LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_gkdi_c.c (source / functions) Hit Total Coverage
Test: coverage report for master 70ed9daf Lines: 0 111 0.0 %
Date: 2024-01-11 09:59:51 Functions: 0 8 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_gkdi.h"
       7             : #include "bin/default/librpc/gen_ndr/ndr_gkdi_c.h"
       8             : 
       9             : /* gkdi - client functions generated by pidl */
      10             : 
      11             : struct dcerpc_gkdi_GetKey_r_state {
      12             :         TALLOC_CTX *out_mem_ctx;
      13             : };
      14             : 
      15             : static void dcerpc_gkdi_GetKey_r_done(struct tevent_req *subreq);
      16             : 
      17           0 : struct tevent_req *dcerpc_gkdi_GetKey_r_send(TALLOC_CTX *mem_ctx,
      18             :         struct tevent_context *ev,
      19             :         struct dcerpc_binding_handle *h,
      20             :         struct gkdi_GetKey *r)
      21             : {
      22           0 :         struct tevent_req *req;
      23           0 :         struct dcerpc_gkdi_GetKey_r_state *state;
      24           0 :         struct tevent_req *subreq;
      25             : 
      26           0 :         req = tevent_req_create(mem_ctx, &state,
      27             :                                 struct dcerpc_gkdi_GetKey_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_gkdi,
      39           0 :                         NDR_GKDI_GETKEY, 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_gkdi_GetKey_r_done, req);
      44             : 
      45           0 :         return req;
      46             : }
      47             : 
      48           0 : static void dcerpc_gkdi_GetKey_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_gkdi_GetKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
      65             : {
      66           0 :         struct dcerpc_gkdi_GetKey_r_state *state =
      67           0 :                 tevent_req_data(req,
      68             :                 struct dcerpc_gkdi_GetKey_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           0 : NTSTATUS dcerpc_gkdi_GetKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct gkdi_GetKey *r)
      83             : {
      84           0 :         NTSTATUS status;
      85             : 
      86           0 :         status = dcerpc_binding_handle_call(h,
      87             :                         NULL, &ndr_table_gkdi,
      88             :                         NDR_GKDI_GETKEY, mem_ctx, r);
      89             : 
      90           0 :         return status;
      91             : }
      92             : 
      93             : struct dcerpc_gkdi_GetKey_state {
      94             :         struct gkdi_GetKey orig;
      95             :         struct gkdi_GetKey tmp;
      96             :         TALLOC_CTX *out_mem_ctx;
      97             : };
      98             : 
      99             : static void dcerpc_gkdi_GetKey_done(struct tevent_req *subreq);
     100             : 
     101           0 : struct tevent_req *dcerpc_gkdi_GetKey_send(TALLOC_CTX *mem_ctx,
     102             :                                            struct tevent_context *ev,
     103             :                                            struct dcerpc_binding_handle *h,
     104             :                                            uint32_t _target_sd_len /* [in]  */,
     105             :                                            uint8_t *_target_sd /* [in] [ref,size_is(target_sd_len)] */,
     106             :                                            struct GUID *_root_key_id /* [in] [unique] */,
     107             :                                            int32_t _l0_key_id /* [in]  */,
     108             :                                            int32_t _l1_key_id /* [in]  */,
     109             :                                            int32_t _l2_key_id /* [in]  */,
     110             :                                            uint32_t *_out_len /* [out] [ref] */,
     111             :                                            uint8_t **_out /* [out] [ref,size_is(,*out_len)] */)
     112             : {
     113           0 :         struct tevent_req *req;
     114           0 :         struct dcerpc_gkdi_GetKey_state *state;
     115           0 :         struct tevent_req *subreq;
     116             : 
     117           0 :         req = tevent_req_create(mem_ctx, &state,
     118             :                                 struct dcerpc_gkdi_GetKey_state);
     119           0 :         if (req == NULL) {
     120           0 :                 return NULL;
     121             :         }
     122           0 :         state->out_mem_ctx = NULL;
     123             : 
     124             :         /* In parameters */
     125           0 :         state->orig.in.target_sd_len = _target_sd_len;
     126           0 :         state->orig.in.target_sd = _target_sd;
     127           0 :         state->orig.in.root_key_id = _root_key_id;
     128           0 :         state->orig.in.l0_key_id = _l0_key_id;
     129           0 :         state->orig.in.l1_key_id = _l1_key_id;
     130           0 :         state->orig.in.l2_key_id = _l2_key_id;
     131             : 
     132             :         /* Out parameters */
     133           0 :         state->orig.out.out_len = _out_len;
     134           0 :         state->orig.out.out = _out;
     135             : 
     136             :         /* Result */
     137           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     138             : 
     139           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     140             :                              "dcerpc_gkdi_GetKey_out_memory");
     141           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     142           0 :                 return tevent_req_post(req, ev);
     143             :         }
     144             : 
     145             :         /* make a temporary copy, that we pass to the dispatch function */
     146           0 :         state->tmp = state->orig;
     147             : 
     148           0 :         subreq = dcerpc_gkdi_GetKey_r_send(state, ev, h, &state->tmp);
     149           0 :         if (tevent_req_nomem(subreq, req)) {
     150           0 :                 return tevent_req_post(req, ev);
     151             :         }
     152           0 :         tevent_req_set_callback(subreq, dcerpc_gkdi_GetKey_done, req);
     153           0 :         return req;
     154             : }
     155             : 
     156           0 : static void dcerpc_gkdi_GetKey_done(struct tevent_req *subreq)
     157             : {
     158           0 :         struct tevent_req *req = tevent_req_callback_data(
     159             :                 subreq, struct tevent_req);
     160           0 :         struct dcerpc_gkdi_GetKey_state *state = tevent_req_data(
     161             :                 req, struct dcerpc_gkdi_GetKey_state);
     162           0 :         NTSTATUS status;
     163           0 :         TALLOC_CTX *mem_ctx;
     164             : 
     165           0 :         if (state->out_mem_ctx) {
     166           0 :                 mem_ctx = state->out_mem_ctx;
     167             :         } else {
     168           0 :                 mem_ctx = state;
     169             :         }
     170             : 
     171           0 :         status = dcerpc_gkdi_GetKey_r_recv(subreq, mem_ctx);
     172           0 :         TALLOC_FREE(subreq);
     173           0 :         if (tevent_req_nterror(req, status)) {
     174           0 :                 return;
     175             :         }
     176             : 
     177             :         /* Copy out parameters */
     178           0 :         *state->orig.out.out_len = *state->tmp.out.out_len;
     179           0 :         *state->orig.out.out = *state->tmp.out.out;
     180             : 
     181             :         /* Copy result */
     182           0 :         state->orig.out.result = state->tmp.out.result;
     183             : 
     184             :         /* Reset temporary structure */
     185           0 :         NDR_ZERO_STRUCT(state->tmp);
     186             : 
     187           0 :         tevent_req_done(req);
     188             : }
     189             : 
     190           0 : NTSTATUS dcerpc_gkdi_GetKey_recv(struct tevent_req *req,
     191             :                                  TALLOC_CTX *mem_ctx,
     192             :                                  HRESULT *result)
     193             : {
     194           0 :         struct dcerpc_gkdi_GetKey_state *state = tevent_req_data(
     195             :                 req, struct dcerpc_gkdi_GetKey_state);
     196           0 :         NTSTATUS status;
     197             : 
     198           0 :         if (tevent_req_is_nterror(req, &status)) {
     199           0 :                 tevent_req_received(req);
     200           0 :                 return status;
     201             :         }
     202             : 
     203             :         /* Steal possible out parameters to the callers context */
     204           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     205             : 
     206             :         /* Return result */
     207           0 :         *result = state->orig.out.result;
     208             : 
     209           0 :         tevent_req_received(req);
     210           0 :         return NT_STATUS_OK;
     211             : }
     212             : 
     213           0 : NTSTATUS dcerpc_gkdi_GetKey(struct dcerpc_binding_handle *h,
     214             :                             TALLOC_CTX *mem_ctx,
     215             :                             uint32_t _target_sd_len /* [in]  */,
     216             :                             uint8_t *_target_sd /* [in] [ref,size_is(target_sd_len)] */,
     217             :                             struct GUID *_root_key_id /* [in] [unique] */,
     218             :                             int32_t _l0_key_id /* [in]  */,
     219             :                             int32_t _l1_key_id /* [in]  */,
     220             :                             int32_t _l2_key_id /* [in]  */,
     221             :                             uint32_t *_out_len /* [out] [ref] */,
     222             :                             uint8_t **_out /* [out] [ref,size_is(,*out_len)] */,
     223             :                             HRESULT *result)
     224             : {
     225           0 :         struct gkdi_GetKey r;
     226           0 :         NTSTATUS status;
     227             : 
     228             :         /* In parameters */
     229           0 :         r.in.target_sd_len = _target_sd_len;
     230           0 :         r.in.target_sd = _target_sd;
     231           0 :         r.in.root_key_id = _root_key_id;
     232           0 :         r.in.l0_key_id = _l0_key_id;
     233           0 :         r.in.l1_key_id = _l1_key_id;
     234           0 :         r.in.l2_key_id = _l2_key_id;
     235             : 
     236             :         /* Out parameters */
     237           0 :         r.out.out_len = _out_len;
     238           0 :         r.out.out = _out;
     239             : 
     240             :         /* Result */
     241           0 :         NDR_ZERO_STRUCT(r.out.result);
     242             : 
     243           0 :         status = dcerpc_gkdi_GetKey_r(h, mem_ctx, &r);
     244           0 :         if (!NT_STATUS_IS_OK(status)) {
     245           0 :                 return status;
     246             :         }
     247             : 
     248             :         /* Return variables */
     249           0 :         *_out_len = *r.out.out_len;
     250           0 :         *_out = *r.out.out;
     251             : 
     252             :         /* Return result */
     253           0 :         *result = r.out.result;
     254             : 
     255           0 :         return NT_STATUS_OK;
     256             : }
     257             : 

Generated by: LCOV version 1.14