LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_echo_c.c (source / functions) Hit Total Coverage
Test: coverage report for fix-15632 9995c5c2 Lines: 85 933 9.1 %
Date: 2024-04-13 12:30:31 Functions: 15 80 18.8 %

          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_echo.h"
       7             : #include "bin/default/librpc/gen_ndr/ndr_echo_c.h"
       8             : 
       9             : /* rpcecho - client functions generated by pidl */
      10             : 
      11             : struct dcerpc_echo_AddOne_r_state {
      12             :         TALLOC_CTX *out_mem_ctx;
      13             : };
      14             : 
      15             : static void dcerpc_echo_AddOne_r_done(struct tevent_req *subreq);
      16             : 
      17       16219 : struct tevent_req *dcerpc_echo_AddOne_r_send(TALLOC_CTX *mem_ctx,
      18             :         struct tevent_context *ev,
      19             :         struct dcerpc_binding_handle *h,
      20             :         struct echo_AddOne *r)
      21             : {
      22       16219 :         struct tevent_req *req;
      23       16219 :         struct dcerpc_echo_AddOne_r_state *state;
      24       16219 :         struct tevent_req *subreq;
      25             : 
      26       16219 :         req = tevent_req_create(mem_ctx, &state,
      27             :                                 struct dcerpc_echo_AddOne_r_state);
      28       16219 :         if (req == NULL) {
      29           0 :                 return NULL;
      30             :         }
      31             : 
      32       16219 :         state->out_mem_ctx = talloc_new(state);
      33       16219 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
      34           0 :                 return tevent_req_post(req, ev);
      35             :         }
      36             : 
      37       32438 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
      38             :                         NULL, &ndr_table_rpcecho,
      39       16219 :                         NDR_ECHO_ADDONE, state->out_mem_ctx, r);
      40       16219 :         if (tevent_req_nomem(subreq, req)) {
      41           0 :                 return tevent_req_post(req, ev);
      42             :         }
      43       16219 :         tevent_req_set_callback(subreq, dcerpc_echo_AddOne_r_done, req);
      44             : 
      45       16219 :         return req;
      46             : }
      47             : 
      48       16219 : static void dcerpc_echo_AddOne_r_done(struct tevent_req *subreq)
      49             : {
      50       16219 :         struct tevent_req *req =
      51       16219 :                 tevent_req_callback_data(subreq,
      52             :                 struct tevent_req);
      53       16219 :         NTSTATUS status;
      54             : 
      55       16219 :         status = dcerpc_binding_handle_call_recv(subreq);
      56       16219 :         TALLOC_FREE(subreq);
      57       16219 :         if (tevent_req_nterror(req, status)) {
      58           0 :                 return;
      59             :         }
      60             : 
      61       16219 :         tevent_req_done(req);
      62             : }
      63             : 
      64       16219 : NTSTATUS dcerpc_echo_AddOne_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
      65             : {
      66       16219 :         struct dcerpc_echo_AddOne_r_state *state =
      67       16219 :                 tevent_req_data(req,
      68             :                 struct dcerpc_echo_AddOne_r_state);
      69       16219 :         NTSTATUS status;
      70             : 
      71       16219 :         if (tevent_req_is_nterror(req, &status)) {
      72           0 :                 tevent_req_received(req);
      73           0 :                 return status;
      74             :         }
      75             : 
      76       16219 :         talloc_steal(mem_ctx, state->out_mem_ctx);
      77             : 
      78       16219 :         tevent_req_received(req);
      79       16219 :         return NT_STATUS_OK;
      80             : }
      81             : 
      82        3745 : NTSTATUS dcerpc_echo_AddOne_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct echo_AddOne *r)
      83             : {
      84          33 :         NTSTATUS status;
      85             : 
      86        3745 :         status = dcerpc_binding_handle_call(h,
      87             :                         NULL, &ndr_table_rpcecho,
      88             :                         NDR_ECHO_ADDONE, mem_ctx, r);
      89             : 
      90        3745 :         return status;
      91             : }
      92             : 
      93             : struct dcerpc_echo_AddOne_state {
      94             :         struct echo_AddOne orig;
      95             :         struct echo_AddOne tmp;
      96             :         TALLOC_CTX *out_mem_ctx;
      97             : };
      98             : 
      99             : static void dcerpc_echo_AddOne_done(struct tevent_req *subreq);
     100             : 
     101           0 : struct tevent_req *dcerpc_echo_AddOne_send(TALLOC_CTX *mem_ctx,
     102             :                                            struct tevent_context *ev,
     103             :                                            struct dcerpc_binding_handle *h,
     104             :                                            uint32_t _in_data /* [in]  */,
     105             :                                            uint32_t *_out_data /* [out] [ref] */)
     106             : {
     107           0 :         struct tevent_req *req;
     108           0 :         struct dcerpc_echo_AddOne_state *state;
     109           0 :         struct tevent_req *subreq;
     110             : 
     111           0 :         req = tevent_req_create(mem_ctx, &state,
     112             :                                 struct dcerpc_echo_AddOne_state);
     113           0 :         if (req == NULL) {
     114           0 :                 return NULL;
     115             :         }
     116           0 :         state->out_mem_ctx = NULL;
     117             : 
     118             :         /* In parameters */
     119           0 :         state->orig.in.in_data = _in_data;
     120             : 
     121             :         /* Out parameters */
     122           0 :         state->orig.out.out_data = _out_data;
     123             : 
     124           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     125             :                              "dcerpc_echo_AddOne_out_memory");
     126           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     127           0 :                 return tevent_req_post(req, ev);
     128             :         }
     129             : 
     130             :         /* make a temporary copy, that we pass to the dispatch function */
     131           0 :         state->tmp = state->orig;
     132             : 
     133           0 :         subreq = dcerpc_echo_AddOne_r_send(state, ev, h, &state->tmp);
     134           0 :         if (tevent_req_nomem(subreq, req)) {
     135           0 :                 return tevent_req_post(req, ev);
     136             :         }
     137           0 :         tevent_req_set_callback(subreq, dcerpc_echo_AddOne_done, req);
     138           0 :         return req;
     139             : }
     140             : 
     141           0 : static void dcerpc_echo_AddOne_done(struct tevent_req *subreq)
     142             : {
     143           0 :         struct tevent_req *req = tevent_req_callback_data(
     144             :                 subreq, struct tevent_req);
     145           0 :         struct dcerpc_echo_AddOne_state *state = tevent_req_data(
     146             :                 req, struct dcerpc_echo_AddOne_state);
     147           0 :         NTSTATUS status;
     148           0 :         TALLOC_CTX *mem_ctx;
     149             : 
     150           0 :         if (state->out_mem_ctx) {
     151           0 :                 mem_ctx = state->out_mem_ctx;
     152             :         } else {
     153           0 :                 mem_ctx = state;
     154             :         }
     155             : 
     156           0 :         status = dcerpc_echo_AddOne_r_recv(subreq, mem_ctx);
     157           0 :         TALLOC_FREE(subreq);
     158           0 :         if (tevent_req_nterror(req, status)) {
     159           0 :                 return;
     160             :         }
     161             : 
     162             :         /* Copy out parameters */
     163           0 :         *state->orig.out.out_data = *state->tmp.out.out_data;
     164             : 
     165             :         /* Reset temporary structure */
     166           0 :         NDR_ZERO_STRUCT(state->tmp);
     167             : 
     168           0 :         tevent_req_done(req);
     169             : }
     170             : 
     171           0 : NTSTATUS dcerpc_echo_AddOne_recv(struct tevent_req *req,
     172             :                                  TALLOC_CTX *mem_ctx)
     173             : {
     174           0 :         struct dcerpc_echo_AddOne_state *state = tevent_req_data(
     175             :                 req, struct dcerpc_echo_AddOne_state);
     176           0 :         NTSTATUS status;
     177             : 
     178           0 :         if (tevent_req_is_nterror(req, &status)) {
     179           0 :                 tevent_req_received(req);
     180           0 :                 return status;
     181             :         }
     182             : 
     183             :         /* Steal possible out parameters to the callers context */
     184           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     185             : 
     186           0 :         tevent_req_received(req);
     187           0 :         return NT_STATUS_OK;
     188             : }
     189             : 
     190           0 : NTSTATUS dcerpc_echo_AddOne(struct dcerpc_binding_handle *h,
     191             :                             TALLOC_CTX *mem_ctx,
     192             :                             uint32_t _in_data /* [in]  */,
     193             :                             uint32_t *_out_data /* [out] [ref] */)
     194             : {
     195           0 :         struct echo_AddOne r;
     196           0 :         NTSTATUS status;
     197             : 
     198             :         /* In parameters */
     199           0 :         r.in.in_data = _in_data;
     200             : 
     201             :         /* Out parameters */
     202           0 :         r.out.out_data = _out_data;
     203             : 
     204           0 :         status = dcerpc_echo_AddOne_r(h, mem_ctx, &r);
     205           0 :         if (!NT_STATUS_IS_OK(status)) {
     206           0 :                 return status;
     207             :         }
     208             : 
     209             :         /* Return variables */
     210           0 :         *_out_data = *r.out.out_data;
     211             : 
     212             :         /* Return result */
     213             : 
     214           0 :         return NT_STATUS_OK;
     215             : }
     216             : 
     217             : struct dcerpc_echo_EchoData_r_state {
     218             :         TALLOC_CTX *out_mem_ctx;
     219             : };
     220             : 
     221             : static void dcerpc_echo_EchoData_r_done(struct tevent_req *subreq);
     222             : 
     223           0 : struct tevent_req *dcerpc_echo_EchoData_r_send(TALLOC_CTX *mem_ctx,
     224             :         struct tevent_context *ev,
     225             :         struct dcerpc_binding_handle *h,
     226             :         struct echo_EchoData *r)
     227             : {
     228           0 :         struct tevent_req *req;
     229           0 :         struct dcerpc_echo_EchoData_r_state *state;
     230           0 :         struct tevent_req *subreq;
     231             : 
     232           0 :         req = tevent_req_create(mem_ctx, &state,
     233             :                                 struct dcerpc_echo_EchoData_r_state);
     234           0 :         if (req == NULL) {
     235           0 :                 return NULL;
     236             :         }
     237             : 
     238           0 :         state->out_mem_ctx = talloc_new(state);
     239           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     240           0 :                 return tevent_req_post(req, ev);
     241             :         }
     242             : 
     243           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     244             :                         NULL, &ndr_table_rpcecho,
     245           0 :                         NDR_ECHO_ECHODATA, state->out_mem_ctx, r);
     246           0 :         if (tevent_req_nomem(subreq, req)) {
     247           0 :                 return tevent_req_post(req, ev);
     248             :         }
     249           0 :         tevent_req_set_callback(subreq, dcerpc_echo_EchoData_r_done, req);
     250             : 
     251           0 :         return req;
     252             : }
     253             : 
     254           0 : static void dcerpc_echo_EchoData_r_done(struct tevent_req *subreq)
     255             : {
     256           0 :         struct tevent_req *req =
     257           0 :                 tevent_req_callback_data(subreq,
     258             :                 struct tevent_req);
     259           0 :         NTSTATUS status;
     260             : 
     261           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     262           0 :         TALLOC_FREE(subreq);
     263           0 :         if (tevent_req_nterror(req, status)) {
     264           0 :                 return;
     265             :         }
     266             : 
     267           0 :         tevent_req_done(req);
     268             : }
     269             : 
     270           0 : NTSTATUS dcerpc_echo_EchoData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     271             : {
     272           0 :         struct dcerpc_echo_EchoData_r_state *state =
     273           0 :                 tevent_req_data(req,
     274             :                 struct dcerpc_echo_EchoData_r_state);
     275           0 :         NTSTATUS status;
     276             : 
     277           0 :         if (tevent_req_is_nterror(req, &status)) {
     278           0 :                 tevent_req_received(req);
     279           0 :                 return status;
     280             :         }
     281             : 
     282           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     283             : 
     284           0 :         tevent_req_received(req);
     285           0 :         return NT_STATUS_OK;
     286             : }
     287             : 
     288         275 : NTSTATUS dcerpc_echo_EchoData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct echo_EchoData *r)
     289             : {
     290           3 :         NTSTATUS status;
     291             : 
     292         275 :         status = dcerpc_binding_handle_call(h,
     293             :                         NULL, &ndr_table_rpcecho,
     294             :                         NDR_ECHO_ECHODATA, mem_ctx, r);
     295             : 
     296         275 :         return status;
     297             : }
     298             : 
     299             : struct dcerpc_echo_EchoData_state {
     300             :         struct echo_EchoData orig;
     301             :         struct echo_EchoData tmp;
     302             :         TALLOC_CTX *out_mem_ctx;
     303             : };
     304             : 
     305             : static void dcerpc_echo_EchoData_done(struct tevent_req *subreq);
     306             : 
     307           0 : struct tevent_req *dcerpc_echo_EchoData_send(TALLOC_CTX *mem_ctx,
     308             :                                              struct tevent_context *ev,
     309             :                                              struct dcerpc_binding_handle *h,
     310             :                                              uint32_t _len /* [in]  */,
     311             :                                              uint8_t *_in_data /* [in] [size_is(len)] */,
     312             :                                              uint8_t *_out_data /* [out] [size_is(len)] */)
     313             : {
     314           0 :         struct tevent_req *req;
     315           0 :         struct dcerpc_echo_EchoData_state *state;
     316           0 :         struct tevent_req *subreq;
     317             : 
     318           0 :         req = tevent_req_create(mem_ctx, &state,
     319             :                                 struct dcerpc_echo_EchoData_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.len = _len;
     327           0 :         state->orig.in.in_data = _in_data;
     328             : 
     329             :         /* Out parameters */
     330           0 :         state->orig.out.out_data = _out_data;
     331             : 
     332           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     333             :                              "dcerpc_echo_EchoData_out_memory");
     334           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     335           0 :                 return tevent_req_post(req, ev);
     336             :         }
     337             : 
     338             :         /* make a temporary copy, that we pass to the dispatch function */
     339           0 :         state->tmp = state->orig;
     340             : 
     341           0 :         subreq = dcerpc_echo_EchoData_r_send(state, ev, h, &state->tmp);
     342           0 :         if (tevent_req_nomem(subreq, req)) {
     343           0 :                 return tevent_req_post(req, ev);
     344             :         }
     345           0 :         tevent_req_set_callback(subreq, dcerpc_echo_EchoData_done, req);
     346           0 :         return req;
     347             : }
     348             : 
     349           0 : static void dcerpc_echo_EchoData_done(struct tevent_req *subreq)
     350             : {
     351           0 :         struct tevent_req *req = tevent_req_callback_data(
     352             :                 subreq, struct tevent_req);
     353           0 :         struct dcerpc_echo_EchoData_state *state = tevent_req_data(
     354             :                 req, struct dcerpc_echo_EchoData_state);
     355           0 :         NTSTATUS status;
     356           0 :         TALLOC_CTX *mem_ctx;
     357             : 
     358           0 :         if (state->out_mem_ctx) {
     359           0 :                 mem_ctx = state->out_mem_ctx;
     360             :         } else {
     361           0 :                 mem_ctx = state;
     362             :         }
     363             : 
     364           0 :         status = dcerpc_echo_EchoData_r_recv(subreq, mem_ctx);
     365           0 :         TALLOC_FREE(subreq);
     366           0 :         if (tevent_req_nterror(req, status)) {
     367           0 :                 return;
     368             :         }
     369             : 
     370             :         /* Copy out parameters */
     371             :         {
     372           0 :                 size_t _copy_len_out_data;
     373           0 :                 _copy_len_out_data = state->tmp.in.len;
     374           0 :                 if (state->orig.out.out_data != state->tmp.out.out_data) {
     375           0 :                         memcpy(state->orig.out.out_data, state->tmp.out.out_data, _copy_len_out_data * sizeof(*state->orig.out.out_data));
     376             :                 }
     377             :         }
     378             : 
     379             :         /* Reset temporary structure */
     380           0 :         NDR_ZERO_STRUCT(state->tmp);
     381             : 
     382           0 :         tevent_req_done(req);
     383             : }
     384             : 
     385           0 : NTSTATUS dcerpc_echo_EchoData_recv(struct tevent_req *req,
     386             :                                    TALLOC_CTX *mem_ctx)
     387             : {
     388           0 :         struct dcerpc_echo_EchoData_state *state = tevent_req_data(
     389             :                 req, struct dcerpc_echo_EchoData_state);
     390           0 :         NTSTATUS status;
     391             : 
     392           0 :         if (tevent_req_is_nterror(req, &status)) {
     393           0 :                 tevent_req_received(req);
     394           0 :                 return status;
     395             :         }
     396             : 
     397             :         /* Steal possible out parameters to the callers context */
     398           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     399             : 
     400           0 :         tevent_req_received(req);
     401           0 :         return NT_STATUS_OK;
     402             : }
     403             : 
     404           0 : NTSTATUS dcerpc_echo_EchoData(struct dcerpc_binding_handle *h,
     405             :                               TALLOC_CTX *mem_ctx,
     406             :                               uint32_t _len /* [in]  */,
     407             :                               uint8_t *_in_data /* [in] [size_is(len)] */,
     408             :                               uint8_t *_out_data /* [out] [size_is(len)] */)
     409             : {
     410           0 :         struct echo_EchoData r;
     411           0 :         NTSTATUS status;
     412             : 
     413             :         /* In parameters */
     414           0 :         r.in.len = _len;
     415           0 :         r.in.in_data = _in_data;
     416             : 
     417             :         /* Out parameters */
     418           0 :         r.out.out_data = _out_data;
     419             : 
     420           0 :         status = dcerpc_echo_EchoData_r(h, mem_ctx, &r);
     421           0 :         if (!NT_STATUS_IS_OK(status)) {
     422           0 :                 return status;
     423             :         }
     424             : 
     425             :         /* Return variables */
     426             :         {
     427           0 :                 size_t _copy_len_out_data;
     428           0 :                 _copy_len_out_data = r.in.len;
     429           0 :                 if (_out_data != r.out.out_data) {
     430           0 :                         memcpy(_out_data, r.out.out_data, _copy_len_out_data * sizeof(*_out_data));
     431             :                 }
     432             :         }
     433             : 
     434             :         /* Return result */
     435             : 
     436           0 :         return NT_STATUS_OK;
     437             : }
     438             : 
     439             : struct dcerpc_echo_SinkData_r_state {
     440             :         TALLOC_CTX *out_mem_ctx;
     441             : };
     442             : 
     443             : static void dcerpc_echo_SinkData_r_done(struct tevent_req *subreq);
     444             : 
     445           0 : struct tevent_req *dcerpc_echo_SinkData_r_send(TALLOC_CTX *mem_ctx,
     446             :         struct tevent_context *ev,
     447             :         struct dcerpc_binding_handle *h,
     448             :         struct echo_SinkData *r)
     449             : {
     450           0 :         struct tevent_req *req;
     451           0 :         struct dcerpc_echo_SinkData_r_state *state;
     452           0 :         struct tevent_req *subreq;
     453             : 
     454           0 :         req = tevent_req_create(mem_ctx, &state,
     455             :                                 struct dcerpc_echo_SinkData_r_state);
     456           0 :         if (req == NULL) {
     457           0 :                 return NULL;
     458             :         }
     459             : 
     460           0 :         state->out_mem_ctx = NULL;
     461             : 
     462           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     463             :                         NULL, &ndr_table_rpcecho,
     464             :                         NDR_ECHO_SINKDATA, state, r);
     465           0 :         if (tevent_req_nomem(subreq, req)) {
     466           0 :                 return tevent_req_post(req, ev);
     467             :         }
     468           0 :         tevent_req_set_callback(subreq, dcerpc_echo_SinkData_r_done, req);
     469             : 
     470           0 :         return req;
     471             : }
     472             : 
     473           0 : static void dcerpc_echo_SinkData_r_done(struct tevent_req *subreq)
     474             : {
     475           0 :         struct tevent_req *req =
     476           0 :                 tevent_req_callback_data(subreq,
     477             :                 struct tevent_req);
     478           0 :         NTSTATUS status;
     479             : 
     480           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     481           0 :         TALLOC_FREE(subreq);
     482           0 :         if (tevent_req_nterror(req, status)) {
     483           0 :                 return;
     484             :         }
     485             : 
     486           0 :         tevent_req_done(req);
     487             : }
     488             : 
     489           0 : NTSTATUS dcerpc_echo_SinkData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     490             : {
     491           0 :         struct dcerpc_echo_SinkData_r_state *state =
     492           0 :                 tevent_req_data(req,
     493             :                 struct dcerpc_echo_SinkData_r_state);
     494           0 :         NTSTATUS status;
     495             : 
     496           0 :         if (tevent_req_is_nterror(req, &status)) {
     497           0 :                 tevent_req_received(req);
     498           0 :                 return status;
     499             :         }
     500             : 
     501           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     502             : 
     503           0 :         tevent_req_received(req);
     504           0 :         return NT_STATUS_OK;
     505             : }
     506             : 
     507         267 : NTSTATUS dcerpc_echo_SinkData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct echo_SinkData *r)
     508             : {
     509           2 :         NTSTATUS status;
     510             : 
     511         267 :         status = dcerpc_binding_handle_call(h,
     512             :                         NULL, &ndr_table_rpcecho,
     513             :                         NDR_ECHO_SINKDATA, mem_ctx, r);
     514             : 
     515         267 :         return status;
     516             : }
     517             : 
     518             : struct dcerpc_echo_SinkData_state {
     519             :         struct echo_SinkData orig;
     520             :         struct echo_SinkData tmp;
     521             :         TALLOC_CTX *out_mem_ctx;
     522             : };
     523             : 
     524             : static void dcerpc_echo_SinkData_done(struct tevent_req *subreq);
     525             : 
     526           0 : struct tevent_req *dcerpc_echo_SinkData_send(TALLOC_CTX *mem_ctx,
     527             :                                              struct tevent_context *ev,
     528             :                                              struct dcerpc_binding_handle *h,
     529             :                                              uint32_t _len /* [in]  */,
     530             :                                              uint8_t *_data /* [in] [size_is(len)] */)
     531             : {
     532           0 :         struct tevent_req *req;
     533           0 :         struct dcerpc_echo_SinkData_state *state;
     534           0 :         struct tevent_req *subreq;
     535             : 
     536           0 :         req = tevent_req_create(mem_ctx, &state,
     537             :                                 struct dcerpc_echo_SinkData_state);
     538           0 :         if (req == NULL) {
     539           0 :                 return NULL;
     540             :         }
     541           0 :         state->out_mem_ctx = NULL;
     542             : 
     543             :         /* In parameters */
     544           0 :         state->orig.in.len = _len;
     545           0 :         state->orig.in.data = _data;
     546             : 
     547             :         /* Out parameters */
     548             : 
     549             :         /* make a temporary copy, that we pass to the dispatch function */
     550           0 :         state->tmp = state->orig;
     551             : 
     552           0 :         subreq = dcerpc_echo_SinkData_r_send(state, ev, h, &state->tmp);
     553           0 :         if (tevent_req_nomem(subreq, req)) {
     554           0 :                 return tevent_req_post(req, ev);
     555             :         }
     556           0 :         tevent_req_set_callback(subreq, dcerpc_echo_SinkData_done, req);
     557           0 :         return req;
     558             : }
     559             : 
     560           0 : static void dcerpc_echo_SinkData_done(struct tevent_req *subreq)
     561             : {
     562           0 :         struct tevent_req *req = tevent_req_callback_data(
     563             :                 subreq, struct tevent_req);
     564           0 :         struct dcerpc_echo_SinkData_state *state = tevent_req_data(
     565             :                 req, struct dcerpc_echo_SinkData_state);
     566           0 :         NTSTATUS status;
     567           0 :         TALLOC_CTX *mem_ctx;
     568             : 
     569           0 :         if (state->out_mem_ctx) {
     570           0 :                 mem_ctx = state->out_mem_ctx;
     571             :         } else {
     572           0 :                 mem_ctx = state;
     573             :         }
     574             : 
     575           0 :         status = dcerpc_echo_SinkData_r_recv(subreq, mem_ctx);
     576           0 :         TALLOC_FREE(subreq);
     577           0 :         if (tevent_req_nterror(req, status)) {
     578           0 :                 return;
     579             :         }
     580             : 
     581             :         /* Copy out parameters */
     582             : 
     583             :         /* Reset temporary structure */
     584           0 :         NDR_ZERO_STRUCT(state->tmp);
     585             : 
     586           0 :         tevent_req_done(req);
     587             : }
     588             : 
     589           0 : NTSTATUS dcerpc_echo_SinkData_recv(struct tevent_req *req,
     590             :                                    TALLOC_CTX *mem_ctx)
     591             : {
     592           0 :         struct dcerpc_echo_SinkData_state *state = tevent_req_data(
     593             :                 req, struct dcerpc_echo_SinkData_state);
     594           0 :         NTSTATUS status;
     595             : 
     596           0 :         if (tevent_req_is_nterror(req, &status)) {
     597           0 :                 tevent_req_received(req);
     598           0 :                 return status;
     599             :         }
     600             : 
     601             :         /* Steal possible out parameters to the callers context */
     602           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     603             : 
     604           0 :         tevent_req_received(req);
     605           0 :         return NT_STATUS_OK;
     606             : }
     607             : 
     608           0 : NTSTATUS dcerpc_echo_SinkData(struct dcerpc_binding_handle *h,
     609             :                               TALLOC_CTX *mem_ctx,
     610             :                               uint32_t _len /* [in]  */,
     611             :                               uint8_t *_data /* [in] [size_is(len)] */)
     612             : {
     613           0 :         struct echo_SinkData r;
     614           0 :         NTSTATUS status;
     615             : 
     616             :         /* In parameters */
     617           0 :         r.in.len = _len;
     618           0 :         r.in.data = _data;
     619             : 
     620             :         /* Out parameters */
     621             : 
     622           0 :         status = dcerpc_echo_SinkData_r(h, mem_ctx, &r);
     623           0 :         if (!NT_STATUS_IS_OK(status)) {
     624           0 :                 return status;
     625             :         }
     626             : 
     627             :         /* Return variables */
     628             : 
     629             :         /* Return result */
     630             : 
     631           0 :         return NT_STATUS_OK;
     632             : }
     633             : 
     634             : struct dcerpc_echo_SourceData_r_state {
     635             :         TALLOC_CTX *out_mem_ctx;
     636             : };
     637             : 
     638             : static void dcerpc_echo_SourceData_r_done(struct tevent_req *subreq);
     639             : 
     640           0 : struct tevent_req *dcerpc_echo_SourceData_r_send(TALLOC_CTX *mem_ctx,
     641             :         struct tevent_context *ev,
     642             :         struct dcerpc_binding_handle *h,
     643             :         struct echo_SourceData *r)
     644             : {
     645           0 :         struct tevent_req *req;
     646           0 :         struct dcerpc_echo_SourceData_r_state *state;
     647           0 :         struct tevent_req *subreq;
     648             : 
     649           0 :         req = tevent_req_create(mem_ctx, &state,
     650             :                                 struct dcerpc_echo_SourceData_r_state);
     651           0 :         if (req == NULL) {
     652           0 :                 return NULL;
     653             :         }
     654             : 
     655           0 :         state->out_mem_ctx = talloc_new(state);
     656           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     657           0 :                 return tevent_req_post(req, ev);
     658             :         }
     659             : 
     660           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     661             :                         NULL, &ndr_table_rpcecho,
     662           0 :                         NDR_ECHO_SOURCEDATA, state->out_mem_ctx, r);
     663           0 :         if (tevent_req_nomem(subreq, req)) {
     664           0 :                 return tevent_req_post(req, ev);
     665             :         }
     666           0 :         tevent_req_set_callback(subreq, dcerpc_echo_SourceData_r_done, req);
     667             : 
     668           0 :         return req;
     669             : }
     670             : 
     671           0 : static void dcerpc_echo_SourceData_r_done(struct tevent_req *subreq)
     672             : {
     673           0 :         struct tevent_req *req =
     674           0 :                 tevent_req_callback_data(subreq,
     675             :                 struct tevent_req);
     676           0 :         NTSTATUS status;
     677             : 
     678           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     679           0 :         TALLOC_FREE(subreq);
     680           0 :         if (tevent_req_nterror(req, status)) {
     681           0 :                 return;
     682             :         }
     683             : 
     684           0 :         tevent_req_done(req);
     685             : }
     686             : 
     687           0 : NTSTATUS dcerpc_echo_SourceData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     688             : {
     689           0 :         struct dcerpc_echo_SourceData_r_state *state =
     690           0 :                 tevent_req_data(req,
     691             :                 struct dcerpc_echo_SourceData_r_state);
     692           0 :         NTSTATUS status;
     693             : 
     694           0 :         if (tevent_req_is_nterror(req, &status)) {
     695           0 :                 tevent_req_received(req);
     696           0 :                 return status;
     697             :         }
     698             : 
     699           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     700             : 
     701           0 :         tevent_req_received(req);
     702           0 :         return NT_STATUS_OK;
     703             : }
     704             : 
     705         267 : NTSTATUS dcerpc_echo_SourceData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct echo_SourceData *r)
     706             : {
     707           2 :         NTSTATUS status;
     708             : 
     709         267 :         status = dcerpc_binding_handle_call(h,
     710             :                         NULL, &ndr_table_rpcecho,
     711             :                         NDR_ECHO_SOURCEDATA, mem_ctx, r);
     712             : 
     713         267 :         return status;
     714             : }
     715             : 
     716             : struct dcerpc_echo_SourceData_state {
     717             :         struct echo_SourceData orig;
     718             :         struct echo_SourceData tmp;
     719             :         TALLOC_CTX *out_mem_ctx;
     720             : };
     721             : 
     722             : static void dcerpc_echo_SourceData_done(struct tevent_req *subreq);
     723             : 
     724           0 : struct tevent_req *dcerpc_echo_SourceData_send(TALLOC_CTX *mem_ctx,
     725             :                                                struct tevent_context *ev,
     726             :                                                struct dcerpc_binding_handle *h,
     727             :                                                uint32_t _len /* [in]  */,
     728             :                                                uint8_t *_data /* [out] [size_is(len)] */)
     729             : {
     730           0 :         struct tevent_req *req;
     731           0 :         struct dcerpc_echo_SourceData_state *state;
     732           0 :         struct tevent_req *subreq;
     733             : 
     734           0 :         req = tevent_req_create(mem_ctx, &state,
     735             :                                 struct dcerpc_echo_SourceData_state);
     736           0 :         if (req == NULL) {
     737           0 :                 return NULL;
     738             :         }
     739           0 :         state->out_mem_ctx = NULL;
     740             : 
     741             :         /* In parameters */
     742           0 :         state->orig.in.len = _len;
     743             : 
     744             :         /* Out parameters */
     745           0 :         state->orig.out.data = _data;
     746             : 
     747           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     748             :                              "dcerpc_echo_SourceData_out_memory");
     749           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     750           0 :                 return tevent_req_post(req, ev);
     751             :         }
     752             : 
     753             :         /* make a temporary copy, that we pass to the dispatch function */
     754           0 :         state->tmp = state->orig;
     755             : 
     756           0 :         subreq = dcerpc_echo_SourceData_r_send(state, ev, h, &state->tmp);
     757           0 :         if (tevent_req_nomem(subreq, req)) {
     758           0 :                 return tevent_req_post(req, ev);
     759             :         }
     760           0 :         tevent_req_set_callback(subreq, dcerpc_echo_SourceData_done, req);
     761           0 :         return req;
     762             : }
     763             : 
     764           0 : static void dcerpc_echo_SourceData_done(struct tevent_req *subreq)
     765             : {
     766           0 :         struct tevent_req *req = tevent_req_callback_data(
     767             :                 subreq, struct tevent_req);
     768           0 :         struct dcerpc_echo_SourceData_state *state = tevent_req_data(
     769             :                 req, struct dcerpc_echo_SourceData_state);
     770           0 :         NTSTATUS status;
     771           0 :         TALLOC_CTX *mem_ctx;
     772             : 
     773           0 :         if (state->out_mem_ctx) {
     774           0 :                 mem_ctx = state->out_mem_ctx;
     775             :         } else {
     776           0 :                 mem_ctx = state;
     777             :         }
     778             : 
     779           0 :         status = dcerpc_echo_SourceData_r_recv(subreq, mem_ctx);
     780           0 :         TALLOC_FREE(subreq);
     781           0 :         if (tevent_req_nterror(req, status)) {
     782           0 :                 return;
     783             :         }
     784             : 
     785             :         /* Copy out parameters */
     786             :         {
     787           0 :                 size_t _copy_len_data;
     788           0 :                 _copy_len_data = state->tmp.in.len;
     789           0 :                 if (state->orig.out.data != state->tmp.out.data) {
     790           0 :                         memcpy(state->orig.out.data, state->tmp.out.data, _copy_len_data * sizeof(*state->orig.out.data));
     791             :                 }
     792             :         }
     793             : 
     794             :         /* Reset temporary structure */
     795           0 :         NDR_ZERO_STRUCT(state->tmp);
     796             : 
     797           0 :         tevent_req_done(req);
     798             : }
     799             : 
     800           0 : NTSTATUS dcerpc_echo_SourceData_recv(struct tevent_req *req,
     801             :                                      TALLOC_CTX *mem_ctx)
     802             : {
     803           0 :         struct dcerpc_echo_SourceData_state *state = tevent_req_data(
     804             :                 req, struct dcerpc_echo_SourceData_state);
     805           0 :         NTSTATUS status;
     806             : 
     807           0 :         if (tevent_req_is_nterror(req, &status)) {
     808           0 :                 tevent_req_received(req);
     809           0 :                 return status;
     810             :         }
     811             : 
     812             :         /* Steal possible out parameters to the callers context */
     813           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     814             : 
     815           0 :         tevent_req_received(req);
     816           0 :         return NT_STATUS_OK;
     817             : }
     818             : 
     819           0 : NTSTATUS dcerpc_echo_SourceData(struct dcerpc_binding_handle *h,
     820             :                                 TALLOC_CTX *mem_ctx,
     821             :                                 uint32_t _len /* [in]  */,
     822             :                                 uint8_t *_data /* [out] [size_is(len)] */)
     823             : {
     824           0 :         struct echo_SourceData r;
     825           0 :         NTSTATUS status;
     826             : 
     827             :         /* In parameters */
     828           0 :         r.in.len = _len;
     829             : 
     830             :         /* Out parameters */
     831           0 :         r.out.data = _data;
     832             : 
     833           0 :         status = dcerpc_echo_SourceData_r(h, mem_ctx, &r);
     834           0 :         if (!NT_STATUS_IS_OK(status)) {
     835           0 :                 return status;
     836             :         }
     837             : 
     838             :         /* Return variables */
     839             :         {
     840           0 :                 size_t _copy_len_data;
     841           0 :                 _copy_len_data = r.in.len;
     842           0 :                 if (_data != r.out.data) {
     843           0 :                         memcpy(_data, r.out.data, _copy_len_data * sizeof(*_data));
     844             :                 }
     845             :         }
     846             : 
     847             :         /* Return result */
     848             : 
     849           0 :         return NT_STATUS_OK;
     850             : }
     851             : 
     852             : struct dcerpc_echo_TestCall_r_state {
     853             :         TALLOC_CTX *out_mem_ctx;
     854             : };
     855             : 
     856             : static void dcerpc_echo_TestCall_r_done(struct tevent_req *subreq);
     857             : 
     858           0 : struct tevent_req *dcerpc_echo_TestCall_r_send(TALLOC_CTX *mem_ctx,
     859             :         struct tevent_context *ev,
     860             :         struct dcerpc_binding_handle *h,
     861             :         struct echo_TestCall *r)
     862             : {
     863           0 :         struct tevent_req *req;
     864           0 :         struct dcerpc_echo_TestCall_r_state *state;
     865           0 :         struct tevent_req *subreq;
     866             : 
     867           0 :         req = tevent_req_create(mem_ctx, &state,
     868             :                                 struct dcerpc_echo_TestCall_r_state);
     869           0 :         if (req == NULL) {
     870           0 :                 return NULL;
     871             :         }
     872             : 
     873           0 :         state->out_mem_ctx = talloc_new(state);
     874           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     875           0 :                 return tevent_req_post(req, ev);
     876             :         }
     877             : 
     878           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     879             :                         NULL, &ndr_table_rpcecho,
     880           0 :                         NDR_ECHO_TESTCALL, state->out_mem_ctx, r);
     881           0 :         if (tevent_req_nomem(subreq, req)) {
     882           0 :                 return tevent_req_post(req, ev);
     883             :         }
     884           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestCall_r_done, req);
     885             : 
     886           0 :         return req;
     887             : }
     888             : 
     889           0 : static void dcerpc_echo_TestCall_r_done(struct tevent_req *subreq)
     890             : {
     891           0 :         struct tevent_req *req =
     892           0 :                 tevent_req_callback_data(subreq,
     893             :                 struct tevent_req);
     894           0 :         NTSTATUS status;
     895             : 
     896           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     897           0 :         TALLOC_FREE(subreq);
     898           0 :         if (tevent_req_nterror(req, status)) {
     899           0 :                 return;
     900             :         }
     901             : 
     902           0 :         tevent_req_done(req);
     903             : }
     904             : 
     905           0 : NTSTATUS dcerpc_echo_TestCall_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     906             : {
     907           0 :         struct dcerpc_echo_TestCall_r_state *state =
     908           0 :                 tevent_req_data(req,
     909             :                 struct dcerpc_echo_TestCall_r_state);
     910           0 :         NTSTATUS status;
     911             : 
     912           0 :         if (tevent_req_is_nterror(req, &status)) {
     913           0 :                 tevent_req_received(req);
     914           0 :                 return status;
     915             :         }
     916             : 
     917           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     918             : 
     919           0 :         tevent_req_received(req);
     920           0 :         return NT_STATUS_OK;
     921             : }
     922             : 
     923         268 : NTSTATUS dcerpc_echo_TestCall_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct echo_TestCall *r)
     924             : {
     925           2 :         NTSTATUS status;
     926             : 
     927         268 :         status = dcerpc_binding_handle_call(h,
     928             :                         NULL, &ndr_table_rpcecho,
     929             :                         NDR_ECHO_TESTCALL, mem_ctx, r);
     930             : 
     931         268 :         return status;
     932             : }
     933             : 
     934             : struct dcerpc_echo_TestCall_state {
     935             :         struct echo_TestCall orig;
     936             :         struct echo_TestCall tmp;
     937             :         TALLOC_CTX *out_mem_ctx;
     938             : };
     939             : 
     940             : static void dcerpc_echo_TestCall_done(struct tevent_req *subreq);
     941             : 
     942           0 : struct tevent_req *dcerpc_echo_TestCall_send(TALLOC_CTX *mem_ctx,
     943             :                                              struct tevent_context *ev,
     944             :                                              struct dcerpc_binding_handle *h,
     945             :                                              const char *_s1 /* [in] [charset(UTF16),ref] */,
     946             :                                              const char **_s2 /* [out] [charset(UTF16),ref] */)
     947             : {
     948           0 :         struct tevent_req *req;
     949           0 :         struct dcerpc_echo_TestCall_state *state;
     950           0 :         struct tevent_req *subreq;
     951             : 
     952           0 :         req = tevent_req_create(mem_ctx, &state,
     953             :                                 struct dcerpc_echo_TestCall_state);
     954           0 :         if (req == NULL) {
     955           0 :                 return NULL;
     956             :         }
     957           0 :         state->out_mem_ctx = NULL;
     958             : 
     959             :         /* In parameters */
     960           0 :         state->orig.in.s1 = _s1;
     961             : 
     962             :         /* Out parameters */
     963           0 :         state->orig.out.s2 = _s2;
     964             : 
     965           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     966             :                              "dcerpc_echo_TestCall_out_memory");
     967           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     968           0 :                 return tevent_req_post(req, ev);
     969             :         }
     970             : 
     971             :         /* make a temporary copy, that we pass to the dispatch function */
     972           0 :         state->tmp = state->orig;
     973             : 
     974           0 :         subreq = dcerpc_echo_TestCall_r_send(state, ev, h, &state->tmp);
     975           0 :         if (tevent_req_nomem(subreq, req)) {
     976           0 :                 return tevent_req_post(req, ev);
     977             :         }
     978           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestCall_done, req);
     979           0 :         return req;
     980             : }
     981             : 
     982           0 : static void dcerpc_echo_TestCall_done(struct tevent_req *subreq)
     983             : {
     984           0 :         struct tevent_req *req = tevent_req_callback_data(
     985             :                 subreq, struct tevent_req);
     986           0 :         struct dcerpc_echo_TestCall_state *state = tevent_req_data(
     987             :                 req, struct dcerpc_echo_TestCall_state);
     988           0 :         NTSTATUS status;
     989           0 :         TALLOC_CTX *mem_ctx;
     990             : 
     991           0 :         if (state->out_mem_ctx) {
     992           0 :                 mem_ctx = state->out_mem_ctx;
     993             :         } else {
     994           0 :                 mem_ctx = state;
     995             :         }
     996             : 
     997           0 :         status = dcerpc_echo_TestCall_r_recv(subreq, mem_ctx);
     998           0 :         TALLOC_FREE(subreq);
     999           0 :         if (tevent_req_nterror(req, status)) {
    1000           0 :                 return;
    1001             :         }
    1002             : 
    1003             :         /* Copy out parameters */
    1004           0 :         *state->orig.out.s2 = *state->tmp.out.s2;
    1005             : 
    1006             :         /* Reset temporary structure */
    1007           0 :         NDR_ZERO_STRUCT(state->tmp);
    1008             : 
    1009           0 :         tevent_req_done(req);
    1010             : }
    1011             : 
    1012           0 : NTSTATUS dcerpc_echo_TestCall_recv(struct tevent_req *req,
    1013             :                                    TALLOC_CTX *mem_ctx)
    1014             : {
    1015           0 :         struct dcerpc_echo_TestCall_state *state = tevent_req_data(
    1016             :                 req, struct dcerpc_echo_TestCall_state);
    1017           0 :         NTSTATUS status;
    1018             : 
    1019           0 :         if (tevent_req_is_nterror(req, &status)) {
    1020           0 :                 tevent_req_received(req);
    1021           0 :                 return status;
    1022             :         }
    1023             : 
    1024             :         /* Steal possible out parameters to the callers context */
    1025           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1026             : 
    1027           0 :         tevent_req_received(req);
    1028           0 :         return NT_STATUS_OK;
    1029             : }
    1030             : 
    1031           0 : NTSTATUS dcerpc_echo_TestCall(struct dcerpc_binding_handle *h,
    1032             :                               TALLOC_CTX *mem_ctx,
    1033             :                               const char *_s1 /* [in] [charset(UTF16),ref] */,
    1034             :                               const char **_s2 /* [out] [charset(UTF16),ref] */)
    1035             : {
    1036           0 :         struct echo_TestCall r;
    1037           0 :         NTSTATUS status;
    1038             : 
    1039             :         /* In parameters */
    1040           0 :         r.in.s1 = _s1;
    1041             : 
    1042             :         /* Out parameters */
    1043           0 :         r.out.s2 = _s2;
    1044             : 
    1045           0 :         status = dcerpc_echo_TestCall_r(h, mem_ctx, &r);
    1046           0 :         if (!NT_STATUS_IS_OK(status)) {
    1047           0 :                 return status;
    1048             :         }
    1049             : 
    1050             :         /* Return variables */
    1051           0 :         *_s2 = *r.out.s2;
    1052             : 
    1053             :         /* Return result */
    1054             : 
    1055           0 :         return NT_STATUS_OK;
    1056             : }
    1057             : 
    1058             : struct dcerpc_echo_TestCall2_r_state {
    1059             :         TALLOC_CTX *out_mem_ctx;
    1060             : };
    1061             : 
    1062             : static void dcerpc_echo_TestCall2_r_done(struct tevent_req *subreq);
    1063             : 
    1064           0 : struct tevent_req *dcerpc_echo_TestCall2_r_send(TALLOC_CTX *mem_ctx,
    1065             :         struct tevent_context *ev,
    1066             :         struct dcerpc_binding_handle *h,
    1067             :         struct echo_TestCall2 *r)
    1068             : {
    1069           0 :         struct tevent_req *req;
    1070           0 :         struct dcerpc_echo_TestCall2_r_state *state;
    1071           0 :         struct tevent_req *subreq;
    1072             : 
    1073           0 :         req = tevent_req_create(mem_ctx, &state,
    1074             :                                 struct dcerpc_echo_TestCall2_r_state);
    1075           0 :         if (req == NULL) {
    1076           0 :                 return NULL;
    1077             :         }
    1078             : 
    1079           0 :         state->out_mem_ctx = talloc_new(state);
    1080           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1081           0 :                 return tevent_req_post(req, ev);
    1082             :         }
    1083             : 
    1084           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1085             :                         NULL, &ndr_table_rpcecho,
    1086           0 :                         NDR_ECHO_TESTCALL2, state->out_mem_ctx, r);
    1087           0 :         if (tevent_req_nomem(subreq, req)) {
    1088           0 :                 return tevent_req_post(req, ev);
    1089             :         }
    1090           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestCall2_r_done, req);
    1091             : 
    1092           0 :         return req;
    1093             : }
    1094             : 
    1095           0 : static void dcerpc_echo_TestCall2_r_done(struct tevent_req *subreq)
    1096             : {
    1097           0 :         struct tevent_req *req =
    1098           0 :                 tevent_req_callback_data(subreq,
    1099             :                 struct tevent_req);
    1100           0 :         NTSTATUS status;
    1101             : 
    1102           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1103           0 :         TALLOC_FREE(subreq);
    1104           0 :         if (tevent_req_nterror(req, status)) {
    1105           0 :                 return;
    1106             :         }
    1107             : 
    1108           0 :         tevent_req_done(req);
    1109             : }
    1110             : 
    1111           0 : NTSTATUS dcerpc_echo_TestCall2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1112             : {
    1113           0 :         struct dcerpc_echo_TestCall2_r_state *state =
    1114           0 :                 tevent_req_data(req,
    1115             :                 struct dcerpc_echo_TestCall2_r_state);
    1116           0 :         NTSTATUS status;
    1117             : 
    1118           0 :         if (tevent_req_is_nterror(req, &status)) {
    1119           0 :                 tevent_req_received(req);
    1120           0 :                 return status;
    1121             :         }
    1122             : 
    1123           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1124             : 
    1125           0 :         tevent_req_received(req);
    1126           0 :         return NT_STATUS_OK;
    1127             : }
    1128             : 
    1129        1845 : NTSTATUS dcerpc_echo_TestCall2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct echo_TestCall2 *r)
    1130             : {
    1131          14 :         NTSTATUS status;
    1132             : 
    1133        1845 :         status = dcerpc_binding_handle_call(h,
    1134             :                         NULL, &ndr_table_rpcecho,
    1135             :                         NDR_ECHO_TESTCALL2, mem_ctx, r);
    1136             : 
    1137        1845 :         return status;
    1138             : }
    1139             : 
    1140             : struct dcerpc_echo_TestCall2_state {
    1141             :         struct echo_TestCall2 orig;
    1142             :         struct echo_TestCall2 tmp;
    1143             :         TALLOC_CTX *out_mem_ctx;
    1144             : };
    1145             : 
    1146             : static void dcerpc_echo_TestCall2_done(struct tevent_req *subreq);
    1147             : 
    1148           0 : struct tevent_req *dcerpc_echo_TestCall2_send(TALLOC_CTX *mem_ctx,
    1149             :                                               struct tevent_context *ev,
    1150             :                                               struct dcerpc_binding_handle *h,
    1151             :                                               uint16_t _level /* [in]  */,
    1152             :                                               union echo_Info *_info /* [out] [ref,switch_is(level)] */)
    1153             : {
    1154           0 :         struct tevent_req *req;
    1155           0 :         struct dcerpc_echo_TestCall2_state *state;
    1156           0 :         struct tevent_req *subreq;
    1157             : 
    1158           0 :         req = tevent_req_create(mem_ctx, &state,
    1159             :                                 struct dcerpc_echo_TestCall2_state);
    1160           0 :         if (req == NULL) {
    1161           0 :                 return NULL;
    1162             :         }
    1163           0 :         state->out_mem_ctx = NULL;
    1164             : 
    1165             :         /* In parameters */
    1166           0 :         state->orig.in.level = _level;
    1167             : 
    1168             :         /* Out parameters */
    1169           0 :         state->orig.out.info = _info;
    1170             : 
    1171             :         /* Result */
    1172           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1173             : 
    1174           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1175             :                              "dcerpc_echo_TestCall2_out_memory");
    1176           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1177           0 :                 return tevent_req_post(req, ev);
    1178             :         }
    1179             : 
    1180             :         /* make a temporary copy, that we pass to the dispatch function */
    1181           0 :         state->tmp = state->orig;
    1182             : 
    1183           0 :         subreq = dcerpc_echo_TestCall2_r_send(state, ev, h, &state->tmp);
    1184           0 :         if (tevent_req_nomem(subreq, req)) {
    1185           0 :                 return tevent_req_post(req, ev);
    1186             :         }
    1187           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestCall2_done, req);
    1188           0 :         return req;
    1189             : }
    1190             : 
    1191           0 : static void dcerpc_echo_TestCall2_done(struct tevent_req *subreq)
    1192             : {
    1193           0 :         struct tevent_req *req = tevent_req_callback_data(
    1194             :                 subreq, struct tevent_req);
    1195           0 :         struct dcerpc_echo_TestCall2_state *state = tevent_req_data(
    1196             :                 req, struct dcerpc_echo_TestCall2_state);
    1197           0 :         NTSTATUS status;
    1198           0 :         TALLOC_CTX *mem_ctx;
    1199             : 
    1200           0 :         if (state->out_mem_ctx) {
    1201           0 :                 mem_ctx = state->out_mem_ctx;
    1202             :         } else {
    1203           0 :                 mem_ctx = state;
    1204             :         }
    1205             : 
    1206           0 :         status = dcerpc_echo_TestCall2_r_recv(subreq, mem_ctx);
    1207           0 :         TALLOC_FREE(subreq);
    1208           0 :         if (tevent_req_nterror(req, status)) {
    1209           0 :                 return;
    1210             :         }
    1211             : 
    1212             :         /* Copy out parameters */
    1213           0 :         *state->orig.out.info = *state->tmp.out.info;
    1214             : 
    1215             :         /* Copy result */
    1216           0 :         state->orig.out.result = state->tmp.out.result;
    1217             : 
    1218             :         /* Reset temporary structure */
    1219           0 :         NDR_ZERO_STRUCT(state->tmp);
    1220             : 
    1221           0 :         tevent_req_done(req);
    1222             : }
    1223             : 
    1224           0 : NTSTATUS dcerpc_echo_TestCall2_recv(struct tevent_req *req,
    1225             :                                     TALLOC_CTX *mem_ctx,
    1226             :                                     NTSTATUS *result)
    1227             : {
    1228           0 :         struct dcerpc_echo_TestCall2_state *state = tevent_req_data(
    1229             :                 req, struct dcerpc_echo_TestCall2_state);
    1230           0 :         NTSTATUS status;
    1231             : 
    1232           0 :         if (tevent_req_is_nterror(req, &status)) {
    1233           0 :                 tevent_req_received(req);
    1234           0 :                 return status;
    1235             :         }
    1236             : 
    1237             :         /* Steal possible out parameters to the callers context */
    1238           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1239             : 
    1240             :         /* Return result */
    1241           0 :         *result = state->orig.out.result;
    1242             : 
    1243           0 :         tevent_req_received(req);
    1244           0 :         return NT_STATUS_OK;
    1245             : }
    1246             : 
    1247           0 : NTSTATUS dcerpc_echo_TestCall2(struct dcerpc_binding_handle *h,
    1248             :                                TALLOC_CTX *mem_ctx,
    1249             :                                uint16_t _level /* [in]  */,
    1250             :                                union echo_Info *_info /* [out] [ref,switch_is(level)] */,
    1251             :                                NTSTATUS *result)
    1252             : {
    1253           0 :         struct echo_TestCall2 r;
    1254           0 :         NTSTATUS status;
    1255             : 
    1256             :         /* In parameters */
    1257           0 :         r.in.level = _level;
    1258             : 
    1259             :         /* Out parameters */
    1260           0 :         r.out.info = _info;
    1261             : 
    1262             :         /* Result */
    1263           0 :         NDR_ZERO_STRUCT(r.out.result);
    1264             : 
    1265           0 :         status = dcerpc_echo_TestCall2_r(h, mem_ctx, &r);
    1266           0 :         if (!NT_STATUS_IS_OK(status)) {
    1267           0 :                 return status;
    1268             :         }
    1269             : 
    1270             :         /* Return variables */
    1271           0 :         *_info = *r.out.info;
    1272             : 
    1273             :         /* Return result */
    1274           0 :         *result = r.out.result;
    1275             : 
    1276           0 :         return NT_STATUS_OK;
    1277             : }
    1278             : 
    1279             : struct dcerpc_echo_TestSleep_r_state {
    1280             :         TALLOC_CTX *out_mem_ctx;
    1281             : };
    1282             : 
    1283             : static void dcerpc_echo_TestSleep_r_done(struct tevent_req *subreq);
    1284             : 
    1285         135 : struct tevent_req *dcerpc_echo_TestSleep_r_send(TALLOC_CTX *mem_ctx,
    1286             :         struct tevent_context *ev,
    1287             :         struct dcerpc_binding_handle *h,
    1288             :         struct echo_TestSleep *r)
    1289             : {
    1290           0 :         struct tevent_req *req;
    1291           0 :         struct dcerpc_echo_TestSleep_r_state *state;
    1292           0 :         struct tevent_req *subreq;
    1293             : 
    1294         135 :         req = tevent_req_create(mem_ctx, &state,
    1295             :                                 struct dcerpc_echo_TestSleep_r_state);
    1296         135 :         if (req == NULL) {
    1297           0 :                 return NULL;
    1298             :         }
    1299             : 
    1300         135 :         state->out_mem_ctx = NULL;
    1301             : 
    1302         135 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1303             :                         NULL, &ndr_table_rpcecho,
    1304             :                         NDR_ECHO_TESTSLEEP, state, r);
    1305         135 :         if (tevent_req_nomem(subreq, req)) {
    1306           0 :                 return tevent_req_post(req, ev);
    1307             :         }
    1308         135 :         tevent_req_set_callback(subreq, dcerpc_echo_TestSleep_r_done, req);
    1309             : 
    1310         135 :         return req;
    1311             : }
    1312             : 
    1313         135 : static void dcerpc_echo_TestSleep_r_done(struct tevent_req *subreq)
    1314             : {
    1315           0 :         struct tevent_req *req =
    1316         135 :                 tevent_req_callback_data(subreq,
    1317             :                 struct tevent_req);
    1318           0 :         NTSTATUS status;
    1319             : 
    1320         135 :         status = dcerpc_binding_handle_call_recv(subreq);
    1321         135 :         TALLOC_FREE(subreq);
    1322         135 :         if (tevent_req_nterror(req, status)) {
    1323           0 :                 return;
    1324             :         }
    1325             : 
    1326         135 :         tevent_req_done(req);
    1327             : }
    1328             : 
    1329         135 : NTSTATUS dcerpc_echo_TestSleep_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1330             : {
    1331           0 :         struct dcerpc_echo_TestSleep_r_state *state =
    1332         135 :                 tevent_req_data(req,
    1333             :                 struct dcerpc_echo_TestSleep_r_state);
    1334           0 :         NTSTATUS status;
    1335             : 
    1336         135 :         if (tevent_req_is_nterror(req, &status)) {
    1337           0 :                 tevent_req_received(req);
    1338           0 :                 return status;
    1339             :         }
    1340             : 
    1341         135 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1342             : 
    1343         135 :         tevent_req_received(req);
    1344         135 :         return NT_STATUS_OK;
    1345             : }
    1346             : 
    1347           0 : NTSTATUS dcerpc_echo_TestSleep_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r)
    1348             : {
    1349           0 :         NTSTATUS status;
    1350             : 
    1351           0 :         status = dcerpc_binding_handle_call(h,
    1352             :                         NULL, &ndr_table_rpcecho,
    1353             :                         NDR_ECHO_TESTSLEEP, mem_ctx, r);
    1354             : 
    1355           0 :         return status;
    1356             : }
    1357             : 
    1358             : struct dcerpc_echo_TestSleep_state {
    1359             :         struct echo_TestSleep orig;
    1360             :         struct echo_TestSleep tmp;
    1361             :         TALLOC_CTX *out_mem_ctx;
    1362             : };
    1363             : 
    1364             : static void dcerpc_echo_TestSleep_done(struct tevent_req *subreq);
    1365             : 
    1366           0 : struct tevent_req *dcerpc_echo_TestSleep_send(TALLOC_CTX *mem_ctx,
    1367             :                                               struct tevent_context *ev,
    1368             :                                               struct dcerpc_binding_handle *h,
    1369             :                                               uint32_t _seconds /* [in]  */)
    1370             : {
    1371           0 :         struct tevent_req *req;
    1372           0 :         struct dcerpc_echo_TestSleep_state *state;
    1373           0 :         struct tevent_req *subreq;
    1374             : 
    1375           0 :         req = tevent_req_create(mem_ctx, &state,
    1376             :                                 struct dcerpc_echo_TestSleep_state);
    1377           0 :         if (req == NULL) {
    1378           0 :                 return NULL;
    1379             :         }
    1380           0 :         state->out_mem_ctx = NULL;
    1381             : 
    1382             :         /* In parameters */
    1383           0 :         state->orig.in.seconds = _seconds;
    1384             : 
    1385             :         /* Out parameters */
    1386             : 
    1387             :         /* Result */
    1388           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1389             : 
    1390             :         /* make a temporary copy, that we pass to the dispatch function */
    1391           0 :         state->tmp = state->orig;
    1392             : 
    1393           0 :         subreq = dcerpc_echo_TestSleep_r_send(state, ev, h, &state->tmp);
    1394           0 :         if (tevent_req_nomem(subreq, req)) {
    1395           0 :                 return tevent_req_post(req, ev);
    1396             :         }
    1397           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestSleep_done, req);
    1398           0 :         return req;
    1399             : }
    1400             : 
    1401           0 : static void dcerpc_echo_TestSleep_done(struct tevent_req *subreq)
    1402             : {
    1403           0 :         struct tevent_req *req = tevent_req_callback_data(
    1404             :                 subreq, struct tevent_req);
    1405           0 :         struct dcerpc_echo_TestSleep_state *state = tevent_req_data(
    1406             :                 req, struct dcerpc_echo_TestSleep_state);
    1407           0 :         NTSTATUS status;
    1408           0 :         TALLOC_CTX *mem_ctx;
    1409             : 
    1410           0 :         if (state->out_mem_ctx) {
    1411           0 :                 mem_ctx = state->out_mem_ctx;
    1412             :         } else {
    1413           0 :                 mem_ctx = state;
    1414             :         }
    1415             : 
    1416           0 :         status = dcerpc_echo_TestSleep_r_recv(subreq, mem_ctx);
    1417           0 :         TALLOC_FREE(subreq);
    1418           0 :         if (tevent_req_nterror(req, status)) {
    1419           0 :                 return;
    1420             :         }
    1421             : 
    1422             :         /* Copy out parameters */
    1423             : 
    1424             :         /* Copy result */
    1425           0 :         state->orig.out.result = state->tmp.out.result;
    1426             : 
    1427             :         /* Reset temporary structure */
    1428           0 :         NDR_ZERO_STRUCT(state->tmp);
    1429             : 
    1430           0 :         tevent_req_done(req);
    1431             : }
    1432             : 
    1433           0 : NTSTATUS dcerpc_echo_TestSleep_recv(struct tevent_req *req,
    1434             :                                     TALLOC_CTX *mem_ctx,
    1435             :                                     uint32_t *result)
    1436             : {
    1437           0 :         struct dcerpc_echo_TestSleep_state *state = tevent_req_data(
    1438             :                 req, struct dcerpc_echo_TestSleep_state);
    1439           0 :         NTSTATUS status;
    1440             : 
    1441           0 :         if (tevent_req_is_nterror(req, &status)) {
    1442           0 :                 tevent_req_received(req);
    1443           0 :                 return status;
    1444             :         }
    1445             : 
    1446             :         /* Steal possible out parameters to the callers context */
    1447           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1448             : 
    1449             :         /* Return result */
    1450           0 :         *result = state->orig.out.result;
    1451             : 
    1452           0 :         tevent_req_received(req);
    1453           0 :         return NT_STATUS_OK;
    1454             : }
    1455             : 
    1456           0 : NTSTATUS dcerpc_echo_TestSleep(struct dcerpc_binding_handle *h,
    1457             :                                TALLOC_CTX *mem_ctx,
    1458             :                                uint32_t _seconds /* [in]  */,
    1459             :                                uint32_t *result)
    1460             : {
    1461           0 :         struct echo_TestSleep r;
    1462           0 :         NTSTATUS status;
    1463             : 
    1464             :         /* In parameters */
    1465           0 :         r.in.seconds = _seconds;
    1466             : 
    1467             :         /* Out parameters */
    1468             : 
    1469             :         /* Result */
    1470           0 :         NDR_ZERO_STRUCT(r.out.result);
    1471             : 
    1472           0 :         status = dcerpc_echo_TestSleep_r(h, mem_ctx, &r);
    1473           0 :         if (!NT_STATUS_IS_OK(status)) {
    1474           0 :                 return status;
    1475             :         }
    1476             : 
    1477             :         /* Return variables */
    1478             : 
    1479             :         /* Return result */
    1480           0 :         *result = r.out.result;
    1481             : 
    1482           0 :         return NT_STATUS_OK;
    1483             : }
    1484             : 
    1485             : struct dcerpc_echo_TestEnum_r_state {
    1486             :         TALLOC_CTX *out_mem_ctx;
    1487             : };
    1488             : 
    1489             : static void dcerpc_echo_TestEnum_r_done(struct tevent_req *subreq);
    1490             : 
    1491           0 : struct tevent_req *dcerpc_echo_TestEnum_r_send(TALLOC_CTX *mem_ctx,
    1492             :         struct tevent_context *ev,
    1493             :         struct dcerpc_binding_handle *h,
    1494             :         struct echo_TestEnum *r)
    1495             : {
    1496           0 :         struct tevent_req *req;
    1497           0 :         struct dcerpc_echo_TestEnum_r_state *state;
    1498           0 :         struct tevent_req *subreq;
    1499             : 
    1500           0 :         req = tevent_req_create(mem_ctx, &state,
    1501             :                                 struct dcerpc_echo_TestEnum_r_state);
    1502           0 :         if (req == NULL) {
    1503           0 :                 return NULL;
    1504             :         }
    1505             : 
    1506           0 :         state->out_mem_ctx = talloc_new(state);
    1507           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1508           0 :                 return tevent_req_post(req, ev);
    1509             :         }
    1510             : 
    1511           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1512             :                         NULL, &ndr_table_rpcecho,
    1513           0 :                         NDR_ECHO_TESTENUM, state->out_mem_ctx, r);
    1514           0 :         if (tevent_req_nomem(subreq, req)) {
    1515           0 :                 return tevent_req_post(req, ev);
    1516             :         }
    1517           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestEnum_r_done, req);
    1518             : 
    1519           0 :         return req;
    1520             : }
    1521             : 
    1522           0 : static void dcerpc_echo_TestEnum_r_done(struct tevent_req *subreq)
    1523             : {
    1524           0 :         struct tevent_req *req =
    1525           0 :                 tevent_req_callback_data(subreq,
    1526             :                 struct tevent_req);
    1527           0 :         NTSTATUS status;
    1528             : 
    1529           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1530           0 :         TALLOC_FREE(subreq);
    1531           0 :         if (tevent_req_nterror(req, status)) {
    1532           0 :                 return;
    1533             :         }
    1534             : 
    1535           0 :         tevent_req_done(req);
    1536             : }
    1537             : 
    1538           0 : NTSTATUS dcerpc_echo_TestEnum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1539             : {
    1540           0 :         struct dcerpc_echo_TestEnum_r_state *state =
    1541           0 :                 tevent_req_data(req,
    1542             :                 struct dcerpc_echo_TestEnum_r_state);
    1543           0 :         NTSTATUS status;
    1544             : 
    1545           0 :         if (tevent_req_is_nterror(req, &status)) {
    1546           0 :                 tevent_req_received(req);
    1547           0 :                 return status;
    1548             :         }
    1549             : 
    1550           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1551             : 
    1552           0 :         tevent_req_received(req);
    1553           0 :         return NT_STATUS_OK;
    1554             : }
    1555             : 
    1556         267 : NTSTATUS dcerpc_echo_TestEnum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct echo_TestEnum *r)
    1557             : {
    1558           2 :         NTSTATUS status;
    1559             : 
    1560         267 :         status = dcerpc_binding_handle_call(h,
    1561             :                         NULL, &ndr_table_rpcecho,
    1562             :                         NDR_ECHO_TESTENUM, mem_ctx, r);
    1563             : 
    1564         267 :         return status;
    1565             : }
    1566             : 
    1567             : struct dcerpc_echo_TestEnum_state {
    1568             :         struct echo_TestEnum orig;
    1569             :         struct echo_TestEnum tmp;
    1570             :         TALLOC_CTX *out_mem_ctx;
    1571             : };
    1572             : 
    1573             : static void dcerpc_echo_TestEnum_done(struct tevent_req *subreq);
    1574             : 
    1575           0 : struct tevent_req *dcerpc_echo_TestEnum_send(TALLOC_CTX *mem_ctx,
    1576             :                                              struct tevent_context *ev,
    1577             :                                              struct dcerpc_binding_handle *h,
    1578             :                                              enum echo_Enum1 *_foo1 /* [in,out] [ref] */,
    1579             :                                              struct echo_Enum2 *_foo2 /* [in,out] [ref] */,
    1580             :                                              union echo_Enum3 *_foo3 /* [in,out] [ref,switch_is(*foo1)] */)
    1581             : {
    1582           0 :         struct tevent_req *req;
    1583           0 :         struct dcerpc_echo_TestEnum_state *state;
    1584           0 :         struct tevent_req *subreq;
    1585             : 
    1586           0 :         req = tevent_req_create(mem_ctx, &state,
    1587             :                                 struct dcerpc_echo_TestEnum_state);
    1588           0 :         if (req == NULL) {
    1589           0 :                 return NULL;
    1590             :         }
    1591           0 :         state->out_mem_ctx = NULL;
    1592             : 
    1593             :         /* In parameters */
    1594           0 :         state->orig.in.foo1 = _foo1;
    1595           0 :         state->orig.in.foo2 = _foo2;
    1596           0 :         state->orig.in.foo3 = _foo3;
    1597             : 
    1598             :         /* Out parameters */
    1599           0 :         state->orig.out.foo1 = _foo1;
    1600           0 :         state->orig.out.foo2 = _foo2;
    1601           0 :         state->orig.out.foo3 = _foo3;
    1602             : 
    1603           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1604             :                              "dcerpc_echo_TestEnum_out_memory");
    1605           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1606           0 :                 return tevent_req_post(req, ev);
    1607             :         }
    1608             : 
    1609             :         /* make a temporary copy, that we pass to the dispatch function */
    1610           0 :         state->tmp = state->orig;
    1611             : 
    1612           0 :         subreq = dcerpc_echo_TestEnum_r_send(state, ev, h, &state->tmp);
    1613           0 :         if (tevent_req_nomem(subreq, req)) {
    1614           0 :                 return tevent_req_post(req, ev);
    1615             :         }
    1616           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestEnum_done, req);
    1617           0 :         return req;
    1618             : }
    1619             : 
    1620           0 : static void dcerpc_echo_TestEnum_done(struct tevent_req *subreq)
    1621             : {
    1622           0 :         struct tevent_req *req = tevent_req_callback_data(
    1623             :                 subreq, struct tevent_req);
    1624           0 :         struct dcerpc_echo_TestEnum_state *state = tevent_req_data(
    1625             :                 req, struct dcerpc_echo_TestEnum_state);
    1626           0 :         NTSTATUS status;
    1627           0 :         TALLOC_CTX *mem_ctx;
    1628             : 
    1629           0 :         if (state->out_mem_ctx) {
    1630           0 :                 mem_ctx = state->out_mem_ctx;
    1631             :         } else {
    1632           0 :                 mem_ctx = state;
    1633             :         }
    1634             : 
    1635           0 :         status = dcerpc_echo_TestEnum_r_recv(subreq, mem_ctx);
    1636           0 :         TALLOC_FREE(subreq);
    1637           0 :         if (tevent_req_nterror(req, status)) {
    1638           0 :                 return;
    1639             :         }
    1640             : 
    1641             :         /* Copy out parameters */
    1642           0 :         *state->orig.out.foo1 = *state->tmp.out.foo1;
    1643           0 :         *state->orig.out.foo2 = *state->tmp.out.foo2;
    1644           0 :         *state->orig.out.foo3 = *state->tmp.out.foo3;
    1645             : 
    1646             :         /* Reset temporary structure */
    1647           0 :         NDR_ZERO_STRUCT(state->tmp);
    1648             : 
    1649           0 :         tevent_req_done(req);
    1650             : }
    1651             : 
    1652           0 : NTSTATUS dcerpc_echo_TestEnum_recv(struct tevent_req *req,
    1653             :                                    TALLOC_CTX *mem_ctx)
    1654             : {
    1655           0 :         struct dcerpc_echo_TestEnum_state *state = tevent_req_data(
    1656             :                 req, struct dcerpc_echo_TestEnum_state);
    1657           0 :         NTSTATUS status;
    1658             : 
    1659           0 :         if (tevent_req_is_nterror(req, &status)) {
    1660           0 :                 tevent_req_received(req);
    1661           0 :                 return status;
    1662             :         }
    1663             : 
    1664             :         /* Steal possible out parameters to the callers context */
    1665           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1666             : 
    1667           0 :         tevent_req_received(req);
    1668           0 :         return NT_STATUS_OK;
    1669             : }
    1670             : 
    1671           0 : NTSTATUS dcerpc_echo_TestEnum(struct dcerpc_binding_handle *h,
    1672             :                               TALLOC_CTX *mem_ctx,
    1673             :                               enum echo_Enum1 *_foo1 /* [in,out] [ref] */,
    1674             :                               struct echo_Enum2 *_foo2 /* [in,out] [ref] */,
    1675             :                               union echo_Enum3 *_foo3 /* [in,out] [ref,switch_is(*foo1)] */)
    1676             : {
    1677           0 :         struct echo_TestEnum r;
    1678           0 :         NTSTATUS status;
    1679             : 
    1680             :         /* In parameters */
    1681           0 :         r.in.foo1 = _foo1;
    1682           0 :         r.in.foo2 = _foo2;
    1683           0 :         r.in.foo3 = _foo3;
    1684             : 
    1685             :         /* Out parameters */
    1686           0 :         r.out.foo1 = _foo1;
    1687           0 :         r.out.foo2 = _foo2;
    1688           0 :         r.out.foo3 = _foo3;
    1689             : 
    1690           0 :         status = dcerpc_echo_TestEnum_r(h, mem_ctx, &r);
    1691           0 :         if (!NT_STATUS_IS_OK(status)) {
    1692           0 :                 return status;
    1693             :         }
    1694             : 
    1695             :         /* Return variables */
    1696           0 :         *_foo1 = *r.out.foo1;
    1697           0 :         *_foo2 = *r.out.foo2;
    1698           0 :         *_foo3 = *r.out.foo3;
    1699             : 
    1700             :         /* Return result */
    1701             : 
    1702           0 :         return NT_STATUS_OK;
    1703             : }
    1704             : 
    1705             : struct dcerpc_echo_TestSurrounding_r_state {
    1706             :         TALLOC_CTX *out_mem_ctx;
    1707             : };
    1708             : 
    1709             : static void dcerpc_echo_TestSurrounding_r_done(struct tevent_req *subreq);
    1710             : 
    1711           0 : struct tevent_req *dcerpc_echo_TestSurrounding_r_send(TALLOC_CTX *mem_ctx,
    1712             :         struct tevent_context *ev,
    1713             :         struct dcerpc_binding_handle *h,
    1714             :         struct echo_TestSurrounding *r)
    1715             : {
    1716           0 :         struct tevent_req *req;
    1717           0 :         struct dcerpc_echo_TestSurrounding_r_state *state;
    1718           0 :         struct tevent_req *subreq;
    1719             : 
    1720           0 :         req = tevent_req_create(mem_ctx, &state,
    1721             :                                 struct dcerpc_echo_TestSurrounding_r_state);
    1722           0 :         if (req == NULL) {
    1723           0 :                 return NULL;
    1724             :         }
    1725             : 
    1726           0 :         state->out_mem_ctx = talloc_new(state);
    1727           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1728           0 :                 return tevent_req_post(req, ev);
    1729             :         }
    1730             : 
    1731           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1732             :                         NULL, &ndr_table_rpcecho,
    1733           0 :                         NDR_ECHO_TESTSURROUNDING, state->out_mem_ctx, r);
    1734           0 :         if (tevent_req_nomem(subreq, req)) {
    1735           0 :                 return tevent_req_post(req, ev);
    1736             :         }
    1737           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestSurrounding_r_done, req);
    1738             : 
    1739           0 :         return req;
    1740             : }
    1741             : 
    1742           0 : static void dcerpc_echo_TestSurrounding_r_done(struct tevent_req *subreq)
    1743             : {
    1744           0 :         struct tevent_req *req =
    1745           0 :                 tevent_req_callback_data(subreq,
    1746             :                 struct tevent_req);
    1747           0 :         NTSTATUS status;
    1748             : 
    1749           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1750           0 :         TALLOC_FREE(subreq);
    1751           0 :         if (tevent_req_nterror(req, status)) {
    1752           0 :                 return;
    1753             :         }
    1754             : 
    1755           0 :         tevent_req_done(req);
    1756             : }
    1757             : 
    1758           0 : NTSTATUS dcerpc_echo_TestSurrounding_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1759             : {
    1760           0 :         struct dcerpc_echo_TestSurrounding_r_state *state =
    1761           0 :                 tevent_req_data(req,
    1762             :                 struct dcerpc_echo_TestSurrounding_r_state);
    1763           0 :         NTSTATUS status;
    1764             : 
    1765           0 :         if (tevent_req_is_nterror(req, &status)) {
    1766           0 :                 tevent_req_received(req);
    1767           0 :                 return status;
    1768             :         }
    1769             : 
    1770           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1771             : 
    1772           0 :         tevent_req_received(req);
    1773           0 :         return NT_STATUS_OK;
    1774             : }
    1775             : 
    1776         268 : NTSTATUS dcerpc_echo_TestSurrounding_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct echo_TestSurrounding *r)
    1777             : {
    1778           2 :         NTSTATUS status;
    1779             : 
    1780         268 :         status = dcerpc_binding_handle_call(h,
    1781             :                         NULL, &ndr_table_rpcecho,
    1782             :                         NDR_ECHO_TESTSURROUNDING, mem_ctx, r);
    1783             : 
    1784         268 :         return status;
    1785             : }
    1786             : 
    1787             : struct dcerpc_echo_TestSurrounding_state {
    1788             :         struct echo_TestSurrounding orig;
    1789             :         struct echo_TestSurrounding tmp;
    1790             :         TALLOC_CTX *out_mem_ctx;
    1791             : };
    1792             : 
    1793             : static void dcerpc_echo_TestSurrounding_done(struct tevent_req *subreq);
    1794             : 
    1795           0 : struct tevent_req *dcerpc_echo_TestSurrounding_send(TALLOC_CTX *mem_ctx,
    1796             :                                                     struct tevent_context *ev,
    1797             :                                                     struct dcerpc_binding_handle *h,
    1798             :                                                     struct echo_Surrounding *_data /* [in,out] [ref] */)
    1799             : {
    1800           0 :         struct tevent_req *req;
    1801           0 :         struct dcerpc_echo_TestSurrounding_state *state;
    1802           0 :         struct tevent_req *subreq;
    1803             : 
    1804           0 :         req = tevent_req_create(mem_ctx, &state,
    1805             :                                 struct dcerpc_echo_TestSurrounding_state);
    1806           0 :         if (req == NULL) {
    1807           0 :                 return NULL;
    1808             :         }
    1809           0 :         state->out_mem_ctx = NULL;
    1810             : 
    1811             :         /* In parameters */
    1812           0 :         state->orig.in.data = _data;
    1813             : 
    1814             :         /* Out parameters */
    1815           0 :         state->orig.out.data = _data;
    1816             : 
    1817           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1818             :                              "dcerpc_echo_TestSurrounding_out_memory");
    1819           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1820           0 :                 return tevent_req_post(req, ev);
    1821             :         }
    1822             : 
    1823             :         /* make a temporary copy, that we pass to the dispatch function */
    1824           0 :         state->tmp = state->orig;
    1825             : 
    1826           0 :         subreq = dcerpc_echo_TestSurrounding_r_send(state, ev, h, &state->tmp);
    1827           0 :         if (tevent_req_nomem(subreq, req)) {
    1828           0 :                 return tevent_req_post(req, ev);
    1829             :         }
    1830           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestSurrounding_done, req);
    1831           0 :         return req;
    1832             : }
    1833             : 
    1834           0 : static void dcerpc_echo_TestSurrounding_done(struct tevent_req *subreq)
    1835             : {
    1836           0 :         struct tevent_req *req = tevent_req_callback_data(
    1837             :                 subreq, struct tevent_req);
    1838           0 :         struct dcerpc_echo_TestSurrounding_state *state = tevent_req_data(
    1839             :                 req, struct dcerpc_echo_TestSurrounding_state);
    1840           0 :         NTSTATUS status;
    1841           0 :         TALLOC_CTX *mem_ctx;
    1842             : 
    1843           0 :         if (state->out_mem_ctx) {
    1844           0 :                 mem_ctx = state->out_mem_ctx;
    1845             :         } else {
    1846           0 :                 mem_ctx = state;
    1847             :         }
    1848             : 
    1849           0 :         status = dcerpc_echo_TestSurrounding_r_recv(subreq, mem_ctx);
    1850           0 :         TALLOC_FREE(subreq);
    1851           0 :         if (tevent_req_nterror(req, status)) {
    1852           0 :                 return;
    1853             :         }
    1854             : 
    1855             :         /* Copy out parameters */
    1856           0 :         *state->orig.out.data = *state->tmp.out.data;
    1857             : 
    1858             :         /* Reset temporary structure */
    1859           0 :         NDR_ZERO_STRUCT(state->tmp);
    1860             : 
    1861           0 :         tevent_req_done(req);
    1862             : }
    1863             : 
    1864           0 : NTSTATUS dcerpc_echo_TestSurrounding_recv(struct tevent_req *req,
    1865             :                                           TALLOC_CTX *mem_ctx)
    1866             : {
    1867           0 :         struct dcerpc_echo_TestSurrounding_state *state = tevent_req_data(
    1868             :                 req, struct dcerpc_echo_TestSurrounding_state);
    1869           0 :         NTSTATUS status;
    1870             : 
    1871           0 :         if (tevent_req_is_nterror(req, &status)) {
    1872           0 :                 tevent_req_received(req);
    1873           0 :                 return status;
    1874             :         }
    1875             : 
    1876             :         /* Steal possible out parameters to the callers context */
    1877           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1878             : 
    1879           0 :         tevent_req_received(req);
    1880           0 :         return NT_STATUS_OK;
    1881             : }
    1882             : 
    1883           0 : NTSTATUS dcerpc_echo_TestSurrounding(struct dcerpc_binding_handle *h,
    1884             :                                      TALLOC_CTX *mem_ctx,
    1885             :                                      struct echo_Surrounding *_data /* [in,out] [ref] */)
    1886             : {
    1887           0 :         struct echo_TestSurrounding r;
    1888           0 :         NTSTATUS status;
    1889             : 
    1890             :         /* In parameters */
    1891           0 :         r.in.data = _data;
    1892             : 
    1893             :         /* Out parameters */
    1894           0 :         r.out.data = _data;
    1895             : 
    1896           0 :         status = dcerpc_echo_TestSurrounding_r(h, mem_ctx, &r);
    1897           0 :         if (!NT_STATUS_IS_OK(status)) {
    1898           0 :                 return status;
    1899             :         }
    1900             : 
    1901             :         /* Return variables */
    1902           0 :         *_data = *r.out.data;
    1903             : 
    1904             :         /* Return result */
    1905             : 
    1906           0 :         return NT_STATUS_OK;
    1907             : }
    1908             : 
    1909             : struct dcerpc_echo_TestDoublePointer_r_state {
    1910             :         TALLOC_CTX *out_mem_ctx;
    1911             : };
    1912             : 
    1913             : static void dcerpc_echo_TestDoublePointer_r_done(struct tevent_req *subreq);
    1914             : 
    1915           0 : struct tevent_req *dcerpc_echo_TestDoublePointer_r_send(TALLOC_CTX *mem_ctx,
    1916             :         struct tevent_context *ev,
    1917             :         struct dcerpc_binding_handle *h,
    1918             :         struct echo_TestDoublePointer *r)
    1919             : {
    1920           0 :         struct tevent_req *req;
    1921           0 :         struct dcerpc_echo_TestDoublePointer_r_state *state;
    1922           0 :         struct tevent_req *subreq;
    1923             : 
    1924           0 :         req = tevent_req_create(mem_ctx, &state,
    1925             :                                 struct dcerpc_echo_TestDoublePointer_r_state);
    1926           0 :         if (req == NULL) {
    1927           0 :                 return NULL;
    1928             :         }
    1929             : 
    1930           0 :         state->out_mem_ctx = NULL;
    1931             : 
    1932           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1933             :                         NULL, &ndr_table_rpcecho,
    1934             :                         NDR_ECHO_TESTDOUBLEPOINTER, state, r);
    1935           0 :         if (tevent_req_nomem(subreq, req)) {
    1936           0 :                 return tevent_req_post(req, ev);
    1937             :         }
    1938           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestDoublePointer_r_done, req);
    1939             : 
    1940           0 :         return req;
    1941             : }
    1942             : 
    1943           0 : static void dcerpc_echo_TestDoublePointer_r_done(struct tevent_req *subreq)
    1944             : {
    1945           0 :         struct tevent_req *req =
    1946           0 :                 tevent_req_callback_data(subreq,
    1947             :                 struct tevent_req);
    1948           0 :         NTSTATUS status;
    1949             : 
    1950           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1951           0 :         TALLOC_FREE(subreq);
    1952           0 :         if (tevent_req_nterror(req, status)) {
    1953           0 :                 return;
    1954             :         }
    1955             : 
    1956           0 :         tevent_req_done(req);
    1957             : }
    1958             : 
    1959           0 : NTSTATUS dcerpc_echo_TestDoublePointer_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1960             : {
    1961           0 :         struct dcerpc_echo_TestDoublePointer_r_state *state =
    1962           0 :                 tevent_req_data(req,
    1963             :                 struct dcerpc_echo_TestDoublePointer_r_state);
    1964           0 :         NTSTATUS status;
    1965             : 
    1966           0 :         if (tevent_req_is_nterror(req, &status)) {
    1967           0 :                 tevent_req_received(req);
    1968           0 :                 return status;
    1969             :         }
    1970             : 
    1971           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1972             : 
    1973           0 :         tevent_req_received(req);
    1974           0 :         return NT_STATUS_OK;
    1975             : }
    1976             : 
    1977         267 : NTSTATUS dcerpc_echo_TestDoublePointer_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct echo_TestDoublePointer *r)
    1978             : {
    1979           2 :         NTSTATUS status;
    1980             : 
    1981         267 :         status = dcerpc_binding_handle_call(h,
    1982             :                         NULL, &ndr_table_rpcecho,
    1983             :                         NDR_ECHO_TESTDOUBLEPOINTER, mem_ctx, r);
    1984             : 
    1985         267 :         return status;
    1986             : }
    1987             : 
    1988             : struct dcerpc_echo_TestDoublePointer_state {
    1989             :         struct echo_TestDoublePointer orig;
    1990             :         struct echo_TestDoublePointer tmp;
    1991             :         TALLOC_CTX *out_mem_ctx;
    1992             : };
    1993             : 
    1994             : static void dcerpc_echo_TestDoublePointer_done(struct tevent_req *subreq);
    1995             : 
    1996           0 : struct tevent_req *dcerpc_echo_TestDoublePointer_send(TALLOC_CTX *mem_ctx,
    1997             :                                                       struct tevent_context *ev,
    1998             :                                                       struct dcerpc_binding_handle *h,
    1999             :                                                       uint16_t ***_data /* [in] [ref] */)
    2000             : {
    2001           0 :         struct tevent_req *req;
    2002           0 :         struct dcerpc_echo_TestDoublePointer_state *state;
    2003           0 :         struct tevent_req *subreq;
    2004             : 
    2005           0 :         req = tevent_req_create(mem_ctx, &state,
    2006             :                                 struct dcerpc_echo_TestDoublePointer_state);
    2007           0 :         if (req == NULL) {
    2008           0 :                 return NULL;
    2009             :         }
    2010           0 :         state->out_mem_ctx = NULL;
    2011             : 
    2012             :         /* In parameters */
    2013           0 :         state->orig.in.data = _data;
    2014             : 
    2015             :         /* Out parameters */
    2016             : 
    2017             :         /* Result */
    2018           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2019             : 
    2020             :         /* make a temporary copy, that we pass to the dispatch function */
    2021           0 :         state->tmp = state->orig;
    2022             : 
    2023           0 :         subreq = dcerpc_echo_TestDoublePointer_r_send(state, ev, h, &state->tmp);
    2024           0 :         if (tevent_req_nomem(subreq, req)) {
    2025           0 :                 return tevent_req_post(req, ev);
    2026             :         }
    2027           0 :         tevent_req_set_callback(subreq, dcerpc_echo_TestDoublePointer_done, req);
    2028           0 :         return req;
    2029             : }
    2030             : 
    2031           0 : static void dcerpc_echo_TestDoublePointer_done(struct tevent_req *subreq)
    2032             : {
    2033           0 :         struct tevent_req *req = tevent_req_callback_data(
    2034             :                 subreq, struct tevent_req);
    2035           0 :         struct dcerpc_echo_TestDoublePointer_state *state = tevent_req_data(
    2036             :                 req, struct dcerpc_echo_TestDoublePointer_state);
    2037           0 :         NTSTATUS status;
    2038           0 :         TALLOC_CTX *mem_ctx;
    2039             : 
    2040           0 :         if (state->out_mem_ctx) {
    2041           0 :                 mem_ctx = state->out_mem_ctx;
    2042             :         } else {
    2043           0 :                 mem_ctx = state;
    2044             :         }
    2045             : 
    2046           0 :         status = dcerpc_echo_TestDoublePointer_r_recv(subreq, mem_ctx);
    2047           0 :         TALLOC_FREE(subreq);
    2048           0 :         if (tevent_req_nterror(req, status)) {
    2049           0 :                 return;
    2050             :         }
    2051             : 
    2052             :         /* Copy out parameters */
    2053             : 
    2054             :         /* Copy result */
    2055           0 :         state->orig.out.result = state->tmp.out.result;
    2056             : 
    2057             :         /* Reset temporary structure */
    2058           0 :         NDR_ZERO_STRUCT(state->tmp);
    2059             : 
    2060           0 :         tevent_req_done(req);
    2061             : }
    2062             : 
    2063           0 : NTSTATUS dcerpc_echo_TestDoublePointer_recv(struct tevent_req *req,
    2064             :                                             TALLOC_CTX *mem_ctx,
    2065             :                                             uint16_t *result)
    2066             : {
    2067           0 :         struct dcerpc_echo_TestDoublePointer_state *state = tevent_req_data(
    2068             :                 req, struct dcerpc_echo_TestDoublePointer_state);
    2069           0 :         NTSTATUS status;
    2070             : 
    2071           0 :         if (tevent_req_is_nterror(req, &status)) {
    2072           0 :                 tevent_req_received(req);
    2073           0 :                 return status;
    2074             :         }
    2075             : 
    2076             :         /* Steal possible out parameters to the callers context */
    2077           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2078             : 
    2079             :         /* Return result */
    2080           0 :         *result = state->orig.out.result;
    2081             : 
    2082           0 :         tevent_req_received(req);
    2083           0 :         return NT_STATUS_OK;
    2084             : }
    2085             : 
    2086           0 : NTSTATUS dcerpc_echo_TestDoublePointer(struct dcerpc_binding_handle *h,
    2087             :                                        TALLOC_CTX *mem_ctx,
    2088             :                                        uint16_t ***_data /* [in] [ref] */,
    2089             :                                        uint16_t *result)
    2090             : {
    2091           0 :         struct echo_TestDoublePointer r;
    2092           0 :         NTSTATUS status;
    2093             : 
    2094             :         /* In parameters */
    2095           0 :         r.in.data = _data;
    2096             : 
    2097             :         /* Out parameters */
    2098             : 
    2099             :         /* Result */
    2100           0 :         NDR_ZERO_STRUCT(r.out.result);
    2101             : 
    2102           0 :         status = dcerpc_echo_TestDoublePointer_r(h, mem_ctx, &r);
    2103           0 :         if (!NT_STATUS_IS_OK(status)) {
    2104           0 :                 return status;
    2105             :         }
    2106             : 
    2107             :         /* Return variables */
    2108             : 
    2109             :         /* Return result */
    2110           0 :         *result = r.out.result;
    2111             : 
    2112           0 :         return NT_STATUS_OK;
    2113             : }
    2114             : 

Generated by: LCOV version 1.14