LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_remact_c.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 0 141 0.0 %
Date: 2021-09-23 10:06:22 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_remact.h"
       7             : #include "bin/default/librpc/gen_ndr/ndr_remact_c.h"
       8             : 
       9             : /* IRemoteActivation - client functions generated by pidl */
      10             : 
      11             : struct dcerpc_RemoteActivation_r_state {
      12             :         TALLOC_CTX *out_mem_ctx;
      13             : };
      14             : 
      15             : static void dcerpc_RemoteActivation_r_done(struct tevent_req *subreq);
      16             : 
      17           0 : struct tevent_req *dcerpc_RemoteActivation_r_send(TALLOC_CTX *mem_ctx,
      18             :         struct tevent_context *ev,
      19             :         struct dcerpc_binding_handle *h,
      20             :         struct RemoteActivation *r)
      21             : {
      22             :         struct tevent_req *req;
      23             :         struct dcerpc_RemoteActivation_r_state *state;
      24             :         struct tevent_req *subreq;
      25             : 
      26           0 :         req = tevent_req_create(mem_ctx, &state,
      27             :                                 struct dcerpc_RemoteActivation_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_IRemoteActivation,
      39           0 :                         NDR_REMOTEACTIVATION, 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_RemoteActivation_r_done, req);
      44             : 
      45           0 :         return req;
      46             : }
      47             : 
      48           0 : static void dcerpc_RemoteActivation_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             :         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_RemoteActivation_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
      65             : {
      66           0 :         struct dcerpc_RemoteActivation_r_state *state =
      67           0 :                 tevent_req_data(req,
      68             :                 struct dcerpc_RemoteActivation_r_state);
      69             :         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_RemoteActivation_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct RemoteActivation *r)
      83             : {
      84             :         NTSTATUS status;
      85             : 
      86           0 :         status = dcerpc_binding_handle_call(h,
      87             :                         NULL, &ndr_table_IRemoteActivation,
      88             :                         NDR_REMOTEACTIVATION, mem_ctx, r);
      89             : 
      90           0 :         return status;
      91             : }
      92             : 
      93             : struct dcerpc_RemoteActivation_state {
      94             :         struct RemoteActivation orig;
      95             :         struct RemoteActivation tmp;
      96             :         TALLOC_CTX *out_mem_ctx;
      97             : };
      98             : 
      99             : static void dcerpc_RemoteActivation_done(struct tevent_req *subreq);
     100             : 
     101           0 : struct tevent_req *dcerpc_RemoteActivation_send(TALLOC_CTX *mem_ctx,
     102             :                                                 struct tevent_context *ev,
     103             :                                                 struct dcerpc_binding_handle *h,
     104             :                                                 struct ORPCTHIS _this_object /* [in]  */,
     105             :                                                 struct ORPCTHAT *_that /* [out] [ref] */,
     106             :                                                 struct GUID _Clsid /* [in]  */,
     107             :                                                 const char *_pwszObjectName /* [in] [charset(UTF16),unique] */,
     108             :                                                 struct MInterfacePointer *_pObjectStorage /* [in] [unique] */,
     109             :                                                 enum imp_levels _ClientImpLevel /* [in]  */,
     110             :                                                 uint32_t _Mode /* [in]  */,
     111             :                                                 uint32_t _Interfaces /* [in] [range(1,32768)] */,
     112             :                                                 struct GUID *_pIIDs /* [in] [size_is(Interfaces),unique] */,
     113             :                                                 uint16_t _num_protseqs /* [in]  */,
     114             :                                                 uint16_t *_protseq /* [in] [size_is(num_protseqs)] */,
     115             :                                                 uint64_t *_pOxid /* [out] [ref] */,
     116             :                                                 struct DUALSTRINGARRAY **_pdsaOxidBindings /* [out] [ref] */,
     117             :                                                 struct GUID *_ipidRemUnknown /* [out] [ref] */,
     118             :                                                 uint32_t *_AuthnHint /* [out] [ref] */,
     119             :                                                 struct COMVERSION *_ServerVersion /* [out] [ref] */,
     120             :                                                 HRESULT *_hr /* [out] [ref] */,
     121             :                                                 struct MInterfacePointer **_ifaces /* [out] [ref,size_is(Interfaces)] */,
     122             :                                                 HRESULT *_results /* [out] [size_is(Interfaces)] */)
     123             : {
     124             :         struct tevent_req *req;
     125             :         struct dcerpc_RemoteActivation_state *state;
     126             :         struct tevent_req *subreq;
     127             : 
     128           0 :         req = tevent_req_create(mem_ctx, &state,
     129             :                                 struct dcerpc_RemoteActivation_state);
     130           0 :         if (req == NULL) {
     131           0 :                 return NULL;
     132             :         }
     133           0 :         state->out_mem_ctx = NULL;
     134             : 
     135             :         /* In parameters */
     136           0 :         state->orig.in.this_object = _this_object;
     137           0 :         state->orig.in.Clsid = _Clsid;
     138           0 :         state->orig.in.pwszObjectName = _pwszObjectName;
     139           0 :         state->orig.in.pObjectStorage = _pObjectStorage;
     140           0 :         state->orig.in.ClientImpLevel = _ClientImpLevel;
     141           0 :         state->orig.in.Mode = _Mode;
     142           0 :         state->orig.in.Interfaces = _Interfaces;
     143           0 :         state->orig.in.pIIDs = _pIIDs;
     144           0 :         state->orig.in.num_protseqs = _num_protseqs;
     145           0 :         state->orig.in.protseq = _protseq;
     146             : 
     147             :         /* Out parameters */
     148           0 :         state->orig.out.that = _that;
     149           0 :         state->orig.out.pOxid = _pOxid;
     150           0 :         state->orig.out.pdsaOxidBindings = _pdsaOxidBindings;
     151           0 :         state->orig.out.ipidRemUnknown = _ipidRemUnknown;
     152           0 :         state->orig.out.AuthnHint = _AuthnHint;
     153           0 :         state->orig.out.ServerVersion = _ServerVersion;
     154           0 :         state->orig.out.hr = _hr;
     155           0 :         state->orig.out.ifaces = _ifaces;
     156           0 :         state->orig.out.results = _results;
     157             : 
     158             :         /* Result */
     159           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     160             : 
     161           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     162             :                              "dcerpc_RemoteActivation_out_memory");
     163           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     164           0 :                 return tevent_req_post(req, ev);
     165             :         }
     166             : 
     167             :         /* make a temporary copy, that we pass to the dispatch function */
     168           0 :         state->tmp = state->orig;
     169             : 
     170           0 :         subreq = dcerpc_RemoteActivation_r_send(state, ev, h, &state->tmp);
     171           0 :         if (tevent_req_nomem(subreq, req)) {
     172           0 :                 return tevent_req_post(req, ev);
     173             :         }
     174           0 :         tevent_req_set_callback(subreq, dcerpc_RemoteActivation_done, req);
     175           0 :         return req;
     176             : }
     177             : 
     178           0 : static void dcerpc_RemoteActivation_done(struct tevent_req *subreq)
     179             : {
     180           0 :         struct tevent_req *req = tevent_req_callback_data(
     181             :                 subreq, struct tevent_req);
     182           0 :         struct dcerpc_RemoteActivation_state *state = tevent_req_data(
     183             :                 req, struct dcerpc_RemoteActivation_state);
     184             :         NTSTATUS status;
     185             :         TALLOC_CTX *mem_ctx;
     186             : 
     187           0 :         if (state->out_mem_ctx) {
     188           0 :                 mem_ctx = state->out_mem_ctx;
     189             :         } else {
     190           0 :                 mem_ctx = state;
     191             :         }
     192             : 
     193           0 :         status = dcerpc_RemoteActivation_r_recv(subreq, mem_ctx);
     194           0 :         TALLOC_FREE(subreq);
     195           0 :         if (tevent_req_nterror(req, status)) {
     196           0 :                 return;
     197             :         }
     198             : 
     199             :         /* Copy out parameters */
     200           0 :         *state->orig.out.that = *state->tmp.out.that;
     201           0 :         *state->orig.out.pOxid = *state->tmp.out.pOxid;
     202           0 :         *state->orig.out.pdsaOxidBindings = *state->tmp.out.pdsaOxidBindings;
     203           0 :         *state->orig.out.ipidRemUnknown = *state->tmp.out.ipidRemUnknown;
     204           0 :         *state->orig.out.AuthnHint = *state->tmp.out.AuthnHint;
     205           0 :         *state->orig.out.ServerVersion = *state->tmp.out.ServerVersion;
     206           0 :         *state->orig.out.hr = *state->tmp.out.hr;
     207             :         {
     208             :                 size_t _copy_len_ifaces;
     209           0 :                 _copy_len_ifaces = state->tmp.in.Interfaces;
     210           0 :                 if (state->orig.out.ifaces != state->tmp.out.ifaces) {
     211           0 :                         memcpy(state->orig.out.ifaces, state->tmp.out.ifaces, _copy_len_ifaces * sizeof(*state->orig.out.ifaces));
     212             :                 }
     213             :         }
     214             :         {
     215             :                 size_t _copy_len_results;
     216           0 :                 _copy_len_results = state->tmp.in.Interfaces;
     217           0 :                 if (state->orig.out.results != state->tmp.out.results) {
     218           0 :                         memcpy(state->orig.out.results, state->tmp.out.results, _copy_len_results * sizeof(*state->orig.out.results));
     219             :                 }
     220             :         }
     221             : 
     222             :         /* Copy result */
     223           0 :         state->orig.out.result = state->tmp.out.result;
     224             : 
     225             :         /* Reset temporary structure */
     226           0 :         NDR_ZERO_STRUCT(state->tmp);
     227             : 
     228           0 :         tevent_req_done(req);
     229             : }
     230             : 
     231           0 : NTSTATUS dcerpc_RemoteActivation_recv(struct tevent_req *req,
     232             :                                       TALLOC_CTX *mem_ctx,
     233             :                                       WERROR *result)
     234             : {
     235           0 :         struct dcerpc_RemoteActivation_state *state = tevent_req_data(
     236             :                 req, struct dcerpc_RemoteActivation_state);
     237             :         NTSTATUS status;
     238             : 
     239           0 :         if (tevent_req_is_nterror(req, &status)) {
     240           0 :                 tevent_req_received(req);
     241           0 :                 return status;
     242             :         }
     243             : 
     244             :         /* Steal possible out parameters to the callers context */
     245           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     246             : 
     247             :         /* Return result */
     248           0 :         *result = state->orig.out.result;
     249             : 
     250           0 :         tevent_req_received(req);
     251           0 :         return NT_STATUS_OK;
     252             : }
     253             : 
     254           0 : NTSTATUS dcerpc_RemoteActivation(struct dcerpc_binding_handle *h,
     255             :                                  TALLOC_CTX *mem_ctx,
     256             :                                  struct ORPCTHIS _this_object /* [in]  */,
     257             :                                  struct ORPCTHAT *_that /* [out] [ref] */,
     258             :                                  struct GUID _Clsid /* [in]  */,
     259             :                                  const char *_pwszObjectName /* [in] [charset(UTF16),unique] */,
     260             :                                  struct MInterfacePointer *_pObjectStorage /* [in] [unique] */,
     261             :                                  enum imp_levels _ClientImpLevel /* [in]  */,
     262             :                                  uint32_t _Mode /* [in]  */,
     263             :                                  uint32_t _Interfaces /* [in] [range(1,32768)] */,
     264             :                                  struct GUID *_pIIDs /* [in] [size_is(Interfaces),unique] */,
     265             :                                  uint16_t _num_protseqs /* [in]  */,
     266             :                                  uint16_t *_protseq /* [in] [size_is(num_protseqs)] */,
     267             :                                  uint64_t *_pOxid /* [out] [ref] */,
     268             :                                  struct DUALSTRINGARRAY **_pdsaOxidBindings /* [out] [ref] */,
     269             :                                  struct GUID *_ipidRemUnknown /* [out] [ref] */,
     270             :                                  uint32_t *_AuthnHint /* [out] [ref] */,
     271             :                                  struct COMVERSION *_ServerVersion /* [out] [ref] */,
     272             :                                  HRESULT *_hr /* [out] [ref] */,
     273             :                                  struct MInterfacePointer **_ifaces /* [out] [ref,size_is(Interfaces)] */,
     274             :                                  HRESULT *_results /* [out] [size_is(Interfaces)] */,
     275             :                                  WERROR *result)
     276             : {
     277             :         struct RemoteActivation r;
     278             :         NTSTATUS status;
     279             : 
     280             :         /* In parameters */
     281           0 :         r.in.this_object = _this_object;
     282           0 :         r.in.Clsid = _Clsid;
     283           0 :         r.in.pwszObjectName = _pwszObjectName;
     284           0 :         r.in.pObjectStorage = _pObjectStorage;
     285           0 :         r.in.ClientImpLevel = _ClientImpLevel;
     286           0 :         r.in.Mode = _Mode;
     287           0 :         r.in.Interfaces = _Interfaces;
     288           0 :         r.in.pIIDs = _pIIDs;
     289           0 :         r.in.num_protseqs = _num_protseqs;
     290           0 :         r.in.protseq = _protseq;
     291             : 
     292             :         /* Out parameters */
     293           0 :         r.out.that = _that;
     294           0 :         r.out.pOxid = _pOxid;
     295           0 :         r.out.pdsaOxidBindings = _pdsaOxidBindings;
     296           0 :         r.out.ipidRemUnknown = _ipidRemUnknown;
     297           0 :         r.out.AuthnHint = _AuthnHint;
     298           0 :         r.out.ServerVersion = _ServerVersion;
     299           0 :         r.out.hr = _hr;
     300           0 :         r.out.ifaces = _ifaces;
     301           0 :         r.out.results = _results;
     302             : 
     303             :         /* Result */
     304           0 :         NDR_ZERO_STRUCT(r.out.result);
     305             : 
     306           0 :         status = dcerpc_RemoteActivation_r(h, mem_ctx, &r);
     307           0 :         if (!NT_STATUS_IS_OK(status)) {
     308           0 :                 return status;
     309             :         }
     310             : 
     311             :         /* Return variables */
     312           0 :         *_that = *r.out.that;
     313           0 :         *_pOxid = *r.out.pOxid;
     314           0 :         *_pdsaOxidBindings = *r.out.pdsaOxidBindings;
     315           0 :         *_ipidRemUnknown = *r.out.ipidRemUnknown;
     316           0 :         *_AuthnHint = *r.out.AuthnHint;
     317           0 :         *_ServerVersion = *r.out.ServerVersion;
     318           0 :         *_hr = *r.out.hr;
     319             :         {
     320             :                 size_t _copy_len_ifaces;
     321           0 :                 _copy_len_ifaces = r.in.Interfaces;
     322           0 :                 if (_ifaces != r.out.ifaces) {
     323           0 :                         memcpy(_ifaces, r.out.ifaces, _copy_len_ifaces * sizeof(*_ifaces));
     324             :                 }
     325             :         }
     326             :         {
     327             :                 size_t _copy_len_results;
     328           0 :                 _copy_len_results = r.in.Interfaces;
     329           0 :                 if (_results != r.out.results) {
     330           0 :                         memcpy(_results, r.out.results, _copy_len_results * sizeof(*_results));
     331             :                 }
     332             :         }
     333             : 
     334             :         /* Return result */
     335           0 :         *result = r.out.result;
     336             : 
     337           0 :         return NT_STATUS_OK;
     338             : }
     339             : 

Generated by: LCOV version 1.13