LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_mgmt_c.c (source / functions) Hit Total Coverage
Test: coverage report for master 70ed9daf Lines: 15 484 3.1 %
Date: 2024-01-11 09:59:51 Functions: 5 40 12.5 %

          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_mgmt.h"
       7             : #include "bin/default/librpc/gen_ndr/ndr_mgmt_c.h"
       8             : 
       9             : /* mgmt - client functions generated by pidl */
      10             : 
      11             : struct dcerpc_mgmt_inq_if_ids_r_state {
      12             :         TALLOC_CTX *out_mem_ctx;
      13             : };
      14             : 
      15             : static void dcerpc_mgmt_inq_if_ids_r_done(struct tevent_req *subreq);
      16             : 
      17           0 : struct tevent_req *dcerpc_mgmt_inq_if_ids_r_send(TALLOC_CTX *mem_ctx,
      18             :         struct tevent_context *ev,
      19             :         struct dcerpc_binding_handle *h,
      20             :         struct mgmt_inq_if_ids *r)
      21             : {
      22           0 :         struct tevent_req *req;
      23           0 :         struct dcerpc_mgmt_inq_if_ids_r_state *state;
      24           0 :         struct tevent_req *subreq;
      25             : 
      26           0 :         req = tevent_req_create(mem_ctx, &state,
      27             :                                 struct dcerpc_mgmt_inq_if_ids_r_state);
      28           0 :         if (req == NULL) {
      29           0 :                 return NULL;
      30             :         }
      31             : 
      32           0 :         state->out_mem_ctx = talloc_new(state);
      33           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
      34           0 :                 return tevent_req_post(req, ev);
      35             :         }
      36             : 
      37           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
      38             :                         NULL, &ndr_table_mgmt,
      39           0 :                         NDR_MGMT_INQ_IF_IDS, state->out_mem_ctx, r);
      40           0 :         if (tevent_req_nomem(subreq, req)) {
      41           0 :                 return tevent_req_post(req, ev);
      42             :         }
      43           0 :         tevent_req_set_callback(subreq, dcerpc_mgmt_inq_if_ids_r_done, req);
      44             : 
      45           0 :         return req;
      46             : }
      47             : 
      48           0 : static void dcerpc_mgmt_inq_if_ids_r_done(struct tevent_req *subreq)
      49             : {
      50           0 :         struct tevent_req *req =
      51           0 :                 tevent_req_callback_data(subreq,
      52             :                 struct tevent_req);
      53           0 :         NTSTATUS status;
      54             : 
      55           0 :         status = dcerpc_binding_handle_call_recv(subreq);
      56           0 :         TALLOC_FREE(subreq);
      57           0 :         if (tevent_req_nterror(req, status)) {
      58           0 :                 return;
      59             :         }
      60             : 
      61           0 :         tevent_req_done(req);
      62             : }
      63             : 
      64           0 : NTSTATUS dcerpc_mgmt_inq_if_ids_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
      65             : {
      66           0 :         struct dcerpc_mgmt_inq_if_ids_r_state *state =
      67           0 :                 tevent_req_data(req,
      68             :                 struct dcerpc_mgmt_inq_if_ids_r_state);
      69           0 :         NTSTATUS status;
      70             : 
      71           0 :         if (tevent_req_is_nterror(req, &status)) {
      72           0 :                 tevent_req_received(req);
      73           0 :                 return status;
      74             :         }
      75             : 
      76           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
      77             : 
      78           0 :         tevent_req_received(req);
      79           0 :         return NT_STATUS_OK;
      80             : }
      81             : 
      82         141 : NTSTATUS dcerpc_mgmt_inq_if_ids_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct mgmt_inq_if_ids *r)
      83             : {
      84           0 :         NTSTATUS status;
      85             : 
      86         141 :         status = dcerpc_binding_handle_call(h,
      87             :                         NULL, &ndr_table_mgmt,
      88             :                         NDR_MGMT_INQ_IF_IDS, mem_ctx, r);
      89             : 
      90         141 :         return status;
      91             : }
      92             : 
      93             : struct dcerpc_mgmt_inq_if_ids_state {
      94             :         struct mgmt_inq_if_ids orig;
      95             :         struct mgmt_inq_if_ids tmp;
      96             :         TALLOC_CTX *out_mem_ctx;
      97             : };
      98             : 
      99             : static void dcerpc_mgmt_inq_if_ids_done(struct tevent_req *subreq);
     100             : 
     101           0 : struct tevent_req *dcerpc_mgmt_inq_if_ids_send(TALLOC_CTX *mem_ctx,
     102             :                                                struct tevent_context *ev,
     103             :                                                struct dcerpc_binding_handle *h,
     104             :                                                struct rpc_if_id_vector_t **_if_id_vector /* [out] [ref] */)
     105             : {
     106           0 :         struct tevent_req *req;
     107           0 :         struct dcerpc_mgmt_inq_if_ids_state *state;
     108           0 :         struct tevent_req *subreq;
     109             : 
     110           0 :         req = tevent_req_create(mem_ctx, &state,
     111             :                                 struct dcerpc_mgmt_inq_if_ids_state);
     112           0 :         if (req == NULL) {
     113           0 :                 return NULL;
     114             :         }
     115           0 :         state->out_mem_ctx = NULL;
     116             : 
     117             :         /* In parameters */
     118             : 
     119             :         /* Out parameters */
     120           0 :         state->orig.out.if_id_vector = _if_id_vector;
     121             : 
     122             :         /* Result */
     123           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     124             : 
     125           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     126             :                              "dcerpc_mgmt_inq_if_ids_out_memory");
     127           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     128           0 :                 return tevent_req_post(req, ev);
     129             :         }
     130             : 
     131             :         /* make a temporary copy, that we pass to the dispatch function */
     132           0 :         state->tmp = state->orig;
     133             : 
     134           0 :         subreq = dcerpc_mgmt_inq_if_ids_r_send(state, ev, h, &state->tmp);
     135           0 :         if (tevent_req_nomem(subreq, req)) {
     136           0 :                 return tevent_req_post(req, ev);
     137             :         }
     138           0 :         tevent_req_set_callback(subreq, dcerpc_mgmt_inq_if_ids_done, req);
     139           0 :         return req;
     140             : }
     141             : 
     142           0 : static void dcerpc_mgmt_inq_if_ids_done(struct tevent_req *subreq)
     143             : {
     144           0 :         struct tevent_req *req = tevent_req_callback_data(
     145             :                 subreq, struct tevent_req);
     146           0 :         struct dcerpc_mgmt_inq_if_ids_state *state = tevent_req_data(
     147             :                 req, struct dcerpc_mgmt_inq_if_ids_state);
     148           0 :         NTSTATUS status;
     149           0 :         TALLOC_CTX *mem_ctx;
     150             : 
     151           0 :         if (state->out_mem_ctx) {
     152           0 :                 mem_ctx = state->out_mem_ctx;
     153             :         } else {
     154           0 :                 mem_ctx = state;
     155             :         }
     156             : 
     157           0 :         status = dcerpc_mgmt_inq_if_ids_r_recv(subreq, mem_ctx);
     158           0 :         TALLOC_FREE(subreq);
     159           0 :         if (tevent_req_nterror(req, status)) {
     160           0 :                 return;
     161             :         }
     162             : 
     163             :         /* Copy out parameters */
     164           0 :         *state->orig.out.if_id_vector = *state->tmp.out.if_id_vector;
     165             : 
     166             :         /* Copy result */
     167           0 :         state->orig.out.result = state->tmp.out.result;
     168             : 
     169             :         /* Reset temporary structure */
     170           0 :         NDR_ZERO_STRUCT(state->tmp);
     171             : 
     172           0 :         tevent_req_done(req);
     173             : }
     174             : 
     175           0 : NTSTATUS dcerpc_mgmt_inq_if_ids_recv(struct tevent_req *req,
     176             :                                      TALLOC_CTX *mem_ctx,
     177             :                                      WERROR *result)
     178             : {
     179           0 :         struct dcerpc_mgmt_inq_if_ids_state *state = tevent_req_data(
     180             :                 req, struct dcerpc_mgmt_inq_if_ids_state);
     181           0 :         NTSTATUS status;
     182             : 
     183           0 :         if (tevent_req_is_nterror(req, &status)) {
     184           0 :                 tevent_req_received(req);
     185           0 :                 return status;
     186             :         }
     187             : 
     188             :         /* Steal possible out parameters to the callers context */
     189           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     190             : 
     191             :         /* Return result */
     192           0 :         *result = state->orig.out.result;
     193             : 
     194           0 :         tevent_req_received(req);
     195           0 :         return NT_STATUS_OK;
     196             : }
     197             : 
     198           0 : NTSTATUS dcerpc_mgmt_inq_if_ids(struct dcerpc_binding_handle *h,
     199             :                                 TALLOC_CTX *mem_ctx,
     200             :                                 struct rpc_if_id_vector_t **_if_id_vector /* [out] [ref] */,
     201             :                                 WERROR *result)
     202             : {
     203           0 :         struct mgmt_inq_if_ids r;
     204           0 :         NTSTATUS status;
     205             : 
     206             :         /* In parameters */
     207             : 
     208             :         /* Out parameters */
     209           0 :         r.out.if_id_vector = _if_id_vector;
     210             : 
     211             :         /* Result */
     212           0 :         NDR_ZERO_STRUCT(r.out.result);
     213             : 
     214           0 :         status = dcerpc_mgmt_inq_if_ids_r(h, mem_ctx, &r);
     215           0 :         if (!NT_STATUS_IS_OK(status)) {
     216           0 :                 return status;
     217             :         }
     218             : 
     219             :         /* Return variables */
     220           0 :         *_if_id_vector = *r.out.if_id_vector;
     221             : 
     222             :         /* Return result */
     223           0 :         *result = r.out.result;
     224             : 
     225           0 :         return NT_STATUS_OK;
     226             : }
     227             : 
     228             : struct dcerpc_mgmt_inq_stats_r_state {
     229             :         TALLOC_CTX *out_mem_ctx;
     230             : };
     231             : 
     232             : static void dcerpc_mgmt_inq_stats_r_done(struct tevent_req *subreq);
     233             : 
     234           0 : struct tevent_req *dcerpc_mgmt_inq_stats_r_send(TALLOC_CTX *mem_ctx,
     235             :         struct tevent_context *ev,
     236             :         struct dcerpc_binding_handle *h,
     237             :         struct mgmt_inq_stats *r)
     238             : {
     239           0 :         struct tevent_req *req;
     240           0 :         struct dcerpc_mgmt_inq_stats_r_state *state;
     241           0 :         struct tevent_req *subreq;
     242             : 
     243           0 :         req = tevent_req_create(mem_ctx, &state,
     244             :                                 struct dcerpc_mgmt_inq_stats_r_state);
     245           0 :         if (req == NULL) {
     246           0 :                 return NULL;
     247             :         }
     248             : 
     249           0 :         state->out_mem_ctx = talloc_new(state);
     250           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     251           0 :                 return tevent_req_post(req, ev);
     252             :         }
     253             : 
     254           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     255             :                         NULL, &ndr_table_mgmt,
     256           0 :                         NDR_MGMT_INQ_STATS, state->out_mem_ctx, r);
     257           0 :         if (tevent_req_nomem(subreq, req)) {
     258           0 :                 return tevent_req_post(req, ev);
     259             :         }
     260           0 :         tevent_req_set_callback(subreq, dcerpc_mgmt_inq_stats_r_done, req);
     261             : 
     262           0 :         return req;
     263             : }
     264             : 
     265           0 : static void dcerpc_mgmt_inq_stats_r_done(struct tevent_req *subreq)
     266             : {
     267           0 :         struct tevent_req *req =
     268           0 :                 tevent_req_callback_data(subreq,
     269             :                 struct tevent_req);
     270           0 :         NTSTATUS status;
     271             : 
     272           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     273           0 :         TALLOC_FREE(subreq);
     274           0 :         if (tevent_req_nterror(req, status)) {
     275           0 :                 return;
     276             :         }
     277             : 
     278           0 :         tevent_req_done(req);
     279             : }
     280             : 
     281           0 : NTSTATUS dcerpc_mgmt_inq_stats_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     282             : {
     283           0 :         struct dcerpc_mgmt_inq_stats_r_state *state =
     284           0 :                 tevent_req_data(req,
     285             :                 struct dcerpc_mgmt_inq_stats_r_state);
     286           0 :         NTSTATUS status;
     287             : 
     288           0 :         if (tevent_req_is_nterror(req, &status)) {
     289           0 :                 tevent_req_received(req);
     290           0 :                 return status;
     291             :         }
     292             : 
     293           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     294             : 
     295           0 :         tevent_req_received(req);
     296           0 :         return NT_STATUS_OK;
     297             : }
     298             : 
     299         141 : NTSTATUS dcerpc_mgmt_inq_stats_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct mgmt_inq_stats *r)
     300             : {
     301           0 :         NTSTATUS status;
     302             : 
     303         141 :         status = dcerpc_binding_handle_call(h,
     304             :                         NULL, &ndr_table_mgmt,
     305             :                         NDR_MGMT_INQ_STATS, mem_ctx, r);
     306             : 
     307         141 :         return status;
     308             : }
     309             : 
     310             : struct dcerpc_mgmt_inq_stats_state {
     311             :         struct mgmt_inq_stats orig;
     312             :         struct mgmt_inq_stats tmp;
     313             :         TALLOC_CTX *out_mem_ctx;
     314             : };
     315             : 
     316             : static void dcerpc_mgmt_inq_stats_done(struct tevent_req *subreq);
     317             : 
     318           0 : struct tevent_req *dcerpc_mgmt_inq_stats_send(TALLOC_CTX *mem_ctx,
     319             :                                               struct tevent_context *ev,
     320             :                                               struct dcerpc_binding_handle *h,
     321             :                                               uint32_t _max_count /* [in]  */,
     322             :                                               uint32_t _unknown /* [in]  */,
     323             :                                               struct mgmt_statistics *_statistics /* [out] [ref] */)
     324             : {
     325           0 :         struct tevent_req *req;
     326           0 :         struct dcerpc_mgmt_inq_stats_state *state;
     327           0 :         struct tevent_req *subreq;
     328             : 
     329           0 :         req = tevent_req_create(mem_ctx, &state,
     330             :                                 struct dcerpc_mgmt_inq_stats_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.max_count = _max_count;
     338           0 :         state->orig.in.unknown = _unknown;
     339             : 
     340             :         /* Out parameters */
     341           0 :         state->orig.out.statistics = _statistics;
     342             : 
     343             :         /* Result */
     344           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     345             : 
     346           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     347             :                              "dcerpc_mgmt_inq_stats_out_memory");
     348           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     349           0 :                 return tevent_req_post(req, ev);
     350             :         }
     351             : 
     352             :         /* make a temporary copy, that we pass to the dispatch function */
     353           0 :         state->tmp = state->orig;
     354             : 
     355           0 :         subreq = dcerpc_mgmt_inq_stats_r_send(state, ev, h, &state->tmp);
     356           0 :         if (tevent_req_nomem(subreq, req)) {
     357           0 :                 return tevent_req_post(req, ev);
     358             :         }
     359           0 :         tevent_req_set_callback(subreq, dcerpc_mgmt_inq_stats_done, req);
     360           0 :         return req;
     361             : }
     362             : 
     363           0 : static void dcerpc_mgmt_inq_stats_done(struct tevent_req *subreq)
     364             : {
     365           0 :         struct tevent_req *req = tevent_req_callback_data(
     366             :                 subreq, struct tevent_req);
     367           0 :         struct dcerpc_mgmt_inq_stats_state *state = tevent_req_data(
     368             :                 req, struct dcerpc_mgmt_inq_stats_state);
     369           0 :         NTSTATUS status;
     370           0 :         TALLOC_CTX *mem_ctx;
     371             : 
     372           0 :         if (state->out_mem_ctx) {
     373           0 :                 mem_ctx = state->out_mem_ctx;
     374             :         } else {
     375           0 :                 mem_ctx = state;
     376             :         }
     377             : 
     378           0 :         status = dcerpc_mgmt_inq_stats_r_recv(subreq, mem_ctx);
     379           0 :         TALLOC_FREE(subreq);
     380           0 :         if (tevent_req_nterror(req, status)) {
     381           0 :                 return;
     382             :         }
     383             : 
     384             :         /* Copy out parameters */
     385           0 :         *state->orig.out.statistics = *state->tmp.out.statistics;
     386             : 
     387             :         /* Copy result */
     388           0 :         state->orig.out.result = state->tmp.out.result;
     389             : 
     390             :         /* Reset temporary structure */
     391           0 :         NDR_ZERO_STRUCT(state->tmp);
     392             : 
     393           0 :         tevent_req_done(req);
     394             : }
     395             : 
     396           0 : NTSTATUS dcerpc_mgmt_inq_stats_recv(struct tevent_req *req,
     397             :                                     TALLOC_CTX *mem_ctx,
     398             :                                     WERROR *result)
     399             : {
     400           0 :         struct dcerpc_mgmt_inq_stats_state *state = tevent_req_data(
     401             :                 req, struct dcerpc_mgmt_inq_stats_state);
     402           0 :         NTSTATUS status;
     403             : 
     404           0 :         if (tevent_req_is_nterror(req, &status)) {
     405           0 :                 tevent_req_received(req);
     406           0 :                 return status;
     407             :         }
     408             : 
     409             :         /* Steal possible out parameters to the callers context */
     410           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     411             : 
     412             :         /* Return result */
     413           0 :         *result = state->orig.out.result;
     414             : 
     415           0 :         tevent_req_received(req);
     416           0 :         return NT_STATUS_OK;
     417             : }
     418             : 
     419           0 : NTSTATUS dcerpc_mgmt_inq_stats(struct dcerpc_binding_handle *h,
     420             :                                TALLOC_CTX *mem_ctx,
     421             :                                uint32_t _max_count /* [in]  */,
     422             :                                uint32_t _unknown /* [in]  */,
     423             :                                struct mgmt_statistics *_statistics /* [out] [ref] */,
     424             :                                WERROR *result)
     425             : {
     426           0 :         struct mgmt_inq_stats r;
     427           0 :         NTSTATUS status;
     428             : 
     429             :         /* In parameters */
     430           0 :         r.in.max_count = _max_count;
     431           0 :         r.in.unknown = _unknown;
     432             : 
     433             :         /* Out parameters */
     434           0 :         r.out.statistics = _statistics;
     435             : 
     436             :         /* Result */
     437           0 :         NDR_ZERO_STRUCT(r.out.result);
     438             : 
     439           0 :         status = dcerpc_mgmt_inq_stats_r(h, mem_ctx, &r);
     440           0 :         if (!NT_STATUS_IS_OK(status)) {
     441           0 :                 return status;
     442             :         }
     443             : 
     444             :         /* Return variables */
     445           0 :         *_statistics = *r.out.statistics;
     446             : 
     447             :         /* Return result */
     448           0 :         *result = r.out.result;
     449             : 
     450           0 :         return NT_STATUS_OK;
     451             : }
     452             : 
     453             : struct dcerpc_mgmt_is_server_listening_r_state {
     454             :         TALLOC_CTX *out_mem_ctx;
     455             : };
     456             : 
     457             : static void dcerpc_mgmt_is_server_listening_r_done(struct tevent_req *subreq);
     458             : 
     459           0 : struct tevent_req *dcerpc_mgmt_is_server_listening_r_send(TALLOC_CTX *mem_ctx,
     460             :         struct tevent_context *ev,
     461             :         struct dcerpc_binding_handle *h,
     462             :         struct mgmt_is_server_listening *r)
     463             : {
     464           0 :         struct tevent_req *req;
     465           0 :         struct dcerpc_mgmt_is_server_listening_r_state *state;
     466           0 :         struct tevent_req *subreq;
     467             : 
     468           0 :         req = tevent_req_create(mem_ctx, &state,
     469             :                                 struct dcerpc_mgmt_is_server_listening_r_state);
     470           0 :         if (req == NULL) {
     471           0 :                 return NULL;
     472             :         }
     473             : 
     474           0 :         state->out_mem_ctx = talloc_new(state);
     475           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     476           0 :                 return tevent_req_post(req, ev);
     477             :         }
     478             : 
     479           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     480             :                         NULL, &ndr_table_mgmt,
     481           0 :                         NDR_MGMT_IS_SERVER_LISTENING, state->out_mem_ctx, r);
     482           0 :         if (tevent_req_nomem(subreq, req)) {
     483           0 :                 return tevent_req_post(req, ev);
     484             :         }
     485           0 :         tevent_req_set_callback(subreq, dcerpc_mgmt_is_server_listening_r_done, req);
     486             : 
     487           0 :         return req;
     488             : }
     489             : 
     490           0 : static void dcerpc_mgmt_is_server_listening_r_done(struct tevent_req *subreq)
     491             : {
     492           0 :         struct tevent_req *req =
     493           0 :                 tevent_req_callback_data(subreq,
     494             :                 struct tevent_req);
     495           0 :         NTSTATUS status;
     496             : 
     497           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     498           0 :         TALLOC_FREE(subreq);
     499           0 :         if (tevent_req_nterror(req, status)) {
     500           0 :                 return;
     501             :         }
     502             : 
     503           0 :         tevent_req_done(req);
     504             : }
     505             : 
     506           0 : NTSTATUS dcerpc_mgmt_is_server_listening_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     507             : {
     508           0 :         struct dcerpc_mgmt_is_server_listening_r_state *state =
     509           0 :                 tevent_req_data(req,
     510             :                 struct dcerpc_mgmt_is_server_listening_r_state);
     511           0 :         NTSTATUS status;
     512             : 
     513           0 :         if (tevent_req_is_nterror(req, &status)) {
     514           0 :                 tevent_req_received(req);
     515           0 :                 return status;
     516             :         }
     517             : 
     518           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     519             : 
     520           0 :         tevent_req_received(req);
     521           0 :         return NT_STATUS_OK;
     522             : }
     523             : 
     524         141 : NTSTATUS dcerpc_mgmt_is_server_listening_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct mgmt_is_server_listening *r)
     525             : {
     526           0 :         NTSTATUS status;
     527             : 
     528         141 :         status = dcerpc_binding_handle_call(h,
     529             :                         NULL, &ndr_table_mgmt,
     530             :                         NDR_MGMT_IS_SERVER_LISTENING, mem_ctx, r);
     531             : 
     532         141 :         return status;
     533             : }
     534             : 
     535             : struct dcerpc_mgmt_is_server_listening_state {
     536             :         struct mgmt_is_server_listening orig;
     537             :         struct mgmt_is_server_listening tmp;
     538             :         TALLOC_CTX *out_mem_ctx;
     539             : };
     540             : 
     541             : static void dcerpc_mgmt_is_server_listening_done(struct tevent_req *subreq);
     542             : 
     543           0 : struct tevent_req *dcerpc_mgmt_is_server_listening_send(TALLOC_CTX *mem_ctx,
     544             :                                                         struct tevent_context *ev,
     545             :                                                         struct dcerpc_binding_handle *h,
     546             :                                                         uint32_t *_status /* [out] [ref] */)
     547             : {
     548           0 :         struct tevent_req *req;
     549           0 :         struct dcerpc_mgmt_is_server_listening_state *state;
     550           0 :         struct tevent_req *subreq;
     551             : 
     552           0 :         req = tevent_req_create(mem_ctx, &state,
     553             :                                 struct dcerpc_mgmt_is_server_listening_state);
     554           0 :         if (req == NULL) {
     555           0 :                 return NULL;
     556             :         }
     557           0 :         state->out_mem_ctx = NULL;
     558             : 
     559             :         /* In parameters */
     560             : 
     561             :         /* Out parameters */
     562           0 :         state->orig.out.status = _status;
     563             : 
     564             :         /* Result */
     565           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     566             : 
     567           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     568             :                              "dcerpc_mgmt_is_server_listening_out_memory");
     569           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     570           0 :                 return tevent_req_post(req, ev);
     571             :         }
     572             : 
     573             :         /* make a temporary copy, that we pass to the dispatch function */
     574           0 :         state->tmp = state->orig;
     575             : 
     576           0 :         subreq = dcerpc_mgmt_is_server_listening_r_send(state, ev, h, &state->tmp);
     577           0 :         if (tevent_req_nomem(subreq, req)) {
     578           0 :                 return tevent_req_post(req, ev);
     579             :         }
     580           0 :         tevent_req_set_callback(subreq, dcerpc_mgmt_is_server_listening_done, req);
     581           0 :         return req;
     582             : }
     583             : 
     584           0 : static void dcerpc_mgmt_is_server_listening_done(struct tevent_req *subreq)
     585             : {
     586           0 :         struct tevent_req *req = tevent_req_callback_data(
     587             :                 subreq, struct tevent_req);
     588           0 :         struct dcerpc_mgmt_is_server_listening_state *state = tevent_req_data(
     589             :                 req, struct dcerpc_mgmt_is_server_listening_state);
     590           0 :         NTSTATUS status;
     591           0 :         TALLOC_CTX *mem_ctx;
     592             : 
     593           0 :         if (state->out_mem_ctx) {
     594           0 :                 mem_ctx = state->out_mem_ctx;
     595             :         } else {
     596           0 :                 mem_ctx = state;
     597             :         }
     598             : 
     599           0 :         status = dcerpc_mgmt_is_server_listening_r_recv(subreq, mem_ctx);
     600           0 :         TALLOC_FREE(subreq);
     601           0 :         if (tevent_req_nterror(req, status)) {
     602           0 :                 return;
     603             :         }
     604             : 
     605             :         /* Copy out parameters */
     606           0 :         *state->orig.out.status = *state->tmp.out.status;
     607             : 
     608             :         /* Copy result */
     609           0 :         state->orig.out.result = state->tmp.out.result;
     610             : 
     611             :         /* Reset temporary structure */
     612           0 :         NDR_ZERO_STRUCT(state->tmp);
     613             : 
     614           0 :         tevent_req_done(req);
     615             : }
     616             : 
     617           0 : NTSTATUS dcerpc_mgmt_is_server_listening_recv(struct tevent_req *req,
     618             :                                               TALLOC_CTX *mem_ctx,
     619             :                                               uint32_t *result)
     620             : {
     621           0 :         struct dcerpc_mgmt_is_server_listening_state *state = tevent_req_data(
     622             :                 req, struct dcerpc_mgmt_is_server_listening_state);
     623           0 :         NTSTATUS status;
     624             : 
     625           0 :         if (tevent_req_is_nterror(req, &status)) {
     626           0 :                 tevent_req_received(req);
     627           0 :                 return status;
     628             :         }
     629             : 
     630             :         /* Steal possible out parameters to the callers context */
     631           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     632             : 
     633             :         /* Return result */
     634           0 :         *result = state->orig.out.result;
     635             : 
     636           0 :         tevent_req_received(req);
     637           0 :         return NT_STATUS_OK;
     638             : }
     639             : 
     640           0 : NTSTATUS dcerpc_mgmt_is_server_listening(struct dcerpc_binding_handle *h,
     641             :                                          TALLOC_CTX *mem_ctx,
     642             :                                          uint32_t *_status /* [out] [ref] */,
     643             :                                          uint32_t *result)
     644             : {
     645           0 :         struct mgmt_is_server_listening r;
     646           0 :         NTSTATUS status;
     647             : 
     648             :         /* In parameters */
     649             : 
     650             :         /* Out parameters */
     651           0 :         r.out.status = _status;
     652             : 
     653             :         /* Result */
     654           0 :         NDR_ZERO_STRUCT(r.out.result);
     655             : 
     656           0 :         status = dcerpc_mgmt_is_server_listening_r(h, mem_ctx, &r);
     657           0 :         if (!NT_STATUS_IS_OK(status)) {
     658           0 :                 return status;
     659             :         }
     660             : 
     661             :         /* Return variables */
     662           0 :         *_status = *r.out.status;
     663             : 
     664             :         /* Return result */
     665           0 :         *result = r.out.result;
     666             : 
     667           0 :         return NT_STATUS_OK;
     668             : }
     669             : 
     670             : struct dcerpc_mgmt_stop_server_listening_r_state {
     671             :         TALLOC_CTX *out_mem_ctx;
     672             : };
     673             : 
     674             : static void dcerpc_mgmt_stop_server_listening_r_done(struct tevent_req *subreq);
     675             : 
     676           0 : struct tevent_req *dcerpc_mgmt_stop_server_listening_r_send(TALLOC_CTX *mem_ctx,
     677             :         struct tevent_context *ev,
     678             :         struct dcerpc_binding_handle *h,
     679             :         struct mgmt_stop_server_listening *r)
     680             : {
     681           0 :         struct tevent_req *req;
     682           0 :         struct dcerpc_mgmt_stop_server_listening_r_state *state;
     683           0 :         struct tevent_req *subreq;
     684             : 
     685           0 :         req = tevent_req_create(mem_ctx, &state,
     686             :                                 struct dcerpc_mgmt_stop_server_listening_r_state);
     687           0 :         if (req == NULL) {
     688           0 :                 return NULL;
     689             :         }
     690             : 
     691           0 :         state->out_mem_ctx = NULL;
     692             : 
     693           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     694             :                         NULL, &ndr_table_mgmt,
     695             :                         NDR_MGMT_STOP_SERVER_LISTENING, state, r);
     696           0 :         if (tevent_req_nomem(subreq, req)) {
     697           0 :                 return tevent_req_post(req, ev);
     698             :         }
     699           0 :         tevent_req_set_callback(subreq, dcerpc_mgmt_stop_server_listening_r_done, req);
     700             : 
     701           0 :         return req;
     702             : }
     703             : 
     704           0 : static void dcerpc_mgmt_stop_server_listening_r_done(struct tevent_req *subreq)
     705             : {
     706           0 :         struct tevent_req *req =
     707           0 :                 tevent_req_callback_data(subreq,
     708             :                 struct tevent_req);
     709           0 :         NTSTATUS status;
     710             : 
     711           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     712           0 :         TALLOC_FREE(subreq);
     713           0 :         if (tevent_req_nterror(req, status)) {
     714           0 :                 return;
     715             :         }
     716             : 
     717           0 :         tevent_req_done(req);
     718             : }
     719             : 
     720           0 : NTSTATUS dcerpc_mgmt_stop_server_listening_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     721             : {
     722           0 :         struct dcerpc_mgmt_stop_server_listening_r_state *state =
     723           0 :                 tevent_req_data(req,
     724             :                 struct dcerpc_mgmt_stop_server_listening_r_state);
     725           0 :         NTSTATUS status;
     726             : 
     727           0 :         if (tevent_req_is_nterror(req, &status)) {
     728           0 :                 tevent_req_received(req);
     729           0 :                 return status;
     730             :         }
     731             : 
     732           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     733             : 
     734           0 :         tevent_req_received(req);
     735           0 :         return NT_STATUS_OK;
     736             : }
     737             : 
     738         141 : NTSTATUS dcerpc_mgmt_stop_server_listening_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct mgmt_stop_server_listening *r)
     739             : {
     740           0 :         NTSTATUS status;
     741             : 
     742         141 :         status = dcerpc_binding_handle_call(h,
     743             :                         NULL, &ndr_table_mgmt,
     744             :                         NDR_MGMT_STOP_SERVER_LISTENING, mem_ctx, r);
     745             : 
     746         141 :         return status;
     747             : }
     748             : 
     749             : struct dcerpc_mgmt_stop_server_listening_state {
     750             :         struct mgmt_stop_server_listening orig;
     751             :         struct mgmt_stop_server_listening tmp;
     752             :         TALLOC_CTX *out_mem_ctx;
     753             : };
     754             : 
     755             : static void dcerpc_mgmt_stop_server_listening_done(struct tevent_req *subreq);
     756             : 
     757           0 : struct tevent_req *dcerpc_mgmt_stop_server_listening_send(TALLOC_CTX *mem_ctx,
     758             :                                                           struct tevent_context *ev,
     759             :                                                           struct dcerpc_binding_handle *h)
     760             : {
     761           0 :         struct tevent_req *req;
     762           0 :         struct dcerpc_mgmt_stop_server_listening_state *state;
     763           0 :         struct tevent_req *subreq;
     764             : 
     765           0 :         req = tevent_req_create(mem_ctx, &state,
     766             :                                 struct dcerpc_mgmt_stop_server_listening_state);
     767           0 :         if (req == NULL) {
     768           0 :                 return NULL;
     769             :         }
     770           0 :         state->out_mem_ctx = NULL;
     771             : 
     772             :         /* In parameters */
     773             : 
     774             :         /* Out parameters */
     775             : 
     776             :         /* Result */
     777           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     778             : 
     779             :         /* make a temporary copy, that we pass to the dispatch function */
     780           0 :         state->tmp = state->orig;
     781             : 
     782           0 :         subreq = dcerpc_mgmt_stop_server_listening_r_send(state, ev, h, &state->tmp);
     783           0 :         if (tevent_req_nomem(subreq, req)) {
     784           0 :                 return tevent_req_post(req, ev);
     785             :         }
     786           0 :         tevent_req_set_callback(subreq, dcerpc_mgmt_stop_server_listening_done, req);
     787           0 :         return req;
     788             : }
     789             : 
     790           0 : static void dcerpc_mgmt_stop_server_listening_done(struct tevent_req *subreq)
     791             : {
     792           0 :         struct tevent_req *req = tevent_req_callback_data(
     793             :                 subreq, struct tevent_req);
     794           0 :         struct dcerpc_mgmt_stop_server_listening_state *state = tevent_req_data(
     795             :                 req, struct dcerpc_mgmt_stop_server_listening_state);
     796           0 :         NTSTATUS status;
     797           0 :         TALLOC_CTX *mem_ctx;
     798             : 
     799           0 :         if (state->out_mem_ctx) {
     800           0 :                 mem_ctx = state->out_mem_ctx;
     801             :         } else {
     802           0 :                 mem_ctx = state;
     803             :         }
     804             : 
     805           0 :         status = dcerpc_mgmt_stop_server_listening_r_recv(subreq, mem_ctx);
     806           0 :         TALLOC_FREE(subreq);
     807           0 :         if (tevent_req_nterror(req, status)) {
     808           0 :                 return;
     809             :         }
     810             : 
     811             :         /* Copy out parameters */
     812             : 
     813             :         /* Copy result */
     814           0 :         state->orig.out.result = state->tmp.out.result;
     815             : 
     816             :         /* Reset temporary structure */
     817           0 :         NDR_ZERO_STRUCT(state->tmp);
     818             : 
     819           0 :         tevent_req_done(req);
     820             : }
     821             : 
     822           0 : NTSTATUS dcerpc_mgmt_stop_server_listening_recv(struct tevent_req *req,
     823             :                                                 TALLOC_CTX *mem_ctx,
     824             :                                                 WERROR *result)
     825             : {
     826           0 :         struct dcerpc_mgmt_stop_server_listening_state *state = tevent_req_data(
     827             :                 req, struct dcerpc_mgmt_stop_server_listening_state);
     828           0 :         NTSTATUS status;
     829             : 
     830           0 :         if (tevent_req_is_nterror(req, &status)) {
     831           0 :                 tevent_req_received(req);
     832           0 :                 return status;
     833             :         }
     834             : 
     835             :         /* Steal possible out parameters to the callers context */
     836           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     837             : 
     838             :         /* Return result */
     839           0 :         *result = state->orig.out.result;
     840             : 
     841           0 :         tevent_req_received(req);
     842           0 :         return NT_STATUS_OK;
     843             : }
     844             : 
     845           0 : NTSTATUS dcerpc_mgmt_stop_server_listening(struct dcerpc_binding_handle *h,
     846             :                                            TALLOC_CTX *mem_ctx,
     847             :                                            WERROR *result)
     848             : {
     849           0 :         struct mgmt_stop_server_listening r;
     850           0 :         NTSTATUS status;
     851             : 
     852             :         /* In parameters */
     853             : 
     854             :         /* Out parameters */
     855             : 
     856             :         /* Result */
     857           0 :         NDR_ZERO_STRUCT(r.out.result);
     858             : 
     859           0 :         status = dcerpc_mgmt_stop_server_listening_r(h, mem_ctx, &r);
     860           0 :         if (!NT_STATUS_IS_OK(status)) {
     861           0 :                 return status;
     862             :         }
     863             : 
     864             :         /* Return variables */
     865             : 
     866             :         /* Return result */
     867           0 :         *result = r.out.result;
     868             : 
     869           0 :         return NT_STATUS_OK;
     870             : }
     871             : 
     872             : struct dcerpc_mgmt_inq_princ_name_r_state {
     873             :         TALLOC_CTX *out_mem_ctx;
     874             : };
     875             : 
     876             : static void dcerpc_mgmt_inq_princ_name_r_done(struct tevent_req *subreq);
     877             : 
     878           0 : struct tevent_req *dcerpc_mgmt_inq_princ_name_r_send(TALLOC_CTX *mem_ctx,
     879             :         struct tevent_context *ev,
     880             :         struct dcerpc_binding_handle *h,
     881             :         struct mgmt_inq_princ_name *r)
     882             : {
     883           0 :         struct tevent_req *req;
     884           0 :         struct dcerpc_mgmt_inq_princ_name_r_state *state;
     885           0 :         struct tevent_req *subreq;
     886             : 
     887           0 :         req = tevent_req_create(mem_ctx, &state,
     888             :                                 struct dcerpc_mgmt_inq_princ_name_r_state);
     889           0 :         if (req == NULL) {
     890           0 :                 return NULL;
     891             :         }
     892             : 
     893           0 :         state->out_mem_ctx = talloc_new(state);
     894           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     895           0 :                 return tevent_req_post(req, ev);
     896             :         }
     897             : 
     898           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     899             :                         NULL, &ndr_table_mgmt,
     900           0 :                         NDR_MGMT_INQ_PRINC_NAME, state->out_mem_ctx, r);
     901           0 :         if (tevent_req_nomem(subreq, req)) {
     902           0 :                 return tevent_req_post(req, ev);
     903             :         }
     904           0 :         tevent_req_set_callback(subreq, dcerpc_mgmt_inq_princ_name_r_done, req);
     905             : 
     906           0 :         return req;
     907             : }
     908             : 
     909           0 : static void dcerpc_mgmt_inq_princ_name_r_done(struct tevent_req *subreq)
     910             : {
     911           0 :         struct tevent_req *req =
     912           0 :                 tevent_req_callback_data(subreq,
     913             :                 struct tevent_req);
     914           0 :         NTSTATUS status;
     915             : 
     916           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     917           0 :         TALLOC_FREE(subreq);
     918           0 :         if (tevent_req_nterror(req, status)) {
     919           0 :                 return;
     920             :         }
     921             : 
     922           0 :         tevent_req_done(req);
     923             : }
     924             : 
     925           0 : NTSTATUS dcerpc_mgmt_inq_princ_name_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     926             : {
     927           0 :         struct dcerpc_mgmt_inq_princ_name_r_state *state =
     928           0 :                 tevent_req_data(req,
     929             :                 struct dcerpc_mgmt_inq_princ_name_r_state);
     930           0 :         NTSTATUS status;
     931             : 
     932           0 :         if (tevent_req_is_nterror(req, &status)) {
     933           0 :                 tevent_req_received(req);
     934           0 :                 return status;
     935             :         }
     936             : 
     937           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     938             : 
     939           0 :         tevent_req_received(req);
     940           0 :         return NT_STATUS_OK;
     941             : }
     942             : 
     943       37526 : NTSTATUS dcerpc_mgmt_inq_princ_name_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct mgmt_inq_princ_name *r)
     944             : {
     945           0 :         NTSTATUS status;
     946             : 
     947       37526 :         status = dcerpc_binding_handle_call(h,
     948             :                         NULL, &ndr_table_mgmt,
     949             :                         NDR_MGMT_INQ_PRINC_NAME, mem_ctx, r);
     950             : 
     951       37526 :         return status;
     952             : }
     953             : 
     954             : struct dcerpc_mgmt_inq_princ_name_state {
     955             :         struct mgmt_inq_princ_name orig;
     956             :         struct mgmt_inq_princ_name tmp;
     957             :         TALLOC_CTX *out_mem_ctx;
     958             : };
     959             : 
     960             : static void dcerpc_mgmt_inq_princ_name_done(struct tevent_req *subreq);
     961             : 
     962           0 : struct tevent_req *dcerpc_mgmt_inq_princ_name_send(TALLOC_CTX *mem_ctx,
     963             :                                                    struct tevent_context *ev,
     964             :                                                    struct dcerpc_binding_handle *h,
     965             :                                                    uint32_t _authn_proto /* [in]  */,
     966             :                                                    uint32_t _princ_name_size /* [in]  */,
     967             :                                                    const char *_princ_name /* [out] [charset(DOS),size_is(princ_name_size)] */)
     968             : {
     969           0 :         struct tevent_req *req;
     970           0 :         struct dcerpc_mgmt_inq_princ_name_state *state;
     971           0 :         struct tevent_req *subreq;
     972             : 
     973           0 :         req = tevent_req_create(mem_ctx, &state,
     974             :                                 struct dcerpc_mgmt_inq_princ_name_state);
     975           0 :         if (req == NULL) {
     976           0 :                 return NULL;
     977             :         }
     978           0 :         state->out_mem_ctx = NULL;
     979             : 
     980             :         /* In parameters */
     981           0 :         state->orig.in.authn_proto = _authn_proto;
     982           0 :         state->orig.in.princ_name_size = _princ_name_size;
     983             : 
     984             :         /* Out parameters */
     985           0 :         state->orig.out.princ_name = _princ_name;
     986             : 
     987             :         /* Result */
     988           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     989             : 
     990           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     991             :                              "dcerpc_mgmt_inq_princ_name_out_memory");
     992           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     993           0 :                 return tevent_req_post(req, ev);
     994             :         }
     995             : 
     996             :         /* make a temporary copy, that we pass to the dispatch function */
     997           0 :         state->tmp = state->orig;
     998             : 
     999           0 :         subreq = dcerpc_mgmt_inq_princ_name_r_send(state, ev, h, &state->tmp);
    1000           0 :         if (tevent_req_nomem(subreq, req)) {
    1001           0 :                 return tevent_req_post(req, ev);
    1002             :         }
    1003           0 :         tevent_req_set_callback(subreq, dcerpc_mgmt_inq_princ_name_done, req);
    1004           0 :         return req;
    1005             : }
    1006             : 
    1007           0 : static void dcerpc_mgmt_inq_princ_name_done(struct tevent_req *subreq)
    1008             : {
    1009           0 :         struct tevent_req *req = tevent_req_callback_data(
    1010             :                 subreq, struct tevent_req);
    1011           0 :         struct dcerpc_mgmt_inq_princ_name_state *state = tevent_req_data(
    1012             :                 req, struct dcerpc_mgmt_inq_princ_name_state);
    1013           0 :         NTSTATUS status;
    1014           0 :         TALLOC_CTX *mem_ctx;
    1015             : 
    1016           0 :         if (state->out_mem_ctx) {
    1017           0 :                 mem_ctx = state->out_mem_ctx;
    1018             :         } else {
    1019           0 :                 mem_ctx = state;
    1020             :         }
    1021             : 
    1022           0 :         status = dcerpc_mgmt_inq_princ_name_r_recv(subreq, mem_ctx);
    1023           0 :         TALLOC_FREE(subreq);
    1024           0 :         if (tevent_req_nterror(req, status)) {
    1025           0 :                 return;
    1026             :         }
    1027             : 
    1028             :         /* Copy out parameters */
    1029             :         {
    1030           0 :                 size_t _copy_len_princ_name;
    1031           0 :                 _copy_len_princ_name = ndr_charset_length(state->tmp.out.princ_name, CH_UNIX);
    1032           0 :                 if (_copy_len_princ_name > state->tmp.in.princ_name_size) {
    1033           0 :                         tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
    1034           0 :                         return;
    1035             :                 }
    1036           0 :                 if (state->orig.out.princ_name != state->tmp.out.princ_name) {
    1037           0 :                         memcpy(discard_const_p(uint8_t *, state->orig.out.princ_name), state->tmp.out.princ_name, _copy_len_princ_name * sizeof(*state->orig.out.princ_name));
    1038             :                 }
    1039             :         }
    1040             : 
    1041             :         /* Copy result */
    1042           0 :         state->orig.out.result = state->tmp.out.result;
    1043             : 
    1044             :         /* Reset temporary structure */
    1045           0 :         NDR_ZERO_STRUCT(state->tmp);
    1046             : 
    1047           0 :         tevent_req_done(req);
    1048             : }
    1049             : 
    1050           0 : NTSTATUS dcerpc_mgmt_inq_princ_name_recv(struct tevent_req *req,
    1051             :                                          TALLOC_CTX *mem_ctx,
    1052             :                                          WERROR *result)
    1053             : {
    1054           0 :         struct dcerpc_mgmt_inq_princ_name_state *state = tevent_req_data(
    1055             :                 req, struct dcerpc_mgmt_inq_princ_name_state);
    1056           0 :         NTSTATUS status;
    1057             : 
    1058           0 :         if (tevent_req_is_nterror(req, &status)) {
    1059           0 :                 tevent_req_received(req);
    1060           0 :                 return status;
    1061             :         }
    1062             : 
    1063             :         /* Steal possible out parameters to the callers context */
    1064           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1065             : 
    1066             :         /* Return result */
    1067           0 :         *result = state->orig.out.result;
    1068             : 
    1069           0 :         tevent_req_received(req);
    1070           0 :         return NT_STATUS_OK;
    1071             : }
    1072             : 
    1073           0 : NTSTATUS dcerpc_mgmt_inq_princ_name(struct dcerpc_binding_handle *h,
    1074             :                                     TALLOC_CTX *mem_ctx,
    1075             :                                     uint32_t _authn_proto /* [in]  */,
    1076             :                                     uint32_t _princ_name_size /* [in]  */,
    1077             :                                     const char *_princ_name /* [out] [charset(DOS),size_is(princ_name_size)] */,
    1078             :                                     WERROR *result)
    1079             : {
    1080           0 :         struct mgmt_inq_princ_name r;
    1081           0 :         NTSTATUS status;
    1082             : 
    1083             :         /* In parameters */
    1084           0 :         r.in.authn_proto = _authn_proto;
    1085           0 :         r.in.princ_name_size = _princ_name_size;
    1086             : 
    1087             :         /* Out parameters */
    1088           0 :         r.out.princ_name = _princ_name;
    1089             : 
    1090             :         /* Result */
    1091           0 :         NDR_ZERO_STRUCT(r.out.result);
    1092             : 
    1093           0 :         status = dcerpc_mgmt_inq_princ_name_r(h, mem_ctx, &r);
    1094           0 :         if (!NT_STATUS_IS_OK(status)) {
    1095           0 :                 return status;
    1096             :         }
    1097             : 
    1098             :         /* Return variables */
    1099             :         {
    1100           0 :                 size_t _copy_len_princ_name;
    1101           0 :                 _copy_len_princ_name = ndr_charset_length(r.out.princ_name, CH_UNIX);
    1102           0 :                 if (_copy_len_princ_name > r.in.princ_name_size) {
    1103           0 :                         return NT_STATUS_INVALID_NETWORK_RESPONSE;
    1104             :                 }
    1105           0 :                 if (_princ_name != r.out.princ_name) {
    1106           0 :                         memcpy(discard_const_p(uint8_t *, _princ_name), r.out.princ_name, _copy_len_princ_name * sizeof(*_princ_name));
    1107             :                 }
    1108             :         }
    1109             : 
    1110             :         /* Return result */
    1111           0 :         *result = r.out.result;
    1112             : 
    1113           0 :         return NT_STATUS_OK;
    1114             : }
    1115             : 

Generated by: LCOV version 1.14