r18690: Regenerate RPC files after pidl changes.
[jpeach/samba.git] / source / librpc / gen_ndr / srv_eventlog.c
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
9 static BOOL api_eventlog_ClearEventLogW(pipes_struct *p)
10 {
11         struct ndr_pull *pull;
12         struct ndr_push *push;
13         NTSTATUS status;
14         DATA_BLOB blob;
15         struct eventlog_ClearEventLogW r;
16         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ClearEventLogW");
17         
18         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
19                 talloc_free(mem_ctx);
20                 return False;
21         }
22         
23         pull = ndr_pull_init_blob(&blob, mem_ctx);
24         if (pull == NULL)
25                 return False;
26         
27         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
28         status = ndr_pull_eventlog_ClearEventLogW(pull, NDR_IN, &r);
29         if (NT_STATUS_IS_ERR(status)) {
30                 talloc_free(mem_ctx);
31                 return False;
32         }
33         
34         r.out.result = _eventlog_ClearEventLogW(p, r.in.handle, r.in.unknown);
35         
36         push = ndr_push_init_ctx(mem_ctx);
37         if (push == NULL) {
38                 talloc_free(mem_ctx);
39                 return False;
40         }
41         
42         status = ndr_push_eventlog_ClearEventLogW(push, NDR_OUT, &r);
43         if (NT_STATUS_IS_ERR(status)) {
44                 talloc_free(mem_ctx);
45                 return False;
46         }
47         
48         blob = ndr_push_blob(push);
49         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
50                 talloc_free(mem_ctx);
51                 return False;
52         }
53         
54         talloc_free(mem_ctx);
55         
56         return True;
57 }
58
59 static BOOL api_eventlog_BackupEventLogW(pipes_struct *p)
60 {
61         struct ndr_pull *pull;
62         struct ndr_push *push;
63         NTSTATUS status;
64         DATA_BLOB blob;
65         struct eventlog_BackupEventLogW r;
66         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_BackupEventLogW");
67         
68         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
69                 talloc_free(mem_ctx);
70                 return False;
71         }
72         
73         pull = ndr_pull_init_blob(&blob, mem_ctx);
74         if (pull == NULL)
75                 return False;
76         
77         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
78         status = ndr_pull_eventlog_BackupEventLogW(pull, NDR_IN, &r);
79         if (NT_STATUS_IS_ERR(status)) {
80                 talloc_free(mem_ctx);
81                 return False;
82         }
83         
84         r.out.result = _eventlog_BackupEventLogW(p);
85         
86         push = ndr_push_init_ctx(mem_ctx);
87         if (push == NULL) {
88                 talloc_free(mem_ctx);
89                 return False;
90         }
91         
92         status = ndr_push_eventlog_BackupEventLogW(push, NDR_OUT, &r);
93         if (NT_STATUS_IS_ERR(status)) {
94                 talloc_free(mem_ctx);
95                 return False;
96         }
97         
98         blob = ndr_push_blob(push);
99         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
100                 talloc_free(mem_ctx);
101                 return False;
102         }
103         
104         talloc_free(mem_ctx);
105         
106         return True;
107 }
108
109 static BOOL api_eventlog_CloseEventLog(pipes_struct *p)
110 {
111         struct ndr_pull *pull;
112         struct ndr_push *push;
113         NTSTATUS status;
114         DATA_BLOB blob;
115         struct eventlog_CloseEventLog r;
116         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_CloseEventLog");
117         
118         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
119                 talloc_free(mem_ctx);
120                 return False;
121         }
122         
123         pull = ndr_pull_init_blob(&blob, mem_ctx);
124         if (pull == NULL)
125                 return False;
126         
127         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
128         status = ndr_pull_eventlog_CloseEventLog(pull, NDR_IN, &r);
129         if (NT_STATUS_IS_ERR(status)) {
130                 talloc_free(mem_ctx);
131                 return False;
132         }
133         
134         ZERO_STRUCT(r.out);
135         r.out.handle = r.in.handle;
136         r.out.result = _eventlog_CloseEventLog(p, r.in.handle);
137         
138         push = ndr_push_init_ctx(mem_ctx);
139         if (push == NULL) {
140                 talloc_free(mem_ctx);
141                 return False;
142         }
143         
144         status = ndr_push_eventlog_CloseEventLog(push, NDR_OUT, &r);
145         if (NT_STATUS_IS_ERR(status)) {
146                 talloc_free(mem_ctx);
147                 return False;
148         }
149         
150         blob = ndr_push_blob(push);
151         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
152                 talloc_free(mem_ctx);
153                 return False;
154         }
155         
156         talloc_free(mem_ctx);
157         
158         return True;
159 }
160
161 static BOOL api_eventlog_DeregisterEventSource(pipes_struct *p)
162 {
163         struct ndr_pull *pull;
164         struct ndr_push *push;
165         NTSTATUS status;
166         DATA_BLOB blob;
167         struct eventlog_DeregisterEventSource r;
168         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_DeregisterEventSource");
169         
170         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
171                 talloc_free(mem_ctx);
172                 return False;
173         }
174         
175         pull = ndr_pull_init_blob(&blob, mem_ctx);
176         if (pull == NULL)
177                 return False;
178         
179         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
180         status = ndr_pull_eventlog_DeregisterEventSource(pull, NDR_IN, &r);
181         if (NT_STATUS_IS_ERR(status)) {
182                 talloc_free(mem_ctx);
183                 return False;
184         }
185         
186         r.out.result = _eventlog_DeregisterEventSource(p);
187         
188         push = ndr_push_init_ctx(mem_ctx);
189         if (push == NULL) {
190                 talloc_free(mem_ctx);
191                 return False;
192         }
193         
194         status = ndr_push_eventlog_DeregisterEventSource(push, NDR_OUT, &r);
195         if (NT_STATUS_IS_ERR(status)) {
196                 talloc_free(mem_ctx);
197                 return False;
198         }
199         
200         blob = ndr_push_blob(push);
201         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
202                 talloc_free(mem_ctx);
203                 return False;
204         }
205         
206         talloc_free(mem_ctx);
207         
208         return True;
209 }
210
211 static BOOL api_eventlog_GetNumRecords(pipes_struct *p)
212 {
213         struct ndr_pull *pull;
214         struct ndr_push *push;
215         NTSTATUS status;
216         DATA_BLOB blob;
217         struct eventlog_GetNumRecords r;
218         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_GetNumRecords");
219         
220         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
221                 talloc_free(mem_ctx);
222                 return False;
223         }
224         
225         pull = ndr_pull_init_blob(&blob, mem_ctx);
226         if (pull == NULL)
227                 return False;
228         
229         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
230         status = ndr_pull_eventlog_GetNumRecords(pull, NDR_IN, &r);
231         if (NT_STATUS_IS_ERR(status)) {
232                 talloc_free(mem_ctx);
233                 return False;
234         }
235         
236         ZERO_STRUCT(r.out);
237         r.out.number = talloc_size(mem_ctx, sizeof(*r.out.number));
238         if (r.out.number == NULL) {
239                 talloc_free(mem_ctx);
240                 return False;
241         }
242         
243         r.out.result = _eventlog_GetNumRecords(p, r.in.handle, r.out.number);
244         
245         push = ndr_push_init_ctx(mem_ctx);
246         if (push == NULL) {
247                 talloc_free(mem_ctx);
248                 return False;
249         }
250         
251         status = ndr_push_eventlog_GetNumRecords(push, NDR_OUT, &r);
252         if (NT_STATUS_IS_ERR(status)) {
253                 talloc_free(mem_ctx);
254                 return False;
255         }
256         
257         blob = ndr_push_blob(push);
258         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
259                 talloc_free(mem_ctx);
260                 return False;
261         }
262         
263         talloc_free(mem_ctx);
264         
265         return True;
266 }
267
268 static BOOL api_eventlog_GetOldestRecord(pipes_struct *p)
269 {
270         struct ndr_pull *pull;
271         struct ndr_push *push;
272         NTSTATUS status;
273         DATA_BLOB blob;
274         struct eventlog_GetOldestRecord r;
275         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_GetOldestRecord");
276         
277         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
278                 talloc_free(mem_ctx);
279                 return False;
280         }
281         
282         pull = ndr_pull_init_blob(&blob, mem_ctx);
283         if (pull == NULL)
284                 return False;
285         
286         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
287         status = ndr_pull_eventlog_GetOldestRecord(pull, NDR_IN, &r);
288         if (NT_STATUS_IS_ERR(status)) {
289                 talloc_free(mem_ctx);
290                 return False;
291         }
292         
293         r.out.result = _eventlog_GetOldestRecord(p);
294         
295         push = ndr_push_init_ctx(mem_ctx);
296         if (push == NULL) {
297                 talloc_free(mem_ctx);
298                 return False;
299         }
300         
301         status = ndr_push_eventlog_GetOldestRecord(push, NDR_OUT, &r);
302         if (NT_STATUS_IS_ERR(status)) {
303                 talloc_free(mem_ctx);
304                 return False;
305         }
306         
307         blob = ndr_push_blob(push);
308         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
309                 talloc_free(mem_ctx);
310                 return False;
311         }
312         
313         talloc_free(mem_ctx);
314         
315         return True;
316 }
317
318 static BOOL api_eventlog_ChangeNotify(pipes_struct *p)
319 {
320         struct ndr_pull *pull;
321         struct ndr_push *push;
322         NTSTATUS status;
323         DATA_BLOB blob;
324         struct eventlog_ChangeNotify r;
325         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ChangeNotify");
326         
327         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
328                 talloc_free(mem_ctx);
329                 return False;
330         }
331         
332         pull = ndr_pull_init_blob(&blob, mem_ctx);
333         if (pull == NULL)
334                 return False;
335         
336         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
337         status = ndr_pull_eventlog_ChangeNotify(pull, NDR_IN, &r);
338         if (NT_STATUS_IS_ERR(status)) {
339                 talloc_free(mem_ctx);
340                 return False;
341         }
342         
343         r.out.result = _eventlog_ChangeNotify(p);
344         
345         push = ndr_push_init_ctx(mem_ctx);
346         if (push == NULL) {
347                 talloc_free(mem_ctx);
348                 return False;
349         }
350         
351         status = ndr_push_eventlog_ChangeNotify(push, NDR_OUT, &r);
352         if (NT_STATUS_IS_ERR(status)) {
353                 talloc_free(mem_ctx);
354                 return False;
355         }
356         
357         blob = ndr_push_blob(push);
358         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
359                 talloc_free(mem_ctx);
360                 return False;
361         }
362         
363         talloc_free(mem_ctx);
364         
365         return True;
366 }
367
368 static BOOL api_eventlog_OpenEventLogW(pipes_struct *p)
369 {
370         struct ndr_pull *pull;
371         struct ndr_push *push;
372         NTSTATUS status;
373         DATA_BLOB blob;
374         struct eventlog_OpenEventLogW r;
375         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_OpenEventLogW");
376         
377         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
378                 talloc_free(mem_ctx);
379                 return False;
380         }
381         
382         pull = ndr_pull_init_blob(&blob, mem_ctx);
383         if (pull == NULL)
384                 return False;
385         
386         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
387         status = ndr_pull_eventlog_OpenEventLogW(pull, NDR_IN, &r);
388         if (NT_STATUS_IS_ERR(status)) {
389                 talloc_free(mem_ctx);
390                 return False;
391         }
392         
393         ZERO_STRUCT(r.out);
394         r.out.handle = talloc_size(mem_ctx, sizeof(*r.out.handle));
395         if (r.out.handle == NULL) {
396                 talloc_free(mem_ctx);
397                 return False;
398         }
399         
400         r.out.result = _eventlog_OpenEventLogW(p, r.in.unknown0, r.in.logname, r.in.servername, r.in.unknown2, r.in.unknown3, r.out.handle);
401         
402         push = ndr_push_init_ctx(mem_ctx);
403         if (push == NULL) {
404                 talloc_free(mem_ctx);
405                 return False;
406         }
407         
408         status = ndr_push_eventlog_OpenEventLogW(push, NDR_OUT, &r);
409         if (NT_STATUS_IS_ERR(status)) {
410                 talloc_free(mem_ctx);
411                 return False;
412         }
413         
414         blob = ndr_push_blob(push);
415         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
416                 talloc_free(mem_ctx);
417                 return False;
418         }
419         
420         talloc_free(mem_ctx);
421         
422         return True;
423 }
424
425 static BOOL api_eventlog_RegisterEventSourceW(pipes_struct *p)
426 {
427         struct ndr_pull *pull;
428         struct ndr_push *push;
429         NTSTATUS status;
430         DATA_BLOB blob;
431         struct eventlog_RegisterEventSourceW r;
432         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_RegisterEventSourceW");
433         
434         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
435                 talloc_free(mem_ctx);
436                 return False;
437         }
438         
439         pull = ndr_pull_init_blob(&blob, mem_ctx);
440         if (pull == NULL)
441                 return False;
442         
443         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
444         status = ndr_pull_eventlog_RegisterEventSourceW(pull, NDR_IN, &r);
445         if (NT_STATUS_IS_ERR(status)) {
446                 talloc_free(mem_ctx);
447                 return False;
448         }
449         
450         r.out.result = _eventlog_RegisterEventSourceW(p);
451         
452         push = ndr_push_init_ctx(mem_ctx);
453         if (push == NULL) {
454                 talloc_free(mem_ctx);
455                 return False;
456         }
457         
458         status = ndr_push_eventlog_RegisterEventSourceW(push, NDR_OUT, &r);
459         if (NT_STATUS_IS_ERR(status)) {
460                 talloc_free(mem_ctx);
461                 return False;
462         }
463         
464         blob = ndr_push_blob(push);
465         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
466                 talloc_free(mem_ctx);
467                 return False;
468         }
469         
470         talloc_free(mem_ctx);
471         
472         return True;
473 }
474
475 static BOOL api_eventlog_OpenBackupEventLogW(pipes_struct *p)
476 {
477         struct ndr_pull *pull;
478         struct ndr_push *push;
479         NTSTATUS status;
480         DATA_BLOB blob;
481         struct eventlog_OpenBackupEventLogW r;
482         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_OpenBackupEventLogW");
483         
484         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
485                 talloc_free(mem_ctx);
486                 return False;
487         }
488         
489         pull = ndr_pull_init_blob(&blob, mem_ctx);
490         if (pull == NULL)
491                 return False;
492         
493         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
494         status = ndr_pull_eventlog_OpenBackupEventLogW(pull, NDR_IN, &r);
495         if (NT_STATUS_IS_ERR(status)) {
496                 talloc_free(mem_ctx);
497                 return False;
498         }
499         
500         r.out.result = _eventlog_OpenBackupEventLogW(p);
501         
502         push = ndr_push_init_ctx(mem_ctx);
503         if (push == NULL) {
504                 talloc_free(mem_ctx);
505                 return False;
506         }
507         
508         status = ndr_push_eventlog_OpenBackupEventLogW(push, NDR_OUT, &r);
509         if (NT_STATUS_IS_ERR(status)) {
510                 talloc_free(mem_ctx);
511                 return False;
512         }
513         
514         blob = ndr_push_blob(push);
515         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
516                 talloc_free(mem_ctx);
517                 return False;
518         }
519         
520         talloc_free(mem_ctx);
521         
522         return True;
523 }
524
525 static BOOL api_eventlog_ReadEventLogW(pipes_struct *p)
526 {
527         struct ndr_pull *pull;
528         struct ndr_push *push;
529         NTSTATUS status;
530         DATA_BLOB blob;
531         struct eventlog_ReadEventLogW r;
532         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ReadEventLogW");
533         
534         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
535                 talloc_free(mem_ctx);
536                 return False;
537         }
538         
539         pull = ndr_pull_init_blob(&blob, mem_ctx);
540         if (pull == NULL)
541                 return False;
542         
543         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
544         status = ndr_pull_eventlog_ReadEventLogW(pull, NDR_IN, &r);
545         if (NT_STATUS_IS_ERR(status)) {
546                 talloc_free(mem_ctx);
547                 return False;
548         }
549         
550         ZERO_STRUCT(r.out);
551         r.out.data = talloc_array_size(mem_ctx, sizeof(*r.out.data), r.in.number_of_bytes);
552         if (r.out.data == NULL) {
553                 talloc_free(mem_ctx);
554                 return False;
555         }
556         
557         r.out.sent_size = talloc_size(mem_ctx, sizeof(*r.out.sent_size));
558         if (r.out.sent_size == NULL) {
559                 talloc_free(mem_ctx);
560                 return False;
561         }
562         
563         r.out.real_size = talloc_size(mem_ctx, sizeof(*r.out.real_size));
564         if (r.out.real_size == NULL) {
565                 talloc_free(mem_ctx);
566                 return False;
567         }
568         
569         r.out.result = _eventlog_ReadEventLogW(p, r.in.handle, r.in.flags, r.in.offset, r.in.number_of_bytes, r.out.data, r.out.sent_size, r.out.real_size);
570         
571         push = ndr_push_init_ctx(mem_ctx);
572         if (push == NULL) {
573                 talloc_free(mem_ctx);
574                 return False;
575         }
576         
577         status = ndr_push_eventlog_ReadEventLogW(push, NDR_OUT, &r);
578         if (NT_STATUS_IS_ERR(status)) {
579                 talloc_free(mem_ctx);
580                 return False;
581         }
582         
583         blob = ndr_push_blob(push);
584         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
585                 talloc_free(mem_ctx);
586                 return False;
587         }
588         
589         talloc_free(mem_ctx);
590         
591         return True;
592 }
593
594 static BOOL api_eventlog_ReportEventW(pipes_struct *p)
595 {
596         struct ndr_pull *pull;
597         struct ndr_push *push;
598         NTSTATUS status;
599         DATA_BLOB blob;
600         struct eventlog_ReportEventW r;
601         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ReportEventW");
602         
603         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
604                 talloc_free(mem_ctx);
605                 return False;
606         }
607         
608         pull = ndr_pull_init_blob(&blob, mem_ctx);
609         if (pull == NULL)
610                 return False;
611         
612         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
613         status = ndr_pull_eventlog_ReportEventW(pull, NDR_IN, &r);
614         if (NT_STATUS_IS_ERR(status)) {
615                 talloc_free(mem_ctx);
616                 return False;
617         }
618         
619         r.out.result = _eventlog_ReportEventW(p);
620         
621         push = ndr_push_init_ctx(mem_ctx);
622         if (push == NULL) {
623                 talloc_free(mem_ctx);
624                 return False;
625         }
626         
627         status = ndr_push_eventlog_ReportEventW(push, NDR_OUT, &r);
628         if (NT_STATUS_IS_ERR(status)) {
629                 talloc_free(mem_ctx);
630                 return False;
631         }
632         
633         blob = ndr_push_blob(push);
634         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
635                 talloc_free(mem_ctx);
636                 return False;
637         }
638         
639         talloc_free(mem_ctx);
640         
641         return True;
642 }
643
644 static BOOL api_eventlog_ClearEventLogA(pipes_struct *p)
645 {
646         struct ndr_pull *pull;
647         struct ndr_push *push;
648         NTSTATUS status;
649         DATA_BLOB blob;
650         struct eventlog_ClearEventLogA r;
651         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ClearEventLogA");
652         
653         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
654                 talloc_free(mem_ctx);
655                 return False;
656         }
657         
658         pull = ndr_pull_init_blob(&blob, mem_ctx);
659         if (pull == NULL)
660                 return False;
661         
662         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
663         status = ndr_pull_eventlog_ClearEventLogA(pull, NDR_IN, &r);
664         if (NT_STATUS_IS_ERR(status)) {
665                 talloc_free(mem_ctx);
666                 return False;
667         }
668         
669         r.out.result = _eventlog_ClearEventLogA(p);
670         
671         push = ndr_push_init_ctx(mem_ctx);
672         if (push == NULL) {
673                 talloc_free(mem_ctx);
674                 return False;
675         }
676         
677         status = ndr_push_eventlog_ClearEventLogA(push, NDR_OUT, &r);
678         if (NT_STATUS_IS_ERR(status)) {
679                 talloc_free(mem_ctx);
680                 return False;
681         }
682         
683         blob = ndr_push_blob(push);
684         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
685                 talloc_free(mem_ctx);
686                 return False;
687         }
688         
689         talloc_free(mem_ctx);
690         
691         return True;
692 }
693
694 static BOOL api_eventlog_BackupEventLogA(pipes_struct *p)
695 {
696         struct ndr_pull *pull;
697         struct ndr_push *push;
698         NTSTATUS status;
699         DATA_BLOB blob;
700         struct eventlog_BackupEventLogA r;
701         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_BackupEventLogA");
702         
703         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
704                 talloc_free(mem_ctx);
705                 return False;
706         }
707         
708         pull = ndr_pull_init_blob(&blob, mem_ctx);
709         if (pull == NULL)
710                 return False;
711         
712         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
713         status = ndr_pull_eventlog_BackupEventLogA(pull, NDR_IN, &r);
714         if (NT_STATUS_IS_ERR(status)) {
715                 talloc_free(mem_ctx);
716                 return False;
717         }
718         
719         r.out.result = _eventlog_BackupEventLogA(p);
720         
721         push = ndr_push_init_ctx(mem_ctx);
722         if (push == NULL) {
723                 talloc_free(mem_ctx);
724                 return False;
725         }
726         
727         status = ndr_push_eventlog_BackupEventLogA(push, NDR_OUT, &r);
728         if (NT_STATUS_IS_ERR(status)) {
729                 talloc_free(mem_ctx);
730                 return False;
731         }
732         
733         blob = ndr_push_blob(push);
734         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
735                 talloc_free(mem_ctx);
736                 return False;
737         }
738         
739         talloc_free(mem_ctx);
740         
741         return True;
742 }
743
744 static BOOL api_eventlog_OpenEventLogA(pipes_struct *p)
745 {
746         struct ndr_pull *pull;
747         struct ndr_push *push;
748         NTSTATUS status;
749         DATA_BLOB blob;
750         struct eventlog_OpenEventLogA r;
751         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_OpenEventLogA");
752         
753         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
754                 talloc_free(mem_ctx);
755                 return False;
756         }
757         
758         pull = ndr_pull_init_blob(&blob, mem_ctx);
759         if (pull == NULL)
760                 return False;
761         
762         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
763         status = ndr_pull_eventlog_OpenEventLogA(pull, NDR_IN, &r);
764         if (NT_STATUS_IS_ERR(status)) {
765                 talloc_free(mem_ctx);
766                 return False;
767         }
768         
769         r.out.result = _eventlog_OpenEventLogA(p);
770         
771         push = ndr_push_init_ctx(mem_ctx);
772         if (push == NULL) {
773                 talloc_free(mem_ctx);
774                 return False;
775         }
776         
777         status = ndr_push_eventlog_OpenEventLogA(push, NDR_OUT, &r);
778         if (NT_STATUS_IS_ERR(status)) {
779                 talloc_free(mem_ctx);
780                 return False;
781         }
782         
783         blob = ndr_push_blob(push);
784         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
785                 talloc_free(mem_ctx);
786                 return False;
787         }
788         
789         talloc_free(mem_ctx);
790         
791         return True;
792 }
793
794 static BOOL api_eventlog_RegisterEventSourceA(pipes_struct *p)
795 {
796         struct ndr_pull *pull;
797         struct ndr_push *push;
798         NTSTATUS status;
799         DATA_BLOB blob;
800         struct eventlog_RegisterEventSourceA r;
801         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_RegisterEventSourceA");
802         
803         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
804                 talloc_free(mem_ctx);
805                 return False;
806         }
807         
808         pull = ndr_pull_init_blob(&blob, mem_ctx);
809         if (pull == NULL)
810                 return False;
811         
812         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
813         status = ndr_pull_eventlog_RegisterEventSourceA(pull, NDR_IN, &r);
814         if (NT_STATUS_IS_ERR(status)) {
815                 talloc_free(mem_ctx);
816                 return False;
817         }
818         
819         r.out.result = _eventlog_RegisterEventSourceA(p);
820         
821         push = ndr_push_init_ctx(mem_ctx);
822         if (push == NULL) {
823                 talloc_free(mem_ctx);
824                 return False;
825         }
826         
827         status = ndr_push_eventlog_RegisterEventSourceA(push, NDR_OUT, &r);
828         if (NT_STATUS_IS_ERR(status)) {
829                 talloc_free(mem_ctx);
830                 return False;
831         }
832         
833         blob = ndr_push_blob(push);
834         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
835                 talloc_free(mem_ctx);
836                 return False;
837         }
838         
839         talloc_free(mem_ctx);
840         
841         return True;
842 }
843
844 static BOOL api_eventlog_OpenBackupEventLogA(pipes_struct *p)
845 {
846         struct ndr_pull *pull;
847         struct ndr_push *push;
848         NTSTATUS status;
849         DATA_BLOB blob;
850         struct eventlog_OpenBackupEventLogA r;
851         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_OpenBackupEventLogA");
852         
853         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
854                 talloc_free(mem_ctx);
855                 return False;
856         }
857         
858         pull = ndr_pull_init_blob(&blob, mem_ctx);
859         if (pull == NULL)
860                 return False;
861         
862         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
863         status = ndr_pull_eventlog_OpenBackupEventLogA(pull, NDR_IN, &r);
864         if (NT_STATUS_IS_ERR(status)) {
865                 talloc_free(mem_ctx);
866                 return False;
867         }
868         
869         r.out.result = _eventlog_OpenBackupEventLogA(p);
870         
871         push = ndr_push_init_ctx(mem_ctx);
872         if (push == NULL) {
873                 talloc_free(mem_ctx);
874                 return False;
875         }
876         
877         status = ndr_push_eventlog_OpenBackupEventLogA(push, NDR_OUT, &r);
878         if (NT_STATUS_IS_ERR(status)) {
879                 talloc_free(mem_ctx);
880                 return False;
881         }
882         
883         blob = ndr_push_blob(push);
884         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
885                 talloc_free(mem_ctx);
886                 return False;
887         }
888         
889         talloc_free(mem_ctx);
890         
891         return True;
892 }
893
894 static BOOL api_eventlog_ReadEventLogA(pipes_struct *p)
895 {
896         struct ndr_pull *pull;
897         struct ndr_push *push;
898         NTSTATUS status;
899         DATA_BLOB blob;
900         struct eventlog_ReadEventLogA r;
901         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ReadEventLogA");
902         
903         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
904                 talloc_free(mem_ctx);
905                 return False;
906         }
907         
908         pull = ndr_pull_init_blob(&blob, mem_ctx);
909         if (pull == NULL)
910                 return False;
911         
912         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
913         status = ndr_pull_eventlog_ReadEventLogA(pull, NDR_IN, &r);
914         if (NT_STATUS_IS_ERR(status)) {
915                 talloc_free(mem_ctx);
916                 return False;
917         }
918         
919         r.out.result = _eventlog_ReadEventLogA(p);
920         
921         push = ndr_push_init_ctx(mem_ctx);
922         if (push == NULL) {
923                 talloc_free(mem_ctx);
924                 return False;
925         }
926         
927         status = ndr_push_eventlog_ReadEventLogA(push, NDR_OUT, &r);
928         if (NT_STATUS_IS_ERR(status)) {
929                 talloc_free(mem_ctx);
930                 return False;
931         }
932         
933         blob = ndr_push_blob(push);
934         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
935                 talloc_free(mem_ctx);
936                 return False;
937         }
938         
939         talloc_free(mem_ctx);
940         
941         return True;
942 }
943
944 static BOOL api_eventlog_ReportEventA(pipes_struct *p)
945 {
946         struct ndr_pull *pull;
947         struct ndr_push *push;
948         NTSTATUS status;
949         DATA_BLOB blob;
950         struct eventlog_ReportEventA r;
951         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ReportEventA");
952         
953         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
954                 talloc_free(mem_ctx);
955                 return False;
956         }
957         
958         pull = ndr_pull_init_blob(&blob, mem_ctx);
959         if (pull == NULL)
960                 return False;
961         
962         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
963         status = ndr_pull_eventlog_ReportEventA(pull, NDR_IN, &r);
964         if (NT_STATUS_IS_ERR(status)) {
965                 talloc_free(mem_ctx);
966                 return False;
967         }
968         
969         r.out.result = _eventlog_ReportEventA(p);
970         
971         push = ndr_push_init_ctx(mem_ctx);
972         if (push == NULL) {
973                 talloc_free(mem_ctx);
974                 return False;
975         }
976         
977         status = ndr_push_eventlog_ReportEventA(push, NDR_OUT, &r);
978         if (NT_STATUS_IS_ERR(status)) {
979                 talloc_free(mem_ctx);
980                 return False;
981         }
982         
983         blob = ndr_push_blob(push);
984         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
985                 talloc_free(mem_ctx);
986                 return False;
987         }
988         
989         talloc_free(mem_ctx);
990         
991         return True;
992 }
993
994 static BOOL api_eventlog_RegisterClusterSvc(pipes_struct *p)
995 {
996         struct ndr_pull *pull;
997         struct ndr_push *push;
998         NTSTATUS status;
999         DATA_BLOB blob;
1000         struct eventlog_RegisterClusterSvc r;
1001         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_RegisterClusterSvc");
1002         
1003         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1004                 talloc_free(mem_ctx);
1005                 return False;
1006         }
1007         
1008         pull = ndr_pull_init_blob(&blob, mem_ctx);
1009         if (pull == NULL)
1010                 return False;
1011         
1012         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1013         status = ndr_pull_eventlog_RegisterClusterSvc(pull, NDR_IN, &r);
1014         if (NT_STATUS_IS_ERR(status)) {
1015                 talloc_free(mem_ctx);
1016                 return False;
1017         }
1018         
1019         r.out.result = _eventlog_RegisterClusterSvc(p);
1020         
1021         push = ndr_push_init_ctx(mem_ctx);
1022         if (push == NULL) {
1023                 talloc_free(mem_ctx);
1024                 return False;
1025         }
1026         
1027         status = ndr_push_eventlog_RegisterClusterSvc(push, NDR_OUT, &r);
1028         if (NT_STATUS_IS_ERR(status)) {
1029                 talloc_free(mem_ctx);
1030                 return False;
1031         }
1032         
1033         blob = ndr_push_blob(push);
1034         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
1035                 talloc_free(mem_ctx);
1036                 return False;
1037         }
1038         
1039         talloc_free(mem_ctx);
1040         
1041         return True;
1042 }
1043
1044 static BOOL api_eventlog_DeregisterClusterSvc(pipes_struct *p)
1045 {
1046         struct ndr_pull *pull;
1047         struct ndr_push *push;
1048         NTSTATUS status;
1049         DATA_BLOB blob;
1050         struct eventlog_DeregisterClusterSvc r;
1051         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_DeregisterClusterSvc");
1052         
1053         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1054                 talloc_free(mem_ctx);
1055                 return False;
1056         }
1057         
1058         pull = ndr_pull_init_blob(&blob, mem_ctx);
1059         if (pull == NULL)
1060                 return False;
1061         
1062         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1063         status = ndr_pull_eventlog_DeregisterClusterSvc(pull, NDR_IN, &r);
1064         if (NT_STATUS_IS_ERR(status)) {
1065                 talloc_free(mem_ctx);
1066                 return False;
1067         }
1068         
1069         r.out.result = _eventlog_DeregisterClusterSvc(p);
1070         
1071         push = ndr_push_init_ctx(mem_ctx);
1072         if (push == NULL) {
1073                 talloc_free(mem_ctx);
1074                 return False;
1075         }
1076         
1077         status = ndr_push_eventlog_DeregisterClusterSvc(push, NDR_OUT, &r);
1078         if (NT_STATUS_IS_ERR(status)) {
1079                 talloc_free(mem_ctx);
1080                 return False;
1081         }
1082         
1083         blob = ndr_push_blob(push);
1084         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
1085                 talloc_free(mem_ctx);
1086                 return False;
1087         }
1088         
1089         talloc_free(mem_ctx);
1090         
1091         return True;
1092 }
1093
1094 static BOOL api_eventlog_WriteClusterEvents(pipes_struct *p)
1095 {
1096         struct ndr_pull *pull;
1097         struct ndr_push *push;
1098         NTSTATUS status;
1099         DATA_BLOB blob;
1100         struct eventlog_WriteClusterEvents r;
1101         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_WriteClusterEvents");
1102         
1103         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1104                 talloc_free(mem_ctx);
1105                 return False;
1106         }
1107         
1108         pull = ndr_pull_init_blob(&blob, mem_ctx);
1109         if (pull == NULL)
1110                 return False;
1111         
1112         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1113         status = ndr_pull_eventlog_WriteClusterEvents(pull, NDR_IN, &r);
1114         if (NT_STATUS_IS_ERR(status)) {
1115                 talloc_free(mem_ctx);
1116                 return False;
1117         }
1118         
1119         r.out.result = _eventlog_WriteClusterEvents(p);
1120         
1121         push = ndr_push_init_ctx(mem_ctx);
1122         if (push == NULL) {
1123                 talloc_free(mem_ctx);
1124                 return False;
1125         }
1126         
1127         status = ndr_push_eventlog_WriteClusterEvents(push, NDR_OUT, &r);
1128         if (NT_STATUS_IS_ERR(status)) {
1129                 talloc_free(mem_ctx);
1130                 return False;
1131         }
1132         
1133         blob = ndr_push_blob(push);
1134         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
1135                 talloc_free(mem_ctx);
1136                 return False;
1137         }
1138         
1139         talloc_free(mem_ctx);
1140         
1141         return True;
1142 }
1143
1144 static BOOL api_eventlog_GetLogIntormation(pipes_struct *p)
1145 {
1146         struct ndr_pull *pull;
1147         struct ndr_push *push;
1148         NTSTATUS status;
1149         DATA_BLOB blob;
1150         struct eventlog_GetLogIntormation r;
1151         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_GetLogIntormation");
1152         
1153         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1154                 talloc_free(mem_ctx);
1155                 return False;
1156         }
1157         
1158         pull = ndr_pull_init_blob(&blob, mem_ctx);
1159         if (pull == NULL)
1160                 return False;
1161         
1162         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1163         status = ndr_pull_eventlog_GetLogIntormation(pull, NDR_IN, &r);
1164         if (NT_STATUS_IS_ERR(status)) {
1165                 talloc_free(mem_ctx);
1166                 return False;
1167         }
1168         
1169         r.out.result = _eventlog_GetLogIntormation(p);
1170         
1171         push = ndr_push_init_ctx(mem_ctx);
1172         if (push == NULL) {
1173                 talloc_free(mem_ctx);
1174                 return False;
1175         }
1176         
1177         status = ndr_push_eventlog_GetLogIntormation(push, NDR_OUT, &r);
1178         if (NT_STATUS_IS_ERR(status)) {
1179                 talloc_free(mem_ctx);
1180                 return False;
1181         }
1182         
1183         blob = ndr_push_blob(push);
1184         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
1185                 talloc_free(mem_ctx);
1186                 return False;
1187         }
1188         
1189         talloc_free(mem_ctx);
1190         
1191         return True;
1192 }
1193
1194 static BOOL api_eventlog_FlushEventLog(pipes_struct *p)
1195 {
1196         struct ndr_pull *pull;
1197         struct ndr_push *push;
1198         NTSTATUS status;
1199         DATA_BLOB blob;
1200         struct eventlog_FlushEventLog r;
1201         TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_FlushEventLog");
1202         
1203         if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1204                 talloc_free(mem_ctx);
1205                 return False;
1206         }
1207         
1208         pull = ndr_pull_init_blob(&blob, mem_ctx);
1209         if (pull == NULL)
1210                 return False;
1211         
1212         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1213         status = ndr_pull_eventlog_FlushEventLog(pull, NDR_IN, &r);
1214         if (NT_STATUS_IS_ERR(status)) {
1215                 talloc_free(mem_ctx);
1216                 return False;
1217         }
1218         
1219         r.out.result = _eventlog_FlushEventLog(p, r.in.handle);
1220         
1221         push = ndr_push_init_ctx(mem_ctx);
1222         if (push == NULL) {
1223                 talloc_free(mem_ctx);
1224                 return False;
1225         }
1226         
1227         status = ndr_push_eventlog_FlushEventLog(push, NDR_OUT, &r);
1228         if (NT_STATUS_IS_ERR(status)) {
1229                 talloc_free(mem_ctx);
1230                 return False;
1231         }
1232         
1233         blob = ndr_push_blob(push);
1234         if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
1235                 talloc_free(mem_ctx);
1236                 return False;
1237         }
1238         
1239         talloc_free(mem_ctx);
1240         
1241         return True;
1242 }
1243
1244
1245 /* Tables */
1246 static struct api_struct api_eventlog_cmds[] = 
1247 {
1248         {"EVENTLOG_CLEAREVENTLOGW", DCERPC_EVENTLOG_CLEAREVENTLOGW, api_eventlog_ClearEventLogW},
1249         {"EVENTLOG_BACKUPEVENTLOGW", DCERPC_EVENTLOG_BACKUPEVENTLOGW, api_eventlog_BackupEventLogW},
1250         {"EVENTLOG_CLOSEEVENTLOG", DCERPC_EVENTLOG_CLOSEEVENTLOG, api_eventlog_CloseEventLog},
1251         {"EVENTLOG_DEREGISTEREVENTSOURCE", DCERPC_EVENTLOG_DEREGISTEREVENTSOURCE, api_eventlog_DeregisterEventSource},
1252         {"EVENTLOG_GETNUMRECORDS", DCERPC_EVENTLOG_GETNUMRECORDS, api_eventlog_GetNumRecords},
1253         {"EVENTLOG_GETOLDESTRECORD", DCERPC_EVENTLOG_GETOLDESTRECORD, api_eventlog_GetOldestRecord},
1254         {"EVENTLOG_CHANGENOTIFY", DCERPC_EVENTLOG_CHANGENOTIFY, api_eventlog_ChangeNotify},
1255         {"EVENTLOG_OPENEVENTLOGW", DCERPC_EVENTLOG_OPENEVENTLOGW, api_eventlog_OpenEventLogW},
1256         {"EVENTLOG_REGISTEREVENTSOURCEW", DCERPC_EVENTLOG_REGISTEREVENTSOURCEW, api_eventlog_RegisterEventSourceW},
1257         {"EVENTLOG_OPENBACKUPEVENTLOGW", DCERPC_EVENTLOG_OPENBACKUPEVENTLOGW, api_eventlog_OpenBackupEventLogW},
1258         {"EVENTLOG_READEVENTLOGW", DCERPC_EVENTLOG_READEVENTLOGW, api_eventlog_ReadEventLogW},
1259         {"EVENTLOG_REPORTEVENTW", DCERPC_EVENTLOG_REPORTEVENTW, api_eventlog_ReportEventW},
1260         {"EVENTLOG_CLEAREVENTLOGA", DCERPC_EVENTLOG_CLEAREVENTLOGA, api_eventlog_ClearEventLogA},
1261         {"EVENTLOG_BACKUPEVENTLOGA", DCERPC_EVENTLOG_BACKUPEVENTLOGA, api_eventlog_BackupEventLogA},
1262         {"EVENTLOG_OPENEVENTLOGA", DCERPC_EVENTLOG_OPENEVENTLOGA, api_eventlog_OpenEventLogA},
1263         {"EVENTLOG_REGISTEREVENTSOURCEA", DCERPC_EVENTLOG_REGISTEREVENTSOURCEA, api_eventlog_RegisterEventSourceA},
1264         {"EVENTLOG_OPENBACKUPEVENTLOGA", DCERPC_EVENTLOG_OPENBACKUPEVENTLOGA, api_eventlog_OpenBackupEventLogA},
1265         {"EVENTLOG_READEVENTLOGA", DCERPC_EVENTLOG_READEVENTLOGA, api_eventlog_ReadEventLogA},
1266         {"EVENTLOG_REPORTEVENTA", DCERPC_EVENTLOG_REPORTEVENTA, api_eventlog_ReportEventA},
1267         {"EVENTLOG_REGISTERCLUSTERSVC", DCERPC_EVENTLOG_REGISTERCLUSTERSVC, api_eventlog_RegisterClusterSvc},
1268         {"EVENTLOG_DEREGISTERCLUSTERSVC", DCERPC_EVENTLOG_DEREGISTERCLUSTERSVC, api_eventlog_DeregisterClusterSvc},
1269         {"EVENTLOG_WRITECLUSTEREVENTS", DCERPC_EVENTLOG_WRITECLUSTEREVENTS, api_eventlog_WriteClusterEvents},
1270         {"EVENTLOG_GETLOGINTORMATION", DCERPC_EVENTLOG_GETLOGINTORMATION, api_eventlog_GetLogIntormation},
1271         {"EVENTLOG_FLUSHEVENTLOG", DCERPC_EVENTLOG_FLUSHEVENTLOG, api_eventlog_FlushEventLog},
1272 };
1273
1274 void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns)
1275 {
1276         *fns = api_eventlog_cmds;
1277         *n_fns = sizeof(api_eventlog_cmds) / sizeof(struct api_struct);
1278 }
1279
1280 NTSTATUS rpc_eventlog_init(void)
1281 {
1282         return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "eventlog", "eventlog", api_eventlog_cmds, sizeof(api_eventlog_cmds) / sizeof(struct api_struct));
1283 }