LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_epmapper_c.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 60 703 8.5 %
Date: 2024-04-21 15:09:00 Functions: 8 56 14.3 %

          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_epmapper.h"
       7             : #include "bin/default/librpc/gen_ndr/ndr_epmapper_c.h"
       8             : 
       9             : /* epmapper - client functions generated by pidl */
      10             : 
      11             : struct dcerpc_epm_Insert_r_state {
      12             :         TALLOC_CTX *out_mem_ctx;
      13             : };
      14             : 
      15             : static void dcerpc_epm_Insert_r_done(struct tevent_req *subreq);
      16             : 
      17           0 : struct tevent_req *dcerpc_epm_Insert_r_send(TALLOC_CTX *mem_ctx,
      18             :         struct tevent_context *ev,
      19             :         struct dcerpc_binding_handle *h,
      20             :         struct epm_Insert *r)
      21             : {
      22           0 :         struct tevent_req *req;
      23           0 :         struct dcerpc_epm_Insert_r_state *state;
      24           0 :         struct tevent_req *subreq;
      25             : 
      26           0 :         req = tevent_req_create(mem_ctx, &state,
      27             :                                 struct dcerpc_epm_Insert_r_state);
      28           0 :         if (req == NULL) {
      29           0 :                 return NULL;
      30             :         }
      31             : 
      32           0 :         state->out_mem_ctx = NULL;
      33             : 
      34           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
      35             :                         NULL, &ndr_table_epmapper,
      36             :                         NDR_EPM_INSERT, state, r);
      37           0 :         if (tevent_req_nomem(subreq, req)) {
      38           0 :                 return tevent_req_post(req, ev);
      39             :         }
      40           0 :         tevent_req_set_callback(subreq, dcerpc_epm_Insert_r_done, req);
      41             : 
      42           0 :         return req;
      43             : }
      44             : 
      45           0 : static void dcerpc_epm_Insert_r_done(struct tevent_req *subreq)
      46             : {
      47           0 :         struct tevent_req *req =
      48           0 :                 tevent_req_callback_data(subreq,
      49             :                 struct tevent_req);
      50           0 :         NTSTATUS status;
      51             : 
      52           0 :         status = dcerpc_binding_handle_call_recv(subreq);
      53           0 :         TALLOC_FREE(subreq);
      54           0 :         if (tevent_req_nterror(req, status)) {
      55           0 :                 return;
      56             :         }
      57             : 
      58           0 :         tevent_req_done(req);
      59             : }
      60             : 
      61           0 : NTSTATUS dcerpc_epm_Insert_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
      62             : {
      63           0 :         struct dcerpc_epm_Insert_r_state *state =
      64           0 :                 tevent_req_data(req,
      65             :                 struct dcerpc_epm_Insert_r_state);
      66           0 :         NTSTATUS status;
      67             : 
      68           0 :         if (tevent_req_is_nterror(req, &status)) {
      69           0 :                 tevent_req_received(req);
      70           0 :                 return status;
      71             :         }
      72             : 
      73           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
      74             : 
      75           0 :         tevent_req_received(req);
      76           0 :         return NT_STATUS_OK;
      77             : }
      78             : 
      79           4 : NTSTATUS dcerpc_epm_Insert_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct epm_Insert *r)
      80             : {
      81           0 :         NTSTATUS status;
      82             : 
      83           4 :         status = dcerpc_binding_handle_call(h,
      84             :                         NULL, &ndr_table_epmapper,
      85             :                         NDR_EPM_INSERT, mem_ctx, r);
      86             : 
      87           4 :         return status;
      88             : }
      89             : 
      90             : struct dcerpc_epm_Insert_state {
      91             :         struct epm_Insert orig;
      92             :         struct epm_Insert tmp;
      93             :         TALLOC_CTX *out_mem_ctx;
      94             : };
      95             : 
      96             : static void dcerpc_epm_Insert_done(struct tevent_req *subreq);
      97             : 
      98           0 : struct tevent_req *dcerpc_epm_Insert_send(TALLOC_CTX *mem_ctx,
      99             :                                           struct tevent_context *ev,
     100             :                                           struct dcerpc_binding_handle *h,
     101             :                                           uint32_t _num_ents /* [in]  */,
     102             :                                           struct epm_entry_t *_entries /* [in] [size_is(num_ents)] */,
     103             :                                           uint32_t _replace /* [in]  */)
     104             : {
     105           0 :         struct tevent_req *req;
     106           0 :         struct dcerpc_epm_Insert_state *state;
     107           0 :         struct tevent_req *subreq;
     108             : 
     109           0 :         req = tevent_req_create(mem_ctx, &state,
     110             :                                 struct dcerpc_epm_Insert_state);
     111           0 :         if (req == NULL) {
     112           0 :                 return NULL;
     113             :         }
     114           0 :         state->out_mem_ctx = NULL;
     115             : 
     116             :         /* In parameters */
     117           0 :         state->orig.in.num_ents = _num_ents;
     118           0 :         state->orig.in.entries = _entries;
     119           0 :         state->orig.in.replace = _replace;
     120             : 
     121             :         /* Out parameters */
     122             : 
     123             :         /* Result */
     124           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     125             : 
     126             :         /* make a temporary copy, that we pass to the dispatch function */
     127           0 :         state->tmp = state->orig;
     128             : 
     129           0 :         subreq = dcerpc_epm_Insert_r_send(state, ev, h, &state->tmp);
     130           0 :         if (tevent_req_nomem(subreq, req)) {
     131           0 :                 return tevent_req_post(req, ev);
     132             :         }
     133           0 :         tevent_req_set_callback(subreq, dcerpc_epm_Insert_done, req);
     134           0 :         return req;
     135             : }
     136             : 
     137           0 : static void dcerpc_epm_Insert_done(struct tevent_req *subreq)
     138             : {
     139           0 :         struct tevent_req *req = tevent_req_callback_data(
     140             :                 subreq, struct tevent_req);
     141           0 :         struct dcerpc_epm_Insert_state *state = tevent_req_data(
     142             :                 req, struct dcerpc_epm_Insert_state);
     143           0 :         NTSTATUS status;
     144           0 :         TALLOC_CTX *mem_ctx;
     145             : 
     146           0 :         if (state->out_mem_ctx) {
     147           0 :                 mem_ctx = state->out_mem_ctx;
     148             :         } else {
     149           0 :                 mem_ctx = state;
     150             :         }
     151             : 
     152           0 :         status = dcerpc_epm_Insert_r_recv(subreq, mem_ctx);
     153           0 :         TALLOC_FREE(subreq);
     154           0 :         if (tevent_req_nterror(req, status)) {
     155           0 :                 return;
     156             :         }
     157             : 
     158             :         /* Copy out parameters */
     159             : 
     160             :         /* Copy result */
     161           0 :         state->orig.out.result = state->tmp.out.result;
     162             : 
     163             :         /* Reset temporary structure */
     164           0 :         NDR_ZERO_STRUCT(state->tmp);
     165             : 
     166           0 :         tevent_req_done(req);
     167             : }
     168             : 
     169           0 : NTSTATUS dcerpc_epm_Insert_recv(struct tevent_req *req,
     170             :                                 TALLOC_CTX *mem_ctx,
     171             :                                 uint32_t *result)
     172             : {
     173           0 :         struct dcerpc_epm_Insert_state *state = tevent_req_data(
     174             :                 req, struct dcerpc_epm_Insert_state);
     175           0 :         NTSTATUS status;
     176             : 
     177           0 :         if (tevent_req_is_nterror(req, &status)) {
     178           0 :                 tevent_req_received(req);
     179           0 :                 return status;
     180             :         }
     181             : 
     182             :         /* Steal possible out parameters to the callers context */
     183           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     184             : 
     185             :         /* Return result */
     186           0 :         *result = state->orig.out.result;
     187             : 
     188           0 :         tevent_req_received(req);
     189           0 :         return NT_STATUS_OK;
     190             : }
     191             : 
     192           0 : NTSTATUS dcerpc_epm_Insert(struct dcerpc_binding_handle *h,
     193             :                            TALLOC_CTX *mem_ctx,
     194             :                            uint32_t _num_ents /* [in]  */,
     195             :                            struct epm_entry_t *_entries /* [in] [size_is(num_ents)] */,
     196             :                            uint32_t _replace /* [in]  */,
     197             :                            uint32_t *result)
     198             : {
     199           0 :         struct epm_Insert r;
     200           0 :         NTSTATUS status;
     201             : 
     202             :         /* In parameters */
     203           0 :         r.in.num_ents = _num_ents;
     204           0 :         r.in.entries = _entries;
     205           0 :         r.in.replace = _replace;
     206             : 
     207             :         /* Out parameters */
     208             : 
     209             :         /* Result */
     210           0 :         NDR_ZERO_STRUCT(r.out.result);
     211             : 
     212           0 :         status = dcerpc_epm_Insert_r(h, mem_ctx, &r);
     213           0 :         if (!NT_STATUS_IS_OK(status)) {
     214           0 :                 return status;
     215             :         }
     216             : 
     217             :         /* Return variables */
     218             : 
     219             :         /* Return result */
     220           0 :         *result = r.out.result;
     221             : 
     222           0 :         return NT_STATUS_OK;
     223             : }
     224             : 
     225             : struct dcerpc_epm_Delete_r_state {
     226             :         TALLOC_CTX *out_mem_ctx;
     227             : };
     228             : 
     229             : static void dcerpc_epm_Delete_r_done(struct tevent_req *subreq);
     230             : 
     231           0 : struct tevent_req *dcerpc_epm_Delete_r_send(TALLOC_CTX *mem_ctx,
     232             :         struct tevent_context *ev,
     233             :         struct dcerpc_binding_handle *h,
     234             :         struct epm_Delete *r)
     235             : {
     236           0 :         struct tevent_req *req;
     237           0 :         struct dcerpc_epm_Delete_r_state *state;
     238           0 :         struct tevent_req *subreq;
     239             : 
     240           0 :         req = tevent_req_create(mem_ctx, &state,
     241             :                                 struct dcerpc_epm_Delete_r_state);
     242           0 :         if (req == NULL) {
     243           0 :                 return NULL;
     244             :         }
     245             : 
     246           0 :         state->out_mem_ctx = NULL;
     247             : 
     248           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     249             :                         NULL, &ndr_table_epmapper,
     250             :                         NDR_EPM_DELETE, state, r);
     251           0 :         if (tevent_req_nomem(subreq, req)) {
     252           0 :                 return tevent_req_post(req, ev);
     253             :         }
     254           0 :         tevent_req_set_callback(subreq, dcerpc_epm_Delete_r_done, req);
     255             : 
     256           0 :         return req;
     257             : }
     258             : 
     259           0 : static void dcerpc_epm_Delete_r_done(struct tevent_req *subreq)
     260             : {
     261           0 :         struct tevent_req *req =
     262           0 :                 tevent_req_callback_data(subreq,
     263             :                 struct tevent_req);
     264           0 :         NTSTATUS status;
     265             : 
     266           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     267           0 :         TALLOC_FREE(subreq);
     268           0 :         if (tevent_req_nterror(req, status)) {
     269           0 :                 return;
     270             :         }
     271             : 
     272           0 :         tevent_req_done(req);
     273             : }
     274             : 
     275           0 : NTSTATUS dcerpc_epm_Delete_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     276             : {
     277           0 :         struct dcerpc_epm_Delete_r_state *state =
     278           0 :                 tevent_req_data(req,
     279             :                 struct dcerpc_epm_Delete_r_state);
     280           0 :         NTSTATUS status;
     281             : 
     282           0 :         if (tevent_req_is_nterror(req, &status)) {
     283           0 :                 tevent_req_received(req);
     284           0 :                 return status;
     285             :         }
     286             : 
     287           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     288             : 
     289           0 :         tevent_req_received(req);
     290           0 :         return NT_STATUS_OK;
     291             : }
     292             : 
     293           0 : NTSTATUS dcerpc_epm_Delete_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct epm_Delete *r)
     294             : {
     295           0 :         NTSTATUS status;
     296             : 
     297           0 :         status = dcerpc_binding_handle_call(h,
     298             :                         NULL, &ndr_table_epmapper,
     299             :                         NDR_EPM_DELETE, mem_ctx, r);
     300             : 
     301           0 :         return status;
     302             : }
     303             : 
     304             : struct dcerpc_epm_Delete_state {
     305             :         struct epm_Delete orig;
     306             :         struct epm_Delete tmp;
     307             :         TALLOC_CTX *out_mem_ctx;
     308             : };
     309             : 
     310             : static void dcerpc_epm_Delete_done(struct tevent_req *subreq);
     311             : 
     312           0 : struct tevent_req *dcerpc_epm_Delete_send(TALLOC_CTX *mem_ctx,
     313             :                                           struct tevent_context *ev,
     314             :                                           struct dcerpc_binding_handle *h,
     315             :                                           uint32_t _num_ents /* [in]  */,
     316             :                                           struct epm_entry_t *_entries /* [in] [size_is(num_ents)] */)
     317             : {
     318           0 :         struct tevent_req *req;
     319           0 :         struct dcerpc_epm_Delete_state *state;
     320           0 :         struct tevent_req *subreq;
     321             : 
     322           0 :         req = tevent_req_create(mem_ctx, &state,
     323             :                                 struct dcerpc_epm_Delete_state);
     324           0 :         if (req == NULL) {
     325           0 :                 return NULL;
     326             :         }
     327           0 :         state->out_mem_ctx = NULL;
     328             : 
     329             :         /* In parameters */
     330           0 :         state->orig.in.num_ents = _num_ents;
     331           0 :         state->orig.in.entries = _entries;
     332             : 
     333             :         /* Out parameters */
     334             : 
     335             :         /* Result */
     336           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     337             : 
     338             :         /* make a temporary copy, that we pass to the dispatch function */
     339           0 :         state->tmp = state->orig;
     340             : 
     341           0 :         subreq = dcerpc_epm_Delete_r_send(state, ev, h, &state->tmp);
     342           0 :         if (tevent_req_nomem(subreq, req)) {
     343           0 :                 return tevent_req_post(req, ev);
     344             :         }
     345           0 :         tevent_req_set_callback(subreq, dcerpc_epm_Delete_done, req);
     346           0 :         return req;
     347             : }
     348             : 
     349           0 : static void dcerpc_epm_Delete_done(struct tevent_req *subreq)
     350             : {
     351           0 :         struct tevent_req *req = tevent_req_callback_data(
     352             :                 subreq, struct tevent_req);
     353           0 :         struct dcerpc_epm_Delete_state *state = tevent_req_data(
     354             :                 req, struct dcerpc_epm_Delete_state);
     355           0 :         NTSTATUS status;
     356           0 :         TALLOC_CTX *mem_ctx;
     357             : 
     358           0 :         if (state->out_mem_ctx) {
     359           0 :                 mem_ctx = state->out_mem_ctx;
     360             :         } else {
     361           0 :                 mem_ctx = state;
     362             :         }
     363             : 
     364           0 :         status = dcerpc_epm_Delete_r_recv(subreq, mem_ctx);
     365           0 :         TALLOC_FREE(subreq);
     366           0 :         if (tevent_req_nterror(req, status)) {
     367           0 :                 return;
     368             :         }
     369             : 
     370             :         /* Copy out parameters */
     371             : 
     372             :         /* Copy result */
     373           0 :         state->orig.out.result = state->tmp.out.result;
     374             : 
     375             :         /* Reset temporary structure */
     376           0 :         NDR_ZERO_STRUCT(state->tmp);
     377             : 
     378           0 :         tevent_req_done(req);
     379             : }
     380             : 
     381           0 : NTSTATUS dcerpc_epm_Delete_recv(struct tevent_req *req,
     382             :                                 TALLOC_CTX *mem_ctx,
     383             :                                 uint32_t *result)
     384             : {
     385           0 :         struct dcerpc_epm_Delete_state *state = tevent_req_data(
     386             :                 req, struct dcerpc_epm_Delete_state);
     387           0 :         NTSTATUS status;
     388             : 
     389           0 :         if (tevent_req_is_nterror(req, &status)) {
     390           0 :                 tevent_req_received(req);
     391           0 :                 return status;
     392             :         }
     393             : 
     394             :         /* Steal possible out parameters to the callers context */
     395           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     396             : 
     397             :         /* Return result */
     398           0 :         *result = state->orig.out.result;
     399             : 
     400           0 :         tevent_req_received(req);
     401           0 :         return NT_STATUS_OK;
     402             : }
     403             : 
     404           0 : NTSTATUS dcerpc_epm_Delete(struct dcerpc_binding_handle *h,
     405             :                            TALLOC_CTX *mem_ctx,
     406             :                            uint32_t _num_ents /* [in]  */,
     407             :                            struct epm_entry_t *_entries /* [in] [size_is(num_ents)] */,
     408             :                            uint32_t *result)
     409             : {
     410           0 :         struct epm_Delete r;
     411           0 :         NTSTATUS status;
     412             : 
     413             :         /* In parameters */
     414           0 :         r.in.num_ents = _num_ents;
     415           0 :         r.in.entries = _entries;
     416             : 
     417             :         /* Out parameters */
     418             : 
     419             :         /* Result */
     420           0 :         NDR_ZERO_STRUCT(r.out.result);
     421             : 
     422           0 :         status = dcerpc_epm_Delete_r(h, mem_ctx, &r);
     423           0 :         if (!NT_STATUS_IS_OK(status)) {
     424           0 :                 return status;
     425             :         }
     426             : 
     427             :         /* Return variables */
     428             : 
     429             :         /* Return result */
     430           0 :         *result = r.out.result;
     431             : 
     432           0 :         return NT_STATUS_OK;
     433             : }
     434             : 
     435             : struct dcerpc_epm_Lookup_r_state {
     436             :         TALLOC_CTX *out_mem_ctx;
     437             : };
     438             : 
     439             : static void dcerpc_epm_Lookup_r_done(struct tevent_req *subreq);
     440             : 
     441           0 : struct tevent_req *dcerpc_epm_Lookup_r_send(TALLOC_CTX *mem_ctx,
     442             :         struct tevent_context *ev,
     443             :         struct dcerpc_binding_handle *h,
     444             :         struct epm_Lookup *r)
     445             : {
     446           0 :         struct tevent_req *req;
     447           0 :         struct dcerpc_epm_Lookup_r_state *state;
     448           0 :         struct tevent_req *subreq;
     449             : 
     450           0 :         req = tevent_req_create(mem_ctx, &state,
     451             :                                 struct dcerpc_epm_Lookup_r_state);
     452           0 :         if (req == NULL) {
     453           0 :                 return NULL;
     454             :         }
     455             : 
     456           0 :         state->out_mem_ctx = talloc_new(state);
     457           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     458           0 :                 return tevent_req_post(req, ev);
     459             :         }
     460             : 
     461           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     462             :                         NULL, &ndr_table_epmapper,
     463           0 :                         NDR_EPM_LOOKUP, state->out_mem_ctx, r);
     464           0 :         if (tevent_req_nomem(subreq, req)) {
     465           0 :                 return tevent_req_post(req, ev);
     466             :         }
     467           0 :         tevent_req_set_callback(subreq, dcerpc_epm_Lookup_r_done, req);
     468             : 
     469           0 :         return req;
     470             : }
     471             : 
     472           0 : static void dcerpc_epm_Lookup_r_done(struct tevent_req *subreq)
     473             : {
     474           0 :         struct tevent_req *req =
     475           0 :                 tevent_req_callback_data(subreq,
     476             :                 struct tevent_req);
     477           0 :         NTSTATUS status;
     478             : 
     479           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     480           0 :         TALLOC_FREE(subreq);
     481           0 :         if (tevent_req_nterror(req, status)) {
     482           0 :                 return;
     483             :         }
     484             : 
     485           0 :         tevent_req_done(req);
     486             : }
     487             : 
     488           0 : NTSTATUS dcerpc_epm_Lookup_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     489             : {
     490           0 :         struct dcerpc_epm_Lookup_r_state *state =
     491           0 :                 tevent_req_data(req,
     492             :                 struct dcerpc_epm_Lookup_r_state);
     493           0 :         NTSTATUS status;
     494             : 
     495           0 :         if (tevent_req_is_nterror(req, &status)) {
     496           0 :                 tevent_req_received(req);
     497           0 :                 return status;
     498             :         }
     499             : 
     500           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     501             : 
     502           0 :         tevent_req_received(req);
     503           0 :         return NT_STATUS_OK;
     504             : }
     505             : 
     506          82 : NTSTATUS dcerpc_epm_Lookup_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct epm_Lookup *r)
     507             : {
     508           0 :         NTSTATUS status;
     509             : 
     510          82 :         status = dcerpc_binding_handle_call(h,
     511             :                         NULL, &ndr_table_epmapper,
     512             :                         NDR_EPM_LOOKUP, mem_ctx, r);
     513             : 
     514          82 :         return status;
     515             : }
     516             : 
     517             : struct dcerpc_epm_Lookup_state {
     518             :         struct epm_Lookup orig;
     519             :         struct epm_Lookup tmp;
     520             :         TALLOC_CTX *out_mem_ctx;
     521             : };
     522             : 
     523             : static void dcerpc_epm_Lookup_done(struct tevent_req *subreq);
     524             : 
     525           0 : struct tevent_req *dcerpc_epm_Lookup_send(TALLOC_CTX *mem_ctx,
     526             :                                           struct tevent_context *ev,
     527             :                                           struct dcerpc_binding_handle *h,
     528             :                                           enum epm_InquiryType _inquiry_type /* [in]  */,
     529             :                                           struct GUID *_object /* [in] [ptr] */,
     530             :                                           struct rpc_if_id_t *_interface_id /* [in] [ptr] */,
     531             :                                           enum epm_VersionOption _vers_option /* [in]  */,
     532             :                                           struct policy_handle *_entry_handle /* [in,out] [ref] */,
     533             :                                           uint32_t _max_ents /* [in]  */,
     534             :                                           uint32_t *_num_ents /* [out] [ref] */,
     535             :                                           struct epm_entry_t *_entries /* [out] [length_is(*num_ents),size_is(max_ents)] */)
     536             : {
     537           0 :         struct tevent_req *req;
     538           0 :         struct dcerpc_epm_Lookup_state *state;
     539           0 :         struct tevent_req *subreq;
     540             : 
     541           0 :         req = tevent_req_create(mem_ctx, &state,
     542             :                                 struct dcerpc_epm_Lookup_state);
     543           0 :         if (req == NULL) {
     544           0 :                 return NULL;
     545             :         }
     546           0 :         state->out_mem_ctx = NULL;
     547             : 
     548             :         /* In parameters */
     549           0 :         state->orig.in.inquiry_type = _inquiry_type;
     550           0 :         state->orig.in.object = _object;
     551           0 :         state->orig.in.interface_id = _interface_id;
     552           0 :         state->orig.in.vers_option = _vers_option;
     553           0 :         state->orig.in.entry_handle = _entry_handle;
     554           0 :         state->orig.in.max_ents = _max_ents;
     555             : 
     556             :         /* Out parameters */
     557           0 :         state->orig.out.entry_handle = _entry_handle;
     558           0 :         state->orig.out.num_ents = _num_ents;
     559           0 :         state->orig.out.entries = _entries;
     560             : 
     561             :         /* Result */
     562           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     563             : 
     564           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     565             :                              "dcerpc_epm_Lookup_out_memory");
     566           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     567           0 :                 return tevent_req_post(req, ev);
     568             :         }
     569             : 
     570             :         /* make a temporary copy, that we pass to the dispatch function */
     571           0 :         state->tmp = state->orig;
     572             : 
     573           0 :         subreq = dcerpc_epm_Lookup_r_send(state, ev, h, &state->tmp);
     574           0 :         if (tevent_req_nomem(subreq, req)) {
     575           0 :                 return tevent_req_post(req, ev);
     576             :         }
     577           0 :         tevent_req_set_callback(subreq, dcerpc_epm_Lookup_done, req);
     578           0 :         return req;
     579             : }
     580             : 
     581           0 : static void dcerpc_epm_Lookup_done(struct tevent_req *subreq)
     582             : {
     583           0 :         struct tevent_req *req = tevent_req_callback_data(
     584             :                 subreq, struct tevent_req);
     585           0 :         struct dcerpc_epm_Lookup_state *state = tevent_req_data(
     586             :                 req, struct dcerpc_epm_Lookup_state);
     587           0 :         NTSTATUS status;
     588           0 :         TALLOC_CTX *mem_ctx;
     589             : 
     590           0 :         if (state->out_mem_ctx) {
     591           0 :                 mem_ctx = state->out_mem_ctx;
     592             :         } else {
     593           0 :                 mem_ctx = state;
     594             :         }
     595             : 
     596           0 :         status = dcerpc_epm_Lookup_r_recv(subreq, mem_ctx);
     597           0 :         TALLOC_FREE(subreq);
     598           0 :         if (tevent_req_nterror(req, status)) {
     599           0 :                 return;
     600             :         }
     601             : 
     602             :         /* Copy out parameters */
     603           0 :         *state->orig.out.entry_handle = *state->tmp.out.entry_handle;
     604           0 :         *state->orig.out.num_ents = *state->tmp.out.num_ents;
     605             :         {
     606           0 :                 size_t _copy_len_entries;
     607           0 :                 if ((*state->tmp.out.num_ents) > (state->tmp.in.max_ents)) {
     608           0 :                         tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
     609           0 :                         return;
     610             :                 }
     611           0 :                 _copy_len_entries = *state->tmp.out.num_ents;
     612           0 :                 if (state->orig.out.entries != state->tmp.out.entries) {
     613           0 :                         memcpy(state->orig.out.entries, state->tmp.out.entries, _copy_len_entries * sizeof(*state->orig.out.entries));
     614             :                 }
     615             :         }
     616             : 
     617             :         /* Copy result */
     618           0 :         state->orig.out.result = state->tmp.out.result;
     619             : 
     620             :         /* Reset temporary structure */
     621           0 :         NDR_ZERO_STRUCT(state->tmp);
     622             : 
     623           0 :         tevent_req_done(req);
     624             : }
     625             : 
     626           0 : NTSTATUS dcerpc_epm_Lookup_recv(struct tevent_req *req,
     627             :                                 TALLOC_CTX *mem_ctx,
     628             :                                 uint32_t *result)
     629             : {
     630           0 :         struct dcerpc_epm_Lookup_state *state = tevent_req_data(
     631             :                 req, struct dcerpc_epm_Lookup_state);
     632           0 :         NTSTATUS status;
     633             : 
     634           0 :         if (tevent_req_is_nterror(req, &status)) {
     635           0 :                 tevent_req_received(req);
     636           0 :                 return status;
     637             :         }
     638             : 
     639             :         /* Steal possible out parameters to the callers context */
     640           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     641             : 
     642             :         /* Return result */
     643           0 :         *result = state->orig.out.result;
     644             : 
     645           0 :         tevent_req_received(req);
     646           0 :         return NT_STATUS_OK;
     647             : }
     648             : 
     649           0 : NTSTATUS dcerpc_epm_Lookup(struct dcerpc_binding_handle *h,
     650             :                            TALLOC_CTX *mem_ctx,
     651             :                            enum epm_InquiryType _inquiry_type /* [in]  */,
     652             :                            struct GUID *_object /* [in] [ptr] */,
     653             :                            struct rpc_if_id_t *_interface_id /* [in] [ptr] */,
     654             :                            enum epm_VersionOption _vers_option /* [in]  */,
     655             :                            struct policy_handle *_entry_handle /* [in,out] [ref] */,
     656             :                            uint32_t _max_ents /* [in]  */,
     657             :                            uint32_t *_num_ents /* [out] [ref] */,
     658             :                            struct epm_entry_t *_entries /* [out] [length_is(*num_ents),size_is(max_ents)] */,
     659             :                            uint32_t *result)
     660             : {
     661           0 :         struct epm_Lookup r;
     662           0 :         NTSTATUS status;
     663             : 
     664             :         /* In parameters */
     665           0 :         r.in.inquiry_type = _inquiry_type;
     666           0 :         r.in.object = _object;
     667           0 :         r.in.interface_id = _interface_id;
     668           0 :         r.in.vers_option = _vers_option;
     669           0 :         r.in.entry_handle = _entry_handle;
     670           0 :         r.in.max_ents = _max_ents;
     671             : 
     672             :         /* Out parameters */
     673           0 :         r.out.entry_handle = _entry_handle;
     674           0 :         r.out.num_ents = _num_ents;
     675           0 :         r.out.entries = _entries;
     676             : 
     677             :         /* Result */
     678           0 :         NDR_ZERO_STRUCT(r.out.result);
     679             : 
     680           0 :         status = dcerpc_epm_Lookup_r(h, mem_ctx, &r);
     681           0 :         if (!NT_STATUS_IS_OK(status)) {
     682           0 :                 return status;
     683             :         }
     684             : 
     685             :         /* Return variables */
     686           0 :         *_entry_handle = *r.out.entry_handle;
     687           0 :         *_num_ents = *r.out.num_ents;
     688             :         {
     689           0 :                 size_t _copy_len_entries;
     690           0 :                 if ((*r.out.num_ents) > (r.in.max_ents)) {
     691           0 :                         return NT_STATUS_INVALID_NETWORK_RESPONSE;
     692             :                 }
     693           0 :                 _copy_len_entries = *r.out.num_ents;
     694           0 :                 if (_entries != r.out.entries) {
     695           0 :                         memcpy(_entries, r.out.entries, _copy_len_entries * sizeof(*_entries));
     696             :                 }
     697             :         }
     698             : 
     699             :         /* Return result */
     700           0 :         *result = r.out.result;
     701             : 
     702           0 :         return NT_STATUS_OK;
     703             : }
     704             : 
     705             : struct dcerpc_epm_Map_r_state {
     706             :         TALLOC_CTX *out_mem_ctx;
     707             : };
     708             : 
     709             : static void dcerpc_epm_Map_r_done(struct tevent_req *subreq);
     710             : 
     711        6124 : struct tevent_req *dcerpc_epm_Map_r_send(TALLOC_CTX *mem_ctx,
     712             :         struct tevent_context *ev,
     713             :         struct dcerpc_binding_handle *h,
     714             :         struct epm_Map *r)
     715             : {
     716         125 :         struct tevent_req *req;
     717         125 :         struct dcerpc_epm_Map_r_state *state;
     718         125 :         struct tevent_req *subreq;
     719             : 
     720        6124 :         req = tevent_req_create(mem_ctx, &state,
     721             :                                 struct dcerpc_epm_Map_r_state);
     722        6124 :         if (req == NULL) {
     723           0 :                 return NULL;
     724             :         }
     725             : 
     726        6124 :         state->out_mem_ctx = talloc_new(state);
     727        6124 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     728           0 :                 return tevent_req_post(req, ev);
     729             :         }
     730             : 
     731        6249 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     732             :                         NULL, &ndr_table_epmapper,
     733        6124 :                         NDR_EPM_MAP, state->out_mem_ctx, r);
     734        6124 :         if (tevent_req_nomem(subreq, req)) {
     735           0 :                 return tevent_req_post(req, ev);
     736             :         }
     737        6124 :         tevent_req_set_callback(subreq, dcerpc_epm_Map_r_done, req);
     738             : 
     739        6124 :         return req;
     740             : }
     741             : 
     742        6124 : static void dcerpc_epm_Map_r_done(struct tevent_req *subreq)
     743             : {
     744         125 :         struct tevent_req *req =
     745        6124 :                 tevent_req_callback_data(subreq,
     746             :                 struct tevent_req);
     747         125 :         NTSTATUS status;
     748             : 
     749        6124 :         status = dcerpc_binding_handle_call_recv(subreq);
     750        6124 :         TALLOC_FREE(subreq);
     751        6124 :         if (tevent_req_nterror(req, status)) {
     752           0 :                 return;
     753             :         }
     754             : 
     755        6124 :         tevent_req_done(req);
     756             : }
     757             : 
     758        6124 : NTSTATUS dcerpc_epm_Map_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     759             : {
     760         125 :         struct dcerpc_epm_Map_r_state *state =
     761        6124 :                 tevent_req_data(req,
     762             :                 struct dcerpc_epm_Map_r_state);
     763         125 :         NTSTATUS status;
     764             : 
     765        6124 :         if (tevent_req_is_nterror(req, &status)) {
     766           0 :                 tevent_req_received(req);
     767           0 :                 return status;
     768             :         }
     769             : 
     770        6124 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     771             : 
     772        6124 :         tevent_req_received(req);
     773        6124 :         return NT_STATUS_OK;
     774             : }
     775             : 
     776        1187 : NTSTATUS dcerpc_epm_Map_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct epm_Map *r)
     777             : {
     778           0 :         NTSTATUS status;
     779             : 
     780        1187 :         status = dcerpc_binding_handle_call(h,
     781             :                         NULL, &ndr_table_epmapper,
     782             :                         NDR_EPM_MAP, mem_ctx, r);
     783             : 
     784        1187 :         return status;
     785             : }
     786             : 
     787             : struct dcerpc_epm_Map_state {
     788             :         struct epm_Map orig;
     789             :         struct epm_Map tmp;
     790             :         TALLOC_CTX *out_mem_ctx;
     791             : };
     792             : 
     793             : static void dcerpc_epm_Map_done(struct tevent_req *subreq);
     794             : 
     795           0 : struct tevent_req *dcerpc_epm_Map_send(TALLOC_CTX *mem_ctx,
     796             :                                        struct tevent_context *ev,
     797             :                                        struct dcerpc_binding_handle *h,
     798             :                                        struct GUID *_object /* [in] [ptr] */,
     799             :                                        struct epm_twr_t *_map_tower /* [in] [ptr] */,
     800             :                                        struct policy_handle *_entry_handle /* [in,out] [ref] */,
     801             :                                        uint32_t _max_towers /* [in]  */,
     802             :                                        uint32_t *_num_towers /* [out] [ref] */,
     803             :                                        struct epm_twr_p_t *_towers /* [out] [length_is(*num_towers),size_is(max_towers)] */)
     804             : {
     805           0 :         struct tevent_req *req;
     806           0 :         struct dcerpc_epm_Map_state *state;
     807           0 :         struct tevent_req *subreq;
     808             : 
     809           0 :         req = tevent_req_create(mem_ctx, &state,
     810             :                                 struct dcerpc_epm_Map_state);
     811           0 :         if (req == NULL) {
     812           0 :                 return NULL;
     813             :         }
     814           0 :         state->out_mem_ctx = NULL;
     815             : 
     816             :         /* In parameters */
     817           0 :         state->orig.in.object = _object;
     818           0 :         state->orig.in.map_tower = _map_tower;
     819           0 :         state->orig.in.entry_handle = _entry_handle;
     820           0 :         state->orig.in.max_towers = _max_towers;
     821             : 
     822             :         /* Out parameters */
     823           0 :         state->orig.out.entry_handle = _entry_handle;
     824           0 :         state->orig.out.num_towers = _num_towers;
     825           0 :         state->orig.out.towers = _towers;
     826             : 
     827             :         /* Result */
     828           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     829             : 
     830           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     831             :                              "dcerpc_epm_Map_out_memory");
     832           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     833           0 :                 return tevent_req_post(req, ev);
     834             :         }
     835             : 
     836             :         /* make a temporary copy, that we pass to the dispatch function */
     837           0 :         state->tmp = state->orig;
     838             : 
     839           0 :         subreq = dcerpc_epm_Map_r_send(state, ev, h, &state->tmp);
     840           0 :         if (tevent_req_nomem(subreq, req)) {
     841           0 :                 return tevent_req_post(req, ev);
     842             :         }
     843           0 :         tevent_req_set_callback(subreq, dcerpc_epm_Map_done, req);
     844           0 :         return req;
     845             : }
     846             : 
     847           0 : static void dcerpc_epm_Map_done(struct tevent_req *subreq)
     848             : {
     849           0 :         struct tevent_req *req = tevent_req_callback_data(
     850             :                 subreq, struct tevent_req);
     851           0 :         struct dcerpc_epm_Map_state *state = tevent_req_data(
     852             :                 req, struct dcerpc_epm_Map_state);
     853           0 :         NTSTATUS status;
     854           0 :         TALLOC_CTX *mem_ctx;
     855             : 
     856           0 :         if (state->out_mem_ctx) {
     857           0 :                 mem_ctx = state->out_mem_ctx;
     858             :         } else {
     859           0 :                 mem_ctx = state;
     860             :         }
     861             : 
     862           0 :         status = dcerpc_epm_Map_r_recv(subreq, mem_ctx);
     863           0 :         TALLOC_FREE(subreq);
     864           0 :         if (tevent_req_nterror(req, status)) {
     865           0 :                 return;
     866             :         }
     867             : 
     868             :         /* Copy out parameters */
     869           0 :         *state->orig.out.entry_handle = *state->tmp.out.entry_handle;
     870           0 :         *state->orig.out.num_towers = *state->tmp.out.num_towers;
     871             :         {
     872           0 :                 size_t _copy_len_towers;
     873           0 :                 if ((*state->tmp.out.num_towers) > (state->tmp.in.max_towers)) {
     874           0 :                         tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
     875           0 :                         return;
     876             :                 }
     877           0 :                 _copy_len_towers = *state->tmp.out.num_towers;
     878           0 :                 if (state->orig.out.towers != state->tmp.out.towers) {
     879           0 :                         memcpy(state->orig.out.towers, state->tmp.out.towers, _copy_len_towers * sizeof(*state->orig.out.towers));
     880             :                 }
     881             :         }
     882             : 
     883             :         /* Copy result */
     884           0 :         state->orig.out.result = state->tmp.out.result;
     885             : 
     886             :         /* Reset temporary structure */
     887           0 :         NDR_ZERO_STRUCT(state->tmp);
     888             : 
     889           0 :         tevent_req_done(req);
     890             : }
     891             : 
     892           0 : NTSTATUS dcerpc_epm_Map_recv(struct tevent_req *req,
     893             :                              TALLOC_CTX *mem_ctx,
     894             :                              uint32_t *result)
     895             : {
     896           0 :         struct dcerpc_epm_Map_state *state = tevent_req_data(
     897             :                 req, struct dcerpc_epm_Map_state);
     898           0 :         NTSTATUS status;
     899             : 
     900           0 :         if (tevent_req_is_nterror(req, &status)) {
     901           0 :                 tevent_req_received(req);
     902           0 :                 return status;
     903             :         }
     904             : 
     905             :         /* Steal possible out parameters to the callers context */
     906           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     907             : 
     908             :         /* Return result */
     909           0 :         *result = state->orig.out.result;
     910             : 
     911           0 :         tevent_req_received(req);
     912           0 :         return NT_STATUS_OK;
     913             : }
     914             : 
     915         234 : NTSTATUS dcerpc_epm_Map(struct dcerpc_binding_handle *h,
     916             :                         TALLOC_CTX *mem_ctx,
     917             :                         struct GUID *_object /* [in] [ptr] */,
     918             :                         struct epm_twr_t *_map_tower /* [in] [ptr] */,
     919             :                         struct policy_handle *_entry_handle /* [in,out] [ref] */,
     920             :                         uint32_t _max_towers /* [in]  */,
     921             :                         uint32_t *_num_towers /* [out] [ref] */,
     922             :                         struct epm_twr_p_t *_towers /* [out] [length_is(*num_towers),size_is(max_towers)] */,
     923             :                         uint32_t *result)
     924             : {
     925           0 :         struct epm_Map r;
     926           0 :         NTSTATUS status;
     927             : 
     928             :         /* In parameters */
     929         234 :         r.in.object = _object;
     930         234 :         r.in.map_tower = _map_tower;
     931         234 :         r.in.entry_handle = _entry_handle;
     932         234 :         r.in.max_towers = _max_towers;
     933             : 
     934             :         /* Out parameters */
     935         234 :         r.out.entry_handle = _entry_handle;
     936         234 :         r.out.num_towers = _num_towers;
     937         234 :         r.out.towers = _towers;
     938             : 
     939             :         /* Result */
     940         234 :         NDR_ZERO_STRUCT(r.out.result);
     941             : 
     942         234 :         status = dcerpc_epm_Map_r(h, mem_ctx, &r);
     943         234 :         if (!NT_STATUS_IS_OK(status)) {
     944           0 :                 return status;
     945             :         }
     946             : 
     947             :         /* Return variables */
     948         234 :         *_entry_handle = *r.out.entry_handle;
     949         234 :         *_num_towers = *r.out.num_towers;
     950             :         {
     951           0 :                 size_t _copy_len_towers;
     952         234 :                 if ((*r.out.num_towers) > (r.in.max_towers)) {
     953           0 :                         return NT_STATUS_INVALID_NETWORK_RESPONSE;
     954             :                 }
     955         234 :                 _copy_len_towers = *r.out.num_towers;
     956         234 :                 if (_towers != r.out.towers) {
     957         234 :                         memcpy(_towers, r.out.towers, _copy_len_towers * sizeof(*_towers));
     958             :                 }
     959             :         }
     960             : 
     961             :         /* Return result */
     962         234 :         *result = r.out.result;
     963             : 
     964         234 :         return NT_STATUS_OK;
     965             : }
     966             : 
     967             : struct dcerpc_epm_LookupHandleFree_r_state {
     968             :         TALLOC_CTX *out_mem_ctx;
     969             : };
     970             : 
     971             : static void dcerpc_epm_LookupHandleFree_r_done(struct tevent_req *subreq);
     972             : 
     973           0 : struct tevent_req *dcerpc_epm_LookupHandleFree_r_send(TALLOC_CTX *mem_ctx,
     974             :         struct tevent_context *ev,
     975             :         struct dcerpc_binding_handle *h,
     976             :         struct epm_LookupHandleFree *r)
     977             : {
     978           0 :         struct tevent_req *req;
     979           0 :         struct dcerpc_epm_LookupHandleFree_r_state *state;
     980           0 :         struct tevent_req *subreq;
     981             : 
     982           0 :         req = tevent_req_create(mem_ctx, &state,
     983             :                                 struct dcerpc_epm_LookupHandleFree_r_state);
     984           0 :         if (req == NULL) {
     985           0 :                 return NULL;
     986             :         }
     987             : 
     988           0 :         state->out_mem_ctx = talloc_new(state);
     989           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     990           0 :                 return tevent_req_post(req, ev);
     991             :         }
     992             : 
     993           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     994             :                         NULL, &ndr_table_epmapper,
     995           0 :                         NDR_EPM_LOOKUPHANDLEFREE, state->out_mem_ctx, r);
     996           0 :         if (tevent_req_nomem(subreq, req)) {
     997           0 :                 return tevent_req_post(req, ev);
     998             :         }
     999           0 :         tevent_req_set_callback(subreq, dcerpc_epm_LookupHandleFree_r_done, req);
    1000             : 
    1001           0 :         return req;
    1002             : }
    1003             : 
    1004           0 : static void dcerpc_epm_LookupHandleFree_r_done(struct tevent_req *subreq)
    1005             : {
    1006           0 :         struct tevent_req *req =
    1007           0 :                 tevent_req_callback_data(subreq,
    1008             :                 struct tevent_req);
    1009           0 :         NTSTATUS status;
    1010             : 
    1011           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1012           0 :         TALLOC_FREE(subreq);
    1013           0 :         if (tevent_req_nterror(req, status)) {
    1014           0 :                 return;
    1015             :         }
    1016             : 
    1017           0 :         tevent_req_done(req);
    1018             : }
    1019             : 
    1020           0 : NTSTATUS dcerpc_epm_LookupHandleFree_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1021             : {
    1022           0 :         struct dcerpc_epm_LookupHandleFree_r_state *state =
    1023           0 :                 tevent_req_data(req,
    1024             :                 struct dcerpc_epm_LookupHandleFree_r_state);
    1025           0 :         NTSTATUS status;
    1026             : 
    1027           0 :         if (tevent_req_is_nterror(req, &status)) {
    1028           0 :                 tevent_req_received(req);
    1029           0 :                 return status;
    1030             :         }
    1031             : 
    1032           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1033             : 
    1034           0 :         tevent_req_received(req);
    1035           0 :         return NT_STATUS_OK;
    1036             : }
    1037             : 
    1038          12 : NTSTATUS dcerpc_epm_LookupHandleFree_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct epm_LookupHandleFree *r)
    1039             : {
    1040           0 :         NTSTATUS status;
    1041             : 
    1042          12 :         status = dcerpc_binding_handle_call(h,
    1043             :                         NULL, &ndr_table_epmapper,
    1044             :                         NDR_EPM_LOOKUPHANDLEFREE, mem_ctx, r);
    1045             : 
    1046          12 :         return status;
    1047             : }
    1048             : 
    1049             : struct dcerpc_epm_LookupHandleFree_state {
    1050             :         struct epm_LookupHandleFree orig;
    1051             :         struct epm_LookupHandleFree tmp;
    1052             :         TALLOC_CTX *out_mem_ctx;
    1053             : };
    1054             : 
    1055             : static void dcerpc_epm_LookupHandleFree_done(struct tevent_req *subreq);
    1056             : 
    1057           0 : struct tevent_req *dcerpc_epm_LookupHandleFree_send(TALLOC_CTX *mem_ctx,
    1058             :                                                     struct tevent_context *ev,
    1059             :                                                     struct dcerpc_binding_handle *h,
    1060             :                                                     struct policy_handle *_entry_handle /* [in,out] [ref] */)
    1061             : {
    1062           0 :         struct tevent_req *req;
    1063           0 :         struct dcerpc_epm_LookupHandleFree_state *state;
    1064           0 :         struct tevent_req *subreq;
    1065             : 
    1066           0 :         req = tevent_req_create(mem_ctx, &state,
    1067             :                                 struct dcerpc_epm_LookupHandleFree_state);
    1068           0 :         if (req == NULL) {
    1069           0 :                 return NULL;
    1070             :         }
    1071           0 :         state->out_mem_ctx = NULL;
    1072             : 
    1073             :         /* In parameters */
    1074           0 :         state->orig.in.entry_handle = _entry_handle;
    1075             : 
    1076             :         /* Out parameters */
    1077           0 :         state->orig.out.entry_handle = _entry_handle;
    1078             : 
    1079             :         /* Result */
    1080           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1081             : 
    1082           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1083             :                              "dcerpc_epm_LookupHandleFree_out_memory");
    1084           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1085           0 :                 return tevent_req_post(req, ev);
    1086             :         }
    1087             : 
    1088             :         /* make a temporary copy, that we pass to the dispatch function */
    1089           0 :         state->tmp = state->orig;
    1090             : 
    1091           0 :         subreq = dcerpc_epm_LookupHandleFree_r_send(state, ev, h, &state->tmp);
    1092           0 :         if (tevent_req_nomem(subreq, req)) {
    1093           0 :                 return tevent_req_post(req, ev);
    1094             :         }
    1095           0 :         tevent_req_set_callback(subreq, dcerpc_epm_LookupHandleFree_done, req);
    1096           0 :         return req;
    1097             : }
    1098             : 
    1099           0 : static void dcerpc_epm_LookupHandleFree_done(struct tevent_req *subreq)
    1100             : {
    1101           0 :         struct tevent_req *req = tevent_req_callback_data(
    1102             :                 subreq, struct tevent_req);
    1103           0 :         struct dcerpc_epm_LookupHandleFree_state *state = tevent_req_data(
    1104             :                 req, struct dcerpc_epm_LookupHandleFree_state);
    1105           0 :         NTSTATUS status;
    1106           0 :         TALLOC_CTX *mem_ctx;
    1107             : 
    1108           0 :         if (state->out_mem_ctx) {
    1109           0 :                 mem_ctx = state->out_mem_ctx;
    1110             :         } else {
    1111           0 :                 mem_ctx = state;
    1112             :         }
    1113             : 
    1114           0 :         status = dcerpc_epm_LookupHandleFree_r_recv(subreq, mem_ctx);
    1115           0 :         TALLOC_FREE(subreq);
    1116           0 :         if (tevent_req_nterror(req, status)) {
    1117           0 :                 return;
    1118             :         }
    1119             : 
    1120             :         /* Copy out parameters */
    1121           0 :         *state->orig.out.entry_handle = *state->tmp.out.entry_handle;
    1122             : 
    1123             :         /* Copy result */
    1124           0 :         state->orig.out.result = state->tmp.out.result;
    1125             : 
    1126             :         /* Reset temporary structure */
    1127           0 :         NDR_ZERO_STRUCT(state->tmp);
    1128             : 
    1129           0 :         tevent_req_done(req);
    1130             : }
    1131             : 
    1132           0 : NTSTATUS dcerpc_epm_LookupHandleFree_recv(struct tevent_req *req,
    1133             :                                           TALLOC_CTX *mem_ctx,
    1134             :                                           uint32_t *result)
    1135             : {
    1136           0 :         struct dcerpc_epm_LookupHandleFree_state *state = tevent_req_data(
    1137             :                 req, struct dcerpc_epm_LookupHandleFree_state);
    1138           0 :         NTSTATUS status;
    1139             : 
    1140           0 :         if (tevent_req_is_nterror(req, &status)) {
    1141           0 :                 tevent_req_received(req);
    1142           0 :                 return status;
    1143             :         }
    1144             : 
    1145             :         /* Steal possible out parameters to the callers context */
    1146           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1147             : 
    1148             :         /* Return result */
    1149           0 :         *result = state->orig.out.result;
    1150             : 
    1151           0 :         tevent_req_received(req);
    1152           0 :         return NT_STATUS_OK;
    1153             : }
    1154             : 
    1155           0 : NTSTATUS dcerpc_epm_LookupHandleFree(struct dcerpc_binding_handle *h,
    1156             :                                      TALLOC_CTX *mem_ctx,
    1157             :                                      struct policy_handle *_entry_handle /* [in,out] [ref] */,
    1158             :                                      uint32_t *result)
    1159             : {
    1160           0 :         struct epm_LookupHandleFree r;
    1161           0 :         NTSTATUS status;
    1162             : 
    1163             :         /* In parameters */
    1164           0 :         r.in.entry_handle = _entry_handle;
    1165             : 
    1166             :         /* Out parameters */
    1167           0 :         r.out.entry_handle = _entry_handle;
    1168             : 
    1169             :         /* Result */
    1170           0 :         NDR_ZERO_STRUCT(r.out.result);
    1171             : 
    1172           0 :         status = dcerpc_epm_LookupHandleFree_r(h, mem_ctx, &r);
    1173           0 :         if (!NT_STATUS_IS_OK(status)) {
    1174           0 :                 return status;
    1175             :         }
    1176             : 
    1177             :         /* Return variables */
    1178           0 :         *_entry_handle = *r.out.entry_handle;
    1179             : 
    1180             :         /* Return result */
    1181           0 :         *result = r.out.result;
    1182             : 
    1183           0 :         return NT_STATUS_OK;
    1184             : }
    1185             : 
    1186             : struct dcerpc_epm_InqObject_r_state {
    1187             :         TALLOC_CTX *out_mem_ctx;
    1188             : };
    1189             : 
    1190             : static void dcerpc_epm_InqObject_r_done(struct tevent_req *subreq);
    1191             : 
    1192           0 : struct tevent_req *dcerpc_epm_InqObject_r_send(TALLOC_CTX *mem_ctx,
    1193             :         struct tevent_context *ev,
    1194             :         struct dcerpc_binding_handle *h,
    1195             :         struct epm_InqObject *r)
    1196             : {
    1197           0 :         struct tevent_req *req;
    1198           0 :         struct dcerpc_epm_InqObject_r_state *state;
    1199           0 :         struct tevent_req *subreq;
    1200             : 
    1201           0 :         req = tevent_req_create(mem_ctx, &state,
    1202             :                                 struct dcerpc_epm_InqObject_r_state);
    1203           0 :         if (req == NULL) {
    1204           0 :                 return NULL;
    1205             :         }
    1206             : 
    1207           0 :         state->out_mem_ctx = NULL;
    1208             : 
    1209           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1210             :                         NULL, &ndr_table_epmapper,
    1211             :                         NDR_EPM_INQOBJECT, state, r);
    1212           0 :         if (tevent_req_nomem(subreq, req)) {
    1213           0 :                 return tevent_req_post(req, ev);
    1214             :         }
    1215           0 :         tevent_req_set_callback(subreq, dcerpc_epm_InqObject_r_done, req);
    1216             : 
    1217           0 :         return req;
    1218             : }
    1219             : 
    1220           0 : static void dcerpc_epm_InqObject_r_done(struct tevent_req *subreq)
    1221             : {
    1222           0 :         struct tevent_req *req =
    1223           0 :                 tevent_req_callback_data(subreq,
    1224             :                 struct tevent_req);
    1225           0 :         NTSTATUS status;
    1226             : 
    1227           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1228           0 :         TALLOC_FREE(subreq);
    1229           0 :         if (tevent_req_nterror(req, status)) {
    1230           0 :                 return;
    1231             :         }
    1232             : 
    1233           0 :         tevent_req_done(req);
    1234             : }
    1235             : 
    1236           0 : NTSTATUS dcerpc_epm_InqObject_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1237             : {
    1238           0 :         struct dcerpc_epm_InqObject_r_state *state =
    1239           0 :                 tevent_req_data(req,
    1240             :                 struct dcerpc_epm_InqObject_r_state);
    1241           0 :         NTSTATUS status;
    1242             : 
    1243           0 :         if (tevent_req_is_nterror(req, &status)) {
    1244           0 :                 tevent_req_received(req);
    1245           0 :                 return status;
    1246             :         }
    1247             : 
    1248           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1249             : 
    1250           0 :         tevent_req_received(req);
    1251           0 :         return NT_STATUS_OK;
    1252             : }
    1253             : 
    1254           0 : NTSTATUS dcerpc_epm_InqObject_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct epm_InqObject *r)
    1255             : {
    1256           0 :         NTSTATUS status;
    1257             : 
    1258           0 :         status = dcerpc_binding_handle_call(h,
    1259             :                         NULL, &ndr_table_epmapper,
    1260             :                         NDR_EPM_INQOBJECT, mem_ctx, r);
    1261             : 
    1262           0 :         return status;
    1263             : }
    1264             : 
    1265             : struct dcerpc_epm_InqObject_state {
    1266             :         struct epm_InqObject orig;
    1267             :         struct epm_InqObject tmp;
    1268             :         TALLOC_CTX *out_mem_ctx;
    1269             : };
    1270             : 
    1271             : static void dcerpc_epm_InqObject_done(struct tevent_req *subreq);
    1272             : 
    1273           0 : struct tevent_req *dcerpc_epm_InqObject_send(TALLOC_CTX *mem_ctx,
    1274             :                                              struct tevent_context *ev,
    1275             :                                              struct dcerpc_binding_handle *h,
    1276             :                                              struct GUID *_epm_object /* [in] [ref] */)
    1277             : {
    1278           0 :         struct tevent_req *req;
    1279           0 :         struct dcerpc_epm_InqObject_state *state;
    1280           0 :         struct tevent_req *subreq;
    1281             : 
    1282           0 :         req = tevent_req_create(mem_ctx, &state,
    1283             :                                 struct dcerpc_epm_InqObject_state);
    1284           0 :         if (req == NULL) {
    1285           0 :                 return NULL;
    1286             :         }
    1287           0 :         state->out_mem_ctx = NULL;
    1288             : 
    1289             :         /* In parameters */
    1290           0 :         state->orig.in.epm_object = _epm_object;
    1291             : 
    1292             :         /* Out parameters */
    1293             : 
    1294             :         /* Result */
    1295           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1296             : 
    1297             :         /* make a temporary copy, that we pass to the dispatch function */
    1298           0 :         state->tmp = state->orig;
    1299             : 
    1300           0 :         subreq = dcerpc_epm_InqObject_r_send(state, ev, h, &state->tmp);
    1301           0 :         if (tevent_req_nomem(subreq, req)) {
    1302           0 :                 return tevent_req_post(req, ev);
    1303             :         }
    1304           0 :         tevent_req_set_callback(subreq, dcerpc_epm_InqObject_done, req);
    1305           0 :         return req;
    1306             : }
    1307             : 
    1308           0 : static void dcerpc_epm_InqObject_done(struct tevent_req *subreq)
    1309             : {
    1310           0 :         struct tevent_req *req = tevent_req_callback_data(
    1311             :                 subreq, struct tevent_req);
    1312           0 :         struct dcerpc_epm_InqObject_state *state = tevent_req_data(
    1313             :                 req, struct dcerpc_epm_InqObject_state);
    1314           0 :         NTSTATUS status;
    1315           0 :         TALLOC_CTX *mem_ctx;
    1316             : 
    1317           0 :         if (state->out_mem_ctx) {
    1318           0 :                 mem_ctx = state->out_mem_ctx;
    1319             :         } else {
    1320           0 :                 mem_ctx = state;
    1321             :         }
    1322             : 
    1323           0 :         status = dcerpc_epm_InqObject_r_recv(subreq, mem_ctx);
    1324           0 :         TALLOC_FREE(subreq);
    1325           0 :         if (tevent_req_nterror(req, status)) {
    1326           0 :                 return;
    1327             :         }
    1328             : 
    1329             :         /* Copy out parameters */
    1330             : 
    1331             :         /* Copy result */
    1332           0 :         state->orig.out.result = state->tmp.out.result;
    1333             : 
    1334             :         /* Reset temporary structure */
    1335           0 :         NDR_ZERO_STRUCT(state->tmp);
    1336             : 
    1337           0 :         tevent_req_done(req);
    1338             : }
    1339             : 
    1340           0 : NTSTATUS dcerpc_epm_InqObject_recv(struct tevent_req *req,
    1341             :                                    TALLOC_CTX *mem_ctx,
    1342             :                                    uint32_t *result)
    1343             : {
    1344           0 :         struct dcerpc_epm_InqObject_state *state = tevent_req_data(
    1345             :                 req, struct dcerpc_epm_InqObject_state);
    1346           0 :         NTSTATUS status;
    1347             : 
    1348           0 :         if (tevent_req_is_nterror(req, &status)) {
    1349           0 :                 tevent_req_received(req);
    1350           0 :                 return status;
    1351             :         }
    1352             : 
    1353             :         /* Steal possible out parameters to the callers context */
    1354           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1355             : 
    1356             :         /* Return result */
    1357           0 :         *result = state->orig.out.result;
    1358             : 
    1359           0 :         tevent_req_received(req);
    1360           0 :         return NT_STATUS_OK;
    1361             : }
    1362             : 
    1363           0 : NTSTATUS dcerpc_epm_InqObject(struct dcerpc_binding_handle *h,
    1364             :                               TALLOC_CTX *mem_ctx,
    1365             :                               struct GUID *_epm_object /* [in] [ref] */,
    1366             :                               uint32_t *result)
    1367             : {
    1368           0 :         struct epm_InqObject r;
    1369           0 :         NTSTATUS status;
    1370             : 
    1371             :         /* In parameters */
    1372           0 :         r.in.epm_object = _epm_object;
    1373             : 
    1374             :         /* Out parameters */
    1375             : 
    1376             :         /* Result */
    1377           0 :         NDR_ZERO_STRUCT(r.out.result);
    1378             : 
    1379           0 :         status = dcerpc_epm_InqObject_r(h, mem_ctx, &r);
    1380           0 :         if (!NT_STATUS_IS_OK(status)) {
    1381           0 :                 return status;
    1382             :         }
    1383             : 
    1384             :         /* Return variables */
    1385             : 
    1386             :         /* Return result */
    1387           0 :         *result = r.out.result;
    1388             : 
    1389           0 :         return NT_STATUS_OK;
    1390             : }
    1391             : 
    1392             : struct dcerpc_epm_MgmtDelete_r_state {
    1393             :         TALLOC_CTX *out_mem_ctx;
    1394             : };
    1395             : 
    1396             : static void dcerpc_epm_MgmtDelete_r_done(struct tevent_req *subreq);
    1397             : 
    1398           0 : struct tevent_req *dcerpc_epm_MgmtDelete_r_send(TALLOC_CTX *mem_ctx,
    1399             :         struct tevent_context *ev,
    1400             :         struct dcerpc_binding_handle *h,
    1401             :         struct epm_MgmtDelete *r)
    1402             : {
    1403           0 :         struct tevent_req *req;
    1404           0 :         struct dcerpc_epm_MgmtDelete_r_state *state;
    1405           0 :         struct tevent_req *subreq;
    1406             : 
    1407           0 :         req = tevent_req_create(mem_ctx, &state,
    1408             :                                 struct dcerpc_epm_MgmtDelete_r_state);
    1409           0 :         if (req == NULL) {
    1410           0 :                 return NULL;
    1411             :         }
    1412             : 
    1413           0 :         state->out_mem_ctx = NULL;
    1414             : 
    1415           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1416             :                         NULL, &ndr_table_epmapper,
    1417             :                         NDR_EPM_MGMTDELETE, state, r);
    1418           0 :         if (tevent_req_nomem(subreq, req)) {
    1419           0 :                 return tevent_req_post(req, ev);
    1420             :         }
    1421           0 :         tevent_req_set_callback(subreq, dcerpc_epm_MgmtDelete_r_done, req);
    1422             : 
    1423           0 :         return req;
    1424             : }
    1425             : 
    1426           0 : static void dcerpc_epm_MgmtDelete_r_done(struct tevent_req *subreq)
    1427             : {
    1428           0 :         struct tevent_req *req =
    1429           0 :                 tevent_req_callback_data(subreq,
    1430             :                 struct tevent_req);
    1431           0 :         NTSTATUS status;
    1432             : 
    1433           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1434           0 :         TALLOC_FREE(subreq);
    1435           0 :         if (tevent_req_nterror(req, status)) {
    1436           0 :                 return;
    1437             :         }
    1438             : 
    1439           0 :         tevent_req_done(req);
    1440             : }
    1441             : 
    1442           0 : NTSTATUS dcerpc_epm_MgmtDelete_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1443             : {
    1444           0 :         struct dcerpc_epm_MgmtDelete_r_state *state =
    1445           0 :                 tevent_req_data(req,
    1446             :                 struct dcerpc_epm_MgmtDelete_r_state);
    1447           0 :         NTSTATUS status;
    1448             : 
    1449           0 :         if (tevent_req_is_nterror(req, &status)) {
    1450           0 :                 tevent_req_received(req);
    1451           0 :                 return status;
    1452             :         }
    1453             : 
    1454           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1455             : 
    1456           0 :         tevent_req_received(req);
    1457           0 :         return NT_STATUS_OK;
    1458             : }
    1459             : 
    1460           0 : NTSTATUS dcerpc_epm_MgmtDelete_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct epm_MgmtDelete *r)
    1461             : {
    1462           0 :         NTSTATUS status;
    1463             : 
    1464           0 :         status = dcerpc_binding_handle_call(h,
    1465             :                         NULL, &ndr_table_epmapper,
    1466             :                         NDR_EPM_MGMTDELETE, mem_ctx, r);
    1467             : 
    1468           0 :         return status;
    1469             : }
    1470             : 
    1471             : struct dcerpc_epm_MgmtDelete_state {
    1472             :         struct epm_MgmtDelete orig;
    1473             :         struct epm_MgmtDelete tmp;
    1474             :         TALLOC_CTX *out_mem_ctx;
    1475             : };
    1476             : 
    1477             : static void dcerpc_epm_MgmtDelete_done(struct tevent_req *subreq);
    1478             : 
    1479           0 : struct tevent_req *dcerpc_epm_MgmtDelete_send(TALLOC_CTX *mem_ctx,
    1480             :                                               struct tevent_context *ev,
    1481             :                                               struct dcerpc_binding_handle *h,
    1482             :                                               uint32_t _object_speced /* [in]  */,
    1483             :                                               struct GUID *_object /* [in] [ptr] */,
    1484             :                                               struct epm_twr_t *_tower /* [in] [ptr] */)
    1485             : {
    1486           0 :         struct tevent_req *req;
    1487           0 :         struct dcerpc_epm_MgmtDelete_state *state;
    1488           0 :         struct tevent_req *subreq;
    1489             : 
    1490           0 :         req = tevent_req_create(mem_ctx, &state,
    1491             :                                 struct dcerpc_epm_MgmtDelete_state);
    1492           0 :         if (req == NULL) {
    1493           0 :                 return NULL;
    1494             :         }
    1495           0 :         state->out_mem_ctx = NULL;
    1496             : 
    1497             :         /* In parameters */
    1498           0 :         state->orig.in.object_speced = _object_speced;
    1499           0 :         state->orig.in.object = _object;
    1500           0 :         state->orig.in.tower = _tower;
    1501             : 
    1502             :         /* Out parameters */
    1503             : 
    1504             :         /* Result */
    1505           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1506             : 
    1507             :         /* make a temporary copy, that we pass to the dispatch function */
    1508           0 :         state->tmp = state->orig;
    1509             : 
    1510           0 :         subreq = dcerpc_epm_MgmtDelete_r_send(state, ev, h, &state->tmp);
    1511           0 :         if (tevent_req_nomem(subreq, req)) {
    1512           0 :                 return tevent_req_post(req, ev);
    1513             :         }
    1514           0 :         tevent_req_set_callback(subreq, dcerpc_epm_MgmtDelete_done, req);
    1515           0 :         return req;
    1516             : }
    1517             : 
    1518           0 : static void dcerpc_epm_MgmtDelete_done(struct tevent_req *subreq)
    1519             : {
    1520           0 :         struct tevent_req *req = tevent_req_callback_data(
    1521             :                 subreq, struct tevent_req);
    1522           0 :         struct dcerpc_epm_MgmtDelete_state *state = tevent_req_data(
    1523             :                 req, struct dcerpc_epm_MgmtDelete_state);
    1524           0 :         NTSTATUS status;
    1525           0 :         TALLOC_CTX *mem_ctx;
    1526             : 
    1527           0 :         if (state->out_mem_ctx) {
    1528           0 :                 mem_ctx = state->out_mem_ctx;
    1529             :         } else {
    1530           0 :                 mem_ctx = state;
    1531             :         }
    1532             : 
    1533           0 :         status = dcerpc_epm_MgmtDelete_r_recv(subreq, mem_ctx);
    1534           0 :         TALLOC_FREE(subreq);
    1535           0 :         if (tevent_req_nterror(req, status)) {
    1536           0 :                 return;
    1537             :         }
    1538             : 
    1539             :         /* Copy out parameters */
    1540             : 
    1541             :         /* Copy result */
    1542           0 :         state->orig.out.result = state->tmp.out.result;
    1543             : 
    1544             :         /* Reset temporary structure */
    1545           0 :         NDR_ZERO_STRUCT(state->tmp);
    1546             : 
    1547           0 :         tevent_req_done(req);
    1548             : }
    1549             : 
    1550           0 : NTSTATUS dcerpc_epm_MgmtDelete_recv(struct tevent_req *req,
    1551             :                                     TALLOC_CTX *mem_ctx,
    1552             :                                     uint32_t *result)
    1553             : {
    1554           0 :         struct dcerpc_epm_MgmtDelete_state *state = tevent_req_data(
    1555             :                 req, struct dcerpc_epm_MgmtDelete_state);
    1556           0 :         NTSTATUS status;
    1557             : 
    1558           0 :         if (tevent_req_is_nterror(req, &status)) {
    1559           0 :                 tevent_req_received(req);
    1560           0 :                 return status;
    1561             :         }
    1562             : 
    1563             :         /* Steal possible out parameters to the callers context */
    1564           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1565             : 
    1566             :         /* Return result */
    1567           0 :         *result = state->orig.out.result;
    1568             : 
    1569           0 :         tevent_req_received(req);
    1570           0 :         return NT_STATUS_OK;
    1571             : }
    1572             : 
    1573           0 : NTSTATUS dcerpc_epm_MgmtDelete(struct dcerpc_binding_handle *h,
    1574             :                                TALLOC_CTX *mem_ctx,
    1575             :                                uint32_t _object_speced /* [in]  */,
    1576             :                                struct GUID *_object /* [in] [ptr] */,
    1577             :                                struct epm_twr_t *_tower /* [in] [ptr] */,
    1578             :                                uint32_t *result)
    1579             : {
    1580           0 :         struct epm_MgmtDelete r;
    1581           0 :         NTSTATUS status;
    1582             : 
    1583             :         /* In parameters */
    1584           0 :         r.in.object_speced = _object_speced;
    1585           0 :         r.in.object = _object;
    1586           0 :         r.in.tower = _tower;
    1587             : 
    1588             :         /* Out parameters */
    1589             : 
    1590             :         /* Result */
    1591           0 :         NDR_ZERO_STRUCT(r.out.result);
    1592             : 
    1593           0 :         status = dcerpc_epm_MgmtDelete_r(h, mem_ctx, &r);
    1594           0 :         if (!NT_STATUS_IS_OK(status)) {
    1595           0 :                 return status;
    1596             :         }
    1597             : 
    1598             :         /* Return variables */
    1599             : 
    1600             :         /* Return result */
    1601           0 :         *result = r.out.result;
    1602             : 
    1603           0 :         return NT_STATUS_OK;
    1604             : }
    1605             : 

Generated by: LCOV version 1.14