lsa: add LSA_TRUSTED_DOMAIN access masks.
[ira/wip.git] / librpc / gen_ndr / cli_eventlog.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * client auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_eventlog.h"
8
9 struct rpccli_eventlog_ClearEventLogW_state {
10         struct eventlog_ClearEventLogW orig;
11         struct eventlog_ClearEventLogW tmp;
12         TALLOC_CTX *out_mem_ctx;
13         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
14 };
15
16 static void rpccli_eventlog_ClearEventLogW_done(struct tevent_req *subreq);
17
18 struct tevent_req *rpccli_eventlog_ClearEventLogW_send(TALLOC_CTX *mem_ctx,
19                                                        struct tevent_context *ev,
20                                                        struct rpc_pipe_client *cli,
21                                                        struct policy_handle *_handle /* [in] [ref] */,
22                                                        struct lsa_String *_backupfile /* [in] [unique] */)
23 {
24         struct tevent_req *req;
25         struct rpccli_eventlog_ClearEventLogW_state *state;
26         struct tevent_req *subreq;
27
28         req = tevent_req_create(mem_ctx, &state,
29                                 struct rpccli_eventlog_ClearEventLogW_state);
30         if (req == NULL) {
31                 return NULL;
32         }
33         state->out_mem_ctx = NULL;
34         state->dispatch_recv = cli->dispatch_recv;
35
36         /* In parameters */
37         state->orig.in.handle = _handle;
38         state->orig.in.backupfile = _backupfile;
39
40         /* Out parameters */
41
42         /* Result */
43         ZERO_STRUCT(state->orig.out.result);
44
45         if (DEBUGLEVEL >= 10) {
46                 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, &state->orig);
47         }
48
49         /* make a temporary copy, that we pass to the dispatch function */
50         state->tmp = state->orig;
51
52         subreq = cli->dispatch_send(state, ev, cli,
53                                     &ndr_table_eventlog,
54                                     NDR_EVENTLOG_CLEAREVENTLOGW,
55                                     &state->tmp);
56         if (tevent_req_nomem(subreq, req)) {
57                 return tevent_req_post(req, ev);
58         }
59         tevent_req_set_callback(subreq, rpccli_eventlog_ClearEventLogW_done, req);
60         return req;
61 }
62
63 static void rpccli_eventlog_ClearEventLogW_done(struct tevent_req *subreq)
64 {
65         struct tevent_req *req = tevent_req_callback_data(
66                 subreq, struct tevent_req);
67         struct rpccli_eventlog_ClearEventLogW_state *state = tevent_req_data(
68                 req, struct rpccli_eventlog_ClearEventLogW_state);
69         NTSTATUS status;
70         TALLOC_CTX *mem_ctx;
71
72         if (state->out_mem_ctx) {
73                 mem_ctx = state->out_mem_ctx;
74         } else {
75                 mem_ctx = state;
76         }
77
78         status = state->dispatch_recv(subreq, mem_ctx);
79         TALLOC_FREE(subreq);
80         if (!NT_STATUS_IS_OK(status)) {
81                 tevent_req_nterror(req, status);
82                 return;
83         }
84
85         /* Copy out parameters */
86
87         /* Copy result */
88         state->orig.out.result = state->tmp.out.result;
89
90         /* Reset temporary structure */
91         ZERO_STRUCT(state->tmp);
92
93         if (DEBUGLEVEL >= 10) {
94                 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, &state->orig);
95         }
96
97         tevent_req_done(req);
98 }
99
100 NTSTATUS rpccli_eventlog_ClearEventLogW_recv(struct tevent_req *req,
101                                              TALLOC_CTX *mem_ctx,
102                                              NTSTATUS *result)
103 {
104         struct rpccli_eventlog_ClearEventLogW_state *state = tevent_req_data(
105                 req, struct rpccli_eventlog_ClearEventLogW_state);
106         NTSTATUS status;
107
108         if (tevent_req_is_nterror(req, &status)) {
109                 tevent_req_received(req);
110                 return status;
111         }
112
113         /* Steal possbile out parameters to the callers context */
114         talloc_steal(mem_ctx, state->out_mem_ctx);
115
116         /* Return result */
117         *result = state->orig.out.result;
118
119         tevent_req_received(req);
120         return NT_STATUS_OK;
121 }
122
123 NTSTATUS rpccli_eventlog_ClearEventLogW(struct rpc_pipe_client *cli,
124                                         TALLOC_CTX *mem_ctx,
125                                         struct policy_handle *handle /* [in] [ref] */,
126                                         struct lsa_String *backupfile /* [in] [unique] */)
127 {
128         struct eventlog_ClearEventLogW r;
129         NTSTATUS status;
130
131         /* In parameters */
132         r.in.handle = handle;
133         r.in.backupfile = backupfile;
134
135         if (DEBUGLEVEL >= 10) {
136                 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, &r);
137         }
138
139         status = cli->dispatch(cli,
140                                 mem_ctx,
141                                 &ndr_table_eventlog,
142                                 NDR_EVENTLOG_CLEAREVENTLOGW,
143                                 &r);
144
145         if (!NT_STATUS_IS_OK(status)) {
146                 return status;
147         }
148
149         if (DEBUGLEVEL >= 10) {
150                 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, &r);
151         }
152
153         if (NT_STATUS_IS_ERR(status)) {
154                 return status;
155         }
156
157         /* Return variables */
158
159         /* Return result */
160         return r.out.result;
161 }
162
163 struct rpccli_eventlog_BackupEventLogW_state {
164         struct eventlog_BackupEventLogW orig;
165         struct eventlog_BackupEventLogW tmp;
166         TALLOC_CTX *out_mem_ctx;
167         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
168 };
169
170 static void rpccli_eventlog_BackupEventLogW_done(struct tevent_req *subreq);
171
172 struct tevent_req *rpccli_eventlog_BackupEventLogW_send(TALLOC_CTX *mem_ctx,
173                                                         struct tevent_context *ev,
174                                                         struct rpc_pipe_client *cli,
175                                                         struct policy_handle *_handle /* [in] [ref] */,
176                                                         struct lsa_String *_backup_filename /* [in] [ref] */)
177 {
178         struct tevent_req *req;
179         struct rpccli_eventlog_BackupEventLogW_state *state;
180         struct tevent_req *subreq;
181
182         req = tevent_req_create(mem_ctx, &state,
183                                 struct rpccli_eventlog_BackupEventLogW_state);
184         if (req == NULL) {
185                 return NULL;
186         }
187         state->out_mem_ctx = NULL;
188         state->dispatch_recv = cli->dispatch_recv;
189
190         /* In parameters */
191         state->orig.in.handle = _handle;
192         state->orig.in.backup_filename = _backup_filename;
193
194         /* Out parameters */
195
196         /* Result */
197         ZERO_STRUCT(state->orig.out.result);
198
199         if (DEBUGLEVEL >= 10) {
200                 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, &state->orig);
201         }
202
203         /* make a temporary copy, that we pass to the dispatch function */
204         state->tmp = state->orig;
205
206         subreq = cli->dispatch_send(state, ev, cli,
207                                     &ndr_table_eventlog,
208                                     NDR_EVENTLOG_BACKUPEVENTLOGW,
209                                     &state->tmp);
210         if (tevent_req_nomem(subreq, req)) {
211                 return tevent_req_post(req, ev);
212         }
213         tevent_req_set_callback(subreq, rpccli_eventlog_BackupEventLogW_done, req);
214         return req;
215 }
216
217 static void rpccli_eventlog_BackupEventLogW_done(struct tevent_req *subreq)
218 {
219         struct tevent_req *req = tevent_req_callback_data(
220                 subreq, struct tevent_req);
221         struct rpccli_eventlog_BackupEventLogW_state *state = tevent_req_data(
222                 req, struct rpccli_eventlog_BackupEventLogW_state);
223         NTSTATUS status;
224         TALLOC_CTX *mem_ctx;
225
226         if (state->out_mem_ctx) {
227                 mem_ctx = state->out_mem_ctx;
228         } else {
229                 mem_ctx = state;
230         }
231
232         status = state->dispatch_recv(subreq, mem_ctx);
233         TALLOC_FREE(subreq);
234         if (!NT_STATUS_IS_OK(status)) {
235                 tevent_req_nterror(req, status);
236                 return;
237         }
238
239         /* Copy out parameters */
240
241         /* Copy result */
242         state->orig.out.result = state->tmp.out.result;
243
244         /* Reset temporary structure */
245         ZERO_STRUCT(state->tmp);
246
247         if (DEBUGLEVEL >= 10) {
248                 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, &state->orig);
249         }
250
251         tevent_req_done(req);
252 }
253
254 NTSTATUS rpccli_eventlog_BackupEventLogW_recv(struct tevent_req *req,
255                                               TALLOC_CTX *mem_ctx,
256                                               NTSTATUS *result)
257 {
258         struct rpccli_eventlog_BackupEventLogW_state *state = tevent_req_data(
259                 req, struct rpccli_eventlog_BackupEventLogW_state);
260         NTSTATUS status;
261
262         if (tevent_req_is_nterror(req, &status)) {
263                 tevent_req_received(req);
264                 return status;
265         }
266
267         /* Steal possbile out parameters to the callers context */
268         talloc_steal(mem_ctx, state->out_mem_ctx);
269
270         /* Return result */
271         *result = state->orig.out.result;
272
273         tevent_req_received(req);
274         return NT_STATUS_OK;
275 }
276
277 NTSTATUS rpccli_eventlog_BackupEventLogW(struct rpc_pipe_client *cli,
278                                          TALLOC_CTX *mem_ctx,
279                                          struct policy_handle *handle /* [in] [ref] */,
280                                          struct lsa_String *backup_filename /* [in] [ref] */)
281 {
282         struct eventlog_BackupEventLogW r;
283         NTSTATUS status;
284
285         /* In parameters */
286         r.in.handle = handle;
287         r.in.backup_filename = backup_filename;
288
289         if (DEBUGLEVEL >= 10) {
290                 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, &r);
291         }
292
293         status = cli->dispatch(cli,
294                                 mem_ctx,
295                                 &ndr_table_eventlog,
296                                 NDR_EVENTLOG_BACKUPEVENTLOGW,
297                                 &r);
298
299         if (!NT_STATUS_IS_OK(status)) {
300                 return status;
301         }
302
303         if (DEBUGLEVEL >= 10) {
304                 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, &r);
305         }
306
307         if (NT_STATUS_IS_ERR(status)) {
308                 return status;
309         }
310
311         /* Return variables */
312
313         /* Return result */
314         return r.out.result;
315 }
316
317 struct rpccli_eventlog_CloseEventLog_state {
318         struct eventlog_CloseEventLog orig;
319         struct eventlog_CloseEventLog tmp;
320         TALLOC_CTX *out_mem_ctx;
321         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
322 };
323
324 static void rpccli_eventlog_CloseEventLog_done(struct tevent_req *subreq);
325
326 struct tevent_req *rpccli_eventlog_CloseEventLog_send(TALLOC_CTX *mem_ctx,
327                                                       struct tevent_context *ev,
328                                                       struct rpc_pipe_client *cli,
329                                                       struct policy_handle *_handle /* [in,out] [ref] */)
330 {
331         struct tevent_req *req;
332         struct rpccli_eventlog_CloseEventLog_state *state;
333         struct tevent_req *subreq;
334
335         req = tevent_req_create(mem_ctx, &state,
336                                 struct rpccli_eventlog_CloseEventLog_state);
337         if (req == NULL) {
338                 return NULL;
339         }
340         state->out_mem_ctx = NULL;
341         state->dispatch_recv = cli->dispatch_recv;
342
343         /* In parameters */
344         state->orig.in.handle = _handle;
345
346         /* Out parameters */
347         state->orig.out.handle = _handle;
348
349         /* Result */
350         ZERO_STRUCT(state->orig.out.result);
351
352         if (DEBUGLEVEL >= 10) {
353                 NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, &state->orig);
354         }
355
356         state->out_mem_ctx = talloc_named_const(state, 0,
357                              "rpccli_eventlog_CloseEventLog_out_memory");
358         if (tevent_req_nomem(state->out_mem_ctx, req)) {
359                 return tevent_req_post(req, ev);
360         }
361
362         /* make a temporary copy, that we pass to the dispatch function */
363         state->tmp = state->orig;
364
365         subreq = cli->dispatch_send(state, ev, cli,
366                                     &ndr_table_eventlog,
367                                     NDR_EVENTLOG_CLOSEEVENTLOG,
368                                     &state->tmp);
369         if (tevent_req_nomem(subreq, req)) {
370                 return tevent_req_post(req, ev);
371         }
372         tevent_req_set_callback(subreq, rpccli_eventlog_CloseEventLog_done, req);
373         return req;
374 }
375
376 static void rpccli_eventlog_CloseEventLog_done(struct tevent_req *subreq)
377 {
378         struct tevent_req *req = tevent_req_callback_data(
379                 subreq, struct tevent_req);
380         struct rpccli_eventlog_CloseEventLog_state *state = tevent_req_data(
381                 req, struct rpccli_eventlog_CloseEventLog_state);
382         NTSTATUS status;
383         TALLOC_CTX *mem_ctx;
384
385         if (state->out_mem_ctx) {
386                 mem_ctx = state->out_mem_ctx;
387         } else {
388                 mem_ctx = state;
389         }
390
391         status = state->dispatch_recv(subreq, mem_ctx);
392         TALLOC_FREE(subreq);
393         if (!NT_STATUS_IS_OK(status)) {
394                 tevent_req_nterror(req, status);
395                 return;
396         }
397
398         /* Copy out parameters */
399         *state->orig.out.handle = *state->tmp.out.handle;
400
401         /* Copy result */
402         state->orig.out.result = state->tmp.out.result;
403
404         /* Reset temporary structure */
405         ZERO_STRUCT(state->tmp);
406
407         if (DEBUGLEVEL >= 10) {
408                 NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, &state->orig);
409         }
410
411         tevent_req_done(req);
412 }
413
414 NTSTATUS rpccli_eventlog_CloseEventLog_recv(struct tevent_req *req,
415                                             TALLOC_CTX *mem_ctx,
416                                             NTSTATUS *result)
417 {
418         struct rpccli_eventlog_CloseEventLog_state *state = tevent_req_data(
419                 req, struct rpccli_eventlog_CloseEventLog_state);
420         NTSTATUS status;
421
422         if (tevent_req_is_nterror(req, &status)) {
423                 tevent_req_received(req);
424                 return status;
425         }
426
427         /* Steal possbile out parameters to the callers context */
428         talloc_steal(mem_ctx, state->out_mem_ctx);
429
430         /* Return result */
431         *result = state->orig.out.result;
432
433         tevent_req_received(req);
434         return NT_STATUS_OK;
435 }
436
437 NTSTATUS rpccli_eventlog_CloseEventLog(struct rpc_pipe_client *cli,
438                                        TALLOC_CTX *mem_ctx,
439                                        struct policy_handle *handle /* [in,out] [ref] */)
440 {
441         struct eventlog_CloseEventLog r;
442         NTSTATUS status;
443
444         /* In parameters */
445         r.in.handle = handle;
446
447         if (DEBUGLEVEL >= 10) {
448                 NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, &r);
449         }
450
451         status = cli->dispatch(cli,
452                                 mem_ctx,
453                                 &ndr_table_eventlog,
454                                 NDR_EVENTLOG_CLOSEEVENTLOG,
455                                 &r);
456
457         if (!NT_STATUS_IS_OK(status)) {
458                 return status;
459         }
460
461         if (DEBUGLEVEL >= 10) {
462                 NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, &r);
463         }
464
465         if (NT_STATUS_IS_ERR(status)) {
466                 return status;
467         }
468
469         /* Return variables */
470         *handle = *r.out.handle;
471
472         /* Return result */
473         return r.out.result;
474 }
475
476 struct rpccli_eventlog_DeregisterEventSource_state {
477         struct eventlog_DeregisterEventSource orig;
478         struct eventlog_DeregisterEventSource tmp;
479         TALLOC_CTX *out_mem_ctx;
480         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
481 };
482
483 static void rpccli_eventlog_DeregisterEventSource_done(struct tevent_req *subreq);
484
485 struct tevent_req *rpccli_eventlog_DeregisterEventSource_send(TALLOC_CTX *mem_ctx,
486                                                               struct tevent_context *ev,
487                                                               struct rpc_pipe_client *cli,
488                                                               struct policy_handle *_handle /* [in,out] [ref] */)
489 {
490         struct tevent_req *req;
491         struct rpccli_eventlog_DeregisterEventSource_state *state;
492         struct tevent_req *subreq;
493
494         req = tevent_req_create(mem_ctx, &state,
495                                 struct rpccli_eventlog_DeregisterEventSource_state);
496         if (req == NULL) {
497                 return NULL;
498         }
499         state->out_mem_ctx = NULL;
500         state->dispatch_recv = cli->dispatch_recv;
501
502         /* In parameters */
503         state->orig.in.handle = _handle;
504
505         /* Out parameters */
506         state->orig.out.handle = _handle;
507
508         /* Result */
509         ZERO_STRUCT(state->orig.out.result);
510
511         if (DEBUGLEVEL >= 10) {
512                 NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, &state->orig);
513         }
514
515         state->out_mem_ctx = talloc_named_const(state, 0,
516                              "rpccli_eventlog_DeregisterEventSource_out_memory");
517         if (tevent_req_nomem(state->out_mem_ctx, req)) {
518                 return tevent_req_post(req, ev);
519         }
520
521         /* make a temporary copy, that we pass to the dispatch function */
522         state->tmp = state->orig;
523
524         subreq = cli->dispatch_send(state, ev, cli,
525                                     &ndr_table_eventlog,
526                                     NDR_EVENTLOG_DEREGISTEREVENTSOURCE,
527                                     &state->tmp);
528         if (tevent_req_nomem(subreq, req)) {
529                 return tevent_req_post(req, ev);
530         }
531         tevent_req_set_callback(subreq, rpccli_eventlog_DeregisterEventSource_done, req);
532         return req;
533 }
534
535 static void rpccli_eventlog_DeregisterEventSource_done(struct tevent_req *subreq)
536 {
537         struct tevent_req *req = tevent_req_callback_data(
538                 subreq, struct tevent_req);
539         struct rpccli_eventlog_DeregisterEventSource_state *state = tevent_req_data(
540                 req, struct rpccli_eventlog_DeregisterEventSource_state);
541         NTSTATUS status;
542         TALLOC_CTX *mem_ctx;
543
544         if (state->out_mem_ctx) {
545                 mem_ctx = state->out_mem_ctx;
546         } else {
547                 mem_ctx = state;
548         }
549
550         status = state->dispatch_recv(subreq, mem_ctx);
551         TALLOC_FREE(subreq);
552         if (!NT_STATUS_IS_OK(status)) {
553                 tevent_req_nterror(req, status);
554                 return;
555         }
556
557         /* Copy out parameters */
558         *state->orig.out.handle = *state->tmp.out.handle;
559
560         /* Copy result */
561         state->orig.out.result = state->tmp.out.result;
562
563         /* Reset temporary structure */
564         ZERO_STRUCT(state->tmp);
565
566         if (DEBUGLEVEL >= 10) {
567                 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &state->orig);
568         }
569
570         tevent_req_done(req);
571 }
572
573 NTSTATUS rpccli_eventlog_DeregisterEventSource_recv(struct tevent_req *req,
574                                                     TALLOC_CTX *mem_ctx,
575                                                     NTSTATUS *result)
576 {
577         struct rpccli_eventlog_DeregisterEventSource_state *state = tevent_req_data(
578                 req, struct rpccli_eventlog_DeregisterEventSource_state);
579         NTSTATUS status;
580
581         if (tevent_req_is_nterror(req, &status)) {
582                 tevent_req_received(req);
583                 return status;
584         }
585
586         /* Steal possbile out parameters to the callers context */
587         talloc_steal(mem_ctx, state->out_mem_ctx);
588
589         /* Return result */
590         *result = state->orig.out.result;
591
592         tevent_req_received(req);
593         return NT_STATUS_OK;
594 }
595
596 NTSTATUS rpccli_eventlog_DeregisterEventSource(struct rpc_pipe_client *cli,
597                                                TALLOC_CTX *mem_ctx,
598                                                struct policy_handle *handle /* [in,out] [ref] */)
599 {
600         struct eventlog_DeregisterEventSource r;
601         NTSTATUS status;
602
603         /* In parameters */
604         r.in.handle = handle;
605
606         if (DEBUGLEVEL >= 10) {
607                 NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, &r);
608         }
609
610         status = cli->dispatch(cli,
611                                 mem_ctx,
612                                 &ndr_table_eventlog,
613                                 NDR_EVENTLOG_DEREGISTEREVENTSOURCE,
614                                 &r);
615
616         if (!NT_STATUS_IS_OK(status)) {
617                 return status;
618         }
619
620         if (DEBUGLEVEL >= 10) {
621                 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &r);
622         }
623
624         if (NT_STATUS_IS_ERR(status)) {
625                 return status;
626         }
627
628         /* Return variables */
629         *handle = *r.out.handle;
630
631         /* Return result */
632         return r.out.result;
633 }
634
635 struct rpccli_eventlog_GetNumRecords_state {
636         struct eventlog_GetNumRecords orig;
637         struct eventlog_GetNumRecords tmp;
638         TALLOC_CTX *out_mem_ctx;
639         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
640 };
641
642 static void rpccli_eventlog_GetNumRecords_done(struct tevent_req *subreq);
643
644 struct tevent_req *rpccli_eventlog_GetNumRecords_send(TALLOC_CTX *mem_ctx,
645                                                       struct tevent_context *ev,
646                                                       struct rpc_pipe_client *cli,
647                                                       struct policy_handle *_handle /* [in] [ref] */,
648                                                       uint32_t *_number /* [out] [ref] */)
649 {
650         struct tevent_req *req;
651         struct rpccli_eventlog_GetNumRecords_state *state;
652         struct tevent_req *subreq;
653
654         req = tevent_req_create(mem_ctx, &state,
655                                 struct rpccli_eventlog_GetNumRecords_state);
656         if (req == NULL) {
657                 return NULL;
658         }
659         state->out_mem_ctx = NULL;
660         state->dispatch_recv = cli->dispatch_recv;
661
662         /* In parameters */
663         state->orig.in.handle = _handle;
664
665         /* Out parameters */
666         state->orig.out.number = _number;
667
668         /* Result */
669         ZERO_STRUCT(state->orig.out.result);
670
671         if (DEBUGLEVEL >= 10) {
672                 NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, &state->orig);
673         }
674
675         state->out_mem_ctx = talloc_named_const(state, 0,
676                              "rpccli_eventlog_GetNumRecords_out_memory");
677         if (tevent_req_nomem(state->out_mem_ctx, req)) {
678                 return tevent_req_post(req, ev);
679         }
680
681         /* make a temporary copy, that we pass to the dispatch function */
682         state->tmp = state->orig;
683
684         subreq = cli->dispatch_send(state, ev, cli,
685                                     &ndr_table_eventlog,
686                                     NDR_EVENTLOG_GETNUMRECORDS,
687                                     &state->tmp);
688         if (tevent_req_nomem(subreq, req)) {
689                 return tevent_req_post(req, ev);
690         }
691         tevent_req_set_callback(subreq, rpccli_eventlog_GetNumRecords_done, req);
692         return req;
693 }
694
695 static void rpccli_eventlog_GetNumRecords_done(struct tevent_req *subreq)
696 {
697         struct tevent_req *req = tevent_req_callback_data(
698                 subreq, struct tevent_req);
699         struct rpccli_eventlog_GetNumRecords_state *state = tevent_req_data(
700                 req, struct rpccli_eventlog_GetNumRecords_state);
701         NTSTATUS status;
702         TALLOC_CTX *mem_ctx;
703
704         if (state->out_mem_ctx) {
705                 mem_ctx = state->out_mem_ctx;
706         } else {
707                 mem_ctx = state;
708         }
709
710         status = state->dispatch_recv(subreq, mem_ctx);
711         TALLOC_FREE(subreq);
712         if (!NT_STATUS_IS_OK(status)) {
713                 tevent_req_nterror(req, status);
714                 return;
715         }
716
717         /* Copy out parameters */
718         *state->orig.out.number = *state->tmp.out.number;
719
720         /* Copy result */
721         state->orig.out.result = state->tmp.out.result;
722
723         /* Reset temporary structure */
724         ZERO_STRUCT(state->tmp);
725
726         if (DEBUGLEVEL >= 10) {
727                 NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &state->orig);
728         }
729
730         tevent_req_done(req);
731 }
732
733 NTSTATUS rpccli_eventlog_GetNumRecords_recv(struct tevent_req *req,
734                                             TALLOC_CTX *mem_ctx,
735                                             NTSTATUS *result)
736 {
737         struct rpccli_eventlog_GetNumRecords_state *state = tevent_req_data(
738                 req, struct rpccli_eventlog_GetNumRecords_state);
739         NTSTATUS status;
740
741         if (tevent_req_is_nterror(req, &status)) {
742                 tevent_req_received(req);
743                 return status;
744         }
745
746         /* Steal possbile out parameters to the callers context */
747         talloc_steal(mem_ctx, state->out_mem_ctx);
748
749         /* Return result */
750         *result = state->orig.out.result;
751
752         tevent_req_received(req);
753         return NT_STATUS_OK;
754 }
755
756 NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli,
757                                        TALLOC_CTX *mem_ctx,
758                                        struct policy_handle *handle /* [in] [ref] */,
759                                        uint32_t *number /* [out] [ref] */)
760 {
761         struct eventlog_GetNumRecords r;
762         NTSTATUS status;
763
764         /* In parameters */
765         r.in.handle = handle;
766
767         if (DEBUGLEVEL >= 10) {
768                 NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, &r);
769         }
770
771         status = cli->dispatch(cli,
772                                 mem_ctx,
773                                 &ndr_table_eventlog,
774                                 NDR_EVENTLOG_GETNUMRECORDS,
775                                 &r);
776
777         if (!NT_STATUS_IS_OK(status)) {
778                 return status;
779         }
780
781         if (DEBUGLEVEL >= 10) {
782                 NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &r);
783         }
784
785         if (NT_STATUS_IS_ERR(status)) {
786                 return status;
787         }
788
789         /* Return variables */
790         *number = *r.out.number;
791
792         /* Return result */
793         return r.out.result;
794 }
795
796 struct rpccli_eventlog_GetOldestRecord_state {
797         struct eventlog_GetOldestRecord orig;
798         struct eventlog_GetOldestRecord tmp;
799         TALLOC_CTX *out_mem_ctx;
800         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
801 };
802
803 static void rpccli_eventlog_GetOldestRecord_done(struct tevent_req *subreq);
804
805 struct tevent_req *rpccli_eventlog_GetOldestRecord_send(TALLOC_CTX *mem_ctx,
806                                                         struct tevent_context *ev,
807                                                         struct rpc_pipe_client *cli,
808                                                         struct policy_handle *_handle /* [in] [ref] */,
809                                                         uint32_t *_oldest_entry /* [out] [ref] */)
810 {
811         struct tevent_req *req;
812         struct rpccli_eventlog_GetOldestRecord_state *state;
813         struct tevent_req *subreq;
814
815         req = tevent_req_create(mem_ctx, &state,
816                                 struct rpccli_eventlog_GetOldestRecord_state);
817         if (req == NULL) {
818                 return NULL;
819         }
820         state->out_mem_ctx = NULL;
821         state->dispatch_recv = cli->dispatch_recv;
822
823         /* In parameters */
824         state->orig.in.handle = _handle;
825
826         /* Out parameters */
827         state->orig.out.oldest_entry = _oldest_entry;
828
829         /* Result */
830         ZERO_STRUCT(state->orig.out.result);
831
832         if (DEBUGLEVEL >= 10) {
833                 NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &state->orig);
834         }
835
836         state->out_mem_ctx = talloc_named_const(state, 0,
837                              "rpccli_eventlog_GetOldestRecord_out_memory");
838         if (tevent_req_nomem(state->out_mem_ctx, req)) {
839                 return tevent_req_post(req, ev);
840         }
841
842         /* make a temporary copy, that we pass to the dispatch function */
843         state->tmp = state->orig;
844
845         subreq = cli->dispatch_send(state, ev, cli,
846                                     &ndr_table_eventlog,
847                                     NDR_EVENTLOG_GETOLDESTRECORD,
848                                     &state->tmp);
849         if (tevent_req_nomem(subreq, req)) {
850                 return tevent_req_post(req, ev);
851         }
852         tevent_req_set_callback(subreq, rpccli_eventlog_GetOldestRecord_done, req);
853         return req;
854 }
855
856 static void rpccli_eventlog_GetOldestRecord_done(struct tevent_req *subreq)
857 {
858         struct tevent_req *req = tevent_req_callback_data(
859                 subreq, struct tevent_req);
860         struct rpccli_eventlog_GetOldestRecord_state *state = tevent_req_data(
861                 req, struct rpccli_eventlog_GetOldestRecord_state);
862         NTSTATUS status;
863         TALLOC_CTX *mem_ctx;
864
865         if (state->out_mem_ctx) {
866                 mem_ctx = state->out_mem_ctx;
867         } else {
868                 mem_ctx = state;
869         }
870
871         status = state->dispatch_recv(subreq, mem_ctx);
872         TALLOC_FREE(subreq);
873         if (!NT_STATUS_IS_OK(status)) {
874                 tevent_req_nterror(req, status);
875                 return;
876         }
877
878         /* Copy out parameters */
879         *state->orig.out.oldest_entry = *state->tmp.out.oldest_entry;
880
881         /* Copy result */
882         state->orig.out.result = state->tmp.out.result;
883
884         /* Reset temporary structure */
885         ZERO_STRUCT(state->tmp);
886
887         if (DEBUGLEVEL >= 10) {
888                 NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &state->orig);
889         }
890
891         tevent_req_done(req);
892 }
893
894 NTSTATUS rpccli_eventlog_GetOldestRecord_recv(struct tevent_req *req,
895                                               TALLOC_CTX *mem_ctx,
896                                               NTSTATUS *result)
897 {
898         struct rpccli_eventlog_GetOldestRecord_state *state = tevent_req_data(
899                 req, struct rpccli_eventlog_GetOldestRecord_state);
900         NTSTATUS status;
901
902         if (tevent_req_is_nterror(req, &status)) {
903                 tevent_req_received(req);
904                 return status;
905         }
906
907         /* Steal possbile out parameters to the callers context */
908         talloc_steal(mem_ctx, state->out_mem_ctx);
909
910         /* Return result */
911         *result = state->orig.out.result;
912
913         tevent_req_received(req);
914         return NT_STATUS_OK;
915 }
916
917 NTSTATUS rpccli_eventlog_GetOldestRecord(struct rpc_pipe_client *cli,
918                                          TALLOC_CTX *mem_ctx,
919                                          struct policy_handle *handle /* [in] [ref] */,
920                                          uint32_t *oldest_entry /* [out] [ref] */)
921 {
922         struct eventlog_GetOldestRecord r;
923         NTSTATUS status;
924
925         /* In parameters */
926         r.in.handle = handle;
927
928         if (DEBUGLEVEL >= 10) {
929                 NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &r);
930         }
931
932         status = cli->dispatch(cli,
933                                 mem_ctx,
934                                 &ndr_table_eventlog,
935                                 NDR_EVENTLOG_GETOLDESTRECORD,
936                                 &r);
937
938         if (!NT_STATUS_IS_OK(status)) {
939                 return status;
940         }
941
942         if (DEBUGLEVEL >= 10) {
943                 NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &r);
944         }
945
946         if (NT_STATUS_IS_ERR(status)) {
947                 return status;
948         }
949
950         /* Return variables */
951         *oldest_entry = *r.out.oldest_entry;
952
953         /* Return result */
954         return r.out.result;
955 }
956
957 struct rpccli_eventlog_ChangeNotify_state {
958         struct eventlog_ChangeNotify orig;
959         struct eventlog_ChangeNotify tmp;
960         TALLOC_CTX *out_mem_ctx;
961         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
962 };
963
964 static void rpccli_eventlog_ChangeNotify_done(struct tevent_req *subreq);
965
966 struct tevent_req *rpccli_eventlog_ChangeNotify_send(TALLOC_CTX *mem_ctx,
967                                                      struct tevent_context *ev,
968                                                      struct rpc_pipe_client *cli)
969 {
970         struct tevent_req *req;
971         struct rpccli_eventlog_ChangeNotify_state *state;
972         struct tevent_req *subreq;
973
974         req = tevent_req_create(mem_ctx, &state,
975                                 struct rpccli_eventlog_ChangeNotify_state);
976         if (req == NULL) {
977                 return NULL;
978         }
979         state->out_mem_ctx = NULL;
980         state->dispatch_recv = cli->dispatch_recv;
981
982         /* In parameters */
983
984         /* Out parameters */
985
986         /* Result */
987         ZERO_STRUCT(state->orig.out.result);
988
989         if (DEBUGLEVEL >= 10) {
990                 NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, &state->orig);
991         }
992
993         /* make a temporary copy, that we pass to the dispatch function */
994         state->tmp = state->orig;
995
996         subreq = cli->dispatch_send(state, ev, cli,
997                                     &ndr_table_eventlog,
998                                     NDR_EVENTLOG_CHANGENOTIFY,
999                                     &state->tmp);
1000         if (tevent_req_nomem(subreq, req)) {
1001                 return tevent_req_post(req, ev);
1002         }
1003         tevent_req_set_callback(subreq, rpccli_eventlog_ChangeNotify_done, req);
1004         return req;
1005 }
1006
1007 static void rpccli_eventlog_ChangeNotify_done(struct tevent_req *subreq)
1008 {
1009         struct tevent_req *req = tevent_req_callback_data(
1010                 subreq, struct tevent_req);
1011         struct rpccli_eventlog_ChangeNotify_state *state = tevent_req_data(
1012                 req, struct rpccli_eventlog_ChangeNotify_state);
1013         NTSTATUS status;
1014         TALLOC_CTX *mem_ctx;
1015
1016         if (state->out_mem_ctx) {
1017                 mem_ctx = state->out_mem_ctx;
1018         } else {
1019                 mem_ctx = state;
1020         }
1021
1022         status = state->dispatch_recv(subreq, mem_ctx);
1023         TALLOC_FREE(subreq);
1024         if (!NT_STATUS_IS_OK(status)) {
1025                 tevent_req_nterror(req, status);
1026                 return;
1027         }
1028
1029         /* Copy out parameters */
1030
1031         /* Copy result */
1032         state->orig.out.result = state->tmp.out.result;
1033
1034         /* Reset temporary structure */
1035         ZERO_STRUCT(state->tmp);
1036
1037         if (DEBUGLEVEL >= 10) {
1038                 NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &state->orig);
1039         }
1040
1041         tevent_req_done(req);
1042 }
1043
1044 NTSTATUS rpccli_eventlog_ChangeNotify_recv(struct tevent_req *req,
1045                                            TALLOC_CTX *mem_ctx,
1046                                            NTSTATUS *result)
1047 {
1048         struct rpccli_eventlog_ChangeNotify_state *state = tevent_req_data(
1049                 req, struct rpccli_eventlog_ChangeNotify_state);
1050         NTSTATUS status;
1051
1052         if (tevent_req_is_nterror(req, &status)) {
1053                 tevent_req_received(req);
1054                 return status;
1055         }
1056
1057         /* Steal possbile out parameters to the callers context */
1058         talloc_steal(mem_ctx, state->out_mem_ctx);
1059
1060         /* Return result */
1061         *result = state->orig.out.result;
1062
1063         tevent_req_received(req);
1064         return NT_STATUS_OK;
1065 }
1066
1067 NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli,
1068                                       TALLOC_CTX *mem_ctx)
1069 {
1070         struct eventlog_ChangeNotify r;
1071         NTSTATUS status;
1072
1073         /* In parameters */
1074
1075         if (DEBUGLEVEL >= 10) {
1076                 NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, &r);
1077         }
1078
1079         status = cli->dispatch(cli,
1080                                 mem_ctx,
1081                                 &ndr_table_eventlog,
1082                                 NDR_EVENTLOG_CHANGENOTIFY,
1083                                 &r);
1084
1085         if (!NT_STATUS_IS_OK(status)) {
1086                 return status;
1087         }
1088
1089         if (DEBUGLEVEL >= 10) {
1090                 NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &r);
1091         }
1092
1093         if (NT_STATUS_IS_ERR(status)) {
1094                 return status;
1095         }
1096
1097         /* Return variables */
1098
1099         /* Return result */
1100         return r.out.result;
1101 }
1102
1103 struct rpccli_eventlog_OpenEventLogW_state {
1104         struct eventlog_OpenEventLogW orig;
1105         struct eventlog_OpenEventLogW tmp;
1106         TALLOC_CTX *out_mem_ctx;
1107         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1108 };
1109
1110 static void rpccli_eventlog_OpenEventLogW_done(struct tevent_req *subreq);
1111
1112 struct tevent_req *rpccli_eventlog_OpenEventLogW_send(TALLOC_CTX *mem_ctx,
1113                                                       struct tevent_context *ev,
1114                                                       struct rpc_pipe_client *cli,
1115                                                       struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
1116                                                       struct lsa_String *_logname /* [in] [ref] */,
1117                                                       struct lsa_String *_servername /* [in] [ref] */,
1118                                                       uint32_t _major_version /* [in]  */,
1119                                                       uint32_t _minor_version /* [in]  */,
1120                                                       struct policy_handle *_handle /* [out] [ref] */)
1121 {
1122         struct tevent_req *req;
1123         struct rpccli_eventlog_OpenEventLogW_state *state;
1124         struct tevent_req *subreq;
1125
1126         req = tevent_req_create(mem_ctx, &state,
1127                                 struct rpccli_eventlog_OpenEventLogW_state);
1128         if (req == NULL) {
1129                 return NULL;
1130         }
1131         state->out_mem_ctx = NULL;
1132         state->dispatch_recv = cli->dispatch_recv;
1133
1134         /* In parameters */
1135         state->orig.in.unknown0 = _unknown0;
1136         state->orig.in.logname = _logname;
1137         state->orig.in.servername = _servername;
1138         state->orig.in.major_version = _major_version;
1139         state->orig.in.minor_version = _minor_version;
1140
1141         /* Out parameters */
1142         state->orig.out.handle = _handle;
1143
1144         /* Result */
1145         ZERO_STRUCT(state->orig.out.result);
1146
1147         if (DEBUGLEVEL >= 10) {
1148                 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, &state->orig);
1149         }
1150
1151         state->out_mem_ctx = talloc_named_const(state, 0,
1152                              "rpccli_eventlog_OpenEventLogW_out_memory");
1153         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1154                 return tevent_req_post(req, ev);
1155         }
1156
1157         /* make a temporary copy, that we pass to the dispatch function */
1158         state->tmp = state->orig;
1159
1160         subreq = cli->dispatch_send(state, ev, cli,
1161                                     &ndr_table_eventlog,
1162                                     NDR_EVENTLOG_OPENEVENTLOGW,
1163                                     &state->tmp);
1164         if (tevent_req_nomem(subreq, req)) {
1165                 return tevent_req_post(req, ev);
1166         }
1167         tevent_req_set_callback(subreq, rpccli_eventlog_OpenEventLogW_done, req);
1168         return req;
1169 }
1170
1171 static void rpccli_eventlog_OpenEventLogW_done(struct tevent_req *subreq)
1172 {
1173         struct tevent_req *req = tevent_req_callback_data(
1174                 subreq, struct tevent_req);
1175         struct rpccli_eventlog_OpenEventLogW_state *state = tevent_req_data(
1176                 req, struct rpccli_eventlog_OpenEventLogW_state);
1177         NTSTATUS status;
1178         TALLOC_CTX *mem_ctx;
1179
1180         if (state->out_mem_ctx) {
1181                 mem_ctx = state->out_mem_ctx;
1182         } else {
1183                 mem_ctx = state;
1184         }
1185
1186         status = state->dispatch_recv(subreq, mem_ctx);
1187         TALLOC_FREE(subreq);
1188         if (!NT_STATUS_IS_OK(status)) {
1189                 tevent_req_nterror(req, status);
1190                 return;
1191         }
1192
1193         /* Copy out parameters */
1194         *state->orig.out.handle = *state->tmp.out.handle;
1195
1196         /* Copy result */
1197         state->orig.out.result = state->tmp.out.result;
1198
1199         /* Reset temporary structure */
1200         ZERO_STRUCT(state->tmp);
1201
1202         if (DEBUGLEVEL >= 10) {
1203                 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &state->orig);
1204         }
1205
1206         tevent_req_done(req);
1207 }
1208
1209 NTSTATUS rpccli_eventlog_OpenEventLogW_recv(struct tevent_req *req,
1210                                             TALLOC_CTX *mem_ctx,
1211                                             NTSTATUS *result)
1212 {
1213         struct rpccli_eventlog_OpenEventLogW_state *state = tevent_req_data(
1214                 req, struct rpccli_eventlog_OpenEventLogW_state);
1215         NTSTATUS status;
1216
1217         if (tevent_req_is_nterror(req, &status)) {
1218                 tevent_req_received(req);
1219                 return status;
1220         }
1221
1222         /* Steal possbile out parameters to the callers context */
1223         talloc_steal(mem_ctx, state->out_mem_ctx);
1224
1225         /* Return result */
1226         *result = state->orig.out.result;
1227
1228         tevent_req_received(req);
1229         return NT_STATUS_OK;
1230 }
1231
1232 NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli,
1233                                        TALLOC_CTX *mem_ctx,
1234                                        struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
1235                                        struct lsa_String *logname /* [in] [ref] */,
1236                                        struct lsa_String *servername /* [in] [ref] */,
1237                                        uint32_t major_version /* [in]  */,
1238                                        uint32_t minor_version /* [in]  */,
1239                                        struct policy_handle *handle /* [out] [ref] */)
1240 {
1241         struct eventlog_OpenEventLogW r;
1242         NTSTATUS status;
1243
1244         /* In parameters */
1245         r.in.unknown0 = unknown0;
1246         r.in.logname = logname;
1247         r.in.servername = servername;
1248         r.in.major_version = major_version;
1249         r.in.minor_version = minor_version;
1250
1251         if (DEBUGLEVEL >= 10) {
1252                 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, &r);
1253         }
1254
1255         status = cli->dispatch(cli,
1256                                 mem_ctx,
1257                                 &ndr_table_eventlog,
1258                                 NDR_EVENTLOG_OPENEVENTLOGW,
1259                                 &r);
1260
1261         if (!NT_STATUS_IS_OK(status)) {
1262                 return status;
1263         }
1264
1265         if (DEBUGLEVEL >= 10) {
1266                 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &r);
1267         }
1268
1269         if (NT_STATUS_IS_ERR(status)) {
1270                 return status;
1271         }
1272
1273         /* Return variables */
1274         *handle = *r.out.handle;
1275
1276         /* Return result */
1277         return r.out.result;
1278 }
1279
1280 struct rpccli_eventlog_RegisterEventSourceW_state {
1281         struct eventlog_RegisterEventSourceW orig;
1282         struct eventlog_RegisterEventSourceW tmp;
1283         TALLOC_CTX *out_mem_ctx;
1284         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1285 };
1286
1287 static void rpccli_eventlog_RegisterEventSourceW_done(struct tevent_req *subreq);
1288
1289 struct tevent_req *rpccli_eventlog_RegisterEventSourceW_send(TALLOC_CTX *mem_ctx,
1290                                                              struct tevent_context *ev,
1291                                                              struct rpc_pipe_client *cli,
1292                                                              struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
1293                                                              struct lsa_String *_module_name /* [in] [ref] */,
1294                                                              struct lsa_String *_reg_module_name /* [in] [ref] */,
1295                                                              uint32_t _major_version /* [in]  */,
1296                                                              uint32_t _minor_version /* [in]  */,
1297                                                              struct policy_handle *_log_handle /* [out] [ref] */)
1298 {
1299         struct tevent_req *req;
1300         struct rpccli_eventlog_RegisterEventSourceW_state *state;
1301         struct tevent_req *subreq;
1302
1303         req = tevent_req_create(mem_ctx, &state,
1304                                 struct rpccli_eventlog_RegisterEventSourceW_state);
1305         if (req == NULL) {
1306                 return NULL;
1307         }
1308         state->out_mem_ctx = NULL;
1309         state->dispatch_recv = cli->dispatch_recv;
1310
1311         /* In parameters */
1312         state->orig.in.unknown0 = _unknown0;
1313         state->orig.in.module_name = _module_name;
1314         state->orig.in.reg_module_name = _reg_module_name;
1315         state->orig.in.major_version = _major_version;
1316         state->orig.in.minor_version = _minor_version;
1317
1318         /* Out parameters */
1319         state->orig.out.log_handle = _log_handle;
1320
1321         /* Result */
1322         ZERO_STRUCT(state->orig.out.result);
1323
1324         if (DEBUGLEVEL >= 10) {
1325                 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, &state->orig);
1326         }
1327
1328         state->out_mem_ctx = talloc_named_const(state, 0,
1329                              "rpccli_eventlog_RegisterEventSourceW_out_memory");
1330         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1331                 return tevent_req_post(req, ev);
1332         }
1333
1334         /* make a temporary copy, that we pass to the dispatch function */
1335         state->tmp = state->orig;
1336
1337         subreq = cli->dispatch_send(state, ev, cli,
1338                                     &ndr_table_eventlog,
1339                                     NDR_EVENTLOG_REGISTEREVENTSOURCEW,
1340                                     &state->tmp);
1341         if (tevent_req_nomem(subreq, req)) {
1342                 return tevent_req_post(req, ev);
1343         }
1344         tevent_req_set_callback(subreq, rpccli_eventlog_RegisterEventSourceW_done, req);
1345         return req;
1346 }
1347
1348 static void rpccli_eventlog_RegisterEventSourceW_done(struct tevent_req *subreq)
1349 {
1350         struct tevent_req *req = tevent_req_callback_data(
1351                 subreq, struct tevent_req);
1352         struct rpccli_eventlog_RegisterEventSourceW_state *state = tevent_req_data(
1353                 req, struct rpccli_eventlog_RegisterEventSourceW_state);
1354         NTSTATUS status;
1355         TALLOC_CTX *mem_ctx;
1356
1357         if (state->out_mem_ctx) {
1358                 mem_ctx = state->out_mem_ctx;
1359         } else {
1360                 mem_ctx = state;
1361         }
1362
1363         status = state->dispatch_recv(subreq, mem_ctx);
1364         TALLOC_FREE(subreq);
1365         if (!NT_STATUS_IS_OK(status)) {
1366                 tevent_req_nterror(req, status);
1367                 return;
1368         }
1369
1370         /* Copy out parameters */
1371         *state->orig.out.log_handle = *state->tmp.out.log_handle;
1372
1373         /* Copy result */
1374         state->orig.out.result = state->tmp.out.result;
1375
1376         /* Reset temporary structure */
1377         ZERO_STRUCT(state->tmp);
1378
1379         if (DEBUGLEVEL >= 10) {
1380                 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &state->orig);
1381         }
1382
1383         tevent_req_done(req);
1384 }
1385
1386 NTSTATUS rpccli_eventlog_RegisterEventSourceW_recv(struct tevent_req *req,
1387                                                    TALLOC_CTX *mem_ctx,
1388                                                    NTSTATUS *result)
1389 {
1390         struct rpccli_eventlog_RegisterEventSourceW_state *state = tevent_req_data(
1391                 req, struct rpccli_eventlog_RegisterEventSourceW_state);
1392         NTSTATUS status;
1393
1394         if (tevent_req_is_nterror(req, &status)) {
1395                 tevent_req_received(req);
1396                 return status;
1397         }
1398
1399         /* Steal possbile out parameters to the callers context */
1400         talloc_steal(mem_ctx, state->out_mem_ctx);
1401
1402         /* Return result */
1403         *result = state->orig.out.result;
1404
1405         tevent_req_received(req);
1406         return NT_STATUS_OK;
1407 }
1408
1409 NTSTATUS rpccli_eventlog_RegisterEventSourceW(struct rpc_pipe_client *cli,
1410                                               TALLOC_CTX *mem_ctx,
1411                                               struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
1412                                               struct lsa_String *module_name /* [in] [ref] */,
1413                                               struct lsa_String *reg_module_name /* [in] [ref] */,
1414                                               uint32_t major_version /* [in]  */,
1415                                               uint32_t minor_version /* [in]  */,
1416                                               struct policy_handle *log_handle /* [out] [ref] */)
1417 {
1418         struct eventlog_RegisterEventSourceW r;
1419         NTSTATUS status;
1420
1421         /* In parameters */
1422         r.in.unknown0 = unknown0;
1423         r.in.module_name = module_name;
1424         r.in.reg_module_name = reg_module_name;
1425         r.in.major_version = major_version;
1426         r.in.minor_version = minor_version;
1427
1428         if (DEBUGLEVEL >= 10) {
1429                 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, &r);
1430         }
1431
1432         status = cli->dispatch(cli,
1433                                 mem_ctx,
1434                                 &ndr_table_eventlog,
1435                                 NDR_EVENTLOG_REGISTEREVENTSOURCEW,
1436                                 &r);
1437
1438         if (!NT_STATUS_IS_OK(status)) {
1439                 return status;
1440         }
1441
1442         if (DEBUGLEVEL >= 10) {
1443                 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &r);
1444         }
1445
1446         if (NT_STATUS_IS_ERR(status)) {
1447                 return status;
1448         }
1449
1450         /* Return variables */
1451         *log_handle = *r.out.log_handle;
1452
1453         /* Return result */
1454         return r.out.result;
1455 }
1456
1457 struct rpccli_eventlog_OpenBackupEventLogW_state {
1458         struct eventlog_OpenBackupEventLogW orig;
1459         struct eventlog_OpenBackupEventLogW tmp;
1460         TALLOC_CTX *out_mem_ctx;
1461         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1462 };
1463
1464 static void rpccli_eventlog_OpenBackupEventLogW_done(struct tevent_req *subreq);
1465
1466 struct tevent_req *rpccli_eventlog_OpenBackupEventLogW_send(TALLOC_CTX *mem_ctx,
1467                                                             struct tevent_context *ev,
1468                                                             struct rpc_pipe_client *cli,
1469                                                             struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
1470                                                             struct lsa_String *_backup_logname /* [in] [ref] */,
1471                                                             uint32_t _major_version /* [in]  */,
1472                                                             uint32_t _minor_version /* [in]  */,
1473                                                             struct policy_handle *_handle /* [out] [ref] */)
1474 {
1475         struct tevent_req *req;
1476         struct rpccli_eventlog_OpenBackupEventLogW_state *state;
1477         struct tevent_req *subreq;
1478
1479         req = tevent_req_create(mem_ctx, &state,
1480                                 struct rpccli_eventlog_OpenBackupEventLogW_state);
1481         if (req == NULL) {
1482                 return NULL;
1483         }
1484         state->out_mem_ctx = NULL;
1485         state->dispatch_recv = cli->dispatch_recv;
1486
1487         /* In parameters */
1488         state->orig.in.unknown0 = _unknown0;
1489         state->orig.in.backup_logname = _backup_logname;
1490         state->orig.in.major_version = _major_version;
1491         state->orig.in.minor_version = _minor_version;
1492
1493         /* Out parameters */
1494         state->orig.out.handle = _handle;
1495
1496         /* Result */
1497         ZERO_STRUCT(state->orig.out.result);
1498
1499         if (DEBUGLEVEL >= 10) {
1500                 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, &state->orig);
1501         }
1502
1503         state->out_mem_ctx = talloc_named_const(state, 0,
1504                              "rpccli_eventlog_OpenBackupEventLogW_out_memory");
1505         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1506                 return tevent_req_post(req, ev);
1507         }
1508
1509         /* make a temporary copy, that we pass to the dispatch function */
1510         state->tmp = state->orig;
1511
1512         subreq = cli->dispatch_send(state, ev, cli,
1513                                     &ndr_table_eventlog,
1514                                     NDR_EVENTLOG_OPENBACKUPEVENTLOGW,
1515                                     &state->tmp);
1516         if (tevent_req_nomem(subreq, req)) {
1517                 return tevent_req_post(req, ev);
1518         }
1519         tevent_req_set_callback(subreq, rpccli_eventlog_OpenBackupEventLogW_done, req);
1520         return req;
1521 }
1522
1523 static void rpccli_eventlog_OpenBackupEventLogW_done(struct tevent_req *subreq)
1524 {
1525         struct tevent_req *req = tevent_req_callback_data(
1526                 subreq, struct tevent_req);
1527         struct rpccli_eventlog_OpenBackupEventLogW_state *state = tevent_req_data(
1528                 req, struct rpccli_eventlog_OpenBackupEventLogW_state);
1529         NTSTATUS status;
1530         TALLOC_CTX *mem_ctx;
1531
1532         if (state->out_mem_ctx) {
1533                 mem_ctx = state->out_mem_ctx;
1534         } else {
1535                 mem_ctx = state;
1536         }
1537
1538         status = state->dispatch_recv(subreq, mem_ctx);
1539         TALLOC_FREE(subreq);
1540         if (!NT_STATUS_IS_OK(status)) {
1541                 tevent_req_nterror(req, status);
1542                 return;
1543         }
1544
1545         /* Copy out parameters */
1546         *state->orig.out.handle = *state->tmp.out.handle;
1547
1548         /* Copy result */
1549         state->orig.out.result = state->tmp.out.result;
1550
1551         /* Reset temporary structure */
1552         ZERO_STRUCT(state->tmp);
1553
1554         if (DEBUGLEVEL >= 10) {
1555                 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &state->orig);
1556         }
1557
1558         tevent_req_done(req);
1559 }
1560
1561 NTSTATUS rpccli_eventlog_OpenBackupEventLogW_recv(struct tevent_req *req,
1562                                                   TALLOC_CTX *mem_ctx,
1563                                                   NTSTATUS *result)
1564 {
1565         struct rpccli_eventlog_OpenBackupEventLogW_state *state = tevent_req_data(
1566                 req, struct rpccli_eventlog_OpenBackupEventLogW_state);
1567         NTSTATUS status;
1568
1569         if (tevent_req_is_nterror(req, &status)) {
1570                 tevent_req_received(req);
1571                 return status;
1572         }
1573
1574         /* Steal possbile out parameters to the callers context */
1575         talloc_steal(mem_ctx, state->out_mem_ctx);
1576
1577         /* Return result */
1578         *result = state->orig.out.result;
1579
1580         tevent_req_received(req);
1581         return NT_STATUS_OK;
1582 }
1583
1584 NTSTATUS rpccli_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli,
1585                                              TALLOC_CTX *mem_ctx,
1586                                              struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
1587                                              struct lsa_String *backup_logname /* [in] [ref] */,
1588                                              uint32_t major_version /* [in]  */,
1589                                              uint32_t minor_version /* [in]  */,
1590                                              struct policy_handle *handle /* [out] [ref] */)
1591 {
1592         struct eventlog_OpenBackupEventLogW r;
1593         NTSTATUS status;
1594
1595         /* In parameters */
1596         r.in.unknown0 = unknown0;
1597         r.in.backup_logname = backup_logname;
1598         r.in.major_version = major_version;
1599         r.in.minor_version = minor_version;
1600
1601         if (DEBUGLEVEL >= 10) {
1602                 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, &r);
1603         }
1604
1605         status = cli->dispatch(cli,
1606                                 mem_ctx,
1607                                 &ndr_table_eventlog,
1608                                 NDR_EVENTLOG_OPENBACKUPEVENTLOGW,
1609                                 &r);
1610
1611         if (!NT_STATUS_IS_OK(status)) {
1612                 return status;
1613         }
1614
1615         if (DEBUGLEVEL >= 10) {
1616                 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &r);
1617         }
1618
1619         if (NT_STATUS_IS_ERR(status)) {
1620                 return status;
1621         }
1622
1623         /* Return variables */
1624         *handle = *r.out.handle;
1625
1626         /* Return result */
1627         return r.out.result;
1628 }
1629
1630 struct rpccli_eventlog_ReadEventLogW_state {
1631         struct eventlog_ReadEventLogW orig;
1632         struct eventlog_ReadEventLogW tmp;
1633         TALLOC_CTX *out_mem_ctx;
1634         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1635 };
1636
1637 static void rpccli_eventlog_ReadEventLogW_done(struct tevent_req *subreq);
1638
1639 struct tevent_req *rpccli_eventlog_ReadEventLogW_send(TALLOC_CTX *mem_ctx,
1640                                                       struct tevent_context *ev,
1641                                                       struct rpc_pipe_client *cli,
1642                                                       struct policy_handle *_handle /* [in] [ref] */,
1643                                                       uint32_t _flags /* [in]  */,
1644                                                       uint32_t _offset /* [in]  */,
1645                                                       uint32_t _number_of_bytes /* [in] [range(0,0x7FFFF)] */,
1646                                                       uint8_t *_data /* [out] [ref,size_is(number_of_bytes)] */,
1647                                                       uint32_t *_sent_size /* [out] [ref] */,
1648                                                       uint32_t *_real_size /* [out] [ref] */)
1649 {
1650         struct tevent_req *req;
1651         struct rpccli_eventlog_ReadEventLogW_state *state;
1652         struct tevent_req *subreq;
1653
1654         req = tevent_req_create(mem_ctx, &state,
1655                                 struct rpccli_eventlog_ReadEventLogW_state);
1656         if (req == NULL) {
1657                 return NULL;
1658         }
1659         state->out_mem_ctx = NULL;
1660         state->dispatch_recv = cli->dispatch_recv;
1661
1662         /* In parameters */
1663         state->orig.in.handle = _handle;
1664         state->orig.in.flags = _flags;
1665         state->orig.in.offset = _offset;
1666         state->orig.in.number_of_bytes = _number_of_bytes;
1667
1668         /* Out parameters */
1669         state->orig.out.data = _data;
1670         state->orig.out.sent_size = _sent_size;
1671         state->orig.out.real_size = _real_size;
1672
1673         /* Result */
1674         ZERO_STRUCT(state->orig.out.result);
1675
1676         if (DEBUGLEVEL >= 10) {
1677                 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, &state->orig);
1678         }
1679
1680         state->out_mem_ctx = talloc_named_const(state, 0,
1681                              "rpccli_eventlog_ReadEventLogW_out_memory");
1682         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1683                 return tevent_req_post(req, ev);
1684         }
1685
1686         /* make a temporary copy, that we pass to the dispatch function */
1687         state->tmp = state->orig;
1688
1689         subreq = cli->dispatch_send(state, ev, cli,
1690                                     &ndr_table_eventlog,
1691                                     NDR_EVENTLOG_READEVENTLOGW,
1692                                     &state->tmp);
1693         if (tevent_req_nomem(subreq, req)) {
1694                 return tevent_req_post(req, ev);
1695         }
1696         tevent_req_set_callback(subreq, rpccli_eventlog_ReadEventLogW_done, req);
1697         return req;
1698 }
1699
1700 static void rpccli_eventlog_ReadEventLogW_done(struct tevent_req *subreq)
1701 {
1702         struct tevent_req *req = tevent_req_callback_data(
1703                 subreq, struct tevent_req);
1704         struct rpccli_eventlog_ReadEventLogW_state *state = tevent_req_data(
1705                 req, struct rpccli_eventlog_ReadEventLogW_state);
1706         NTSTATUS status;
1707         TALLOC_CTX *mem_ctx;
1708
1709         if (state->out_mem_ctx) {
1710                 mem_ctx = state->out_mem_ctx;
1711         } else {
1712                 mem_ctx = state;
1713         }
1714
1715         status = state->dispatch_recv(subreq, mem_ctx);
1716         TALLOC_FREE(subreq);
1717         if (!NT_STATUS_IS_OK(status)) {
1718                 tevent_req_nterror(req, status);
1719                 return;
1720         }
1721
1722         /* Copy out parameters */
1723         memcpy(state->orig.out.data, state->tmp.out.data, state->tmp.in.number_of_bytes * sizeof(*state->orig.out.data));
1724         *state->orig.out.sent_size = *state->tmp.out.sent_size;
1725         *state->orig.out.real_size = *state->tmp.out.real_size;
1726
1727         /* Copy result */
1728         state->orig.out.result = state->tmp.out.result;
1729
1730         /* Reset temporary structure */
1731         ZERO_STRUCT(state->tmp);
1732
1733         if (DEBUGLEVEL >= 10) {
1734                 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &state->orig);
1735         }
1736
1737         tevent_req_done(req);
1738 }
1739
1740 NTSTATUS rpccli_eventlog_ReadEventLogW_recv(struct tevent_req *req,
1741                                             TALLOC_CTX *mem_ctx,
1742                                             NTSTATUS *result)
1743 {
1744         struct rpccli_eventlog_ReadEventLogW_state *state = tevent_req_data(
1745                 req, struct rpccli_eventlog_ReadEventLogW_state);
1746         NTSTATUS status;
1747
1748         if (tevent_req_is_nterror(req, &status)) {
1749                 tevent_req_received(req);
1750                 return status;
1751         }
1752
1753         /* Steal possbile out parameters to the callers context */
1754         talloc_steal(mem_ctx, state->out_mem_ctx);
1755
1756         /* Return result */
1757         *result = state->orig.out.result;
1758
1759         tevent_req_received(req);
1760         return NT_STATUS_OK;
1761 }
1762
1763 NTSTATUS rpccli_eventlog_ReadEventLogW(struct rpc_pipe_client *cli,
1764                                        TALLOC_CTX *mem_ctx,
1765                                        struct policy_handle *handle /* [in] [ref] */,
1766                                        uint32_t flags /* [in]  */,
1767                                        uint32_t offset /* [in]  */,
1768                                        uint32_t number_of_bytes /* [in] [range(0,0x7FFFF)] */,
1769                                        uint8_t *data /* [out] [ref,size_is(number_of_bytes)] */,
1770                                        uint32_t *sent_size /* [out] [ref] */,
1771                                        uint32_t *real_size /* [out] [ref] */)
1772 {
1773         struct eventlog_ReadEventLogW r;
1774         NTSTATUS status;
1775
1776         /* In parameters */
1777         r.in.handle = handle;
1778         r.in.flags = flags;
1779         r.in.offset = offset;
1780         r.in.number_of_bytes = number_of_bytes;
1781
1782         if (DEBUGLEVEL >= 10) {
1783                 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, &r);
1784         }
1785
1786         status = cli->dispatch(cli,
1787                                 mem_ctx,
1788                                 &ndr_table_eventlog,
1789                                 NDR_EVENTLOG_READEVENTLOGW,
1790                                 &r);
1791
1792         if (!NT_STATUS_IS_OK(status)) {
1793                 return status;
1794         }
1795
1796         if (DEBUGLEVEL >= 10) {
1797                 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &r);
1798         }
1799
1800         if (NT_STATUS_IS_ERR(status)) {
1801                 return status;
1802         }
1803
1804         /* Return variables */
1805         memcpy(data, r.out.data, r.in.number_of_bytes * sizeof(*data));
1806         *sent_size = *r.out.sent_size;
1807         *real_size = *r.out.real_size;
1808
1809         /* Return result */
1810         return r.out.result;
1811 }
1812
1813 struct rpccli_eventlog_ReportEventW_state {
1814         struct eventlog_ReportEventW orig;
1815         struct eventlog_ReportEventW tmp;
1816         TALLOC_CTX *out_mem_ctx;
1817         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1818 };
1819
1820 static void rpccli_eventlog_ReportEventW_done(struct tevent_req *subreq);
1821
1822 struct tevent_req *rpccli_eventlog_ReportEventW_send(TALLOC_CTX *mem_ctx,
1823                                                      struct tevent_context *ev,
1824                                                      struct rpc_pipe_client *cli,
1825                                                      struct policy_handle *_handle /* [in] [ref] */,
1826                                                      time_t _timestamp /* [in]  */,
1827                                                      enum eventlogEventTypes _event_type /* [in]  */,
1828                                                      uint16_t _event_category /* [in]  */,
1829                                                      uint32_t _event_id /* [in]  */,
1830                                                      uint16_t _num_of_strings /* [in] [range(0,256)] */,
1831                                                      uint32_t _data_size /* [in] [range(0,0x3FFFF)] */,
1832                                                      struct lsa_String *_servername /* [in] [ref] */,
1833                                                      struct dom_sid *_user_sid /* [in] [unique] */,
1834                                                      struct lsa_String **_strings /* [in] [unique,size_is(num_of_strings)] */,
1835                                                      uint8_t *_data /* [in] [unique,size_is(data_size)] */,
1836                                                      uint16_t _flags /* [in]  */,
1837                                                      uint32_t *_record_number /* [in,out] [unique] */,
1838                                                      time_t *_time_written /* [in,out] [unique] */)
1839 {
1840         struct tevent_req *req;
1841         struct rpccli_eventlog_ReportEventW_state *state;
1842         struct tevent_req *subreq;
1843
1844         req = tevent_req_create(mem_ctx, &state,
1845                                 struct rpccli_eventlog_ReportEventW_state);
1846         if (req == NULL) {
1847                 return NULL;
1848         }
1849         state->out_mem_ctx = NULL;
1850         state->dispatch_recv = cli->dispatch_recv;
1851
1852         /* In parameters */
1853         state->orig.in.handle = _handle;
1854         state->orig.in.timestamp = _timestamp;
1855         state->orig.in.event_type = _event_type;
1856         state->orig.in.event_category = _event_category;
1857         state->orig.in.event_id = _event_id;
1858         state->orig.in.num_of_strings = _num_of_strings;
1859         state->orig.in.data_size = _data_size;
1860         state->orig.in.servername = _servername;
1861         state->orig.in.user_sid = _user_sid;
1862         state->orig.in.strings = _strings;
1863         state->orig.in.data = _data;
1864         state->orig.in.flags = _flags;
1865         state->orig.in.record_number = _record_number;
1866         state->orig.in.time_written = _time_written;
1867
1868         /* Out parameters */
1869         state->orig.out.record_number = _record_number;
1870         state->orig.out.time_written = _time_written;
1871
1872         /* Result */
1873         ZERO_STRUCT(state->orig.out.result);
1874
1875         if (DEBUGLEVEL >= 10) {
1876                 NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, &state->orig);
1877         }
1878
1879         state->out_mem_ctx = talloc_named_const(state, 0,
1880                              "rpccli_eventlog_ReportEventW_out_memory");
1881         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1882                 return tevent_req_post(req, ev);
1883         }
1884
1885         /* make a temporary copy, that we pass to the dispatch function */
1886         state->tmp = state->orig;
1887
1888         subreq = cli->dispatch_send(state, ev, cli,
1889                                     &ndr_table_eventlog,
1890                                     NDR_EVENTLOG_REPORTEVENTW,
1891                                     &state->tmp);
1892         if (tevent_req_nomem(subreq, req)) {
1893                 return tevent_req_post(req, ev);
1894         }
1895         tevent_req_set_callback(subreq, rpccli_eventlog_ReportEventW_done, req);
1896         return req;
1897 }
1898
1899 static void rpccli_eventlog_ReportEventW_done(struct tevent_req *subreq)
1900 {
1901         struct tevent_req *req = tevent_req_callback_data(
1902                 subreq, struct tevent_req);
1903         struct rpccli_eventlog_ReportEventW_state *state = tevent_req_data(
1904                 req, struct rpccli_eventlog_ReportEventW_state);
1905         NTSTATUS status;
1906         TALLOC_CTX *mem_ctx;
1907
1908         if (state->out_mem_ctx) {
1909                 mem_ctx = state->out_mem_ctx;
1910         } else {
1911                 mem_ctx = state;
1912         }
1913
1914         status = state->dispatch_recv(subreq, mem_ctx);
1915         TALLOC_FREE(subreq);
1916         if (!NT_STATUS_IS_OK(status)) {
1917                 tevent_req_nterror(req, status);
1918                 return;
1919         }
1920
1921         /* Copy out parameters */
1922         if (state->orig.out.record_number && state->tmp.out.record_number) {
1923                 *state->orig.out.record_number = *state->tmp.out.record_number;
1924         }
1925         if (state->orig.out.time_written && state->tmp.out.time_written) {
1926                 *state->orig.out.time_written = *state->tmp.out.time_written;
1927         }
1928
1929         /* Copy result */
1930         state->orig.out.result = state->tmp.out.result;
1931
1932         /* Reset temporary structure */
1933         ZERO_STRUCT(state->tmp);
1934
1935         if (DEBUGLEVEL >= 10) {
1936                 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &state->orig);
1937         }
1938
1939         tevent_req_done(req);
1940 }
1941
1942 NTSTATUS rpccli_eventlog_ReportEventW_recv(struct tevent_req *req,
1943                                            TALLOC_CTX *mem_ctx,
1944                                            NTSTATUS *result)
1945 {
1946         struct rpccli_eventlog_ReportEventW_state *state = tevent_req_data(
1947                 req, struct rpccli_eventlog_ReportEventW_state);
1948         NTSTATUS status;
1949
1950         if (tevent_req_is_nterror(req, &status)) {
1951                 tevent_req_received(req);
1952                 return status;
1953         }
1954
1955         /* Steal possbile out parameters to the callers context */
1956         talloc_steal(mem_ctx, state->out_mem_ctx);
1957
1958         /* Return result */
1959         *result = state->orig.out.result;
1960
1961         tevent_req_received(req);
1962         return NT_STATUS_OK;
1963 }
1964
1965 NTSTATUS rpccli_eventlog_ReportEventW(struct rpc_pipe_client *cli,
1966                                       TALLOC_CTX *mem_ctx,
1967                                       struct policy_handle *handle /* [in] [ref] */,
1968                                       time_t timestamp /* [in]  */,
1969                                       enum eventlogEventTypes event_type /* [in]  */,
1970                                       uint16_t event_category /* [in]  */,
1971                                       uint32_t event_id /* [in]  */,
1972                                       uint16_t num_of_strings /* [in] [range(0,256)] */,
1973                                       uint32_t data_size /* [in] [range(0,0x3FFFF)] */,
1974                                       struct lsa_String *servername /* [in] [ref] */,
1975                                       struct dom_sid *user_sid /* [in] [unique] */,
1976                                       struct lsa_String **strings /* [in] [unique,size_is(num_of_strings)] */,
1977                                       uint8_t *data /* [in] [unique,size_is(data_size)] */,
1978                                       uint16_t flags /* [in]  */,
1979                                       uint32_t *record_number /* [in,out] [unique] */,
1980                                       time_t *time_written /* [in,out] [unique] */)
1981 {
1982         struct eventlog_ReportEventW r;
1983         NTSTATUS status;
1984
1985         /* In parameters */
1986         r.in.handle = handle;
1987         r.in.timestamp = timestamp;
1988         r.in.event_type = event_type;
1989         r.in.event_category = event_category;
1990         r.in.event_id = event_id;
1991         r.in.num_of_strings = num_of_strings;
1992         r.in.data_size = data_size;
1993         r.in.servername = servername;
1994         r.in.user_sid = user_sid;
1995         r.in.strings = strings;
1996         r.in.data = data;
1997         r.in.flags = flags;
1998         r.in.record_number = record_number;
1999         r.in.time_written = time_written;
2000
2001         if (DEBUGLEVEL >= 10) {
2002                 NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, &r);
2003         }
2004
2005         status = cli->dispatch(cli,
2006                                 mem_ctx,
2007                                 &ndr_table_eventlog,
2008                                 NDR_EVENTLOG_REPORTEVENTW,
2009                                 &r);
2010
2011         if (!NT_STATUS_IS_OK(status)) {
2012                 return status;
2013         }
2014
2015         if (DEBUGLEVEL >= 10) {
2016                 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &r);
2017         }
2018
2019         if (NT_STATUS_IS_ERR(status)) {
2020                 return status;
2021         }
2022
2023         /* Return variables */
2024         if (record_number && r.out.record_number) {
2025                 *record_number = *r.out.record_number;
2026         }
2027         if (time_written && r.out.time_written) {
2028                 *time_written = *r.out.time_written;
2029         }
2030
2031         /* Return result */
2032         return r.out.result;
2033 }
2034
2035 struct rpccli_eventlog_ClearEventLogA_state {
2036         struct eventlog_ClearEventLogA orig;
2037         struct eventlog_ClearEventLogA tmp;
2038         TALLOC_CTX *out_mem_ctx;
2039         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2040 };
2041
2042 static void rpccli_eventlog_ClearEventLogA_done(struct tevent_req *subreq);
2043
2044 struct tevent_req *rpccli_eventlog_ClearEventLogA_send(TALLOC_CTX *mem_ctx,
2045                                                        struct tevent_context *ev,
2046                                                        struct rpc_pipe_client *cli)
2047 {
2048         struct tevent_req *req;
2049         struct rpccli_eventlog_ClearEventLogA_state *state;
2050         struct tevent_req *subreq;
2051
2052         req = tevent_req_create(mem_ctx, &state,
2053                                 struct rpccli_eventlog_ClearEventLogA_state);
2054         if (req == NULL) {
2055                 return NULL;
2056         }
2057         state->out_mem_ctx = NULL;
2058         state->dispatch_recv = cli->dispatch_recv;
2059
2060         /* In parameters */
2061
2062         /* Out parameters */
2063
2064         /* Result */
2065         ZERO_STRUCT(state->orig.out.result);
2066
2067         if (DEBUGLEVEL >= 10) {
2068                 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, &state->orig);
2069         }
2070
2071         /* make a temporary copy, that we pass to the dispatch function */
2072         state->tmp = state->orig;
2073
2074         subreq = cli->dispatch_send(state, ev, cli,
2075                                     &ndr_table_eventlog,
2076                                     NDR_EVENTLOG_CLEAREVENTLOGA,
2077                                     &state->tmp);
2078         if (tevent_req_nomem(subreq, req)) {
2079                 return tevent_req_post(req, ev);
2080         }
2081         tevent_req_set_callback(subreq, rpccli_eventlog_ClearEventLogA_done, req);
2082         return req;
2083 }
2084
2085 static void rpccli_eventlog_ClearEventLogA_done(struct tevent_req *subreq)
2086 {
2087         struct tevent_req *req = tevent_req_callback_data(
2088                 subreq, struct tevent_req);
2089         struct rpccli_eventlog_ClearEventLogA_state *state = tevent_req_data(
2090                 req, struct rpccli_eventlog_ClearEventLogA_state);
2091         NTSTATUS status;
2092         TALLOC_CTX *mem_ctx;
2093
2094         if (state->out_mem_ctx) {
2095                 mem_ctx = state->out_mem_ctx;
2096         } else {
2097                 mem_ctx = state;
2098         }
2099
2100         status = state->dispatch_recv(subreq, mem_ctx);
2101         TALLOC_FREE(subreq);
2102         if (!NT_STATUS_IS_OK(status)) {
2103                 tevent_req_nterror(req, status);
2104                 return;
2105         }
2106
2107         /* Copy out parameters */
2108
2109         /* Copy result */
2110         state->orig.out.result = state->tmp.out.result;
2111
2112         /* Reset temporary structure */
2113         ZERO_STRUCT(state->tmp);
2114
2115         if (DEBUGLEVEL >= 10) {
2116                 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &state->orig);
2117         }
2118
2119         tevent_req_done(req);
2120 }
2121
2122 NTSTATUS rpccli_eventlog_ClearEventLogA_recv(struct tevent_req *req,
2123                                              TALLOC_CTX *mem_ctx,
2124                                              NTSTATUS *result)
2125 {
2126         struct rpccli_eventlog_ClearEventLogA_state *state = tevent_req_data(
2127                 req, struct rpccli_eventlog_ClearEventLogA_state);
2128         NTSTATUS status;
2129
2130         if (tevent_req_is_nterror(req, &status)) {
2131                 tevent_req_received(req);
2132                 return status;
2133         }
2134
2135         /* Steal possbile out parameters to the callers context */
2136         talloc_steal(mem_ctx, state->out_mem_ctx);
2137
2138         /* Return result */
2139         *result = state->orig.out.result;
2140
2141         tevent_req_received(req);
2142         return NT_STATUS_OK;
2143 }
2144
2145 NTSTATUS rpccli_eventlog_ClearEventLogA(struct rpc_pipe_client *cli,
2146                                         TALLOC_CTX *mem_ctx)
2147 {
2148         struct eventlog_ClearEventLogA r;
2149         NTSTATUS status;
2150
2151         /* In parameters */
2152
2153         if (DEBUGLEVEL >= 10) {
2154                 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, &r);
2155         }
2156
2157         status = cli->dispatch(cli,
2158                                 mem_ctx,
2159                                 &ndr_table_eventlog,
2160                                 NDR_EVENTLOG_CLEAREVENTLOGA,
2161                                 &r);
2162
2163         if (!NT_STATUS_IS_OK(status)) {
2164                 return status;
2165         }
2166
2167         if (DEBUGLEVEL >= 10) {
2168                 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &r);
2169         }
2170
2171         if (NT_STATUS_IS_ERR(status)) {
2172                 return status;
2173         }
2174
2175         /* Return variables */
2176
2177         /* Return result */
2178         return r.out.result;
2179 }
2180
2181 struct rpccli_eventlog_BackupEventLogA_state {
2182         struct eventlog_BackupEventLogA orig;
2183         struct eventlog_BackupEventLogA tmp;
2184         TALLOC_CTX *out_mem_ctx;
2185         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2186 };
2187
2188 static void rpccli_eventlog_BackupEventLogA_done(struct tevent_req *subreq);
2189
2190 struct tevent_req *rpccli_eventlog_BackupEventLogA_send(TALLOC_CTX *mem_ctx,
2191                                                         struct tevent_context *ev,
2192                                                         struct rpc_pipe_client *cli)
2193 {
2194         struct tevent_req *req;
2195         struct rpccli_eventlog_BackupEventLogA_state *state;
2196         struct tevent_req *subreq;
2197
2198         req = tevent_req_create(mem_ctx, &state,
2199                                 struct rpccli_eventlog_BackupEventLogA_state);
2200         if (req == NULL) {
2201                 return NULL;
2202         }
2203         state->out_mem_ctx = NULL;
2204         state->dispatch_recv = cli->dispatch_recv;
2205
2206         /* In parameters */
2207
2208         /* Out parameters */
2209
2210         /* Result */
2211         ZERO_STRUCT(state->orig.out.result);
2212
2213         if (DEBUGLEVEL >= 10) {
2214                 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, &state->orig);
2215         }
2216
2217         /* make a temporary copy, that we pass to the dispatch function */
2218         state->tmp = state->orig;
2219
2220         subreq = cli->dispatch_send(state, ev, cli,
2221                                     &ndr_table_eventlog,
2222                                     NDR_EVENTLOG_BACKUPEVENTLOGA,
2223                                     &state->tmp);
2224         if (tevent_req_nomem(subreq, req)) {
2225                 return tevent_req_post(req, ev);
2226         }
2227         tevent_req_set_callback(subreq, rpccli_eventlog_BackupEventLogA_done, req);
2228         return req;
2229 }
2230
2231 static void rpccli_eventlog_BackupEventLogA_done(struct tevent_req *subreq)
2232 {
2233         struct tevent_req *req = tevent_req_callback_data(
2234                 subreq, struct tevent_req);
2235         struct rpccli_eventlog_BackupEventLogA_state *state = tevent_req_data(
2236                 req, struct rpccli_eventlog_BackupEventLogA_state);
2237         NTSTATUS status;
2238         TALLOC_CTX *mem_ctx;
2239
2240         if (state->out_mem_ctx) {
2241                 mem_ctx = state->out_mem_ctx;
2242         } else {
2243                 mem_ctx = state;
2244         }
2245
2246         status = state->dispatch_recv(subreq, mem_ctx);
2247         TALLOC_FREE(subreq);
2248         if (!NT_STATUS_IS_OK(status)) {
2249                 tevent_req_nterror(req, status);
2250                 return;
2251         }
2252
2253         /* Copy out parameters */
2254
2255         /* Copy result */
2256         state->orig.out.result = state->tmp.out.result;
2257
2258         /* Reset temporary structure */
2259         ZERO_STRUCT(state->tmp);
2260
2261         if (DEBUGLEVEL >= 10) {
2262                 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &state->orig);
2263         }
2264
2265         tevent_req_done(req);
2266 }
2267
2268 NTSTATUS rpccli_eventlog_BackupEventLogA_recv(struct tevent_req *req,
2269                                               TALLOC_CTX *mem_ctx,
2270                                               NTSTATUS *result)
2271 {
2272         struct rpccli_eventlog_BackupEventLogA_state *state = tevent_req_data(
2273                 req, struct rpccli_eventlog_BackupEventLogA_state);
2274         NTSTATUS status;
2275
2276         if (tevent_req_is_nterror(req, &status)) {
2277                 tevent_req_received(req);
2278                 return status;
2279         }
2280
2281         /* Steal possbile out parameters to the callers context */
2282         talloc_steal(mem_ctx, state->out_mem_ctx);
2283
2284         /* Return result */
2285         *result = state->orig.out.result;
2286
2287         tevent_req_received(req);
2288         return NT_STATUS_OK;
2289 }
2290
2291 NTSTATUS rpccli_eventlog_BackupEventLogA(struct rpc_pipe_client *cli,
2292                                          TALLOC_CTX *mem_ctx)
2293 {
2294         struct eventlog_BackupEventLogA r;
2295         NTSTATUS status;
2296
2297         /* In parameters */
2298
2299         if (DEBUGLEVEL >= 10) {
2300                 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, &r);
2301         }
2302
2303         status = cli->dispatch(cli,
2304                                 mem_ctx,
2305                                 &ndr_table_eventlog,
2306                                 NDR_EVENTLOG_BACKUPEVENTLOGA,
2307                                 &r);
2308
2309         if (!NT_STATUS_IS_OK(status)) {
2310                 return status;
2311         }
2312
2313         if (DEBUGLEVEL >= 10) {
2314                 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &r);
2315         }
2316
2317         if (NT_STATUS_IS_ERR(status)) {
2318                 return status;
2319         }
2320
2321         /* Return variables */
2322
2323         /* Return result */
2324         return r.out.result;
2325 }
2326
2327 struct rpccli_eventlog_OpenEventLogA_state {
2328         struct eventlog_OpenEventLogA orig;
2329         struct eventlog_OpenEventLogA tmp;
2330         TALLOC_CTX *out_mem_ctx;
2331         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2332 };
2333
2334 static void rpccli_eventlog_OpenEventLogA_done(struct tevent_req *subreq);
2335
2336 struct tevent_req *rpccli_eventlog_OpenEventLogA_send(TALLOC_CTX *mem_ctx,
2337                                                       struct tevent_context *ev,
2338                                                       struct rpc_pipe_client *cli)
2339 {
2340         struct tevent_req *req;
2341         struct rpccli_eventlog_OpenEventLogA_state *state;
2342         struct tevent_req *subreq;
2343
2344         req = tevent_req_create(mem_ctx, &state,
2345                                 struct rpccli_eventlog_OpenEventLogA_state);
2346         if (req == NULL) {
2347                 return NULL;
2348         }
2349         state->out_mem_ctx = NULL;
2350         state->dispatch_recv = cli->dispatch_recv;
2351
2352         /* In parameters */
2353
2354         /* Out parameters */
2355
2356         /* Result */
2357         ZERO_STRUCT(state->orig.out.result);
2358
2359         if (DEBUGLEVEL >= 10) {
2360                 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, &state->orig);
2361         }
2362
2363         /* make a temporary copy, that we pass to the dispatch function */
2364         state->tmp = state->orig;
2365
2366         subreq = cli->dispatch_send(state, ev, cli,
2367                                     &ndr_table_eventlog,
2368                                     NDR_EVENTLOG_OPENEVENTLOGA,
2369                                     &state->tmp);
2370         if (tevent_req_nomem(subreq, req)) {
2371                 return tevent_req_post(req, ev);
2372         }
2373         tevent_req_set_callback(subreq, rpccli_eventlog_OpenEventLogA_done, req);
2374         return req;
2375 }
2376
2377 static void rpccli_eventlog_OpenEventLogA_done(struct tevent_req *subreq)
2378 {
2379         struct tevent_req *req = tevent_req_callback_data(
2380                 subreq, struct tevent_req);
2381         struct rpccli_eventlog_OpenEventLogA_state *state = tevent_req_data(
2382                 req, struct rpccli_eventlog_OpenEventLogA_state);
2383         NTSTATUS status;
2384         TALLOC_CTX *mem_ctx;
2385
2386         if (state->out_mem_ctx) {
2387                 mem_ctx = state->out_mem_ctx;
2388         } else {
2389                 mem_ctx = state;
2390         }
2391
2392         status = state->dispatch_recv(subreq, mem_ctx);
2393         TALLOC_FREE(subreq);
2394         if (!NT_STATUS_IS_OK(status)) {
2395                 tevent_req_nterror(req, status);
2396                 return;
2397         }
2398
2399         /* Copy out parameters */
2400
2401         /* Copy result */
2402         state->orig.out.result = state->tmp.out.result;
2403
2404         /* Reset temporary structure */
2405         ZERO_STRUCT(state->tmp);
2406
2407         if (DEBUGLEVEL >= 10) {
2408                 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &state->orig);
2409         }
2410
2411         tevent_req_done(req);
2412 }
2413
2414 NTSTATUS rpccli_eventlog_OpenEventLogA_recv(struct tevent_req *req,
2415                                             TALLOC_CTX *mem_ctx,
2416                                             NTSTATUS *result)
2417 {
2418         struct rpccli_eventlog_OpenEventLogA_state *state = tevent_req_data(
2419                 req, struct rpccli_eventlog_OpenEventLogA_state);
2420         NTSTATUS status;
2421
2422         if (tevent_req_is_nterror(req, &status)) {
2423                 tevent_req_received(req);
2424                 return status;
2425         }
2426
2427         /* Steal possbile out parameters to the callers context */
2428         talloc_steal(mem_ctx, state->out_mem_ctx);
2429
2430         /* Return result */
2431         *result = state->orig.out.result;
2432
2433         tevent_req_received(req);
2434         return NT_STATUS_OK;
2435 }
2436
2437 NTSTATUS rpccli_eventlog_OpenEventLogA(struct rpc_pipe_client *cli,
2438                                        TALLOC_CTX *mem_ctx)
2439 {
2440         struct eventlog_OpenEventLogA r;
2441         NTSTATUS status;
2442
2443         /* In parameters */
2444
2445         if (DEBUGLEVEL >= 10) {
2446                 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, &r);
2447         }
2448
2449         status = cli->dispatch(cli,
2450                                 mem_ctx,
2451                                 &ndr_table_eventlog,
2452                                 NDR_EVENTLOG_OPENEVENTLOGA,
2453                                 &r);
2454
2455         if (!NT_STATUS_IS_OK(status)) {
2456                 return status;
2457         }
2458
2459         if (DEBUGLEVEL >= 10) {
2460                 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &r);
2461         }
2462
2463         if (NT_STATUS_IS_ERR(status)) {
2464                 return status;
2465         }
2466
2467         /* Return variables */
2468
2469         /* Return result */
2470         return r.out.result;
2471 }
2472
2473 struct rpccli_eventlog_RegisterEventSourceA_state {
2474         struct eventlog_RegisterEventSourceA orig;
2475         struct eventlog_RegisterEventSourceA tmp;
2476         TALLOC_CTX *out_mem_ctx;
2477         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2478 };
2479
2480 static void rpccli_eventlog_RegisterEventSourceA_done(struct tevent_req *subreq);
2481
2482 struct tevent_req *rpccli_eventlog_RegisterEventSourceA_send(TALLOC_CTX *mem_ctx,
2483                                                              struct tevent_context *ev,
2484                                                              struct rpc_pipe_client *cli)
2485 {
2486         struct tevent_req *req;
2487         struct rpccli_eventlog_RegisterEventSourceA_state *state;
2488         struct tevent_req *subreq;
2489
2490         req = tevent_req_create(mem_ctx, &state,
2491                                 struct rpccli_eventlog_RegisterEventSourceA_state);
2492         if (req == NULL) {
2493                 return NULL;
2494         }
2495         state->out_mem_ctx = NULL;
2496         state->dispatch_recv = cli->dispatch_recv;
2497
2498         /* In parameters */
2499
2500         /* Out parameters */
2501
2502         /* Result */
2503         ZERO_STRUCT(state->orig.out.result);
2504
2505         if (DEBUGLEVEL >= 10) {
2506                 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, &state->orig);
2507         }
2508
2509         /* make a temporary copy, that we pass to the dispatch function */
2510         state->tmp = state->orig;
2511
2512         subreq = cli->dispatch_send(state, ev, cli,
2513                                     &ndr_table_eventlog,
2514                                     NDR_EVENTLOG_REGISTEREVENTSOURCEA,
2515                                     &state->tmp);
2516         if (tevent_req_nomem(subreq, req)) {
2517                 return tevent_req_post(req, ev);
2518         }
2519         tevent_req_set_callback(subreq, rpccli_eventlog_RegisterEventSourceA_done, req);
2520         return req;
2521 }
2522
2523 static void rpccli_eventlog_RegisterEventSourceA_done(struct tevent_req *subreq)
2524 {
2525         struct tevent_req *req = tevent_req_callback_data(
2526                 subreq, struct tevent_req);
2527         struct rpccli_eventlog_RegisterEventSourceA_state *state = tevent_req_data(
2528                 req, struct rpccli_eventlog_RegisterEventSourceA_state);
2529         NTSTATUS status;
2530         TALLOC_CTX *mem_ctx;
2531
2532         if (state->out_mem_ctx) {
2533                 mem_ctx = state->out_mem_ctx;
2534         } else {
2535                 mem_ctx = state;
2536         }
2537
2538         status = state->dispatch_recv(subreq, mem_ctx);
2539         TALLOC_FREE(subreq);
2540         if (!NT_STATUS_IS_OK(status)) {
2541                 tevent_req_nterror(req, status);
2542                 return;
2543         }
2544
2545         /* Copy out parameters */
2546
2547         /* Copy result */
2548         state->orig.out.result = state->tmp.out.result;
2549
2550         /* Reset temporary structure */
2551         ZERO_STRUCT(state->tmp);
2552
2553         if (DEBUGLEVEL >= 10) {
2554                 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &state->orig);
2555         }
2556
2557         tevent_req_done(req);
2558 }
2559
2560 NTSTATUS rpccli_eventlog_RegisterEventSourceA_recv(struct tevent_req *req,
2561                                                    TALLOC_CTX *mem_ctx,
2562                                                    NTSTATUS *result)
2563 {
2564         struct rpccli_eventlog_RegisterEventSourceA_state *state = tevent_req_data(
2565                 req, struct rpccli_eventlog_RegisterEventSourceA_state);
2566         NTSTATUS status;
2567
2568         if (tevent_req_is_nterror(req, &status)) {
2569                 tevent_req_received(req);
2570                 return status;
2571         }
2572
2573         /* Steal possbile out parameters to the callers context */
2574         talloc_steal(mem_ctx, state->out_mem_ctx);
2575
2576         /* Return result */
2577         *result = state->orig.out.result;
2578
2579         tevent_req_received(req);
2580         return NT_STATUS_OK;
2581 }
2582
2583 NTSTATUS rpccli_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli,
2584                                               TALLOC_CTX *mem_ctx)
2585 {
2586         struct eventlog_RegisterEventSourceA r;
2587         NTSTATUS status;
2588
2589         /* In parameters */
2590
2591         if (DEBUGLEVEL >= 10) {
2592                 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, &r);
2593         }
2594
2595         status = cli->dispatch(cli,
2596                                 mem_ctx,
2597                                 &ndr_table_eventlog,
2598                                 NDR_EVENTLOG_REGISTEREVENTSOURCEA,
2599                                 &r);
2600
2601         if (!NT_STATUS_IS_OK(status)) {
2602                 return status;
2603         }
2604
2605         if (DEBUGLEVEL >= 10) {
2606                 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &r);
2607         }
2608
2609         if (NT_STATUS_IS_ERR(status)) {
2610                 return status;
2611         }
2612
2613         /* Return variables */
2614
2615         /* Return result */
2616         return r.out.result;
2617 }
2618
2619 struct rpccli_eventlog_OpenBackupEventLogA_state {
2620         struct eventlog_OpenBackupEventLogA orig;
2621         struct eventlog_OpenBackupEventLogA tmp;
2622         TALLOC_CTX *out_mem_ctx;
2623         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2624 };
2625
2626 static void rpccli_eventlog_OpenBackupEventLogA_done(struct tevent_req *subreq);
2627
2628 struct tevent_req *rpccli_eventlog_OpenBackupEventLogA_send(TALLOC_CTX *mem_ctx,
2629                                                             struct tevent_context *ev,
2630                                                             struct rpc_pipe_client *cli)
2631 {
2632         struct tevent_req *req;
2633         struct rpccli_eventlog_OpenBackupEventLogA_state *state;
2634         struct tevent_req *subreq;
2635
2636         req = tevent_req_create(mem_ctx, &state,
2637                                 struct rpccli_eventlog_OpenBackupEventLogA_state);
2638         if (req == NULL) {
2639                 return NULL;
2640         }
2641         state->out_mem_ctx = NULL;
2642         state->dispatch_recv = cli->dispatch_recv;
2643
2644         /* In parameters */
2645
2646         /* Out parameters */
2647
2648         /* Result */
2649         ZERO_STRUCT(state->orig.out.result);
2650
2651         if (DEBUGLEVEL >= 10) {
2652                 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, &state->orig);
2653         }
2654
2655         /* make a temporary copy, that we pass to the dispatch function */
2656         state->tmp = state->orig;
2657
2658         subreq = cli->dispatch_send(state, ev, cli,
2659                                     &ndr_table_eventlog,
2660                                     NDR_EVENTLOG_OPENBACKUPEVENTLOGA,
2661                                     &state->tmp);
2662         if (tevent_req_nomem(subreq, req)) {
2663                 return tevent_req_post(req, ev);
2664         }
2665         tevent_req_set_callback(subreq, rpccli_eventlog_OpenBackupEventLogA_done, req);
2666         return req;
2667 }
2668
2669 static void rpccli_eventlog_OpenBackupEventLogA_done(struct tevent_req *subreq)
2670 {
2671         struct tevent_req *req = tevent_req_callback_data(
2672                 subreq, struct tevent_req);
2673         struct rpccli_eventlog_OpenBackupEventLogA_state *state = tevent_req_data(
2674                 req, struct rpccli_eventlog_OpenBackupEventLogA_state);
2675         NTSTATUS status;
2676         TALLOC_CTX *mem_ctx;
2677
2678         if (state->out_mem_ctx) {
2679                 mem_ctx = state->out_mem_ctx;
2680         } else {
2681                 mem_ctx = state;
2682         }
2683
2684         status = state->dispatch_recv(subreq, mem_ctx);
2685         TALLOC_FREE(subreq);
2686         if (!NT_STATUS_IS_OK(status)) {
2687                 tevent_req_nterror(req, status);
2688                 return;
2689         }
2690
2691         /* Copy out parameters */
2692
2693         /* Copy result */
2694         state->orig.out.result = state->tmp.out.result;
2695
2696         /* Reset temporary structure */
2697         ZERO_STRUCT(state->tmp);
2698
2699         if (DEBUGLEVEL >= 10) {
2700                 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &state->orig);
2701         }
2702
2703         tevent_req_done(req);
2704 }
2705
2706 NTSTATUS rpccli_eventlog_OpenBackupEventLogA_recv(struct tevent_req *req,
2707                                                   TALLOC_CTX *mem_ctx,
2708                                                   NTSTATUS *result)
2709 {
2710         struct rpccli_eventlog_OpenBackupEventLogA_state *state = tevent_req_data(
2711                 req, struct rpccli_eventlog_OpenBackupEventLogA_state);
2712         NTSTATUS status;
2713
2714         if (tevent_req_is_nterror(req, &status)) {
2715                 tevent_req_received(req);
2716                 return status;
2717         }
2718
2719         /* Steal possbile out parameters to the callers context */
2720         talloc_steal(mem_ctx, state->out_mem_ctx);
2721
2722         /* Return result */
2723         *result = state->orig.out.result;
2724
2725         tevent_req_received(req);
2726         return NT_STATUS_OK;
2727 }
2728
2729 NTSTATUS rpccli_eventlog_OpenBackupEventLogA(struct rpc_pipe_client *cli,
2730                                              TALLOC_CTX *mem_ctx)
2731 {
2732         struct eventlog_OpenBackupEventLogA r;
2733         NTSTATUS status;
2734
2735         /* In parameters */
2736
2737         if (DEBUGLEVEL >= 10) {
2738                 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, &r);
2739         }
2740
2741         status = cli->dispatch(cli,
2742                                 mem_ctx,
2743                                 &ndr_table_eventlog,
2744                                 NDR_EVENTLOG_OPENBACKUPEVENTLOGA,
2745                                 &r);
2746
2747         if (!NT_STATUS_IS_OK(status)) {
2748                 return status;
2749         }
2750
2751         if (DEBUGLEVEL >= 10) {
2752                 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &r);
2753         }
2754
2755         if (NT_STATUS_IS_ERR(status)) {
2756                 return status;
2757         }
2758
2759         /* Return variables */
2760
2761         /* Return result */
2762         return r.out.result;
2763 }
2764
2765 struct rpccli_eventlog_ReadEventLogA_state {
2766         struct eventlog_ReadEventLogA orig;
2767         struct eventlog_ReadEventLogA tmp;
2768         TALLOC_CTX *out_mem_ctx;
2769         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2770 };
2771
2772 static void rpccli_eventlog_ReadEventLogA_done(struct tevent_req *subreq);
2773
2774 struct tevent_req *rpccli_eventlog_ReadEventLogA_send(TALLOC_CTX *mem_ctx,
2775                                                       struct tevent_context *ev,
2776                                                       struct rpc_pipe_client *cli)
2777 {
2778         struct tevent_req *req;
2779         struct rpccli_eventlog_ReadEventLogA_state *state;
2780         struct tevent_req *subreq;
2781
2782         req = tevent_req_create(mem_ctx, &state,
2783                                 struct rpccli_eventlog_ReadEventLogA_state);
2784         if (req == NULL) {
2785                 return NULL;
2786         }
2787         state->out_mem_ctx = NULL;
2788         state->dispatch_recv = cli->dispatch_recv;
2789
2790         /* In parameters */
2791
2792         /* Out parameters */
2793
2794         /* Result */
2795         ZERO_STRUCT(state->orig.out.result);
2796
2797         if (DEBUGLEVEL >= 10) {
2798                 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, &state->orig);
2799         }
2800
2801         /* make a temporary copy, that we pass to the dispatch function */
2802         state->tmp = state->orig;
2803
2804         subreq = cli->dispatch_send(state, ev, cli,
2805                                     &ndr_table_eventlog,
2806                                     NDR_EVENTLOG_READEVENTLOGA,
2807                                     &state->tmp);
2808         if (tevent_req_nomem(subreq, req)) {
2809                 return tevent_req_post(req, ev);
2810         }
2811         tevent_req_set_callback(subreq, rpccli_eventlog_ReadEventLogA_done, req);
2812         return req;
2813 }
2814
2815 static void rpccli_eventlog_ReadEventLogA_done(struct tevent_req *subreq)
2816 {
2817         struct tevent_req *req = tevent_req_callback_data(
2818                 subreq, struct tevent_req);
2819         struct rpccli_eventlog_ReadEventLogA_state *state = tevent_req_data(
2820                 req, struct rpccli_eventlog_ReadEventLogA_state);
2821         NTSTATUS status;
2822         TALLOC_CTX *mem_ctx;
2823
2824         if (state->out_mem_ctx) {
2825                 mem_ctx = state->out_mem_ctx;
2826         } else {
2827                 mem_ctx = state;
2828         }
2829
2830         status = state->dispatch_recv(subreq, mem_ctx);
2831         TALLOC_FREE(subreq);
2832         if (!NT_STATUS_IS_OK(status)) {
2833                 tevent_req_nterror(req, status);
2834                 return;
2835         }
2836
2837         /* Copy out parameters */
2838
2839         /* Copy result */
2840         state->orig.out.result = state->tmp.out.result;
2841
2842         /* Reset temporary structure */
2843         ZERO_STRUCT(state->tmp);
2844
2845         if (DEBUGLEVEL >= 10) {
2846                 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &state->orig);
2847         }
2848
2849         tevent_req_done(req);
2850 }
2851
2852 NTSTATUS rpccli_eventlog_ReadEventLogA_recv(struct tevent_req *req,
2853                                             TALLOC_CTX *mem_ctx,
2854                                             NTSTATUS *result)
2855 {
2856         struct rpccli_eventlog_ReadEventLogA_state *state = tevent_req_data(
2857                 req, struct rpccli_eventlog_ReadEventLogA_state);
2858         NTSTATUS status;
2859
2860         if (tevent_req_is_nterror(req, &status)) {
2861                 tevent_req_received(req);
2862                 return status;
2863         }
2864
2865         /* Steal possbile out parameters to the callers context */
2866         talloc_steal(mem_ctx, state->out_mem_ctx);
2867
2868         /* Return result */
2869         *result = state->orig.out.result;
2870
2871         tevent_req_received(req);
2872         return NT_STATUS_OK;
2873 }
2874
2875 NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli,
2876                                        TALLOC_CTX *mem_ctx)
2877 {
2878         struct eventlog_ReadEventLogA r;
2879         NTSTATUS status;
2880
2881         /* In parameters */
2882
2883         if (DEBUGLEVEL >= 10) {
2884                 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, &r);
2885         }
2886
2887         status = cli->dispatch(cli,
2888                                 mem_ctx,
2889                                 &ndr_table_eventlog,
2890                                 NDR_EVENTLOG_READEVENTLOGA,
2891                                 &r);
2892
2893         if (!NT_STATUS_IS_OK(status)) {
2894                 return status;
2895         }
2896
2897         if (DEBUGLEVEL >= 10) {
2898                 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &r);
2899         }
2900
2901         if (NT_STATUS_IS_ERR(status)) {
2902                 return status;
2903         }
2904
2905         /* Return variables */
2906
2907         /* Return result */
2908         return r.out.result;
2909 }
2910
2911 struct rpccli_eventlog_ReportEventA_state {
2912         struct eventlog_ReportEventA orig;
2913         struct eventlog_ReportEventA tmp;
2914         TALLOC_CTX *out_mem_ctx;
2915         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2916 };
2917
2918 static void rpccli_eventlog_ReportEventA_done(struct tevent_req *subreq);
2919
2920 struct tevent_req *rpccli_eventlog_ReportEventA_send(TALLOC_CTX *mem_ctx,
2921                                                      struct tevent_context *ev,
2922                                                      struct rpc_pipe_client *cli)
2923 {
2924         struct tevent_req *req;
2925         struct rpccli_eventlog_ReportEventA_state *state;
2926         struct tevent_req *subreq;
2927
2928         req = tevent_req_create(mem_ctx, &state,
2929                                 struct rpccli_eventlog_ReportEventA_state);
2930         if (req == NULL) {
2931                 return NULL;
2932         }
2933         state->out_mem_ctx = NULL;
2934         state->dispatch_recv = cli->dispatch_recv;
2935
2936         /* In parameters */
2937
2938         /* Out parameters */
2939
2940         /* Result */
2941         ZERO_STRUCT(state->orig.out.result);
2942
2943         if (DEBUGLEVEL >= 10) {
2944                 NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, &state->orig);
2945         }
2946
2947         /* make a temporary copy, that we pass to the dispatch function */
2948         state->tmp = state->orig;
2949
2950         subreq = cli->dispatch_send(state, ev, cli,
2951                                     &ndr_table_eventlog,
2952                                     NDR_EVENTLOG_REPORTEVENTA,
2953                                     &state->tmp);
2954         if (tevent_req_nomem(subreq, req)) {
2955                 return tevent_req_post(req, ev);
2956         }
2957         tevent_req_set_callback(subreq, rpccli_eventlog_ReportEventA_done, req);
2958         return req;
2959 }
2960
2961 static void rpccli_eventlog_ReportEventA_done(struct tevent_req *subreq)
2962 {
2963         struct tevent_req *req = tevent_req_callback_data(
2964                 subreq, struct tevent_req);
2965         struct rpccli_eventlog_ReportEventA_state *state = tevent_req_data(
2966                 req, struct rpccli_eventlog_ReportEventA_state);
2967         NTSTATUS status;
2968         TALLOC_CTX *mem_ctx;
2969
2970         if (state->out_mem_ctx) {
2971                 mem_ctx = state->out_mem_ctx;
2972         } else {
2973                 mem_ctx = state;
2974         }
2975
2976         status = state->dispatch_recv(subreq, mem_ctx);
2977         TALLOC_FREE(subreq);
2978         if (!NT_STATUS_IS_OK(status)) {
2979                 tevent_req_nterror(req, status);
2980                 return;
2981         }
2982
2983         /* Copy out parameters */
2984
2985         /* Copy result */
2986         state->orig.out.result = state->tmp.out.result;
2987
2988         /* Reset temporary structure */
2989         ZERO_STRUCT(state->tmp);
2990
2991         if (DEBUGLEVEL >= 10) {
2992                 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &state->orig);
2993         }
2994
2995         tevent_req_done(req);
2996 }
2997
2998 NTSTATUS rpccli_eventlog_ReportEventA_recv(struct tevent_req *req,
2999                                            TALLOC_CTX *mem_ctx,
3000                                            NTSTATUS *result)
3001 {
3002         struct rpccli_eventlog_ReportEventA_state *state = tevent_req_data(
3003                 req, struct rpccli_eventlog_ReportEventA_state);
3004         NTSTATUS status;
3005
3006         if (tevent_req_is_nterror(req, &status)) {
3007                 tevent_req_received(req);
3008                 return status;
3009         }
3010
3011         /* Steal possbile out parameters to the callers context */
3012         talloc_steal(mem_ctx, state->out_mem_ctx);
3013
3014         /* Return result */
3015         *result = state->orig.out.result;
3016
3017         tevent_req_received(req);
3018         return NT_STATUS_OK;
3019 }
3020
3021 NTSTATUS rpccli_eventlog_ReportEventA(struct rpc_pipe_client *cli,
3022                                       TALLOC_CTX *mem_ctx)
3023 {
3024         struct eventlog_ReportEventA r;
3025         NTSTATUS status;
3026
3027         /* In parameters */
3028
3029         if (DEBUGLEVEL >= 10) {
3030                 NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, &r);
3031         }
3032
3033         status = cli->dispatch(cli,
3034                                 mem_ctx,
3035                                 &ndr_table_eventlog,
3036                                 NDR_EVENTLOG_REPORTEVENTA,
3037                                 &r);
3038
3039         if (!NT_STATUS_IS_OK(status)) {
3040                 return status;
3041         }
3042
3043         if (DEBUGLEVEL >= 10) {
3044                 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &r);
3045         }
3046
3047         if (NT_STATUS_IS_ERR(status)) {
3048                 return status;
3049         }
3050
3051         /* Return variables */
3052
3053         /* Return result */
3054         return r.out.result;
3055 }
3056
3057 struct rpccli_eventlog_RegisterClusterSvc_state {
3058         struct eventlog_RegisterClusterSvc orig;
3059         struct eventlog_RegisterClusterSvc tmp;
3060         TALLOC_CTX *out_mem_ctx;
3061         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3062 };
3063
3064 static void rpccli_eventlog_RegisterClusterSvc_done(struct tevent_req *subreq);
3065
3066 struct tevent_req *rpccli_eventlog_RegisterClusterSvc_send(TALLOC_CTX *mem_ctx,
3067                                                            struct tevent_context *ev,
3068                                                            struct rpc_pipe_client *cli)
3069 {
3070         struct tevent_req *req;
3071         struct rpccli_eventlog_RegisterClusterSvc_state *state;
3072         struct tevent_req *subreq;
3073
3074         req = tevent_req_create(mem_ctx, &state,
3075                                 struct rpccli_eventlog_RegisterClusterSvc_state);
3076         if (req == NULL) {
3077                 return NULL;
3078         }
3079         state->out_mem_ctx = NULL;
3080         state->dispatch_recv = cli->dispatch_recv;
3081
3082         /* In parameters */
3083
3084         /* Out parameters */
3085
3086         /* Result */
3087         ZERO_STRUCT(state->orig.out.result);
3088
3089         if (DEBUGLEVEL >= 10) {
3090                 NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, &state->orig);
3091         }
3092
3093         /* make a temporary copy, that we pass to the dispatch function */
3094         state->tmp = state->orig;
3095
3096         subreq = cli->dispatch_send(state, ev, cli,
3097                                     &ndr_table_eventlog,
3098                                     NDR_EVENTLOG_REGISTERCLUSTERSVC,
3099                                     &state->tmp);
3100         if (tevent_req_nomem(subreq, req)) {
3101                 return tevent_req_post(req, ev);
3102         }
3103         tevent_req_set_callback(subreq, rpccli_eventlog_RegisterClusterSvc_done, req);
3104         return req;
3105 }
3106
3107 static void rpccli_eventlog_RegisterClusterSvc_done(struct tevent_req *subreq)
3108 {
3109         struct tevent_req *req = tevent_req_callback_data(
3110                 subreq, struct tevent_req);
3111         struct rpccli_eventlog_RegisterClusterSvc_state *state = tevent_req_data(
3112                 req, struct rpccli_eventlog_RegisterClusterSvc_state);
3113         NTSTATUS status;
3114         TALLOC_CTX *mem_ctx;
3115
3116         if (state->out_mem_ctx) {
3117                 mem_ctx = state->out_mem_ctx;
3118         } else {
3119                 mem_ctx = state;
3120         }
3121
3122         status = state->dispatch_recv(subreq, mem_ctx);
3123         TALLOC_FREE(subreq);
3124         if (!NT_STATUS_IS_OK(status)) {
3125                 tevent_req_nterror(req, status);
3126                 return;
3127         }
3128
3129         /* Copy out parameters */
3130
3131         /* Copy result */
3132         state->orig.out.result = state->tmp.out.result;
3133
3134         /* Reset temporary structure */
3135         ZERO_STRUCT(state->tmp);
3136
3137         if (DEBUGLEVEL >= 10) {
3138                 NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &state->orig);
3139         }
3140
3141         tevent_req_done(req);
3142 }
3143
3144 NTSTATUS rpccli_eventlog_RegisterClusterSvc_recv(struct tevent_req *req,
3145                                                  TALLOC_CTX *mem_ctx,
3146                                                  NTSTATUS *result)
3147 {
3148         struct rpccli_eventlog_RegisterClusterSvc_state *state = tevent_req_data(
3149                 req, struct rpccli_eventlog_RegisterClusterSvc_state);
3150         NTSTATUS status;
3151
3152         if (tevent_req_is_nterror(req, &status)) {
3153                 tevent_req_received(req);
3154                 return status;
3155         }
3156
3157         /* Steal possbile out parameters to the callers context */
3158         talloc_steal(mem_ctx, state->out_mem_ctx);
3159
3160         /* Return result */
3161         *result = state->orig.out.result;
3162
3163         tevent_req_received(req);
3164         return NT_STATUS_OK;
3165 }
3166
3167 NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli,
3168                                             TALLOC_CTX *mem_ctx)
3169 {
3170         struct eventlog_RegisterClusterSvc r;
3171         NTSTATUS status;
3172
3173         /* In parameters */
3174
3175         if (DEBUGLEVEL >= 10) {
3176                 NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, &r);
3177         }
3178
3179         status = cli->dispatch(cli,
3180                                 mem_ctx,
3181                                 &ndr_table_eventlog,
3182                                 NDR_EVENTLOG_REGISTERCLUSTERSVC,
3183                                 &r);
3184
3185         if (!NT_STATUS_IS_OK(status)) {
3186                 return status;
3187         }
3188
3189         if (DEBUGLEVEL >= 10) {
3190                 NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &r);
3191         }
3192
3193         if (NT_STATUS_IS_ERR(status)) {
3194                 return status;
3195         }
3196
3197         /* Return variables */
3198
3199         /* Return result */
3200         return r.out.result;
3201 }
3202
3203 struct rpccli_eventlog_DeregisterClusterSvc_state {
3204         struct eventlog_DeregisterClusterSvc orig;
3205         struct eventlog_DeregisterClusterSvc tmp;
3206         TALLOC_CTX *out_mem_ctx;
3207         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3208 };
3209
3210 static void rpccli_eventlog_DeregisterClusterSvc_done(struct tevent_req *subreq);
3211
3212 struct tevent_req *rpccli_eventlog_DeregisterClusterSvc_send(TALLOC_CTX *mem_ctx,
3213                                                              struct tevent_context *ev,
3214                                                              struct rpc_pipe_client *cli)
3215 {
3216         struct tevent_req *req;
3217         struct rpccli_eventlog_DeregisterClusterSvc_state *state;
3218         struct tevent_req *subreq;
3219
3220         req = tevent_req_create(mem_ctx, &state,
3221                                 struct rpccli_eventlog_DeregisterClusterSvc_state);
3222         if (req == NULL) {
3223                 return NULL;
3224         }
3225         state->out_mem_ctx = NULL;
3226         state->dispatch_recv = cli->dispatch_recv;
3227
3228         /* In parameters */
3229
3230         /* Out parameters */
3231
3232         /* Result */
3233         ZERO_STRUCT(state->orig.out.result);
3234
3235         if (DEBUGLEVEL >= 10) {
3236                 NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, &state->orig);
3237         }
3238
3239         /* make a temporary copy, that we pass to the dispatch function */
3240         state->tmp = state->orig;
3241
3242         subreq = cli->dispatch_send(state, ev, cli,
3243                                     &ndr_table_eventlog,
3244                                     NDR_EVENTLOG_DEREGISTERCLUSTERSVC,
3245                                     &state->tmp);
3246         if (tevent_req_nomem(subreq, req)) {
3247                 return tevent_req_post(req, ev);
3248         }
3249         tevent_req_set_callback(subreq, rpccli_eventlog_DeregisterClusterSvc_done, req);
3250         return req;
3251 }
3252
3253 static void rpccli_eventlog_DeregisterClusterSvc_done(struct tevent_req *subreq)
3254 {
3255         struct tevent_req *req = tevent_req_callback_data(
3256                 subreq, struct tevent_req);
3257         struct rpccli_eventlog_DeregisterClusterSvc_state *state = tevent_req_data(
3258                 req, struct rpccli_eventlog_DeregisterClusterSvc_state);
3259         NTSTATUS status;
3260         TALLOC_CTX *mem_ctx;
3261
3262         if (state->out_mem_ctx) {
3263                 mem_ctx = state->out_mem_ctx;
3264         } else {
3265                 mem_ctx = state;
3266         }
3267
3268         status = state->dispatch_recv(subreq, mem_ctx);
3269         TALLOC_FREE(subreq);
3270         if (!NT_STATUS_IS_OK(status)) {
3271                 tevent_req_nterror(req, status);
3272                 return;
3273         }
3274
3275         /* Copy out parameters */
3276
3277         /* Copy result */
3278         state->orig.out.result = state->tmp.out.result;
3279
3280         /* Reset temporary structure */
3281         ZERO_STRUCT(state->tmp);
3282
3283         if (DEBUGLEVEL >= 10) {
3284                 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &state->orig);
3285         }
3286
3287         tevent_req_done(req);
3288 }
3289
3290 NTSTATUS rpccli_eventlog_DeregisterClusterSvc_recv(struct tevent_req *req,
3291                                                    TALLOC_CTX *mem_ctx,
3292                                                    NTSTATUS *result)
3293 {
3294         struct rpccli_eventlog_DeregisterClusterSvc_state *state = tevent_req_data(
3295                 req, struct rpccli_eventlog_DeregisterClusterSvc_state);
3296         NTSTATUS status;
3297
3298         if (tevent_req_is_nterror(req, &status)) {
3299                 tevent_req_received(req);
3300                 return status;
3301         }
3302
3303         /* Steal possbile out parameters to the callers context */
3304         talloc_steal(mem_ctx, state->out_mem_ctx);
3305
3306         /* Return result */
3307         *result = state->orig.out.result;
3308
3309         tevent_req_received(req);
3310         return NT_STATUS_OK;
3311 }
3312
3313 NTSTATUS rpccli_eventlog_DeregisterClusterSvc(struct rpc_pipe_client *cli,
3314                                               TALLOC_CTX *mem_ctx)
3315 {
3316         struct eventlog_DeregisterClusterSvc r;
3317         NTSTATUS status;
3318
3319         /* In parameters */
3320
3321         if (DEBUGLEVEL >= 10) {
3322                 NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, &r);
3323         }
3324
3325         status = cli->dispatch(cli,
3326                                 mem_ctx,
3327                                 &ndr_table_eventlog,
3328                                 NDR_EVENTLOG_DEREGISTERCLUSTERSVC,
3329                                 &r);
3330
3331         if (!NT_STATUS_IS_OK(status)) {
3332                 return status;
3333         }
3334
3335         if (DEBUGLEVEL >= 10) {
3336                 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &r);
3337         }
3338
3339         if (NT_STATUS_IS_ERR(status)) {
3340                 return status;
3341         }
3342
3343         /* Return variables */
3344
3345         /* Return result */
3346         return r.out.result;
3347 }
3348
3349 struct rpccli_eventlog_WriteClusterEvents_state {
3350         struct eventlog_WriteClusterEvents orig;
3351         struct eventlog_WriteClusterEvents tmp;
3352         TALLOC_CTX *out_mem_ctx;
3353         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3354 };
3355
3356 static void rpccli_eventlog_WriteClusterEvents_done(struct tevent_req *subreq);
3357
3358 struct tevent_req *rpccli_eventlog_WriteClusterEvents_send(TALLOC_CTX *mem_ctx,
3359                                                            struct tevent_context *ev,
3360                                                            struct rpc_pipe_client *cli)
3361 {
3362         struct tevent_req *req;
3363         struct rpccli_eventlog_WriteClusterEvents_state *state;
3364         struct tevent_req *subreq;
3365
3366         req = tevent_req_create(mem_ctx, &state,
3367                                 struct rpccli_eventlog_WriteClusterEvents_state);
3368         if (req == NULL) {
3369                 return NULL;
3370         }
3371         state->out_mem_ctx = NULL;
3372         state->dispatch_recv = cli->dispatch_recv;
3373
3374         /* In parameters */
3375
3376         /* Out parameters */
3377
3378         /* Result */
3379         ZERO_STRUCT(state->orig.out.result);
3380
3381         if (DEBUGLEVEL >= 10) {
3382                 NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, &state->orig);
3383         }
3384
3385         /* make a temporary copy, that we pass to the dispatch function */
3386         state->tmp = state->orig;
3387
3388         subreq = cli->dispatch_send(state, ev, cli,
3389                                     &ndr_table_eventlog,
3390                                     NDR_EVENTLOG_WRITECLUSTEREVENTS,
3391                                     &state->tmp);
3392         if (tevent_req_nomem(subreq, req)) {
3393                 return tevent_req_post(req, ev);
3394         }
3395         tevent_req_set_callback(subreq, rpccli_eventlog_WriteClusterEvents_done, req);
3396         return req;
3397 }
3398
3399 static void rpccli_eventlog_WriteClusterEvents_done(struct tevent_req *subreq)
3400 {
3401         struct tevent_req *req = tevent_req_callback_data(
3402                 subreq, struct tevent_req);
3403         struct rpccli_eventlog_WriteClusterEvents_state *state = tevent_req_data(
3404                 req, struct rpccli_eventlog_WriteClusterEvents_state);
3405         NTSTATUS status;
3406         TALLOC_CTX *mem_ctx;
3407
3408         if (state->out_mem_ctx) {
3409                 mem_ctx = state->out_mem_ctx;
3410         } else {
3411                 mem_ctx = state;
3412         }
3413
3414         status = state->dispatch_recv(subreq, mem_ctx);
3415         TALLOC_FREE(subreq);
3416         if (!NT_STATUS_IS_OK(status)) {
3417                 tevent_req_nterror(req, status);
3418                 return;
3419         }
3420
3421         /* Copy out parameters */
3422
3423         /* Copy result */
3424         state->orig.out.result = state->tmp.out.result;
3425
3426         /* Reset temporary structure */
3427         ZERO_STRUCT(state->tmp);
3428
3429         if (DEBUGLEVEL >= 10) {
3430                 NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &state->orig);
3431         }
3432
3433         tevent_req_done(req);
3434 }
3435
3436 NTSTATUS rpccli_eventlog_WriteClusterEvents_recv(struct tevent_req *req,
3437                                                  TALLOC_CTX *mem_ctx,
3438                                                  NTSTATUS *result)
3439 {
3440         struct rpccli_eventlog_WriteClusterEvents_state *state = tevent_req_data(
3441                 req, struct rpccli_eventlog_WriteClusterEvents_state);
3442         NTSTATUS status;
3443
3444         if (tevent_req_is_nterror(req, &status)) {
3445                 tevent_req_received(req);
3446                 return status;
3447         }
3448
3449         /* Steal possbile out parameters to the callers context */
3450         talloc_steal(mem_ctx, state->out_mem_ctx);
3451
3452         /* Return result */
3453         *result = state->orig.out.result;
3454
3455         tevent_req_received(req);
3456         return NT_STATUS_OK;
3457 }
3458
3459 NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli,
3460                                             TALLOC_CTX *mem_ctx)
3461 {
3462         struct eventlog_WriteClusterEvents r;
3463         NTSTATUS status;
3464
3465         /* In parameters */
3466
3467         if (DEBUGLEVEL >= 10) {
3468                 NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, &r);
3469         }
3470
3471         status = cli->dispatch(cli,
3472                                 mem_ctx,
3473                                 &ndr_table_eventlog,
3474                                 NDR_EVENTLOG_WRITECLUSTEREVENTS,
3475                                 &r);
3476
3477         if (!NT_STATUS_IS_OK(status)) {
3478                 return status;
3479         }
3480
3481         if (DEBUGLEVEL >= 10) {
3482                 NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &r);
3483         }
3484
3485         if (NT_STATUS_IS_ERR(status)) {
3486                 return status;
3487         }
3488
3489         /* Return variables */
3490
3491         /* Return result */
3492         return r.out.result;
3493 }
3494
3495 struct rpccli_eventlog_GetLogInformation_state {
3496         struct eventlog_GetLogInformation orig;
3497         struct eventlog_GetLogInformation tmp;
3498         TALLOC_CTX *out_mem_ctx;
3499         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3500 };
3501
3502 static void rpccli_eventlog_GetLogInformation_done(struct tevent_req *subreq);
3503
3504 struct tevent_req *rpccli_eventlog_GetLogInformation_send(TALLOC_CTX *mem_ctx,
3505                                                           struct tevent_context *ev,
3506                                                           struct rpc_pipe_client *cli,
3507                                                           struct policy_handle *_handle /* [in] [ref] */,
3508                                                           uint32_t _level /* [in]  */,
3509                                                           uint8_t *_buffer /* [out] [ref,size_is(buf_size)] */,
3510                                                           uint32_t _buf_size /* [in] [range(0,1024)] */,
3511                                                           uint32_t *_bytes_needed /* [out] [ref] */)
3512 {
3513         struct tevent_req *req;
3514         struct rpccli_eventlog_GetLogInformation_state *state;
3515         struct tevent_req *subreq;
3516
3517         req = tevent_req_create(mem_ctx, &state,
3518                                 struct rpccli_eventlog_GetLogInformation_state);
3519         if (req == NULL) {
3520                 return NULL;
3521         }
3522         state->out_mem_ctx = NULL;
3523         state->dispatch_recv = cli->dispatch_recv;
3524
3525         /* In parameters */
3526         state->orig.in.handle = _handle;
3527         state->orig.in.level = _level;
3528         state->orig.in.buf_size = _buf_size;
3529
3530         /* Out parameters */
3531         state->orig.out.buffer = _buffer;
3532         state->orig.out.bytes_needed = _bytes_needed;
3533
3534         /* Result */
3535         ZERO_STRUCT(state->orig.out.result);
3536
3537         if (DEBUGLEVEL >= 10) {
3538                 NDR_PRINT_IN_DEBUG(eventlog_GetLogInformation, &state->orig);
3539         }
3540
3541         state->out_mem_ctx = talloc_named_const(state, 0,
3542                              "rpccli_eventlog_GetLogInformation_out_memory");
3543         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3544                 return tevent_req_post(req, ev);
3545         }
3546
3547         /* make a temporary copy, that we pass to the dispatch function */
3548         state->tmp = state->orig;
3549
3550         subreq = cli->dispatch_send(state, ev, cli,
3551                                     &ndr_table_eventlog,
3552                                     NDR_EVENTLOG_GETLOGINFORMATION,
3553                                     &state->tmp);
3554         if (tevent_req_nomem(subreq, req)) {
3555                 return tevent_req_post(req, ev);
3556         }
3557         tevent_req_set_callback(subreq, rpccli_eventlog_GetLogInformation_done, req);
3558         return req;
3559 }
3560
3561 static void rpccli_eventlog_GetLogInformation_done(struct tevent_req *subreq)
3562 {
3563         struct tevent_req *req = tevent_req_callback_data(
3564                 subreq, struct tevent_req);
3565         struct rpccli_eventlog_GetLogInformation_state *state = tevent_req_data(
3566                 req, struct rpccli_eventlog_GetLogInformation_state);
3567         NTSTATUS status;
3568         TALLOC_CTX *mem_ctx;
3569
3570         if (state->out_mem_ctx) {
3571                 mem_ctx = state->out_mem_ctx;
3572         } else {
3573                 mem_ctx = state;
3574         }
3575
3576         status = state->dispatch_recv(subreq, mem_ctx);
3577         TALLOC_FREE(subreq);
3578         if (!NT_STATUS_IS_OK(status)) {
3579                 tevent_req_nterror(req, status);
3580                 return;
3581         }
3582
3583         /* Copy out parameters */
3584         memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.buf_size * sizeof(*state->orig.out.buffer));
3585         *state->orig.out.bytes_needed = *state->tmp.out.bytes_needed;
3586
3587         /* Copy result */
3588         state->orig.out.result = state->tmp.out.result;
3589
3590         /* Reset temporary structure */
3591         ZERO_STRUCT(state->tmp);
3592
3593         if (DEBUGLEVEL >= 10) {
3594                 NDR_PRINT_OUT_DEBUG(eventlog_GetLogInformation, &state->orig);
3595         }
3596
3597         tevent_req_done(req);
3598 }
3599
3600 NTSTATUS rpccli_eventlog_GetLogInformation_recv(struct tevent_req *req,
3601                                                 TALLOC_CTX *mem_ctx,
3602                                                 NTSTATUS *result)
3603 {
3604         struct rpccli_eventlog_GetLogInformation_state *state = tevent_req_data(
3605                 req, struct rpccli_eventlog_GetLogInformation_state);
3606         NTSTATUS status;
3607
3608         if (tevent_req_is_nterror(req, &status)) {
3609                 tevent_req_received(req);
3610                 return status;
3611         }
3612
3613         /* Steal possbile out parameters to the callers context */
3614         talloc_steal(mem_ctx, state->out_mem_ctx);
3615
3616         /* Return result */
3617         *result = state->orig.out.result;
3618
3619         tevent_req_received(req);
3620         return NT_STATUS_OK;
3621 }
3622
3623 NTSTATUS rpccli_eventlog_GetLogInformation(struct rpc_pipe_client *cli,
3624                                            TALLOC_CTX *mem_ctx,
3625                                            struct policy_handle *handle /* [in] [ref] */,
3626                                            uint32_t level /* [in]  */,
3627                                            uint8_t *buffer /* [out] [ref,size_is(buf_size)] */,
3628                                            uint32_t buf_size /* [in] [range(0,1024)] */,
3629                                            uint32_t *bytes_needed /* [out] [ref] */)
3630 {
3631         struct eventlog_GetLogInformation r;
3632         NTSTATUS status;
3633
3634         /* In parameters */
3635         r.in.handle = handle;
3636         r.in.level = level;
3637         r.in.buf_size = buf_size;
3638
3639         if (DEBUGLEVEL >= 10) {
3640                 NDR_PRINT_IN_DEBUG(eventlog_GetLogInformation, &r);
3641         }
3642
3643         status = cli->dispatch(cli,
3644                                 mem_ctx,
3645                                 &ndr_table_eventlog,
3646                                 NDR_EVENTLOG_GETLOGINFORMATION,
3647                                 &r);
3648
3649         if (!NT_STATUS_IS_OK(status)) {
3650                 return status;
3651         }
3652
3653         if (DEBUGLEVEL >= 10) {
3654                 NDR_PRINT_OUT_DEBUG(eventlog_GetLogInformation, &r);
3655         }
3656
3657         if (NT_STATUS_IS_ERR(status)) {
3658                 return status;
3659         }
3660
3661         /* Return variables */
3662         memcpy(buffer, r.out.buffer, r.in.buf_size * sizeof(*buffer));
3663         *bytes_needed = *r.out.bytes_needed;
3664
3665         /* Return result */
3666         return r.out.result;
3667 }
3668
3669 struct rpccli_eventlog_FlushEventLog_state {
3670         struct eventlog_FlushEventLog orig;
3671         struct eventlog_FlushEventLog tmp;
3672         TALLOC_CTX *out_mem_ctx;
3673         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3674 };
3675
3676 static void rpccli_eventlog_FlushEventLog_done(struct tevent_req *subreq);
3677
3678 struct tevent_req *rpccli_eventlog_FlushEventLog_send(TALLOC_CTX *mem_ctx,
3679                                                       struct tevent_context *ev,
3680                                                       struct rpc_pipe_client *cli,
3681                                                       struct policy_handle *_handle /* [in] [ref] */)
3682 {
3683         struct tevent_req *req;
3684         struct rpccli_eventlog_FlushEventLog_state *state;
3685         struct tevent_req *subreq;
3686
3687         req = tevent_req_create(mem_ctx, &state,
3688                                 struct rpccli_eventlog_FlushEventLog_state);
3689         if (req == NULL) {
3690                 return NULL;
3691         }
3692         state->out_mem_ctx = NULL;
3693         state->dispatch_recv = cli->dispatch_recv;
3694
3695         /* In parameters */
3696         state->orig.in.handle = _handle;
3697
3698         /* Out parameters */
3699
3700         /* Result */
3701         ZERO_STRUCT(state->orig.out.result);
3702
3703         if (DEBUGLEVEL >= 10) {
3704                 NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, &state->orig);
3705         }
3706
3707         /* make a temporary copy, that we pass to the dispatch function */
3708         state->tmp = state->orig;
3709
3710         subreq = cli->dispatch_send(state, ev, cli,
3711                                     &ndr_table_eventlog,
3712                                     NDR_EVENTLOG_FLUSHEVENTLOG,
3713                                     &state->tmp);
3714         if (tevent_req_nomem(subreq, req)) {
3715                 return tevent_req_post(req, ev);
3716         }
3717         tevent_req_set_callback(subreq, rpccli_eventlog_FlushEventLog_done, req);
3718         return req;
3719 }
3720
3721 static void rpccli_eventlog_FlushEventLog_done(struct tevent_req *subreq)
3722 {
3723         struct tevent_req *req = tevent_req_callback_data(
3724                 subreq, struct tevent_req);
3725         struct rpccli_eventlog_FlushEventLog_state *state = tevent_req_data(
3726                 req, struct rpccli_eventlog_FlushEventLog_state);
3727         NTSTATUS status;
3728         TALLOC_CTX *mem_ctx;
3729
3730         if (state->out_mem_ctx) {
3731                 mem_ctx = state->out_mem_ctx;
3732         } else {
3733                 mem_ctx = state;
3734         }
3735
3736         status = state->dispatch_recv(subreq, mem_ctx);
3737         TALLOC_FREE(subreq);
3738         if (!NT_STATUS_IS_OK(status)) {
3739                 tevent_req_nterror(req, status);
3740                 return;
3741         }
3742
3743         /* Copy out parameters */
3744
3745         /* Copy result */
3746         state->orig.out.result = state->tmp.out.result;
3747
3748         /* Reset temporary structure */
3749         ZERO_STRUCT(state->tmp);
3750
3751         if (DEBUGLEVEL >= 10) {
3752                 NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, &state->orig);
3753         }
3754
3755         tevent_req_done(req);
3756 }
3757
3758 NTSTATUS rpccli_eventlog_FlushEventLog_recv(struct tevent_req *req,
3759                                             TALLOC_CTX *mem_ctx,
3760                                             NTSTATUS *result)
3761 {
3762         struct rpccli_eventlog_FlushEventLog_state *state = tevent_req_data(
3763                 req, struct rpccli_eventlog_FlushEventLog_state);
3764         NTSTATUS status;
3765
3766         if (tevent_req_is_nterror(req, &status)) {
3767                 tevent_req_received(req);
3768                 return status;
3769         }
3770
3771         /* Steal possbile out parameters to the callers context */
3772         talloc_steal(mem_ctx, state->out_mem_ctx);
3773
3774         /* Return result */
3775         *result = state->orig.out.result;
3776
3777         tevent_req_received(req);
3778         return NT_STATUS_OK;
3779 }
3780
3781 NTSTATUS rpccli_eventlog_FlushEventLog(struct rpc_pipe_client *cli,
3782                                        TALLOC_CTX *mem_ctx,
3783                                        struct policy_handle *handle /* [in] [ref] */)
3784 {
3785         struct eventlog_FlushEventLog r;
3786         NTSTATUS status;
3787
3788         /* In parameters */
3789         r.in.handle = handle;
3790
3791         if (DEBUGLEVEL >= 10) {
3792                 NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, &r);
3793         }
3794
3795         status = cli->dispatch(cli,
3796                                 mem_ctx,
3797                                 &ndr_table_eventlog,
3798                                 NDR_EVENTLOG_FLUSHEVENTLOG,
3799                                 &r);
3800
3801         if (!NT_STATUS_IS_OK(status)) {
3802                 return status;
3803         }
3804
3805         if (DEBUGLEVEL >= 10) {
3806                 NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, &r);
3807         }
3808
3809         if (NT_STATUS_IS_ERR(status)) {
3810                 return status;
3811         }
3812
3813         /* Return variables */
3814
3815         /* Return result */
3816         return r.out.result;
3817 }
3818
3819 struct rpccli_eventlog_ReportEventAndSourceW_state {
3820         struct eventlog_ReportEventAndSourceW orig;
3821         struct eventlog_ReportEventAndSourceW tmp;
3822         TALLOC_CTX *out_mem_ctx;
3823         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3824 };
3825
3826 static void rpccli_eventlog_ReportEventAndSourceW_done(struct tevent_req *subreq);
3827
3828 struct tevent_req *rpccli_eventlog_ReportEventAndSourceW_send(TALLOC_CTX *mem_ctx,
3829                                                               struct tevent_context *ev,
3830                                                               struct rpc_pipe_client *cli,
3831                                                               struct policy_handle *_handle /* [in] [ref] */,
3832                                                               time_t _timestamp /* [in]  */,
3833                                                               enum eventlogEventTypes _event_type /* [in]  */,
3834                                                               uint16_t _event_category /* [in]  */,
3835                                                               uint32_t _event_id /* [in]  */,
3836                                                               struct lsa_String *_sourcename /* [in] [ref] */,
3837                                                               uint16_t _num_of_strings /* [in] [range(0,256)] */,
3838                                                               uint32_t _data_size /* [in] [range(0,0x3FFFF)] */,
3839                                                               struct lsa_String *_servername /* [in] [ref] */,
3840                                                               struct dom_sid *_user_sid /* [in] [unique] */,
3841                                                               struct lsa_String **_strings /* [in] [unique,size_is(num_of_strings)] */,
3842                                                               uint8_t *_data /* [in] [unique,size_is(data_size)] */,
3843                                                               uint16_t _flags /* [in]  */,
3844                                                               uint32_t *_record_number /* [in,out] [unique] */,
3845                                                               time_t *_time_written /* [in,out] [unique] */)
3846 {
3847         struct tevent_req *req;
3848         struct rpccli_eventlog_ReportEventAndSourceW_state *state;
3849         struct tevent_req *subreq;
3850
3851         req = tevent_req_create(mem_ctx, &state,
3852                                 struct rpccli_eventlog_ReportEventAndSourceW_state);
3853         if (req == NULL) {
3854                 return NULL;
3855         }
3856         state->out_mem_ctx = NULL;
3857         state->dispatch_recv = cli->dispatch_recv;
3858
3859         /* In parameters */
3860         state->orig.in.handle = _handle;
3861         state->orig.in.timestamp = _timestamp;
3862         state->orig.in.event_type = _event_type;
3863         state->orig.in.event_category = _event_category;
3864         state->orig.in.event_id = _event_id;
3865         state->orig.in.sourcename = _sourcename;
3866         state->orig.in.num_of_strings = _num_of_strings;
3867         state->orig.in.data_size = _data_size;
3868         state->orig.in.servername = _servername;
3869         state->orig.in.user_sid = _user_sid;
3870         state->orig.in.strings = _strings;
3871         state->orig.in.data = _data;
3872         state->orig.in.flags = _flags;
3873         state->orig.in.record_number = _record_number;
3874         state->orig.in.time_written = _time_written;
3875
3876         /* Out parameters */
3877         state->orig.out.record_number = _record_number;
3878         state->orig.out.time_written = _time_written;
3879
3880         /* Result */
3881         ZERO_STRUCT(state->orig.out.result);
3882
3883         if (DEBUGLEVEL >= 10) {
3884                 NDR_PRINT_IN_DEBUG(eventlog_ReportEventAndSourceW, &state->orig);
3885         }
3886
3887         state->out_mem_ctx = talloc_named_const(state, 0,
3888                              "rpccli_eventlog_ReportEventAndSourceW_out_memory");
3889         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3890                 return tevent_req_post(req, ev);
3891         }
3892
3893         /* make a temporary copy, that we pass to the dispatch function */
3894         state->tmp = state->orig;
3895
3896         subreq = cli->dispatch_send(state, ev, cli,
3897                                     &ndr_table_eventlog,
3898                                     NDR_EVENTLOG_REPORTEVENTANDSOURCEW,
3899                                     &state->tmp);
3900         if (tevent_req_nomem(subreq, req)) {
3901                 return tevent_req_post(req, ev);
3902         }
3903         tevent_req_set_callback(subreq, rpccli_eventlog_ReportEventAndSourceW_done, req);
3904         return req;
3905 }
3906
3907 static void rpccli_eventlog_ReportEventAndSourceW_done(struct tevent_req *subreq)
3908 {
3909         struct tevent_req *req = tevent_req_callback_data(
3910                 subreq, struct tevent_req);
3911         struct rpccli_eventlog_ReportEventAndSourceW_state *state = tevent_req_data(
3912                 req, struct rpccli_eventlog_ReportEventAndSourceW_state);
3913         NTSTATUS status;
3914         TALLOC_CTX *mem_ctx;
3915
3916         if (state->out_mem_ctx) {
3917                 mem_ctx = state->out_mem_ctx;
3918         } else {
3919                 mem_ctx = state;
3920         }
3921
3922         status = state->dispatch_recv(subreq, mem_ctx);
3923         TALLOC_FREE(subreq);
3924         if (!NT_STATUS_IS_OK(status)) {
3925                 tevent_req_nterror(req, status);
3926                 return;
3927         }
3928
3929         /* Copy out parameters */
3930         if (state->orig.out.record_number && state->tmp.out.record_number) {
3931                 *state->orig.out.record_number = *state->tmp.out.record_number;
3932         }
3933         if (state->orig.out.time_written && state->tmp.out.time_written) {
3934                 *state->orig.out.time_written = *state->tmp.out.time_written;
3935         }
3936
3937         /* Copy result */
3938         state->orig.out.result = state->tmp.out.result;
3939
3940         /* Reset temporary structure */
3941         ZERO_STRUCT(state->tmp);
3942
3943         if (DEBUGLEVEL >= 10) {
3944                 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventAndSourceW, &state->orig);
3945         }
3946
3947         tevent_req_done(req);
3948 }
3949
3950 NTSTATUS rpccli_eventlog_ReportEventAndSourceW_recv(struct tevent_req *req,
3951                                                     TALLOC_CTX *mem_ctx,
3952                                                     NTSTATUS *result)
3953 {
3954         struct rpccli_eventlog_ReportEventAndSourceW_state *state = tevent_req_data(
3955                 req, struct rpccli_eventlog_ReportEventAndSourceW_state);
3956         NTSTATUS status;
3957
3958         if (tevent_req_is_nterror(req, &status)) {
3959                 tevent_req_received(req);
3960                 return status;
3961         }
3962
3963         /* Steal possbile out parameters to the callers context */
3964         talloc_steal(mem_ctx, state->out_mem_ctx);
3965
3966         /* Return result */
3967         *result = state->orig.out.result;
3968
3969         tevent_req_received(req);
3970         return NT_STATUS_OK;
3971 }
3972
3973 NTSTATUS rpccli_eventlog_ReportEventAndSourceW(struct rpc_pipe_client *cli,
3974                                                TALLOC_CTX *mem_ctx,
3975                                                struct policy_handle *handle /* [in] [ref] */,
3976                                                time_t timestamp /* [in]  */,
3977                                                enum eventlogEventTypes event_type /* [in]  */,
3978                                                uint16_t event_category /* [in]  */,
3979                                                uint32_t event_id /* [in]  */,
3980                                                struct lsa_String *sourcename /* [in] [ref] */,
3981                                                uint16_t num_of_strings /* [in] [range(0,256)] */,
3982                                                uint32_t data_size /* [in] [range(0,0x3FFFF)] */,
3983                                                struct lsa_String *servername /* [in] [ref] */,
3984                                                struct dom_sid *user_sid /* [in] [unique] */,
3985                                                struct lsa_String **strings /* [in] [unique,size_is(num_of_strings)] */,
3986                                                uint8_t *data /* [in] [unique,size_is(data_size)] */,
3987                                                uint16_t flags /* [in]  */,
3988                                                uint32_t *record_number /* [in,out] [unique] */,
3989                                                time_t *time_written /* [in,out] [unique] */)
3990 {
3991         struct eventlog_ReportEventAndSourceW r;
3992         NTSTATUS status;
3993
3994         /* In parameters */
3995         r.in.handle = handle;
3996         r.in.timestamp = timestamp;
3997         r.in.event_type = event_type;
3998         r.in.event_category = event_category;
3999         r.in.event_id = event_id;
4000         r.in.sourcename = sourcename;
4001         r.in.num_of_strings = num_of_strings;
4002         r.in.data_size = data_size;
4003         r.in.servername = servername;
4004         r.in.user_sid = user_sid;
4005         r.in.strings = strings;
4006         r.in.data = data;
4007         r.in.flags = flags;
4008         r.in.record_number = record_number;
4009         r.in.time_written = time_written;
4010
4011         if (DEBUGLEVEL >= 10) {
4012                 NDR_PRINT_IN_DEBUG(eventlog_ReportEventAndSourceW, &r);
4013         }
4014
4015         status = cli->dispatch(cli,
4016                                 mem_ctx,
4017                                 &ndr_table_eventlog,
4018                                 NDR_EVENTLOG_REPORTEVENTANDSOURCEW,
4019                                 &r);
4020
4021         if (!NT_STATUS_IS_OK(status)) {
4022                 return status;
4023         }
4024
4025         if (DEBUGLEVEL >= 10) {
4026                 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventAndSourceW, &r);
4027         }
4028
4029         if (NT_STATUS_IS_ERR(status)) {
4030                 return status;
4031         }
4032
4033         /* Return variables */
4034         if (record_number && r.out.record_number) {
4035                 *record_number = *r.out.record_number;
4036         }
4037         if (time_written && r.out.time_written) {
4038                 *time_written = *r.out.time_written;
4039         }
4040
4041         /* Return result */
4042         return r.out.result;
4043 }
4044