LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_initshutdown_c.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 0 279 0.0 %
Date: 2024-04-21 15:09:00 Functions: 0 24 0.0 %

          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_initshutdown.h"
       7             : #include "bin/default/librpc/gen_ndr/ndr_initshutdown_c.h"
       8             : 
       9             : /* initshutdown - client functions generated by pidl */
      10             : 
      11             : struct dcerpc_initshutdown_Init_r_state {
      12             :         TALLOC_CTX *out_mem_ctx;
      13             : };
      14             : 
      15             : static void dcerpc_initshutdown_Init_r_done(struct tevent_req *subreq);
      16             : 
      17           0 : struct tevent_req *dcerpc_initshutdown_Init_r_send(TALLOC_CTX *mem_ctx,
      18             :         struct tevent_context *ev,
      19             :         struct dcerpc_binding_handle *h,
      20             :         struct initshutdown_Init *r)
      21             : {
      22           0 :         struct tevent_req *req;
      23           0 :         struct dcerpc_initshutdown_Init_r_state *state;
      24           0 :         struct tevent_req *subreq;
      25             : 
      26           0 :         req = tevent_req_create(mem_ctx, &state,
      27             :                                 struct dcerpc_initshutdown_Init_r_state);
      28           0 :         if (req == NULL) {
      29           0 :                 return NULL;
      30             :         }
      31             : 
      32           0 :         state->out_mem_ctx = NULL;
      33             : 
      34           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
      35             :                         NULL, &ndr_table_initshutdown,
      36             :                         NDR_INITSHUTDOWN_INIT, state, r);
      37           0 :         if (tevent_req_nomem(subreq, req)) {
      38           0 :                 return tevent_req_post(req, ev);
      39             :         }
      40           0 :         tevent_req_set_callback(subreq, dcerpc_initshutdown_Init_r_done, req);
      41             : 
      42           0 :         return req;
      43             : }
      44             : 
      45           0 : static void dcerpc_initshutdown_Init_r_done(struct tevent_req *subreq)
      46             : {
      47           0 :         struct tevent_req *req =
      48           0 :                 tevent_req_callback_data(subreq,
      49             :                 struct tevent_req);
      50           0 :         NTSTATUS status;
      51             : 
      52           0 :         status = dcerpc_binding_handle_call_recv(subreq);
      53           0 :         TALLOC_FREE(subreq);
      54           0 :         if (tevent_req_nterror(req, status)) {
      55           0 :                 return;
      56             :         }
      57             : 
      58           0 :         tevent_req_done(req);
      59             : }
      60             : 
      61           0 : NTSTATUS dcerpc_initshutdown_Init_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
      62             : {
      63           0 :         struct dcerpc_initshutdown_Init_r_state *state =
      64           0 :                 tevent_req_data(req,
      65             :                 struct dcerpc_initshutdown_Init_r_state);
      66           0 :         NTSTATUS status;
      67             : 
      68           0 :         if (tevent_req_is_nterror(req, &status)) {
      69           0 :                 tevent_req_received(req);
      70           0 :                 return status;
      71             :         }
      72             : 
      73           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
      74             : 
      75           0 :         tevent_req_received(req);
      76           0 :         return NT_STATUS_OK;
      77             : }
      78             : 
      79           0 : NTSTATUS dcerpc_initshutdown_Init_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct initshutdown_Init *r)
      80             : {
      81           0 :         NTSTATUS status;
      82             : 
      83           0 :         status = dcerpc_binding_handle_call(h,
      84             :                         NULL, &ndr_table_initshutdown,
      85             :                         NDR_INITSHUTDOWN_INIT, mem_ctx, r);
      86             : 
      87           0 :         return status;
      88             : }
      89             : 
      90             : struct dcerpc_initshutdown_Init_state {
      91             :         struct initshutdown_Init orig;
      92             :         struct initshutdown_Init tmp;
      93             :         TALLOC_CTX *out_mem_ctx;
      94             : };
      95             : 
      96             : static void dcerpc_initshutdown_Init_done(struct tevent_req *subreq);
      97             : 
      98           0 : struct tevent_req *dcerpc_initshutdown_Init_send(TALLOC_CTX *mem_ctx,
      99             :                                                  struct tevent_context *ev,
     100             :                                                  struct dcerpc_binding_handle *h,
     101             :                                                  uint16_t *_hostname /* [in] [unique] */,
     102             :                                                  struct lsa_StringLarge *_message /* [in] [unique] */,
     103             :                                                  uint32_t _timeout /* [in]  */,
     104             :                                                  uint8_t _force_apps /* [in]  */,
     105             :                                                  uint8_t _do_reboot /* [in]  */)
     106             : {
     107           0 :         struct tevent_req *req;
     108           0 :         struct dcerpc_initshutdown_Init_state *state;
     109           0 :         struct tevent_req *subreq;
     110             : 
     111           0 :         req = tevent_req_create(mem_ctx, &state,
     112             :                                 struct dcerpc_initshutdown_Init_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.hostname = _hostname;
     120           0 :         state->orig.in.message = _message;
     121           0 :         state->orig.in.timeout = _timeout;
     122           0 :         state->orig.in.force_apps = _force_apps;
     123           0 :         state->orig.in.do_reboot = _do_reboot;
     124             : 
     125             :         /* Out parameters */
     126             : 
     127             :         /* Result */
     128           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     129             : 
     130             :         /* make a temporary copy, that we pass to the dispatch function */
     131           0 :         state->tmp = state->orig;
     132             : 
     133           0 :         subreq = dcerpc_initshutdown_Init_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_initshutdown_Init_done, req);
     138           0 :         return req;
     139             : }
     140             : 
     141           0 : static void dcerpc_initshutdown_Init_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_initshutdown_Init_state *state = tevent_req_data(
     146             :                 req, struct dcerpc_initshutdown_Init_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_initshutdown_Init_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             : 
     164             :         /* Copy result */
     165           0 :         state->orig.out.result = state->tmp.out.result;
     166             : 
     167             :         /* Reset temporary structure */
     168           0 :         NDR_ZERO_STRUCT(state->tmp);
     169             : 
     170           0 :         tevent_req_done(req);
     171             : }
     172             : 
     173           0 : NTSTATUS dcerpc_initshutdown_Init_recv(struct tevent_req *req,
     174             :                                        TALLOC_CTX *mem_ctx,
     175             :                                        WERROR *result)
     176             : {
     177           0 :         struct dcerpc_initshutdown_Init_state *state = tevent_req_data(
     178             :                 req, struct dcerpc_initshutdown_Init_state);
     179           0 :         NTSTATUS status;
     180             : 
     181           0 :         if (tevent_req_is_nterror(req, &status)) {
     182           0 :                 tevent_req_received(req);
     183           0 :                 return status;
     184             :         }
     185             : 
     186             :         /* Steal possible out parameters to the callers context */
     187           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     188             : 
     189             :         /* Return result */
     190           0 :         *result = state->orig.out.result;
     191             : 
     192           0 :         tevent_req_received(req);
     193           0 :         return NT_STATUS_OK;
     194             : }
     195             : 
     196           0 : NTSTATUS dcerpc_initshutdown_Init(struct dcerpc_binding_handle *h,
     197             :                                   TALLOC_CTX *mem_ctx,
     198             :                                   uint16_t *_hostname /* [in] [unique] */,
     199             :                                   struct lsa_StringLarge *_message /* [in] [unique] */,
     200             :                                   uint32_t _timeout /* [in]  */,
     201             :                                   uint8_t _force_apps /* [in]  */,
     202             :                                   uint8_t _do_reboot /* [in]  */,
     203             :                                   WERROR *result)
     204             : {
     205           0 :         struct initshutdown_Init r;
     206           0 :         NTSTATUS status;
     207             : 
     208             :         /* In parameters */
     209           0 :         r.in.hostname = _hostname;
     210           0 :         r.in.message = _message;
     211           0 :         r.in.timeout = _timeout;
     212           0 :         r.in.force_apps = _force_apps;
     213           0 :         r.in.do_reboot = _do_reboot;
     214             : 
     215             :         /* Out parameters */
     216             : 
     217             :         /* Result */
     218           0 :         NDR_ZERO_STRUCT(r.out.result);
     219             : 
     220           0 :         status = dcerpc_initshutdown_Init_r(h, mem_ctx, &r);
     221           0 :         if (!NT_STATUS_IS_OK(status)) {
     222           0 :                 return status;
     223             :         }
     224             : 
     225             :         /* Return variables */
     226             : 
     227             :         /* Return result */
     228           0 :         *result = r.out.result;
     229             : 
     230           0 :         return NT_STATUS_OK;
     231             : }
     232             : 
     233             : struct dcerpc_initshutdown_Abort_r_state {
     234             :         TALLOC_CTX *out_mem_ctx;
     235             : };
     236             : 
     237             : static void dcerpc_initshutdown_Abort_r_done(struct tevent_req *subreq);
     238             : 
     239           0 : struct tevent_req *dcerpc_initshutdown_Abort_r_send(TALLOC_CTX *mem_ctx,
     240             :         struct tevent_context *ev,
     241             :         struct dcerpc_binding_handle *h,
     242             :         struct initshutdown_Abort *r)
     243             : {
     244           0 :         struct tevent_req *req;
     245           0 :         struct dcerpc_initshutdown_Abort_r_state *state;
     246           0 :         struct tevent_req *subreq;
     247             : 
     248           0 :         req = tevent_req_create(mem_ctx, &state,
     249             :                                 struct dcerpc_initshutdown_Abort_r_state);
     250           0 :         if (req == NULL) {
     251           0 :                 return NULL;
     252             :         }
     253             : 
     254           0 :         state->out_mem_ctx = NULL;
     255             : 
     256           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     257             :                         NULL, &ndr_table_initshutdown,
     258             :                         NDR_INITSHUTDOWN_ABORT, state, r);
     259           0 :         if (tevent_req_nomem(subreq, req)) {
     260           0 :                 return tevent_req_post(req, ev);
     261             :         }
     262           0 :         tevent_req_set_callback(subreq, dcerpc_initshutdown_Abort_r_done, req);
     263             : 
     264           0 :         return req;
     265             : }
     266             : 
     267           0 : static void dcerpc_initshutdown_Abort_r_done(struct tevent_req *subreq)
     268             : {
     269           0 :         struct tevent_req *req =
     270           0 :                 tevent_req_callback_data(subreq,
     271             :                 struct tevent_req);
     272           0 :         NTSTATUS status;
     273             : 
     274           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     275           0 :         TALLOC_FREE(subreq);
     276           0 :         if (tevent_req_nterror(req, status)) {
     277           0 :                 return;
     278             :         }
     279             : 
     280           0 :         tevent_req_done(req);
     281             : }
     282             : 
     283           0 : NTSTATUS dcerpc_initshutdown_Abort_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     284             : {
     285           0 :         struct dcerpc_initshutdown_Abort_r_state *state =
     286           0 :                 tevent_req_data(req,
     287             :                 struct dcerpc_initshutdown_Abort_r_state);
     288           0 :         NTSTATUS status;
     289             : 
     290           0 :         if (tevent_req_is_nterror(req, &status)) {
     291           0 :                 tevent_req_received(req);
     292           0 :                 return status;
     293             :         }
     294             : 
     295           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     296             : 
     297           0 :         tevent_req_received(req);
     298           0 :         return NT_STATUS_OK;
     299             : }
     300             : 
     301           0 : NTSTATUS dcerpc_initshutdown_Abort_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct initshutdown_Abort *r)
     302             : {
     303           0 :         NTSTATUS status;
     304             : 
     305           0 :         status = dcerpc_binding_handle_call(h,
     306             :                         NULL, &ndr_table_initshutdown,
     307             :                         NDR_INITSHUTDOWN_ABORT, mem_ctx, r);
     308             : 
     309           0 :         return status;
     310             : }
     311             : 
     312             : struct dcerpc_initshutdown_Abort_state {
     313             :         struct initshutdown_Abort orig;
     314             :         struct initshutdown_Abort tmp;
     315             :         TALLOC_CTX *out_mem_ctx;
     316             : };
     317             : 
     318             : static void dcerpc_initshutdown_Abort_done(struct tevent_req *subreq);
     319             : 
     320           0 : struct tevent_req *dcerpc_initshutdown_Abort_send(TALLOC_CTX *mem_ctx,
     321             :                                                   struct tevent_context *ev,
     322             :                                                   struct dcerpc_binding_handle *h,
     323             :                                                   uint16_t *_server /* [in] [unique] */)
     324             : {
     325           0 :         struct tevent_req *req;
     326           0 :         struct dcerpc_initshutdown_Abort_state *state;
     327           0 :         struct tevent_req *subreq;
     328             : 
     329           0 :         req = tevent_req_create(mem_ctx, &state,
     330             :                                 struct dcerpc_initshutdown_Abort_state);
     331           0 :         if (req == NULL) {
     332           0 :                 return NULL;
     333             :         }
     334           0 :         state->out_mem_ctx = NULL;
     335             : 
     336             :         /* In parameters */
     337           0 :         state->orig.in.server = _server;
     338             : 
     339             :         /* Out parameters */
     340             : 
     341             :         /* Result */
     342           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     343             : 
     344             :         /* make a temporary copy, that we pass to the dispatch function */
     345           0 :         state->tmp = state->orig;
     346             : 
     347           0 :         subreq = dcerpc_initshutdown_Abort_r_send(state, ev, h, &state->tmp);
     348           0 :         if (tevent_req_nomem(subreq, req)) {
     349           0 :                 return tevent_req_post(req, ev);
     350             :         }
     351           0 :         tevent_req_set_callback(subreq, dcerpc_initshutdown_Abort_done, req);
     352           0 :         return req;
     353             : }
     354             : 
     355           0 : static void dcerpc_initshutdown_Abort_done(struct tevent_req *subreq)
     356             : {
     357           0 :         struct tevent_req *req = tevent_req_callback_data(
     358             :                 subreq, struct tevent_req);
     359           0 :         struct dcerpc_initshutdown_Abort_state *state = tevent_req_data(
     360             :                 req, struct dcerpc_initshutdown_Abort_state);
     361           0 :         NTSTATUS status;
     362           0 :         TALLOC_CTX *mem_ctx;
     363             : 
     364           0 :         if (state->out_mem_ctx) {
     365           0 :                 mem_ctx = state->out_mem_ctx;
     366             :         } else {
     367           0 :                 mem_ctx = state;
     368             :         }
     369             : 
     370           0 :         status = dcerpc_initshutdown_Abort_r_recv(subreq, mem_ctx);
     371           0 :         TALLOC_FREE(subreq);
     372           0 :         if (tevent_req_nterror(req, status)) {
     373           0 :                 return;
     374             :         }
     375             : 
     376             :         /* Copy out parameters */
     377             : 
     378             :         /* Copy result */
     379           0 :         state->orig.out.result = state->tmp.out.result;
     380             : 
     381             :         /* Reset temporary structure */
     382           0 :         NDR_ZERO_STRUCT(state->tmp);
     383             : 
     384           0 :         tevent_req_done(req);
     385             : }
     386             : 
     387           0 : NTSTATUS dcerpc_initshutdown_Abort_recv(struct tevent_req *req,
     388             :                                         TALLOC_CTX *mem_ctx,
     389             :                                         WERROR *result)
     390             : {
     391           0 :         struct dcerpc_initshutdown_Abort_state *state = tevent_req_data(
     392             :                 req, struct dcerpc_initshutdown_Abort_state);
     393           0 :         NTSTATUS status;
     394             : 
     395           0 :         if (tevent_req_is_nterror(req, &status)) {
     396           0 :                 tevent_req_received(req);
     397           0 :                 return status;
     398             :         }
     399             : 
     400             :         /* Steal possible out parameters to the callers context */
     401           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     402             : 
     403             :         /* Return result */
     404           0 :         *result = state->orig.out.result;
     405             : 
     406           0 :         tevent_req_received(req);
     407           0 :         return NT_STATUS_OK;
     408             : }
     409             : 
     410           0 : NTSTATUS dcerpc_initshutdown_Abort(struct dcerpc_binding_handle *h,
     411             :                                    TALLOC_CTX *mem_ctx,
     412             :                                    uint16_t *_server /* [in] [unique] */,
     413             :                                    WERROR *result)
     414             : {
     415           0 :         struct initshutdown_Abort r;
     416           0 :         NTSTATUS status;
     417             : 
     418             :         /* In parameters */
     419           0 :         r.in.server = _server;
     420             : 
     421             :         /* Out parameters */
     422             : 
     423             :         /* Result */
     424           0 :         NDR_ZERO_STRUCT(r.out.result);
     425             : 
     426           0 :         status = dcerpc_initshutdown_Abort_r(h, mem_ctx, &r);
     427           0 :         if (!NT_STATUS_IS_OK(status)) {
     428           0 :                 return status;
     429             :         }
     430             : 
     431             :         /* Return variables */
     432             : 
     433             :         /* Return result */
     434           0 :         *result = r.out.result;
     435             : 
     436           0 :         return NT_STATUS_OK;
     437             : }
     438             : 
     439             : struct dcerpc_initshutdown_InitEx_r_state {
     440             :         TALLOC_CTX *out_mem_ctx;
     441             : };
     442             : 
     443             : static void dcerpc_initshutdown_InitEx_r_done(struct tevent_req *subreq);
     444             : 
     445           0 : struct tevent_req *dcerpc_initshutdown_InitEx_r_send(TALLOC_CTX *mem_ctx,
     446             :         struct tevent_context *ev,
     447             :         struct dcerpc_binding_handle *h,
     448             :         struct initshutdown_InitEx *r)
     449             : {
     450           0 :         struct tevent_req *req;
     451           0 :         struct dcerpc_initshutdown_InitEx_r_state *state;
     452           0 :         struct tevent_req *subreq;
     453             : 
     454           0 :         req = tevent_req_create(mem_ctx, &state,
     455             :                                 struct dcerpc_initshutdown_InitEx_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_initshutdown,
     464             :                         NDR_INITSHUTDOWN_INITEX, 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_initshutdown_InitEx_r_done, req);
     469             : 
     470           0 :         return req;
     471             : }
     472             : 
     473           0 : static void dcerpc_initshutdown_InitEx_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_initshutdown_InitEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     490             : {
     491           0 :         struct dcerpc_initshutdown_InitEx_r_state *state =
     492           0 :                 tevent_req_data(req,
     493             :                 struct dcerpc_initshutdown_InitEx_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           0 : NTSTATUS dcerpc_initshutdown_InitEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct initshutdown_InitEx *r)
     508             : {
     509           0 :         NTSTATUS status;
     510             : 
     511           0 :         status = dcerpc_binding_handle_call(h,
     512             :                         NULL, &ndr_table_initshutdown,
     513             :                         NDR_INITSHUTDOWN_INITEX, mem_ctx, r);
     514             : 
     515           0 :         return status;
     516             : }
     517             : 
     518             : struct dcerpc_initshutdown_InitEx_state {
     519             :         struct initshutdown_InitEx orig;
     520             :         struct initshutdown_InitEx tmp;
     521             :         TALLOC_CTX *out_mem_ctx;
     522             : };
     523             : 
     524             : static void dcerpc_initshutdown_InitEx_done(struct tevent_req *subreq);
     525             : 
     526           0 : struct tevent_req *dcerpc_initshutdown_InitEx_send(TALLOC_CTX *mem_ctx,
     527             :                                                    struct tevent_context *ev,
     528             :                                                    struct dcerpc_binding_handle *h,
     529             :                                                    uint16_t *_hostname /* [in] [unique] */,
     530             :                                                    struct lsa_StringLarge *_message /* [in] [unique] */,
     531             :                                                    uint32_t _timeout /* [in]  */,
     532             :                                                    uint8_t _force_apps /* [in]  */,
     533             :                                                    uint8_t _do_reboot /* [in]  */,
     534             :                                                    uint32_t _reason /* [in]  */)
     535             : {
     536           0 :         struct tevent_req *req;
     537           0 :         struct dcerpc_initshutdown_InitEx_state *state;
     538           0 :         struct tevent_req *subreq;
     539             : 
     540           0 :         req = tevent_req_create(mem_ctx, &state,
     541             :                                 struct dcerpc_initshutdown_InitEx_state);
     542           0 :         if (req == NULL) {
     543           0 :                 return NULL;
     544             :         }
     545           0 :         state->out_mem_ctx = NULL;
     546             : 
     547             :         /* In parameters */
     548           0 :         state->orig.in.hostname = _hostname;
     549           0 :         state->orig.in.message = _message;
     550           0 :         state->orig.in.timeout = _timeout;
     551           0 :         state->orig.in.force_apps = _force_apps;
     552           0 :         state->orig.in.do_reboot = _do_reboot;
     553           0 :         state->orig.in.reason = _reason;
     554             : 
     555             :         /* Out parameters */
     556             : 
     557             :         /* Result */
     558           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     559             : 
     560             :         /* make a temporary copy, that we pass to the dispatch function */
     561           0 :         state->tmp = state->orig;
     562             : 
     563           0 :         subreq = dcerpc_initshutdown_InitEx_r_send(state, ev, h, &state->tmp);
     564           0 :         if (tevent_req_nomem(subreq, req)) {
     565           0 :                 return tevent_req_post(req, ev);
     566             :         }
     567           0 :         tevent_req_set_callback(subreq, dcerpc_initshutdown_InitEx_done, req);
     568           0 :         return req;
     569             : }
     570             : 
     571           0 : static void dcerpc_initshutdown_InitEx_done(struct tevent_req *subreq)
     572             : {
     573           0 :         struct tevent_req *req = tevent_req_callback_data(
     574             :                 subreq, struct tevent_req);
     575           0 :         struct dcerpc_initshutdown_InitEx_state *state = tevent_req_data(
     576             :                 req, struct dcerpc_initshutdown_InitEx_state);
     577           0 :         NTSTATUS status;
     578           0 :         TALLOC_CTX *mem_ctx;
     579             : 
     580           0 :         if (state->out_mem_ctx) {
     581           0 :                 mem_ctx = state->out_mem_ctx;
     582             :         } else {
     583           0 :                 mem_ctx = state;
     584             :         }
     585             : 
     586           0 :         status = dcerpc_initshutdown_InitEx_r_recv(subreq, mem_ctx);
     587           0 :         TALLOC_FREE(subreq);
     588           0 :         if (tevent_req_nterror(req, status)) {
     589           0 :                 return;
     590             :         }
     591             : 
     592             :         /* Copy out parameters */
     593             : 
     594             :         /* Copy result */
     595           0 :         state->orig.out.result = state->tmp.out.result;
     596             : 
     597             :         /* Reset temporary structure */
     598           0 :         NDR_ZERO_STRUCT(state->tmp);
     599             : 
     600           0 :         tevent_req_done(req);
     601             : }
     602             : 
     603           0 : NTSTATUS dcerpc_initshutdown_InitEx_recv(struct tevent_req *req,
     604             :                                          TALLOC_CTX *mem_ctx,
     605             :                                          WERROR *result)
     606             : {
     607           0 :         struct dcerpc_initshutdown_InitEx_state *state = tevent_req_data(
     608             :                 req, struct dcerpc_initshutdown_InitEx_state);
     609           0 :         NTSTATUS status;
     610             : 
     611           0 :         if (tevent_req_is_nterror(req, &status)) {
     612           0 :                 tevent_req_received(req);
     613           0 :                 return status;
     614             :         }
     615             : 
     616             :         /* Steal possible out parameters to the callers context */
     617           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     618             : 
     619             :         /* Return result */
     620           0 :         *result = state->orig.out.result;
     621             : 
     622           0 :         tevent_req_received(req);
     623           0 :         return NT_STATUS_OK;
     624             : }
     625             : 
     626           0 : NTSTATUS dcerpc_initshutdown_InitEx(struct dcerpc_binding_handle *h,
     627             :                                     TALLOC_CTX *mem_ctx,
     628             :                                     uint16_t *_hostname /* [in] [unique] */,
     629             :                                     struct lsa_StringLarge *_message /* [in] [unique] */,
     630             :                                     uint32_t _timeout /* [in]  */,
     631             :                                     uint8_t _force_apps /* [in]  */,
     632             :                                     uint8_t _do_reboot /* [in]  */,
     633             :                                     uint32_t _reason /* [in]  */,
     634             :                                     WERROR *result)
     635             : {
     636           0 :         struct initshutdown_InitEx r;
     637           0 :         NTSTATUS status;
     638             : 
     639             :         /* In parameters */
     640           0 :         r.in.hostname = _hostname;
     641           0 :         r.in.message = _message;
     642           0 :         r.in.timeout = _timeout;
     643           0 :         r.in.force_apps = _force_apps;
     644           0 :         r.in.do_reboot = _do_reboot;
     645           0 :         r.in.reason = _reason;
     646             : 
     647             :         /* Out parameters */
     648             : 
     649             :         /* Result */
     650           0 :         NDR_ZERO_STRUCT(r.out.result);
     651             : 
     652           0 :         status = dcerpc_initshutdown_InitEx_r(h, mem_ctx, &r);
     653           0 :         if (!NT_STATUS_IS_OK(status)) {
     654           0 :                 return status;
     655             :         }
     656             : 
     657             :         /* Return variables */
     658             : 
     659             :         /* Return result */
     660           0 :         *result = r.out.result;
     661             : 
     662           0 :         return NT_STATUS_OK;
     663             : }
     664             : 

Generated by: LCOV version 1.14