LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_eventlog_c.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 21 1258 1.7 %
Date: 2021-09-23 10:06:22 Functions: 7 112 6.2 %

          Line data    Source code
       1             : /* client functions auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include <tevent.h>
       5             : #include "lib/util/tevent_ntstatus.h"
       6             : #include "bin/default/librpc/gen_ndr/ndr_eventlog.h"
       7             : #include "bin/default/librpc/gen_ndr/ndr_eventlog_c.h"
       8             : 
       9             : /* eventlog - client functions generated by pidl */
      10             : 
      11             : struct dcerpc_eventlog_ClearEventLogW_r_state {
      12             :         TALLOC_CTX *out_mem_ctx;
      13             : };
      14             : 
      15             : static void dcerpc_eventlog_ClearEventLogW_r_done(struct tevent_req *subreq);
      16             : 
      17           0 : struct tevent_req *dcerpc_eventlog_ClearEventLogW_r_send(TALLOC_CTX *mem_ctx,
      18             :         struct tevent_context *ev,
      19             :         struct dcerpc_binding_handle *h,
      20             :         struct eventlog_ClearEventLogW *r)
      21             : {
      22             :         struct tevent_req *req;
      23             :         struct dcerpc_eventlog_ClearEventLogW_r_state *state;
      24             :         struct tevent_req *subreq;
      25             : 
      26           0 :         req = tevent_req_create(mem_ctx, &state,
      27             :                                 struct dcerpc_eventlog_ClearEventLogW_r_state);
      28           0 :         if (req == NULL) {
      29           0 :                 return NULL;
      30             :         }
      31             : 
      32           0 :         state->out_mem_ctx = NULL;
      33             : 
      34           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
      35             :                         NULL, &ndr_table_eventlog,
      36             :                         NDR_EVENTLOG_CLEAREVENTLOGW, state, r);
      37           0 :         if (tevent_req_nomem(subreq, req)) {
      38           0 :                 return tevent_req_post(req, ev);
      39             :         }
      40           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_ClearEventLogW_r_done, req);
      41             : 
      42           0 :         return req;
      43             : }
      44             : 
      45           0 : static void dcerpc_eventlog_ClearEventLogW_r_done(struct tevent_req *subreq)
      46             : {
      47           0 :         struct tevent_req *req =
      48           0 :                 tevent_req_callback_data(subreq,
      49             :                 struct tevent_req);
      50             :         NTSTATUS status;
      51             : 
      52           0 :         status = dcerpc_binding_handle_call_recv(subreq);
      53           0 :         TALLOC_FREE(subreq);
      54           0 :         if (tevent_req_nterror(req, status)) {
      55           0 :                 return;
      56             :         }
      57             : 
      58           0 :         tevent_req_done(req);
      59             : }
      60             : 
      61           0 : NTSTATUS dcerpc_eventlog_ClearEventLogW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
      62             : {
      63           0 :         struct dcerpc_eventlog_ClearEventLogW_r_state *state =
      64           0 :                 tevent_req_data(req,
      65             :                 struct dcerpc_eventlog_ClearEventLogW_r_state);
      66             :         NTSTATUS status;
      67             : 
      68           0 :         if (tevent_req_is_nterror(req, &status)) {
      69           0 :                 tevent_req_received(req);
      70           0 :                 return status;
      71             :         }
      72             : 
      73           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
      74             : 
      75           0 :         tevent_req_received(req);
      76           0 :         return NT_STATUS_OK;
      77             : }
      78             : 
      79           0 : NTSTATUS dcerpc_eventlog_ClearEventLogW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_ClearEventLogW *r)
      80             : {
      81             :         NTSTATUS status;
      82             : 
      83           0 :         status = dcerpc_binding_handle_call(h,
      84             :                         NULL, &ndr_table_eventlog,
      85             :                         NDR_EVENTLOG_CLEAREVENTLOGW, mem_ctx, r);
      86             : 
      87           0 :         return status;
      88             : }
      89             : 
      90             : struct dcerpc_eventlog_ClearEventLogW_state {
      91             :         struct eventlog_ClearEventLogW orig;
      92             :         struct eventlog_ClearEventLogW tmp;
      93             :         TALLOC_CTX *out_mem_ctx;
      94             : };
      95             : 
      96             : static void dcerpc_eventlog_ClearEventLogW_done(struct tevent_req *subreq);
      97             : 
      98           0 : struct tevent_req *dcerpc_eventlog_ClearEventLogW_send(TALLOC_CTX *mem_ctx,
      99             :                                                        struct tevent_context *ev,
     100             :                                                        struct dcerpc_binding_handle *h,
     101             :                                                        struct policy_handle *_handle /* [in] [ref] */,
     102             :                                                        struct lsa_String *_backupfile /* [in] [unique] */)
     103             : {
     104             :         struct tevent_req *req;
     105             :         struct dcerpc_eventlog_ClearEventLogW_state *state;
     106             :         struct tevent_req *subreq;
     107             : 
     108           0 :         req = tevent_req_create(mem_ctx, &state,
     109             :                                 struct dcerpc_eventlog_ClearEventLogW_state);
     110           0 :         if (req == NULL) {
     111           0 :                 return NULL;
     112             :         }
     113           0 :         state->out_mem_ctx = NULL;
     114             : 
     115             :         /* In parameters */
     116           0 :         state->orig.in.handle = _handle;
     117           0 :         state->orig.in.backupfile = _backupfile;
     118             : 
     119             :         /* Out parameters */
     120             : 
     121             :         /* Result */
     122           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     123             : 
     124             :         /* make a temporary copy, that we pass to the dispatch function */
     125           0 :         state->tmp = state->orig;
     126             : 
     127           0 :         subreq = dcerpc_eventlog_ClearEventLogW_r_send(state, ev, h, &state->tmp);
     128           0 :         if (tevent_req_nomem(subreq, req)) {
     129           0 :                 return tevent_req_post(req, ev);
     130             :         }
     131           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_ClearEventLogW_done, req);
     132           0 :         return req;
     133             : }
     134             : 
     135           0 : static void dcerpc_eventlog_ClearEventLogW_done(struct tevent_req *subreq)
     136             : {
     137           0 :         struct tevent_req *req = tevent_req_callback_data(
     138             :                 subreq, struct tevent_req);
     139           0 :         struct dcerpc_eventlog_ClearEventLogW_state *state = tevent_req_data(
     140             :                 req, struct dcerpc_eventlog_ClearEventLogW_state);
     141             :         NTSTATUS status;
     142             :         TALLOC_CTX *mem_ctx;
     143             : 
     144           0 :         if (state->out_mem_ctx) {
     145           0 :                 mem_ctx = state->out_mem_ctx;
     146             :         } else {
     147           0 :                 mem_ctx = state;
     148             :         }
     149             : 
     150           0 :         status = dcerpc_eventlog_ClearEventLogW_r_recv(subreq, mem_ctx);
     151           0 :         TALLOC_FREE(subreq);
     152           0 :         if (tevent_req_nterror(req, status)) {
     153           0 :                 return;
     154             :         }
     155             : 
     156             :         /* Copy out parameters */
     157             : 
     158             :         /* Copy result */
     159           0 :         state->orig.out.result = state->tmp.out.result;
     160             : 
     161             :         /* Reset temporary structure */
     162           0 :         NDR_ZERO_STRUCT(state->tmp);
     163             : 
     164           0 :         tevent_req_done(req);
     165             : }
     166             : 
     167           0 : NTSTATUS dcerpc_eventlog_ClearEventLogW_recv(struct tevent_req *req,
     168             :                                              TALLOC_CTX *mem_ctx,
     169             :                                              NTSTATUS *result)
     170             : {
     171           0 :         struct dcerpc_eventlog_ClearEventLogW_state *state = tevent_req_data(
     172             :                 req, struct dcerpc_eventlog_ClearEventLogW_state);
     173             :         NTSTATUS status;
     174             : 
     175           0 :         if (tevent_req_is_nterror(req, &status)) {
     176           0 :                 tevent_req_received(req);
     177           0 :                 return status;
     178             :         }
     179             : 
     180             :         /* Steal possible out parameters to the callers context */
     181           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     182             : 
     183             :         /* Return result */
     184           0 :         *result = state->orig.out.result;
     185             : 
     186           0 :         tevent_req_received(req);
     187           0 :         return NT_STATUS_OK;
     188             : }
     189             : 
     190           0 : NTSTATUS dcerpc_eventlog_ClearEventLogW(struct dcerpc_binding_handle *h,
     191             :                                         TALLOC_CTX *mem_ctx,
     192             :                                         struct policy_handle *_handle /* [in] [ref] */,
     193             :                                         struct lsa_String *_backupfile /* [in] [unique] */,
     194             :                                         NTSTATUS *result)
     195             : {
     196             :         struct eventlog_ClearEventLogW r;
     197             :         NTSTATUS status;
     198             : 
     199             :         /* In parameters */
     200           0 :         r.in.handle = _handle;
     201           0 :         r.in.backupfile = _backupfile;
     202             : 
     203             :         /* Out parameters */
     204             : 
     205             :         /* Result */
     206           0 :         NDR_ZERO_STRUCT(r.out.result);
     207             : 
     208           0 :         status = dcerpc_eventlog_ClearEventLogW_r(h, mem_ctx, &r);
     209           0 :         if (!NT_STATUS_IS_OK(status)) {
     210           0 :                 return status;
     211             :         }
     212             : 
     213             :         /* Return variables */
     214             : 
     215             :         /* Return result */
     216           0 :         *result = r.out.result;
     217             : 
     218           0 :         return NT_STATUS_OK;
     219             : }
     220             : 
     221             : struct dcerpc_eventlog_BackupEventLogW_r_state {
     222             :         TALLOC_CTX *out_mem_ctx;
     223             : };
     224             : 
     225             : static void dcerpc_eventlog_BackupEventLogW_r_done(struct tevent_req *subreq);
     226             : 
     227           0 : struct tevent_req *dcerpc_eventlog_BackupEventLogW_r_send(TALLOC_CTX *mem_ctx,
     228             :         struct tevent_context *ev,
     229             :         struct dcerpc_binding_handle *h,
     230             :         struct eventlog_BackupEventLogW *r)
     231             : {
     232             :         struct tevent_req *req;
     233             :         struct dcerpc_eventlog_BackupEventLogW_r_state *state;
     234             :         struct tevent_req *subreq;
     235             : 
     236           0 :         req = tevent_req_create(mem_ctx, &state,
     237             :                                 struct dcerpc_eventlog_BackupEventLogW_r_state);
     238           0 :         if (req == NULL) {
     239           0 :                 return NULL;
     240             :         }
     241             : 
     242           0 :         state->out_mem_ctx = NULL;
     243             : 
     244           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     245             :                         NULL, &ndr_table_eventlog,
     246             :                         NDR_EVENTLOG_BACKUPEVENTLOGW, state, r);
     247           0 :         if (tevent_req_nomem(subreq, req)) {
     248           0 :                 return tevent_req_post(req, ev);
     249             :         }
     250           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_BackupEventLogW_r_done, req);
     251             : 
     252           0 :         return req;
     253             : }
     254             : 
     255           0 : static void dcerpc_eventlog_BackupEventLogW_r_done(struct tevent_req *subreq)
     256             : {
     257           0 :         struct tevent_req *req =
     258           0 :                 tevent_req_callback_data(subreq,
     259             :                 struct tevent_req);
     260             :         NTSTATUS status;
     261             : 
     262           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     263           0 :         TALLOC_FREE(subreq);
     264           0 :         if (tevent_req_nterror(req, status)) {
     265           0 :                 return;
     266             :         }
     267             : 
     268           0 :         tevent_req_done(req);
     269             : }
     270             : 
     271           0 : NTSTATUS dcerpc_eventlog_BackupEventLogW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     272             : {
     273           0 :         struct dcerpc_eventlog_BackupEventLogW_r_state *state =
     274           0 :                 tevent_req_data(req,
     275             :                 struct dcerpc_eventlog_BackupEventLogW_r_state);
     276             :         NTSTATUS status;
     277             : 
     278           0 :         if (tevent_req_is_nterror(req, &status)) {
     279           0 :                 tevent_req_received(req);
     280           0 :                 return status;
     281             :         }
     282             : 
     283           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     284             : 
     285           0 :         tevent_req_received(req);
     286           0 :         return NT_STATUS_OK;
     287             : }
     288             : 
     289           0 : NTSTATUS dcerpc_eventlog_BackupEventLogW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_BackupEventLogW *r)
     290             : {
     291             :         NTSTATUS status;
     292             : 
     293           0 :         status = dcerpc_binding_handle_call(h,
     294             :                         NULL, &ndr_table_eventlog,
     295             :                         NDR_EVENTLOG_BACKUPEVENTLOGW, mem_ctx, r);
     296             : 
     297           0 :         return status;
     298             : }
     299             : 
     300             : struct dcerpc_eventlog_BackupEventLogW_state {
     301             :         struct eventlog_BackupEventLogW orig;
     302             :         struct eventlog_BackupEventLogW tmp;
     303             :         TALLOC_CTX *out_mem_ctx;
     304             : };
     305             : 
     306             : static void dcerpc_eventlog_BackupEventLogW_done(struct tevent_req *subreq);
     307             : 
     308           0 : struct tevent_req *dcerpc_eventlog_BackupEventLogW_send(TALLOC_CTX *mem_ctx,
     309             :                                                         struct tevent_context *ev,
     310             :                                                         struct dcerpc_binding_handle *h,
     311             :                                                         struct policy_handle *_handle /* [in] [ref] */,
     312             :                                                         struct lsa_String *_backup_filename /* [in] [ref] */)
     313             : {
     314             :         struct tevent_req *req;
     315             :         struct dcerpc_eventlog_BackupEventLogW_state *state;
     316             :         struct tevent_req *subreq;
     317             : 
     318           0 :         req = tevent_req_create(mem_ctx, &state,
     319             :                                 struct dcerpc_eventlog_BackupEventLogW_state);
     320           0 :         if (req == NULL) {
     321           0 :                 return NULL;
     322             :         }
     323           0 :         state->out_mem_ctx = NULL;
     324             : 
     325             :         /* In parameters */
     326           0 :         state->orig.in.handle = _handle;
     327           0 :         state->orig.in.backup_filename = _backup_filename;
     328             : 
     329             :         /* Out parameters */
     330             : 
     331             :         /* Result */
     332           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     333             : 
     334             :         /* make a temporary copy, that we pass to the dispatch function */
     335           0 :         state->tmp = state->orig;
     336             : 
     337           0 :         subreq = dcerpc_eventlog_BackupEventLogW_r_send(state, ev, h, &state->tmp);
     338           0 :         if (tevent_req_nomem(subreq, req)) {
     339           0 :                 return tevent_req_post(req, ev);
     340             :         }
     341           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_BackupEventLogW_done, req);
     342           0 :         return req;
     343             : }
     344             : 
     345           0 : static void dcerpc_eventlog_BackupEventLogW_done(struct tevent_req *subreq)
     346             : {
     347           0 :         struct tevent_req *req = tevent_req_callback_data(
     348             :                 subreq, struct tevent_req);
     349           0 :         struct dcerpc_eventlog_BackupEventLogW_state *state = tevent_req_data(
     350             :                 req, struct dcerpc_eventlog_BackupEventLogW_state);
     351             :         NTSTATUS status;
     352             :         TALLOC_CTX *mem_ctx;
     353             : 
     354           0 :         if (state->out_mem_ctx) {
     355           0 :                 mem_ctx = state->out_mem_ctx;
     356             :         } else {
     357           0 :                 mem_ctx = state;
     358             :         }
     359             : 
     360           0 :         status = dcerpc_eventlog_BackupEventLogW_r_recv(subreq, mem_ctx);
     361           0 :         TALLOC_FREE(subreq);
     362           0 :         if (tevent_req_nterror(req, status)) {
     363           0 :                 return;
     364             :         }
     365             : 
     366             :         /* Copy out parameters */
     367             : 
     368             :         /* Copy result */
     369           0 :         state->orig.out.result = state->tmp.out.result;
     370             : 
     371             :         /* Reset temporary structure */
     372           0 :         NDR_ZERO_STRUCT(state->tmp);
     373             : 
     374           0 :         tevent_req_done(req);
     375             : }
     376             : 
     377           0 : NTSTATUS dcerpc_eventlog_BackupEventLogW_recv(struct tevent_req *req,
     378             :                                               TALLOC_CTX *mem_ctx,
     379             :                                               NTSTATUS *result)
     380             : {
     381           0 :         struct dcerpc_eventlog_BackupEventLogW_state *state = tevent_req_data(
     382             :                 req, struct dcerpc_eventlog_BackupEventLogW_state);
     383             :         NTSTATUS status;
     384             : 
     385           0 :         if (tevent_req_is_nterror(req, &status)) {
     386           0 :                 tevent_req_received(req);
     387           0 :                 return status;
     388             :         }
     389             : 
     390             :         /* Steal possible out parameters to the callers context */
     391           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     392             : 
     393             :         /* Return result */
     394           0 :         *result = state->orig.out.result;
     395             : 
     396           0 :         tevent_req_received(req);
     397           0 :         return NT_STATUS_OK;
     398             : }
     399             : 
     400           0 : NTSTATUS dcerpc_eventlog_BackupEventLogW(struct dcerpc_binding_handle *h,
     401             :                                          TALLOC_CTX *mem_ctx,
     402             :                                          struct policy_handle *_handle /* [in] [ref] */,
     403             :                                          struct lsa_String *_backup_filename /* [in] [ref] */,
     404             :                                          NTSTATUS *result)
     405             : {
     406             :         struct eventlog_BackupEventLogW r;
     407             :         NTSTATUS status;
     408             : 
     409             :         /* In parameters */
     410           0 :         r.in.handle = _handle;
     411           0 :         r.in.backup_filename = _backup_filename;
     412             : 
     413             :         /* Out parameters */
     414             : 
     415             :         /* Result */
     416           0 :         NDR_ZERO_STRUCT(r.out.result);
     417             : 
     418           0 :         status = dcerpc_eventlog_BackupEventLogW_r(h, mem_ctx, &r);
     419           0 :         if (!NT_STATUS_IS_OK(status)) {
     420           0 :                 return status;
     421             :         }
     422             : 
     423             :         /* Return variables */
     424             : 
     425             :         /* Return result */
     426           0 :         *result = r.out.result;
     427             : 
     428           0 :         return NT_STATUS_OK;
     429             : }
     430             : 
     431             : struct dcerpc_eventlog_CloseEventLog_r_state {
     432             :         TALLOC_CTX *out_mem_ctx;
     433             : };
     434             : 
     435             : static void dcerpc_eventlog_CloseEventLog_r_done(struct tevent_req *subreq);
     436             : 
     437           0 : struct tevent_req *dcerpc_eventlog_CloseEventLog_r_send(TALLOC_CTX *mem_ctx,
     438             :         struct tevent_context *ev,
     439             :         struct dcerpc_binding_handle *h,
     440             :         struct eventlog_CloseEventLog *r)
     441             : {
     442             :         struct tevent_req *req;
     443             :         struct dcerpc_eventlog_CloseEventLog_r_state *state;
     444             :         struct tevent_req *subreq;
     445             : 
     446           0 :         req = tevent_req_create(mem_ctx, &state,
     447             :                                 struct dcerpc_eventlog_CloseEventLog_r_state);
     448           0 :         if (req == NULL) {
     449           0 :                 return NULL;
     450             :         }
     451             : 
     452           0 :         state->out_mem_ctx = talloc_new(state);
     453           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     454           0 :                 return tevent_req_post(req, ev);
     455             :         }
     456             : 
     457           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     458             :                         NULL, &ndr_table_eventlog,
     459           0 :                         NDR_EVENTLOG_CLOSEEVENTLOG, state->out_mem_ctx, r);
     460           0 :         if (tevent_req_nomem(subreq, req)) {
     461           0 :                 return tevent_req_post(req, ev);
     462             :         }
     463           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_CloseEventLog_r_done, req);
     464             : 
     465           0 :         return req;
     466             : }
     467             : 
     468           0 : static void dcerpc_eventlog_CloseEventLog_r_done(struct tevent_req *subreq)
     469             : {
     470           0 :         struct tevent_req *req =
     471           0 :                 tevent_req_callback_data(subreq,
     472             :                 struct tevent_req);
     473             :         NTSTATUS status;
     474             : 
     475           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     476           0 :         TALLOC_FREE(subreq);
     477           0 :         if (tevent_req_nterror(req, status)) {
     478           0 :                 return;
     479             :         }
     480             : 
     481           0 :         tevent_req_done(req);
     482             : }
     483             : 
     484           0 : NTSTATUS dcerpc_eventlog_CloseEventLog_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     485             : {
     486           0 :         struct dcerpc_eventlog_CloseEventLog_r_state *state =
     487           0 :                 tevent_req_data(req,
     488             :                 struct dcerpc_eventlog_CloseEventLog_r_state);
     489             :         NTSTATUS status;
     490             : 
     491           0 :         if (tevent_req_is_nterror(req, &status)) {
     492           0 :                 tevent_req_received(req);
     493           0 :                 return status;
     494             :         }
     495             : 
     496           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     497             : 
     498           0 :         tevent_req_received(req);
     499           0 :         return NT_STATUS_OK;
     500             : }
     501             : 
     502          12 : NTSTATUS dcerpc_eventlog_CloseEventLog_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_CloseEventLog *r)
     503             : {
     504             :         NTSTATUS status;
     505             : 
     506          12 :         status = dcerpc_binding_handle_call(h,
     507             :                         NULL, &ndr_table_eventlog,
     508             :                         NDR_EVENTLOG_CLOSEEVENTLOG, mem_ctx, r);
     509             : 
     510          12 :         return status;
     511             : }
     512             : 
     513             : struct dcerpc_eventlog_CloseEventLog_state {
     514             :         struct eventlog_CloseEventLog orig;
     515             :         struct eventlog_CloseEventLog tmp;
     516             :         TALLOC_CTX *out_mem_ctx;
     517             : };
     518             : 
     519             : static void dcerpc_eventlog_CloseEventLog_done(struct tevent_req *subreq);
     520             : 
     521           0 : struct tevent_req *dcerpc_eventlog_CloseEventLog_send(TALLOC_CTX *mem_ctx,
     522             :                                                       struct tevent_context *ev,
     523             :                                                       struct dcerpc_binding_handle *h,
     524             :                                                       struct policy_handle *_handle /* [in,out] [ref] */)
     525             : {
     526             :         struct tevent_req *req;
     527             :         struct dcerpc_eventlog_CloseEventLog_state *state;
     528             :         struct tevent_req *subreq;
     529             : 
     530           0 :         req = tevent_req_create(mem_ctx, &state,
     531             :                                 struct dcerpc_eventlog_CloseEventLog_state);
     532           0 :         if (req == NULL) {
     533           0 :                 return NULL;
     534             :         }
     535           0 :         state->out_mem_ctx = NULL;
     536             : 
     537             :         /* In parameters */
     538           0 :         state->orig.in.handle = _handle;
     539             : 
     540             :         /* Out parameters */
     541           0 :         state->orig.out.handle = _handle;
     542             : 
     543             :         /* Result */
     544           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     545             : 
     546           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     547             :                              "dcerpc_eventlog_CloseEventLog_out_memory");
     548           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     549           0 :                 return tevent_req_post(req, ev);
     550             :         }
     551             : 
     552             :         /* make a temporary copy, that we pass to the dispatch function */
     553           0 :         state->tmp = state->orig;
     554             : 
     555           0 :         subreq = dcerpc_eventlog_CloseEventLog_r_send(state, ev, h, &state->tmp);
     556           0 :         if (tevent_req_nomem(subreq, req)) {
     557           0 :                 return tevent_req_post(req, ev);
     558             :         }
     559           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_CloseEventLog_done, req);
     560           0 :         return req;
     561             : }
     562             : 
     563           0 : static void dcerpc_eventlog_CloseEventLog_done(struct tevent_req *subreq)
     564             : {
     565           0 :         struct tevent_req *req = tevent_req_callback_data(
     566             :                 subreq, struct tevent_req);
     567           0 :         struct dcerpc_eventlog_CloseEventLog_state *state = tevent_req_data(
     568             :                 req, struct dcerpc_eventlog_CloseEventLog_state);
     569             :         NTSTATUS status;
     570             :         TALLOC_CTX *mem_ctx;
     571             : 
     572           0 :         if (state->out_mem_ctx) {
     573           0 :                 mem_ctx = state->out_mem_ctx;
     574             :         } else {
     575           0 :                 mem_ctx = state;
     576             :         }
     577             : 
     578           0 :         status = dcerpc_eventlog_CloseEventLog_r_recv(subreq, mem_ctx);
     579           0 :         TALLOC_FREE(subreq);
     580           0 :         if (tevent_req_nterror(req, status)) {
     581           0 :                 return;
     582             :         }
     583             : 
     584             :         /* Copy out parameters */
     585           0 :         *state->orig.out.handle = *state->tmp.out.handle;
     586             : 
     587             :         /* Copy result */
     588           0 :         state->orig.out.result = state->tmp.out.result;
     589             : 
     590             :         /* Reset temporary structure */
     591           0 :         NDR_ZERO_STRUCT(state->tmp);
     592             : 
     593           0 :         tevent_req_done(req);
     594             : }
     595             : 
     596           0 : NTSTATUS dcerpc_eventlog_CloseEventLog_recv(struct tevent_req *req,
     597             :                                             TALLOC_CTX *mem_ctx,
     598             :                                             NTSTATUS *result)
     599             : {
     600           0 :         struct dcerpc_eventlog_CloseEventLog_state *state = tevent_req_data(
     601             :                 req, struct dcerpc_eventlog_CloseEventLog_state);
     602             :         NTSTATUS status;
     603             : 
     604           0 :         if (tevent_req_is_nterror(req, &status)) {
     605           0 :                 tevent_req_received(req);
     606           0 :                 return status;
     607             :         }
     608             : 
     609             :         /* Steal possible out parameters to the callers context */
     610           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     611             : 
     612             :         /* Return result */
     613           0 :         *result = state->orig.out.result;
     614             : 
     615           0 :         tevent_req_received(req);
     616           0 :         return NT_STATUS_OK;
     617             : }
     618             : 
     619           0 : NTSTATUS dcerpc_eventlog_CloseEventLog(struct dcerpc_binding_handle *h,
     620             :                                        TALLOC_CTX *mem_ctx,
     621             :                                        struct policy_handle *_handle /* [in,out] [ref] */,
     622             :                                        NTSTATUS *result)
     623             : {
     624             :         struct eventlog_CloseEventLog r;
     625             :         NTSTATUS status;
     626             : 
     627             :         /* In parameters */
     628           0 :         r.in.handle = _handle;
     629             : 
     630             :         /* Out parameters */
     631           0 :         r.out.handle = _handle;
     632             : 
     633             :         /* Result */
     634           0 :         NDR_ZERO_STRUCT(r.out.result);
     635             : 
     636           0 :         status = dcerpc_eventlog_CloseEventLog_r(h, mem_ctx, &r);
     637           0 :         if (!NT_STATUS_IS_OK(status)) {
     638           0 :                 return status;
     639             :         }
     640             : 
     641             :         /* Return variables */
     642           0 :         *_handle = *r.out.handle;
     643             : 
     644             :         /* Return result */
     645           0 :         *result = r.out.result;
     646             : 
     647           0 :         return NT_STATUS_OK;
     648             : }
     649             : 
     650             : struct dcerpc_eventlog_DeregisterEventSource_r_state {
     651             :         TALLOC_CTX *out_mem_ctx;
     652             : };
     653             : 
     654             : static void dcerpc_eventlog_DeregisterEventSource_r_done(struct tevent_req *subreq);
     655             : 
     656           0 : struct tevent_req *dcerpc_eventlog_DeregisterEventSource_r_send(TALLOC_CTX *mem_ctx,
     657             :         struct tevent_context *ev,
     658             :         struct dcerpc_binding_handle *h,
     659             :         struct eventlog_DeregisterEventSource *r)
     660             : {
     661             :         struct tevent_req *req;
     662             :         struct dcerpc_eventlog_DeregisterEventSource_r_state *state;
     663             :         struct tevent_req *subreq;
     664             : 
     665           0 :         req = tevent_req_create(mem_ctx, &state,
     666             :                                 struct dcerpc_eventlog_DeregisterEventSource_r_state);
     667           0 :         if (req == NULL) {
     668           0 :                 return NULL;
     669             :         }
     670             : 
     671           0 :         state->out_mem_ctx = talloc_new(state);
     672           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     673           0 :                 return tevent_req_post(req, ev);
     674             :         }
     675             : 
     676           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     677             :                         NULL, &ndr_table_eventlog,
     678           0 :                         NDR_EVENTLOG_DEREGISTEREVENTSOURCE, state->out_mem_ctx, r);
     679           0 :         if (tevent_req_nomem(subreq, req)) {
     680           0 :                 return tevent_req_post(req, ev);
     681             :         }
     682           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_DeregisterEventSource_r_done, req);
     683             : 
     684           0 :         return req;
     685             : }
     686             : 
     687           0 : static void dcerpc_eventlog_DeregisterEventSource_r_done(struct tevent_req *subreq)
     688             : {
     689           0 :         struct tevent_req *req =
     690           0 :                 tevent_req_callback_data(subreq,
     691             :                 struct tevent_req);
     692             :         NTSTATUS status;
     693             : 
     694           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     695           0 :         TALLOC_FREE(subreq);
     696           0 :         if (tevent_req_nterror(req, status)) {
     697           0 :                 return;
     698             :         }
     699             : 
     700           0 :         tevent_req_done(req);
     701             : }
     702             : 
     703           0 : NTSTATUS dcerpc_eventlog_DeregisterEventSource_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     704             : {
     705           0 :         struct dcerpc_eventlog_DeregisterEventSource_r_state *state =
     706           0 :                 tevent_req_data(req,
     707             :                 struct dcerpc_eventlog_DeregisterEventSource_r_state);
     708             :         NTSTATUS status;
     709             : 
     710           0 :         if (tevent_req_is_nterror(req, &status)) {
     711           0 :                 tevent_req_received(req);
     712           0 :                 return status;
     713             :         }
     714             : 
     715           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     716             : 
     717           0 :         tevent_req_received(req);
     718           0 :         return NT_STATUS_OK;
     719             : }
     720             : 
     721           0 : NTSTATUS dcerpc_eventlog_DeregisterEventSource_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_DeregisterEventSource *r)
     722             : {
     723             :         NTSTATUS status;
     724             : 
     725           0 :         status = dcerpc_binding_handle_call(h,
     726             :                         NULL, &ndr_table_eventlog,
     727             :                         NDR_EVENTLOG_DEREGISTEREVENTSOURCE, mem_ctx, r);
     728             : 
     729           0 :         return status;
     730             : }
     731             : 
     732             : struct dcerpc_eventlog_DeregisterEventSource_state {
     733             :         struct eventlog_DeregisterEventSource orig;
     734             :         struct eventlog_DeregisterEventSource tmp;
     735             :         TALLOC_CTX *out_mem_ctx;
     736             : };
     737             : 
     738             : static void dcerpc_eventlog_DeregisterEventSource_done(struct tevent_req *subreq);
     739             : 
     740           0 : struct tevent_req *dcerpc_eventlog_DeregisterEventSource_send(TALLOC_CTX *mem_ctx,
     741             :                                                               struct tevent_context *ev,
     742             :                                                               struct dcerpc_binding_handle *h,
     743             :                                                               struct policy_handle *_handle /* [in,out] [ref] */)
     744             : {
     745             :         struct tevent_req *req;
     746             :         struct dcerpc_eventlog_DeregisterEventSource_state *state;
     747             :         struct tevent_req *subreq;
     748             : 
     749           0 :         req = tevent_req_create(mem_ctx, &state,
     750             :                                 struct dcerpc_eventlog_DeregisterEventSource_state);
     751           0 :         if (req == NULL) {
     752           0 :                 return NULL;
     753             :         }
     754           0 :         state->out_mem_ctx = NULL;
     755             : 
     756             :         /* In parameters */
     757           0 :         state->orig.in.handle = _handle;
     758             : 
     759             :         /* Out parameters */
     760           0 :         state->orig.out.handle = _handle;
     761             : 
     762             :         /* Result */
     763           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     764             : 
     765           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     766             :                              "dcerpc_eventlog_DeregisterEventSource_out_memory");
     767           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     768           0 :                 return tevent_req_post(req, ev);
     769             :         }
     770             : 
     771             :         /* make a temporary copy, that we pass to the dispatch function */
     772           0 :         state->tmp = state->orig;
     773             : 
     774           0 :         subreq = dcerpc_eventlog_DeregisterEventSource_r_send(state, ev, h, &state->tmp);
     775           0 :         if (tevent_req_nomem(subreq, req)) {
     776           0 :                 return tevent_req_post(req, ev);
     777             :         }
     778           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_DeregisterEventSource_done, req);
     779           0 :         return req;
     780             : }
     781             : 
     782           0 : static void dcerpc_eventlog_DeregisterEventSource_done(struct tevent_req *subreq)
     783             : {
     784           0 :         struct tevent_req *req = tevent_req_callback_data(
     785             :                 subreq, struct tevent_req);
     786           0 :         struct dcerpc_eventlog_DeregisterEventSource_state *state = tevent_req_data(
     787             :                 req, struct dcerpc_eventlog_DeregisterEventSource_state);
     788             :         NTSTATUS status;
     789             :         TALLOC_CTX *mem_ctx;
     790             : 
     791           0 :         if (state->out_mem_ctx) {
     792           0 :                 mem_ctx = state->out_mem_ctx;
     793             :         } else {
     794           0 :                 mem_ctx = state;
     795             :         }
     796             : 
     797           0 :         status = dcerpc_eventlog_DeregisterEventSource_r_recv(subreq, mem_ctx);
     798           0 :         TALLOC_FREE(subreq);
     799           0 :         if (tevent_req_nterror(req, status)) {
     800           0 :                 return;
     801             :         }
     802             : 
     803             :         /* Copy out parameters */
     804           0 :         *state->orig.out.handle = *state->tmp.out.handle;
     805             : 
     806             :         /* Copy result */
     807           0 :         state->orig.out.result = state->tmp.out.result;
     808             : 
     809             :         /* Reset temporary structure */
     810           0 :         NDR_ZERO_STRUCT(state->tmp);
     811             : 
     812           0 :         tevent_req_done(req);
     813             : }
     814             : 
     815           0 : NTSTATUS dcerpc_eventlog_DeregisterEventSource_recv(struct tevent_req *req,
     816             :                                                     TALLOC_CTX *mem_ctx,
     817             :                                                     NTSTATUS *result)
     818             : {
     819           0 :         struct dcerpc_eventlog_DeregisterEventSource_state *state = tevent_req_data(
     820             :                 req, struct dcerpc_eventlog_DeregisterEventSource_state);
     821             :         NTSTATUS status;
     822             : 
     823           0 :         if (tevent_req_is_nterror(req, &status)) {
     824           0 :                 tevent_req_received(req);
     825           0 :                 return status;
     826             :         }
     827             : 
     828             :         /* Steal possible out parameters to the callers context */
     829           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     830             : 
     831             :         /* Return result */
     832           0 :         *result = state->orig.out.result;
     833             : 
     834           0 :         tevent_req_received(req);
     835           0 :         return NT_STATUS_OK;
     836             : }
     837             : 
     838           0 : NTSTATUS dcerpc_eventlog_DeregisterEventSource(struct dcerpc_binding_handle *h,
     839             :                                                TALLOC_CTX *mem_ctx,
     840             :                                                struct policy_handle *_handle /* [in,out] [ref] */,
     841             :                                                NTSTATUS *result)
     842             : {
     843             :         struct eventlog_DeregisterEventSource r;
     844             :         NTSTATUS status;
     845             : 
     846             :         /* In parameters */
     847           0 :         r.in.handle = _handle;
     848             : 
     849             :         /* Out parameters */
     850           0 :         r.out.handle = _handle;
     851             : 
     852             :         /* Result */
     853           0 :         NDR_ZERO_STRUCT(r.out.result);
     854             : 
     855           0 :         status = dcerpc_eventlog_DeregisterEventSource_r(h, mem_ctx, &r);
     856           0 :         if (!NT_STATUS_IS_OK(status)) {
     857           0 :                 return status;
     858             :         }
     859             : 
     860             :         /* Return variables */
     861           0 :         *_handle = *r.out.handle;
     862             : 
     863             :         /* Return result */
     864           0 :         *result = r.out.result;
     865             : 
     866           0 :         return NT_STATUS_OK;
     867             : }
     868             : 
     869             : struct dcerpc_eventlog_GetNumRecords_r_state {
     870             :         TALLOC_CTX *out_mem_ctx;
     871             : };
     872             : 
     873             : static void dcerpc_eventlog_GetNumRecords_r_done(struct tevent_req *subreq);
     874             : 
     875           0 : struct tevent_req *dcerpc_eventlog_GetNumRecords_r_send(TALLOC_CTX *mem_ctx,
     876             :         struct tevent_context *ev,
     877             :         struct dcerpc_binding_handle *h,
     878             :         struct eventlog_GetNumRecords *r)
     879             : {
     880             :         struct tevent_req *req;
     881             :         struct dcerpc_eventlog_GetNumRecords_r_state *state;
     882             :         struct tevent_req *subreq;
     883             : 
     884           0 :         req = tevent_req_create(mem_ctx, &state,
     885             :                                 struct dcerpc_eventlog_GetNumRecords_r_state);
     886           0 :         if (req == NULL) {
     887           0 :                 return NULL;
     888             :         }
     889             : 
     890           0 :         state->out_mem_ctx = talloc_new(state);
     891           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     892           0 :                 return tevent_req_post(req, ev);
     893             :         }
     894             : 
     895           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     896             :                         NULL, &ndr_table_eventlog,
     897           0 :                         NDR_EVENTLOG_GETNUMRECORDS, state->out_mem_ctx, r);
     898           0 :         if (tevent_req_nomem(subreq, req)) {
     899           0 :                 return tevent_req_post(req, ev);
     900             :         }
     901           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_GetNumRecords_r_done, req);
     902             : 
     903           0 :         return req;
     904             : }
     905             : 
     906           0 : static void dcerpc_eventlog_GetNumRecords_r_done(struct tevent_req *subreq)
     907             : {
     908           0 :         struct tevent_req *req =
     909           0 :                 tevent_req_callback_data(subreq,
     910             :                 struct tevent_req);
     911             :         NTSTATUS status;
     912             : 
     913           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     914           0 :         TALLOC_FREE(subreq);
     915           0 :         if (tevent_req_nterror(req, status)) {
     916           0 :                 return;
     917             :         }
     918             : 
     919           0 :         tevent_req_done(req);
     920             : }
     921             : 
     922           0 : NTSTATUS dcerpc_eventlog_GetNumRecords_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     923             : {
     924           0 :         struct dcerpc_eventlog_GetNumRecords_r_state *state =
     925           0 :                 tevent_req_data(req,
     926             :                 struct dcerpc_eventlog_GetNumRecords_r_state);
     927             :         NTSTATUS status;
     928             : 
     929           0 :         if (tevent_req_is_nterror(req, &status)) {
     930           0 :                 tevent_req_received(req);
     931           0 :                 return status;
     932             :         }
     933             : 
     934           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     935             : 
     936           0 :         tevent_req_received(req);
     937           0 :         return NT_STATUS_OK;
     938             : }
     939             : 
     940           2 : NTSTATUS dcerpc_eventlog_GetNumRecords_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_GetNumRecords *r)
     941             : {
     942             :         NTSTATUS status;
     943             : 
     944           2 :         status = dcerpc_binding_handle_call(h,
     945             :                         NULL, &ndr_table_eventlog,
     946             :                         NDR_EVENTLOG_GETNUMRECORDS, mem_ctx, r);
     947             : 
     948           2 :         return status;
     949             : }
     950             : 
     951             : struct dcerpc_eventlog_GetNumRecords_state {
     952             :         struct eventlog_GetNumRecords orig;
     953             :         struct eventlog_GetNumRecords tmp;
     954             :         TALLOC_CTX *out_mem_ctx;
     955             : };
     956             : 
     957             : static void dcerpc_eventlog_GetNumRecords_done(struct tevent_req *subreq);
     958             : 
     959           0 : struct tevent_req *dcerpc_eventlog_GetNumRecords_send(TALLOC_CTX *mem_ctx,
     960             :                                                       struct tevent_context *ev,
     961             :                                                       struct dcerpc_binding_handle *h,
     962             :                                                       struct policy_handle *_handle /* [in] [ref] */,
     963             :                                                       uint32_t *_number /* [out] [ref] */)
     964             : {
     965             :         struct tevent_req *req;
     966             :         struct dcerpc_eventlog_GetNumRecords_state *state;
     967             :         struct tevent_req *subreq;
     968             : 
     969           0 :         req = tevent_req_create(mem_ctx, &state,
     970             :                                 struct dcerpc_eventlog_GetNumRecords_state);
     971           0 :         if (req == NULL) {
     972           0 :                 return NULL;
     973             :         }
     974           0 :         state->out_mem_ctx = NULL;
     975             : 
     976             :         /* In parameters */
     977           0 :         state->orig.in.handle = _handle;
     978             : 
     979             :         /* Out parameters */
     980           0 :         state->orig.out.number = _number;
     981             : 
     982             :         /* Result */
     983           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     984             : 
     985           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     986             :                              "dcerpc_eventlog_GetNumRecords_out_memory");
     987           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     988           0 :                 return tevent_req_post(req, ev);
     989             :         }
     990             : 
     991             :         /* make a temporary copy, that we pass to the dispatch function */
     992           0 :         state->tmp = state->orig;
     993             : 
     994           0 :         subreq = dcerpc_eventlog_GetNumRecords_r_send(state, ev, h, &state->tmp);
     995           0 :         if (tevent_req_nomem(subreq, req)) {
     996           0 :                 return tevent_req_post(req, ev);
     997             :         }
     998           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_GetNumRecords_done, req);
     999           0 :         return req;
    1000             : }
    1001             : 
    1002           0 : static void dcerpc_eventlog_GetNumRecords_done(struct tevent_req *subreq)
    1003             : {
    1004           0 :         struct tevent_req *req = tevent_req_callback_data(
    1005             :                 subreq, struct tevent_req);
    1006           0 :         struct dcerpc_eventlog_GetNumRecords_state *state = tevent_req_data(
    1007             :                 req, struct dcerpc_eventlog_GetNumRecords_state);
    1008             :         NTSTATUS status;
    1009             :         TALLOC_CTX *mem_ctx;
    1010             : 
    1011           0 :         if (state->out_mem_ctx) {
    1012           0 :                 mem_ctx = state->out_mem_ctx;
    1013             :         } else {
    1014           0 :                 mem_ctx = state;
    1015             :         }
    1016             : 
    1017           0 :         status = dcerpc_eventlog_GetNumRecords_r_recv(subreq, mem_ctx);
    1018           0 :         TALLOC_FREE(subreq);
    1019           0 :         if (tevent_req_nterror(req, status)) {
    1020           0 :                 return;
    1021             :         }
    1022             : 
    1023             :         /* Copy out parameters */
    1024           0 :         *state->orig.out.number = *state->tmp.out.number;
    1025             : 
    1026             :         /* Copy result */
    1027           0 :         state->orig.out.result = state->tmp.out.result;
    1028             : 
    1029             :         /* Reset temporary structure */
    1030           0 :         NDR_ZERO_STRUCT(state->tmp);
    1031             : 
    1032           0 :         tevent_req_done(req);
    1033             : }
    1034             : 
    1035           0 : NTSTATUS dcerpc_eventlog_GetNumRecords_recv(struct tevent_req *req,
    1036             :                                             TALLOC_CTX *mem_ctx,
    1037             :                                             NTSTATUS *result)
    1038             : {
    1039           0 :         struct dcerpc_eventlog_GetNumRecords_state *state = tevent_req_data(
    1040             :                 req, struct dcerpc_eventlog_GetNumRecords_state);
    1041             :         NTSTATUS status;
    1042             : 
    1043           0 :         if (tevent_req_is_nterror(req, &status)) {
    1044           0 :                 tevent_req_received(req);
    1045           0 :                 return status;
    1046             :         }
    1047             : 
    1048             :         /* Steal possible out parameters to the callers context */
    1049           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1050             : 
    1051             :         /* Return result */
    1052           0 :         *result = state->orig.out.result;
    1053             : 
    1054           0 :         tevent_req_received(req);
    1055           0 :         return NT_STATUS_OK;
    1056             : }
    1057             : 
    1058           0 : NTSTATUS dcerpc_eventlog_GetNumRecords(struct dcerpc_binding_handle *h,
    1059             :                                        TALLOC_CTX *mem_ctx,
    1060             :                                        struct policy_handle *_handle /* [in] [ref] */,
    1061             :                                        uint32_t *_number /* [out] [ref] */,
    1062             :                                        NTSTATUS *result)
    1063             : {
    1064             :         struct eventlog_GetNumRecords r;
    1065             :         NTSTATUS status;
    1066             : 
    1067             :         /* In parameters */
    1068           0 :         r.in.handle = _handle;
    1069             : 
    1070             :         /* Out parameters */
    1071           0 :         r.out.number = _number;
    1072             : 
    1073             :         /* Result */
    1074           0 :         NDR_ZERO_STRUCT(r.out.result);
    1075             : 
    1076           0 :         status = dcerpc_eventlog_GetNumRecords_r(h, mem_ctx, &r);
    1077           0 :         if (!NT_STATUS_IS_OK(status)) {
    1078           0 :                 return status;
    1079             :         }
    1080             : 
    1081             :         /* Return variables */
    1082           0 :         *_number = *r.out.number;
    1083             : 
    1084             :         /* Return result */
    1085           0 :         *result = r.out.result;
    1086             : 
    1087           0 :         return NT_STATUS_OK;
    1088             : }
    1089             : 
    1090             : struct dcerpc_eventlog_GetOldestRecord_r_state {
    1091             :         TALLOC_CTX *out_mem_ctx;
    1092             : };
    1093             : 
    1094             : static void dcerpc_eventlog_GetOldestRecord_r_done(struct tevent_req *subreq);
    1095             : 
    1096           0 : struct tevent_req *dcerpc_eventlog_GetOldestRecord_r_send(TALLOC_CTX *mem_ctx,
    1097             :         struct tevent_context *ev,
    1098             :         struct dcerpc_binding_handle *h,
    1099             :         struct eventlog_GetOldestRecord *r)
    1100             : {
    1101             :         struct tevent_req *req;
    1102             :         struct dcerpc_eventlog_GetOldestRecord_r_state *state;
    1103             :         struct tevent_req *subreq;
    1104             : 
    1105           0 :         req = tevent_req_create(mem_ctx, &state,
    1106             :                                 struct dcerpc_eventlog_GetOldestRecord_r_state);
    1107           0 :         if (req == NULL) {
    1108           0 :                 return NULL;
    1109             :         }
    1110             : 
    1111           0 :         state->out_mem_ctx = talloc_new(state);
    1112           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1113           0 :                 return tevent_req_post(req, ev);
    1114             :         }
    1115             : 
    1116           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1117             :                         NULL, &ndr_table_eventlog,
    1118           0 :                         NDR_EVENTLOG_GETOLDESTRECORD, state->out_mem_ctx, r);
    1119           0 :         if (tevent_req_nomem(subreq, req)) {
    1120           0 :                 return tevent_req_post(req, ev);
    1121             :         }
    1122           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_GetOldestRecord_r_done, req);
    1123             : 
    1124           0 :         return req;
    1125             : }
    1126             : 
    1127           0 : static void dcerpc_eventlog_GetOldestRecord_r_done(struct tevent_req *subreq)
    1128             : {
    1129           0 :         struct tevent_req *req =
    1130           0 :                 tevent_req_callback_data(subreq,
    1131             :                 struct tevent_req);
    1132             :         NTSTATUS status;
    1133             : 
    1134           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1135           0 :         TALLOC_FREE(subreq);
    1136           0 :         if (tevent_req_nterror(req, status)) {
    1137           0 :                 return;
    1138             :         }
    1139             : 
    1140           0 :         tevent_req_done(req);
    1141             : }
    1142             : 
    1143           0 : NTSTATUS dcerpc_eventlog_GetOldestRecord_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1144             : {
    1145           0 :         struct dcerpc_eventlog_GetOldestRecord_r_state *state =
    1146           0 :                 tevent_req_data(req,
    1147             :                 struct dcerpc_eventlog_GetOldestRecord_r_state);
    1148             :         NTSTATUS status;
    1149             : 
    1150           0 :         if (tevent_req_is_nterror(req, &status)) {
    1151           0 :                 tevent_req_received(req);
    1152           0 :                 return status;
    1153             :         }
    1154             : 
    1155           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1156             : 
    1157           0 :         tevent_req_received(req);
    1158           0 :         return NT_STATUS_OK;
    1159             : }
    1160             : 
    1161           0 : NTSTATUS dcerpc_eventlog_GetOldestRecord_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_GetOldestRecord *r)
    1162             : {
    1163             :         NTSTATUS status;
    1164             : 
    1165           0 :         status = dcerpc_binding_handle_call(h,
    1166             :                         NULL, &ndr_table_eventlog,
    1167             :                         NDR_EVENTLOG_GETOLDESTRECORD, mem_ctx, r);
    1168             : 
    1169           0 :         return status;
    1170             : }
    1171             : 
    1172             : struct dcerpc_eventlog_GetOldestRecord_state {
    1173             :         struct eventlog_GetOldestRecord orig;
    1174             :         struct eventlog_GetOldestRecord tmp;
    1175             :         TALLOC_CTX *out_mem_ctx;
    1176             : };
    1177             : 
    1178             : static void dcerpc_eventlog_GetOldestRecord_done(struct tevent_req *subreq);
    1179             : 
    1180           0 : struct tevent_req *dcerpc_eventlog_GetOldestRecord_send(TALLOC_CTX *mem_ctx,
    1181             :                                                         struct tevent_context *ev,
    1182             :                                                         struct dcerpc_binding_handle *h,
    1183             :                                                         struct policy_handle *_handle /* [in] [ref] */,
    1184             :                                                         uint32_t *_oldest_entry /* [out] [ref] */)
    1185             : {
    1186             :         struct tevent_req *req;
    1187             :         struct dcerpc_eventlog_GetOldestRecord_state *state;
    1188             :         struct tevent_req *subreq;
    1189             : 
    1190           0 :         req = tevent_req_create(mem_ctx, &state,
    1191             :                                 struct dcerpc_eventlog_GetOldestRecord_state);
    1192           0 :         if (req == NULL) {
    1193           0 :                 return NULL;
    1194             :         }
    1195           0 :         state->out_mem_ctx = NULL;
    1196             : 
    1197             :         /* In parameters */
    1198           0 :         state->orig.in.handle = _handle;
    1199             : 
    1200             :         /* Out parameters */
    1201           0 :         state->orig.out.oldest_entry = _oldest_entry;
    1202             : 
    1203             :         /* Result */
    1204           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1205             : 
    1206           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1207             :                              "dcerpc_eventlog_GetOldestRecord_out_memory");
    1208           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1209           0 :                 return tevent_req_post(req, ev);
    1210             :         }
    1211             : 
    1212             :         /* make a temporary copy, that we pass to the dispatch function */
    1213           0 :         state->tmp = state->orig;
    1214             : 
    1215           0 :         subreq = dcerpc_eventlog_GetOldestRecord_r_send(state, ev, h, &state->tmp);
    1216           0 :         if (tevent_req_nomem(subreq, req)) {
    1217           0 :                 return tevent_req_post(req, ev);
    1218             :         }
    1219           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_GetOldestRecord_done, req);
    1220           0 :         return req;
    1221             : }
    1222             : 
    1223           0 : static void dcerpc_eventlog_GetOldestRecord_done(struct tevent_req *subreq)
    1224             : {
    1225           0 :         struct tevent_req *req = tevent_req_callback_data(
    1226             :                 subreq, struct tevent_req);
    1227           0 :         struct dcerpc_eventlog_GetOldestRecord_state *state = tevent_req_data(
    1228             :                 req, struct dcerpc_eventlog_GetOldestRecord_state);
    1229             :         NTSTATUS status;
    1230             :         TALLOC_CTX *mem_ctx;
    1231             : 
    1232           0 :         if (state->out_mem_ctx) {
    1233           0 :                 mem_ctx = state->out_mem_ctx;
    1234             :         } else {
    1235           0 :                 mem_ctx = state;
    1236             :         }
    1237             : 
    1238           0 :         status = dcerpc_eventlog_GetOldestRecord_r_recv(subreq, mem_ctx);
    1239           0 :         TALLOC_FREE(subreq);
    1240           0 :         if (tevent_req_nterror(req, status)) {
    1241           0 :                 return;
    1242             :         }
    1243             : 
    1244             :         /* Copy out parameters */
    1245           0 :         *state->orig.out.oldest_entry = *state->tmp.out.oldest_entry;
    1246             : 
    1247             :         /* Copy result */
    1248           0 :         state->orig.out.result = state->tmp.out.result;
    1249             : 
    1250             :         /* Reset temporary structure */
    1251           0 :         NDR_ZERO_STRUCT(state->tmp);
    1252             : 
    1253           0 :         tevent_req_done(req);
    1254             : }
    1255             : 
    1256           0 : NTSTATUS dcerpc_eventlog_GetOldestRecord_recv(struct tevent_req *req,
    1257             :                                               TALLOC_CTX *mem_ctx,
    1258             :                                               NTSTATUS *result)
    1259             : {
    1260           0 :         struct dcerpc_eventlog_GetOldestRecord_state *state = tevent_req_data(
    1261             :                 req, struct dcerpc_eventlog_GetOldestRecord_state);
    1262             :         NTSTATUS status;
    1263             : 
    1264           0 :         if (tevent_req_is_nterror(req, &status)) {
    1265           0 :                 tevent_req_received(req);
    1266           0 :                 return status;
    1267             :         }
    1268             : 
    1269             :         /* Steal possible out parameters to the callers context */
    1270           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1271             : 
    1272             :         /* Return result */
    1273           0 :         *result = state->orig.out.result;
    1274             : 
    1275           0 :         tevent_req_received(req);
    1276           0 :         return NT_STATUS_OK;
    1277             : }
    1278             : 
    1279           0 : NTSTATUS dcerpc_eventlog_GetOldestRecord(struct dcerpc_binding_handle *h,
    1280             :                                          TALLOC_CTX *mem_ctx,
    1281             :                                          struct policy_handle *_handle /* [in] [ref] */,
    1282             :                                          uint32_t *_oldest_entry /* [out] [ref] */,
    1283             :                                          NTSTATUS *result)
    1284             : {
    1285             :         struct eventlog_GetOldestRecord r;
    1286             :         NTSTATUS status;
    1287             : 
    1288             :         /* In parameters */
    1289           0 :         r.in.handle = _handle;
    1290             : 
    1291             :         /* Out parameters */
    1292           0 :         r.out.oldest_entry = _oldest_entry;
    1293             : 
    1294             :         /* Result */
    1295           0 :         NDR_ZERO_STRUCT(r.out.result);
    1296             : 
    1297           0 :         status = dcerpc_eventlog_GetOldestRecord_r(h, mem_ctx, &r);
    1298           0 :         if (!NT_STATUS_IS_OK(status)) {
    1299           0 :                 return status;
    1300             :         }
    1301             : 
    1302             :         /* Return variables */
    1303           0 :         *_oldest_entry = *r.out.oldest_entry;
    1304             : 
    1305             :         /* Return result */
    1306           0 :         *result = r.out.result;
    1307             : 
    1308           0 :         return NT_STATUS_OK;
    1309             : }
    1310             : 
    1311             : struct dcerpc_eventlog_OpenEventLogW_r_state {
    1312             :         TALLOC_CTX *out_mem_ctx;
    1313             : };
    1314             : 
    1315             : static void dcerpc_eventlog_OpenEventLogW_r_done(struct tevent_req *subreq);
    1316             : 
    1317           0 : struct tevent_req *dcerpc_eventlog_OpenEventLogW_r_send(TALLOC_CTX *mem_ctx,
    1318             :         struct tevent_context *ev,
    1319             :         struct dcerpc_binding_handle *h,
    1320             :         struct eventlog_OpenEventLogW *r)
    1321             : {
    1322             :         struct tevent_req *req;
    1323             :         struct dcerpc_eventlog_OpenEventLogW_r_state *state;
    1324             :         struct tevent_req *subreq;
    1325             : 
    1326           0 :         req = tevent_req_create(mem_ctx, &state,
    1327             :                                 struct dcerpc_eventlog_OpenEventLogW_r_state);
    1328           0 :         if (req == NULL) {
    1329           0 :                 return NULL;
    1330             :         }
    1331             : 
    1332           0 :         state->out_mem_ctx = talloc_new(state);
    1333           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1334           0 :                 return tevent_req_post(req, ev);
    1335             :         }
    1336             : 
    1337           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1338             :                         NULL, &ndr_table_eventlog,
    1339           0 :                         NDR_EVENTLOG_OPENEVENTLOGW, state->out_mem_ctx, r);
    1340           0 :         if (tevent_req_nomem(subreq, req)) {
    1341           0 :                 return tevent_req_post(req, ev);
    1342             :         }
    1343           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_OpenEventLogW_r_done, req);
    1344             : 
    1345           0 :         return req;
    1346             : }
    1347             : 
    1348           0 : static void dcerpc_eventlog_OpenEventLogW_r_done(struct tevent_req *subreq)
    1349             : {
    1350           0 :         struct tevent_req *req =
    1351           0 :                 tevent_req_callback_data(subreq,
    1352             :                 struct tevent_req);
    1353             :         NTSTATUS status;
    1354             : 
    1355           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1356           0 :         TALLOC_FREE(subreq);
    1357           0 :         if (tevent_req_nterror(req, status)) {
    1358           0 :                 return;
    1359             :         }
    1360             : 
    1361           0 :         tevent_req_done(req);
    1362             : }
    1363             : 
    1364           0 : NTSTATUS dcerpc_eventlog_OpenEventLogW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1365             : {
    1366           0 :         struct dcerpc_eventlog_OpenEventLogW_r_state *state =
    1367           0 :                 tevent_req_data(req,
    1368             :                 struct dcerpc_eventlog_OpenEventLogW_r_state);
    1369             :         NTSTATUS status;
    1370             : 
    1371           0 :         if (tevent_req_is_nterror(req, &status)) {
    1372           0 :                 tevent_req_received(req);
    1373           0 :                 return status;
    1374             :         }
    1375             : 
    1376           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1377             : 
    1378           0 :         tevent_req_received(req);
    1379           0 :         return NT_STATUS_OK;
    1380             : }
    1381             : 
    1382          24 : NTSTATUS dcerpc_eventlog_OpenEventLogW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_OpenEventLogW *r)
    1383             : {
    1384             :         NTSTATUS status;
    1385             : 
    1386          24 :         status = dcerpc_binding_handle_call(h,
    1387             :                         NULL, &ndr_table_eventlog,
    1388             :                         NDR_EVENTLOG_OPENEVENTLOGW, mem_ctx, r);
    1389             : 
    1390          24 :         return status;
    1391             : }
    1392             : 
    1393             : struct dcerpc_eventlog_OpenEventLogW_state {
    1394             :         struct eventlog_OpenEventLogW orig;
    1395             :         struct eventlog_OpenEventLogW tmp;
    1396             :         TALLOC_CTX *out_mem_ctx;
    1397             : };
    1398             : 
    1399             : static void dcerpc_eventlog_OpenEventLogW_done(struct tevent_req *subreq);
    1400             : 
    1401           0 : struct tevent_req *dcerpc_eventlog_OpenEventLogW_send(TALLOC_CTX *mem_ctx,
    1402             :                                                       struct tevent_context *ev,
    1403             :                                                       struct dcerpc_binding_handle *h,
    1404             :                                                       struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
    1405             :                                                       struct lsa_String *_logname /* [in] [ref] */,
    1406             :                                                       struct lsa_String *_servername /* [in] [ref] */,
    1407             :                                                       uint32_t _major_version /* [in]  */,
    1408             :                                                       uint32_t _minor_version /* [in]  */,
    1409             :                                                       struct policy_handle *_handle /* [out] [ref] */)
    1410             : {
    1411             :         struct tevent_req *req;
    1412             :         struct dcerpc_eventlog_OpenEventLogW_state *state;
    1413             :         struct tevent_req *subreq;
    1414             : 
    1415           0 :         req = tevent_req_create(mem_ctx, &state,
    1416             :                                 struct dcerpc_eventlog_OpenEventLogW_state);
    1417           0 :         if (req == NULL) {
    1418           0 :                 return NULL;
    1419             :         }
    1420           0 :         state->out_mem_ctx = NULL;
    1421             : 
    1422             :         /* In parameters */
    1423           0 :         state->orig.in.unknown0 = _unknown0;
    1424           0 :         state->orig.in.logname = _logname;
    1425           0 :         state->orig.in.servername = _servername;
    1426           0 :         state->orig.in.major_version = _major_version;
    1427           0 :         state->orig.in.minor_version = _minor_version;
    1428             : 
    1429             :         /* Out parameters */
    1430           0 :         state->orig.out.handle = _handle;
    1431             : 
    1432             :         /* Result */
    1433           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1434             : 
    1435           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1436             :                              "dcerpc_eventlog_OpenEventLogW_out_memory");
    1437           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1438           0 :                 return tevent_req_post(req, ev);
    1439             :         }
    1440             : 
    1441             :         /* make a temporary copy, that we pass to the dispatch function */
    1442           0 :         state->tmp = state->orig;
    1443             : 
    1444           0 :         subreq = dcerpc_eventlog_OpenEventLogW_r_send(state, ev, h, &state->tmp);
    1445           0 :         if (tevent_req_nomem(subreq, req)) {
    1446           0 :                 return tevent_req_post(req, ev);
    1447             :         }
    1448           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_OpenEventLogW_done, req);
    1449           0 :         return req;
    1450             : }
    1451             : 
    1452           0 : static void dcerpc_eventlog_OpenEventLogW_done(struct tevent_req *subreq)
    1453             : {
    1454           0 :         struct tevent_req *req = tevent_req_callback_data(
    1455             :                 subreq, struct tevent_req);
    1456           0 :         struct dcerpc_eventlog_OpenEventLogW_state *state = tevent_req_data(
    1457             :                 req, struct dcerpc_eventlog_OpenEventLogW_state);
    1458             :         NTSTATUS status;
    1459             :         TALLOC_CTX *mem_ctx;
    1460             : 
    1461           0 :         if (state->out_mem_ctx) {
    1462           0 :                 mem_ctx = state->out_mem_ctx;
    1463             :         } else {
    1464           0 :                 mem_ctx = state;
    1465             :         }
    1466             : 
    1467           0 :         status = dcerpc_eventlog_OpenEventLogW_r_recv(subreq, mem_ctx);
    1468           0 :         TALLOC_FREE(subreq);
    1469           0 :         if (tevent_req_nterror(req, status)) {
    1470           0 :                 return;
    1471             :         }
    1472             : 
    1473             :         /* Copy out parameters */
    1474           0 :         *state->orig.out.handle = *state->tmp.out.handle;
    1475             : 
    1476             :         /* Copy result */
    1477           0 :         state->orig.out.result = state->tmp.out.result;
    1478             : 
    1479             :         /* Reset temporary structure */
    1480           0 :         NDR_ZERO_STRUCT(state->tmp);
    1481             : 
    1482           0 :         tevent_req_done(req);
    1483             : }
    1484             : 
    1485           0 : NTSTATUS dcerpc_eventlog_OpenEventLogW_recv(struct tevent_req *req,
    1486             :                                             TALLOC_CTX *mem_ctx,
    1487             :                                             NTSTATUS *result)
    1488             : {
    1489           0 :         struct dcerpc_eventlog_OpenEventLogW_state *state = tevent_req_data(
    1490             :                 req, struct dcerpc_eventlog_OpenEventLogW_state);
    1491             :         NTSTATUS status;
    1492             : 
    1493           0 :         if (tevent_req_is_nterror(req, &status)) {
    1494           0 :                 tevent_req_received(req);
    1495           0 :                 return status;
    1496             :         }
    1497             : 
    1498             :         /* Steal possible out parameters to the callers context */
    1499           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1500             : 
    1501             :         /* Return result */
    1502           0 :         *result = state->orig.out.result;
    1503             : 
    1504           0 :         tevent_req_received(req);
    1505           0 :         return NT_STATUS_OK;
    1506             : }
    1507             : 
    1508           0 : NTSTATUS dcerpc_eventlog_OpenEventLogW(struct dcerpc_binding_handle *h,
    1509             :                                        TALLOC_CTX *mem_ctx,
    1510             :                                        struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
    1511             :                                        struct lsa_String *_logname /* [in] [ref] */,
    1512             :                                        struct lsa_String *_servername /* [in] [ref] */,
    1513             :                                        uint32_t _major_version /* [in]  */,
    1514             :                                        uint32_t _minor_version /* [in]  */,
    1515             :                                        struct policy_handle *_handle /* [out] [ref] */,
    1516             :                                        NTSTATUS *result)
    1517             : {
    1518             :         struct eventlog_OpenEventLogW r;
    1519             :         NTSTATUS status;
    1520             : 
    1521             :         /* In parameters */
    1522           0 :         r.in.unknown0 = _unknown0;
    1523           0 :         r.in.logname = _logname;
    1524           0 :         r.in.servername = _servername;
    1525           0 :         r.in.major_version = _major_version;
    1526           0 :         r.in.minor_version = _minor_version;
    1527             : 
    1528             :         /* Out parameters */
    1529           0 :         r.out.handle = _handle;
    1530             : 
    1531             :         /* Result */
    1532           0 :         NDR_ZERO_STRUCT(r.out.result);
    1533             : 
    1534           0 :         status = dcerpc_eventlog_OpenEventLogW_r(h, mem_ctx, &r);
    1535           0 :         if (!NT_STATUS_IS_OK(status)) {
    1536           0 :                 return status;
    1537             :         }
    1538             : 
    1539             :         /* Return variables */
    1540           0 :         *_handle = *r.out.handle;
    1541             : 
    1542             :         /* Return result */
    1543           0 :         *result = r.out.result;
    1544             : 
    1545           0 :         return NT_STATUS_OK;
    1546             : }
    1547             : 
    1548             : struct dcerpc_eventlog_RegisterEventSourceW_r_state {
    1549             :         TALLOC_CTX *out_mem_ctx;
    1550             : };
    1551             : 
    1552             : static void dcerpc_eventlog_RegisterEventSourceW_r_done(struct tevent_req *subreq);
    1553             : 
    1554           0 : struct tevent_req *dcerpc_eventlog_RegisterEventSourceW_r_send(TALLOC_CTX *mem_ctx,
    1555             :         struct tevent_context *ev,
    1556             :         struct dcerpc_binding_handle *h,
    1557             :         struct eventlog_RegisterEventSourceW *r)
    1558             : {
    1559             :         struct tevent_req *req;
    1560             :         struct dcerpc_eventlog_RegisterEventSourceW_r_state *state;
    1561             :         struct tevent_req *subreq;
    1562             : 
    1563           0 :         req = tevent_req_create(mem_ctx, &state,
    1564             :                                 struct dcerpc_eventlog_RegisterEventSourceW_r_state);
    1565           0 :         if (req == NULL) {
    1566           0 :                 return NULL;
    1567             :         }
    1568             : 
    1569           0 :         state->out_mem_ctx = talloc_new(state);
    1570           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1571           0 :                 return tevent_req_post(req, ev);
    1572             :         }
    1573             : 
    1574           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1575             :                         NULL, &ndr_table_eventlog,
    1576           0 :                         NDR_EVENTLOG_REGISTEREVENTSOURCEW, state->out_mem_ctx, r);
    1577           0 :         if (tevent_req_nomem(subreq, req)) {
    1578           0 :                 return tevent_req_post(req, ev);
    1579             :         }
    1580           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_RegisterEventSourceW_r_done, req);
    1581             : 
    1582           0 :         return req;
    1583             : }
    1584             : 
    1585           0 : static void dcerpc_eventlog_RegisterEventSourceW_r_done(struct tevent_req *subreq)
    1586             : {
    1587           0 :         struct tevent_req *req =
    1588           0 :                 tevent_req_callback_data(subreq,
    1589             :                 struct tevent_req);
    1590             :         NTSTATUS status;
    1591             : 
    1592           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1593           0 :         TALLOC_FREE(subreq);
    1594           0 :         if (tevent_req_nterror(req, status)) {
    1595           0 :                 return;
    1596             :         }
    1597             : 
    1598           0 :         tevent_req_done(req);
    1599             : }
    1600             : 
    1601           0 : NTSTATUS dcerpc_eventlog_RegisterEventSourceW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1602             : {
    1603           0 :         struct dcerpc_eventlog_RegisterEventSourceW_r_state *state =
    1604           0 :                 tevent_req_data(req,
    1605             :                 struct dcerpc_eventlog_RegisterEventSourceW_r_state);
    1606             :         NTSTATUS status;
    1607             : 
    1608           0 :         if (tevent_req_is_nterror(req, &status)) {
    1609           0 :                 tevent_req_received(req);
    1610           0 :                 return status;
    1611             :         }
    1612             : 
    1613           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1614             : 
    1615           0 :         tevent_req_received(req);
    1616           0 :         return NT_STATUS_OK;
    1617             : }
    1618             : 
    1619           0 : NTSTATUS dcerpc_eventlog_RegisterEventSourceW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_RegisterEventSourceW *r)
    1620             : {
    1621             :         NTSTATUS status;
    1622             : 
    1623           0 :         status = dcerpc_binding_handle_call(h,
    1624             :                         NULL, &ndr_table_eventlog,
    1625             :                         NDR_EVENTLOG_REGISTEREVENTSOURCEW, mem_ctx, r);
    1626             : 
    1627           0 :         return status;
    1628             : }
    1629             : 
    1630             : struct dcerpc_eventlog_RegisterEventSourceW_state {
    1631             :         struct eventlog_RegisterEventSourceW orig;
    1632             :         struct eventlog_RegisterEventSourceW tmp;
    1633             :         TALLOC_CTX *out_mem_ctx;
    1634             : };
    1635             : 
    1636             : static void dcerpc_eventlog_RegisterEventSourceW_done(struct tevent_req *subreq);
    1637             : 
    1638           0 : struct tevent_req *dcerpc_eventlog_RegisterEventSourceW_send(TALLOC_CTX *mem_ctx,
    1639             :                                                              struct tevent_context *ev,
    1640             :                                                              struct dcerpc_binding_handle *h,
    1641             :                                                              struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
    1642             :                                                              struct lsa_String *_module_name /* [in] [ref] */,
    1643             :                                                              struct lsa_String *_reg_module_name /* [in] [ref] */,
    1644             :                                                              uint32_t _major_version /* [in]  */,
    1645             :                                                              uint32_t _minor_version /* [in]  */,
    1646             :                                                              struct policy_handle *_log_handle /* [out] [ref] */)
    1647             : {
    1648             :         struct tevent_req *req;
    1649             :         struct dcerpc_eventlog_RegisterEventSourceW_state *state;
    1650             :         struct tevent_req *subreq;
    1651             : 
    1652           0 :         req = tevent_req_create(mem_ctx, &state,
    1653             :                                 struct dcerpc_eventlog_RegisterEventSourceW_state);
    1654           0 :         if (req == NULL) {
    1655           0 :                 return NULL;
    1656             :         }
    1657           0 :         state->out_mem_ctx = NULL;
    1658             : 
    1659             :         /* In parameters */
    1660           0 :         state->orig.in.unknown0 = _unknown0;
    1661           0 :         state->orig.in.module_name = _module_name;
    1662           0 :         state->orig.in.reg_module_name = _reg_module_name;
    1663           0 :         state->orig.in.major_version = _major_version;
    1664           0 :         state->orig.in.minor_version = _minor_version;
    1665             : 
    1666             :         /* Out parameters */
    1667           0 :         state->orig.out.log_handle = _log_handle;
    1668             : 
    1669             :         /* Result */
    1670           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1671             : 
    1672           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1673             :                              "dcerpc_eventlog_RegisterEventSourceW_out_memory");
    1674           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1675           0 :                 return tevent_req_post(req, ev);
    1676             :         }
    1677             : 
    1678             :         /* make a temporary copy, that we pass to the dispatch function */
    1679           0 :         state->tmp = state->orig;
    1680             : 
    1681           0 :         subreq = dcerpc_eventlog_RegisterEventSourceW_r_send(state, ev, h, &state->tmp);
    1682           0 :         if (tevent_req_nomem(subreq, req)) {
    1683           0 :                 return tevent_req_post(req, ev);
    1684             :         }
    1685           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_RegisterEventSourceW_done, req);
    1686           0 :         return req;
    1687             : }
    1688             : 
    1689           0 : static void dcerpc_eventlog_RegisterEventSourceW_done(struct tevent_req *subreq)
    1690             : {
    1691           0 :         struct tevent_req *req = tevent_req_callback_data(
    1692             :                 subreq, struct tevent_req);
    1693           0 :         struct dcerpc_eventlog_RegisterEventSourceW_state *state = tevent_req_data(
    1694             :                 req, struct dcerpc_eventlog_RegisterEventSourceW_state);
    1695             :         NTSTATUS status;
    1696             :         TALLOC_CTX *mem_ctx;
    1697             : 
    1698           0 :         if (state->out_mem_ctx) {
    1699           0 :                 mem_ctx = state->out_mem_ctx;
    1700             :         } else {
    1701           0 :                 mem_ctx = state;
    1702             :         }
    1703             : 
    1704           0 :         status = dcerpc_eventlog_RegisterEventSourceW_r_recv(subreq, mem_ctx);
    1705           0 :         TALLOC_FREE(subreq);
    1706           0 :         if (tevent_req_nterror(req, status)) {
    1707           0 :                 return;
    1708             :         }
    1709             : 
    1710             :         /* Copy out parameters */
    1711           0 :         *state->orig.out.log_handle = *state->tmp.out.log_handle;
    1712             : 
    1713             :         /* Copy result */
    1714           0 :         state->orig.out.result = state->tmp.out.result;
    1715             : 
    1716             :         /* Reset temporary structure */
    1717           0 :         NDR_ZERO_STRUCT(state->tmp);
    1718             : 
    1719           0 :         tevent_req_done(req);
    1720             : }
    1721             : 
    1722           0 : NTSTATUS dcerpc_eventlog_RegisterEventSourceW_recv(struct tevent_req *req,
    1723             :                                                    TALLOC_CTX *mem_ctx,
    1724             :                                                    NTSTATUS *result)
    1725             : {
    1726           0 :         struct dcerpc_eventlog_RegisterEventSourceW_state *state = tevent_req_data(
    1727             :                 req, struct dcerpc_eventlog_RegisterEventSourceW_state);
    1728             :         NTSTATUS status;
    1729             : 
    1730           0 :         if (tevent_req_is_nterror(req, &status)) {
    1731           0 :                 tevent_req_received(req);
    1732           0 :                 return status;
    1733             :         }
    1734             : 
    1735             :         /* Steal possible out parameters to the callers context */
    1736           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1737             : 
    1738             :         /* Return result */
    1739           0 :         *result = state->orig.out.result;
    1740             : 
    1741           0 :         tevent_req_received(req);
    1742           0 :         return NT_STATUS_OK;
    1743             : }
    1744             : 
    1745           0 : NTSTATUS dcerpc_eventlog_RegisterEventSourceW(struct dcerpc_binding_handle *h,
    1746             :                                               TALLOC_CTX *mem_ctx,
    1747             :                                               struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
    1748             :                                               struct lsa_String *_module_name /* [in] [ref] */,
    1749             :                                               struct lsa_String *_reg_module_name /* [in] [ref] */,
    1750             :                                               uint32_t _major_version /* [in]  */,
    1751             :                                               uint32_t _minor_version /* [in]  */,
    1752             :                                               struct policy_handle *_log_handle /* [out] [ref] */,
    1753             :                                               NTSTATUS *result)
    1754             : {
    1755             :         struct eventlog_RegisterEventSourceW r;
    1756             :         NTSTATUS status;
    1757             : 
    1758             :         /* In parameters */
    1759           0 :         r.in.unknown0 = _unknown0;
    1760           0 :         r.in.module_name = _module_name;
    1761           0 :         r.in.reg_module_name = _reg_module_name;
    1762           0 :         r.in.major_version = _major_version;
    1763           0 :         r.in.minor_version = _minor_version;
    1764             : 
    1765             :         /* Out parameters */
    1766           0 :         r.out.log_handle = _log_handle;
    1767             : 
    1768             :         /* Result */
    1769           0 :         NDR_ZERO_STRUCT(r.out.result);
    1770             : 
    1771           0 :         status = dcerpc_eventlog_RegisterEventSourceW_r(h, mem_ctx, &r);
    1772           0 :         if (!NT_STATUS_IS_OK(status)) {
    1773           0 :                 return status;
    1774             :         }
    1775             : 
    1776             :         /* Return variables */
    1777           0 :         *_log_handle = *r.out.log_handle;
    1778             : 
    1779             :         /* Return result */
    1780           0 :         *result = r.out.result;
    1781             : 
    1782           0 :         return NT_STATUS_OK;
    1783             : }
    1784             : 
    1785             : struct dcerpc_eventlog_OpenBackupEventLogW_r_state {
    1786             :         TALLOC_CTX *out_mem_ctx;
    1787             : };
    1788             : 
    1789             : static void dcerpc_eventlog_OpenBackupEventLogW_r_done(struct tevent_req *subreq);
    1790             : 
    1791           0 : struct tevent_req *dcerpc_eventlog_OpenBackupEventLogW_r_send(TALLOC_CTX *mem_ctx,
    1792             :         struct tevent_context *ev,
    1793             :         struct dcerpc_binding_handle *h,
    1794             :         struct eventlog_OpenBackupEventLogW *r)
    1795             : {
    1796             :         struct tevent_req *req;
    1797             :         struct dcerpc_eventlog_OpenBackupEventLogW_r_state *state;
    1798             :         struct tevent_req *subreq;
    1799             : 
    1800           0 :         req = tevent_req_create(mem_ctx, &state,
    1801             :                                 struct dcerpc_eventlog_OpenBackupEventLogW_r_state);
    1802           0 :         if (req == NULL) {
    1803           0 :                 return NULL;
    1804             :         }
    1805             : 
    1806           0 :         state->out_mem_ctx = talloc_new(state);
    1807           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1808           0 :                 return tevent_req_post(req, ev);
    1809             :         }
    1810             : 
    1811           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1812             :                         NULL, &ndr_table_eventlog,
    1813           0 :                         NDR_EVENTLOG_OPENBACKUPEVENTLOGW, state->out_mem_ctx, r);
    1814           0 :         if (tevent_req_nomem(subreq, req)) {
    1815           0 :                 return tevent_req_post(req, ev);
    1816             :         }
    1817           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_OpenBackupEventLogW_r_done, req);
    1818             : 
    1819           0 :         return req;
    1820             : }
    1821             : 
    1822           0 : static void dcerpc_eventlog_OpenBackupEventLogW_r_done(struct tevent_req *subreq)
    1823             : {
    1824           0 :         struct tevent_req *req =
    1825           0 :                 tevent_req_callback_data(subreq,
    1826             :                 struct tevent_req);
    1827             :         NTSTATUS status;
    1828             : 
    1829           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1830           0 :         TALLOC_FREE(subreq);
    1831           0 :         if (tevent_req_nterror(req, status)) {
    1832           0 :                 return;
    1833             :         }
    1834             : 
    1835           0 :         tevent_req_done(req);
    1836             : }
    1837             : 
    1838           0 : NTSTATUS dcerpc_eventlog_OpenBackupEventLogW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1839             : {
    1840           0 :         struct dcerpc_eventlog_OpenBackupEventLogW_r_state *state =
    1841           0 :                 tevent_req_data(req,
    1842             :                 struct dcerpc_eventlog_OpenBackupEventLogW_r_state);
    1843             :         NTSTATUS status;
    1844             : 
    1845           0 :         if (tevent_req_is_nterror(req, &status)) {
    1846           0 :                 tevent_req_received(req);
    1847           0 :                 return status;
    1848             :         }
    1849             : 
    1850           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1851             : 
    1852           0 :         tevent_req_received(req);
    1853           0 :         return NT_STATUS_OK;
    1854             : }
    1855             : 
    1856           0 : NTSTATUS dcerpc_eventlog_OpenBackupEventLogW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_OpenBackupEventLogW *r)
    1857             : {
    1858             :         NTSTATUS status;
    1859             : 
    1860           0 :         status = dcerpc_binding_handle_call(h,
    1861             :                         NULL, &ndr_table_eventlog,
    1862             :                         NDR_EVENTLOG_OPENBACKUPEVENTLOGW, mem_ctx, r);
    1863             : 
    1864           0 :         return status;
    1865             : }
    1866             : 
    1867             : struct dcerpc_eventlog_OpenBackupEventLogW_state {
    1868             :         struct eventlog_OpenBackupEventLogW orig;
    1869             :         struct eventlog_OpenBackupEventLogW tmp;
    1870             :         TALLOC_CTX *out_mem_ctx;
    1871             : };
    1872             : 
    1873             : static void dcerpc_eventlog_OpenBackupEventLogW_done(struct tevent_req *subreq);
    1874             : 
    1875           0 : struct tevent_req *dcerpc_eventlog_OpenBackupEventLogW_send(TALLOC_CTX *mem_ctx,
    1876             :                                                             struct tevent_context *ev,
    1877             :                                                             struct dcerpc_binding_handle *h,
    1878             :                                                             struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
    1879             :                                                             struct lsa_String *_backup_logname /* [in] [ref] */,
    1880             :                                                             uint32_t _major_version /* [in]  */,
    1881             :                                                             uint32_t _minor_version /* [in]  */,
    1882             :                                                             struct policy_handle *_handle /* [out] [ref] */)
    1883             : {
    1884             :         struct tevent_req *req;
    1885             :         struct dcerpc_eventlog_OpenBackupEventLogW_state *state;
    1886             :         struct tevent_req *subreq;
    1887             : 
    1888           0 :         req = tevent_req_create(mem_ctx, &state,
    1889             :                                 struct dcerpc_eventlog_OpenBackupEventLogW_state);
    1890           0 :         if (req == NULL) {
    1891           0 :                 return NULL;
    1892             :         }
    1893           0 :         state->out_mem_ctx = NULL;
    1894             : 
    1895             :         /* In parameters */
    1896           0 :         state->orig.in.unknown0 = _unknown0;
    1897           0 :         state->orig.in.backup_logname = _backup_logname;
    1898           0 :         state->orig.in.major_version = _major_version;
    1899           0 :         state->orig.in.minor_version = _minor_version;
    1900             : 
    1901             :         /* Out parameters */
    1902           0 :         state->orig.out.handle = _handle;
    1903             : 
    1904             :         /* Result */
    1905           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1906             : 
    1907           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1908             :                              "dcerpc_eventlog_OpenBackupEventLogW_out_memory");
    1909           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1910           0 :                 return tevent_req_post(req, ev);
    1911             :         }
    1912             : 
    1913             :         /* make a temporary copy, that we pass to the dispatch function */
    1914           0 :         state->tmp = state->orig;
    1915             : 
    1916           0 :         subreq = dcerpc_eventlog_OpenBackupEventLogW_r_send(state, ev, h, &state->tmp);
    1917           0 :         if (tevent_req_nomem(subreq, req)) {
    1918           0 :                 return tevent_req_post(req, ev);
    1919             :         }
    1920           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_OpenBackupEventLogW_done, req);
    1921           0 :         return req;
    1922             : }
    1923             : 
    1924           0 : static void dcerpc_eventlog_OpenBackupEventLogW_done(struct tevent_req *subreq)
    1925             : {
    1926           0 :         struct tevent_req *req = tevent_req_callback_data(
    1927             :                 subreq, struct tevent_req);
    1928           0 :         struct dcerpc_eventlog_OpenBackupEventLogW_state *state = tevent_req_data(
    1929             :                 req, struct dcerpc_eventlog_OpenBackupEventLogW_state);
    1930             :         NTSTATUS status;
    1931             :         TALLOC_CTX *mem_ctx;
    1932             : 
    1933           0 :         if (state->out_mem_ctx) {
    1934           0 :                 mem_ctx = state->out_mem_ctx;
    1935             :         } else {
    1936           0 :                 mem_ctx = state;
    1937             :         }
    1938             : 
    1939           0 :         status = dcerpc_eventlog_OpenBackupEventLogW_r_recv(subreq, mem_ctx);
    1940           0 :         TALLOC_FREE(subreq);
    1941           0 :         if (tevent_req_nterror(req, status)) {
    1942           0 :                 return;
    1943             :         }
    1944             : 
    1945             :         /* Copy out parameters */
    1946           0 :         *state->orig.out.handle = *state->tmp.out.handle;
    1947             : 
    1948             :         /* Copy result */
    1949           0 :         state->orig.out.result = state->tmp.out.result;
    1950             : 
    1951             :         /* Reset temporary structure */
    1952           0 :         NDR_ZERO_STRUCT(state->tmp);
    1953             : 
    1954           0 :         tevent_req_done(req);
    1955             : }
    1956             : 
    1957           0 : NTSTATUS dcerpc_eventlog_OpenBackupEventLogW_recv(struct tevent_req *req,
    1958             :                                                   TALLOC_CTX *mem_ctx,
    1959             :                                                   NTSTATUS *result)
    1960             : {
    1961           0 :         struct dcerpc_eventlog_OpenBackupEventLogW_state *state = tevent_req_data(
    1962             :                 req, struct dcerpc_eventlog_OpenBackupEventLogW_state);
    1963             :         NTSTATUS status;
    1964             : 
    1965           0 :         if (tevent_req_is_nterror(req, &status)) {
    1966           0 :                 tevent_req_received(req);
    1967           0 :                 return status;
    1968             :         }
    1969             : 
    1970             :         /* Steal possible out parameters to the callers context */
    1971           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1972             : 
    1973             :         /* Return result */
    1974           0 :         *result = state->orig.out.result;
    1975             : 
    1976           0 :         tevent_req_received(req);
    1977           0 :         return NT_STATUS_OK;
    1978             : }
    1979             : 
    1980           0 : NTSTATUS dcerpc_eventlog_OpenBackupEventLogW(struct dcerpc_binding_handle *h,
    1981             :                                              TALLOC_CTX *mem_ctx,
    1982             :                                              struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
    1983             :                                              struct lsa_String *_backup_logname /* [in] [ref] */,
    1984             :                                              uint32_t _major_version /* [in]  */,
    1985             :                                              uint32_t _minor_version /* [in]  */,
    1986             :                                              struct policy_handle *_handle /* [out] [ref] */,
    1987             :                                              NTSTATUS *result)
    1988             : {
    1989             :         struct eventlog_OpenBackupEventLogW r;
    1990             :         NTSTATUS status;
    1991             : 
    1992             :         /* In parameters */
    1993           0 :         r.in.unknown0 = _unknown0;
    1994           0 :         r.in.backup_logname = _backup_logname;
    1995           0 :         r.in.major_version = _major_version;
    1996           0 :         r.in.minor_version = _minor_version;
    1997             : 
    1998             :         /* Out parameters */
    1999           0 :         r.out.handle = _handle;
    2000             : 
    2001             :         /* Result */
    2002           0 :         NDR_ZERO_STRUCT(r.out.result);
    2003             : 
    2004           0 :         status = dcerpc_eventlog_OpenBackupEventLogW_r(h, mem_ctx, &r);
    2005           0 :         if (!NT_STATUS_IS_OK(status)) {
    2006           0 :                 return status;
    2007             :         }
    2008             : 
    2009             :         /* Return variables */
    2010           0 :         *_handle = *r.out.handle;
    2011             : 
    2012             :         /* Return result */
    2013           0 :         *result = r.out.result;
    2014             : 
    2015           0 :         return NT_STATUS_OK;
    2016             : }
    2017             : 
    2018             : struct dcerpc_eventlog_ReadEventLogW_r_state {
    2019             :         TALLOC_CTX *out_mem_ctx;
    2020             : };
    2021             : 
    2022             : static void dcerpc_eventlog_ReadEventLogW_r_done(struct tevent_req *subreq);
    2023             : 
    2024           0 : struct tevent_req *dcerpc_eventlog_ReadEventLogW_r_send(TALLOC_CTX *mem_ctx,
    2025             :         struct tevent_context *ev,
    2026             :         struct dcerpc_binding_handle *h,
    2027             :         struct eventlog_ReadEventLogW *r)
    2028             : {
    2029             :         struct tevent_req *req;
    2030             :         struct dcerpc_eventlog_ReadEventLogW_r_state *state;
    2031             :         struct tevent_req *subreq;
    2032             : 
    2033           0 :         req = tevent_req_create(mem_ctx, &state,
    2034             :                                 struct dcerpc_eventlog_ReadEventLogW_r_state);
    2035           0 :         if (req == NULL) {
    2036           0 :                 return NULL;
    2037             :         }
    2038             : 
    2039           0 :         state->out_mem_ctx = talloc_new(state);
    2040           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2041           0 :                 return tevent_req_post(req, ev);
    2042             :         }
    2043             : 
    2044           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2045             :                         NULL, &ndr_table_eventlog,
    2046           0 :                         NDR_EVENTLOG_READEVENTLOGW, state->out_mem_ctx, r);
    2047           0 :         if (tevent_req_nomem(subreq, req)) {
    2048           0 :                 return tevent_req_post(req, ev);
    2049             :         }
    2050           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_ReadEventLogW_r_done, req);
    2051             : 
    2052           0 :         return req;
    2053             : }
    2054             : 
    2055           0 : static void dcerpc_eventlog_ReadEventLogW_r_done(struct tevent_req *subreq)
    2056             : {
    2057           0 :         struct tevent_req *req =
    2058           0 :                 tevent_req_callback_data(subreq,
    2059             :                 struct tevent_req);
    2060             :         NTSTATUS status;
    2061             : 
    2062           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2063           0 :         TALLOC_FREE(subreq);
    2064           0 :         if (tevent_req_nterror(req, status)) {
    2065           0 :                 return;
    2066             :         }
    2067             : 
    2068           0 :         tevent_req_done(req);
    2069             : }
    2070             : 
    2071           0 : NTSTATUS dcerpc_eventlog_ReadEventLogW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2072             : {
    2073           0 :         struct dcerpc_eventlog_ReadEventLogW_r_state *state =
    2074           0 :                 tevent_req_data(req,
    2075             :                 struct dcerpc_eventlog_ReadEventLogW_r_state);
    2076             :         NTSTATUS status;
    2077             : 
    2078           0 :         if (tevent_req_is_nterror(req, &status)) {
    2079           0 :                 tevent_req_received(req);
    2080           0 :                 return status;
    2081             :         }
    2082             : 
    2083           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2084             : 
    2085           0 :         tevent_req_received(req);
    2086           0 :         return NT_STATUS_OK;
    2087             : }
    2088             : 
    2089           4 : NTSTATUS dcerpc_eventlog_ReadEventLogW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_ReadEventLogW *r)
    2090             : {
    2091             :         NTSTATUS status;
    2092             : 
    2093           4 :         status = dcerpc_binding_handle_call(h,
    2094             :                         NULL, &ndr_table_eventlog,
    2095             :                         NDR_EVENTLOG_READEVENTLOGW, mem_ctx, r);
    2096             : 
    2097           4 :         return status;
    2098             : }
    2099             : 
    2100             : struct dcerpc_eventlog_ReadEventLogW_state {
    2101             :         struct eventlog_ReadEventLogW orig;
    2102             :         struct eventlog_ReadEventLogW tmp;
    2103             :         TALLOC_CTX *out_mem_ctx;
    2104             : };
    2105             : 
    2106             : static void dcerpc_eventlog_ReadEventLogW_done(struct tevent_req *subreq);
    2107             : 
    2108           0 : struct tevent_req *dcerpc_eventlog_ReadEventLogW_send(TALLOC_CTX *mem_ctx,
    2109             :                                                       struct tevent_context *ev,
    2110             :                                                       struct dcerpc_binding_handle *h,
    2111             :                                                       struct policy_handle *_handle /* [in] [ref] */,
    2112             :                                                       uint32_t _flags /* [in]  */,
    2113             :                                                       uint32_t _offset /* [in]  */,
    2114             :                                                       uint32_t _number_of_bytes /* [in] [range(0,0x7FFFF)] */,
    2115             :                                                       uint8_t *_data /* [out] [ref,size_is(number_of_bytes)] */,
    2116             :                                                       uint32_t *_sent_size /* [out] [ref] */,
    2117             :                                                       uint32_t *_real_size /* [out] [ref] */)
    2118             : {
    2119             :         struct tevent_req *req;
    2120             :         struct dcerpc_eventlog_ReadEventLogW_state *state;
    2121             :         struct tevent_req *subreq;
    2122             : 
    2123           0 :         req = tevent_req_create(mem_ctx, &state,
    2124             :                                 struct dcerpc_eventlog_ReadEventLogW_state);
    2125           0 :         if (req == NULL) {
    2126           0 :                 return NULL;
    2127             :         }
    2128           0 :         state->out_mem_ctx = NULL;
    2129             : 
    2130             :         /* In parameters */
    2131           0 :         state->orig.in.handle = _handle;
    2132           0 :         state->orig.in.flags = _flags;
    2133           0 :         state->orig.in.offset = _offset;
    2134           0 :         state->orig.in.number_of_bytes = _number_of_bytes;
    2135             : 
    2136             :         /* Out parameters */
    2137           0 :         state->orig.out.data = _data;
    2138           0 :         state->orig.out.sent_size = _sent_size;
    2139           0 :         state->orig.out.real_size = _real_size;
    2140             : 
    2141             :         /* Result */
    2142           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2143             : 
    2144           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2145             :                              "dcerpc_eventlog_ReadEventLogW_out_memory");
    2146           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2147           0 :                 return tevent_req_post(req, ev);
    2148             :         }
    2149             : 
    2150             :         /* make a temporary copy, that we pass to the dispatch function */
    2151           0 :         state->tmp = state->orig;
    2152             : 
    2153           0 :         subreq = dcerpc_eventlog_ReadEventLogW_r_send(state, ev, h, &state->tmp);
    2154           0 :         if (tevent_req_nomem(subreq, req)) {
    2155           0 :                 return tevent_req_post(req, ev);
    2156             :         }
    2157           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_ReadEventLogW_done, req);
    2158           0 :         return req;
    2159             : }
    2160             : 
    2161           0 : static void dcerpc_eventlog_ReadEventLogW_done(struct tevent_req *subreq)
    2162             : {
    2163           0 :         struct tevent_req *req = tevent_req_callback_data(
    2164             :                 subreq, struct tevent_req);
    2165           0 :         struct dcerpc_eventlog_ReadEventLogW_state *state = tevent_req_data(
    2166             :                 req, struct dcerpc_eventlog_ReadEventLogW_state);
    2167             :         NTSTATUS status;
    2168             :         TALLOC_CTX *mem_ctx;
    2169             : 
    2170           0 :         if (state->out_mem_ctx) {
    2171           0 :                 mem_ctx = state->out_mem_ctx;
    2172             :         } else {
    2173           0 :                 mem_ctx = state;
    2174             :         }
    2175             : 
    2176           0 :         status = dcerpc_eventlog_ReadEventLogW_r_recv(subreq, mem_ctx);
    2177           0 :         TALLOC_FREE(subreq);
    2178           0 :         if (tevent_req_nterror(req, status)) {
    2179           0 :                 return;
    2180             :         }
    2181             : 
    2182             :         /* Copy out parameters */
    2183             :         {
    2184             :                 size_t _copy_len_data;
    2185           0 :                 _copy_len_data = state->tmp.in.number_of_bytes;
    2186           0 :                 if (state->orig.out.data != state->tmp.out.data) {
    2187           0 :                         memcpy(state->orig.out.data, state->tmp.out.data, _copy_len_data * sizeof(*state->orig.out.data));
    2188             :                 }
    2189             :         }
    2190           0 :         *state->orig.out.sent_size = *state->tmp.out.sent_size;
    2191           0 :         *state->orig.out.real_size = *state->tmp.out.real_size;
    2192             : 
    2193             :         /* Copy result */
    2194           0 :         state->orig.out.result = state->tmp.out.result;
    2195             : 
    2196             :         /* Reset temporary structure */
    2197           0 :         NDR_ZERO_STRUCT(state->tmp);
    2198             : 
    2199           0 :         tevent_req_done(req);
    2200             : }
    2201             : 
    2202           0 : NTSTATUS dcerpc_eventlog_ReadEventLogW_recv(struct tevent_req *req,
    2203             :                                             TALLOC_CTX *mem_ctx,
    2204             :                                             NTSTATUS *result)
    2205             : {
    2206           0 :         struct dcerpc_eventlog_ReadEventLogW_state *state = tevent_req_data(
    2207             :                 req, struct dcerpc_eventlog_ReadEventLogW_state);
    2208             :         NTSTATUS status;
    2209             : 
    2210           0 :         if (tevent_req_is_nterror(req, &status)) {
    2211           0 :                 tevent_req_received(req);
    2212           0 :                 return status;
    2213             :         }
    2214             : 
    2215             :         /* Steal possible out parameters to the callers context */
    2216           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2217             : 
    2218             :         /* Return result */
    2219           0 :         *result = state->orig.out.result;
    2220             : 
    2221           0 :         tevent_req_received(req);
    2222           0 :         return NT_STATUS_OK;
    2223             : }
    2224             : 
    2225           0 : NTSTATUS dcerpc_eventlog_ReadEventLogW(struct dcerpc_binding_handle *h,
    2226             :                                        TALLOC_CTX *mem_ctx,
    2227             :                                        struct policy_handle *_handle /* [in] [ref] */,
    2228             :                                        uint32_t _flags /* [in]  */,
    2229             :                                        uint32_t _offset /* [in]  */,
    2230             :                                        uint32_t _number_of_bytes /* [in] [range(0,0x7FFFF)] */,
    2231             :                                        uint8_t *_data /* [out] [ref,size_is(number_of_bytes)] */,
    2232             :                                        uint32_t *_sent_size /* [out] [ref] */,
    2233             :                                        uint32_t *_real_size /* [out] [ref] */,
    2234             :                                        NTSTATUS *result)
    2235             : {
    2236             :         struct eventlog_ReadEventLogW r;
    2237             :         NTSTATUS status;
    2238             : 
    2239             :         /* In parameters */
    2240           0 :         r.in.handle = _handle;
    2241           0 :         r.in.flags = _flags;
    2242           0 :         r.in.offset = _offset;
    2243           0 :         r.in.number_of_bytes = _number_of_bytes;
    2244             : 
    2245             :         /* Out parameters */
    2246           0 :         r.out.data = _data;
    2247           0 :         r.out.sent_size = _sent_size;
    2248           0 :         r.out.real_size = _real_size;
    2249             : 
    2250             :         /* Result */
    2251           0 :         NDR_ZERO_STRUCT(r.out.result);
    2252             : 
    2253           0 :         status = dcerpc_eventlog_ReadEventLogW_r(h, mem_ctx, &r);
    2254           0 :         if (!NT_STATUS_IS_OK(status)) {
    2255           0 :                 return status;
    2256             :         }
    2257             : 
    2258             :         /* Return variables */
    2259             :         {
    2260             :                 size_t _copy_len_data;
    2261           0 :                 _copy_len_data = r.in.number_of_bytes;
    2262           0 :                 if (_data != r.out.data) {
    2263           0 :                         memcpy(_data, r.out.data, _copy_len_data * sizeof(*_data));
    2264             :                 }
    2265             :         }
    2266           0 :         *_sent_size = *r.out.sent_size;
    2267           0 :         *_real_size = *r.out.real_size;
    2268             : 
    2269             :         /* Return result */
    2270           0 :         *result = r.out.result;
    2271             : 
    2272           0 :         return NT_STATUS_OK;
    2273             : }
    2274             : 
    2275             : struct dcerpc_eventlog_ReportEventW_r_state {
    2276             :         TALLOC_CTX *out_mem_ctx;
    2277             : };
    2278             : 
    2279             : static void dcerpc_eventlog_ReportEventW_r_done(struct tevent_req *subreq);
    2280             : 
    2281           0 : struct tevent_req *dcerpc_eventlog_ReportEventW_r_send(TALLOC_CTX *mem_ctx,
    2282             :         struct tevent_context *ev,
    2283             :         struct dcerpc_binding_handle *h,
    2284             :         struct eventlog_ReportEventW *r)
    2285             : {
    2286             :         struct tevent_req *req;
    2287             :         struct dcerpc_eventlog_ReportEventW_r_state *state;
    2288             :         struct tevent_req *subreq;
    2289             : 
    2290           0 :         req = tevent_req_create(mem_ctx, &state,
    2291             :                                 struct dcerpc_eventlog_ReportEventW_r_state);
    2292           0 :         if (req == NULL) {
    2293           0 :                 return NULL;
    2294             :         }
    2295             : 
    2296           0 :         state->out_mem_ctx = talloc_new(state);
    2297           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2298           0 :                 return tevent_req_post(req, ev);
    2299             :         }
    2300             : 
    2301           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2302             :                         NULL, &ndr_table_eventlog,
    2303           0 :                         NDR_EVENTLOG_REPORTEVENTW, state->out_mem_ctx, r);
    2304           0 :         if (tevent_req_nomem(subreq, req)) {
    2305           0 :                 return tevent_req_post(req, ev);
    2306             :         }
    2307           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_ReportEventW_r_done, req);
    2308             : 
    2309           0 :         return req;
    2310             : }
    2311             : 
    2312           0 : static void dcerpc_eventlog_ReportEventW_r_done(struct tevent_req *subreq)
    2313             : {
    2314           0 :         struct tevent_req *req =
    2315           0 :                 tevent_req_callback_data(subreq,
    2316             :                 struct tevent_req);
    2317             :         NTSTATUS status;
    2318             : 
    2319           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2320           0 :         TALLOC_FREE(subreq);
    2321           0 :         if (tevent_req_nterror(req, status)) {
    2322           0 :                 return;
    2323             :         }
    2324             : 
    2325           0 :         tevent_req_done(req);
    2326             : }
    2327             : 
    2328           0 : NTSTATUS dcerpc_eventlog_ReportEventW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2329             : {
    2330           0 :         struct dcerpc_eventlog_ReportEventW_r_state *state =
    2331           0 :                 tevent_req_data(req,
    2332             :                 struct dcerpc_eventlog_ReportEventW_r_state);
    2333             :         NTSTATUS status;
    2334             : 
    2335           0 :         if (tevent_req_is_nterror(req, &status)) {
    2336           0 :                 tevent_req_received(req);
    2337           0 :                 return status;
    2338             :         }
    2339             : 
    2340           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2341             : 
    2342           0 :         tevent_req_received(req);
    2343           0 :         return NT_STATUS_OK;
    2344             : }
    2345             : 
    2346           2 : NTSTATUS dcerpc_eventlog_ReportEventW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_ReportEventW *r)
    2347             : {
    2348             :         NTSTATUS status;
    2349             : 
    2350           2 :         status = dcerpc_binding_handle_call(h,
    2351             :                         NULL, &ndr_table_eventlog,
    2352             :                         NDR_EVENTLOG_REPORTEVENTW, mem_ctx, r);
    2353             : 
    2354           2 :         return status;
    2355             : }
    2356             : 
    2357             : struct dcerpc_eventlog_ReportEventW_state {
    2358             :         struct eventlog_ReportEventW orig;
    2359             :         struct eventlog_ReportEventW tmp;
    2360             :         TALLOC_CTX *out_mem_ctx;
    2361             : };
    2362             : 
    2363             : static void dcerpc_eventlog_ReportEventW_done(struct tevent_req *subreq);
    2364             : 
    2365           0 : struct tevent_req *dcerpc_eventlog_ReportEventW_send(TALLOC_CTX *mem_ctx,
    2366             :                                                      struct tevent_context *ev,
    2367             :                                                      struct dcerpc_binding_handle *h,
    2368             :                                                      struct policy_handle *_handle /* [in] [ref] */,
    2369             :                                                      time_t _timestamp /* [in]  */,
    2370             :                                                      enum eventlogEventTypes _event_type /* [in]  */,
    2371             :                                                      uint16_t _event_category /* [in]  */,
    2372             :                                                      uint32_t _event_id /* [in]  */,
    2373             :                                                      uint16_t _num_of_strings /* [in] [range(0,256)] */,
    2374             :                                                      uint32_t _data_size /* [in] [range(0,0x3FFFF)] */,
    2375             :                                                      struct lsa_String *_servername /* [in] [ref] */,
    2376             :                                                      struct dom_sid *_user_sid /* [in] [unique] */,
    2377             :                                                      struct lsa_String **_strings /* [in] [size_is(num_of_strings),unique] */,
    2378             :                                                      uint8_t *_data /* [in] [size_is(data_size),unique] */,
    2379             :                                                      uint16_t _flags /* [in]  */,
    2380             :                                                      uint32_t *_record_number /* [in,out] [unique] */,
    2381             :                                                      time_t *_time_written /* [in,out] [unique] */)
    2382             : {
    2383             :         struct tevent_req *req;
    2384             :         struct dcerpc_eventlog_ReportEventW_state *state;
    2385             :         struct tevent_req *subreq;
    2386             : 
    2387           0 :         req = tevent_req_create(mem_ctx, &state,
    2388             :                                 struct dcerpc_eventlog_ReportEventW_state);
    2389           0 :         if (req == NULL) {
    2390           0 :                 return NULL;
    2391             :         }
    2392           0 :         state->out_mem_ctx = NULL;
    2393             : 
    2394             :         /* In parameters */
    2395           0 :         state->orig.in.handle = _handle;
    2396           0 :         state->orig.in.timestamp = _timestamp;
    2397           0 :         state->orig.in.event_type = _event_type;
    2398           0 :         state->orig.in.event_category = _event_category;
    2399           0 :         state->orig.in.event_id = _event_id;
    2400           0 :         state->orig.in.num_of_strings = _num_of_strings;
    2401           0 :         state->orig.in.data_size = _data_size;
    2402           0 :         state->orig.in.servername = _servername;
    2403           0 :         state->orig.in.user_sid = _user_sid;
    2404           0 :         state->orig.in.strings = _strings;
    2405           0 :         state->orig.in.data = _data;
    2406           0 :         state->orig.in.flags = _flags;
    2407           0 :         state->orig.in.record_number = _record_number;
    2408           0 :         state->orig.in.time_written = _time_written;
    2409             : 
    2410             :         /* Out parameters */
    2411           0 :         state->orig.out.record_number = _record_number;
    2412           0 :         state->orig.out.time_written = _time_written;
    2413             : 
    2414             :         /* Result */
    2415           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2416             : 
    2417           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2418             :                              "dcerpc_eventlog_ReportEventW_out_memory");
    2419           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2420           0 :                 return tevent_req_post(req, ev);
    2421             :         }
    2422             : 
    2423             :         /* make a temporary copy, that we pass to the dispatch function */
    2424           0 :         state->tmp = state->orig;
    2425             : 
    2426           0 :         subreq = dcerpc_eventlog_ReportEventW_r_send(state, ev, h, &state->tmp);
    2427           0 :         if (tevent_req_nomem(subreq, req)) {
    2428           0 :                 return tevent_req_post(req, ev);
    2429             :         }
    2430           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_ReportEventW_done, req);
    2431           0 :         return req;
    2432             : }
    2433             : 
    2434           0 : static void dcerpc_eventlog_ReportEventW_done(struct tevent_req *subreq)
    2435             : {
    2436           0 :         struct tevent_req *req = tevent_req_callback_data(
    2437             :                 subreq, struct tevent_req);
    2438           0 :         struct dcerpc_eventlog_ReportEventW_state *state = tevent_req_data(
    2439             :                 req, struct dcerpc_eventlog_ReportEventW_state);
    2440             :         NTSTATUS status;
    2441             :         TALLOC_CTX *mem_ctx;
    2442             : 
    2443           0 :         if (state->out_mem_ctx) {
    2444           0 :                 mem_ctx = state->out_mem_ctx;
    2445             :         } else {
    2446           0 :                 mem_ctx = state;
    2447             :         }
    2448             : 
    2449           0 :         status = dcerpc_eventlog_ReportEventW_r_recv(subreq, mem_ctx);
    2450           0 :         TALLOC_FREE(subreq);
    2451           0 :         if (tevent_req_nterror(req, status)) {
    2452           0 :                 return;
    2453             :         }
    2454             : 
    2455             :         /* Copy out parameters */
    2456           0 :         if (state->orig.out.record_number && state->tmp.out.record_number) {
    2457           0 :                 *state->orig.out.record_number = *state->tmp.out.record_number;
    2458             :         }
    2459           0 :         if (state->orig.out.time_written && state->tmp.out.time_written) {
    2460           0 :                 *state->orig.out.time_written = *state->tmp.out.time_written;
    2461             :         }
    2462             : 
    2463             :         /* Copy result */
    2464           0 :         state->orig.out.result = state->tmp.out.result;
    2465             : 
    2466             :         /* Reset temporary structure */
    2467           0 :         NDR_ZERO_STRUCT(state->tmp);
    2468             : 
    2469           0 :         tevent_req_done(req);
    2470             : }
    2471             : 
    2472           0 : NTSTATUS dcerpc_eventlog_ReportEventW_recv(struct tevent_req *req,
    2473             :                                            TALLOC_CTX *mem_ctx,
    2474             :                                            NTSTATUS *result)
    2475             : {
    2476           0 :         struct dcerpc_eventlog_ReportEventW_state *state = tevent_req_data(
    2477             :                 req, struct dcerpc_eventlog_ReportEventW_state);
    2478             :         NTSTATUS status;
    2479             : 
    2480           0 :         if (tevent_req_is_nterror(req, &status)) {
    2481           0 :                 tevent_req_received(req);
    2482           0 :                 return status;
    2483             :         }
    2484             : 
    2485             :         /* Steal possible out parameters to the callers context */
    2486           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2487             : 
    2488             :         /* Return result */
    2489           0 :         *result = state->orig.out.result;
    2490             : 
    2491           0 :         tevent_req_received(req);
    2492           0 :         return NT_STATUS_OK;
    2493             : }
    2494             : 
    2495           0 : NTSTATUS dcerpc_eventlog_ReportEventW(struct dcerpc_binding_handle *h,
    2496             :                                       TALLOC_CTX *mem_ctx,
    2497             :                                       struct policy_handle *_handle /* [in] [ref] */,
    2498             :                                       time_t _timestamp /* [in]  */,
    2499             :                                       enum eventlogEventTypes _event_type /* [in]  */,
    2500             :                                       uint16_t _event_category /* [in]  */,
    2501             :                                       uint32_t _event_id /* [in]  */,
    2502             :                                       uint16_t _num_of_strings /* [in] [range(0,256)] */,
    2503             :                                       uint32_t _data_size /* [in] [range(0,0x3FFFF)] */,
    2504             :                                       struct lsa_String *_servername /* [in] [ref] */,
    2505             :                                       struct dom_sid *_user_sid /* [in] [unique] */,
    2506             :                                       struct lsa_String **_strings /* [in] [size_is(num_of_strings),unique] */,
    2507             :                                       uint8_t *_data /* [in] [size_is(data_size),unique] */,
    2508             :                                       uint16_t _flags /* [in]  */,
    2509             :                                       uint32_t *_record_number /* [in,out] [unique] */,
    2510             :                                       time_t *_time_written /* [in,out] [unique] */,
    2511             :                                       NTSTATUS *result)
    2512             : {
    2513             :         struct eventlog_ReportEventW r;
    2514             :         NTSTATUS status;
    2515             : 
    2516             :         /* In parameters */
    2517           0 :         r.in.handle = _handle;
    2518           0 :         r.in.timestamp = _timestamp;
    2519           0 :         r.in.event_type = _event_type;
    2520           0 :         r.in.event_category = _event_category;
    2521           0 :         r.in.event_id = _event_id;
    2522           0 :         r.in.num_of_strings = _num_of_strings;
    2523           0 :         r.in.data_size = _data_size;
    2524           0 :         r.in.servername = _servername;
    2525           0 :         r.in.user_sid = _user_sid;
    2526           0 :         r.in.strings = _strings;
    2527           0 :         r.in.data = _data;
    2528           0 :         r.in.flags = _flags;
    2529           0 :         r.in.record_number = _record_number;
    2530           0 :         r.in.time_written = _time_written;
    2531             : 
    2532             :         /* Out parameters */
    2533           0 :         r.out.record_number = _record_number;
    2534           0 :         r.out.time_written = _time_written;
    2535             : 
    2536             :         /* Result */
    2537           0 :         NDR_ZERO_STRUCT(r.out.result);
    2538             : 
    2539           0 :         status = dcerpc_eventlog_ReportEventW_r(h, mem_ctx, &r);
    2540           0 :         if (!NT_STATUS_IS_OK(status)) {
    2541           0 :                 return status;
    2542             :         }
    2543             : 
    2544             :         /* Return variables */
    2545           0 :         if (_record_number && r.out.record_number) {
    2546           0 :                 *_record_number = *r.out.record_number;
    2547             :         }
    2548           0 :         if (_time_written && r.out.time_written) {
    2549           0 :                 *_time_written = *r.out.time_written;
    2550             :         }
    2551             : 
    2552             :         /* Return result */
    2553           0 :         *result = r.out.result;
    2554             : 
    2555           0 :         return NT_STATUS_OK;
    2556             : }
    2557             : 
    2558             : struct dcerpc_eventlog_GetLogInformation_r_state {
    2559             :         TALLOC_CTX *out_mem_ctx;
    2560             : };
    2561             : 
    2562             : static void dcerpc_eventlog_GetLogInformation_r_done(struct tevent_req *subreq);
    2563             : 
    2564           0 : struct tevent_req *dcerpc_eventlog_GetLogInformation_r_send(TALLOC_CTX *mem_ctx,
    2565             :         struct tevent_context *ev,
    2566             :         struct dcerpc_binding_handle *h,
    2567             :         struct eventlog_GetLogInformation *r)
    2568             : {
    2569             :         struct tevent_req *req;
    2570             :         struct dcerpc_eventlog_GetLogInformation_r_state *state;
    2571             :         struct tevent_req *subreq;
    2572             : 
    2573           0 :         req = tevent_req_create(mem_ctx, &state,
    2574             :                                 struct dcerpc_eventlog_GetLogInformation_r_state);
    2575           0 :         if (req == NULL) {
    2576           0 :                 return NULL;
    2577             :         }
    2578             : 
    2579           0 :         state->out_mem_ctx = talloc_new(state);
    2580           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2581           0 :                 return tevent_req_post(req, ev);
    2582             :         }
    2583             : 
    2584           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2585             :                         NULL, &ndr_table_eventlog,
    2586           0 :                         NDR_EVENTLOG_GETLOGINFORMATION, state->out_mem_ctx, r);
    2587           0 :         if (tevent_req_nomem(subreq, req)) {
    2588           0 :                 return tevent_req_post(req, ev);
    2589             :         }
    2590           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_GetLogInformation_r_done, req);
    2591             : 
    2592           0 :         return req;
    2593             : }
    2594             : 
    2595           0 : static void dcerpc_eventlog_GetLogInformation_r_done(struct tevent_req *subreq)
    2596             : {
    2597           0 :         struct tevent_req *req =
    2598           0 :                 tevent_req_callback_data(subreq,
    2599             :                 struct tevent_req);
    2600             :         NTSTATUS status;
    2601             : 
    2602           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2603           0 :         TALLOC_FREE(subreq);
    2604           0 :         if (tevent_req_nterror(req, status)) {
    2605           0 :                 return;
    2606             :         }
    2607             : 
    2608           0 :         tevent_req_done(req);
    2609             : }
    2610             : 
    2611           0 : NTSTATUS dcerpc_eventlog_GetLogInformation_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2612             : {
    2613           0 :         struct dcerpc_eventlog_GetLogInformation_r_state *state =
    2614           0 :                 tevent_req_data(req,
    2615             :                 struct dcerpc_eventlog_GetLogInformation_r_state);
    2616             :         NTSTATUS status;
    2617             : 
    2618           0 :         if (tevent_req_is_nterror(req, &status)) {
    2619           0 :                 tevent_req_received(req);
    2620           0 :                 return status;
    2621             :         }
    2622             : 
    2623           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2624             : 
    2625           0 :         tevent_req_received(req);
    2626           0 :         return NT_STATUS_OK;
    2627             : }
    2628             : 
    2629           6 : NTSTATUS dcerpc_eventlog_GetLogInformation_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_GetLogInformation *r)
    2630             : {
    2631             :         NTSTATUS status;
    2632             : 
    2633           6 :         status = dcerpc_binding_handle_call(h,
    2634             :                         NULL, &ndr_table_eventlog,
    2635             :                         NDR_EVENTLOG_GETLOGINFORMATION, mem_ctx, r);
    2636             : 
    2637           6 :         return status;
    2638             : }
    2639             : 
    2640             : struct dcerpc_eventlog_GetLogInformation_state {
    2641             :         struct eventlog_GetLogInformation orig;
    2642             :         struct eventlog_GetLogInformation tmp;
    2643             :         TALLOC_CTX *out_mem_ctx;
    2644             : };
    2645             : 
    2646             : static void dcerpc_eventlog_GetLogInformation_done(struct tevent_req *subreq);
    2647             : 
    2648           0 : struct tevent_req *dcerpc_eventlog_GetLogInformation_send(TALLOC_CTX *mem_ctx,
    2649             :                                                           struct tevent_context *ev,
    2650             :                                                           struct dcerpc_binding_handle *h,
    2651             :                                                           struct policy_handle *_handle /* [in] [ref] */,
    2652             :                                                           uint32_t _level /* [in]  */,
    2653             :                                                           uint8_t *_buffer /* [out] [ref,size_is(buf_size)] */,
    2654             :                                                           uint32_t _buf_size /* [in] [range(0,1024)] */,
    2655             :                                                           uint32_t *_bytes_needed /* [out] [ref] */)
    2656             : {
    2657             :         struct tevent_req *req;
    2658             :         struct dcerpc_eventlog_GetLogInformation_state *state;
    2659             :         struct tevent_req *subreq;
    2660             : 
    2661           0 :         req = tevent_req_create(mem_ctx, &state,
    2662             :                                 struct dcerpc_eventlog_GetLogInformation_state);
    2663           0 :         if (req == NULL) {
    2664           0 :                 return NULL;
    2665             :         }
    2666           0 :         state->out_mem_ctx = NULL;
    2667             : 
    2668             :         /* In parameters */
    2669           0 :         state->orig.in.handle = _handle;
    2670           0 :         state->orig.in.level = _level;
    2671           0 :         state->orig.in.buf_size = _buf_size;
    2672             : 
    2673             :         /* Out parameters */
    2674           0 :         state->orig.out.buffer = _buffer;
    2675           0 :         state->orig.out.bytes_needed = _bytes_needed;
    2676             : 
    2677             :         /* Result */
    2678           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2679             : 
    2680           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2681             :                              "dcerpc_eventlog_GetLogInformation_out_memory");
    2682           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2683           0 :                 return tevent_req_post(req, ev);
    2684             :         }
    2685             : 
    2686             :         /* make a temporary copy, that we pass to the dispatch function */
    2687           0 :         state->tmp = state->orig;
    2688             : 
    2689           0 :         subreq = dcerpc_eventlog_GetLogInformation_r_send(state, ev, h, &state->tmp);
    2690           0 :         if (tevent_req_nomem(subreq, req)) {
    2691           0 :                 return tevent_req_post(req, ev);
    2692             :         }
    2693           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_GetLogInformation_done, req);
    2694           0 :         return req;
    2695             : }
    2696             : 
    2697           0 : static void dcerpc_eventlog_GetLogInformation_done(struct tevent_req *subreq)
    2698             : {
    2699           0 :         struct tevent_req *req = tevent_req_callback_data(
    2700             :                 subreq, struct tevent_req);
    2701           0 :         struct dcerpc_eventlog_GetLogInformation_state *state = tevent_req_data(
    2702             :                 req, struct dcerpc_eventlog_GetLogInformation_state);
    2703             :         NTSTATUS status;
    2704             :         TALLOC_CTX *mem_ctx;
    2705             : 
    2706           0 :         if (state->out_mem_ctx) {
    2707           0 :                 mem_ctx = state->out_mem_ctx;
    2708             :         } else {
    2709           0 :                 mem_ctx = state;
    2710             :         }
    2711             : 
    2712           0 :         status = dcerpc_eventlog_GetLogInformation_r_recv(subreq, mem_ctx);
    2713           0 :         TALLOC_FREE(subreq);
    2714           0 :         if (tevent_req_nterror(req, status)) {
    2715           0 :                 return;
    2716             :         }
    2717             : 
    2718             :         /* Copy out parameters */
    2719             :         {
    2720             :                 size_t _copy_len_buffer;
    2721           0 :                 _copy_len_buffer = state->tmp.in.buf_size;
    2722           0 :                 if (state->orig.out.buffer != state->tmp.out.buffer) {
    2723           0 :                         memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
    2724             :                 }
    2725             :         }
    2726           0 :         *state->orig.out.bytes_needed = *state->tmp.out.bytes_needed;
    2727             : 
    2728             :         /* Copy result */
    2729           0 :         state->orig.out.result = state->tmp.out.result;
    2730             : 
    2731             :         /* Reset temporary structure */
    2732           0 :         NDR_ZERO_STRUCT(state->tmp);
    2733             : 
    2734           0 :         tevent_req_done(req);
    2735             : }
    2736             : 
    2737           0 : NTSTATUS dcerpc_eventlog_GetLogInformation_recv(struct tevent_req *req,
    2738             :                                                 TALLOC_CTX *mem_ctx,
    2739             :                                                 NTSTATUS *result)
    2740             : {
    2741           0 :         struct dcerpc_eventlog_GetLogInformation_state *state = tevent_req_data(
    2742             :                 req, struct dcerpc_eventlog_GetLogInformation_state);
    2743             :         NTSTATUS status;
    2744             : 
    2745           0 :         if (tevent_req_is_nterror(req, &status)) {
    2746           0 :                 tevent_req_received(req);
    2747           0 :                 return status;
    2748             :         }
    2749             : 
    2750             :         /* Steal possible out parameters to the callers context */
    2751           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2752             : 
    2753             :         /* Return result */
    2754           0 :         *result = state->orig.out.result;
    2755             : 
    2756           0 :         tevent_req_received(req);
    2757           0 :         return NT_STATUS_OK;
    2758             : }
    2759             : 
    2760           0 : NTSTATUS dcerpc_eventlog_GetLogInformation(struct dcerpc_binding_handle *h,
    2761             :                                            TALLOC_CTX *mem_ctx,
    2762             :                                            struct policy_handle *_handle /* [in] [ref] */,
    2763             :                                            uint32_t _level /* [in]  */,
    2764             :                                            uint8_t *_buffer /* [out] [ref,size_is(buf_size)] */,
    2765             :                                            uint32_t _buf_size /* [in] [range(0,1024)] */,
    2766             :                                            uint32_t *_bytes_needed /* [out] [ref] */,
    2767             :                                            NTSTATUS *result)
    2768             : {
    2769             :         struct eventlog_GetLogInformation r;
    2770             :         NTSTATUS status;
    2771             : 
    2772             :         /* In parameters */
    2773           0 :         r.in.handle = _handle;
    2774           0 :         r.in.level = _level;
    2775           0 :         r.in.buf_size = _buf_size;
    2776             : 
    2777             :         /* Out parameters */
    2778           0 :         r.out.buffer = _buffer;
    2779           0 :         r.out.bytes_needed = _bytes_needed;
    2780             : 
    2781             :         /* Result */
    2782           0 :         NDR_ZERO_STRUCT(r.out.result);
    2783             : 
    2784           0 :         status = dcerpc_eventlog_GetLogInformation_r(h, mem_ctx, &r);
    2785           0 :         if (!NT_STATUS_IS_OK(status)) {
    2786           0 :                 return status;
    2787             :         }
    2788             : 
    2789             :         /* Return variables */
    2790             :         {
    2791             :                 size_t _copy_len_buffer;
    2792           0 :                 _copy_len_buffer = r.in.buf_size;
    2793           0 :                 if (_buffer != r.out.buffer) {
    2794           0 :                         memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
    2795             :                 }
    2796             :         }
    2797           0 :         *_bytes_needed = *r.out.bytes_needed;
    2798             : 
    2799             :         /* Return result */
    2800           0 :         *result = r.out.result;
    2801             : 
    2802           0 :         return NT_STATUS_OK;
    2803             : }
    2804             : 
    2805             : struct dcerpc_eventlog_FlushEventLog_r_state {
    2806             :         TALLOC_CTX *out_mem_ctx;
    2807             : };
    2808             : 
    2809             : static void dcerpc_eventlog_FlushEventLog_r_done(struct tevent_req *subreq);
    2810             : 
    2811           0 : struct tevent_req *dcerpc_eventlog_FlushEventLog_r_send(TALLOC_CTX *mem_ctx,
    2812             :         struct tevent_context *ev,
    2813             :         struct dcerpc_binding_handle *h,
    2814             :         struct eventlog_FlushEventLog *r)
    2815             : {
    2816             :         struct tevent_req *req;
    2817             :         struct dcerpc_eventlog_FlushEventLog_r_state *state;
    2818             :         struct tevent_req *subreq;
    2819             : 
    2820           0 :         req = tevent_req_create(mem_ctx, &state,
    2821             :                                 struct dcerpc_eventlog_FlushEventLog_r_state);
    2822           0 :         if (req == NULL) {
    2823           0 :                 return NULL;
    2824             :         }
    2825             : 
    2826           0 :         state->out_mem_ctx = NULL;
    2827             : 
    2828           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2829             :                         NULL, &ndr_table_eventlog,
    2830             :                         NDR_EVENTLOG_FLUSHEVENTLOG, state, r);
    2831           0 :         if (tevent_req_nomem(subreq, req)) {
    2832           0 :                 return tevent_req_post(req, ev);
    2833             :         }
    2834           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_FlushEventLog_r_done, req);
    2835             : 
    2836           0 :         return req;
    2837             : }
    2838             : 
    2839           0 : static void dcerpc_eventlog_FlushEventLog_r_done(struct tevent_req *subreq)
    2840             : {
    2841           0 :         struct tevent_req *req =
    2842           0 :                 tevent_req_callback_data(subreq,
    2843             :                 struct tevent_req);
    2844             :         NTSTATUS status;
    2845             : 
    2846           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2847           0 :         TALLOC_FREE(subreq);
    2848           0 :         if (tevent_req_nterror(req, status)) {
    2849           0 :                 return;
    2850             :         }
    2851             : 
    2852           0 :         tevent_req_done(req);
    2853             : }
    2854             : 
    2855           0 : NTSTATUS dcerpc_eventlog_FlushEventLog_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2856             : {
    2857           0 :         struct dcerpc_eventlog_FlushEventLog_r_state *state =
    2858           0 :                 tevent_req_data(req,
    2859             :                 struct dcerpc_eventlog_FlushEventLog_r_state);
    2860             :         NTSTATUS status;
    2861             : 
    2862           0 :         if (tevent_req_is_nterror(req, &status)) {
    2863           0 :                 tevent_req_received(req);
    2864           0 :                 return status;
    2865             :         }
    2866             : 
    2867           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2868             : 
    2869           0 :         tevent_req_received(req);
    2870           0 :         return NT_STATUS_OK;
    2871             : }
    2872             : 
    2873           2 : NTSTATUS dcerpc_eventlog_FlushEventLog_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_FlushEventLog *r)
    2874             : {
    2875             :         NTSTATUS status;
    2876             : 
    2877           2 :         status = dcerpc_binding_handle_call(h,
    2878             :                         NULL, &ndr_table_eventlog,
    2879             :                         NDR_EVENTLOG_FLUSHEVENTLOG, mem_ctx, r);
    2880             : 
    2881           2 :         return status;
    2882             : }
    2883             : 
    2884             : struct dcerpc_eventlog_FlushEventLog_state {
    2885             :         struct eventlog_FlushEventLog orig;
    2886             :         struct eventlog_FlushEventLog tmp;
    2887             :         TALLOC_CTX *out_mem_ctx;
    2888             : };
    2889             : 
    2890             : static void dcerpc_eventlog_FlushEventLog_done(struct tevent_req *subreq);
    2891             : 
    2892           0 : struct tevent_req *dcerpc_eventlog_FlushEventLog_send(TALLOC_CTX *mem_ctx,
    2893             :                                                       struct tevent_context *ev,
    2894             :                                                       struct dcerpc_binding_handle *h,
    2895             :                                                       struct policy_handle *_handle /* [in] [ref] */)
    2896             : {
    2897             :         struct tevent_req *req;
    2898             :         struct dcerpc_eventlog_FlushEventLog_state *state;
    2899             :         struct tevent_req *subreq;
    2900             : 
    2901           0 :         req = tevent_req_create(mem_ctx, &state,
    2902             :                                 struct dcerpc_eventlog_FlushEventLog_state);
    2903           0 :         if (req == NULL) {
    2904           0 :                 return NULL;
    2905             :         }
    2906           0 :         state->out_mem_ctx = NULL;
    2907             : 
    2908             :         /* In parameters */
    2909           0 :         state->orig.in.handle = _handle;
    2910             : 
    2911             :         /* Out parameters */
    2912             : 
    2913             :         /* Result */
    2914           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2915             : 
    2916             :         /* make a temporary copy, that we pass to the dispatch function */
    2917           0 :         state->tmp = state->orig;
    2918             : 
    2919           0 :         subreq = dcerpc_eventlog_FlushEventLog_r_send(state, ev, h, &state->tmp);
    2920           0 :         if (tevent_req_nomem(subreq, req)) {
    2921           0 :                 return tevent_req_post(req, ev);
    2922             :         }
    2923           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_FlushEventLog_done, req);
    2924           0 :         return req;
    2925             : }
    2926             : 
    2927           0 : static void dcerpc_eventlog_FlushEventLog_done(struct tevent_req *subreq)
    2928             : {
    2929           0 :         struct tevent_req *req = tevent_req_callback_data(
    2930             :                 subreq, struct tevent_req);
    2931           0 :         struct dcerpc_eventlog_FlushEventLog_state *state = tevent_req_data(
    2932             :                 req, struct dcerpc_eventlog_FlushEventLog_state);
    2933             :         NTSTATUS status;
    2934             :         TALLOC_CTX *mem_ctx;
    2935             : 
    2936           0 :         if (state->out_mem_ctx) {
    2937           0 :                 mem_ctx = state->out_mem_ctx;
    2938             :         } else {
    2939           0 :                 mem_ctx = state;
    2940             :         }
    2941             : 
    2942           0 :         status = dcerpc_eventlog_FlushEventLog_r_recv(subreq, mem_ctx);
    2943           0 :         TALLOC_FREE(subreq);
    2944           0 :         if (tevent_req_nterror(req, status)) {
    2945           0 :                 return;
    2946             :         }
    2947             : 
    2948             :         /* Copy out parameters */
    2949             : 
    2950             :         /* Copy result */
    2951           0 :         state->orig.out.result = state->tmp.out.result;
    2952             : 
    2953             :         /* Reset temporary structure */
    2954           0 :         NDR_ZERO_STRUCT(state->tmp);
    2955             : 
    2956           0 :         tevent_req_done(req);
    2957             : }
    2958             : 
    2959           0 : NTSTATUS dcerpc_eventlog_FlushEventLog_recv(struct tevent_req *req,
    2960             :                                             TALLOC_CTX *mem_ctx,
    2961             :                                             NTSTATUS *result)
    2962             : {
    2963           0 :         struct dcerpc_eventlog_FlushEventLog_state *state = tevent_req_data(
    2964             :                 req, struct dcerpc_eventlog_FlushEventLog_state);
    2965             :         NTSTATUS status;
    2966             : 
    2967           0 :         if (tevent_req_is_nterror(req, &status)) {
    2968           0 :                 tevent_req_received(req);
    2969           0 :                 return status;
    2970             :         }
    2971             : 
    2972             :         /* Steal possible out parameters to the callers context */
    2973           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2974             : 
    2975             :         /* Return result */
    2976           0 :         *result = state->orig.out.result;
    2977             : 
    2978           0 :         tevent_req_received(req);
    2979           0 :         return NT_STATUS_OK;
    2980             : }
    2981             : 
    2982           0 : NTSTATUS dcerpc_eventlog_FlushEventLog(struct dcerpc_binding_handle *h,
    2983             :                                        TALLOC_CTX *mem_ctx,
    2984             :                                        struct policy_handle *_handle /* [in] [ref] */,
    2985             :                                        NTSTATUS *result)
    2986             : {
    2987             :         struct eventlog_FlushEventLog r;
    2988             :         NTSTATUS status;
    2989             : 
    2990             :         /* In parameters */
    2991           0 :         r.in.handle = _handle;
    2992             : 
    2993             :         /* Out parameters */
    2994             : 
    2995             :         /* Result */
    2996           0 :         NDR_ZERO_STRUCT(r.out.result);
    2997             : 
    2998           0 :         status = dcerpc_eventlog_FlushEventLog_r(h, mem_ctx, &r);
    2999           0 :         if (!NT_STATUS_IS_OK(status)) {
    3000           0 :                 return status;
    3001             :         }
    3002             : 
    3003             :         /* Return variables */
    3004             : 
    3005             :         /* Return result */
    3006           0 :         *result = r.out.result;
    3007             : 
    3008           0 :         return NT_STATUS_OK;
    3009             : }
    3010             : 
    3011             : struct dcerpc_eventlog_ReportEventAndSourceW_r_state {
    3012             :         TALLOC_CTX *out_mem_ctx;
    3013             : };
    3014             : 
    3015             : static void dcerpc_eventlog_ReportEventAndSourceW_r_done(struct tevent_req *subreq);
    3016             : 
    3017           0 : struct tevent_req *dcerpc_eventlog_ReportEventAndSourceW_r_send(TALLOC_CTX *mem_ctx,
    3018             :         struct tevent_context *ev,
    3019             :         struct dcerpc_binding_handle *h,
    3020             :         struct eventlog_ReportEventAndSourceW *r)
    3021             : {
    3022             :         struct tevent_req *req;
    3023             :         struct dcerpc_eventlog_ReportEventAndSourceW_r_state *state;
    3024             :         struct tevent_req *subreq;
    3025             : 
    3026           0 :         req = tevent_req_create(mem_ctx, &state,
    3027             :                                 struct dcerpc_eventlog_ReportEventAndSourceW_r_state);
    3028           0 :         if (req == NULL) {
    3029           0 :                 return NULL;
    3030             :         }
    3031             : 
    3032           0 :         state->out_mem_ctx = talloc_new(state);
    3033           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3034           0 :                 return tevent_req_post(req, ev);
    3035             :         }
    3036             : 
    3037           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3038             :                         NULL, &ndr_table_eventlog,
    3039           0 :                         NDR_EVENTLOG_REPORTEVENTANDSOURCEW, state->out_mem_ctx, r);
    3040           0 :         if (tevent_req_nomem(subreq, req)) {
    3041           0 :                 return tevent_req_post(req, ev);
    3042             :         }
    3043           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_ReportEventAndSourceW_r_done, req);
    3044             : 
    3045           0 :         return req;
    3046             : }
    3047             : 
    3048           0 : static void dcerpc_eventlog_ReportEventAndSourceW_r_done(struct tevent_req *subreq)
    3049             : {
    3050           0 :         struct tevent_req *req =
    3051           0 :                 tevent_req_callback_data(subreq,
    3052             :                 struct tevent_req);
    3053             :         NTSTATUS status;
    3054             : 
    3055           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3056           0 :         TALLOC_FREE(subreq);
    3057           0 :         if (tevent_req_nterror(req, status)) {
    3058           0 :                 return;
    3059             :         }
    3060             : 
    3061           0 :         tevent_req_done(req);
    3062             : }
    3063             : 
    3064           0 : NTSTATUS dcerpc_eventlog_ReportEventAndSourceW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3065             : {
    3066           0 :         struct dcerpc_eventlog_ReportEventAndSourceW_r_state *state =
    3067           0 :                 tevent_req_data(req,
    3068             :                 struct dcerpc_eventlog_ReportEventAndSourceW_r_state);
    3069             :         NTSTATUS status;
    3070             : 
    3071           0 :         if (tevent_req_is_nterror(req, &status)) {
    3072           0 :                 tevent_req_received(req);
    3073           0 :                 return status;
    3074             :         }
    3075             : 
    3076           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3077             : 
    3078           0 :         tevent_req_received(req);
    3079           0 :         return NT_STATUS_OK;
    3080             : }
    3081             : 
    3082           0 : NTSTATUS dcerpc_eventlog_ReportEventAndSourceW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct eventlog_ReportEventAndSourceW *r)
    3083             : {
    3084             :         NTSTATUS status;
    3085             : 
    3086           0 :         status = dcerpc_binding_handle_call(h,
    3087             :                         NULL, &ndr_table_eventlog,
    3088             :                         NDR_EVENTLOG_REPORTEVENTANDSOURCEW, mem_ctx, r);
    3089             : 
    3090           0 :         return status;
    3091             : }
    3092             : 
    3093             : struct dcerpc_eventlog_ReportEventAndSourceW_state {
    3094             :         struct eventlog_ReportEventAndSourceW orig;
    3095             :         struct eventlog_ReportEventAndSourceW tmp;
    3096             :         TALLOC_CTX *out_mem_ctx;
    3097             : };
    3098             : 
    3099             : static void dcerpc_eventlog_ReportEventAndSourceW_done(struct tevent_req *subreq);
    3100             : 
    3101           0 : struct tevent_req *dcerpc_eventlog_ReportEventAndSourceW_send(TALLOC_CTX *mem_ctx,
    3102             :                                                               struct tevent_context *ev,
    3103             :                                                               struct dcerpc_binding_handle *h,
    3104             :                                                               struct policy_handle *_handle /* [in] [ref] */,
    3105             :                                                               time_t _timestamp /* [in]  */,
    3106             :                                                               enum eventlogEventTypes _event_type /* [in]  */,
    3107             :                                                               uint16_t _event_category /* [in]  */,
    3108             :                                                               uint32_t _event_id /* [in]  */,
    3109             :                                                               struct lsa_String *_sourcename /* [in] [ref] */,
    3110             :                                                               uint16_t _num_of_strings /* [in] [range(0,256)] */,
    3111             :                                                               uint32_t _data_size /* [in] [range(0,0x3FFFF)] */,
    3112             :                                                               struct lsa_String *_servername /* [in] [ref] */,
    3113             :                                                               struct dom_sid *_user_sid /* [in] [unique] */,
    3114             :                                                               struct lsa_String **_strings /* [in] [size_is(num_of_strings),unique] */,
    3115             :                                                               uint8_t *_data /* [in] [size_is(data_size),unique] */,
    3116             :                                                               uint16_t _flags /* [in]  */,
    3117             :                                                               uint32_t *_record_number /* [in,out] [unique] */,
    3118             :                                                               time_t *_time_written /* [in,out] [unique] */)
    3119             : {
    3120             :         struct tevent_req *req;
    3121             :         struct dcerpc_eventlog_ReportEventAndSourceW_state *state;
    3122             :         struct tevent_req *subreq;
    3123             : 
    3124           0 :         req = tevent_req_create(mem_ctx, &state,
    3125             :                                 struct dcerpc_eventlog_ReportEventAndSourceW_state);
    3126           0 :         if (req == NULL) {
    3127           0 :                 return NULL;
    3128             :         }
    3129           0 :         state->out_mem_ctx = NULL;
    3130             : 
    3131             :         /* In parameters */
    3132           0 :         state->orig.in.handle = _handle;
    3133           0 :         state->orig.in.timestamp = _timestamp;
    3134           0 :         state->orig.in.event_type = _event_type;
    3135           0 :         state->orig.in.event_category = _event_category;
    3136           0 :         state->orig.in.event_id = _event_id;
    3137           0 :         state->orig.in.sourcename = _sourcename;
    3138           0 :         state->orig.in.num_of_strings = _num_of_strings;
    3139           0 :         state->orig.in.data_size = _data_size;
    3140           0 :         state->orig.in.servername = _servername;
    3141           0 :         state->orig.in.user_sid = _user_sid;
    3142           0 :         state->orig.in.strings = _strings;
    3143           0 :         state->orig.in.data = _data;
    3144           0 :         state->orig.in.flags = _flags;
    3145           0 :         state->orig.in.record_number = _record_number;
    3146           0 :         state->orig.in.time_written = _time_written;
    3147             : 
    3148             :         /* Out parameters */
    3149           0 :         state->orig.out.record_number = _record_number;
    3150           0 :         state->orig.out.time_written = _time_written;
    3151             : 
    3152             :         /* Result */
    3153           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3154             : 
    3155           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3156             :                              "dcerpc_eventlog_ReportEventAndSourceW_out_memory");
    3157           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3158           0 :                 return tevent_req_post(req, ev);
    3159             :         }
    3160             : 
    3161             :         /* make a temporary copy, that we pass to the dispatch function */
    3162           0 :         state->tmp = state->orig;
    3163             : 
    3164           0 :         subreq = dcerpc_eventlog_ReportEventAndSourceW_r_send(state, ev, h, &state->tmp);
    3165           0 :         if (tevent_req_nomem(subreq, req)) {
    3166           0 :                 return tevent_req_post(req, ev);
    3167             :         }
    3168           0 :         tevent_req_set_callback(subreq, dcerpc_eventlog_ReportEventAndSourceW_done, req);
    3169           0 :         return req;
    3170             : }
    3171             : 
    3172           0 : static void dcerpc_eventlog_ReportEventAndSourceW_done(struct tevent_req *subreq)
    3173             : {
    3174           0 :         struct tevent_req *req = tevent_req_callback_data(
    3175             :                 subreq, struct tevent_req);
    3176           0 :         struct dcerpc_eventlog_ReportEventAndSourceW_state *state = tevent_req_data(
    3177             :                 req, struct dcerpc_eventlog_ReportEventAndSourceW_state);
    3178             :         NTSTATUS status;
    3179             :         TALLOC_CTX *mem_ctx;
    3180             : 
    3181           0 :         if (state->out_mem_ctx) {
    3182           0 :                 mem_ctx = state->out_mem_ctx;
    3183             :         } else {
    3184           0 :                 mem_ctx = state;
    3185             :         }
    3186             : 
    3187           0 :         status = dcerpc_eventlog_ReportEventAndSourceW_r_recv(subreq, mem_ctx);
    3188           0 :         TALLOC_FREE(subreq);
    3189           0 :         if (tevent_req_nterror(req, status)) {
    3190           0 :                 return;
    3191             :         }
    3192             : 
    3193             :         /* Copy out parameters */
    3194           0 :         if (state->orig.out.record_number && state->tmp.out.record_number) {
    3195           0 :                 *state->orig.out.record_number = *state->tmp.out.record_number;
    3196             :         }
    3197           0 :         if (state->orig.out.time_written && state->tmp.out.time_written) {
    3198           0 :                 *state->orig.out.time_written = *state->tmp.out.time_written;
    3199             :         }
    3200             : 
    3201             :         /* Copy result */
    3202           0 :         state->orig.out.result = state->tmp.out.result;
    3203             : 
    3204             :         /* Reset temporary structure */
    3205           0 :         NDR_ZERO_STRUCT(state->tmp);
    3206             : 
    3207           0 :         tevent_req_done(req);
    3208             : }
    3209             : 
    3210           0 : NTSTATUS dcerpc_eventlog_ReportEventAndSourceW_recv(struct tevent_req *req,
    3211             :                                                     TALLOC_CTX *mem_ctx,
    3212             :                                                     NTSTATUS *result)
    3213             : {
    3214           0 :         struct dcerpc_eventlog_ReportEventAndSourceW_state *state = tevent_req_data(
    3215             :                 req, struct dcerpc_eventlog_ReportEventAndSourceW_state);
    3216             :         NTSTATUS status;
    3217             : 
    3218           0 :         if (tevent_req_is_nterror(req, &status)) {
    3219           0 :                 tevent_req_received(req);
    3220           0 :                 return status;
    3221             :         }
    3222             : 
    3223             :         /* Steal possible out parameters to the callers context */
    3224           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3225             : 
    3226             :         /* Return result */
    3227           0 :         *result = state->orig.out.result;
    3228             : 
    3229           0 :         tevent_req_received(req);
    3230           0 :         return NT_STATUS_OK;
    3231             : }
    3232             : 
    3233           0 : NTSTATUS dcerpc_eventlog_ReportEventAndSourceW(struct dcerpc_binding_handle *h,
    3234             :                                                TALLOC_CTX *mem_ctx,
    3235             :                                                struct policy_handle *_handle /* [in] [ref] */,
    3236             :                                                time_t _timestamp /* [in]  */,
    3237             :                                                enum eventlogEventTypes _event_type /* [in]  */,
    3238             :                                                uint16_t _event_category /* [in]  */,
    3239             :                                                uint32_t _event_id /* [in]  */,
    3240             :                                                struct lsa_String *_sourcename /* [in] [ref] */,
    3241             :                                                uint16_t _num_of_strings /* [in] [range(0,256)] */,
    3242             :                                                uint32_t _data_size /* [in] [range(0,0x3FFFF)] */,
    3243             :                                                struct lsa_String *_servername /* [in] [ref] */,
    3244             :                                                struct dom_sid *_user_sid /* [in] [unique] */,
    3245             :                                                struct lsa_String **_strings /* [in] [size_is(num_of_strings),unique] */,
    3246             :                                                uint8_t *_data /* [in] [size_is(data_size),unique] */,
    3247             :                                                uint16_t _flags /* [in]  */,
    3248             :                                                uint32_t *_record_number /* [in,out] [unique] */,
    3249             :                                                time_t *_time_written /* [in,out] [unique] */,
    3250             :                                                NTSTATUS *result)
    3251             : {
    3252             :         struct eventlog_ReportEventAndSourceW r;
    3253             :         NTSTATUS status;
    3254             : 
    3255             :         /* In parameters */
    3256           0 :         r.in.handle = _handle;
    3257           0 :         r.in.timestamp = _timestamp;
    3258           0 :         r.in.event_type = _event_type;
    3259           0 :         r.in.event_category = _event_category;
    3260           0 :         r.in.event_id = _event_id;
    3261           0 :         r.in.sourcename = _sourcename;
    3262           0 :         r.in.num_of_strings = _num_of_strings;
    3263           0 :         r.in.data_size = _data_size;
    3264           0 :         r.in.servername = _servername;
    3265           0 :         r.in.user_sid = _user_sid;
    3266           0 :         r.in.strings = _strings;
    3267           0 :         r.in.data = _data;
    3268           0 :         r.in.flags = _flags;
    3269           0 :         r.in.record_number = _record_number;
    3270           0 :         r.in.time_written = _time_written;
    3271             : 
    3272             :         /* Out parameters */
    3273           0 :         r.out.record_number = _record_number;
    3274           0 :         r.out.time_written = _time_written;
    3275             : 
    3276             :         /* Result */
    3277           0 :         NDR_ZERO_STRUCT(r.out.result);
    3278             : 
    3279           0 :         status = dcerpc_eventlog_ReportEventAndSourceW_r(h, mem_ctx, &r);
    3280           0 :         if (!NT_STATUS_IS_OK(status)) {
    3281           0 :                 return status;
    3282             :         }
    3283             : 
    3284             :         /* Return variables */
    3285           0 :         if (_record_number && r.out.record_number) {
    3286           0 :                 *_record_number = *r.out.record_number;
    3287             :         }
    3288           0 :         if (_time_written && r.out.time_written) {
    3289           0 :                 *_time_written = *r.out.time_written;
    3290             :         }
    3291             : 
    3292             :         /* Return result */
    3293           0 :         *result = r.out.result;
    3294             : 
    3295           0 :         return NT_STATUS_OK;
    3296             : }
    3297             : 

Generated by: LCOV version 1.13