git add -f bin/default/librpc/gen_ndr/*.[ch] bin/default/source*/librpc/gen_ndr/...
[metze/samba/wip.git] / bin.gen_ndr / default / librpc / gen_ndr / srv_eventlog6.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * server auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "ntdomain.h"
8 #include "bin/default/librpc/gen_ndr/srv_eventlog6.h"
9
10 static bool api_eventlog6_EvtRpcRegisterRemoteSubscription(struct pipes_struct *p)
11 {
12         const struct ndr_interface_call *call;
13         struct ndr_pull *pull;
14         struct ndr_push *push;
15         enum ndr_err_code ndr_err;
16         struct eventlog6_EvtRpcRegisterRemoteSubscription *r;
17
18         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCREGISTERREMOTESUBSCRIPTION];
19
20         r = talloc(talloc_tos(), struct eventlog6_EvtRpcRegisterRemoteSubscription);
21         if (r == NULL) {
22                 return false;
23         }
24
25         pull = ndr_pull_init_blob(&p->in_data.data, r);
26         if (pull == NULL) {
27                 talloc_free(r);
28                 return false;
29         }
30
31         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
32         if (p->endian) {
33                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
34         }
35         ndr_err = call->ndr_pull(pull, NDR_IN, r);
36         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
37                 talloc_free(r);
38                 return false;
39         }
40
41         if (DEBUGLEVEL >= 10) {
42                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterRemoteSubscription, NDR_IN, r);
43         }
44
45         ZERO_STRUCT(r->out);
46         r->out.handle = talloc_zero(r, struct policy_handle);
47         if (r->out.handle == NULL) {
48                 talloc_free(r);
49                 return false;
50         }
51
52         r->out.control = talloc_zero(r, struct policy_handle);
53         if (r->out.control == NULL) {
54                 talloc_free(r);
55                 return false;
56         }
57
58         r->out.queryChannelInfoSize = talloc_zero(r, uint32_t);
59         if (r->out.queryChannelInfoSize == NULL) {
60                 talloc_free(r);
61                 return false;
62         }
63
64         r->out.queryChannelInfo = talloc_zero(r, struct eventlog6_EvtRpcQueryChannelInfo *);
65         if (r->out.queryChannelInfo == NULL) {
66                 talloc_free(r);
67                 return false;
68         }
69
70         r->out.error = talloc_zero(r, struct eventlog6_RpcInfo);
71         if (r->out.error == NULL) {
72                 talloc_free(r);
73                 return false;
74         }
75
76         r->out.result = _eventlog6_EvtRpcRegisterRemoteSubscription(p, r);
77
78         if (p->fault_state) {
79                 talloc_free(r);
80                 /* Return true here, srv_pipe_hnd.c will take care */
81                 return true;
82         }
83
84         if (DEBUGLEVEL >= 10) {
85                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterRemoteSubscription, NDR_OUT | NDR_SET_VALUES, r);
86         }
87
88         push = ndr_push_init_ctx(r);
89         if (push == NULL) {
90                 talloc_free(r);
91                 return false;
92         }
93
94         /*
95          * carry over the pointer count to the reply in case we are
96          * using full pointer. See NDR specification for full pointers
97          */
98         push->ptr_count = pull->ptr_count;
99
100         ndr_err = call->ndr_push(push, NDR_OUT, r);
101         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
102                 talloc_free(r);
103                 return false;
104         }
105
106         p->out_data.rdata = ndr_push_blob(push);
107         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
108
109         talloc_free(r);
110
111         return true;
112 }
113
114 static bool api_eventlog6_EvtRpcRemoteSubscriptionNextAsync(struct pipes_struct *p)
115 {
116         const struct ndr_interface_call *call;
117         struct ndr_pull *pull;
118         struct ndr_push *push;
119         enum ndr_err_code ndr_err;
120         struct eventlog6_EvtRpcRemoteSubscriptionNextAsync *r;
121
122         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCREMOTESUBSCRIPTIONNEXTASYNC];
123
124         r = talloc(talloc_tos(), struct eventlog6_EvtRpcRemoteSubscriptionNextAsync);
125         if (r == NULL) {
126                 return false;
127         }
128
129         pull = ndr_pull_init_blob(&p->in_data.data, r);
130         if (pull == NULL) {
131                 talloc_free(r);
132                 return false;
133         }
134
135         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
136         if (p->endian) {
137                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
138         }
139         ndr_err = call->ndr_pull(pull, NDR_IN, r);
140         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
141                 talloc_free(r);
142                 return false;
143         }
144
145         if (DEBUGLEVEL >= 10) {
146                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNextAsync, NDR_IN, r);
147         }
148
149         ZERO_STRUCT(r->out);
150         r->out.numActualRecords = talloc_zero(r, uint32_t);
151         if (r->out.numActualRecords == NULL) {
152                 talloc_free(r);
153                 return false;
154         }
155
156         r->out.eventDataIndices = talloc_zero(r, uint32_t *);
157         if (r->out.eventDataIndices == NULL) {
158                 talloc_free(r);
159                 return false;
160         }
161
162         r->out.eventDataSizes = talloc_zero(r, uint32_t *);
163         if (r->out.eventDataSizes == NULL) {
164                 talloc_free(r);
165                 return false;
166         }
167
168         r->out.resultBufferSize = talloc_zero(r, uint32_t);
169         if (r->out.resultBufferSize == NULL) {
170                 talloc_free(r);
171                 return false;
172         }
173
174         r->out.resultBuffer = talloc_zero(r, uint8_t *);
175         if (r->out.resultBuffer == NULL) {
176                 talloc_free(r);
177                 return false;
178         }
179
180         r->out.result = _eventlog6_EvtRpcRemoteSubscriptionNextAsync(p, r);
181
182         if (p->fault_state) {
183                 talloc_free(r);
184                 /* Return true here, srv_pipe_hnd.c will take care */
185                 return true;
186         }
187
188         if (DEBUGLEVEL >= 10) {
189                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNextAsync, NDR_OUT | NDR_SET_VALUES, r);
190         }
191
192         push = ndr_push_init_ctx(r);
193         if (push == NULL) {
194                 talloc_free(r);
195                 return false;
196         }
197
198         /*
199          * carry over the pointer count to the reply in case we are
200          * using full pointer. See NDR specification for full pointers
201          */
202         push->ptr_count = pull->ptr_count;
203
204         ndr_err = call->ndr_push(push, NDR_OUT, r);
205         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
206                 talloc_free(r);
207                 return false;
208         }
209
210         p->out_data.rdata = ndr_push_blob(push);
211         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
212
213         talloc_free(r);
214
215         return true;
216 }
217
218 static bool api_eventlog6_EvtRpcRemoteSubscriptionNext(struct pipes_struct *p)
219 {
220         const struct ndr_interface_call *call;
221         struct ndr_pull *pull;
222         struct ndr_push *push;
223         enum ndr_err_code ndr_err;
224         struct eventlog6_EvtRpcRemoteSubscriptionNext *r;
225
226         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCREMOTESUBSCRIPTIONNEXT];
227
228         r = talloc(talloc_tos(), struct eventlog6_EvtRpcRemoteSubscriptionNext);
229         if (r == NULL) {
230                 return false;
231         }
232
233         pull = ndr_pull_init_blob(&p->in_data.data, r);
234         if (pull == NULL) {
235                 talloc_free(r);
236                 return false;
237         }
238
239         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
240         if (p->endian) {
241                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
242         }
243         ndr_err = call->ndr_pull(pull, NDR_IN, r);
244         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
245                 talloc_free(r);
246                 return false;
247         }
248
249         if (DEBUGLEVEL >= 10) {
250                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNext, NDR_IN, r);
251         }
252
253         ZERO_STRUCT(r->out);
254         r->out.numActualRecords = talloc_zero(r, uint32_t);
255         if (r->out.numActualRecords == NULL) {
256                 talloc_free(r);
257                 return false;
258         }
259
260         r->out.eventDataIndices = talloc_zero(r, uint32_t *);
261         if (r->out.eventDataIndices == NULL) {
262                 talloc_free(r);
263                 return false;
264         }
265
266         r->out.eventDataSizes = talloc_zero(r, uint32_t *);
267         if (r->out.eventDataSizes == NULL) {
268                 talloc_free(r);
269                 return false;
270         }
271
272         r->out.resultBufferSize = talloc_zero(r, uint32_t);
273         if (r->out.resultBufferSize == NULL) {
274                 talloc_free(r);
275                 return false;
276         }
277
278         r->out.resultBuffer = talloc_zero(r, uint8_t *);
279         if (r->out.resultBuffer == NULL) {
280                 talloc_free(r);
281                 return false;
282         }
283
284         r->out.result = _eventlog6_EvtRpcRemoteSubscriptionNext(p, r);
285
286         if (p->fault_state) {
287                 talloc_free(r);
288                 /* Return true here, srv_pipe_hnd.c will take care */
289                 return true;
290         }
291
292         if (DEBUGLEVEL >= 10) {
293                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNext, NDR_OUT | NDR_SET_VALUES, r);
294         }
295
296         push = ndr_push_init_ctx(r);
297         if (push == NULL) {
298                 talloc_free(r);
299                 return false;
300         }
301
302         /*
303          * carry over the pointer count to the reply in case we are
304          * using full pointer. See NDR specification for full pointers
305          */
306         push->ptr_count = pull->ptr_count;
307
308         ndr_err = call->ndr_push(push, NDR_OUT, r);
309         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
310                 talloc_free(r);
311                 return false;
312         }
313
314         p->out_data.rdata = ndr_push_blob(push);
315         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
316
317         talloc_free(r);
318
319         return true;
320 }
321
322 static bool api_eventlog6_EvtRpcRemoteSubscriptionWaitAsync(struct pipes_struct *p)
323 {
324         const struct ndr_interface_call *call;
325         struct ndr_pull *pull;
326         struct ndr_push *push;
327         enum ndr_err_code ndr_err;
328         struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync *r;
329
330         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCREMOTESUBSCRIPTIONWAITASYNC];
331
332         r = talloc(talloc_tos(), struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync);
333         if (r == NULL) {
334                 return false;
335         }
336
337         pull = ndr_pull_init_blob(&p->in_data.data, r);
338         if (pull == NULL) {
339                 talloc_free(r);
340                 return false;
341         }
342
343         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
344         if (p->endian) {
345                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
346         }
347         ndr_err = call->ndr_pull(pull, NDR_IN, r);
348         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
349                 talloc_free(r);
350                 return false;
351         }
352
353         if (DEBUGLEVEL >= 10) {
354                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionWaitAsync, NDR_IN, r);
355         }
356
357         r->out.result = _eventlog6_EvtRpcRemoteSubscriptionWaitAsync(p, r);
358
359         if (p->fault_state) {
360                 talloc_free(r);
361                 /* Return true here, srv_pipe_hnd.c will take care */
362                 return true;
363         }
364
365         if (DEBUGLEVEL >= 10) {
366                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionWaitAsync, NDR_OUT | NDR_SET_VALUES, r);
367         }
368
369         push = ndr_push_init_ctx(r);
370         if (push == NULL) {
371                 talloc_free(r);
372                 return false;
373         }
374
375         /*
376          * carry over the pointer count to the reply in case we are
377          * using full pointer. See NDR specification for full pointers
378          */
379         push->ptr_count = pull->ptr_count;
380
381         ndr_err = call->ndr_push(push, NDR_OUT, r);
382         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
383                 talloc_free(r);
384                 return false;
385         }
386
387         p->out_data.rdata = ndr_push_blob(push);
388         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
389
390         talloc_free(r);
391
392         return true;
393 }
394
395 static bool api_eventlog6_EvtRpcRegisterControllableOperation(struct pipes_struct *p)
396 {
397         const struct ndr_interface_call *call;
398         struct ndr_pull *pull;
399         struct ndr_push *push;
400         enum ndr_err_code ndr_err;
401         struct eventlog6_EvtRpcRegisterControllableOperation *r;
402
403         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCREGISTERCONTROLLABLEOPERATION];
404
405         r = talloc(talloc_tos(), struct eventlog6_EvtRpcRegisterControllableOperation);
406         if (r == NULL) {
407                 return false;
408         }
409
410         pull = ndr_pull_init_blob(&p->in_data.data, r);
411         if (pull == NULL) {
412                 talloc_free(r);
413                 return false;
414         }
415
416         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
417         if (p->endian) {
418                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
419         }
420         ndr_err = call->ndr_pull(pull, NDR_IN, r);
421         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
422                 talloc_free(r);
423                 return false;
424         }
425
426         if (DEBUGLEVEL >= 10) {
427                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterControllableOperation, NDR_IN, r);
428         }
429
430         ZERO_STRUCT(r->out);
431         r->out.handle = talloc_zero(r, struct policy_handle);
432         if (r->out.handle == NULL) {
433                 talloc_free(r);
434                 return false;
435         }
436
437         r->out.result = _eventlog6_EvtRpcRegisterControllableOperation(p, r);
438
439         if (p->fault_state) {
440                 talloc_free(r);
441                 /* Return true here, srv_pipe_hnd.c will take care */
442                 return true;
443         }
444
445         if (DEBUGLEVEL >= 10) {
446                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterControllableOperation, NDR_OUT | NDR_SET_VALUES, r);
447         }
448
449         push = ndr_push_init_ctx(r);
450         if (push == NULL) {
451                 talloc_free(r);
452                 return false;
453         }
454
455         /*
456          * carry over the pointer count to the reply in case we are
457          * using full pointer. See NDR specification for full pointers
458          */
459         push->ptr_count = pull->ptr_count;
460
461         ndr_err = call->ndr_push(push, NDR_OUT, r);
462         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
463                 talloc_free(r);
464                 return false;
465         }
466
467         p->out_data.rdata = ndr_push_blob(push);
468         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
469
470         talloc_free(r);
471
472         return true;
473 }
474
475 static bool api_eventlog6_EvtRpcRegisterLogQuery(struct pipes_struct *p)
476 {
477         const struct ndr_interface_call *call;
478         struct ndr_pull *pull;
479         struct ndr_push *push;
480         enum ndr_err_code ndr_err;
481         struct eventlog6_EvtRpcRegisterLogQuery *r;
482
483         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCREGISTERLOGQUERY];
484
485         r = talloc(talloc_tos(), struct eventlog6_EvtRpcRegisterLogQuery);
486         if (r == NULL) {
487                 return false;
488         }
489
490         pull = ndr_pull_init_blob(&p->in_data.data, r);
491         if (pull == NULL) {
492                 talloc_free(r);
493                 return false;
494         }
495
496         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
497         if (p->endian) {
498                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
499         }
500         ndr_err = call->ndr_pull(pull, NDR_IN, r);
501         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
502                 talloc_free(r);
503                 return false;
504         }
505
506         if (DEBUGLEVEL >= 10) {
507                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterLogQuery, NDR_IN, r);
508         }
509
510         ZERO_STRUCT(r->out);
511         r->out.handle = talloc_zero(r, struct policy_handle);
512         if (r->out.handle == NULL) {
513                 talloc_free(r);
514                 return false;
515         }
516
517         r->out.opControl = talloc_zero(r, struct policy_handle);
518         if (r->out.opControl == NULL) {
519                 talloc_free(r);
520                 return false;
521         }
522
523         r->out.queryChannelInfoSize = talloc_zero(r, uint32_t);
524         if (r->out.queryChannelInfoSize == NULL) {
525                 talloc_free(r);
526                 return false;
527         }
528
529         r->out.queryChannelInfo = talloc_zero(r, struct eventlog6_EvtRpcQueryChannelInfo *);
530         if (r->out.queryChannelInfo == NULL) {
531                 talloc_free(r);
532                 return false;
533         }
534
535         r->out.error = talloc_zero(r, struct eventlog6_RpcInfo);
536         if (r->out.error == NULL) {
537                 talloc_free(r);
538                 return false;
539         }
540
541         r->out.result = _eventlog6_EvtRpcRegisterLogQuery(p, r);
542
543         if (p->fault_state) {
544                 talloc_free(r);
545                 /* Return true here, srv_pipe_hnd.c will take care */
546                 return true;
547         }
548
549         if (DEBUGLEVEL >= 10) {
550                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterLogQuery, NDR_OUT | NDR_SET_VALUES, r);
551         }
552
553         push = ndr_push_init_ctx(r);
554         if (push == NULL) {
555                 talloc_free(r);
556                 return false;
557         }
558
559         /*
560          * carry over the pointer count to the reply in case we are
561          * using full pointer. See NDR specification for full pointers
562          */
563         push->ptr_count = pull->ptr_count;
564
565         ndr_err = call->ndr_push(push, NDR_OUT, r);
566         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
567                 talloc_free(r);
568                 return false;
569         }
570
571         p->out_data.rdata = ndr_push_blob(push);
572         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
573
574         talloc_free(r);
575
576         return true;
577 }
578
579 static bool api_eventlog6_EvtRpcClearLog(struct pipes_struct *p)
580 {
581         const struct ndr_interface_call *call;
582         struct ndr_pull *pull;
583         struct ndr_push *push;
584         enum ndr_err_code ndr_err;
585         struct eventlog6_EvtRpcClearLog *r;
586
587         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCCLEARLOG];
588
589         r = talloc(talloc_tos(), struct eventlog6_EvtRpcClearLog);
590         if (r == NULL) {
591                 return false;
592         }
593
594         pull = ndr_pull_init_blob(&p->in_data.data, r);
595         if (pull == NULL) {
596                 talloc_free(r);
597                 return false;
598         }
599
600         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
601         if (p->endian) {
602                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
603         }
604         ndr_err = call->ndr_pull(pull, NDR_IN, r);
605         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
606                 talloc_free(r);
607                 return false;
608         }
609
610         if (DEBUGLEVEL >= 10) {
611                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClearLog, NDR_IN, r);
612         }
613
614         ZERO_STRUCT(r->out);
615         r->out.error = talloc_zero(r, struct eventlog6_RpcInfo);
616         if (r->out.error == NULL) {
617                 talloc_free(r);
618                 return false;
619         }
620
621         r->out.result = _eventlog6_EvtRpcClearLog(p, r);
622
623         if (p->fault_state) {
624                 talloc_free(r);
625                 /* Return true here, srv_pipe_hnd.c will take care */
626                 return true;
627         }
628
629         if (DEBUGLEVEL >= 10) {
630                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClearLog, NDR_OUT | NDR_SET_VALUES, r);
631         }
632
633         push = ndr_push_init_ctx(r);
634         if (push == NULL) {
635                 talloc_free(r);
636                 return false;
637         }
638
639         /*
640          * carry over the pointer count to the reply in case we are
641          * using full pointer. See NDR specification for full pointers
642          */
643         push->ptr_count = pull->ptr_count;
644
645         ndr_err = call->ndr_push(push, NDR_OUT, r);
646         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
647                 talloc_free(r);
648                 return false;
649         }
650
651         p->out_data.rdata = ndr_push_blob(push);
652         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
653
654         talloc_free(r);
655
656         return true;
657 }
658
659 static bool api_eventlog6_EvtRpcExportLog(struct pipes_struct *p)
660 {
661         const struct ndr_interface_call *call;
662         struct ndr_pull *pull;
663         struct ndr_push *push;
664         enum ndr_err_code ndr_err;
665         struct eventlog6_EvtRpcExportLog *r;
666
667         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCEXPORTLOG];
668
669         r = talloc(talloc_tos(), struct eventlog6_EvtRpcExportLog);
670         if (r == NULL) {
671                 return false;
672         }
673
674         pull = ndr_pull_init_blob(&p->in_data.data, r);
675         if (pull == NULL) {
676                 talloc_free(r);
677                 return false;
678         }
679
680         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
681         if (p->endian) {
682                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
683         }
684         ndr_err = call->ndr_pull(pull, NDR_IN, r);
685         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
686                 talloc_free(r);
687                 return false;
688         }
689
690         if (DEBUGLEVEL >= 10) {
691                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcExportLog, NDR_IN, r);
692         }
693
694         ZERO_STRUCT(r->out);
695         r->out.error = talloc_zero(r, struct eventlog6_RpcInfo);
696         if (r->out.error == NULL) {
697                 talloc_free(r);
698                 return false;
699         }
700
701         r->out.result = _eventlog6_EvtRpcExportLog(p, r);
702
703         if (p->fault_state) {
704                 talloc_free(r);
705                 /* Return true here, srv_pipe_hnd.c will take care */
706                 return true;
707         }
708
709         if (DEBUGLEVEL >= 10) {
710                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcExportLog, NDR_OUT | NDR_SET_VALUES, r);
711         }
712
713         push = ndr_push_init_ctx(r);
714         if (push == NULL) {
715                 talloc_free(r);
716                 return false;
717         }
718
719         /*
720          * carry over the pointer count to the reply in case we are
721          * using full pointer. See NDR specification for full pointers
722          */
723         push->ptr_count = pull->ptr_count;
724
725         ndr_err = call->ndr_push(push, NDR_OUT, r);
726         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
727                 talloc_free(r);
728                 return false;
729         }
730
731         p->out_data.rdata = ndr_push_blob(push);
732         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
733
734         talloc_free(r);
735
736         return true;
737 }
738
739 static bool api_eventlog6_EvtRpcLocalizeExportLog(struct pipes_struct *p)
740 {
741         const struct ndr_interface_call *call;
742         struct ndr_pull *pull;
743         struct ndr_push *push;
744         enum ndr_err_code ndr_err;
745         struct eventlog6_EvtRpcLocalizeExportLog *r;
746
747         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCLOCALIZEEXPORTLOG];
748
749         r = talloc(talloc_tos(), struct eventlog6_EvtRpcLocalizeExportLog);
750         if (r == NULL) {
751                 return false;
752         }
753
754         pull = ndr_pull_init_blob(&p->in_data.data, r);
755         if (pull == NULL) {
756                 talloc_free(r);
757                 return false;
758         }
759
760         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
761         if (p->endian) {
762                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
763         }
764         ndr_err = call->ndr_pull(pull, NDR_IN, r);
765         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
766                 talloc_free(r);
767                 return false;
768         }
769
770         if (DEBUGLEVEL >= 10) {
771                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcLocalizeExportLog, NDR_IN, r);
772         }
773
774         ZERO_STRUCT(r->out);
775         r->out.error = talloc_zero(r, struct eventlog6_RpcInfo);
776         if (r->out.error == NULL) {
777                 talloc_free(r);
778                 return false;
779         }
780
781         r->out.result = _eventlog6_EvtRpcLocalizeExportLog(p, r);
782
783         if (p->fault_state) {
784                 talloc_free(r);
785                 /* Return true here, srv_pipe_hnd.c will take care */
786                 return true;
787         }
788
789         if (DEBUGLEVEL >= 10) {
790                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcLocalizeExportLog, NDR_OUT | NDR_SET_VALUES, r);
791         }
792
793         push = ndr_push_init_ctx(r);
794         if (push == NULL) {
795                 talloc_free(r);
796                 return false;
797         }
798
799         /*
800          * carry over the pointer count to the reply in case we are
801          * using full pointer. See NDR specification for full pointers
802          */
803         push->ptr_count = pull->ptr_count;
804
805         ndr_err = call->ndr_push(push, NDR_OUT, r);
806         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
807                 talloc_free(r);
808                 return false;
809         }
810
811         p->out_data.rdata = ndr_push_blob(push);
812         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
813
814         talloc_free(r);
815
816         return true;
817 }
818
819 static bool api_eventlog6_EvtRpcMessageRender(struct pipes_struct *p)
820 {
821         const struct ndr_interface_call *call;
822         struct ndr_pull *pull;
823         struct ndr_push *push;
824         enum ndr_err_code ndr_err;
825         struct eventlog6_EvtRpcMessageRender *r;
826
827         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCMESSAGERENDER];
828
829         r = talloc(talloc_tos(), struct eventlog6_EvtRpcMessageRender);
830         if (r == NULL) {
831                 return false;
832         }
833
834         pull = ndr_pull_init_blob(&p->in_data.data, r);
835         if (pull == NULL) {
836                 talloc_free(r);
837                 return false;
838         }
839
840         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
841         if (p->endian) {
842                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
843         }
844         ndr_err = call->ndr_pull(pull, NDR_IN, r);
845         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
846                 talloc_free(r);
847                 return false;
848         }
849
850         if (DEBUGLEVEL >= 10) {
851                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRender, NDR_IN, r);
852         }
853
854         ZERO_STRUCT(r->out);
855         r->out.actualSizeString = talloc_zero(r, uint32_t);
856         if (r->out.actualSizeString == NULL) {
857                 talloc_free(r);
858                 return false;
859         }
860
861         r->out.neededSizeString = talloc_zero(r, uint32_t);
862         if (r->out.neededSizeString == NULL) {
863                 talloc_free(r);
864                 return false;
865         }
866
867         r->out.string = talloc_zero(r, uint8_t *);
868         if (r->out.string == NULL) {
869                 talloc_free(r);
870                 return false;
871         }
872
873         r->out.error = talloc_zero(r, struct eventlog6_RpcInfo);
874         if (r->out.error == NULL) {
875                 talloc_free(r);
876                 return false;
877         }
878
879         r->out.result = _eventlog6_EvtRpcMessageRender(p, r);
880
881         if (p->fault_state) {
882                 talloc_free(r);
883                 /* Return true here, srv_pipe_hnd.c will take care */
884                 return true;
885         }
886
887         if (DEBUGLEVEL >= 10) {
888                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRender, NDR_OUT | NDR_SET_VALUES, r);
889         }
890
891         push = ndr_push_init_ctx(r);
892         if (push == NULL) {
893                 talloc_free(r);
894                 return false;
895         }
896
897         /*
898          * carry over the pointer count to the reply in case we are
899          * using full pointer. See NDR specification for full pointers
900          */
901         push->ptr_count = pull->ptr_count;
902
903         ndr_err = call->ndr_push(push, NDR_OUT, r);
904         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
905                 talloc_free(r);
906                 return false;
907         }
908
909         p->out_data.rdata = ndr_push_blob(push);
910         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
911
912         talloc_free(r);
913
914         return true;
915 }
916
917 static bool api_eventlog6_EvtRpcMessageRenderDefault(struct pipes_struct *p)
918 {
919         const struct ndr_interface_call *call;
920         struct ndr_pull *pull;
921         struct ndr_push *push;
922         enum ndr_err_code ndr_err;
923         struct eventlog6_EvtRpcMessageRenderDefault *r;
924
925         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCMESSAGERENDERDEFAULT];
926
927         r = talloc(talloc_tos(), struct eventlog6_EvtRpcMessageRenderDefault);
928         if (r == NULL) {
929                 return false;
930         }
931
932         pull = ndr_pull_init_blob(&p->in_data.data, r);
933         if (pull == NULL) {
934                 talloc_free(r);
935                 return false;
936         }
937
938         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
939         if (p->endian) {
940                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
941         }
942         ndr_err = call->ndr_pull(pull, NDR_IN, r);
943         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
944                 talloc_free(r);
945                 return false;
946         }
947
948         if (DEBUGLEVEL >= 10) {
949                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRenderDefault, NDR_IN, r);
950         }
951
952         ZERO_STRUCT(r->out);
953         r->out.actualSizeString = talloc_zero(r, uint32_t);
954         if (r->out.actualSizeString == NULL) {
955                 talloc_free(r);
956                 return false;
957         }
958
959         r->out.neededSizeString = talloc_zero(r, uint32_t);
960         if (r->out.neededSizeString == NULL) {
961                 talloc_free(r);
962                 return false;
963         }
964
965         r->out.string = talloc_zero(r, uint8_t *);
966         if (r->out.string == NULL) {
967                 talloc_free(r);
968                 return false;
969         }
970
971         r->out.error = talloc_zero(r, struct eventlog6_RpcInfo);
972         if (r->out.error == NULL) {
973                 talloc_free(r);
974                 return false;
975         }
976
977         r->out.result = _eventlog6_EvtRpcMessageRenderDefault(p, r);
978
979         if (p->fault_state) {
980                 talloc_free(r);
981                 /* Return true here, srv_pipe_hnd.c will take care */
982                 return true;
983         }
984
985         if (DEBUGLEVEL >= 10) {
986                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRenderDefault, NDR_OUT | NDR_SET_VALUES, r);
987         }
988
989         push = ndr_push_init_ctx(r);
990         if (push == NULL) {
991                 talloc_free(r);
992                 return false;
993         }
994
995         /*
996          * carry over the pointer count to the reply in case we are
997          * using full pointer. See NDR specification for full pointers
998          */
999         push->ptr_count = pull->ptr_count;
1000
1001         ndr_err = call->ndr_push(push, NDR_OUT, r);
1002         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1003                 talloc_free(r);
1004                 return false;
1005         }
1006
1007         p->out_data.rdata = ndr_push_blob(push);
1008         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1009
1010         talloc_free(r);
1011
1012         return true;
1013 }
1014
1015 static bool api_eventlog6_EvtRpcQueryNext(struct pipes_struct *p)
1016 {
1017         const struct ndr_interface_call *call;
1018         struct ndr_pull *pull;
1019         struct ndr_push *push;
1020         enum ndr_err_code ndr_err;
1021         struct eventlog6_EvtRpcQueryNext *r;
1022
1023         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCQUERYNEXT];
1024
1025         r = talloc(talloc_tos(), struct eventlog6_EvtRpcQueryNext);
1026         if (r == NULL) {
1027                 return false;
1028         }
1029
1030         pull = ndr_pull_init_blob(&p->in_data.data, r);
1031         if (pull == NULL) {
1032                 talloc_free(r);
1033                 return false;
1034         }
1035
1036         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1037         if (p->endian) {
1038                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1039         }
1040         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1041         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1042                 talloc_free(r);
1043                 return false;
1044         }
1045
1046         if (DEBUGLEVEL >= 10) {
1047                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQueryNext, NDR_IN, r);
1048         }
1049
1050         ZERO_STRUCT(r->out);
1051         r->out.numActualRecords = talloc_zero(r, uint32_t);
1052         if (r->out.numActualRecords == NULL) {
1053                 talloc_free(r);
1054                 return false;
1055         }
1056
1057         r->out.eventDataIndices = talloc_zero(r, uint32_t *);
1058         if (r->out.eventDataIndices == NULL) {
1059                 talloc_free(r);
1060                 return false;
1061         }
1062
1063         r->out.eventDataSizes = talloc_zero(r, uint32_t *);
1064         if (r->out.eventDataSizes == NULL) {
1065                 talloc_free(r);
1066                 return false;
1067         }
1068
1069         r->out.resultBufferSize = talloc_zero(r, uint32_t);
1070         if (r->out.resultBufferSize == NULL) {
1071                 talloc_free(r);
1072                 return false;
1073         }
1074
1075         r->out.resultBuffer = talloc_zero(r, uint8_t *);
1076         if (r->out.resultBuffer == NULL) {
1077                 talloc_free(r);
1078                 return false;
1079         }
1080
1081         r->out.result = _eventlog6_EvtRpcQueryNext(p, r);
1082
1083         if (p->fault_state) {
1084                 talloc_free(r);
1085                 /* Return true here, srv_pipe_hnd.c will take care */
1086                 return true;
1087         }
1088
1089         if (DEBUGLEVEL >= 10) {
1090                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQueryNext, NDR_OUT | NDR_SET_VALUES, r);
1091         }
1092
1093         push = ndr_push_init_ctx(r);
1094         if (push == NULL) {
1095                 talloc_free(r);
1096                 return false;
1097         }
1098
1099         /*
1100          * carry over the pointer count to the reply in case we are
1101          * using full pointer. See NDR specification for full pointers
1102          */
1103         push->ptr_count = pull->ptr_count;
1104
1105         ndr_err = call->ndr_push(push, NDR_OUT, r);
1106         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1107                 talloc_free(r);
1108                 return false;
1109         }
1110
1111         p->out_data.rdata = ndr_push_blob(push);
1112         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1113
1114         talloc_free(r);
1115
1116         return true;
1117 }
1118
1119 static bool api_eventlog6_EvtRpcQuerySeek(struct pipes_struct *p)
1120 {
1121         const struct ndr_interface_call *call;
1122         struct ndr_pull *pull;
1123         struct ndr_push *push;
1124         enum ndr_err_code ndr_err;
1125         struct eventlog6_EvtRpcQuerySeek *r;
1126
1127         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCQUERYSEEK];
1128
1129         r = talloc(talloc_tos(), struct eventlog6_EvtRpcQuerySeek);
1130         if (r == NULL) {
1131                 return false;
1132         }
1133
1134         pull = ndr_pull_init_blob(&p->in_data.data, r);
1135         if (pull == NULL) {
1136                 talloc_free(r);
1137                 return false;
1138         }
1139
1140         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1141         if (p->endian) {
1142                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1143         }
1144         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1145         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1146                 talloc_free(r);
1147                 return false;
1148         }
1149
1150         if (DEBUGLEVEL >= 10) {
1151                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQuerySeek, NDR_IN, r);
1152         }
1153
1154         ZERO_STRUCT(r->out);
1155         r->out.error = talloc_zero(r, struct eventlog6_RpcInfo);
1156         if (r->out.error == NULL) {
1157                 talloc_free(r);
1158                 return false;
1159         }
1160
1161         r->out.result = _eventlog6_EvtRpcQuerySeek(p, r);
1162
1163         if (p->fault_state) {
1164                 talloc_free(r);
1165                 /* Return true here, srv_pipe_hnd.c will take care */
1166                 return true;
1167         }
1168
1169         if (DEBUGLEVEL >= 10) {
1170                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQuerySeek, NDR_OUT | NDR_SET_VALUES, r);
1171         }
1172
1173         push = ndr_push_init_ctx(r);
1174         if (push == NULL) {
1175                 talloc_free(r);
1176                 return false;
1177         }
1178
1179         /*
1180          * carry over the pointer count to the reply in case we are
1181          * using full pointer. See NDR specification for full pointers
1182          */
1183         push->ptr_count = pull->ptr_count;
1184
1185         ndr_err = call->ndr_push(push, NDR_OUT, r);
1186         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1187                 talloc_free(r);
1188                 return false;
1189         }
1190
1191         p->out_data.rdata = ndr_push_blob(push);
1192         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1193
1194         talloc_free(r);
1195
1196         return true;
1197 }
1198
1199 static bool api_eventlog6_EvtRpcClose(struct pipes_struct *p)
1200 {
1201         const struct ndr_interface_call *call;
1202         struct ndr_pull *pull;
1203         struct ndr_push *push;
1204         enum ndr_err_code ndr_err;
1205         struct eventlog6_EvtRpcClose *r;
1206
1207         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCCLOSE];
1208
1209         r = talloc(talloc_tos(), struct eventlog6_EvtRpcClose);
1210         if (r == NULL) {
1211                 return false;
1212         }
1213
1214         pull = ndr_pull_init_blob(&p->in_data.data, r);
1215         if (pull == NULL) {
1216                 talloc_free(r);
1217                 return false;
1218         }
1219
1220         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1221         if (p->endian) {
1222                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1223         }
1224         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1225         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1226                 talloc_free(r);
1227                 return false;
1228         }
1229
1230         if (DEBUGLEVEL >= 10) {
1231                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClose, NDR_IN, r);
1232         }
1233
1234         ZERO_STRUCT(r->out);
1235         r->out.handle = r->in.handle;
1236         r->out.result = _eventlog6_EvtRpcClose(p, r);
1237
1238         if (p->fault_state) {
1239                 talloc_free(r);
1240                 /* Return true here, srv_pipe_hnd.c will take care */
1241                 return true;
1242         }
1243
1244         if (DEBUGLEVEL >= 10) {
1245                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClose, NDR_OUT | NDR_SET_VALUES, r);
1246         }
1247
1248         push = ndr_push_init_ctx(r);
1249         if (push == NULL) {
1250                 talloc_free(r);
1251                 return false;
1252         }
1253
1254         /*
1255          * carry over the pointer count to the reply in case we are
1256          * using full pointer. See NDR specification for full pointers
1257          */
1258         push->ptr_count = pull->ptr_count;
1259
1260         ndr_err = call->ndr_push(push, NDR_OUT, r);
1261         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1262                 talloc_free(r);
1263                 return false;
1264         }
1265
1266         p->out_data.rdata = ndr_push_blob(push);
1267         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1268
1269         talloc_free(r);
1270
1271         return true;
1272 }
1273
1274 static bool api_eventlog6_EvtRpcCancel(struct pipes_struct *p)
1275 {
1276         const struct ndr_interface_call *call;
1277         struct ndr_pull *pull;
1278         struct ndr_push *push;
1279         enum ndr_err_code ndr_err;
1280         struct eventlog6_EvtRpcCancel *r;
1281
1282         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCCANCEL];
1283
1284         r = talloc(talloc_tos(), struct eventlog6_EvtRpcCancel);
1285         if (r == NULL) {
1286                 return false;
1287         }
1288
1289         pull = ndr_pull_init_blob(&p->in_data.data, r);
1290         if (pull == NULL) {
1291                 talloc_free(r);
1292                 return false;
1293         }
1294
1295         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1296         if (p->endian) {
1297                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1298         }
1299         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1300         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1301                 talloc_free(r);
1302                 return false;
1303         }
1304
1305         if (DEBUGLEVEL >= 10) {
1306                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcCancel, NDR_IN, r);
1307         }
1308
1309         r->out.result = _eventlog6_EvtRpcCancel(p, r);
1310
1311         if (p->fault_state) {
1312                 talloc_free(r);
1313                 /* Return true here, srv_pipe_hnd.c will take care */
1314                 return true;
1315         }
1316
1317         if (DEBUGLEVEL >= 10) {
1318                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcCancel, NDR_OUT | NDR_SET_VALUES, r);
1319         }
1320
1321         push = ndr_push_init_ctx(r);
1322         if (push == NULL) {
1323                 talloc_free(r);
1324                 return false;
1325         }
1326
1327         /*
1328          * carry over the pointer count to the reply in case we are
1329          * using full pointer. See NDR specification for full pointers
1330          */
1331         push->ptr_count = pull->ptr_count;
1332
1333         ndr_err = call->ndr_push(push, NDR_OUT, r);
1334         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1335                 talloc_free(r);
1336                 return false;
1337         }
1338
1339         p->out_data.rdata = ndr_push_blob(push);
1340         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1341
1342         talloc_free(r);
1343
1344         return true;
1345 }
1346
1347 static bool api_eventlog6_EvtRpcAssertConfig(struct pipes_struct *p)
1348 {
1349         const struct ndr_interface_call *call;
1350         struct ndr_pull *pull;
1351         struct ndr_push *push;
1352         enum ndr_err_code ndr_err;
1353         struct eventlog6_EvtRpcAssertConfig *r;
1354
1355         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCASSERTCONFIG];
1356
1357         r = talloc(talloc_tos(), struct eventlog6_EvtRpcAssertConfig);
1358         if (r == NULL) {
1359                 return false;
1360         }
1361
1362         pull = ndr_pull_init_blob(&p->in_data.data, r);
1363         if (pull == NULL) {
1364                 talloc_free(r);
1365                 return false;
1366         }
1367
1368         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1369         if (p->endian) {
1370                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1371         }
1372         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1373         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1374                 talloc_free(r);
1375                 return false;
1376         }
1377
1378         if (DEBUGLEVEL >= 10) {
1379                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcAssertConfig, NDR_IN, r);
1380         }
1381
1382         r->out.result = _eventlog6_EvtRpcAssertConfig(p, r);
1383
1384         if (p->fault_state) {
1385                 talloc_free(r);
1386                 /* Return true here, srv_pipe_hnd.c will take care */
1387                 return true;
1388         }
1389
1390         if (DEBUGLEVEL >= 10) {
1391                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcAssertConfig, NDR_OUT | NDR_SET_VALUES, r);
1392         }
1393
1394         push = ndr_push_init_ctx(r);
1395         if (push == NULL) {
1396                 talloc_free(r);
1397                 return false;
1398         }
1399
1400         /*
1401          * carry over the pointer count to the reply in case we are
1402          * using full pointer. See NDR specification for full pointers
1403          */
1404         push->ptr_count = pull->ptr_count;
1405
1406         ndr_err = call->ndr_push(push, NDR_OUT, r);
1407         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1408                 talloc_free(r);
1409                 return false;
1410         }
1411
1412         p->out_data.rdata = ndr_push_blob(push);
1413         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1414
1415         talloc_free(r);
1416
1417         return true;
1418 }
1419
1420 static bool api_eventlog6_EvtRpcRetractConfig(struct pipes_struct *p)
1421 {
1422         const struct ndr_interface_call *call;
1423         struct ndr_pull *pull;
1424         struct ndr_push *push;
1425         enum ndr_err_code ndr_err;
1426         struct eventlog6_EvtRpcRetractConfig *r;
1427
1428         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCRETRACTCONFIG];
1429
1430         r = talloc(talloc_tos(), struct eventlog6_EvtRpcRetractConfig);
1431         if (r == NULL) {
1432                 return false;
1433         }
1434
1435         pull = ndr_pull_init_blob(&p->in_data.data, r);
1436         if (pull == NULL) {
1437                 talloc_free(r);
1438                 return false;
1439         }
1440
1441         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1442         if (p->endian) {
1443                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1444         }
1445         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1446         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1447                 talloc_free(r);
1448                 return false;
1449         }
1450
1451         if (DEBUGLEVEL >= 10) {
1452                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRetractConfig, NDR_IN, r);
1453         }
1454
1455         r->out.result = _eventlog6_EvtRpcRetractConfig(p, r);
1456
1457         if (p->fault_state) {
1458                 talloc_free(r);
1459                 /* Return true here, srv_pipe_hnd.c will take care */
1460                 return true;
1461         }
1462
1463         if (DEBUGLEVEL >= 10) {
1464                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRetractConfig, NDR_OUT | NDR_SET_VALUES, r);
1465         }
1466
1467         push = ndr_push_init_ctx(r);
1468         if (push == NULL) {
1469                 talloc_free(r);
1470                 return false;
1471         }
1472
1473         /*
1474          * carry over the pointer count to the reply in case we are
1475          * using full pointer. See NDR specification for full pointers
1476          */
1477         push->ptr_count = pull->ptr_count;
1478
1479         ndr_err = call->ndr_push(push, NDR_OUT, r);
1480         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1481                 talloc_free(r);
1482                 return false;
1483         }
1484
1485         p->out_data.rdata = ndr_push_blob(push);
1486         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1487
1488         talloc_free(r);
1489
1490         return true;
1491 }
1492
1493 static bool api_eventlog6_EvtRpcOpenLogHandle(struct pipes_struct *p)
1494 {
1495         const struct ndr_interface_call *call;
1496         struct ndr_pull *pull;
1497         struct ndr_push *push;
1498         enum ndr_err_code ndr_err;
1499         struct eventlog6_EvtRpcOpenLogHandle *r;
1500
1501         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCOPENLOGHANDLE];
1502
1503         r = talloc(talloc_tos(), struct eventlog6_EvtRpcOpenLogHandle);
1504         if (r == NULL) {
1505                 return false;
1506         }
1507
1508         pull = ndr_pull_init_blob(&p->in_data.data, r);
1509         if (pull == NULL) {
1510                 talloc_free(r);
1511                 return false;
1512         }
1513
1514         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1515         if (p->endian) {
1516                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1517         }
1518         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1519         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1520                 talloc_free(r);
1521                 return false;
1522         }
1523
1524         if (DEBUGLEVEL >= 10) {
1525                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcOpenLogHandle, NDR_IN, r);
1526         }
1527
1528         ZERO_STRUCT(r->out);
1529         r->out.handle = talloc_zero(r, struct policy_handle);
1530         if (r->out.handle == NULL) {
1531                 talloc_free(r);
1532                 return false;
1533         }
1534
1535         r->out.error = talloc_zero(r, struct eventlog6_RpcInfo);
1536         if (r->out.error == NULL) {
1537                 talloc_free(r);
1538                 return false;
1539         }
1540
1541         r->out.result = _eventlog6_EvtRpcOpenLogHandle(p, r);
1542
1543         if (p->fault_state) {
1544                 talloc_free(r);
1545                 /* Return true here, srv_pipe_hnd.c will take care */
1546                 return true;
1547         }
1548
1549         if (DEBUGLEVEL >= 10) {
1550                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcOpenLogHandle, NDR_OUT | NDR_SET_VALUES, r);
1551         }
1552
1553         push = ndr_push_init_ctx(r);
1554         if (push == NULL) {
1555                 talloc_free(r);
1556                 return false;
1557         }
1558
1559         /*
1560          * carry over the pointer count to the reply in case we are
1561          * using full pointer. See NDR specification for full pointers
1562          */
1563         push->ptr_count = pull->ptr_count;
1564
1565         ndr_err = call->ndr_push(push, NDR_OUT, r);
1566         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1567                 talloc_free(r);
1568                 return false;
1569         }
1570
1571         p->out_data.rdata = ndr_push_blob(push);
1572         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1573
1574         talloc_free(r);
1575
1576         return true;
1577 }
1578
1579 static bool api_eventlog6_EvtRpcGetLogFileInfo(struct pipes_struct *p)
1580 {
1581         const struct ndr_interface_call *call;
1582         struct ndr_pull *pull;
1583         struct ndr_push *push;
1584         enum ndr_err_code ndr_err;
1585         struct eventlog6_EvtRpcGetLogFileInfo *r;
1586
1587         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCGETLOGFILEINFO];
1588
1589         r = talloc(talloc_tos(), struct eventlog6_EvtRpcGetLogFileInfo);
1590         if (r == NULL) {
1591                 return false;
1592         }
1593
1594         pull = ndr_pull_init_blob(&p->in_data.data, r);
1595         if (pull == NULL) {
1596                 talloc_free(r);
1597                 return false;
1598         }
1599
1600         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1601         if (p->endian) {
1602                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1603         }
1604         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1605         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1606                 talloc_free(r);
1607                 return false;
1608         }
1609
1610         if (DEBUGLEVEL >= 10) {
1611                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetLogFileInfo, NDR_IN, r);
1612         }
1613
1614         ZERO_STRUCT(r->out);
1615         r->out.propertyValueBuffer = talloc_zero_array(r, uint8_t, r->in.propertyValueBufferSize);
1616         if (r->out.propertyValueBuffer == NULL) {
1617                 talloc_free(r);
1618                 return false;
1619         }
1620
1621         r->out.propertyValueBufferLength = talloc_zero(r, uint32_t);
1622         if (r->out.propertyValueBufferLength == NULL) {
1623                 talloc_free(r);
1624                 return false;
1625         }
1626
1627         r->out.result = _eventlog6_EvtRpcGetLogFileInfo(p, r);
1628
1629         if (p->fault_state) {
1630                 talloc_free(r);
1631                 /* Return true here, srv_pipe_hnd.c will take care */
1632                 return true;
1633         }
1634
1635         if (DEBUGLEVEL >= 10) {
1636                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetLogFileInfo, NDR_OUT | NDR_SET_VALUES, r);
1637         }
1638
1639         push = ndr_push_init_ctx(r);
1640         if (push == NULL) {
1641                 talloc_free(r);
1642                 return false;
1643         }
1644
1645         /*
1646          * carry over the pointer count to the reply in case we are
1647          * using full pointer. See NDR specification for full pointers
1648          */
1649         push->ptr_count = pull->ptr_count;
1650
1651         ndr_err = call->ndr_push(push, NDR_OUT, r);
1652         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1653                 talloc_free(r);
1654                 return false;
1655         }
1656
1657         p->out_data.rdata = ndr_push_blob(push);
1658         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1659
1660         talloc_free(r);
1661
1662         return true;
1663 }
1664
1665 static bool api_eventlog6_EvtRpcGetChannelList(struct pipes_struct *p)
1666 {
1667         const struct ndr_interface_call *call;
1668         struct ndr_pull *pull;
1669         struct ndr_push *push;
1670         enum ndr_err_code ndr_err;
1671         struct eventlog6_EvtRpcGetChannelList *r;
1672
1673         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCGETCHANNELLIST];
1674
1675         r = talloc(talloc_tos(), struct eventlog6_EvtRpcGetChannelList);
1676         if (r == NULL) {
1677                 return false;
1678         }
1679
1680         pull = ndr_pull_init_blob(&p->in_data.data, r);
1681         if (pull == NULL) {
1682                 talloc_free(r);
1683                 return false;
1684         }
1685
1686         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1687         if (p->endian) {
1688                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1689         }
1690         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1691         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1692                 talloc_free(r);
1693                 return false;
1694         }
1695
1696         if (DEBUGLEVEL >= 10) {
1697                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelList, NDR_IN, r);
1698         }
1699
1700         ZERO_STRUCT(r->out);
1701         r->out.numChannelPaths = talloc_zero(r, uint32_t);
1702         if (r->out.numChannelPaths == NULL) {
1703                 talloc_free(r);
1704                 return false;
1705         }
1706
1707         r->out.channelPaths = talloc_zero(r, const char **);
1708         if (r->out.channelPaths == NULL) {
1709                 talloc_free(r);
1710                 return false;
1711         }
1712
1713         r->out.result = _eventlog6_EvtRpcGetChannelList(p, r);
1714
1715         if (p->fault_state) {
1716                 talloc_free(r);
1717                 /* Return true here, srv_pipe_hnd.c will take care */
1718                 return true;
1719         }
1720
1721         if (DEBUGLEVEL >= 10) {
1722                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelList, NDR_OUT | NDR_SET_VALUES, r);
1723         }
1724
1725         push = ndr_push_init_ctx(r);
1726         if (push == NULL) {
1727                 talloc_free(r);
1728                 return false;
1729         }
1730
1731         /*
1732          * carry over the pointer count to the reply in case we are
1733          * using full pointer. See NDR specification for full pointers
1734          */
1735         push->ptr_count = pull->ptr_count;
1736
1737         ndr_err = call->ndr_push(push, NDR_OUT, r);
1738         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1739                 talloc_free(r);
1740                 return false;
1741         }
1742
1743         p->out_data.rdata = ndr_push_blob(push);
1744         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1745
1746         talloc_free(r);
1747
1748         return true;
1749 }
1750
1751 static bool api_eventlog6_EvtRpcGetChannelConfig(struct pipes_struct *p)
1752 {
1753         const struct ndr_interface_call *call;
1754         struct ndr_pull *pull;
1755         struct ndr_push *push;
1756         enum ndr_err_code ndr_err;
1757         struct eventlog6_EvtRpcGetChannelConfig *r;
1758
1759         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCGETCHANNELCONFIG];
1760
1761         r = talloc(talloc_tos(), struct eventlog6_EvtRpcGetChannelConfig);
1762         if (r == NULL) {
1763                 return false;
1764         }
1765
1766         pull = ndr_pull_init_blob(&p->in_data.data, r);
1767         if (pull == NULL) {
1768                 talloc_free(r);
1769                 return false;
1770         }
1771
1772         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1773         if (p->endian) {
1774                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1775         }
1776         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1777         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1778                 talloc_free(r);
1779                 return false;
1780         }
1781
1782         if (DEBUGLEVEL >= 10) {
1783                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelConfig, NDR_IN, r);
1784         }
1785
1786         ZERO_STRUCT(r->out);
1787         r->out.props = talloc_zero(r, struct eventlog6_EvtRpcVariantList);
1788         if (r->out.props == NULL) {
1789                 talloc_free(r);
1790                 return false;
1791         }
1792
1793         r->out.result = _eventlog6_EvtRpcGetChannelConfig(p, r);
1794
1795         if (p->fault_state) {
1796                 talloc_free(r);
1797                 /* Return true here, srv_pipe_hnd.c will take care */
1798                 return true;
1799         }
1800
1801         if (DEBUGLEVEL >= 10) {
1802                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelConfig, NDR_OUT | NDR_SET_VALUES, r);
1803         }
1804
1805         push = ndr_push_init_ctx(r);
1806         if (push == NULL) {
1807                 talloc_free(r);
1808                 return false;
1809         }
1810
1811         /*
1812          * carry over the pointer count to the reply in case we are
1813          * using full pointer. See NDR specification for full pointers
1814          */
1815         push->ptr_count = pull->ptr_count;
1816
1817         ndr_err = call->ndr_push(push, NDR_OUT, r);
1818         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1819                 talloc_free(r);
1820                 return false;
1821         }
1822
1823         p->out_data.rdata = ndr_push_blob(push);
1824         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1825
1826         talloc_free(r);
1827
1828         return true;
1829 }
1830
1831 static bool api_eventlog6_EvtRpcPutChannelConfig(struct pipes_struct *p)
1832 {
1833         const struct ndr_interface_call *call;
1834         struct ndr_pull *pull;
1835         struct ndr_push *push;
1836         enum ndr_err_code ndr_err;
1837         struct eventlog6_EvtRpcPutChannelConfig *r;
1838
1839         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCPUTCHANNELCONFIG];
1840
1841         r = talloc(talloc_tos(), struct eventlog6_EvtRpcPutChannelConfig);
1842         if (r == NULL) {
1843                 return false;
1844         }
1845
1846         pull = ndr_pull_init_blob(&p->in_data.data, r);
1847         if (pull == NULL) {
1848                 talloc_free(r);
1849                 return false;
1850         }
1851
1852         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1853         if (p->endian) {
1854                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1855         }
1856         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1857         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1858                 talloc_free(r);
1859                 return false;
1860         }
1861
1862         if (DEBUGLEVEL >= 10) {
1863                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcPutChannelConfig, NDR_IN, r);
1864         }
1865
1866         ZERO_STRUCT(r->out);
1867         r->out.error = talloc_zero(r, struct eventlog6_RpcInfo);
1868         if (r->out.error == NULL) {
1869                 talloc_free(r);
1870                 return false;
1871         }
1872
1873         r->out.result = _eventlog6_EvtRpcPutChannelConfig(p, r);
1874
1875         if (p->fault_state) {
1876                 talloc_free(r);
1877                 /* Return true here, srv_pipe_hnd.c will take care */
1878                 return true;
1879         }
1880
1881         if (DEBUGLEVEL >= 10) {
1882                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcPutChannelConfig, NDR_OUT | NDR_SET_VALUES, r);
1883         }
1884
1885         push = ndr_push_init_ctx(r);
1886         if (push == NULL) {
1887                 talloc_free(r);
1888                 return false;
1889         }
1890
1891         /*
1892          * carry over the pointer count to the reply in case we are
1893          * using full pointer. See NDR specification for full pointers
1894          */
1895         push->ptr_count = pull->ptr_count;
1896
1897         ndr_err = call->ndr_push(push, NDR_OUT, r);
1898         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1899                 talloc_free(r);
1900                 return false;
1901         }
1902
1903         p->out_data.rdata = ndr_push_blob(push);
1904         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1905
1906         talloc_free(r);
1907
1908         return true;
1909 }
1910
1911 static bool api_eventlog6_EvtRpcGetPublisherList(struct pipes_struct *p)
1912 {
1913         const struct ndr_interface_call *call;
1914         struct ndr_pull *pull;
1915         struct ndr_push *push;
1916         enum ndr_err_code ndr_err;
1917         struct eventlog6_EvtRpcGetPublisherList *r;
1918
1919         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCGETPUBLISHERLIST];
1920
1921         r = talloc(talloc_tos(), struct eventlog6_EvtRpcGetPublisherList);
1922         if (r == NULL) {
1923                 return false;
1924         }
1925
1926         pull = ndr_pull_init_blob(&p->in_data.data, r);
1927         if (pull == NULL) {
1928                 talloc_free(r);
1929                 return false;
1930         }
1931
1932         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1933         if (p->endian) {
1934                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1935         }
1936         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1937         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1938                 talloc_free(r);
1939                 return false;
1940         }
1941
1942         if (DEBUGLEVEL >= 10) {
1943                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherList, NDR_IN, r);
1944         }
1945
1946         ZERO_STRUCT(r->out);
1947         r->out.numPublisherIds = talloc_zero(r, uint32_t);
1948         if (r->out.numPublisherIds == NULL) {
1949                 talloc_free(r);
1950                 return false;
1951         }
1952
1953         r->out.publisherIds = talloc_zero(r, const char **);
1954         if (r->out.publisherIds == NULL) {
1955                 talloc_free(r);
1956                 return false;
1957         }
1958
1959         r->out.result = _eventlog6_EvtRpcGetPublisherList(p, r);
1960
1961         if (p->fault_state) {
1962                 talloc_free(r);
1963                 /* Return true here, srv_pipe_hnd.c will take care */
1964                 return true;
1965         }
1966
1967         if (DEBUGLEVEL >= 10) {
1968                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherList, NDR_OUT | NDR_SET_VALUES, r);
1969         }
1970
1971         push = ndr_push_init_ctx(r);
1972         if (push == NULL) {
1973                 talloc_free(r);
1974                 return false;
1975         }
1976
1977         /*
1978          * carry over the pointer count to the reply in case we are
1979          * using full pointer. See NDR specification for full pointers
1980          */
1981         push->ptr_count = pull->ptr_count;
1982
1983         ndr_err = call->ndr_push(push, NDR_OUT, r);
1984         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1985                 talloc_free(r);
1986                 return false;
1987         }
1988
1989         p->out_data.rdata = ndr_push_blob(push);
1990         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1991
1992         talloc_free(r);
1993
1994         return true;
1995 }
1996
1997 static bool api_eventlog6_EvtRpcGetPublisherListForChannel(struct pipes_struct *p)
1998 {
1999         const struct ndr_interface_call *call;
2000         struct ndr_pull *pull;
2001         struct ndr_push *push;
2002         enum ndr_err_code ndr_err;
2003         struct eventlog6_EvtRpcGetPublisherListForChannel *r;
2004
2005         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCGETPUBLISHERLISTFORCHANNEL];
2006
2007         r = talloc(talloc_tos(), struct eventlog6_EvtRpcGetPublisherListForChannel);
2008         if (r == NULL) {
2009                 return false;
2010         }
2011
2012         pull = ndr_pull_init_blob(&p->in_data.data, r);
2013         if (pull == NULL) {
2014                 talloc_free(r);
2015                 return false;
2016         }
2017
2018         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2019         if (p->endian) {
2020                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2021         }
2022         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2023         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2024                 talloc_free(r);
2025                 return false;
2026         }
2027
2028         if (DEBUGLEVEL >= 10) {
2029                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherListForChannel, NDR_IN, r);
2030         }
2031
2032         ZERO_STRUCT(r->out);
2033         r->out.numPublisherIds = talloc_zero(r, uint32_t);
2034         if (r->out.numPublisherIds == NULL) {
2035                 talloc_free(r);
2036                 return false;
2037         }
2038
2039         r->out.publisherIds = talloc_zero(r, const char **);
2040         if (r->out.publisherIds == NULL) {
2041                 talloc_free(r);
2042                 return false;
2043         }
2044
2045         r->out.result = _eventlog6_EvtRpcGetPublisherListForChannel(p, r);
2046
2047         if (p->fault_state) {
2048                 talloc_free(r);
2049                 /* Return true here, srv_pipe_hnd.c will take care */
2050                 return true;
2051         }
2052
2053         if (DEBUGLEVEL >= 10) {
2054                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherListForChannel, NDR_OUT | NDR_SET_VALUES, r);
2055         }
2056
2057         push = ndr_push_init_ctx(r);
2058         if (push == NULL) {
2059                 talloc_free(r);
2060                 return false;
2061         }
2062
2063         /*
2064          * carry over the pointer count to the reply in case we are
2065          * using full pointer. See NDR specification for full pointers
2066          */
2067         push->ptr_count = pull->ptr_count;
2068
2069         ndr_err = call->ndr_push(push, NDR_OUT, r);
2070         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2071                 talloc_free(r);
2072                 return false;
2073         }
2074
2075         p->out_data.rdata = ndr_push_blob(push);
2076         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2077
2078         talloc_free(r);
2079
2080         return true;
2081 }
2082
2083 static bool api_eventlog6_EvtRpcGetPublisherMetadata(struct pipes_struct *p)
2084 {
2085         const struct ndr_interface_call *call;
2086         struct ndr_pull *pull;
2087         struct ndr_push *push;
2088         enum ndr_err_code ndr_err;
2089         struct eventlog6_EvtRpcGetPublisherMetadata *r;
2090
2091         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCGETPUBLISHERMETADATA];
2092
2093         r = talloc(talloc_tos(), struct eventlog6_EvtRpcGetPublisherMetadata);
2094         if (r == NULL) {
2095                 return false;
2096         }
2097
2098         pull = ndr_pull_init_blob(&p->in_data.data, r);
2099         if (pull == NULL) {
2100                 talloc_free(r);
2101                 return false;
2102         }
2103
2104         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2105         if (p->endian) {
2106                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2107         }
2108         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2109         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2110                 talloc_free(r);
2111                 return false;
2112         }
2113
2114         if (DEBUGLEVEL >= 10) {
2115                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherMetadata, NDR_IN, r);
2116         }
2117
2118         ZERO_STRUCT(r->out);
2119         r->out.pubMetadataProps = talloc_zero(r, struct eventlog6_EvtRpcVariantList);
2120         if (r->out.pubMetadataProps == NULL) {
2121                 talloc_free(r);
2122                 return false;
2123         }
2124
2125         r->out.pubMetadata = talloc_zero(r, struct policy_handle);
2126         if (r->out.pubMetadata == NULL) {
2127                 talloc_free(r);
2128                 return false;
2129         }
2130
2131         r->out.result = _eventlog6_EvtRpcGetPublisherMetadata(p, r);
2132
2133         if (p->fault_state) {
2134                 talloc_free(r);
2135                 /* Return true here, srv_pipe_hnd.c will take care */
2136                 return true;
2137         }
2138
2139         if (DEBUGLEVEL >= 10) {
2140                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherMetadata, NDR_OUT | NDR_SET_VALUES, r);
2141         }
2142
2143         push = ndr_push_init_ctx(r);
2144         if (push == NULL) {
2145                 talloc_free(r);
2146                 return false;
2147         }
2148
2149         /*
2150          * carry over the pointer count to the reply in case we are
2151          * using full pointer. See NDR specification for full pointers
2152          */
2153         push->ptr_count = pull->ptr_count;
2154
2155         ndr_err = call->ndr_push(push, NDR_OUT, r);
2156         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2157                 talloc_free(r);
2158                 return false;
2159         }
2160
2161         p->out_data.rdata = ndr_push_blob(push);
2162         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2163
2164         talloc_free(r);
2165
2166         return true;
2167 }
2168
2169 static bool api_eventlog6_EvtRpcGetPublisherResourceMetadata(struct pipes_struct *p)
2170 {
2171         const struct ndr_interface_call *call;
2172         struct ndr_pull *pull;
2173         struct ndr_push *push;
2174         enum ndr_err_code ndr_err;
2175         struct eventlog6_EvtRpcGetPublisherResourceMetadata *r;
2176
2177         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCGETPUBLISHERRESOURCEMETADATA];
2178
2179         r = talloc(talloc_tos(), struct eventlog6_EvtRpcGetPublisherResourceMetadata);
2180         if (r == NULL) {
2181                 return false;
2182         }
2183
2184         pull = ndr_pull_init_blob(&p->in_data.data, r);
2185         if (pull == NULL) {
2186                 talloc_free(r);
2187                 return false;
2188         }
2189
2190         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2191         if (p->endian) {
2192                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2193         }
2194         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2195         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2196                 talloc_free(r);
2197                 return false;
2198         }
2199
2200         if (DEBUGLEVEL >= 10) {
2201                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherResourceMetadata, NDR_IN, r);
2202         }
2203
2204         ZERO_STRUCT(r->out);
2205         r->out.pubMetadataProps = talloc_zero(r, struct eventlog6_EvtRpcVariantList);
2206         if (r->out.pubMetadataProps == NULL) {
2207                 talloc_free(r);
2208                 return false;
2209         }
2210
2211         r->out.result = _eventlog6_EvtRpcGetPublisherResourceMetadata(p, r);
2212
2213         if (p->fault_state) {
2214                 talloc_free(r);
2215                 /* Return true here, srv_pipe_hnd.c will take care */
2216                 return true;
2217         }
2218
2219         if (DEBUGLEVEL >= 10) {
2220                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherResourceMetadata, NDR_OUT | NDR_SET_VALUES, r);
2221         }
2222
2223         push = ndr_push_init_ctx(r);
2224         if (push == NULL) {
2225                 talloc_free(r);
2226                 return false;
2227         }
2228
2229         /*
2230          * carry over the pointer count to the reply in case we are
2231          * using full pointer. See NDR specification for full pointers
2232          */
2233         push->ptr_count = pull->ptr_count;
2234
2235         ndr_err = call->ndr_push(push, NDR_OUT, r);
2236         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2237                 talloc_free(r);
2238                 return false;
2239         }
2240
2241         p->out_data.rdata = ndr_push_blob(push);
2242         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2243
2244         talloc_free(r);
2245
2246         return true;
2247 }
2248
2249 static bool api_eventlog6_EvtRpcGetEventMetadataEnum(struct pipes_struct *p)
2250 {
2251         const struct ndr_interface_call *call;
2252         struct ndr_pull *pull;
2253         struct ndr_push *push;
2254         enum ndr_err_code ndr_err;
2255         struct eventlog6_EvtRpcGetEventMetadataEnum *r;
2256
2257         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCGETEVENTMETADATAENUM];
2258
2259         r = talloc(talloc_tos(), struct eventlog6_EvtRpcGetEventMetadataEnum);
2260         if (r == NULL) {
2261                 return false;
2262         }
2263
2264         pull = ndr_pull_init_blob(&p->in_data.data, r);
2265         if (pull == NULL) {
2266                 talloc_free(r);
2267                 return false;
2268         }
2269
2270         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2271         if (p->endian) {
2272                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2273         }
2274         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2275         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2276                 talloc_free(r);
2277                 return false;
2278         }
2279
2280         if (DEBUGLEVEL >= 10) {
2281                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetEventMetadataEnum, NDR_IN, r);
2282         }
2283
2284         ZERO_STRUCT(r->out);
2285         r->out.eventMetaDataEnum = talloc_zero(r, struct policy_handle);
2286         if (r->out.eventMetaDataEnum == NULL) {
2287                 talloc_free(r);
2288                 return false;
2289         }
2290
2291         r->out.result = _eventlog6_EvtRpcGetEventMetadataEnum(p, r);
2292
2293         if (p->fault_state) {
2294                 talloc_free(r);
2295                 /* Return true here, srv_pipe_hnd.c will take care */
2296                 return true;
2297         }
2298
2299         if (DEBUGLEVEL >= 10) {
2300                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetEventMetadataEnum, NDR_OUT | NDR_SET_VALUES, r);
2301         }
2302
2303         push = ndr_push_init_ctx(r);
2304         if (push == NULL) {
2305                 talloc_free(r);
2306                 return false;
2307         }
2308
2309         /*
2310          * carry over the pointer count to the reply in case we are
2311          * using full pointer. See NDR specification for full pointers
2312          */
2313         push->ptr_count = pull->ptr_count;
2314
2315         ndr_err = call->ndr_push(push, NDR_OUT, r);
2316         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2317                 talloc_free(r);
2318                 return false;
2319         }
2320
2321         p->out_data.rdata = ndr_push_blob(push);
2322         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2323
2324         talloc_free(r);
2325
2326         return true;
2327 }
2328
2329 static bool api_eventlog6_EvtRpcGetNextEventMetadata(struct pipes_struct *p)
2330 {
2331         const struct ndr_interface_call *call;
2332         struct ndr_pull *pull;
2333         struct ndr_push *push;
2334         enum ndr_err_code ndr_err;
2335         struct eventlog6_EvtRpcGetNextEventMetadata *r;
2336
2337         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCGETNEXTEVENTMETADATA];
2338
2339         r = talloc(talloc_tos(), struct eventlog6_EvtRpcGetNextEventMetadata);
2340         if (r == NULL) {
2341                 return false;
2342         }
2343
2344         pull = ndr_pull_init_blob(&p->in_data.data, r);
2345         if (pull == NULL) {
2346                 talloc_free(r);
2347                 return false;
2348         }
2349
2350         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2351         if (p->endian) {
2352                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2353         }
2354         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2355         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2356                 talloc_free(r);
2357                 return false;
2358         }
2359
2360         if (DEBUGLEVEL >= 10) {
2361                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetNextEventMetadata, NDR_IN, r);
2362         }
2363
2364         ZERO_STRUCT(r->out);
2365         r->out.numReturned = talloc_zero(r, uint32_t);
2366         if (r->out.numReturned == NULL) {
2367                 talloc_free(r);
2368                 return false;
2369         }
2370
2371         r->out.eventMetadataInstances = talloc_zero(r, struct eventlog6_EvtRpcVariantList *);
2372         if (r->out.eventMetadataInstances == NULL) {
2373                 talloc_free(r);
2374                 return false;
2375         }
2376
2377         r->out.result = _eventlog6_EvtRpcGetNextEventMetadata(p, r);
2378
2379         if (p->fault_state) {
2380                 talloc_free(r);
2381                 /* Return true here, srv_pipe_hnd.c will take care */
2382                 return true;
2383         }
2384
2385         if (DEBUGLEVEL >= 10) {
2386                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetNextEventMetadata, NDR_OUT | NDR_SET_VALUES, r);
2387         }
2388
2389         push = ndr_push_init_ctx(r);
2390         if (push == NULL) {
2391                 talloc_free(r);
2392                 return false;
2393         }
2394
2395         /*
2396          * carry over the pointer count to the reply in case we are
2397          * using full pointer. See NDR specification for full pointers
2398          */
2399         push->ptr_count = pull->ptr_count;
2400
2401         ndr_err = call->ndr_push(push, NDR_OUT, r);
2402         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2403                 talloc_free(r);
2404                 return false;
2405         }
2406
2407         p->out_data.rdata = ndr_push_blob(push);
2408         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2409
2410         talloc_free(r);
2411
2412         return true;
2413 }
2414
2415 static bool api_eventlog6_EvtRpcGetClassicLogDisplayName(struct pipes_struct *p)
2416 {
2417         const struct ndr_interface_call *call;
2418         struct ndr_pull *pull;
2419         struct ndr_push *push;
2420         enum ndr_err_code ndr_err;
2421         struct eventlog6_EvtRpcGetClassicLogDisplayName *r;
2422
2423         call = &ndr_table_eventlog6.calls[NDR_EVENTLOG6_EVTRPCGETCLASSICLOGDISPLAYNAME];
2424
2425         r = talloc(talloc_tos(), struct eventlog6_EvtRpcGetClassicLogDisplayName);
2426         if (r == NULL) {
2427                 return false;
2428         }
2429
2430         pull = ndr_pull_init_blob(&p->in_data.data, r);
2431         if (pull == NULL) {
2432                 talloc_free(r);
2433                 return false;
2434         }
2435
2436         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2437         if (p->endian) {
2438                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2439         }
2440         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2441         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2442                 talloc_free(r);
2443                 return false;
2444         }
2445
2446         if (DEBUGLEVEL >= 10) {
2447                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetClassicLogDisplayName, NDR_IN, r);
2448         }
2449
2450         ZERO_STRUCT(r->out);
2451         r->out.displayName = talloc_zero(r, uint16_t *);
2452         if (r->out.displayName == NULL) {
2453                 talloc_free(r);
2454                 return false;
2455         }
2456
2457         r->out.result = _eventlog6_EvtRpcGetClassicLogDisplayName(p, r);
2458
2459         if (p->fault_state) {
2460                 talloc_free(r);
2461                 /* Return true here, srv_pipe_hnd.c will take care */
2462                 return true;
2463         }
2464
2465         if (DEBUGLEVEL >= 10) {
2466                 NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetClassicLogDisplayName, NDR_OUT | NDR_SET_VALUES, r);
2467         }
2468
2469         push = ndr_push_init_ctx(r);
2470         if (push == NULL) {
2471                 talloc_free(r);
2472                 return false;
2473         }
2474
2475         /*
2476          * carry over the pointer count to the reply in case we are
2477          * using full pointer. See NDR specification for full pointers
2478          */
2479         push->ptr_count = pull->ptr_count;
2480
2481         ndr_err = call->ndr_push(push, NDR_OUT, r);
2482         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2483                 talloc_free(r);
2484                 return false;
2485         }
2486
2487         p->out_data.rdata = ndr_push_blob(push);
2488         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2489
2490         talloc_free(r);
2491
2492         return true;
2493 }
2494
2495
2496 /* Tables */
2497 static struct api_struct api_eventlog6_cmds[] = 
2498 {
2499         {"EVENTLOG6_EVTRPCREGISTERREMOTESUBSCRIPTION", NDR_EVENTLOG6_EVTRPCREGISTERREMOTESUBSCRIPTION, api_eventlog6_EvtRpcRegisterRemoteSubscription},
2500         {"EVENTLOG6_EVTRPCREMOTESUBSCRIPTIONNEXTASYNC", NDR_EVENTLOG6_EVTRPCREMOTESUBSCRIPTIONNEXTASYNC, api_eventlog6_EvtRpcRemoteSubscriptionNextAsync},
2501         {"EVENTLOG6_EVTRPCREMOTESUBSCRIPTIONNEXT", NDR_EVENTLOG6_EVTRPCREMOTESUBSCRIPTIONNEXT, api_eventlog6_EvtRpcRemoteSubscriptionNext},
2502         {"EVENTLOG6_EVTRPCREMOTESUBSCRIPTIONWAITASYNC", NDR_EVENTLOG6_EVTRPCREMOTESUBSCRIPTIONWAITASYNC, api_eventlog6_EvtRpcRemoteSubscriptionWaitAsync},
2503         {"EVENTLOG6_EVTRPCREGISTERCONTROLLABLEOPERATION", NDR_EVENTLOG6_EVTRPCREGISTERCONTROLLABLEOPERATION, api_eventlog6_EvtRpcRegisterControllableOperation},
2504         {"EVENTLOG6_EVTRPCREGISTERLOGQUERY", NDR_EVENTLOG6_EVTRPCREGISTERLOGQUERY, api_eventlog6_EvtRpcRegisterLogQuery},
2505         {"EVENTLOG6_EVTRPCCLEARLOG", NDR_EVENTLOG6_EVTRPCCLEARLOG, api_eventlog6_EvtRpcClearLog},
2506         {"EVENTLOG6_EVTRPCEXPORTLOG", NDR_EVENTLOG6_EVTRPCEXPORTLOG, api_eventlog6_EvtRpcExportLog},
2507         {"EVENTLOG6_EVTRPCLOCALIZEEXPORTLOG", NDR_EVENTLOG6_EVTRPCLOCALIZEEXPORTLOG, api_eventlog6_EvtRpcLocalizeExportLog},
2508         {"EVENTLOG6_EVTRPCMESSAGERENDER", NDR_EVENTLOG6_EVTRPCMESSAGERENDER, api_eventlog6_EvtRpcMessageRender},
2509         {"EVENTLOG6_EVTRPCMESSAGERENDERDEFAULT", NDR_EVENTLOG6_EVTRPCMESSAGERENDERDEFAULT, api_eventlog6_EvtRpcMessageRenderDefault},
2510         {"EVENTLOG6_EVTRPCQUERYNEXT", NDR_EVENTLOG6_EVTRPCQUERYNEXT, api_eventlog6_EvtRpcQueryNext},
2511         {"EVENTLOG6_EVTRPCQUERYSEEK", NDR_EVENTLOG6_EVTRPCQUERYSEEK, api_eventlog6_EvtRpcQuerySeek},
2512         {"EVENTLOG6_EVTRPCCLOSE", NDR_EVENTLOG6_EVTRPCCLOSE, api_eventlog6_EvtRpcClose},
2513         {"EVENTLOG6_EVTRPCCANCEL", NDR_EVENTLOG6_EVTRPCCANCEL, api_eventlog6_EvtRpcCancel},
2514         {"EVENTLOG6_EVTRPCASSERTCONFIG", NDR_EVENTLOG6_EVTRPCASSERTCONFIG, api_eventlog6_EvtRpcAssertConfig},
2515         {"EVENTLOG6_EVTRPCRETRACTCONFIG", NDR_EVENTLOG6_EVTRPCRETRACTCONFIG, api_eventlog6_EvtRpcRetractConfig},
2516         {"EVENTLOG6_EVTRPCOPENLOGHANDLE", NDR_EVENTLOG6_EVTRPCOPENLOGHANDLE, api_eventlog6_EvtRpcOpenLogHandle},
2517         {"EVENTLOG6_EVTRPCGETLOGFILEINFO", NDR_EVENTLOG6_EVTRPCGETLOGFILEINFO, api_eventlog6_EvtRpcGetLogFileInfo},
2518         {"EVENTLOG6_EVTRPCGETCHANNELLIST", NDR_EVENTLOG6_EVTRPCGETCHANNELLIST, api_eventlog6_EvtRpcGetChannelList},
2519         {"EVENTLOG6_EVTRPCGETCHANNELCONFIG", NDR_EVENTLOG6_EVTRPCGETCHANNELCONFIG, api_eventlog6_EvtRpcGetChannelConfig},
2520         {"EVENTLOG6_EVTRPCPUTCHANNELCONFIG", NDR_EVENTLOG6_EVTRPCPUTCHANNELCONFIG, api_eventlog6_EvtRpcPutChannelConfig},
2521         {"EVENTLOG6_EVTRPCGETPUBLISHERLIST", NDR_EVENTLOG6_EVTRPCGETPUBLISHERLIST, api_eventlog6_EvtRpcGetPublisherList},
2522         {"EVENTLOG6_EVTRPCGETPUBLISHERLISTFORCHANNEL", NDR_EVENTLOG6_EVTRPCGETPUBLISHERLISTFORCHANNEL, api_eventlog6_EvtRpcGetPublisherListForChannel},
2523         {"EVENTLOG6_EVTRPCGETPUBLISHERMETADATA", NDR_EVENTLOG6_EVTRPCGETPUBLISHERMETADATA, api_eventlog6_EvtRpcGetPublisherMetadata},
2524         {"EVENTLOG6_EVTRPCGETPUBLISHERRESOURCEMETADATA", NDR_EVENTLOG6_EVTRPCGETPUBLISHERRESOURCEMETADATA, api_eventlog6_EvtRpcGetPublisherResourceMetadata},
2525         {"EVENTLOG6_EVTRPCGETEVENTMETADATAENUM", NDR_EVENTLOG6_EVTRPCGETEVENTMETADATAENUM, api_eventlog6_EvtRpcGetEventMetadataEnum},
2526         {"EVENTLOG6_EVTRPCGETNEXTEVENTMETADATA", NDR_EVENTLOG6_EVTRPCGETNEXTEVENTMETADATA, api_eventlog6_EvtRpcGetNextEventMetadata},
2527         {"EVENTLOG6_EVTRPCGETCLASSICLOGDISPLAYNAME", NDR_EVENTLOG6_EVTRPCGETCLASSICLOGDISPLAYNAME, api_eventlog6_EvtRpcGetClassicLogDisplayName},
2528 };
2529
2530 void eventlog6_get_pipe_fns(struct api_struct **fns, int *n_fns)
2531 {
2532         *fns = api_eventlog6_cmds;
2533         *n_fns = sizeof(api_eventlog6_cmds) / sizeof(struct api_struct);
2534 }
2535
2536 NTSTATUS rpc_eventlog6_init(const struct rpc_srv_callbacks *rpc_srv_cb)
2537 {
2538         return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "eventlog6", "eventlog6", &ndr_table_eventlog6, api_eventlog6_cmds, sizeof(api_eventlog6_cmds) / sizeof(struct api_struct), rpc_srv_cb);
2539 }
2540
2541 NTSTATUS rpc_eventlog6_shutdown(void)
2542 {
2543         return rpc_srv_unregister(&ndr_table_eventlog6);
2544 }