Merge branch 'master' of /home/tridge/samba/git/combined
[Samba/aatanasov.git] / librpc / gen_ndr / cli_eventlog.c
bloba53ca13eb41779745256d2ba1f4469e695c99d81
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_eventlog.h"
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);
16 static void rpccli_eventlog_ClearEventLogW_done(struct tevent_req *subreq);
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] */)
24 struct tevent_req *req;
25 struct rpccli_eventlog_ClearEventLogW_state *state;
26 struct tevent_req *subreq;
28 req = tevent_req_create(mem_ctx, &state,
29 struct rpccli_eventlog_ClearEventLogW_state);
30 if (req == NULL) {
31 return NULL;
33 state->out_mem_ctx = NULL;
34 state->dispatch_recv = cli->dispatch_recv;
36 /* In parameters */
37 state->orig.in.handle = _handle;
38 state->orig.in.backupfile = _backupfile;
40 /* Out parameters */
42 /* Result */
43 ZERO_STRUCT(state->orig.out.result);
45 if (DEBUGLEVEL >= 10) {
46 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, &state->orig);
49 /* make a temporary copy, that we pass to the dispatch function */
50 state->tmp = state->orig;
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);
59 tevent_req_set_callback(subreq, rpccli_eventlog_ClearEventLogW_done, req);
60 return req;
63 static void rpccli_eventlog_ClearEventLogW_done(struct tevent_req *subreq)
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;
72 if (state->out_mem_ctx) {
73 mem_ctx = state->out_mem_ctx;
74 } else {
75 mem_ctx = state;
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;
85 /* Copy out parameters */
87 /* Copy result */
88 state->orig.out.result = state->tmp.out.result;
90 /* Reset temporary structure */
91 ZERO_STRUCT(state->tmp);
93 if (DEBUGLEVEL >= 10) {
94 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, &state->orig);
97 tevent_req_done(req);
100 NTSTATUS rpccli_eventlog_ClearEventLogW_recv(struct tevent_req *req,
101 TALLOC_CTX *mem_ctx,
102 NTSTATUS *result)
104 struct rpccli_eventlog_ClearEventLogW_state *state = tevent_req_data(
105 req, struct rpccli_eventlog_ClearEventLogW_state);
106 NTSTATUS status;
108 if (tevent_req_is_nterror(req, &status)) {
109 tevent_req_received(req);
110 return status;
113 /* Steal possbile out parameters to the callers context */
114 talloc_steal(mem_ctx, state->out_mem_ctx);
116 /* Return result */
117 *result = state->orig.out.result;
119 tevent_req_received(req);
120 return NT_STATUS_OK;
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] */)
128 struct eventlog_ClearEventLogW r;
129 NTSTATUS status;
131 /* In parameters */
132 r.in.handle = handle;
133 r.in.backupfile = backupfile;
135 if (DEBUGLEVEL >= 10) {
136 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, &r);
139 status = cli->dispatch(cli,
140 mem_ctx,
141 &ndr_table_eventlog,
142 NDR_EVENTLOG_CLEAREVENTLOGW,
143 &r);
145 if (!NT_STATUS_IS_OK(status)) {
146 return status;
149 if (DEBUGLEVEL >= 10) {
150 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, &r);
153 if (NT_STATUS_IS_ERR(status)) {
154 return status;
157 /* Return variables */
159 /* Return result */
160 return r.out.result;
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);
170 static void rpccli_eventlog_BackupEventLogW_done(struct tevent_req *subreq);
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] */)
178 struct tevent_req *req;
179 struct rpccli_eventlog_BackupEventLogW_state *state;
180 struct tevent_req *subreq;
182 req = tevent_req_create(mem_ctx, &state,
183 struct rpccli_eventlog_BackupEventLogW_state);
184 if (req == NULL) {
185 return NULL;
187 state->out_mem_ctx = NULL;
188 state->dispatch_recv = cli->dispatch_recv;
190 /* In parameters */
191 state->orig.in.handle = _handle;
192 state->orig.in.backup_filename = _backup_filename;
194 /* Out parameters */
196 /* Result */
197 ZERO_STRUCT(state->orig.out.result);
199 if (DEBUGLEVEL >= 10) {
200 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, &state->orig);
203 /* make a temporary copy, that we pass to the dispatch function */
204 state->tmp = state->orig;
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);
213 tevent_req_set_callback(subreq, rpccli_eventlog_BackupEventLogW_done, req);
214 return req;
217 static void rpccli_eventlog_BackupEventLogW_done(struct tevent_req *subreq)
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;
226 if (state->out_mem_ctx) {
227 mem_ctx = state->out_mem_ctx;
228 } else {
229 mem_ctx = state;
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;
239 /* Copy out parameters */
241 /* Copy result */
242 state->orig.out.result = state->tmp.out.result;
244 /* Reset temporary structure */
245 ZERO_STRUCT(state->tmp);
247 if (DEBUGLEVEL >= 10) {
248 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, &state->orig);
251 tevent_req_done(req);
254 NTSTATUS rpccli_eventlog_BackupEventLogW_recv(struct tevent_req *req,
255 TALLOC_CTX *mem_ctx,
256 NTSTATUS *result)
258 struct rpccli_eventlog_BackupEventLogW_state *state = tevent_req_data(
259 req, struct rpccli_eventlog_BackupEventLogW_state);
260 NTSTATUS status;
262 if (tevent_req_is_nterror(req, &status)) {
263 tevent_req_received(req);
264 return status;
267 /* Steal possbile out parameters to the callers context */
268 talloc_steal(mem_ctx, state->out_mem_ctx);
270 /* Return result */
271 *result = state->orig.out.result;
273 tevent_req_received(req);
274 return NT_STATUS_OK;
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] */)
282 struct eventlog_BackupEventLogW r;
283 NTSTATUS status;
285 /* In parameters */
286 r.in.handle = handle;
287 r.in.backup_filename = backup_filename;
289 if (DEBUGLEVEL >= 10) {
290 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, &r);
293 status = cli->dispatch(cli,
294 mem_ctx,
295 &ndr_table_eventlog,
296 NDR_EVENTLOG_BACKUPEVENTLOGW,
297 &r);
299 if (!NT_STATUS_IS_OK(status)) {
300 return status;
303 if (DEBUGLEVEL >= 10) {
304 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, &r);
307 if (NT_STATUS_IS_ERR(status)) {
308 return status;
311 /* Return variables */
313 /* Return result */
314 return r.out.result;
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);
324 static void rpccli_eventlog_CloseEventLog_done(struct tevent_req *subreq);
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] */)
331 struct tevent_req *req;
332 struct rpccli_eventlog_CloseEventLog_state *state;
333 struct tevent_req *subreq;
335 req = tevent_req_create(mem_ctx, &state,
336 struct rpccli_eventlog_CloseEventLog_state);
337 if (req == NULL) {
338 return NULL;
340 state->out_mem_ctx = NULL;
341 state->dispatch_recv = cli->dispatch_recv;
343 /* In parameters */
344 state->orig.in.handle = _handle;
346 /* Out parameters */
347 state->orig.out.handle = _handle;
349 /* Result */
350 ZERO_STRUCT(state->orig.out.result);
352 if (DEBUGLEVEL >= 10) {
353 NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, &state->orig);
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);
362 /* make a temporary copy, that we pass to the dispatch function */
363 state->tmp = state->orig;
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);
372 tevent_req_set_callback(subreq, rpccli_eventlog_CloseEventLog_done, req);
373 return req;
376 static void rpccli_eventlog_CloseEventLog_done(struct tevent_req *subreq)
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;
385 if (state->out_mem_ctx) {
386 mem_ctx = state->out_mem_ctx;
387 } else {
388 mem_ctx = state;
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;
398 /* Copy out parameters */
399 *state->orig.out.handle = *state->tmp.out.handle;
401 /* Copy result */
402 state->orig.out.result = state->tmp.out.result;
404 /* Reset temporary structure */
405 ZERO_STRUCT(state->tmp);
407 if (DEBUGLEVEL >= 10) {
408 NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, &state->orig);
411 tevent_req_done(req);
414 NTSTATUS rpccli_eventlog_CloseEventLog_recv(struct tevent_req *req,
415 TALLOC_CTX *mem_ctx,
416 NTSTATUS *result)
418 struct rpccli_eventlog_CloseEventLog_state *state = tevent_req_data(
419 req, struct rpccli_eventlog_CloseEventLog_state);
420 NTSTATUS status;
422 if (tevent_req_is_nterror(req, &status)) {
423 tevent_req_received(req);
424 return status;
427 /* Steal possbile out parameters to the callers context */
428 talloc_steal(mem_ctx, state->out_mem_ctx);
430 /* Return result */
431 *result = state->orig.out.result;
433 tevent_req_received(req);
434 return NT_STATUS_OK;
437 NTSTATUS rpccli_eventlog_CloseEventLog(struct rpc_pipe_client *cli,
438 TALLOC_CTX *mem_ctx,
439 struct policy_handle *handle /* [in,out] [ref] */)
441 struct eventlog_CloseEventLog r;
442 NTSTATUS status;
444 /* In parameters */
445 r.in.handle = handle;
447 if (DEBUGLEVEL >= 10) {
448 NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, &r);
451 status = cli->dispatch(cli,
452 mem_ctx,
453 &ndr_table_eventlog,
454 NDR_EVENTLOG_CLOSEEVENTLOG,
455 &r);
457 if (!NT_STATUS_IS_OK(status)) {
458 return status;
461 if (DEBUGLEVEL >= 10) {
462 NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, &r);
465 if (NT_STATUS_IS_ERR(status)) {
466 return status;
469 /* Return variables */
470 *handle = *r.out.handle;
472 /* Return result */
473 return r.out.result;
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);
483 static void rpccli_eventlog_DeregisterEventSource_done(struct tevent_req *subreq);
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] */)
490 struct tevent_req *req;
491 struct rpccli_eventlog_DeregisterEventSource_state *state;
492 struct tevent_req *subreq;
494 req = tevent_req_create(mem_ctx, &state,
495 struct rpccli_eventlog_DeregisterEventSource_state);
496 if (req == NULL) {
497 return NULL;
499 state->out_mem_ctx = NULL;
500 state->dispatch_recv = cli->dispatch_recv;
502 /* In parameters */
503 state->orig.in.handle = _handle;
505 /* Out parameters */
506 state->orig.out.handle = _handle;
508 /* Result */
509 ZERO_STRUCT(state->orig.out.result);
511 if (DEBUGLEVEL >= 10) {
512 NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, &state->orig);
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);
521 /* make a temporary copy, that we pass to the dispatch function */
522 state->tmp = state->orig;
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);
531 tevent_req_set_callback(subreq, rpccli_eventlog_DeregisterEventSource_done, req);
532 return req;
535 static void rpccli_eventlog_DeregisterEventSource_done(struct tevent_req *subreq)
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;
544 if (state->out_mem_ctx) {
545 mem_ctx = state->out_mem_ctx;
546 } else {
547 mem_ctx = state;
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;
557 /* Copy out parameters */
558 *state->orig.out.handle = *state->tmp.out.handle;
560 /* Copy result */
561 state->orig.out.result = state->tmp.out.result;
563 /* Reset temporary structure */
564 ZERO_STRUCT(state->tmp);
566 if (DEBUGLEVEL >= 10) {
567 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &state->orig);
570 tevent_req_done(req);
573 NTSTATUS rpccli_eventlog_DeregisterEventSource_recv(struct tevent_req *req,
574 TALLOC_CTX *mem_ctx,
575 NTSTATUS *result)
577 struct rpccli_eventlog_DeregisterEventSource_state *state = tevent_req_data(
578 req, struct rpccli_eventlog_DeregisterEventSource_state);
579 NTSTATUS status;
581 if (tevent_req_is_nterror(req, &status)) {
582 tevent_req_received(req);
583 return status;
586 /* Steal possbile out parameters to the callers context */
587 talloc_steal(mem_ctx, state->out_mem_ctx);
589 /* Return result */
590 *result = state->orig.out.result;
592 tevent_req_received(req);
593 return NT_STATUS_OK;
596 NTSTATUS rpccli_eventlog_DeregisterEventSource(struct rpc_pipe_client *cli,
597 TALLOC_CTX *mem_ctx,
598 struct policy_handle *handle /* [in,out] [ref] */)
600 struct eventlog_DeregisterEventSource r;
601 NTSTATUS status;
603 /* In parameters */
604 r.in.handle = handle;
606 if (DEBUGLEVEL >= 10) {
607 NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, &r);
610 status = cli->dispatch(cli,
611 mem_ctx,
612 &ndr_table_eventlog,
613 NDR_EVENTLOG_DEREGISTEREVENTSOURCE,
614 &r);
616 if (!NT_STATUS_IS_OK(status)) {
617 return status;
620 if (DEBUGLEVEL >= 10) {
621 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &r);
624 if (NT_STATUS_IS_ERR(status)) {
625 return status;
628 /* Return variables */
629 *handle = *r.out.handle;
631 /* Return result */
632 return r.out.result;
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);
642 static void rpccli_eventlog_GetNumRecords_done(struct tevent_req *subreq);
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] */)
650 struct tevent_req *req;
651 struct rpccli_eventlog_GetNumRecords_state *state;
652 struct tevent_req *subreq;
654 req = tevent_req_create(mem_ctx, &state,
655 struct rpccli_eventlog_GetNumRecords_state);
656 if (req == NULL) {
657 return NULL;
659 state->out_mem_ctx = NULL;
660 state->dispatch_recv = cli->dispatch_recv;
662 /* In parameters */
663 state->orig.in.handle = _handle;
665 /* Out parameters */
666 state->orig.out.number = _number;
668 /* Result */
669 ZERO_STRUCT(state->orig.out.result);
671 if (DEBUGLEVEL >= 10) {
672 NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, &state->orig);
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);
681 /* make a temporary copy, that we pass to the dispatch function */
682 state->tmp = state->orig;
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);
691 tevent_req_set_callback(subreq, rpccli_eventlog_GetNumRecords_done, req);
692 return req;
695 static void rpccli_eventlog_GetNumRecords_done(struct tevent_req *subreq)
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;
704 if (state->out_mem_ctx) {
705 mem_ctx = state->out_mem_ctx;
706 } else {
707 mem_ctx = state;
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;
717 /* Copy out parameters */
718 *state->orig.out.number = *state->tmp.out.number;
720 /* Copy result */
721 state->orig.out.result = state->tmp.out.result;
723 /* Reset temporary structure */
724 ZERO_STRUCT(state->tmp);
726 if (DEBUGLEVEL >= 10) {
727 NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &state->orig);
730 tevent_req_done(req);
733 NTSTATUS rpccli_eventlog_GetNumRecords_recv(struct tevent_req *req,
734 TALLOC_CTX *mem_ctx,
735 NTSTATUS *result)
737 struct rpccli_eventlog_GetNumRecords_state *state = tevent_req_data(
738 req, struct rpccli_eventlog_GetNumRecords_state);
739 NTSTATUS status;
741 if (tevent_req_is_nterror(req, &status)) {
742 tevent_req_received(req);
743 return status;
746 /* Steal possbile out parameters to the callers context */
747 talloc_steal(mem_ctx, state->out_mem_ctx);
749 /* Return result */
750 *result = state->orig.out.result;
752 tevent_req_received(req);
753 return NT_STATUS_OK;
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] */)
761 struct eventlog_GetNumRecords r;
762 NTSTATUS status;
764 /* In parameters */
765 r.in.handle = handle;
767 if (DEBUGLEVEL >= 10) {
768 NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, &r);
771 status = cli->dispatch(cli,
772 mem_ctx,
773 &ndr_table_eventlog,
774 NDR_EVENTLOG_GETNUMRECORDS,
775 &r);
777 if (!NT_STATUS_IS_OK(status)) {
778 return status;
781 if (DEBUGLEVEL >= 10) {
782 NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &r);
785 if (NT_STATUS_IS_ERR(status)) {
786 return status;
789 /* Return variables */
790 *number = *r.out.number;
792 /* Return result */
793 return r.out.result;
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);
803 static void rpccli_eventlog_GetOldestRecord_done(struct tevent_req *subreq);
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] */)
811 struct tevent_req *req;
812 struct rpccli_eventlog_GetOldestRecord_state *state;
813 struct tevent_req *subreq;
815 req = tevent_req_create(mem_ctx, &state,
816 struct rpccli_eventlog_GetOldestRecord_state);
817 if (req == NULL) {
818 return NULL;
820 state->out_mem_ctx = NULL;
821 state->dispatch_recv = cli->dispatch_recv;
823 /* In parameters */
824 state->orig.in.handle = _handle;
826 /* Out parameters */
827 state->orig.out.oldest_entry = _oldest_entry;
829 /* Result */
830 ZERO_STRUCT(state->orig.out.result);
832 if (DEBUGLEVEL >= 10) {
833 NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &state->orig);
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);
842 /* make a temporary copy, that we pass to the dispatch function */
843 state->tmp = state->orig;
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);
852 tevent_req_set_callback(subreq, rpccli_eventlog_GetOldestRecord_done, req);
853 return req;
856 static void rpccli_eventlog_GetOldestRecord_done(struct tevent_req *subreq)
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;
865 if (state->out_mem_ctx) {
866 mem_ctx = state->out_mem_ctx;
867 } else {
868 mem_ctx = state;
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;
878 /* Copy out parameters */
879 *state->orig.out.oldest_entry = *state->tmp.out.oldest_entry;
881 /* Copy result */
882 state->orig.out.result = state->tmp.out.result;
884 /* Reset temporary structure */
885 ZERO_STRUCT(state->tmp);
887 if (DEBUGLEVEL >= 10) {
888 NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &state->orig);
891 tevent_req_done(req);
894 NTSTATUS rpccli_eventlog_GetOldestRecord_recv(struct tevent_req *req,
895 TALLOC_CTX *mem_ctx,
896 NTSTATUS *result)
898 struct rpccli_eventlog_GetOldestRecord_state *state = tevent_req_data(
899 req, struct rpccli_eventlog_GetOldestRecord_state);
900 NTSTATUS status;
902 if (tevent_req_is_nterror(req, &status)) {
903 tevent_req_received(req);
904 return status;
907 /* Steal possbile out parameters to the callers context */
908 talloc_steal(mem_ctx, state->out_mem_ctx);
910 /* Return result */
911 *result = state->orig.out.result;
913 tevent_req_received(req);
914 return NT_STATUS_OK;
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] */)
922 struct eventlog_GetOldestRecord r;
923 NTSTATUS status;
925 /* In parameters */
926 r.in.handle = handle;
928 if (DEBUGLEVEL >= 10) {
929 NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &r);
932 status = cli->dispatch(cli,
933 mem_ctx,
934 &ndr_table_eventlog,
935 NDR_EVENTLOG_GETOLDESTRECORD,
936 &r);
938 if (!NT_STATUS_IS_OK(status)) {
939 return status;
942 if (DEBUGLEVEL >= 10) {
943 NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &r);
946 if (NT_STATUS_IS_ERR(status)) {
947 return status;
950 /* Return variables */
951 *oldest_entry = *r.out.oldest_entry;
953 /* Return result */
954 return r.out.result;
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);
964 static void rpccli_eventlog_ChangeNotify_done(struct tevent_req *subreq);
966 struct tevent_req *rpccli_eventlog_ChangeNotify_send(TALLOC_CTX *mem_ctx,
967 struct tevent_context *ev,
968 struct rpc_pipe_client *cli)
970 struct tevent_req *req;
971 struct rpccli_eventlog_ChangeNotify_state *state;
972 struct tevent_req *subreq;
974 req = tevent_req_create(mem_ctx, &state,
975 struct rpccli_eventlog_ChangeNotify_state);
976 if (req == NULL) {
977 return NULL;
979 state->out_mem_ctx = NULL;
980 state->dispatch_recv = cli->dispatch_recv;
982 /* In parameters */
984 /* Out parameters */
986 /* Result */
987 ZERO_STRUCT(state->orig.out.result);
989 if (DEBUGLEVEL >= 10) {
990 NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, &state->orig);
993 /* make a temporary copy, that we pass to the dispatch function */
994 state->tmp = state->orig;
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);
1003 tevent_req_set_callback(subreq, rpccli_eventlog_ChangeNotify_done, req);
1004 return req;
1007 static void rpccli_eventlog_ChangeNotify_done(struct tevent_req *subreq)
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;
1016 if (state->out_mem_ctx) {
1017 mem_ctx = state->out_mem_ctx;
1018 } else {
1019 mem_ctx = state;
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;
1029 /* Copy out parameters */
1031 /* Copy result */
1032 state->orig.out.result = state->tmp.out.result;
1034 /* Reset temporary structure */
1035 ZERO_STRUCT(state->tmp);
1037 if (DEBUGLEVEL >= 10) {
1038 NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &state->orig);
1041 tevent_req_done(req);
1044 NTSTATUS rpccli_eventlog_ChangeNotify_recv(struct tevent_req *req,
1045 TALLOC_CTX *mem_ctx,
1046 NTSTATUS *result)
1048 struct rpccli_eventlog_ChangeNotify_state *state = tevent_req_data(
1049 req, struct rpccli_eventlog_ChangeNotify_state);
1050 NTSTATUS status;
1052 if (tevent_req_is_nterror(req, &status)) {
1053 tevent_req_received(req);
1054 return status;
1057 /* Steal possbile out parameters to the callers context */
1058 talloc_steal(mem_ctx, state->out_mem_ctx);
1060 /* Return result */
1061 *result = state->orig.out.result;
1063 tevent_req_received(req);
1064 return NT_STATUS_OK;
1067 NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli,
1068 TALLOC_CTX *mem_ctx)
1070 struct eventlog_ChangeNotify r;
1071 NTSTATUS status;
1073 /* In parameters */
1075 if (DEBUGLEVEL >= 10) {
1076 NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, &r);
1079 status = cli->dispatch(cli,
1080 mem_ctx,
1081 &ndr_table_eventlog,
1082 NDR_EVENTLOG_CHANGENOTIFY,
1083 &r);
1085 if (!NT_STATUS_IS_OK(status)) {
1086 return status;
1089 if (DEBUGLEVEL >= 10) {
1090 NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &r);
1093 if (NT_STATUS_IS_ERR(status)) {
1094 return status;
1097 /* Return variables */
1099 /* Return result */
1100 return r.out.result;
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);
1110 static void rpccli_eventlog_OpenEventLogW_done(struct tevent_req *subreq);
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] */)
1122 struct tevent_req *req;
1123 struct rpccli_eventlog_OpenEventLogW_state *state;
1124 struct tevent_req *subreq;
1126 req = tevent_req_create(mem_ctx, &state,
1127 struct rpccli_eventlog_OpenEventLogW_state);
1128 if (req == NULL) {
1129 return NULL;
1131 state->out_mem_ctx = NULL;
1132 state->dispatch_recv = cli->dispatch_recv;
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;
1141 /* Out parameters */
1142 state->orig.out.handle = _handle;
1144 /* Result */
1145 ZERO_STRUCT(state->orig.out.result);
1147 if (DEBUGLEVEL >= 10) {
1148 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, &state->orig);
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);
1157 /* make a temporary copy, that we pass to the dispatch function */
1158 state->tmp = state->orig;
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);
1167 tevent_req_set_callback(subreq, rpccli_eventlog_OpenEventLogW_done, req);
1168 return req;
1171 static void rpccli_eventlog_OpenEventLogW_done(struct tevent_req *subreq)
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;
1180 if (state->out_mem_ctx) {
1181 mem_ctx = state->out_mem_ctx;
1182 } else {
1183 mem_ctx = state;
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;
1193 /* Copy out parameters */
1194 *state->orig.out.handle = *state->tmp.out.handle;
1196 /* Copy result */
1197 state->orig.out.result = state->tmp.out.result;
1199 /* Reset temporary structure */
1200 ZERO_STRUCT(state->tmp);
1202 if (DEBUGLEVEL >= 10) {
1203 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &state->orig);
1206 tevent_req_done(req);
1209 NTSTATUS rpccli_eventlog_OpenEventLogW_recv(struct tevent_req *req,
1210 TALLOC_CTX *mem_ctx,
1211 NTSTATUS *result)
1213 struct rpccli_eventlog_OpenEventLogW_state *state = tevent_req_data(
1214 req, struct rpccli_eventlog_OpenEventLogW_state);
1215 NTSTATUS status;
1217 if (tevent_req_is_nterror(req, &status)) {
1218 tevent_req_received(req);
1219 return status;
1222 /* Steal possbile out parameters to the callers context */
1223 talloc_steal(mem_ctx, state->out_mem_ctx);
1225 /* Return result */
1226 *result = state->orig.out.result;
1228 tevent_req_received(req);
1229 return NT_STATUS_OK;
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] */)
1241 struct eventlog_OpenEventLogW r;
1242 NTSTATUS status;
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;
1251 if (DEBUGLEVEL >= 10) {
1252 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, &r);
1255 status = cli->dispatch(cli,
1256 mem_ctx,
1257 &ndr_table_eventlog,
1258 NDR_EVENTLOG_OPENEVENTLOGW,
1259 &r);
1261 if (!NT_STATUS_IS_OK(status)) {
1262 return status;
1265 if (DEBUGLEVEL >= 10) {
1266 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &r);
1269 if (NT_STATUS_IS_ERR(status)) {
1270 return status;
1273 /* Return variables */
1274 *handle = *r.out.handle;
1276 /* Return result */
1277 return r.out.result;
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);
1287 static void rpccli_eventlog_RegisterEventSourceW_done(struct tevent_req *subreq);
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] */)
1299 struct tevent_req *req;
1300 struct rpccli_eventlog_RegisterEventSourceW_state *state;
1301 struct tevent_req *subreq;
1303 req = tevent_req_create(mem_ctx, &state,
1304 struct rpccli_eventlog_RegisterEventSourceW_state);
1305 if (req == NULL) {
1306 return NULL;
1308 state->out_mem_ctx = NULL;
1309 state->dispatch_recv = cli->dispatch_recv;
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;
1318 /* Out parameters */
1319 state->orig.out.log_handle = _log_handle;
1321 /* Result */
1322 ZERO_STRUCT(state->orig.out.result);
1324 if (DEBUGLEVEL >= 10) {
1325 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, &state->orig);
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);
1334 /* make a temporary copy, that we pass to the dispatch function */
1335 state->tmp = state->orig;
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);
1344 tevent_req_set_callback(subreq, rpccli_eventlog_RegisterEventSourceW_done, req);
1345 return req;
1348 static void rpccli_eventlog_RegisterEventSourceW_done(struct tevent_req *subreq)
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;
1357 if (state->out_mem_ctx) {
1358 mem_ctx = state->out_mem_ctx;
1359 } else {
1360 mem_ctx = state;
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;
1370 /* Copy out parameters */
1371 *state->orig.out.log_handle = *state->tmp.out.log_handle;
1373 /* Copy result */
1374 state->orig.out.result = state->tmp.out.result;
1376 /* Reset temporary structure */
1377 ZERO_STRUCT(state->tmp);
1379 if (DEBUGLEVEL >= 10) {
1380 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &state->orig);
1383 tevent_req_done(req);
1386 NTSTATUS rpccli_eventlog_RegisterEventSourceW_recv(struct tevent_req *req,
1387 TALLOC_CTX *mem_ctx,
1388 NTSTATUS *result)
1390 struct rpccli_eventlog_RegisterEventSourceW_state *state = tevent_req_data(
1391 req, struct rpccli_eventlog_RegisterEventSourceW_state);
1392 NTSTATUS status;
1394 if (tevent_req_is_nterror(req, &status)) {
1395 tevent_req_received(req);
1396 return status;
1399 /* Steal possbile out parameters to the callers context */
1400 talloc_steal(mem_ctx, state->out_mem_ctx);
1402 /* Return result */
1403 *result = state->orig.out.result;
1405 tevent_req_received(req);
1406 return NT_STATUS_OK;
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] */)
1418 struct eventlog_RegisterEventSourceW r;
1419 NTSTATUS status;
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;
1428 if (DEBUGLEVEL >= 10) {
1429 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, &r);
1432 status = cli->dispatch(cli,
1433 mem_ctx,
1434 &ndr_table_eventlog,
1435 NDR_EVENTLOG_REGISTEREVENTSOURCEW,
1436 &r);
1438 if (!NT_STATUS_IS_OK(status)) {
1439 return status;
1442 if (DEBUGLEVEL >= 10) {
1443 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &r);
1446 if (NT_STATUS_IS_ERR(status)) {
1447 return status;
1450 /* Return variables */
1451 *log_handle = *r.out.log_handle;
1453 /* Return result */
1454 return r.out.result;
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);
1464 static void rpccli_eventlog_OpenBackupEventLogW_done(struct tevent_req *subreq);
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] */)
1475 struct tevent_req *req;
1476 struct rpccli_eventlog_OpenBackupEventLogW_state *state;
1477 struct tevent_req *subreq;
1479 req = tevent_req_create(mem_ctx, &state,
1480 struct rpccli_eventlog_OpenBackupEventLogW_state);
1481 if (req == NULL) {
1482 return NULL;
1484 state->out_mem_ctx = NULL;
1485 state->dispatch_recv = cli->dispatch_recv;
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;
1493 /* Out parameters */
1494 state->orig.out.handle = _handle;
1496 /* Result */
1497 ZERO_STRUCT(state->orig.out.result);
1499 if (DEBUGLEVEL >= 10) {
1500 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, &state->orig);
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);
1509 /* make a temporary copy, that we pass to the dispatch function */
1510 state->tmp = state->orig;
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);
1519 tevent_req_set_callback(subreq, rpccli_eventlog_OpenBackupEventLogW_done, req);
1520 return req;
1523 static void rpccli_eventlog_OpenBackupEventLogW_done(struct tevent_req *subreq)
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;
1532 if (state->out_mem_ctx) {
1533 mem_ctx = state->out_mem_ctx;
1534 } else {
1535 mem_ctx = state;
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;
1545 /* Copy out parameters */
1546 *state->orig.out.handle = *state->tmp.out.handle;
1548 /* Copy result */
1549 state->orig.out.result = state->tmp.out.result;
1551 /* Reset temporary structure */
1552 ZERO_STRUCT(state->tmp);
1554 if (DEBUGLEVEL >= 10) {
1555 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &state->orig);
1558 tevent_req_done(req);
1561 NTSTATUS rpccli_eventlog_OpenBackupEventLogW_recv(struct tevent_req *req,
1562 TALLOC_CTX *mem_ctx,
1563 NTSTATUS *result)
1565 struct rpccli_eventlog_OpenBackupEventLogW_state *state = tevent_req_data(
1566 req, struct rpccli_eventlog_OpenBackupEventLogW_state);
1567 NTSTATUS status;
1569 if (tevent_req_is_nterror(req, &status)) {
1570 tevent_req_received(req);
1571 return status;
1574 /* Steal possbile out parameters to the callers context */
1575 talloc_steal(mem_ctx, state->out_mem_ctx);
1577 /* Return result */
1578 *result = state->orig.out.result;
1580 tevent_req_received(req);
1581 return NT_STATUS_OK;
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] */)
1592 struct eventlog_OpenBackupEventLogW r;
1593 NTSTATUS status;
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;
1601 if (DEBUGLEVEL >= 10) {
1602 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, &r);
1605 status = cli->dispatch(cli,
1606 mem_ctx,
1607 &ndr_table_eventlog,
1608 NDR_EVENTLOG_OPENBACKUPEVENTLOGW,
1609 &r);
1611 if (!NT_STATUS_IS_OK(status)) {
1612 return status;
1615 if (DEBUGLEVEL >= 10) {
1616 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &r);
1619 if (NT_STATUS_IS_ERR(status)) {
1620 return status;
1623 /* Return variables */
1624 *handle = *r.out.handle;
1626 /* Return result */
1627 return r.out.result;
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);
1637 static void rpccli_eventlog_ReadEventLogW_done(struct tevent_req *subreq);
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] */)
1650 struct tevent_req *req;
1651 struct rpccli_eventlog_ReadEventLogW_state *state;
1652 struct tevent_req *subreq;
1654 req = tevent_req_create(mem_ctx, &state,
1655 struct rpccli_eventlog_ReadEventLogW_state);
1656 if (req == NULL) {
1657 return NULL;
1659 state->out_mem_ctx = NULL;
1660 state->dispatch_recv = cli->dispatch_recv;
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;
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;
1673 /* Result */
1674 ZERO_STRUCT(state->orig.out.result);
1676 if (DEBUGLEVEL >= 10) {
1677 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, &state->orig);
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);
1686 /* make a temporary copy, that we pass to the dispatch function */
1687 state->tmp = state->orig;
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);
1696 tevent_req_set_callback(subreq, rpccli_eventlog_ReadEventLogW_done, req);
1697 return req;
1700 static void rpccli_eventlog_ReadEventLogW_done(struct tevent_req *subreq)
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;
1709 if (state->out_mem_ctx) {
1710 mem_ctx = state->out_mem_ctx;
1711 } else {
1712 mem_ctx = state;
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;
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;
1727 /* Copy result */
1728 state->orig.out.result = state->tmp.out.result;
1730 /* Reset temporary structure */
1731 ZERO_STRUCT(state->tmp);
1733 if (DEBUGLEVEL >= 10) {
1734 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &state->orig);
1737 tevent_req_done(req);
1740 NTSTATUS rpccli_eventlog_ReadEventLogW_recv(struct tevent_req *req,
1741 TALLOC_CTX *mem_ctx,
1742 NTSTATUS *result)
1744 struct rpccli_eventlog_ReadEventLogW_state *state = tevent_req_data(
1745 req, struct rpccli_eventlog_ReadEventLogW_state);
1746 NTSTATUS status;
1748 if (tevent_req_is_nterror(req, &status)) {
1749 tevent_req_received(req);
1750 return status;
1753 /* Steal possbile out parameters to the callers context */
1754 talloc_steal(mem_ctx, state->out_mem_ctx);
1756 /* Return result */
1757 *result = state->orig.out.result;
1759 tevent_req_received(req);
1760 return NT_STATUS_OK;
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] */)
1773 struct eventlog_ReadEventLogW r;
1774 NTSTATUS status;
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;
1782 if (DEBUGLEVEL >= 10) {
1783 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, &r);
1786 status = cli->dispatch(cli,
1787 mem_ctx,
1788 &ndr_table_eventlog,
1789 NDR_EVENTLOG_READEVENTLOGW,
1790 &r);
1792 if (!NT_STATUS_IS_OK(status)) {
1793 return status;
1796 if (DEBUGLEVEL >= 10) {
1797 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &r);
1800 if (NT_STATUS_IS_ERR(status)) {
1801 return status;
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;
1809 /* Return result */
1810 return r.out.result;
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);
1820 static void rpccli_eventlog_ReportEventW_done(struct tevent_req *subreq);
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] */)
1840 struct tevent_req *req;
1841 struct rpccli_eventlog_ReportEventW_state *state;
1842 struct tevent_req *subreq;
1844 req = tevent_req_create(mem_ctx, &state,
1845 struct rpccli_eventlog_ReportEventW_state);
1846 if (req == NULL) {
1847 return NULL;
1849 state->out_mem_ctx = NULL;
1850 state->dispatch_recv = cli->dispatch_recv;
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;
1868 /* Out parameters */
1869 state->orig.out.record_number = _record_number;
1870 state->orig.out.time_written = _time_written;
1872 /* Result */
1873 ZERO_STRUCT(state->orig.out.result);
1875 if (DEBUGLEVEL >= 10) {
1876 NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, &state->orig);
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);
1885 /* make a temporary copy, that we pass to the dispatch function */
1886 state->tmp = state->orig;
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);
1895 tevent_req_set_callback(subreq, rpccli_eventlog_ReportEventW_done, req);
1896 return req;
1899 static void rpccli_eventlog_ReportEventW_done(struct tevent_req *subreq)
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;
1908 if (state->out_mem_ctx) {
1909 mem_ctx = state->out_mem_ctx;
1910 } else {
1911 mem_ctx = state;
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;
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;
1925 if (state->orig.out.time_written && state->tmp.out.time_written) {
1926 *state->orig.out.time_written = *state->tmp.out.time_written;
1929 /* Copy result */
1930 state->orig.out.result = state->tmp.out.result;
1932 /* Reset temporary structure */
1933 ZERO_STRUCT(state->tmp);
1935 if (DEBUGLEVEL >= 10) {
1936 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &state->orig);
1939 tevent_req_done(req);
1942 NTSTATUS rpccli_eventlog_ReportEventW_recv(struct tevent_req *req,
1943 TALLOC_CTX *mem_ctx,
1944 NTSTATUS *result)
1946 struct rpccli_eventlog_ReportEventW_state *state = tevent_req_data(
1947 req, struct rpccli_eventlog_ReportEventW_state);
1948 NTSTATUS status;
1950 if (tevent_req_is_nterror(req, &status)) {
1951 tevent_req_received(req);
1952 return status;
1955 /* Steal possbile out parameters to the callers context */
1956 talloc_steal(mem_ctx, state->out_mem_ctx);
1958 /* Return result */
1959 *result = state->orig.out.result;
1961 tevent_req_received(req);
1962 return NT_STATUS_OK;
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] */)
1982 struct eventlog_ReportEventW r;
1983 NTSTATUS status;
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;
2001 if (DEBUGLEVEL >= 10) {
2002 NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, &r);
2005 status = cli->dispatch(cli,
2006 mem_ctx,
2007 &ndr_table_eventlog,
2008 NDR_EVENTLOG_REPORTEVENTW,
2009 &r);
2011 if (!NT_STATUS_IS_OK(status)) {
2012 return status;
2015 if (DEBUGLEVEL >= 10) {
2016 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &r);
2019 if (NT_STATUS_IS_ERR(status)) {
2020 return status;
2023 /* Return variables */
2024 if (record_number && r.out.record_number) {
2025 *record_number = *r.out.record_number;
2027 if (time_written && r.out.time_written) {
2028 *time_written = *r.out.time_written;
2031 /* Return result */
2032 return r.out.result;
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);
2042 static void rpccli_eventlog_ClearEventLogA_done(struct tevent_req *subreq);
2044 struct tevent_req *rpccli_eventlog_ClearEventLogA_send(TALLOC_CTX *mem_ctx,
2045 struct tevent_context *ev,
2046 struct rpc_pipe_client *cli)
2048 struct tevent_req *req;
2049 struct rpccli_eventlog_ClearEventLogA_state *state;
2050 struct tevent_req *subreq;
2052 req = tevent_req_create(mem_ctx, &state,
2053 struct rpccli_eventlog_ClearEventLogA_state);
2054 if (req == NULL) {
2055 return NULL;
2057 state->out_mem_ctx = NULL;
2058 state->dispatch_recv = cli->dispatch_recv;
2060 /* In parameters */
2062 /* Out parameters */
2064 /* Result */
2065 ZERO_STRUCT(state->orig.out.result);
2067 if (DEBUGLEVEL >= 10) {
2068 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, &state->orig);
2071 /* make a temporary copy, that we pass to the dispatch function */
2072 state->tmp = state->orig;
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);
2081 tevent_req_set_callback(subreq, rpccli_eventlog_ClearEventLogA_done, req);
2082 return req;
2085 static void rpccli_eventlog_ClearEventLogA_done(struct tevent_req *subreq)
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;
2094 if (state->out_mem_ctx) {
2095 mem_ctx = state->out_mem_ctx;
2096 } else {
2097 mem_ctx = state;
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;
2107 /* Copy out parameters */
2109 /* Copy result */
2110 state->orig.out.result = state->tmp.out.result;
2112 /* Reset temporary structure */
2113 ZERO_STRUCT(state->tmp);
2115 if (DEBUGLEVEL >= 10) {
2116 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &state->orig);
2119 tevent_req_done(req);
2122 NTSTATUS rpccli_eventlog_ClearEventLogA_recv(struct tevent_req *req,
2123 TALLOC_CTX *mem_ctx,
2124 NTSTATUS *result)
2126 struct rpccli_eventlog_ClearEventLogA_state *state = tevent_req_data(
2127 req, struct rpccli_eventlog_ClearEventLogA_state);
2128 NTSTATUS status;
2130 if (tevent_req_is_nterror(req, &status)) {
2131 tevent_req_received(req);
2132 return status;
2135 /* Steal possbile out parameters to the callers context */
2136 talloc_steal(mem_ctx, state->out_mem_ctx);
2138 /* Return result */
2139 *result = state->orig.out.result;
2141 tevent_req_received(req);
2142 return NT_STATUS_OK;
2145 NTSTATUS rpccli_eventlog_ClearEventLogA(struct rpc_pipe_client *cli,
2146 TALLOC_CTX *mem_ctx)
2148 struct eventlog_ClearEventLogA r;
2149 NTSTATUS status;
2151 /* In parameters */
2153 if (DEBUGLEVEL >= 10) {
2154 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, &r);
2157 status = cli->dispatch(cli,
2158 mem_ctx,
2159 &ndr_table_eventlog,
2160 NDR_EVENTLOG_CLEAREVENTLOGA,
2161 &r);
2163 if (!NT_STATUS_IS_OK(status)) {
2164 return status;
2167 if (DEBUGLEVEL >= 10) {
2168 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &r);
2171 if (NT_STATUS_IS_ERR(status)) {
2172 return status;
2175 /* Return variables */
2177 /* Return result */
2178 return r.out.result;
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);
2188 static void rpccli_eventlog_BackupEventLogA_done(struct tevent_req *subreq);
2190 struct tevent_req *rpccli_eventlog_BackupEventLogA_send(TALLOC_CTX *mem_ctx,
2191 struct tevent_context *ev,
2192 struct rpc_pipe_client *cli)
2194 struct tevent_req *req;
2195 struct rpccli_eventlog_BackupEventLogA_state *state;
2196 struct tevent_req *subreq;
2198 req = tevent_req_create(mem_ctx, &state,
2199 struct rpccli_eventlog_BackupEventLogA_state);
2200 if (req == NULL) {
2201 return NULL;
2203 state->out_mem_ctx = NULL;
2204 state->dispatch_recv = cli->dispatch_recv;
2206 /* In parameters */
2208 /* Out parameters */
2210 /* Result */
2211 ZERO_STRUCT(state->orig.out.result);
2213 if (DEBUGLEVEL >= 10) {
2214 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, &state->orig);
2217 /* make a temporary copy, that we pass to the dispatch function */
2218 state->tmp = state->orig;
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);
2227 tevent_req_set_callback(subreq, rpccli_eventlog_BackupEventLogA_done, req);
2228 return req;
2231 static void rpccli_eventlog_BackupEventLogA_done(struct tevent_req *subreq)
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;
2240 if (state->out_mem_ctx) {
2241 mem_ctx = state->out_mem_ctx;
2242 } else {
2243 mem_ctx = state;
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;
2253 /* Copy out parameters */
2255 /* Copy result */
2256 state->orig.out.result = state->tmp.out.result;
2258 /* Reset temporary structure */
2259 ZERO_STRUCT(state->tmp);
2261 if (DEBUGLEVEL >= 10) {
2262 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &state->orig);
2265 tevent_req_done(req);
2268 NTSTATUS rpccli_eventlog_BackupEventLogA_recv(struct tevent_req *req,
2269 TALLOC_CTX *mem_ctx,
2270 NTSTATUS *result)
2272 struct rpccli_eventlog_BackupEventLogA_state *state = tevent_req_data(
2273 req, struct rpccli_eventlog_BackupEventLogA_state);
2274 NTSTATUS status;
2276 if (tevent_req_is_nterror(req, &status)) {
2277 tevent_req_received(req);
2278 return status;
2281 /* Steal possbile out parameters to the callers context */
2282 talloc_steal(mem_ctx, state->out_mem_ctx);
2284 /* Return result */
2285 *result = state->orig.out.result;
2287 tevent_req_received(req);
2288 return NT_STATUS_OK;
2291 NTSTATUS rpccli_eventlog_BackupEventLogA(struct rpc_pipe_client *cli,
2292 TALLOC_CTX *mem_ctx)
2294 struct eventlog_BackupEventLogA r;
2295 NTSTATUS status;
2297 /* In parameters */
2299 if (DEBUGLEVEL >= 10) {
2300 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, &r);
2303 status = cli->dispatch(cli,
2304 mem_ctx,
2305 &ndr_table_eventlog,
2306 NDR_EVENTLOG_BACKUPEVENTLOGA,
2307 &r);
2309 if (!NT_STATUS_IS_OK(status)) {
2310 return status;
2313 if (DEBUGLEVEL >= 10) {
2314 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &r);
2317 if (NT_STATUS_IS_ERR(status)) {
2318 return status;
2321 /* Return variables */
2323 /* Return result */
2324 return r.out.result;
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);
2334 static void rpccli_eventlog_OpenEventLogA_done(struct tevent_req *subreq);
2336 struct tevent_req *rpccli_eventlog_OpenEventLogA_send(TALLOC_CTX *mem_ctx,
2337 struct tevent_context *ev,
2338 struct rpc_pipe_client *cli)
2340 struct tevent_req *req;
2341 struct rpccli_eventlog_OpenEventLogA_state *state;
2342 struct tevent_req *subreq;
2344 req = tevent_req_create(mem_ctx, &state,
2345 struct rpccli_eventlog_OpenEventLogA_state);
2346 if (req == NULL) {
2347 return NULL;
2349 state->out_mem_ctx = NULL;
2350 state->dispatch_recv = cli->dispatch_recv;
2352 /* In parameters */
2354 /* Out parameters */
2356 /* Result */
2357 ZERO_STRUCT(state->orig.out.result);
2359 if (DEBUGLEVEL >= 10) {
2360 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, &state->orig);
2363 /* make a temporary copy, that we pass to the dispatch function */
2364 state->tmp = state->orig;
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);
2373 tevent_req_set_callback(subreq, rpccli_eventlog_OpenEventLogA_done, req);
2374 return req;
2377 static void rpccli_eventlog_OpenEventLogA_done(struct tevent_req *subreq)
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;
2386 if (state->out_mem_ctx) {
2387 mem_ctx = state->out_mem_ctx;
2388 } else {
2389 mem_ctx = state;
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;
2399 /* Copy out parameters */
2401 /* Copy result */
2402 state->orig.out.result = state->tmp.out.result;
2404 /* Reset temporary structure */
2405 ZERO_STRUCT(state->tmp);
2407 if (DEBUGLEVEL >= 10) {
2408 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &state->orig);
2411 tevent_req_done(req);
2414 NTSTATUS rpccli_eventlog_OpenEventLogA_recv(struct tevent_req *req,
2415 TALLOC_CTX *mem_ctx,
2416 NTSTATUS *result)
2418 struct rpccli_eventlog_OpenEventLogA_state *state = tevent_req_data(
2419 req, struct rpccli_eventlog_OpenEventLogA_state);
2420 NTSTATUS status;
2422 if (tevent_req_is_nterror(req, &status)) {
2423 tevent_req_received(req);
2424 return status;
2427 /* Steal possbile out parameters to the callers context */
2428 talloc_steal(mem_ctx, state->out_mem_ctx);
2430 /* Return result */
2431 *result = state->orig.out.result;
2433 tevent_req_received(req);
2434 return NT_STATUS_OK;
2437 NTSTATUS rpccli_eventlog_OpenEventLogA(struct rpc_pipe_client *cli,
2438 TALLOC_CTX *mem_ctx)
2440 struct eventlog_OpenEventLogA r;
2441 NTSTATUS status;
2443 /* In parameters */
2445 if (DEBUGLEVEL >= 10) {
2446 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, &r);
2449 status = cli->dispatch(cli,
2450 mem_ctx,
2451 &ndr_table_eventlog,
2452 NDR_EVENTLOG_OPENEVENTLOGA,
2453 &r);
2455 if (!NT_STATUS_IS_OK(status)) {
2456 return status;
2459 if (DEBUGLEVEL >= 10) {
2460 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &r);
2463 if (NT_STATUS_IS_ERR(status)) {
2464 return status;
2467 /* Return variables */
2469 /* Return result */
2470 return r.out.result;
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);
2480 static void rpccli_eventlog_RegisterEventSourceA_done(struct tevent_req *subreq);
2482 struct tevent_req *rpccli_eventlog_RegisterEventSourceA_send(TALLOC_CTX *mem_ctx,
2483 struct tevent_context *ev,
2484 struct rpc_pipe_client *cli)
2486 struct tevent_req *req;
2487 struct rpccli_eventlog_RegisterEventSourceA_state *state;
2488 struct tevent_req *subreq;
2490 req = tevent_req_create(mem_ctx, &state,
2491 struct rpccli_eventlog_RegisterEventSourceA_state);
2492 if (req == NULL) {
2493 return NULL;
2495 state->out_mem_ctx = NULL;
2496 state->dispatch_recv = cli->dispatch_recv;
2498 /* In parameters */
2500 /* Out parameters */
2502 /* Result */
2503 ZERO_STRUCT(state->orig.out.result);
2505 if (DEBUGLEVEL >= 10) {
2506 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, &state->orig);
2509 /* make a temporary copy, that we pass to the dispatch function */
2510 state->tmp = state->orig;
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);
2519 tevent_req_set_callback(subreq, rpccli_eventlog_RegisterEventSourceA_done, req);
2520 return req;
2523 static void rpccli_eventlog_RegisterEventSourceA_done(struct tevent_req *subreq)
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;
2532 if (state->out_mem_ctx) {
2533 mem_ctx = state->out_mem_ctx;
2534 } else {
2535 mem_ctx = state;
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;
2545 /* Copy out parameters */
2547 /* Copy result */
2548 state->orig.out.result = state->tmp.out.result;
2550 /* Reset temporary structure */
2551 ZERO_STRUCT(state->tmp);
2553 if (DEBUGLEVEL >= 10) {
2554 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &state->orig);
2557 tevent_req_done(req);
2560 NTSTATUS rpccli_eventlog_RegisterEventSourceA_recv(struct tevent_req *req,
2561 TALLOC_CTX *mem_ctx,
2562 NTSTATUS *result)
2564 struct rpccli_eventlog_RegisterEventSourceA_state *state = tevent_req_data(
2565 req, struct rpccli_eventlog_RegisterEventSourceA_state);
2566 NTSTATUS status;
2568 if (tevent_req_is_nterror(req, &status)) {
2569 tevent_req_received(req);
2570 return status;
2573 /* Steal possbile out parameters to the callers context */
2574 talloc_steal(mem_ctx, state->out_mem_ctx);
2576 /* Return result */
2577 *result = state->orig.out.result;
2579 tevent_req_received(req);
2580 return NT_STATUS_OK;
2583 NTSTATUS rpccli_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli,
2584 TALLOC_CTX *mem_ctx)
2586 struct eventlog_RegisterEventSourceA r;
2587 NTSTATUS status;
2589 /* In parameters */
2591 if (DEBUGLEVEL >= 10) {
2592 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, &r);
2595 status = cli->dispatch(cli,
2596 mem_ctx,
2597 &ndr_table_eventlog,
2598 NDR_EVENTLOG_REGISTEREVENTSOURCEA,
2599 &r);
2601 if (!NT_STATUS_IS_OK(status)) {
2602 return status;
2605 if (DEBUGLEVEL >= 10) {
2606 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &r);
2609 if (NT_STATUS_IS_ERR(status)) {
2610 return status;
2613 /* Return variables */
2615 /* Return result */
2616 return r.out.result;
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);
2626 static void rpccli_eventlog_OpenBackupEventLogA_done(struct tevent_req *subreq);
2628 struct tevent_req *rpccli_eventlog_OpenBackupEventLogA_send(TALLOC_CTX *mem_ctx,
2629 struct tevent_context *ev,
2630 struct rpc_pipe_client *cli)
2632 struct tevent_req *req;
2633 struct rpccli_eventlog_OpenBackupEventLogA_state *state;
2634 struct tevent_req *subreq;
2636 req = tevent_req_create(mem_ctx, &state,
2637 struct rpccli_eventlog_OpenBackupEventLogA_state);
2638 if (req == NULL) {
2639 return NULL;
2641 state->out_mem_ctx = NULL;
2642 state->dispatch_recv = cli->dispatch_recv;
2644 /* In parameters */
2646 /* Out parameters */
2648 /* Result */
2649 ZERO_STRUCT(state->orig.out.result);
2651 if (DEBUGLEVEL >= 10) {
2652 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, &state->orig);
2655 /* make a temporary copy, that we pass to the dispatch function */
2656 state->tmp = state->orig;
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);
2665 tevent_req_set_callback(subreq, rpccli_eventlog_OpenBackupEventLogA_done, req);
2666 return req;
2669 static void rpccli_eventlog_OpenBackupEventLogA_done(struct tevent_req *subreq)
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;
2678 if (state->out_mem_ctx) {
2679 mem_ctx = state->out_mem_ctx;
2680 } else {
2681 mem_ctx = state;
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;
2691 /* Copy out parameters */
2693 /* Copy result */
2694 state->orig.out.result = state->tmp.out.result;
2696 /* Reset temporary structure */
2697 ZERO_STRUCT(state->tmp);
2699 if (DEBUGLEVEL >= 10) {
2700 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &state->orig);
2703 tevent_req_done(req);
2706 NTSTATUS rpccli_eventlog_OpenBackupEventLogA_recv(struct tevent_req *req,
2707 TALLOC_CTX *mem_ctx,
2708 NTSTATUS *result)
2710 struct rpccli_eventlog_OpenBackupEventLogA_state *state = tevent_req_data(
2711 req, struct rpccli_eventlog_OpenBackupEventLogA_state);
2712 NTSTATUS status;
2714 if (tevent_req_is_nterror(req, &status)) {
2715 tevent_req_received(req);
2716 return status;
2719 /* Steal possbile out parameters to the callers context */
2720 talloc_steal(mem_ctx, state->out_mem_ctx);
2722 /* Return result */
2723 *result = state->orig.out.result;
2725 tevent_req_received(req);
2726 return NT_STATUS_OK;
2729 NTSTATUS rpccli_eventlog_OpenBackupEventLogA(struct rpc_pipe_client *cli,
2730 TALLOC_CTX *mem_ctx)
2732 struct eventlog_OpenBackupEventLogA r;
2733 NTSTATUS status;
2735 /* In parameters */
2737 if (DEBUGLEVEL >= 10) {
2738 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, &r);
2741 status = cli->dispatch(cli,
2742 mem_ctx,
2743 &ndr_table_eventlog,
2744 NDR_EVENTLOG_OPENBACKUPEVENTLOGA,
2745 &r);
2747 if (!NT_STATUS_IS_OK(status)) {
2748 return status;
2751 if (DEBUGLEVEL >= 10) {
2752 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &r);
2755 if (NT_STATUS_IS_ERR(status)) {
2756 return status;
2759 /* Return variables */
2761 /* Return result */
2762 return r.out.result;
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);
2772 static void rpccli_eventlog_ReadEventLogA_done(struct tevent_req *subreq);
2774 struct tevent_req *rpccli_eventlog_ReadEventLogA_send(TALLOC_CTX *mem_ctx,
2775 struct tevent_context *ev,
2776 struct rpc_pipe_client *cli)
2778 struct tevent_req *req;
2779 struct rpccli_eventlog_ReadEventLogA_state *state;
2780 struct tevent_req *subreq;
2782 req = tevent_req_create(mem_ctx, &state,
2783 struct rpccli_eventlog_ReadEventLogA_state);
2784 if (req == NULL) {
2785 return NULL;
2787 state->out_mem_ctx = NULL;
2788 state->dispatch_recv = cli->dispatch_recv;
2790 /* In parameters */
2792 /* Out parameters */
2794 /* Result */
2795 ZERO_STRUCT(state->orig.out.result);
2797 if (DEBUGLEVEL >= 10) {
2798 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, &state->orig);
2801 /* make a temporary copy, that we pass to the dispatch function */
2802 state->tmp = state->orig;
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);
2811 tevent_req_set_callback(subreq, rpccli_eventlog_ReadEventLogA_done, req);
2812 return req;
2815 static void rpccli_eventlog_ReadEventLogA_done(struct tevent_req *subreq)
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;
2824 if (state->out_mem_ctx) {
2825 mem_ctx = state->out_mem_ctx;
2826 } else {
2827 mem_ctx = state;
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;
2837 /* Copy out parameters */
2839 /* Copy result */
2840 state->orig.out.result = state->tmp.out.result;
2842 /* Reset temporary structure */
2843 ZERO_STRUCT(state->tmp);
2845 if (DEBUGLEVEL >= 10) {
2846 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &state->orig);
2849 tevent_req_done(req);
2852 NTSTATUS rpccli_eventlog_ReadEventLogA_recv(struct tevent_req *req,
2853 TALLOC_CTX *mem_ctx,
2854 NTSTATUS *result)
2856 struct rpccli_eventlog_ReadEventLogA_state *state = tevent_req_data(
2857 req, struct rpccli_eventlog_ReadEventLogA_state);
2858 NTSTATUS status;
2860 if (tevent_req_is_nterror(req, &status)) {
2861 tevent_req_received(req);
2862 return status;
2865 /* Steal possbile out parameters to the callers context */
2866 talloc_steal(mem_ctx, state->out_mem_ctx);
2868 /* Return result */
2869 *result = state->orig.out.result;
2871 tevent_req_received(req);
2872 return NT_STATUS_OK;
2875 NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli,
2876 TALLOC_CTX *mem_ctx)
2878 struct eventlog_ReadEventLogA r;
2879 NTSTATUS status;
2881 /* In parameters */
2883 if (DEBUGLEVEL >= 10) {
2884 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, &r);
2887 status = cli->dispatch(cli,
2888 mem_ctx,
2889 &ndr_table_eventlog,
2890 NDR_EVENTLOG_READEVENTLOGA,
2891 &r);
2893 if (!NT_STATUS_IS_OK(status)) {
2894 return status;
2897 if (DEBUGLEVEL >= 10) {
2898 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &r);
2901 if (NT_STATUS_IS_ERR(status)) {
2902 return status;
2905 /* Return variables */
2907 /* Return result */
2908 return r.out.result;
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);
2918 static void rpccli_eventlog_ReportEventA_done(struct tevent_req *subreq);
2920 struct tevent_req *rpccli_eventlog_ReportEventA_send(TALLOC_CTX *mem_ctx,
2921 struct tevent_context *ev,
2922 struct rpc_pipe_client *cli)
2924 struct tevent_req *req;
2925 struct rpccli_eventlog_ReportEventA_state *state;
2926 struct tevent_req *subreq;
2928 req = tevent_req_create(mem_ctx, &state,
2929 struct rpccli_eventlog_ReportEventA_state);
2930 if (req == NULL) {
2931 return NULL;
2933 state->out_mem_ctx = NULL;
2934 state->dispatch_recv = cli->dispatch_recv;
2936 /* In parameters */
2938 /* Out parameters */
2940 /* Result */
2941 ZERO_STRUCT(state->orig.out.result);
2943 if (DEBUGLEVEL >= 10) {
2944 NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, &state->orig);
2947 /* make a temporary copy, that we pass to the dispatch function */
2948 state->tmp = state->orig;
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);
2957 tevent_req_set_callback(subreq, rpccli_eventlog_ReportEventA_done, req);
2958 return req;
2961 static void rpccli_eventlog_ReportEventA_done(struct tevent_req *subreq)
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;
2970 if (state->out_mem_ctx) {
2971 mem_ctx = state->out_mem_ctx;
2972 } else {
2973 mem_ctx = state;
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;
2983 /* Copy out parameters */
2985 /* Copy result */
2986 state->orig.out.result = state->tmp.out.result;
2988 /* Reset temporary structure */
2989 ZERO_STRUCT(state->tmp);
2991 if (DEBUGLEVEL >= 10) {
2992 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &state->orig);
2995 tevent_req_done(req);
2998 NTSTATUS rpccli_eventlog_ReportEventA_recv(struct tevent_req *req,
2999 TALLOC_CTX *mem_ctx,
3000 NTSTATUS *result)
3002 struct rpccli_eventlog_ReportEventA_state *state = tevent_req_data(
3003 req, struct rpccli_eventlog_ReportEventA_state);
3004 NTSTATUS status;
3006 if (tevent_req_is_nterror(req, &status)) {
3007 tevent_req_received(req);
3008 return status;
3011 /* Steal possbile out parameters to the callers context */
3012 talloc_steal(mem_ctx, state->out_mem_ctx);
3014 /* Return result */
3015 *result = state->orig.out.result;
3017 tevent_req_received(req);
3018 return NT_STATUS_OK;
3021 NTSTATUS rpccli_eventlog_ReportEventA(struct rpc_pipe_client *cli,
3022 TALLOC_CTX *mem_ctx)
3024 struct eventlog_ReportEventA r;
3025 NTSTATUS status;
3027 /* In parameters */
3029 if (DEBUGLEVEL >= 10) {
3030 NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, &r);
3033 status = cli->dispatch(cli,
3034 mem_ctx,
3035 &ndr_table_eventlog,
3036 NDR_EVENTLOG_REPORTEVENTA,
3037 &r);
3039 if (!NT_STATUS_IS_OK(status)) {
3040 return status;
3043 if (DEBUGLEVEL >= 10) {
3044 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &r);
3047 if (NT_STATUS_IS_ERR(status)) {
3048 return status;
3051 /* Return variables */
3053 /* Return result */
3054 return r.out.result;
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);
3064 static void rpccli_eventlog_RegisterClusterSvc_done(struct tevent_req *subreq);
3066 struct tevent_req *rpccli_eventlog_RegisterClusterSvc_send(TALLOC_CTX *mem_ctx,
3067 struct tevent_context *ev,
3068 struct rpc_pipe_client *cli)
3070 struct tevent_req *req;
3071 struct rpccli_eventlog_RegisterClusterSvc_state *state;
3072 struct tevent_req *subreq;
3074 req = tevent_req_create(mem_ctx, &state,
3075 struct rpccli_eventlog_RegisterClusterSvc_state);
3076 if (req == NULL) {
3077 return NULL;
3079 state->out_mem_ctx = NULL;
3080 state->dispatch_recv = cli->dispatch_recv;
3082 /* In parameters */
3084 /* Out parameters */
3086 /* Result */
3087 ZERO_STRUCT(state->orig.out.result);
3089 if (DEBUGLEVEL >= 10) {
3090 NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, &state->orig);
3093 /* make a temporary copy, that we pass to the dispatch function */
3094 state->tmp = state->orig;
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);
3103 tevent_req_set_callback(subreq, rpccli_eventlog_RegisterClusterSvc_done, req);
3104 return req;
3107 static void rpccli_eventlog_RegisterClusterSvc_done(struct tevent_req *subreq)
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;
3116 if (state->out_mem_ctx) {
3117 mem_ctx = state->out_mem_ctx;
3118 } else {
3119 mem_ctx = state;
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;
3129 /* Copy out parameters */
3131 /* Copy result */
3132 state->orig.out.result = state->tmp.out.result;
3134 /* Reset temporary structure */
3135 ZERO_STRUCT(state->tmp);
3137 if (DEBUGLEVEL >= 10) {
3138 NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &state->orig);
3141 tevent_req_done(req);
3144 NTSTATUS rpccli_eventlog_RegisterClusterSvc_recv(struct tevent_req *req,
3145 TALLOC_CTX *mem_ctx,
3146 NTSTATUS *result)
3148 struct rpccli_eventlog_RegisterClusterSvc_state *state = tevent_req_data(
3149 req, struct rpccli_eventlog_RegisterClusterSvc_state);
3150 NTSTATUS status;
3152 if (tevent_req_is_nterror(req, &status)) {
3153 tevent_req_received(req);
3154 return status;
3157 /* Steal possbile out parameters to the callers context */
3158 talloc_steal(mem_ctx, state->out_mem_ctx);
3160 /* Return result */
3161 *result = state->orig.out.result;
3163 tevent_req_received(req);
3164 return NT_STATUS_OK;
3167 NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli,
3168 TALLOC_CTX *mem_ctx)
3170 struct eventlog_RegisterClusterSvc r;
3171 NTSTATUS status;
3173 /* In parameters */
3175 if (DEBUGLEVEL >= 10) {
3176 NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, &r);
3179 status = cli->dispatch(cli,
3180 mem_ctx,
3181 &ndr_table_eventlog,
3182 NDR_EVENTLOG_REGISTERCLUSTERSVC,
3183 &r);
3185 if (!NT_STATUS_IS_OK(status)) {
3186 return status;
3189 if (DEBUGLEVEL >= 10) {
3190 NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &r);
3193 if (NT_STATUS_IS_ERR(status)) {
3194 return status;
3197 /* Return variables */
3199 /* Return result */
3200 return r.out.result;
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);
3210 static void rpccli_eventlog_DeregisterClusterSvc_done(struct tevent_req *subreq);
3212 struct tevent_req *rpccli_eventlog_DeregisterClusterSvc_send(TALLOC_CTX *mem_ctx,
3213 struct tevent_context *ev,
3214 struct rpc_pipe_client *cli)
3216 struct tevent_req *req;
3217 struct rpccli_eventlog_DeregisterClusterSvc_state *state;
3218 struct tevent_req *subreq;
3220 req = tevent_req_create(mem_ctx, &state,
3221 struct rpccli_eventlog_DeregisterClusterSvc_state);
3222 if (req == NULL) {
3223 return NULL;
3225 state->out_mem_ctx = NULL;
3226 state->dispatch_recv = cli->dispatch_recv;
3228 /* In parameters */
3230 /* Out parameters */
3232 /* Result */
3233 ZERO_STRUCT(state->orig.out.result);
3235 if (DEBUGLEVEL >= 10) {
3236 NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, &state->orig);
3239 /* make a temporary copy, that we pass to the dispatch function */
3240 state->tmp = state->orig;
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);
3249 tevent_req_set_callback(subreq, rpccli_eventlog_DeregisterClusterSvc_done, req);
3250 return req;
3253 static void rpccli_eventlog_DeregisterClusterSvc_done(struct tevent_req *subreq)
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;
3262 if (state->out_mem_ctx) {
3263 mem_ctx = state->out_mem_ctx;
3264 } else {
3265 mem_ctx = state;
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;
3275 /* Copy out parameters */
3277 /* Copy result */
3278 state->orig.out.result = state->tmp.out.result;
3280 /* Reset temporary structure */
3281 ZERO_STRUCT(state->tmp);
3283 if (DEBUGLEVEL >= 10) {
3284 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &state->orig);
3287 tevent_req_done(req);
3290 NTSTATUS rpccli_eventlog_DeregisterClusterSvc_recv(struct tevent_req *req,
3291 TALLOC_CTX *mem_ctx,
3292 NTSTATUS *result)
3294 struct rpccli_eventlog_DeregisterClusterSvc_state *state = tevent_req_data(
3295 req, struct rpccli_eventlog_DeregisterClusterSvc_state);
3296 NTSTATUS status;
3298 if (tevent_req_is_nterror(req, &status)) {
3299 tevent_req_received(req);
3300 return status;
3303 /* Steal possbile out parameters to the callers context */
3304 talloc_steal(mem_ctx, state->out_mem_ctx);
3306 /* Return result */
3307 *result = state->orig.out.result;
3309 tevent_req_received(req);
3310 return NT_STATUS_OK;
3313 NTSTATUS rpccli_eventlog_DeregisterClusterSvc(struct rpc_pipe_client *cli,
3314 TALLOC_CTX *mem_ctx)
3316 struct eventlog_DeregisterClusterSvc r;
3317 NTSTATUS status;
3319 /* In parameters */
3321 if (DEBUGLEVEL >= 10) {
3322 NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, &r);
3325 status = cli->dispatch(cli,
3326 mem_ctx,
3327 &ndr_table_eventlog,
3328 NDR_EVENTLOG_DEREGISTERCLUSTERSVC,
3329 &r);
3331 if (!NT_STATUS_IS_OK(status)) {
3332 return status;
3335 if (DEBUGLEVEL >= 10) {
3336 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &r);
3339 if (NT_STATUS_IS_ERR(status)) {
3340 return status;
3343 /* Return variables */
3345 /* Return result */
3346 return r.out.result;
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);
3356 static void rpccli_eventlog_WriteClusterEvents_done(struct tevent_req *subreq);
3358 struct tevent_req *rpccli_eventlog_WriteClusterEvents_send(TALLOC_CTX *mem_ctx,
3359 struct tevent_context *ev,
3360 struct rpc_pipe_client *cli)
3362 struct tevent_req *req;
3363 struct rpccli_eventlog_WriteClusterEvents_state *state;
3364 struct tevent_req *subreq;
3366 req = tevent_req_create(mem_ctx, &state,
3367 struct rpccli_eventlog_WriteClusterEvents_state);
3368 if (req == NULL) {
3369 return NULL;
3371 state->out_mem_ctx = NULL;
3372 state->dispatch_recv = cli->dispatch_recv;
3374 /* In parameters */
3376 /* Out parameters */
3378 /* Result */
3379 ZERO_STRUCT(state->orig.out.result);
3381 if (DEBUGLEVEL >= 10) {
3382 NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, &state->orig);
3385 /* make a temporary copy, that we pass to the dispatch function */
3386 state->tmp = state->orig;
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);
3395 tevent_req_set_callback(subreq, rpccli_eventlog_WriteClusterEvents_done, req);
3396 return req;
3399 static void rpccli_eventlog_WriteClusterEvents_done(struct tevent_req *subreq)
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;
3408 if (state->out_mem_ctx) {
3409 mem_ctx = state->out_mem_ctx;
3410 } else {
3411 mem_ctx = state;
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;
3421 /* Copy out parameters */
3423 /* Copy result */
3424 state->orig.out.result = state->tmp.out.result;
3426 /* Reset temporary structure */
3427 ZERO_STRUCT(state->tmp);
3429 if (DEBUGLEVEL >= 10) {
3430 NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &state->orig);
3433 tevent_req_done(req);
3436 NTSTATUS rpccli_eventlog_WriteClusterEvents_recv(struct tevent_req *req,
3437 TALLOC_CTX *mem_ctx,
3438 NTSTATUS *result)
3440 struct rpccli_eventlog_WriteClusterEvents_state *state = tevent_req_data(
3441 req, struct rpccli_eventlog_WriteClusterEvents_state);
3442 NTSTATUS status;
3444 if (tevent_req_is_nterror(req, &status)) {
3445 tevent_req_received(req);
3446 return status;
3449 /* Steal possbile out parameters to the callers context */
3450 talloc_steal(mem_ctx, state->out_mem_ctx);
3452 /* Return result */
3453 *result = state->orig.out.result;
3455 tevent_req_received(req);
3456 return NT_STATUS_OK;
3459 NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli,
3460 TALLOC_CTX *mem_ctx)
3462 struct eventlog_WriteClusterEvents r;
3463 NTSTATUS status;
3465 /* In parameters */
3467 if (DEBUGLEVEL >= 10) {
3468 NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, &r);
3471 status = cli->dispatch(cli,
3472 mem_ctx,
3473 &ndr_table_eventlog,
3474 NDR_EVENTLOG_WRITECLUSTEREVENTS,
3475 &r);
3477 if (!NT_STATUS_IS_OK(status)) {
3478 return status;
3481 if (DEBUGLEVEL >= 10) {
3482 NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &r);
3485 if (NT_STATUS_IS_ERR(status)) {
3486 return status;
3489 /* Return variables */
3491 /* Return result */
3492 return r.out.result;
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);
3502 static void rpccli_eventlog_GetLogInformation_done(struct tevent_req *subreq);
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] */)
3513 struct tevent_req *req;
3514 struct rpccli_eventlog_GetLogInformation_state *state;
3515 struct tevent_req *subreq;
3517 req = tevent_req_create(mem_ctx, &state,
3518 struct rpccli_eventlog_GetLogInformation_state);
3519 if (req == NULL) {
3520 return NULL;
3522 state->out_mem_ctx = NULL;
3523 state->dispatch_recv = cli->dispatch_recv;
3525 /* In parameters */
3526 state->orig.in.handle = _handle;
3527 state->orig.in.level = _level;
3528 state->orig.in.buf_size = _buf_size;
3530 /* Out parameters */
3531 state->orig.out.buffer = _buffer;
3532 state->orig.out.bytes_needed = _bytes_needed;
3534 /* Result */
3535 ZERO_STRUCT(state->orig.out.result);
3537 if (DEBUGLEVEL >= 10) {
3538 NDR_PRINT_IN_DEBUG(eventlog_GetLogInformation, &state->orig);
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);
3547 /* make a temporary copy, that we pass to the dispatch function */
3548 state->tmp = state->orig;
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);
3557 tevent_req_set_callback(subreq, rpccli_eventlog_GetLogInformation_done, req);
3558 return req;
3561 static void rpccli_eventlog_GetLogInformation_done(struct tevent_req *subreq)
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;
3570 if (state->out_mem_ctx) {
3571 mem_ctx = state->out_mem_ctx;
3572 } else {
3573 mem_ctx = state;
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;
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;
3587 /* Copy result */
3588 state->orig.out.result = state->tmp.out.result;
3590 /* Reset temporary structure */
3591 ZERO_STRUCT(state->tmp);
3593 if (DEBUGLEVEL >= 10) {
3594 NDR_PRINT_OUT_DEBUG(eventlog_GetLogInformation, &state->orig);
3597 tevent_req_done(req);
3600 NTSTATUS rpccli_eventlog_GetLogInformation_recv(struct tevent_req *req,
3601 TALLOC_CTX *mem_ctx,
3602 NTSTATUS *result)
3604 struct rpccli_eventlog_GetLogInformation_state *state = tevent_req_data(
3605 req, struct rpccli_eventlog_GetLogInformation_state);
3606 NTSTATUS status;
3608 if (tevent_req_is_nterror(req, &status)) {
3609 tevent_req_received(req);
3610 return status;
3613 /* Steal possbile out parameters to the callers context */
3614 talloc_steal(mem_ctx, state->out_mem_ctx);
3616 /* Return result */
3617 *result = state->orig.out.result;
3619 tevent_req_received(req);
3620 return NT_STATUS_OK;
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] */)
3631 struct eventlog_GetLogInformation r;
3632 NTSTATUS status;
3634 /* In parameters */
3635 r.in.handle = handle;
3636 r.in.level = level;
3637 r.in.buf_size = buf_size;
3639 if (DEBUGLEVEL >= 10) {
3640 NDR_PRINT_IN_DEBUG(eventlog_GetLogInformation, &r);
3643 status = cli->dispatch(cli,
3644 mem_ctx,
3645 &ndr_table_eventlog,
3646 NDR_EVENTLOG_GETLOGINFORMATION,
3647 &r);
3649 if (!NT_STATUS_IS_OK(status)) {
3650 return status;
3653 if (DEBUGLEVEL >= 10) {
3654 NDR_PRINT_OUT_DEBUG(eventlog_GetLogInformation, &r);
3657 if (NT_STATUS_IS_ERR(status)) {
3658 return status;
3661 /* Return variables */
3662 memcpy(buffer, r.out.buffer, r.in.buf_size * sizeof(*buffer));
3663 *bytes_needed = *r.out.bytes_needed;
3665 /* Return result */
3666 return r.out.result;
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);
3676 static void rpccli_eventlog_FlushEventLog_done(struct tevent_req *subreq);
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] */)
3683 struct tevent_req *req;
3684 struct rpccli_eventlog_FlushEventLog_state *state;
3685 struct tevent_req *subreq;
3687 req = tevent_req_create(mem_ctx, &state,
3688 struct rpccli_eventlog_FlushEventLog_state);
3689 if (req == NULL) {
3690 return NULL;
3692 state->out_mem_ctx = NULL;
3693 state->dispatch_recv = cli->dispatch_recv;
3695 /* In parameters */
3696 state->orig.in.handle = _handle;
3698 /* Out parameters */
3700 /* Result */
3701 ZERO_STRUCT(state->orig.out.result);
3703 if (DEBUGLEVEL >= 10) {
3704 NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, &state->orig);
3707 /* make a temporary copy, that we pass to the dispatch function */
3708 state->tmp = state->orig;
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);
3717 tevent_req_set_callback(subreq, rpccli_eventlog_FlushEventLog_done, req);
3718 return req;
3721 static void rpccli_eventlog_FlushEventLog_done(struct tevent_req *subreq)
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;
3730 if (state->out_mem_ctx) {
3731 mem_ctx = state->out_mem_ctx;
3732 } else {
3733 mem_ctx = state;
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;
3743 /* Copy out parameters */
3745 /* Copy result */
3746 state->orig.out.result = state->tmp.out.result;
3748 /* Reset temporary structure */
3749 ZERO_STRUCT(state->tmp);
3751 if (DEBUGLEVEL >= 10) {
3752 NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, &state->orig);
3755 tevent_req_done(req);
3758 NTSTATUS rpccli_eventlog_FlushEventLog_recv(struct tevent_req *req,
3759 TALLOC_CTX *mem_ctx,
3760 NTSTATUS *result)
3762 struct rpccli_eventlog_FlushEventLog_state *state = tevent_req_data(
3763 req, struct rpccli_eventlog_FlushEventLog_state);
3764 NTSTATUS status;
3766 if (tevent_req_is_nterror(req, &status)) {
3767 tevent_req_received(req);
3768 return status;
3771 /* Steal possbile out parameters to the callers context */
3772 talloc_steal(mem_ctx, state->out_mem_ctx);
3774 /* Return result */
3775 *result = state->orig.out.result;
3777 tevent_req_received(req);
3778 return NT_STATUS_OK;
3781 NTSTATUS rpccli_eventlog_FlushEventLog(struct rpc_pipe_client *cli,
3782 TALLOC_CTX *mem_ctx,
3783 struct policy_handle *handle /* [in] [ref] */)
3785 struct eventlog_FlushEventLog r;
3786 NTSTATUS status;
3788 /* In parameters */
3789 r.in.handle = handle;
3791 if (DEBUGLEVEL >= 10) {
3792 NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, &r);
3795 status = cli->dispatch(cli,
3796 mem_ctx,
3797 &ndr_table_eventlog,
3798 NDR_EVENTLOG_FLUSHEVENTLOG,
3799 &r);
3801 if (!NT_STATUS_IS_OK(status)) {
3802 return status;
3805 if (DEBUGLEVEL >= 10) {
3806 NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, &r);
3809 if (NT_STATUS_IS_ERR(status)) {
3810 return status;
3813 /* Return variables */
3815 /* Return result */
3816 return r.out.result;
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);
3826 static void rpccli_eventlog_ReportEventAndSourceW_done(struct tevent_req *subreq);
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] */)
3847 struct tevent_req *req;
3848 struct rpccli_eventlog_ReportEventAndSourceW_state *state;
3849 struct tevent_req *subreq;
3851 req = tevent_req_create(mem_ctx, &state,
3852 struct rpccli_eventlog_ReportEventAndSourceW_state);
3853 if (req == NULL) {
3854 return NULL;
3856 state->out_mem_ctx = NULL;
3857 state->dispatch_recv = cli->dispatch_recv;
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;
3876 /* Out parameters */
3877 state->orig.out.record_number = _record_number;
3878 state->orig.out.time_written = _time_written;
3880 /* Result */
3881 ZERO_STRUCT(state->orig.out.result);
3883 if (DEBUGLEVEL >= 10) {
3884 NDR_PRINT_IN_DEBUG(eventlog_ReportEventAndSourceW, &state->orig);
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);
3893 /* make a temporary copy, that we pass to the dispatch function */
3894 state->tmp = state->orig;
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);
3903 tevent_req_set_callback(subreq, rpccli_eventlog_ReportEventAndSourceW_done, req);
3904 return req;
3907 static void rpccli_eventlog_ReportEventAndSourceW_done(struct tevent_req *subreq)
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;
3916 if (state->out_mem_ctx) {
3917 mem_ctx = state->out_mem_ctx;
3918 } else {
3919 mem_ctx = state;
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;
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;
3933 if (state->orig.out.time_written && state->tmp.out.time_written) {
3934 *state->orig.out.time_written = *state->tmp.out.time_written;
3937 /* Copy result */
3938 state->orig.out.result = state->tmp.out.result;
3940 /* Reset temporary structure */
3941 ZERO_STRUCT(state->tmp);
3943 if (DEBUGLEVEL >= 10) {
3944 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventAndSourceW, &state->orig);
3947 tevent_req_done(req);
3950 NTSTATUS rpccli_eventlog_ReportEventAndSourceW_recv(struct tevent_req *req,
3951 TALLOC_CTX *mem_ctx,
3952 NTSTATUS *result)
3954 struct rpccli_eventlog_ReportEventAndSourceW_state *state = tevent_req_data(
3955 req, struct rpccli_eventlog_ReportEventAndSourceW_state);
3956 NTSTATUS status;
3958 if (tevent_req_is_nterror(req, &status)) {
3959 tevent_req_received(req);
3960 return status;
3963 /* Steal possbile out parameters to the callers context */
3964 talloc_steal(mem_ctx, state->out_mem_ctx);
3966 /* Return result */
3967 *result = state->orig.out.result;
3969 tevent_req_received(req);
3970 return NT_STATUS_OK;
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] */)
3991 struct eventlog_ReportEventAndSourceW r;
3992 NTSTATUS status;
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;
4011 if (DEBUGLEVEL >= 10) {
4012 NDR_PRINT_IN_DEBUG(eventlog_ReportEventAndSourceW, &r);
4015 status = cli->dispatch(cli,
4016 mem_ctx,
4017 &ndr_table_eventlog,
4018 NDR_EVENTLOG_REPORTEVENTANDSOURCEW,
4019 &r);
4021 if (!NT_STATUS_IS_OK(status)) {
4022 return status;
4025 if (DEBUGLEVEL >= 10) {
4026 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventAndSourceW, &r);
4029 if (NT_STATUS_IS_ERR(status)) {
4030 return status;
4033 /* Return variables */
4034 if (record_number && r.out.record_number) {
4035 *record_number = *r.out.record_number;
4037 if (time_written && r.out.time_written) {
4038 *time_written = *r.out.time_written;
4041 /* Return result */
4042 return r.out.result;