LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_drsuapi_c.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 170 1903 8.9 %
Date: 2024-04-21 15:09:00 Functions: 31 152 20.4 %

          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_drsuapi.h"
       7             : #include "bin/default/librpc/gen_ndr/ndr_drsuapi_c.h"
       8             : 
       9             : /* drsuapi - client functions generated by pidl */
      10             : 
      11             : struct dcerpc_drsuapi_DsBind_r_state {
      12             :         TALLOC_CTX *out_mem_ctx;
      13             : };
      14             : 
      15             : static void dcerpc_drsuapi_DsBind_r_done(struct tevent_req *subreq);
      16             : 
      17          29 : struct tevent_req *dcerpc_drsuapi_DsBind_r_send(TALLOC_CTX *mem_ctx,
      18             :         struct tevent_context *ev,
      19             :         struct dcerpc_binding_handle *h,
      20             :         struct drsuapi_DsBind *r)
      21             : {
      22           0 :         struct tevent_req *req;
      23           0 :         struct dcerpc_drsuapi_DsBind_r_state *state;
      24           0 :         struct tevent_req *subreq;
      25             : 
      26          29 :         req = tevent_req_create(mem_ctx, &state,
      27             :                                 struct dcerpc_drsuapi_DsBind_r_state);
      28          29 :         if (req == NULL) {
      29           0 :                 return NULL;
      30             :         }
      31             : 
      32          29 :         state->out_mem_ctx = talloc_new(state);
      33          29 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
      34           0 :                 return tevent_req_post(req, ev);
      35             :         }
      36             : 
      37          29 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
      38             :                         NULL, &ndr_table_drsuapi,
      39          29 :                         NDR_DRSUAPI_DSBIND, state->out_mem_ctx, r);
      40          29 :         if (tevent_req_nomem(subreq, req)) {
      41           0 :                 return tevent_req_post(req, ev);
      42             :         }
      43          29 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsBind_r_done, req);
      44             : 
      45          29 :         return req;
      46             : }
      47             : 
      48          29 : static void dcerpc_drsuapi_DsBind_r_done(struct tevent_req *subreq)
      49             : {
      50           0 :         struct tevent_req *req =
      51          29 :                 tevent_req_callback_data(subreq,
      52             :                 struct tevent_req);
      53           0 :         NTSTATUS status;
      54             : 
      55          29 :         status = dcerpc_binding_handle_call_recv(subreq);
      56          29 :         TALLOC_FREE(subreq);
      57          29 :         if (tevent_req_nterror(req, status)) {
      58           0 :                 return;
      59             :         }
      60             : 
      61          29 :         tevent_req_done(req);
      62             : }
      63             : 
      64          29 : NTSTATUS dcerpc_drsuapi_DsBind_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
      65             : {
      66           0 :         struct dcerpc_drsuapi_DsBind_r_state *state =
      67          29 :                 tevent_req_data(req,
      68             :                 struct dcerpc_drsuapi_DsBind_r_state);
      69           0 :         NTSTATUS status;
      70             : 
      71          29 :         if (tevent_req_is_nterror(req, &status)) {
      72           0 :                 tevent_req_received(req);
      73           0 :                 return status;
      74             :         }
      75             : 
      76          29 :         talloc_steal(mem_ctx, state->out_mem_ctx);
      77             : 
      78          29 :         tevent_req_received(req);
      79          29 :         return NT_STATUS_OK;
      80             : }
      81             : 
      82        2159 : NTSTATUS dcerpc_drsuapi_DsBind_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsBind *r)
      83             : {
      84          75 :         NTSTATUS status;
      85             : 
      86        2159 :         status = dcerpc_binding_handle_call(h,
      87             :                         NULL, &ndr_table_drsuapi,
      88             :                         NDR_DRSUAPI_DSBIND, mem_ctx, r);
      89             : 
      90        2159 :         return status;
      91             : }
      92             : 
      93             : struct dcerpc_drsuapi_DsBind_state {
      94             :         struct drsuapi_DsBind orig;
      95             :         struct drsuapi_DsBind tmp;
      96             :         TALLOC_CTX *out_mem_ctx;
      97             : };
      98             : 
      99             : static void dcerpc_drsuapi_DsBind_done(struct tevent_req *subreq);
     100             : 
     101           0 : struct tevent_req *dcerpc_drsuapi_DsBind_send(TALLOC_CTX *mem_ctx,
     102             :                                               struct tevent_context *ev,
     103             :                                               struct dcerpc_binding_handle *h,
     104             :                                               struct GUID *_bind_guid /* [in] [unique] */,
     105             :                                               struct drsuapi_DsBindInfoCtr *_bind_info /* [in,out] [unique] */,
     106             :                                               struct policy_handle *_bind_handle /* [out] [ref] */)
     107             : {
     108           0 :         struct tevent_req *req;
     109           0 :         struct dcerpc_drsuapi_DsBind_state *state;
     110           0 :         struct tevent_req *subreq;
     111             : 
     112           0 :         req = tevent_req_create(mem_ctx, &state,
     113             :                                 struct dcerpc_drsuapi_DsBind_state);
     114           0 :         if (req == NULL) {
     115           0 :                 return NULL;
     116             :         }
     117           0 :         state->out_mem_ctx = NULL;
     118             : 
     119             :         /* In parameters */
     120           0 :         state->orig.in.bind_guid = _bind_guid;
     121           0 :         state->orig.in.bind_info = _bind_info;
     122             : 
     123             :         /* Out parameters */
     124           0 :         state->orig.out.bind_info = _bind_info;
     125           0 :         state->orig.out.bind_handle = _bind_handle;
     126             : 
     127             :         /* Result */
     128           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     129             : 
     130           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     131             :                              "dcerpc_drsuapi_DsBind_out_memory");
     132           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     133           0 :                 return tevent_req_post(req, ev);
     134             :         }
     135             : 
     136             :         /* make a temporary copy, that we pass to the dispatch function */
     137           0 :         state->tmp = state->orig;
     138             : 
     139           0 :         subreq = dcerpc_drsuapi_DsBind_r_send(state, ev, h, &state->tmp);
     140           0 :         if (tevent_req_nomem(subreq, req)) {
     141           0 :                 return tevent_req_post(req, ev);
     142             :         }
     143           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsBind_done, req);
     144           0 :         return req;
     145             : }
     146             : 
     147           0 : static void dcerpc_drsuapi_DsBind_done(struct tevent_req *subreq)
     148             : {
     149           0 :         struct tevent_req *req = tevent_req_callback_data(
     150             :                 subreq, struct tevent_req);
     151           0 :         struct dcerpc_drsuapi_DsBind_state *state = tevent_req_data(
     152             :                 req, struct dcerpc_drsuapi_DsBind_state);
     153           0 :         NTSTATUS status;
     154           0 :         TALLOC_CTX *mem_ctx;
     155             : 
     156           0 :         if (state->out_mem_ctx) {
     157           0 :                 mem_ctx = state->out_mem_ctx;
     158             :         } else {
     159           0 :                 mem_ctx = state;
     160             :         }
     161             : 
     162           0 :         status = dcerpc_drsuapi_DsBind_r_recv(subreq, mem_ctx);
     163           0 :         TALLOC_FREE(subreq);
     164           0 :         if (tevent_req_nterror(req, status)) {
     165           0 :                 return;
     166             :         }
     167             : 
     168             :         /* Copy out parameters */
     169           0 :         if (state->orig.out.bind_info && state->tmp.out.bind_info) {
     170           0 :                 *state->orig.out.bind_info = *state->tmp.out.bind_info;
     171             :         }
     172           0 :         *state->orig.out.bind_handle = *state->tmp.out.bind_handle;
     173             : 
     174             :         /* Copy result */
     175           0 :         state->orig.out.result = state->tmp.out.result;
     176             : 
     177             :         /* Reset temporary structure */
     178           0 :         NDR_ZERO_STRUCT(state->tmp);
     179             : 
     180           0 :         tevent_req_done(req);
     181             : }
     182             : 
     183           0 : NTSTATUS dcerpc_drsuapi_DsBind_recv(struct tevent_req *req,
     184             :                                     TALLOC_CTX *mem_ctx,
     185             :                                     WERROR *result)
     186             : {
     187           0 :         struct dcerpc_drsuapi_DsBind_state *state = tevent_req_data(
     188             :                 req, struct dcerpc_drsuapi_DsBind_state);
     189           0 :         NTSTATUS status;
     190             : 
     191           0 :         if (tevent_req_is_nterror(req, &status)) {
     192           0 :                 tevent_req_received(req);
     193           0 :                 return status;
     194             :         }
     195             : 
     196             :         /* Steal possible out parameters to the callers context */
     197           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     198             : 
     199             :         /* Return result */
     200           0 :         *result = state->orig.out.result;
     201             : 
     202           0 :         tevent_req_received(req);
     203           0 :         return NT_STATUS_OK;
     204             : }
     205             : 
     206           0 : NTSTATUS dcerpc_drsuapi_DsBind(struct dcerpc_binding_handle *h,
     207             :                                TALLOC_CTX *mem_ctx,
     208             :                                struct GUID *_bind_guid /* [in] [unique] */,
     209             :                                struct drsuapi_DsBindInfoCtr *_bind_info /* [in,out] [unique] */,
     210             :                                struct policy_handle *_bind_handle /* [out] [ref] */,
     211             :                                WERROR *result)
     212             : {
     213           0 :         struct drsuapi_DsBind r;
     214           0 :         NTSTATUS status;
     215             : 
     216             :         /* In parameters */
     217           0 :         r.in.bind_guid = _bind_guid;
     218           0 :         r.in.bind_info = _bind_info;
     219             : 
     220             :         /* Out parameters */
     221           0 :         r.out.bind_info = _bind_info;
     222           0 :         r.out.bind_handle = _bind_handle;
     223             : 
     224             :         /* Result */
     225           0 :         NDR_ZERO_STRUCT(r.out.result);
     226             : 
     227           0 :         status = dcerpc_drsuapi_DsBind_r(h, mem_ctx, &r);
     228           0 :         if (!NT_STATUS_IS_OK(status)) {
     229           0 :                 return status;
     230             :         }
     231             : 
     232             :         /* Return variables */
     233           0 :         if (_bind_info && r.out.bind_info) {
     234           0 :                 *_bind_info = *r.out.bind_info;
     235             :         }
     236           0 :         *_bind_handle = *r.out.bind_handle;
     237             : 
     238             :         /* Return result */
     239           0 :         *result = r.out.result;
     240             : 
     241           0 :         return NT_STATUS_OK;
     242             : }
     243             : 
     244             : struct dcerpc_drsuapi_DsUnbind_r_state {
     245             :         TALLOC_CTX *out_mem_ctx;
     246             : };
     247             : 
     248             : static void dcerpc_drsuapi_DsUnbind_r_done(struct tevent_req *subreq);
     249             : 
     250           0 : struct tevent_req *dcerpc_drsuapi_DsUnbind_r_send(TALLOC_CTX *mem_ctx,
     251             :         struct tevent_context *ev,
     252             :         struct dcerpc_binding_handle *h,
     253             :         struct drsuapi_DsUnbind *r)
     254             : {
     255           0 :         struct tevent_req *req;
     256           0 :         struct dcerpc_drsuapi_DsUnbind_r_state *state;
     257           0 :         struct tevent_req *subreq;
     258             : 
     259           0 :         req = tevent_req_create(mem_ctx, &state,
     260             :                                 struct dcerpc_drsuapi_DsUnbind_r_state);
     261           0 :         if (req == NULL) {
     262           0 :                 return NULL;
     263             :         }
     264             : 
     265           0 :         state->out_mem_ctx = talloc_new(state);
     266           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     267           0 :                 return tevent_req_post(req, ev);
     268             :         }
     269             : 
     270           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     271             :                         NULL, &ndr_table_drsuapi,
     272           0 :                         NDR_DRSUAPI_DSUNBIND, state->out_mem_ctx, r);
     273           0 :         if (tevent_req_nomem(subreq, req)) {
     274           0 :                 return tevent_req_post(req, ev);
     275             :         }
     276           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsUnbind_r_done, req);
     277             : 
     278           0 :         return req;
     279             : }
     280             : 
     281           0 : static void dcerpc_drsuapi_DsUnbind_r_done(struct tevent_req *subreq)
     282             : {
     283           0 :         struct tevent_req *req =
     284           0 :                 tevent_req_callback_data(subreq,
     285             :                 struct tevent_req);
     286           0 :         NTSTATUS status;
     287             : 
     288           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     289           0 :         TALLOC_FREE(subreq);
     290           0 :         if (tevent_req_nterror(req, status)) {
     291           0 :                 return;
     292             :         }
     293             : 
     294           0 :         tevent_req_done(req);
     295             : }
     296             : 
     297           0 : NTSTATUS dcerpc_drsuapi_DsUnbind_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     298             : {
     299           0 :         struct dcerpc_drsuapi_DsUnbind_r_state *state =
     300           0 :                 tevent_req_data(req,
     301             :                 struct dcerpc_drsuapi_DsUnbind_r_state);
     302           0 :         NTSTATUS status;
     303             : 
     304           0 :         if (tevent_req_is_nterror(req, &status)) {
     305           0 :                 tevent_req_received(req);
     306           0 :                 return status;
     307             :         }
     308             : 
     309           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     310             : 
     311           0 :         tevent_req_received(req);
     312           0 :         return NT_STATUS_OK;
     313             : }
     314             : 
     315          25 : NTSTATUS dcerpc_drsuapi_DsUnbind_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsUnbind *r)
     316             : {
     317           3 :         NTSTATUS status;
     318             : 
     319          25 :         status = dcerpc_binding_handle_call(h,
     320             :                         NULL, &ndr_table_drsuapi,
     321             :                         NDR_DRSUAPI_DSUNBIND, mem_ctx, r);
     322             : 
     323          25 :         return status;
     324             : }
     325             : 
     326             : struct dcerpc_drsuapi_DsUnbind_state {
     327             :         struct drsuapi_DsUnbind orig;
     328             :         struct drsuapi_DsUnbind tmp;
     329             :         TALLOC_CTX *out_mem_ctx;
     330             : };
     331             : 
     332             : static void dcerpc_drsuapi_DsUnbind_done(struct tevent_req *subreq);
     333             : 
     334           0 : struct tevent_req *dcerpc_drsuapi_DsUnbind_send(TALLOC_CTX *mem_ctx,
     335             :                                                 struct tevent_context *ev,
     336             :                                                 struct dcerpc_binding_handle *h,
     337             :                                                 struct policy_handle *_bind_handle /* [in,out] [ref] */)
     338             : {
     339           0 :         struct tevent_req *req;
     340           0 :         struct dcerpc_drsuapi_DsUnbind_state *state;
     341           0 :         struct tevent_req *subreq;
     342             : 
     343           0 :         req = tevent_req_create(mem_ctx, &state,
     344             :                                 struct dcerpc_drsuapi_DsUnbind_state);
     345           0 :         if (req == NULL) {
     346           0 :                 return NULL;
     347             :         }
     348           0 :         state->out_mem_ctx = NULL;
     349             : 
     350             :         /* In parameters */
     351           0 :         state->orig.in.bind_handle = _bind_handle;
     352             : 
     353             :         /* Out parameters */
     354           0 :         state->orig.out.bind_handle = _bind_handle;
     355             : 
     356             :         /* Result */
     357           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     358             : 
     359           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     360             :                              "dcerpc_drsuapi_DsUnbind_out_memory");
     361           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     362           0 :                 return tevent_req_post(req, ev);
     363             :         }
     364             : 
     365             :         /* make a temporary copy, that we pass to the dispatch function */
     366           0 :         state->tmp = state->orig;
     367             : 
     368           0 :         subreq = dcerpc_drsuapi_DsUnbind_r_send(state, ev, h, &state->tmp);
     369           0 :         if (tevent_req_nomem(subreq, req)) {
     370           0 :                 return tevent_req_post(req, ev);
     371             :         }
     372           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsUnbind_done, req);
     373           0 :         return req;
     374             : }
     375             : 
     376           0 : static void dcerpc_drsuapi_DsUnbind_done(struct tevent_req *subreq)
     377             : {
     378           0 :         struct tevent_req *req = tevent_req_callback_data(
     379             :                 subreq, struct tevent_req);
     380           0 :         struct dcerpc_drsuapi_DsUnbind_state *state = tevent_req_data(
     381             :                 req, struct dcerpc_drsuapi_DsUnbind_state);
     382           0 :         NTSTATUS status;
     383           0 :         TALLOC_CTX *mem_ctx;
     384             : 
     385           0 :         if (state->out_mem_ctx) {
     386           0 :                 mem_ctx = state->out_mem_ctx;
     387             :         } else {
     388           0 :                 mem_ctx = state;
     389             :         }
     390             : 
     391           0 :         status = dcerpc_drsuapi_DsUnbind_r_recv(subreq, mem_ctx);
     392           0 :         TALLOC_FREE(subreq);
     393           0 :         if (tevent_req_nterror(req, status)) {
     394           0 :                 return;
     395             :         }
     396             : 
     397             :         /* Copy out parameters */
     398           0 :         *state->orig.out.bind_handle = *state->tmp.out.bind_handle;
     399             : 
     400             :         /* Copy result */
     401           0 :         state->orig.out.result = state->tmp.out.result;
     402             : 
     403             :         /* Reset temporary structure */
     404           0 :         NDR_ZERO_STRUCT(state->tmp);
     405             : 
     406           0 :         tevent_req_done(req);
     407             : }
     408             : 
     409           0 : NTSTATUS dcerpc_drsuapi_DsUnbind_recv(struct tevent_req *req,
     410             :                                       TALLOC_CTX *mem_ctx,
     411             :                                       WERROR *result)
     412             : {
     413           0 :         struct dcerpc_drsuapi_DsUnbind_state *state = tevent_req_data(
     414             :                 req, struct dcerpc_drsuapi_DsUnbind_state);
     415           0 :         NTSTATUS status;
     416             : 
     417           0 :         if (tevent_req_is_nterror(req, &status)) {
     418           0 :                 tevent_req_received(req);
     419           0 :                 return status;
     420             :         }
     421             : 
     422             :         /* Steal possible out parameters to the callers context */
     423           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     424             : 
     425             :         /* Return result */
     426           0 :         *result = state->orig.out.result;
     427             : 
     428           0 :         tevent_req_received(req);
     429           0 :         return NT_STATUS_OK;
     430             : }
     431             : 
     432           0 : NTSTATUS dcerpc_drsuapi_DsUnbind(struct dcerpc_binding_handle *h,
     433             :                                  TALLOC_CTX *mem_ctx,
     434             :                                  struct policy_handle *_bind_handle /* [in,out] [ref] */,
     435             :                                  WERROR *result)
     436             : {
     437           0 :         struct drsuapi_DsUnbind r;
     438           0 :         NTSTATUS status;
     439             : 
     440             :         /* In parameters */
     441           0 :         r.in.bind_handle = _bind_handle;
     442             : 
     443             :         /* Out parameters */
     444           0 :         r.out.bind_handle = _bind_handle;
     445             : 
     446             :         /* Result */
     447           0 :         NDR_ZERO_STRUCT(r.out.result);
     448             : 
     449           0 :         status = dcerpc_drsuapi_DsUnbind_r(h, mem_ctx, &r);
     450           0 :         if (!NT_STATUS_IS_OK(status)) {
     451           0 :                 return status;
     452             :         }
     453             : 
     454             :         /* Return variables */
     455           0 :         *_bind_handle = *r.out.bind_handle;
     456             : 
     457             :         /* Return result */
     458           0 :         *result = r.out.result;
     459             : 
     460           0 :         return NT_STATUS_OK;
     461             : }
     462             : 
     463             : struct dcerpc_drsuapi_DsReplicaSync_r_state {
     464             :         TALLOC_CTX *out_mem_ctx;
     465             : };
     466             : 
     467             : static void dcerpc_drsuapi_DsReplicaSync_r_done(struct tevent_req *subreq);
     468             : 
     469        1136 : struct tevent_req *dcerpc_drsuapi_DsReplicaSync_r_send(TALLOC_CTX *mem_ctx,
     470             :         struct tevent_context *ev,
     471             :         struct dcerpc_binding_handle *h,
     472             :         struct drsuapi_DsReplicaSync *r)
     473             : {
     474           0 :         struct tevent_req *req;
     475           0 :         struct dcerpc_drsuapi_DsReplicaSync_r_state *state;
     476           0 :         struct tevent_req *subreq;
     477             : 
     478        1136 :         req = tevent_req_create(mem_ctx, &state,
     479             :                                 struct dcerpc_drsuapi_DsReplicaSync_r_state);
     480        1136 :         if (req == NULL) {
     481           0 :                 return NULL;
     482             :         }
     483             : 
     484        1136 :         state->out_mem_ctx = NULL;
     485             : 
     486        1136 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     487             :                         NULL, &ndr_table_drsuapi,
     488             :                         NDR_DRSUAPI_DSREPLICASYNC, state, r);
     489        1136 :         if (tevent_req_nomem(subreq, req)) {
     490           0 :                 return tevent_req_post(req, ev);
     491             :         }
     492        1136 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaSync_r_done, req);
     493             : 
     494        1136 :         return req;
     495             : }
     496             : 
     497        1136 : static void dcerpc_drsuapi_DsReplicaSync_r_done(struct tevent_req *subreq)
     498             : {
     499           0 :         struct tevent_req *req =
     500        1136 :                 tevent_req_callback_data(subreq,
     501             :                 struct tevent_req);
     502           0 :         NTSTATUS status;
     503             : 
     504        1136 :         status = dcerpc_binding_handle_call_recv(subreq);
     505        1136 :         TALLOC_FREE(subreq);
     506        1136 :         if (tevent_req_nterror(req, status)) {
     507           0 :                 return;
     508             :         }
     509             : 
     510        1136 :         tevent_req_done(req);
     511             : }
     512             : 
     513        1136 : NTSTATUS dcerpc_drsuapi_DsReplicaSync_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     514             : {
     515           0 :         struct dcerpc_drsuapi_DsReplicaSync_r_state *state =
     516        1136 :                 tevent_req_data(req,
     517             :                 struct dcerpc_drsuapi_DsReplicaSync_r_state);
     518           0 :         NTSTATUS status;
     519             : 
     520        1136 :         if (tevent_req_is_nterror(req, &status)) {
     521           0 :                 tevent_req_received(req);
     522           0 :                 return status;
     523             :         }
     524             : 
     525        1136 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     526             : 
     527        1136 :         tevent_req_received(req);
     528        1136 :         return NT_STATUS_OK;
     529             : }
     530             : 
     531         967 : NTSTATUS dcerpc_drsuapi_DsReplicaSync_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsReplicaSync *r)
     532             : {
     533           0 :         NTSTATUS status;
     534             : 
     535         967 :         status = dcerpc_binding_handle_call(h,
     536             :                         NULL, &ndr_table_drsuapi,
     537             :                         NDR_DRSUAPI_DSREPLICASYNC, mem_ctx, r);
     538             : 
     539         967 :         return status;
     540             : }
     541             : 
     542             : struct dcerpc_drsuapi_DsReplicaSync_state {
     543             :         struct drsuapi_DsReplicaSync orig;
     544             :         struct drsuapi_DsReplicaSync tmp;
     545             :         TALLOC_CTX *out_mem_ctx;
     546             : };
     547             : 
     548             : static void dcerpc_drsuapi_DsReplicaSync_done(struct tevent_req *subreq);
     549             : 
     550           0 : struct tevent_req *dcerpc_drsuapi_DsReplicaSync_send(TALLOC_CTX *mem_ctx,
     551             :                                                      struct tevent_context *ev,
     552             :                                                      struct dcerpc_binding_handle *h,
     553             :                                                      struct policy_handle *_bind_handle /* [in] [ref] */,
     554             :                                                      uint32_t _level /* [in]  */,
     555             :                                                      union drsuapi_DsReplicaSyncRequest *_req /* [in] [ref,switch_is(level)] */)
     556             : {
     557           0 :         struct tevent_req *req;
     558           0 :         struct dcerpc_drsuapi_DsReplicaSync_state *state;
     559           0 :         struct tevent_req *subreq;
     560             : 
     561           0 :         req = tevent_req_create(mem_ctx, &state,
     562             :                                 struct dcerpc_drsuapi_DsReplicaSync_state);
     563           0 :         if (req == NULL) {
     564           0 :                 return NULL;
     565             :         }
     566           0 :         state->out_mem_ctx = NULL;
     567             : 
     568             :         /* In parameters */
     569           0 :         state->orig.in.bind_handle = _bind_handle;
     570           0 :         state->orig.in.level = _level;
     571           0 :         state->orig.in.req = _req;
     572             : 
     573             :         /* Out parameters */
     574             : 
     575             :         /* Result */
     576           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     577             : 
     578             :         /* make a temporary copy, that we pass to the dispatch function */
     579           0 :         state->tmp = state->orig;
     580             : 
     581           0 :         subreq = dcerpc_drsuapi_DsReplicaSync_r_send(state, ev, h, &state->tmp);
     582           0 :         if (tevent_req_nomem(subreq, req)) {
     583           0 :                 return tevent_req_post(req, ev);
     584             :         }
     585           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaSync_done, req);
     586           0 :         return req;
     587             : }
     588             : 
     589           0 : static void dcerpc_drsuapi_DsReplicaSync_done(struct tevent_req *subreq)
     590             : {
     591           0 :         struct tevent_req *req = tevent_req_callback_data(
     592             :                 subreq, struct tevent_req);
     593           0 :         struct dcerpc_drsuapi_DsReplicaSync_state *state = tevent_req_data(
     594             :                 req, struct dcerpc_drsuapi_DsReplicaSync_state);
     595           0 :         NTSTATUS status;
     596           0 :         TALLOC_CTX *mem_ctx;
     597             : 
     598           0 :         if (state->out_mem_ctx) {
     599           0 :                 mem_ctx = state->out_mem_ctx;
     600             :         } else {
     601           0 :                 mem_ctx = state;
     602             :         }
     603             : 
     604           0 :         status = dcerpc_drsuapi_DsReplicaSync_r_recv(subreq, mem_ctx);
     605           0 :         TALLOC_FREE(subreq);
     606           0 :         if (tevent_req_nterror(req, status)) {
     607           0 :                 return;
     608             :         }
     609             : 
     610             :         /* Copy out parameters */
     611             : 
     612             :         /* Copy result */
     613           0 :         state->orig.out.result = state->tmp.out.result;
     614             : 
     615             :         /* Reset temporary structure */
     616           0 :         NDR_ZERO_STRUCT(state->tmp);
     617             : 
     618           0 :         tevent_req_done(req);
     619             : }
     620             : 
     621           0 : NTSTATUS dcerpc_drsuapi_DsReplicaSync_recv(struct tevent_req *req,
     622             :                                            TALLOC_CTX *mem_ctx,
     623             :                                            WERROR *result)
     624             : {
     625           0 :         struct dcerpc_drsuapi_DsReplicaSync_state *state = tevent_req_data(
     626             :                 req, struct dcerpc_drsuapi_DsReplicaSync_state);
     627           0 :         NTSTATUS status;
     628             : 
     629           0 :         if (tevent_req_is_nterror(req, &status)) {
     630           0 :                 tevent_req_received(req);
     631           0 :                 return status;
     632             :         }
     633             : 
     634             :         /* Steal possible out parameters to the callers context */
     635           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     636             : 
     637             :         /* Return result */
     638           0 :         *result = state->orig.out.result;
     639             : 
     640           0 :         tevent_req_received(req);
     641           0 :         return NT_STATUS_OK;
     642             : }
     643             : 
     644           0 : NTSTATUS dcerpc_drsuapi_DsReplicaSync(struct dcerpc_binding_handle *h,
     645             :                                       TALLOC_CTX *mem_ctx,
     646             :                                       struct policy_handle *_bind_handle /* [in] [ref] */,
     647             :                                       uint32_t _level /* [in]  */,
     648             :                                       union drsuapi_DsReplicaSyncRequest *_req /* [in] [ref,switch_is(level)] */,
     649             :                                       WERROR *result)
     650             : {
     651           0 :         struct drsuapi_DsReplicaSync r;
     652           0 :         NTSTATUS status;
     653             : 
     654             :         /* In parameters */
     655           0 :         r.in.bind_handle = _bind_handle;
     656           0 :         r.in.level = _level;
     657           0 :         r.in.req = _req;
     658             : 
     659             :         /* Out parameters */
     660             : 
     661             :         /* Result */
     662           0 :         NDR_ZERO_STRUCT(r.out.result);
     663             : 
     664           0 :         status = dcerpc_drsuapi_DsReplicaSync_r(h, mem_ctx, &r);
     665           0 :         if (!NT_STATUS_IS_OK(status)) {
     666           0 :                 return status;
     667             :         }
     668             : 
     669             :         /* Return variables */
     670             : 
     671             :         /* Return result */
     672           0 :         *result = r.out.result;
     673             : 
     674           0 :         return NT_STATUS_OK;
     675             : }
     676             : 
     677             : struct dcerpc_drsuapi_DsGetNCChanges_r_state {
     678             :         TALLOC_CTX *out_mem_ctx;
     679             : };
     680             : 
     681             : static void dcerpc_drsuapi_DsGetNCChanges_r_done(struct tevent_req *subreq);
     682             : 
     683        4386 : struct tevent_req *dcerpc_drsuapi_DsGetNCChanges_r_send(TALLOC_CTX *mem_ctx,
     684             :         struct tevent_context *ev,
     685             :         struct dcerpc_binding_handle *h,
     686             :         struct drsuapi_DsGetNCChanges *r)
     687             : {
     688           0 :         struct tevent_req *req;
     689           0 :         struct dcerpc_drsuapi_DsGetNCChanges_r_state *state;
     690           0 :         struct tevent_req *subreq;
     691             : 
     692        4386 :         req = tevent_req_create(mem_ctx, &state,
     693             :                                 struct dcerpc_drsuapi_DsGetNCChanges_r_state);
     694        4386 :         if (req == NULL) {
     695           0 :                 return NULL;
     696             :         }
     697             : 
     698        4386 :         state->out_mem_ctx = talloc_new(state);
     699        4386 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     700           0 :                 return tevent_req_post(req, ev);
     701             :         }
     702             : 
     703        4386 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     704             :                         NULL, &ndr_table_drsuapi,
     705        4386 :                         NDR_DRSUAPI_DSGETNCCHANGES, state->out_mem_ctx, r);
     706        4386 :         if (tevent_req_nomem(subreq, req)) {
     707           0 :                 return tevent_req_post(req, ev);
     708             :         }
     709        4386 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsGetNCChanges_r_done, req);
     710             : 
     711        4386 :         return req;
     712             : }
     713             : 
     714        4386 : static void dcerpc_drsuapi_DsGetNCChanges_r_done(struct tevent_req *subreq)
     715             : {
     716           0 :         struct tevent_req *req =
     717        4386 :                 tevent_req_callback_data(subreq,
     718             :                 struct tevent_req);
     719           0 :         NTSTATUS status;
     720             : 
     721        4386 :         status = dcerpc_binding_handle_call_recv(subreq);
     722        4386 :         TALLOC_FREE(subreq);
     723        4386 :         if (tevent_req_nterror(req, status)) {
     724           0 :                 return;
     725             :         }
     726             : 
     727        4386 :         tevent_req_done(req);
     728             : }
     729             : 
     730        4386 : NTSTATUS dcerpc_drsuapi_DsGetNCChanges_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     731             : {
     732           0 :         struct dcerpc_drsuapi_DsGetNCChanges_r_state *state =
     733        4386 :                 tevent_req_data(req,
     734             :                 struct dcerpc_drsuapi_DsGetNCChanges_r_state);
     735           0 :         NTSTATUS status;
     736             : 
     737        4386 :         if (tevent_req_is_nterror(req, &status)) {
     738           0 :                 tevent_req_received(req);
     739           0 :                 return status;
     740             :         }
     741             : 
     742        4386 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     743             : 
     744        4386 :         tevent_req_received(req);
     745        4386 :         return NT_STATUS_OK;
     746             : }
     747             : 
     748        5653 : NTSTATUS dcerpc_drsuapi_DsGetNCChanges_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsGetNCChanges *r)
     749             : {
     750           0 :         NTSTATUS status;
     751             : 
     752        5653 :         status = dcerpc_binding_handle_call(h,
     753             :                         NULL, &ndr_table_drsuapi,
     754             :                         NDR_DRSUAPI_DSGETNCCHANGES, mem_ctx, r);
     755             : 
     756        5653 :         return status;
     757             : }
     758             : 
     759             : struct dcerpc_drsuapi_DsGetNCChanges_state {
     760             :         struct drsuapi_DsGetNCChanges orig;
     761             :         struct drsuapi_DsGetNCChanges tmp;
     762             :         TALLOC_CTX *out_mem_ctx;
     763             : };
     764             : 
     765             : static void dcerpc_drsuapi_DsGetNCChanges_done(struct tevent_req *subreq);
     766             : 
     767           0 : struct tevent_req *dcerpc_drsuapi_DsGetNCChanges_send(TALLOC_CTX *mem_ctx,
     768             :                                                       struct tevent_context *ev,
     769             :                                                       struct dcerpc_binding_handle *h,
     770             :                                                       struct policy_handle *_bind_handle /* [in] [ref] */,
     771             :                                                       uint32_t _level /* [in]  */,
     772             :                                                       union drsuapi_DsGetNCChangesRequest *_req /* [in] [ref,switch_is(level)] */,
     773             :                                                       uint32_t *_level_out /* [out] [ref] */,
     774             :                                                       union drsuapi_DsGetNCChangesCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
     775             : {
     776           0 :         struct tevent_req *req;
     777           0 :         struct dcerpc_drsuapi_DsGetNCChanges_state *state;
     778           0 :         struct tevent_req *subreq;
     779             : 
     780           0 :         req = tevent_req_create(mem_ctx, &state,
     781             :                                 struct dcerpc_drsuapi_DsGetNCChanges_state);
     782           0 :         if (req == NULL) {
     783           0 :                 return NULL;
     784             :         }
     785           0 :         state->out_mem_ctx = NULL;
     786             : 
     787             :         /* In parameters */
     788           0 :         state->orig.in.bind_handle = _bind_handle;
     789           0 :         state->orig.in.level = _level;
     790           0 :         state->orig.in.req = _req;
     791             : 
     792             :         /* Out parameters */
     793           0 :         state->orig.out.level_out = _level_out;
     794           0 :         state->orig.out.ctr = _ctr;
     795             : 
     796             :         /* Result */
     797           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     798             : 
     799           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     800             :                              "dcerpc_drsuapi_DsGetNCChanges_out_memory");
     801           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     802           0 :                 return tevent_req_post(req, ev);
     803             :         }
     804             : 
     805             :         /* make a temporary copy, that we pass to the dispatch function */
     806           0 :         state->tmp = state->orig;
     807             : 
     808           0 :         subreq = dcerpc_drsuapi_DsGetNCChanges_r_send(state, ev, h, &state->tmp);
     809           0 :         if (tevent_req_nomem(subreq, req)) {
     810           0 :                 return tevent_req_post(req, ev);
     811             :         }
     812           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsGetNCChanges_done, req);
     813           0 :         return req;
     814             : }
     815             : 
     816           0 : static void dcerpc_drsuapi_DsGetNCChanges_done(struct tevent_req *subreq)
     817             : {
     818           0 :         struct tevent_req *req = tevent_req_callback_data(
     819             :                 subreq, struct tevent_req);
     820           0 :         struct dcerpc_drsuapi_DsGetNCChanges_state *state = tevent_req_data(
     821             :                 req, struct dcerpc_drsuapi_DsGetNCChanges_state);
     822           0 :         NTSTATUS status;
     823           0 :         TALLOC_CTX *mem_ctx;
     824             : 
     825           0 :         if (state->out_mem_ctx) {
     826           0 :                 mem_ctx = state->out_mem_ctx;
     827             :         } else {
     828           0 :                 mem_ctx = state;
     829             :         }
     830             : 
     831           0 :         status = dcerpc_drsuapi_DsGetNCChanges_r_recv(subreq, mem_ctx);
     832           0 :         TALLOC_FREE(subreq);
     833           0 :         if (tevent_req_nterror(req, status)) {
     834           0 :                 return;
     835             :         }
     836             : 
     837             :         /* Copy out parameters */
     838           0 :         *state->orig.out.level_out = *state->tmp.out.level_out;
     839           0 :         *state->orig.out.ctr = *state->tmp.out.ctr;
     840             : 
     841             :         /* Copy result */
     842           0 :         state->orig.out.result = state->tmp.out.result;
     843             : 
     844             :         /* Reset temporary structure */
     845           0 :         NDR_ZERO_STRUCT(state->tmp);
     846             : 
     847           0 :         tevent_req_done(req);
     848             : }
     849             : 
     850           0 : NTSTATUS dcerpc_drsuapi_DsGetNCChanges_recv(struct tevent_req *req,
     851             :                                             TALLOC_CTX *mem_ctx,
     852             :                                             WERROR *result)
     853             : {
     854           0 :         struct dcerpc_drsuapi_DsGetNCChanges_state *state = tevent_req_data(
     855             :                 req, struct dcerpc_drsuapi_DsGetNCChanges_state);
     856           0 :         NTSTATUS status;
     857             : 
     858           0 :         if (tevent_req_is_nterror(req, &status)) {
     859           0 :                 tevent_req_received(req);
     860           0 :                 return status;
     861             :         }
     862             : 
     863             :         /* Steal possible out parameters to the callers context */
     864           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     865             : 
     866             :         /* Return result */
     867           0 :         *result = state->orig.out.result;
     868             : 
     869           0 :         tevent_req_received(req);
     870           0 :         return NT_STATUS_OK;
     871             : }
     872             : 
     873           0 : NTSTATUS dcerpc_drsuapi_DsGetNCChanges(struct dcerpc_binding_handle *h,
     874             :                                        TALLOC_CTX *mem_ctx,
     875             :                                        struct policy_handle *_bind_handle /* [in] [ref] */,
     876             :                                        uint32_t _level /* [in]  */,
     877             :                                        union drsuapi_DsGetNCChangesRequest *_req /* [in] [ref,switch_is(level)] */,
     878             :                                        uint32_t *_level_out /* [out] [ref] */,
     879             :                                        union drsuapi_DsGetNCChangesCtr *_ctr /* [out] [ref,switch_is(*level_out)] */,
     880             :                                        WERROR *result)
     881             : {
     882           0 :         struct drsuapi_DsGetNCChanges r;
     883           0 :         NTSTATUS status;
     884             : 
     885             :         /* In parameters */
     886           0 :         r.in.bind_handle = _bind_handle;
     887           0 :         r.in.level = _level;
     888           0 :         r.in.req = _req;
     889             : 
     890             :         /* Out parameters */
     891           0 :         r.out.level_out = _level_out;
     892           0 :         r.out.ctr = _ctr;
     893             : 
     894             :         /* Result */
     895           0 :         NDR_ZERO_STRUCT(r.out.result);
     896             : 
     897           0 :         status = dcerpc_drsuapi_DsGetNCChanges_r(h, mem_ctx, &r);
     898           0 :         if (!NT_STATUS_IS_OK(status)) {
     899           0 :                 return status;
     900             :         }
     901             : 
     902             :         /* Return variables */
     903           0 :         *_level_out = *r.out.level_out;
     904           0 :         *_ctr = *r.out.ctr;
     905             : 
     906             :         /* Return result */
     907           0 :         *result = r.out.result;
     908             : 
     909           0 :         return NT_STATUS_OK;
     910             : }
     911             : 
     912             : struct dcerpc_drsuapi_DsReplicaUpdateRefs_r_state {
     913             :         TALLOC_CTX *out_mem_ctx;
     914             : };
     915             : 
     916             : static void dcerpc_drsuapi_DsReplicaUpdateRefs_r_done(struct tevent_req *subreq);
     917             : 
     918        1417 : struct tevent_req *dcerpc_drsuapi_DsReplicaUpdateRefs_r_send(TALLOC_CTX *mem_ctx,
     919             :         struct tevent_context *ev,
     920             :         struct dcerpc_binding_handle *h,
     921             :         struct drsuapi_DsReplicaUpdateRefs *r)
     922             : {
     923           0 :         struct tevent_req *req;
     924           0 :         struct dcerpc_drsuapi_DsReplicaUpdateRefs_r_state *state;
     925           0 :         struct tevent_req *subreq;
     926             : 
     927        1417 :         req = tevent_req_create(mem_ctx, &state,
     928             :                                 struct dcerpc_drsuapi_DsReplicaUpdateRefs_r_state);
     929        1417 :         if (req == NULL) {
     930           0 :                 return NULL;
     931             :         }
     932             : 
     933        1417 :         state->out_mem_ctx = NULL;
     934             : 
     935        1417 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     936             :                         NULL, &ndr_table_drsuapi,
     937             :                         NDR_DRSUAPI_DSREPLICAUPDATEREFS, state, r);
     938        1417 :         if (tevent_req_nomem(subreq, req)) {
     939           0 :                 return tevent_req_post(req, ev);
     940             :         }
     941        1417 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaUpdateRefs_r_done, req);
     942             : 
     943        1417 :         return req;
     944             : }
     945             : 
     946        1417 : static void dcerpc_drsuapi_DsReplicaUpdateRefs_r_done(struct tevent_req *subreq)
     947             : {
     948           0 :         struct tevent_req *req =
     949        1417 :                 tevent_req_callback_data(subreq,
     950             :                 struct tevent_req);
     951           0 :         NTSTATUS status;
     952             : 
     953        1417 :         status = dcerpc_binding_handle_call_recv(subreq);
     954        1417 :         TALLOC_FREE(subreq);
     955        1417 :         if (tevent_req_nterror(req, status)) {
     956           0 :                 return;
     957             :         }
     958             : 
     959        1417 :         tevent_req_done(req);
     960             : }
     961             : 
     962        1417 : NTSTATUS dcerpc_drsuapi_DsReplicaUpdateRefs_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     963             : {
     964           0 :         struct dcerpc_drsuapi_DsReplicaUpdateRefs_r_state *state =
     965        1417 :                 tevent_req_data(req,
     966             :                 struct dcerpc_drsuapi_DsReplicaUpdateRefs_r_state);
     967           0 :         NTSTATUS status;
     968             : 
     969        1417 :         if (tevent_req_is_nterror(req, &status)) {
     970           0 :                 tevent_req_received(req);
     971           0 :                 return status;
     972             :         }
     973             : 
     974        1417 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     975             : 
     976        1417 :         tevent_req_received(req);
     977        1417 :         return NT_STATUS_OK;
     978             : }
     979             : 
     980         202 : NTSTATUS dcerpc_drsuapi_DsReplicaUpdateRefs_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsReplicaUpdateRefs *r)
     981             : {
     982           0 :         NTSTATUS status;
     983             : 
     984         202 :         status = dcerpc_binding_handle_call(h,
     985             :                         NULL, &ndr_table_drsuapi,
     986             :                         NDR_DRSUAPI_DSREPLICAUPDATEREFS, mem_ctx, r);
     987             : 
     988         202 :         return status;
     989             : }
     990             : 
     991             : struct dcerpc_drsuapi_DsReplicaUpdateRefs_state {
     992             :         struct drsuapi_DsReplicaUpdateRefs orig;
     993             :         struct drsuapi_DsReplicaUpdateRefs tmp;
     994             :         TALLOC_CTX *out_mem_ctx;
     995             : };
     996             : 
     997             : static void dcerpc_drsuapi_DsReplicaUpdateRefs_done(struct tevent_req *subreq);
     998             : 
     999           0 : struct tevent_req *dcerpc_drsuapi_DsReplicaUpdateRefs_send(TALLOC_CTX *mem_ctx,
    1000             :                                                            struct tevent_context *ev,
    1001             :                                                            struct dcerpc_binding_handle *h,
    1002             :                                                            struct policy_handle *_bind_handle /* [in] [ref] */,
    1003             :                                                            uint32_t _level /* [in]  */,
    1004             :                                                            union drsuapi_DsReplicaUpdateRefsRequest _req /* [in] [switch_is(level)] */)
    1005             : {
    1006           0 :         struct tevent_req *req;
    1007           0 :         struct dcerpc_drsuapi_DsReplicaUpdateRefs_state *state;
    1008           0 :         struct tevent_req *subreq;
    1009             : 
    1010           0 :         req = tevent_req_create(mem_ctx, &state,
    1011             :                                 struct dcerpc_drsuapi_DsReplicaUpdateRefs_state);
    1012           0 :         if (req == NULL) {
    1013           0 :                 return NULL;
    1014             :         }
    1015           0 :         state->out_mem_ctx = NULL;
    1016             : 
    1017             :         /* In parameters */
    1018           0 :         state->orig.in.bind_handle = _bind_handle;
    1019           0 :         state->orig.in.level = _level;
    1020           0 :         state->orig.in.req = _req;
    1021             : 
    1022             :         /* Out parameters */
    1023             : 
    1024             :         /* Result */
    1025           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1026             : 
    1027             :         /* make a temporary copy, that we pass to the dispatch function */
    1028           0 :         state->tmp = state->orig;
    1029             : 
    1030           0 :         subreq = dcerpc_drsuapi_DsReplicaUpdateRefs_r_send(state, ev, h, &state->tmp);
    1031           0 :         if (tevent_req_nomem(subreq, req)) {
    1032           0 :                 return tevent_req_post(req, ev);
    1033             :         }
    1034           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaUpdateRefs_done, req);
    1035           0 :         return req;
    1036             : }
    1037             : 
    1038           0 : static void dcerpc_drsuapi_DsReplicaUpdateRefs_done(struct tevent_req *subreq)
    1039             : {
    1040           0 :         struct tevent_req *req = tevent_req_callback_data(
    1041             :                 subreq, struct tevent_req);
    1042           0 :         struct dcerpc_drsuapi_DsReplicaUpdateRefs_state *state = tevent_req_data(
    1043             :                 req, struct dcerpc_drsuapi_DsReplicaUpdateRefs_state);
    1044           0 :         NTSTATUS status;
    1045           0 :         TALLOC_CTX *mem_ctx;
    1046             : 
    1047           0 :         if (state->out_mem_ctx) {
    1048           0 :                 mem_ctx = state->out_mem_ctx;
    1049             :         } else {
    1050           0 :                 mem_ctx = state;
    1051             :         }
    1052             : 
    1053           0 :         status = dcerpc_drsuapi_DsReplicaUpdateRefs_r_recv(subreq, mem_ctx);
    1054           0 :         TALLOC_FREE(subreq);
    1055           0 :         if (tevent_req_nterror(req, status)) {
    1056           0 :                 return;
    1057             :         }
    1058             : 
    1059             :         /* Copy out parameters */
    1060             : 
    1061             :         /* Copy result */
    1062           0 :         state->orig.out.result = state->tmp.out.result;
    1063             : 
    1064             :         /* Reset temporary structure */
    1065           0 :         NDR_ZERO_STRUCT(state->tmp);
    1066             : 
    1067           0 :         tevent_req_done(req);
    1068             : }
    1069             : 
    1070           0 : NTSTATUS dcerpc_drsuapi_DsReplicaUpdateRefs_recv(struct tevent_req *req,
    1071             :                                                  TALLOC_CTX *mem_ctx,
    1072             :                                                  WERROR *result)
    1073             : {
    1074           0 :         struct dcerpc_drsuapi_DsReplicaUpdateRefs_state *state = tevent_req_data(
    1075             :                 req, struct dcerpc_drsuapi_DsReplicaUpdateRefs_state);
    1076           0 :         NTSTATUS status;
    1077             : 
    1078           0 :         if (tevent_req_is_nterror(req, &status)) {
    1079           0 :                 tevent_req_received(req);
    1080           0 :                 return status;
    1081             :         }
    1082             : 
    1083             :         /* Steal possible out parameters to the callers context */
    1084           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1085             : 
    1086             :         /* Return result */
    1087           0 :         *result = state->orig.out.result;
    1088             : 
    1089           0 :         tevent_req_received(req);
    1090           0 :         return NT_STATUS_OK;
    1091             : }
    1092             : 
    1093           0 : NTSTATUS dcerpc_drsuapi_DsReplicaUpdateRefs(struct dcerpc_binding_handle *h,
    1094             :                                             TALLOC_CTX *mem_ctx,
    1095             :                                             struct policy_handle *_bind_handle /* [in] [ref] */,
    1096             :                                             uint32_t _level /* [in]  */,
    1097             :                                             union drsuapi_DsReplicaUpdateRefsRequest _req /* [in] [switch_is(level)] */,
    1098             :                                             WERROR *result)
    1099             : {
    1100           0 :         struct drsuapi_DsReplicaUpdateRefs r;
    1101           0 :         NTSTATUS status;
    1102             : 
    1103             :         /* In parameters */
    1104           0 :         r.in.bind_handle = _bind_handle;
    1105           0 :         r.in.level = _level;
    1106           0 :         r.in.req = _req;
    1107             : 
    1108             :         /* Out parameters */
    1109             : 
    1110             :         /* Result */
    1111           0 :         NDR_ZERO_STRUCT(r.out.result);
    1112             : 
    1113           0 :         status = dcerpc_drsuapi_DsReplicaUpdateRefs_r(h, mem_ctx, &r);
    1114           0 :         if (!NT_STATUS_IS_OK(status)) {
    1115           0 :                 return status;
    1116             :         }
    1117             : 
    1118             :         /* Return variables */
    1119             : 
    1120             :         /* Return result */
    1121           0 :         *result = r.out.result;
    1122             : 
    1123           0 :         return NT_STATUS_OK;
    1124             : }
    1125             : 
    1126             : struct dcerpc_drsuapi_DsReplicaAdd_r_state {
    1127             :         TALLOC_CTX *out_mem_ctx;
    1128             : };
    1129             : 
    1130             : static void dcerpc_drsuapi_DsReplicaAdd_r_done(struct tevent_req *subreq);
    1131             : 
    1132           0 : struct tevent_req *dcerpc_drsuapi_DsReplicaAdd_r_send(TALLOC_CTX *mem_ctx,
    1133             :         struct tevent_context *ev,
    1134             :         struct dcerpc_binding_handle *h,
    1135             :         struct drsuapi_DsReplicaAdd *r)
    1136             : {
    1137           0 :         struct tevent_req *req;
    1138           0 :         struct dcerpc_drsuapi_DsReplicaAdd_r_state *state;
    1139           0 :         struct tevent_req *subreq;
    1140             : 
    1141           0 :         req = tevent_req_create(mem_ctx, &state,
    1142             :                                 struct dcerpc_drsuapi_DsReplicaAdd_r_state);
    1143           0 :         if (req == NULL) {
    1144           0 :                 return NULL;
    1145             :         }
    1146             : 
    1147           0 :         state->out_mem_ctx = NULL;
    1148             : 
    1149           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1150             :                         NULL, &ndr_table_drsuapi,
    1151             :                         NDR_DRSUAPI_DSREPLICAADD, state, r);
    1152           0 :         if (tevent_req_nomem(subreq, req)) {
    1153           0 :                 return tevent_req_post(req, ev);
    1154             :         }
    1155           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaAdd_r_done, req);
    1156             : 
    1157           0 :         return req;
    1158             : }
    1159             : 
    1160           0 : static void dcerpc_drsuapi_DsReplicaAdd_r_done(struct tevent_req *subreq)
    1161             : {
    1162           0 :         struct tevent_req *req =
    1163           0 :                 tevent_req_callback_data(subreq,
    1164             :                 struct tevent_req);
    1165           0 :         NTSTATUS status;
    1166             : 
    1167           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1168           0 :         TALLOC_FREE(subreq);
    1169           0 :         if (tevent_req_nterror(req, status)) {
    1170           0 :                 return;
    1171             :         }
    1172             : 
    1173           0 :         tevent_req_done(req);
    1174             : }
    1175             : 
    1176           0 : NTSTATUS dcerpc_drsuapi_DsReplicaAdd_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1177             : {
    1178           0 :         struct dcerpc_drsuapi_DsReplicaAdd_r_state *state =
    1179           0 :                 tevent_req_data(req,
    1180             :                 struct dcerpc_drsuapi_DsReplicaAdd_r_state);
    1181           0 :         NTSTATUS status;
    1182             : 
    1183           0 :         if (tevent_req_is_nterror(req, &status)) {
    1184           0 :                 tevent_req_received(req);
    1185           0 :                 return status;
    1186             :         }
    1187             : 
    1188           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1189             : 
    1190           0 :         tevent_req_received(req);
    1191           0 :         return NT_STATUS_OK;
    1192             : }
    1193             : 
    1194           0 : NTSTATUS dcerpc_drsuapi_DsReplicaAdd_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsReplicaAdd *r)
    1195             : {
    1196           0 :         NTSTATUS status;
    1197             : 
    1198           0 :         status = dcerpc_binding_handle_call(h,
    1199             :                         NULL, &ndr_table_drsuapi,
    1200             :                         NDR_DRSUAPI_DSREPLICAADD, mem_ctx, r);
    1201             : 
    1202           0 :         return status;
    1203             : }
    1204             : 
    1205             : struct dcerpc_drsuapi_DsReplicaAdd_state {
    1206             :         struct drsuapi_DsReplicaAdd orig;
    1207             :         struct drsuapi_DsReplicaAdd tmp;
    1208             :         TALLOC_CTX *out_mem_ctx;
    1209             : };
    1210             : 
    1211             : static void dcerpc_drsuapi_DsReplicaAdd_done(struct tevent_req *subreq);
    1212             : 
    1213           0 : struct tevent_req *dcerpc_drsuapi_DsReplicaAdd_send(TALLOC_CTX *mem_ctx,
    1214             :                                                     struct tevent_context *ev,
    1215             :                                                     struct dcerpc_binding_handle *h,
    1216             :                                                     struct policy_handle *_bind_handle /* [in] [ref] */,
    1217             :                                                     uint32_t _level /* [in]  */,
    1218             :                                                     union drsuapi_DsReplicaAddRequest _req /* [in] [switch_is(level)] */)
    1219             : {
    1220           0 :         struct tevent_req *req;
    1221           0 :         struct dcerpc_drsuapi_DsReplicaAdd_state *state;
    1222           0 :         struct tevent_req *subreq;
    1223             : 
    1224           0 :         req = tevent_req_create(mem_ctx, &state,
    1225             :                                 struct dcerpc_drsuapi_DsReplicaAdd_state);
    1226           0 :         if (req == NULL) {
    1227           0 :                 return NULL;
    1228             :         }
    1229           0 :         state->out_mem_ctx = NULL;
    1230             : 
    1231             :         /* In parameters */
    1232           0 :         state->orig.in.bind_handle = _bind_handle;
    1233           0 :         state->orig.in.level = _level;
    1234           0 :         state->orig.in.req = _req;
    1235             : 
    1236             :         /* Out parameters */
    1237             : 
    1238             :         /* Result */
    1239           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1240             : 
    1241             :         /* make a temporary copy, that we pass to the dispatch function */
    1242           0 :         state->tmp = state->orig;
    1243             : 
    1244           0 :         subreq = dcerpc_drsuapi_DsReplicaAdd_r_send(state, ev, h, &state->tmp);
    1245           0 :         if (tevent_req_nomem(subreq, req)) {
    1246           0 :                 return tevent_req_post(req, ev);
    1247             :         }
    1248           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaAdd_done, req);
    1249           0 :         return req;
    1250             : }
    1251             : 
    1252           0 : static void dcerpc_drsuapi_DsReplicaAdd_done(struct tevent_req *subreq)
    1253             : {
    1254           0 :         struct tevent_req *req = tevent_req_callback_data(
    1255             :                 subreq, struct tevent_req);
    1256           0 :         struct dcerpc_drsuapi_DsReplicaAdd_state *state = tevent_req_data(
    1257             :                 req, struct dcerpc_drsuapi_DsReplicaAdd_state);
    1258           0 :         NTSTATUS status;
    1259           0 :         TALLOC_CTX *mem_ctx;
    1260             : 
    1261           0 :         if (state->out_mem_ctx) {
    1262           0 :                 mem_ctx = state->out_mem_ctx;
    1263             :         } else {
    1264           0 :                 mem_ctx = state;
    1265             :         }
    1266             : 
    1267           0 :         status = dcerpc_drsuapi_DsReplicaAdd_r_recv(subreq, mem_ctx);
    1268           0 :         TALLOC_FREE(subreq);
    1269           0 :         if (tevent_req_nterror(req, status)) {
    1270           0 :                 return;
    1271             :         }
    1272             : 
    1273             :         /* Copy out parameters */
    1274             : 
    1275             :         /* Copy result */
    1276           0 :         state->orig.out.result = state->tmp.out.result;
    1277             : 
    1278             :         /* Reset temporary structure */
    1279           0 :         NDR_ZERO_STRUCT(state->tmp);
    1280             : 
    1281           0 :         tevent_req_done(req);
    1282             : }
    1283             : 
    1284           0 : NTSTATUS dcerpc_drsuapi_DsReplicaAdd_recv(struct tevent_req *req,
    1285             :                                           TALLOC_CTX *mem_ctx,
    1286             :                                           WERROR *result)
    1287             : {
    1288           0 :         struct dcerpc_drsuapi_DsReplicaAdd_state *state = tevent_req_data(
    1289             :                 req, struct dcerpc_drsuapi_DsReplicaAdd_state);
    1290           0 :         NTSTATUS status;
    1291             : 
    1292           0 :         if (tevent_req_is_nterror(req, &status)) {
    1293           0 :                 tevent_req_received(req);
    1294           0 :                 return status;
    1295             :         }
    1296             : 
    1297             :         /* Steal possible out parameters to the callers context */
    1298           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1299             : 
    1300             :         /* Return result */
    1301           0 :         *result = state->orig.out.result;
    1302             : 
    1303           0 :         tevent_req_received(req);
    1304           0 :         return NT_STATUS_OK;
    1305             : }
    1306             : 
    1307           0 : NTSTATUS dcerpc_drsuapi_DsReplicaAdd(struct dcerpc_binding_handle *h,
    1308             :                                      TALLOC_CTX *mem_ctx,
    1309             :                                      struct policy_handle *_bind_handle /* [in] [ref] */,
    1310             :                                      uint32_t _level /* [in]  */,
    1311             :                                      union drsuapi_DsReplicaAddRequest _req /* [in] [switch_is(level)] */,
    1312             :                                      WERROR *result)
    1313             : {
    1314           0 :         struct drsuapi_DsReplicaAdd r;
    1315           0 :         NTSTATUS status;
    1316             : 
    1317             :         /* In parameters */
    1318           0 :         r.in.bind_handle = _bind_handle;
    1319           0 :         r.in.level = _level;
    1320           0 :         r.in.req = _req;
    1321             : 
    1322             :         /* Out parameters */
    1323             : 
    1324             :         /* Result */
    1325           0 :         NDR_ZERO_STRUCT(r.out.result);
    1326             : 
    1327           0 :         status = dcerpc_drsuapi_DsReplicaAdd_r(h, mem_ctx, &r);
    1328           0 :         if (!NT_STATUS_IS_OK(status)) {
    1329           0 :                 return status;
    1330             :         }
    1331             : 
    1332             :         /* Return variables */
    1333             : 
    1334             :         /* Return result */
    1335           0 :         *result = r.out.result;
    1336             : 
    1337           0 :         return NT_STATUS_OK;
    1338             : }
    1339             : 
    1340             : struct dcerpc_drsuapi_DsReplicaDel_r_state {
    1341             :         TALLOC_CTX *out_mem_ctx;
    1342             : };
    1343             : 
    1344             : static void dcerpc_drsuapi_DsReplicaDel_r_done(struct tevent_req *subreq);
    1345             : 
    1346           0 : struct tevent_req *dcerpc_drsuapi_DsReplicaDel_r_send(TALLOC_CTX *mem_ctx,
    1347             :         struct tevent_context *ev,
    1348             :         struct dcerpc_binding_handle *h,
    1349             :         struct drsuapi_DsReplicaDel *r)
    1350             : {
    1351           0 :         struct tevent_req *req;
    1352           0 :         struct dcerpc_drsuapi_DsReplicaDel_r_state *state;
    1353           0 :         struct tevent_req *subreq;
    1354             : 
    1355           0 :         req = tevent_req_create(mem_ctx, &state,
    1356             :                                 struct dcerpc_drsuapi_DsReplicaDel_r_state);
    1357           0 :         if (req == NULL) {
    1358           0 :                 return NULL;
    1359             :         }
    1360             : 
    1361           0 :         state->out_mem_ctx = NULL;
    1362             : 
    1363           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1364             :                         NULL, &ndr_table_drsuapi,
    1365             :                         NDR_DRSUAPI_DSREPLICADEL, state, r);
    1366           0 :         if (tevent_req_nomem(subreq, req)) {
    1367           0 :                 return tevent_req_post(req, ev);
    1368             :         }
    1369           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaDel_r_done, req);
    1370             : 
    1371           0 :         return req;
    1372             : }
    1373             : 
    1374           0 : static void dcerpc_drsuapi_DsReplicaDel_r_done(struct tevent_req *subreq)
    1375             : {
    1376           0 :         struct tevent_req *req =
    1377           0 :                 tevent_req_callback_data(subreq,
    1378             :                 struct tevent_req);
    1379           0 :         NTSTATUS status;
    1380             : 
    1381           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1382           0 :         TALLOC_FREE(subreq);
    1383           0 :         if (tevent_req_nterror(req, status)) {
    1384           0 :                 return;
    1385             :         }
    1386             : 
    1387           0 :         tevent_req_done(req);
    1388             : }
    1389             : 
    1390           0 : NTSTATUS dcerpc_drsuapi_DsReplicaDel_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1391             : {
    1392           0 :         struct dcerpc_drsuapi_DsReplicaDel_r_state *state =
    1393           0 :                 tevent_req_data(req,
    1394             :                 struct dcerpc_drsuapi_DsReplicaDel_r_state);
    1395           0 :         NTSTATUS status;
    1396             : 
    1397           0 :         if (tevent_req_is_nterror(req, &status)) {
    1398           0 :                 tevent_req_received(req);
    1399           0 :                 return status;
    1400             :         }
    1401             : 
    1402           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1403             : 
    1404           0 :         tevent_req_received(req);
    1405           0 :         return NT_STATUS_OK;
    1406             : }
    1407             : 
    1408           0 : NTSTATUS dcerpc_drsuapi_DsReplicaDel_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsReplicaDel *r)
    1409             : {
    1410           0 :         NTSTATUS status;
    1411             : 
    1412           0 :         status = dcerpc_binding_handle_call(h,
    1413             :                         NULL, &ndr_table_drsuapi,
    1414             :                         NDR_DRSUAPI_DSREPLICADEL, mem_ctx, r);
    1415             : 
    1416           0 :         return status;
    1417             : }
    1418             : 
    1419             : struct dcerpc_drsuapi_DsReplicaDel_state {
    1420             :         struct drsuapi_DsReplicaDel orig;
    1421             :         struct drsuapi_DsReplicaDel tmp;
    1422             :         TALLOC_CTX *out_mem_ctx;
    1423             : };
    1424             : 
    1425             : static void dcerpc_drsuapi_DsReplicaDel_done(struct tevent_req *subreq);
    1426             : 
    1427           0 : struct tevent_req *dcerpc_drsuapi_DsReplicaDel_send(TALLOC_CTX *mem_ctx,
    1428             :                                                     struct tevent_context *ev,
    1429             :                                                     struct dcerpc_binding_handle *h,
    1430             :                                                     struct policy_handle *_bind_handle /* [in] [ref] */,
    1431             :                                                     uint32_t _level /* [in]  */,
    1432             :                                                     union drsuapi_DsReplicaDelRequest _req /* [in] [switch_is(level)] */)
    1433             : {
    1434           0 :         struct tevent_req *req;
    1435           0 :         struct dcerpc_drsuapi_DsReplicaDel_state *state;
    1436           0 :         struct tevent_req *subreq;
    1437             : 
    1438           0 :         req = tevent_req_create(mem_ctx, &state,
    1439             :                                 struct dcerpc_drsuapi_DsReplicaDel_state);
    1440           0 :         if (req == NULL) {
    1441           0 :                 return NULL;
    1442             :         }
    1443           0 :         state->out_mem_ctx = NULL;
    1444             : 
    1445             :         /* In parameters */
    1446           0 :         state->orig.in.bind_handle = _bind_handle;
    1447           0 :         state->orig.in.level = _level;
    1448           0 :         state->orig.in.req = _req;
    1449             : 
    1450             :         /* Out parameters */
    1451             : 
    1452             :         /* Result */
    1453           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1454             : 
    1455             :         /* make a temporary copy, that we pass to the dispatch function */
    1456           0 :         state->tmp = state->orig;
    1457             : 
    1458           0 :         subreq = dcerpc_drsuapi_DsReplicaDel_r_send(state, ev, h, &state->tmp);
    1459           0 :         if (tevent_req_nomem(subreq, req)) {
    1460           0 :                 return tevent_req_post(req, ev);
    1461             :         }
    1462           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaDel_done, req);
    1463           0 :         return req;
    1464             : }
    1465             : 
    1466           0 : static void dcerpc_drsuapi_DsReplicaDel_done(struct tevent_req *subreq)
    1467             : {
    1468           0 :         struct tevent_req *req = tevent_req_callback_data(
    1469             :                 subreq, struct tevent_req);
    1470           0 :         struct dcerpc_drsuapi_DsReplicaDel_state *state = tevent_req_data(
    1471             :                 req, struct dcerpc_drsuapi_DsReplicaDel_state);
    1472           0 :         NTSTATUS status;
    1473           0 :         TALLOC_CTX *mem_ctx;
    1474             : 
    1475           0 :         if (state->out_mem_ctx) {
    1476           0 :                 mem_ctx = state->out_mem_ctx;
    1477             :         } else {
    1478           0 :                 mem_ctx = state;
    1479             :         }
    1480             : 
    1481           0 :         status = dcerpc_drsuapi_DsReplicaDel_r_recv(subreq, mem_ctx);
    1482           0 :         TALLOC_FREE(subreq);
    1483           0 :         if (tevent_req_nterror(req, status)) {
    1484           0 :                 return;
    1485             :         }
    1486             : 
    1487             :         /* Copy out parameters */
    1488             : 
    1489             :         /* Copy result */
    1490           0 :         state->orig.out.result = state->tmp.out.result;
    1491             : 
    1492             :         /* Reset temporary structure */
    1493           0 :         NDR_ZERO_STRUCT(state->tmp);
    1494             : 
    1495           0 :         tevent_req_done(req);
    1496             : }
    1497             : 
    1498           0 : NTSTATUS dcerpc_drsuapi_DsReplicaDel_recv(struct tevent_req *req,
    1499             :                                           TALLOC_CTX *mem_ctx,
    1500             :                                           WERROR *result)
    1501             : {
    1502           0 :         struct dcerpc_drsuapi_DsReplicaDel_state *state = tevent_req_data(
    1503             :                 req, struct dcerpc_drsuapi_DsReplicaDel_state);
    1504           0 :         NTSTATUS status;
    1505             : 
    1506           0 :         if (tevent_req_is_nterror(req, &status)) {
    1507           0 :                 tevent_req_received(req);
    1508           0 :                 return status;
    1509             :         }
    1510             : 
    1511             :         /* Steal possible out parameters to the callers context */
    1512           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1513             : 
    1514             :         /* Return result */
    1515           0 :         *result = state->orig.out.result;
    1516             : 
    1517           0 :         tevent_req_received(req);
    1518           0 :         return NT_STATUS_OK;
    1519             : }
    1520             : 
    1521           0 : NTSTATUS dcerpc_drsuapi_DsReplicaDel(struct dcerpc_binding_handle *h,
    1522             :                                      TALLOC_CTX *mem_ctx,
    1523             :                                      struct policy_handle *_bind_handle /* [in] [ref] */,
    1524             :                                      uint32_t _level /* [in]  */,
    1525             :                                      union drsuapi_DsReplicaDelRequest _req /* [in] [switch_is(level)] */,
    1526             :                                      WERROR *result)
    1527             : {
    1528           0 :         struct drsuapi_DsReplicaDel r;
    1529           0 :         NTSTATUS status;
    1530             : 
    1531             :         /* In parameters */
    1532           0 :         r.in.bind_handle = _bind_handle;
    1533           0 :         r.in.level = _level;
    1534           0 :         r.in.req = _req;
    1535             : 
    1536             :         /* Out parameters */
    1537             : 
    1538             :         /* Result */
    1539           0 :         NDR_ZERO_STRUCT(r.out.result);
    1540             : 
    1541           0 :         status = dcerpc_drsuapi_DsReplicaDel_r(h, mem_ctx, &r);
    1542           0 :         if (!NT_STATUS_IS_OK(status)) {
    1543           0 :                 return status;
    1544             :         }
    1545             : 
    1546             :         /* Return variables */
    1547             : 
    1548             :         /* Return result */
    1549           0 :         *result = r.out.result;
    1550             : 
    1551           0 :         return NT_STATUS_OK;
    1552             : }
    1553             : 
    1554             : struct dcerpc_drsuapi_DsReplicaMod_r_state {
    1555             :         TALLOC_CTX *out_mem_ctx;
    1556             : };
    1557             : 
    1558             : static void dcerpc_drsuapi_DsReplicaMod_r_done(struct tevent_req *subreq);
    1559             : 
    1560           0 : struct tevent_req *dcerpc_drsuapi_DsReplicaMod_r_send(TALLOC_CTX *mem_ctx,
    1561             :         struct tevent_context *ev,
    1562             :         struct dcerpc_binding_handle *h,
    1563             :         struct drsuapi_DsReplicaMod *r)
    1564             : {
    1565           0 :         struct tevent_req *req;
    1566           0 :         struct dcerpc_drsuapi_DsReplicaMod_r_state *state;
    1567           0 :         struct tevent_req *subreq;
    1568             : 
    1569           0 :         req = tevent_req_create(mem_ctx, &state,
    1570             :                                 struct dcerpc_drsuapi_DsReplicaMod_r_state);
    1571           0 :         if (req == NULL) {
    1572           0 :                 return NULL;
    1573             :         }
    1574             : 
    1575           0 :         state->out_mem_ctx = NULL;
    1576             : 
    1577           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1578             :                         NULL, &ndr_table_drsuapi,
    1579             :                         NDR_DRSUAPI_DSREPLICAMOD, state, r);
    1580           0 :         if (tevent_req_nomem(subreq, req)) {
    1581           0 :                 return tevent_req_post(req, ev);
    1582             :         }
    1583           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaMod_r_done, req);
    1584             : 
    1585           0 :         return req;
    1586             : }
    1587             : 
    1588           0 : static void dcerpc_drsuapi_DsReplicaMod_r_done(struct tevent_req *subreq)
    1589             : {
    1590           0 :         struct tevent_req *req =
    1591           0 :                 tevent_req_callback_data(subreq,
    1592             :                 struct tevent_req);
    1593           0 :         NTSTATUS status;
    1594             : 
    1595           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1596           0 :         TALLOC_FREE(subreq);
    1597           0 :         if (tevent_req_nterror(req, status)) {
    1598           0 :                 return;
    1599             :         }
    1600             : 
    1601           0 :         tevent_req_done(req);
    1602             : }
    1603             : 
    1604           0 : NTSTATUS dcerpc_drsuapi_DsReplicaMod_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1605             : {
    1606           0 :         struct dcerpc_drsuapi_DsReplicaMod_r_state *state =
    1607           0 :                 tevent_req_data(req,
    1608             :                 struct dcerpc_drsuapi_DsReplicaMod_r_state);
    1609           0 :         NTSTATUS status;
    1610             : 
    1611           0 :         if (tevent_req_is_nterror(req, &status)) {
    1612           0 :                 tevent_req_received(req);
    1613           0 :                 return status;
    1614             :         }
    1615             : 
    1616           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1617             : 
    1618           0 :         tevent_req_received(req);
    1619           0 :         return NT_STATUS_OK;
    1620             : }
    1621             : 
    1622           0 : NTSTATUS dcerpc_drsuapi_DsReplicaMod_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsReplicaMod *r)
    1623             : {
    1624           0 :         NTSTATUS status;
    1625             : 
    1626           0 :         status = dcerpc_binding_handle_call(h,
    1627             :                         NULL, &ndr_table_drsuapi,
    1628             :                         NDR_DRSUAPI_DSREPLICAMOD, mem_ctx, r);
    1629             : 
    1630           0 :         return status;
    1631             : }
    1632             : 
    1633             : struct dcerpc_drsuapi_DsReplicaMod_state {
    1634             :         struct drsuapi_DsReplicaMod orig;
    1635             :         struct drsuapi_DsReplicaMod tmp;
    1636             :         TALLOC_CTX *out_mem_ctx;
    1637             : };
    1638             : 
    1639             : static void dcerpc_drsuapi_DsReplicaMod_done(struct tevent_req *subreq);
    1640             : 
    1641           0 : struct tevent_req *dcerpc_drsuapi_DsReplicaMod_send(TALLOC_CTX *mem_ctx,
    1642             :                                                     struct tevent_context *ev,
    1643             :                                                     struct dcerpc_binding_handle *h,
    1644             :                                                     struct policy_handle *_bind_handle /* [in] [ref] */,
    1645             :                                                     uint32_t _level /* [in]  */,
    1646             :                                                     union drsuapi_DsReplicaModRequest _req /* [in] [switch_is(level)] */)
    1647             : {
    1648           0 :         struct tevent_req *req;
    1649           0 :         struct dcerpc_drsuapi_DsReplicaMod_state *state;
    1650           0 :         struct tevent_req *subreq;
    1651             : 
    1652           0 :         req = tevent_req_create(mem_ctx, &state,
    1653             :                                 struct dcerpc_drsuapi_DsReplicaMod_state);
    1654           0 :         if (req == NULL) {
    1655           0 :                 return NULL;
    1656             :         }
    1657           0 :         state->out_mem_ctx = NULL;
    1658             : 
    1659             :         /* In parameters */
    1660           0 :         state->orig.in.bind_handle = _bind_handle;
    1661           0 :         state->orig.in.level = _level;
    1662           0 :         state->orig.in.req = _req;
    1663             : 
    1664             :         /* Out parameters */
    1665             : 
    1666             :         /* Result */
    1667           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1668             : 
    1669             :         /* make a temporary copy, that we pass to the dispatch function */
    1670           0 :         state->tmp = state->orig;
    1671             : 
    1672           0 :         subreq = dcerpc_drsuapi_DsReplicaMod_r_send(state, ev, h, &state->tmp);
    1673           0 :         if (tevent_req_nomem(subreq, req)) {
    1674           0 :                 return tevent_req_post(req, ev);
    1675             :         }
    1676           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaMod_done, req);
    1677           0 :         return req;
    1678             : }
    1679             : 
    1680           0 : static void dcerpc_drsuapi_DsReplicaMod_done(struct tevent_req *subreq)
    1681             : {
    1682           0 :         struct tevent_req *req = tevent_req_callback_data(
    1683             :                 subreq, struct tevent_req);
    1684           0 :         struct dcerpc_drsuapi_DsReplicaMod_state *state = tevent_req_data(
    1685             :                 req, struct dcerpc_drsuapi_DsReplicaMod_state);
    1686           0 :         NTSTATUS status;
    1687           0 :         TALLOC_CTX *mem_ctx;
    1688             : 
    1689           0 :         if (state->out_mem_ctx) {
    1690           0 :                 mem_ctx = state->out_mem_ctx;
    1691             :         } else {
    1692           0 :                 mem_ctx = state;
    1693             :         }
    1694             : 
    1695           0 :         status = dcerpc_drsuapi_DsReplicaMod_r_recv(subreq, mem_ctx);
    1696           0 :         TALLOC_FREE(subreq);
    1697           0 :         if (tevent_req_nterror(req, status)) {
    1698           0 :                 return;
    1699             :         }
    1700             : 
    1701             :         /* Copy out parameters */
    1702             : 
    1703             :         /* Copy result */
    1704           0 :         state->orig.out.result = state->tmp.out.result;
    1705             : 
    1706             :         /* Reset temporary structure */
    1707           0 :         NDR_ZERO_STRUCT(state->tmp);
    1708             : 
    1709           0 :         tevent_req_done(req);
    1710             : }
    1711             : 
    1712           0 : NTSTATUS dcerpc_drsuapi_DsReplicaMod_recv(struct tevent_req *req,
    1713             :                                           TALLOC_CTX *mem_ctx,
    1714             :                                           WERROR *result)
    1715             : {
    1716           0 :         struct dcerpc_drsuapi_DsReplicaMod_state *state = tevent_req_data(
    1717             :                 req, struct dcerpc_drsuapi_DsReplicaMod_state);
    1718           0 :         NTSTATUS status;
    1719             : 
    1720           0 :         if (tevent_req_is_nterror(req, &status)) {
    1721           0 :                 tevent_req_received(req);
    1722           0 :                 return status;
    1723             :         }
    1724             : 
    1725             :         /* Steal possible out parameters to the callers context */
    1726           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1727             : 
    1728             :         /* Return result */
    1729           0 :         *result = state->orig.out.result;
    1730             : 
    1731           0 :         tevent_req_received(req);
    1732           0 :         return NT_STATUS_OK;
    1733             : }
    1734             : 
    1735           0 : NTSTATUS dcerpc_drsuapi_DsReplicaMod(struct dcerpc_binding_handle *h,
    1736             :                                      TALLOC_CTX *mem_ctx,
    1737             :                                      struct policy_handle *_bind_handle /* [in] [ref] */,
    1738             :                                      uint32_t _level /* [in]  */,
    1739             :                                      union drsuapi_DsReplicaModRequest _req /* [in] [switch_is(level)] */,
    1740             :                                      WERROR *result)
    1741             : {
    1742           0 :         struct drsuapi_DsReplicaMod r;
    1743           0 :         NTSTATUS status;
    1744             : 
    1745             :         /* In parameters */
    1746           0 :         r.in.bind_handle = _bind_handle;
    1747           0 :         r.in.level = _level;
    1748           0 :         r.in.req = _req;
    1749             : 
    1750             :         /* Out parameters */
    1751             : 
    1752             :         /* Result */
    1753           0 :         NDR_ZERO_STRUCT(r.out.result);
    1754             : 
    1755           0 :         status = dcerpc_drsuapi_DsReplicaMod_r(h, mem_ctx, &r);
    1756           0 :         if (!NT_STATUS_IS_OK(status)) {
    1757           0 :                 return status;
    1758             :         }
    1759             : 
    1760             :         /* Return variables */
    1761             : 
    1762             :         /* Return result */
    1763           0 :         *result = r.out.result;
    1764             : 
    1765           0 :         return NT_STATUS_OK;
    1766             : }
    1767             : 
    1768             : struct dcerpc_drsuapi_DsGetMemberships_r_state {
    1769             :         TALLOC_CTX *out_mem_ctx;
    1770             : };
    1771             : 
    1772             : static void dcerpc_drsuapi_DsGetMemberships_r_done(struct tevent_req *subreq);
    1773             : 
    1774           0 : struct tevent_req *dcerpc_drsuapi_DsGetMemberships_r_send(TALLOC_CTX *mem_ctx,
    1775             :         struct tevent_context *ev,
    1776             :         struct dcerpc_binding_handle *h,
    1777             :         struct drsuapi_DsGetMemberships *r)
    1778             : {
    1779           0 :         struct tevent_req *req;
    1780           0 :         struct dcerpc_drsuapi_DsGetMemberships_r_state *state;
    1781           0 :         struct tevent_req *subreq;
    1782             : 
    1783           0 :         req = tevent_req_create(mem_ctx, &state,
    1784             :                                 struct dcerpc_drsuapi_DsGetMemberships_r_state);
    1785           0 :         if (req == NULL) {
    1786           0 :                 return NULL;
    1787             :         }
    1788             : 
    1789           0 :         state->out_mem_ctx = talloc_new(state);
    1790           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1791           0 :                 return tevent_req_post(req, ev);
    1792             :         }
    1793             : 
    1794           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1795             :                         NULL, &ndr_table_drsuapi,
    1796           0 :                         NDR_DRSUAPI_DSGETMEMBERSHIPS, state->out_mem_ctx, r);
    1797           0 :         if (tevent_req_nomem(subreq, req)) {
    1798           0 :                 return tevent_req_post(req, ev);
    1799             :         }
    1800           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsGetMemberships_r_done, req);
    1801             : 
    1802           0 :         return req;
    1803             : }
    1804             : 
    1805           0 : static void dcerpc_drsuapi_DsGetMemberships_r_done(struct tevent_req *subreq)
    1806             : {
    1807           0 :         struct tevent_req *req =
    1808           0 :                 tevent_req_callback_data(subreq,
    1809             :                 struct tevent_req);
    1810           0 :         NTSTATUS status;
    1811             : 
    1812           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1813           0 :         TALLOC_FREE(subreq);
    1814           0 :         if (tevent_req_nterror(req, status)) {
    1815           0 :                 return;
    1816             :         }
    1817             : 
    1818           0 :         tevent_req_done(req);
    1819             : }
    1820             : 
    1821           0 : NTSTATUS dcerpc_drsuapi_DsGetMemberships_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1822             : {
    1823           0 :         struct dcerpc_drsuapi_DsGetMemberships_r_state *state =
    1824           0 :                 tevent_req_data(req,
    1825             :                 struct dcerpc_drsuapi_DsGetMemberships_r_state);
    1826           0 :         NTSTATUS status;
    1827             : 
    1828           0 :         if (tevent_req_is_nterror(req, &status)) {
    1829           0 :                 tevent_req_received(req);
    1830           0 :                 return status;
    1831             :         }
    1832             : 
    1833           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1834             : 
    1835           0 :         tevent_req_received(req);
    1836           0 :         return NT_STATUS_OK;
    1837             : }
    1838             : 
    1839           0 : NTSTATUS dcerpc_drsuapi_DsGetMemberships_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsGetMemberships *r)
    1840             : {
    1841           0 :         NTSTATUS status;
    1842             : 
    1843           0 :         status = dcerpc_binding_handle_call(h,
    1844             :                         NULL, &ndr_table_drsuapi,
    1845             :                         NDR_DRSUAPI_DSGETMEMBERSHIPS, mem_ctx, r);
    1846             : 
    1847           0 :         return status;
    1848             : }
    1849             : 
    1850             : struct dcerpc_drsuapi_DsGetMemberships_state {
    1851             :         struct drsuapi_DsGetMemberships orig;
    1852             :         struct drsuapi_DsGetMemberships tmp;
    1853             :         TALLOC_CTX *out_mem_ctx;
    1854             : };
    1855             : 
    1856             : static void dcerpc_drsuapi_DsGetMemberships_done(struct tevent_req *subreq);
    1857             : 
    1858           0 : struct tevent_req *dcerpc_drsuapi_DsGetMemberships_send(TALLOC_CTX *mem_ctx,
    1859             :                                                         struct tevent_context *ev,
    1860             :                                                         struct dcerpc_binding_handle *h,
    1861             :                                                         struct policy_handle *_bind_handle /* [in] [ref] */,
    1862             :                                                         uint32_t _level /* [in]  */,
    1863             :                                                         union drsuapi_DsGetMembershipsRequest *_req /* [in] [ref,switch_is(level)] */,
    1864             :                                                         uint32_t *_level_out /* [out] [ref] */,
    1865             :                                                         union drsuapi_DsGetMembershipsCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
    1866             : {
    1867           0 :         struct tevent_req *req;
    1868           0 :         struct dcerpc_drsuapi_DsGetMemberships_state *state;
    1869           0 :         struct tevent_req *subreq;
    1870             : 
    1871           0 :         req = tevent_req_create(mem_ctx, &state,
    1872             :                                 struct dcerpc_drsuapi_DsGetMemberships_state);
    1873           0 :         if (req == NULL) {
    1874           0 :                 return NULL;
    1875             :         }
    1876           0 :         state->out_mem_ctx = NULL;
    1877             : 
    1878             :         /* In parameters */
    1879           0 :         state->orig.in.bind_handle = _bind_handle;
    1880           0 :         state->orig.in.level = _level;
    1881           0 :         state->orig.in.req = _req;
    1882             : 
    1883             :         /* Out parameters */
    1884           0 :         state->orig.out.level_out = _level_out;
    1885           0 :         state->orig.out.ctr = _ctr;
    1886             : 
    1887             :         /* Result */
    1888           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1889             : 
    1890           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1891             :                              "dcerpc_drsuapi_DsGetMemberships_out_memory");
    1892           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1893           0 :                 return tevent_req_post(req, ev);
    1894             :         }
    1895             : 
    1896             :         /* make a temporary copy, that we pass to the dispatch function */
    1897           0 :         state->tmp = state->orig;
    1898             : 
    1899           0 :         subreq = dcerpc_drsuapi_DsGetMemberships_r_send(state, ev, h, &state->tmp);
    1900           0 :         if (tevent_req_nomem(subreq, req)) {
    1901           0 :                 return tevent_req_post(req, ev);
    1902             :         }
    1903           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsGetMemberships_done, req);
    1904           0 :         return req;
    1905             : }
    1906             : 
    1907           0 : static void dcerpc_drsuapi_DsGetMemberships_done(struct tevent_req *subreq)
    1908             : {
    1909           0 :         struct tevent_req *req = tevent_req_callback_data(
    1910             :                 subreq, struct tevent_req);
    1911           0 :         struct dcerpc_drsuapi_DsGetMemberships_state *state = tevent_req_data(
    1912             :                 req, struct dcerpc_drsuapi_DsGetMemberships_state);
    1913           0 :         NTSTATUS status;
    1914           0 :         TALLOC_CTX *mem_ctx;
    1915             : 
    1916           0 :         if (state->out_mem_ctx) {
    1917           0 :                 mem_ctx = state->out_mem_ctx;
    1918             :         } else {
    1919           0 :                 mem_ctx = state;
    1920             :         }
    1921             : 
    1922           0 :         status = dcerpc_drsuapi_DsGetMemberships_r_recv(subreq, mem_ctx);
    1923           0 :         TALLOC_FREE(subreq);
    1924           0 :         if (tevent_req_nterror(req, status)) {
    1925           0 :                 return;
    1926             :         }
    1927             : 
    1928             :         /* Copy out parameters */
    1929           0 :         *state->orig.out.level_out = *state->tmp.out.level_out;
    1930           0 :         *state->orig.out.ctr = *state->tmp.out.ctr;
    1931             : 
    1932             :         /* Copy result */
    1933           0 :         state->orig.out.result = state->tmp.out.result;
    1934             : 
    1935             :         /* Reset temporary structure */
    1936           0 :         NDR_ZERO_STRUCT(state->tmp);
    1937             : 
    1938           0 :         tevent_req_done(req);
    1939             : }
    1940             : 
    1941           0 : NTSTATUS dcerpc_drsuapi_DsGetMemberships_recv(struct tevent_req *req,
    1942             :                                               TALLOC_CTX *mem_ctx,
    1943             :                                               WERROR *result)
    1944             : {
    1945           0 :         struct dcerpc_drsuapi_DsGetMemberships_state *state = tevent_req_data(
    1946             :                 req, struct dcerpc_drsuapi_DsGetMemberships_state);
    1947           0 :         NTSTATUS status;
    1948             : 
    1949           0 :         if (tevent_req_is_nterror(req, &status)) {
    1950           0 :                 tevent_req_received(req);
    1951           0 :                 return status;
    1952             :         }
    1953             : 
    1954             :         /* Steal possible out parameters to the callers context */
    1955           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1956             : 
    1957             :         /* Return result */
    1958           0 :         *result = state->orig.out.result;
    1959             : 
    1960           0 :         tevent_req_received(req);
    1961           0 :         return NT_STATUS_OK;
    1962             : }
    1963             : 
    1964           0 : NTSTATUS dcerpc_drsuapi_DsGetMemberships(struct dcerpc_binding_handle *h,
    1965             :                                          TALLOC_CTX *mem_ctx,
    1966             :                                          struct policy_handle *_bind_handle /* [in] [ref] */,
    1967             :                                          uint32_t _level /* [in]  */,
    1968             :                                          union drsuapi_DsGetMembershipsRequest *_req /* [in] [ref,switch_is(level)] */,
    1969             :                                          uint32_t *_level_out /* [out] [ref] */,
    1970             :                                          union drsuapi_DsGetMembershipsCtr *_ctr /* [out] [ref,switch_is(*level_out)] */,
    1971             :                                          WERROR *result)
    1972             : {
    1973           0 :         struct drsuapi_DsGetMemberships r;
    1974           0 :         NTSTATUS status;
    1975             : 
    1976             :         /* In parameters */
    1977           0 :         r.in.bind_handle = _bind_handle;
    1978           0 :         r.in.level = _level;
    1979           0 :         r.in.req = _req;
    1980             : 
    1981             :         /* Out parameters */
    1982           0 :         r.out.level_out = _level_out;
    1983           0 :         r.out.ctr = _ctr;
    1984             : 
    1985             :         /* Result */
    1986           0 :         NDR_ZERO_STRUCT(r.out.result);
    1987             : 
    1988           0 :         status = dcerpc_drsuapi_DsGetMemberships_r(h, mem_ctx, &r);
    1989           0 :         if (!NT_STATUS_IS_OK(status)) {
    1990           0 :                 return status;
    1991             :         }
    1992             : 
    1993             :         /* Return variables */
    1994           0 :         *_level_out = *r.out.level_out;
    1995           0 :         *_ctr = *r.out.ctr;
    1996             : 
    1997             :         /* Return result */
    1998           0 :         *result = r.out.result;
    1999             : 
    2000           0 :         return NT_STATUS_OK;
    2001             : }
    2002             : 
    2003             : struct dcerpc_drsuapi_DsGetNT4ChangeLog_r_state {
    2004             :         TALLOC_CTX *out_mem_ctx;
    2005             : };
    2006             : 
    2007             : static void dcerpc_drsuapi_DsGetNT4ChangeLog_r_done(struct tevent_req *subreq);
    2008             : 
    2009           0 : struct tevent_req *dcerpc_drsuapi_DsGetNT4ChangeLog_r_send(TALLOC_CTX *mem_ctx,
    2010             :         struct tevent_context *ev,
    2011             :         struct dcerpc_binding_handle *h,
    2012             :         struct drsuapi_DsGetNT4ChangeLog *r)
    2013             : {
    2014           0 :         struct tevent_req *req;
    2015           0 :         struct dcerpc_drsuapi_DsGetNT4ChangeLog_r_state *state;
    2016           0 :         struct tevent_req *subreq;
    2017             : 
    2018           0 :         req = tevent_req_create(mem_ctx, &state,
    2019             :                                 struct dcerpc_drsuapi_DsGetNT4ChangeLog_r_state);
    2020           0 :         if (req == NULL) {
    2021           0 :                 return NULL;
    2022             :         }
    2023             : 
    2024           0 :         state->out_mem_ctx = talloc_new(state);
    2025           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2026           0 :                 return tevent_req_post(req, ev);
    2027             :         }
    2028             : 
    2029           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2030             :                         NULL, &ndr_table_drsuapi,
    2031           0 :                         NDR_DRSUAPI_DSGETNT4CHANGELOG, state->out_mem_ctx, r);
    2032           0 :         if (tevent_req_nomem(subreq, req)) {
    2033           0 :                 return tevent_req_post(req, ev);
    2034             :         }
    2035           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsGetNT4ChangeLog_r_done, req);
    2036             : 
    2037           0 :         return req;
    2038             : }
    2039             : 
    2040           0 : static void dcerpc_drsuapi_DsGetNT4ChangeLog_r_done(struct tevent_req *subreq)
    2041             : {
    2042           0 :         struct tevent_req *req =
    2043           0 :                 tevent_req_callback_data(subreq,
    2044             :                 struct tevent_req);
    2045           0 :         NTSTATUS status;
    2046             : 
    2047           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2048           0 :         TALLOC_FREE(subreq);
    2049           0 :         if (tevent_req_nterror(req, status)) {
    2050           0 :                 return;
    2051             :         }
    2052             : 
    2053           0 :         tevent_req_done(req);
    2054             : }
    2055             : 
    2056           0 : NTSTATUS dcerpc_drsuapi_DsGetNT4ChangeLog_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2057             : {
    2058           0 :         struct dcerpc_drsuapi_DsGetNT4ChangeLog_r_state *state =
    2059           0 :                 tevent_req_data(req,
    2060             :                 struct dcerpc_drsuapi_DsGetNT4ChangeLog_r_state);
    2061           0 :         NTSTATUS status;
    2062             : 
    2063           0 :         if (tevent_req_is_nterror(req, &status)) {
    2064           0 :                 tevent_req_received(req);
    2065           0 :                 return status;
    2066             :         }
    2067             : 
    2068           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2069             : 
    2070           0 :         tevent_req_received(req);
    2071           0 :         return NT_STATUS_OK;
    2072             : }
    2073             : 
    2074           3 : NTSTATUS dcerpc_drsuapi_DsGetNT4ChangeLog_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsGetNT4ChangeLog *r)
    2075             : {
    2076           0 :         NTSTATUS status;
    2077             : 
    2078           3 :         status = dcerpc_binding_handle_call(h,
    2079             :                         NULL, &ndr_table_drsuapi,
    2080             :                         NDR_DRSUAPI_DSGETNT4CHANGELOG, mem_ctx, r);
    2081             : 
    2082           3 :         return status;
    2083             : }
    2084             : 
    2085             : struct dcerpc_drsuapi_DsGetNT4ChangeLog_state {
    2086             :         struct drsuapi_DsGetNT4ChangeLog orig;
    2087             :         struct drsuapi_DsGetNT4ChangeLog tmp;
    2088             :         TALLOC_CTX *out_mem_ctx;
    2089             : };
    2090             : 
    2091             : static void dcerpc_drsuapi_DsGetNT4ChangeLog_done(struct tevent_req *subreq);
    2092             : 
    2093           0 : struct tevent_req *dcerpc_drsuapi_DsGetNT4ChangeLog_send(TALLOC_CTX *mem_ctx,
    2094             :                                                          struct tevent_context *ev,
    2095             :                                                          struct dcerpc_binding_handle *h,
    2096             :                                                          struct policy_handle *_bind_handle /* [in] [ref] */,
    2097             :                                                          uint32_t _level /* [in]  */,
    2098             :                                                          union drsuapi_DsGetNT4ChangeLogRequest *_req /* [in] [ref,switch_is(level)] */,
    2099             :                                                          uint32_t *_level_out /* [out] [ref] */,
    2100             :                                                          union drsuapi_DsGetNT4ChangeLogInfo *_info /* [out] [ref,switch_is(*level_out)] */)
    2101             : {
    2102           0 :         struct tevent_req *req;
    2103           0 :         struct dcerpc_drsuapi_DsGetNT4ChangeLog_state *state;
    2104           0 :         struct tevent_req *subreq;
    2105             : 
    2106           0 :         req = tevent_req_create(mem_ctx, &state,
    2107             :                                 struct dcerpc_drsuapi_DsGetNT4ChangeLog_state);
    2108           0 :         if (req == NULL) {
    2109           0 :                 return NULL;
    2110             :         }
    2111           0 :         state->out_mem_ctx = NULL;
    2112             : 
    2113             :         /* In parameters */
    2114           0 :         state->orig.in.bind_handle = _bind_handle;
    2115           0 :         state->orig.in.level = _level;
    2116           0 :         state->orig.in.req = _req;
    2117             : 
    2118             :         /* Out parameters */
    2119           0 :         state->orig.out.level_out = _level_out;
    2120           0 :         state->orig.out.info = _info;
    2121             : 
    2122             :         /* Result */
    2123           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2124             : 
    2125           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2126             :                              "dcerpc_drsuapi_DsGetNT4ChangeLog_out_memory");
    2127           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2128           0 :                 return tevent_req_post(req, ev);
    2129             :         }
    2130             : 
    2131             :         /* make a temporary copy, that we pass to the dispatch function */
    2132           0 :         state->tmp = state->orig;
    2133             : 
    2134           0 :         subreq = dcerpc_drsuapi_DsGetNT4ChangeLog_r_send(state, ev, h, &state->tmp);
    2135           0 :         if (tevent_req_nomem(subreq, req)) {
    2136           0 :                 return tevent_req_post(req, ev);
    2137             :         }
    2138           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsGetNT4ChangeLog_done, req);
    2139           0 :         return req;
    2140             : }
    2141             : 
    2142           0 : static void dcerpc_drsuapi_DsGetNT4ChangeLog_done(struct tevent_req *subreq)
    2143             : {
    2144           0 :         struct tevent_req *req = tevent_req_callback_data(
    2145             :                 subreq, struct tevent_req);
    2146           0 :         struct dcerpc_drsuapi_DsGetNT4ChangeLog_state *state = tevent_req_data(
    2147             :                 req, struct dcerpc_drsuapi_DsGetNT4ChangeLog_state);
    2148           0 :         NTSTATUS status;
    2149           0 :         TALLOC_CTX *mem_ctx;
    2150             : 
    2151           0 :         if (state->out_mem_ctx) {
    2152           0 :                 mem_ctx = state->out_mem_ctx;
    2153             :         } else {
    2154           0 :                 mem_ctx = state;
    2155             :         }
    2156             : 
    2157           0 :         status = dcerpc_drsuapi_DsGetNT4ChangeLog_r_recv(subreq, mem_ctx);
    2158           0 :         TALLOC_FREE(subreq);
    2159           0 :         if (tevent_req_nterror(req, status)) {
    2160           0 :                 return;
    2161             :         }
    2162             : 
    2163             :         /* Copy out parameters */
    2164           0 :         *state->orig.out.level_out = *state->tmp.out.level_out;
    2165           0 :         *state->orig.out.info = *state->tmp.out.info;
    2166             : 
    2167             :         /* Copy result */
    2168           0 :         state->orig.out.result = state->tmp.out.result;
    2169             : 
    2170             :         /* Reset temporary structure */
    2171           0 :         NDR_ZERO_STRUCT(state->tmp);
    2172             : 
    2173           0 :         tevent_req_done(req);
    2174             : }
    2175             : 
    2176           0 : NTSTATUS dcerpc_drsuapi_DsGetNT4ChangeLog_recv(struct tevent_req *req,
    2177             :                                                TALLOC_CTX *mem_ctx,
    2178             :                                                WERROR *result)
    2179             : {
    2180           0 :         struct dcerpc_drsuapi_DsGetNT4ChangeLog_state *state = tevent_req_data(
    2181             :                 req, struct dcerpc_drsuapi_DsGetNT4ChangeLog_state);
    2182           0 :         NTSTATUS status;
    2183             : 
    2184           0 :         if (tevent_req_is_nterror(req, &status)) {
    2185           0 :                 tevent_req_received(req);
    2186           0 :                 return status;
    2187             :         }
    2188             : 
    2189             :         /* Steal possible out parameters to the callers context */
    2190           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2191             : 
    2192             :         /* Return result */
    2193           0 :         *result = state->orig.out.result;
    2194             : 
    2195           0 :         tevent_req_received(req);
    2196           0 :         return NT_STATUS_OK;
    2197             : }
    2198             : 
    2199           0 : NTSTATUS dcerpc_drsuapi_DsGetNT4ChangeLog(struct dcerpc_binding_handle *h,
    2200             :                                           TALLOC_CTX *mem_ctx,
    2201             :                                           struct policy_handle *_bind_handle /* [in] [ref] */,
    2202             :                                           uint32_t _level /* [in]  */,
    2203             :                                           union drsuapi_DsGetNT4ChangeLogRequest *_req /* [in] [ref,switch_is(level)] */,
    2204             :                                           uint32_t *_level_out /* [out] [ref] */,
    2205             :                                           union drsuapi_DsGetNT4ChangeLogInfo *_info /* [out] [ref,switch_is(*level_out)] */,
    2206             :                                           WERROR *result)
    2207             : {
    2208           0 :         struct drsuapi_DsGetNT4ChangeLog r;
    2209           0 :         NTSTATUS status;
    2210             : 
    2211             :         /* In parameters */
    2212           0 :         r.in.bind_handle = _bind_handle;
    2213           0 :         r.in.level = _level;
    2214           0 :         r.in.req = _req;
    2215             : 
    2216             :         /* Out parameters */
    2217           0 :         r.out.level_out = _level_out;
    2218           0 :         r.out.info = _info;
    2219             : 
    2220             :         /* Result */
    2221           0 :         NDR_ZERO_STRUCT(r.out.result);
    2222             : 
    2223           0 :         status = dcerpc_drsuapi_DsGetNT4ChangeLog_r(h, mem_ctx, &r);
    2224           0 :         if (!NT_STATUS_IS_OK(status)) {
    2225           0 :                 return status;
    2226             :         }
    2227             : 
    2228             :         /* Return variables */
    2229           0 :         *_level_out = *r.out.level_out;
    2230           0 :         *_info = *r.out.info;
    2231             : 
    2232             :         /* Return result */
    2233           0 :         *result = r.out.result;
    2234             : 
    2235           0 :         return NT_STATUS_OK;
    2236             : }
    2237             : 
    2238             : struct dcerpc_drsuapi_DsCrackNames_r_state {
    2239             :         TALLOC_CTX *out_mem_ctx;
    2240             : };
    2241             : 
    2242             : static void dcerpc_drsuapi_DsCrackNames_r_done(struct tevent_req *subreq);
    2243             : 
    2244           0 : struct tevent_req *dcerpc_drsuapi_DsCrackNames_r_send(TALLOC_CTX *mem_ctx,
    2245             :         struct tevent_context *ev,
    2246             :         struct dcerpc_binding_handle *h,
    2247             :         struct drsuapi_DsCrackNames *r)
    2248             : {
    2249           0 :         struct tevent_req *req;
    2250           0 :         struct dcerpc_drsuapi_DsCrackNames_r_state *state;
    2251           0 :         struct tevent_req *subreq;
    2252             : 
    2253           0 :         req = tevent_req_create(mem_ctx, &state,
    2254             :                                 struct dcerpc_drsuapi_DsCrackNames_r_state);
    2255           0 :         if (req == NULL) {
    2256           0 :                 return NULL;
    2257             :         }
    2258             : 
    2259           0 :         state->out_mem_ctx = talloc_new(state);
    2260           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2261           0 :                 return tevent_req_post(req, ev);
    2262             :         }
    2263             : 
    2264           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2265             :                         NULL, &ndr_table_drsuapi,
    2266           0 :                         NDR_DRSUAPI_DSCRACKNAMES, state->out_mem_ctx, r);
    2267           0 :         if (tevent_req_nomem(subreq, req)) {
    2268           0 :                 return tevent_req_post(req, ev);
    2269             :         }
    2270           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsCrackNames_r_done, req);
    2271             : 
    2272           0 :         return req;
    2273             : }
    2274             : 
    2275           0 : static void dcerpc_drsuapi_DsCrackNames_r_done(struct tevent_req *subreq)
    2276             : {
    2277           0 :         struct tevent_req *req =
    2278           0 :                 tevent_req_callback_data(subreq,
    2279             :                 struct tevent_req);
    2280           0 :         NTSTATUS status;
    2281             : 
    2282           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2283           0 :         TALLOC_FREE(subreq);
    2284           0 :         if (tevent_req_nterror(req, status)) {
    2285           0 :                 return;
    2286             :         }
    2287             : 
    2288           0 :         tevent_req_done(req);
    2289             : }
    2290             : 
    2291           0 : NTSTATUS dcerpc_drsuapi_DsCrackNames_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2292             : {
    2293           0 :         struct dcerpc_drsuapi_DsCrackNames_r_state *state =
    2294           0 :                 tevent_req_data(req,
    2295             :                 struct dcerpc_drsuapi_DsCrackNames_r_state);
    2296           0 :         NTSTATUS status;
    2297             : 
    2298           0 :         if (tevent_req_is_nterror(req, &status)) {
    2299           0 :                 tevent_req_received(req);
    2300           0 :                 return status;
    2301             :         }
    2302             : 
    2303           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2304             : 
    2305           0 :         tevent_req_received(req);
    2306           0 :         return NT_STATUS_OK;
    2307             : }
    2308             : 
    2309        1395 : NTSTATUS dcerpc_drsuapi_DsCrackNames_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsCrackNames *r)
    2310             : {
    2311         144 :         NTSTATUS status;
    2312             : 
    2313        1395 :         status = dcerpc_binding_handle_call(h,
    2314             :                         NULL, &ndr_table_drsuapi,
    2315             :                         NDR_DRSUAPI_DSCRACKNAMES, mem_ctx, r);
    2316             : 
    2317        1395 :         return status;
    2318             : }
    2319             : 
    2320             : struct dcerpc_drsuapi_DsCrackNames_state {
    2321             :         struct drsuapi_DsCrackNames orig;
    2322             :         struct drsuapi_DsCrackNames tmp;
    2323             :         TALLOC_CTX *out_mem_ctx;
    2324             : };
    2325             : 
    2326             : static void dcerpc_drsuapi_DsCrackNames_done(struct tevent_req *subreq);
    2327             : 
    2328           0 : struct tevent_req *dcerpc_drsuapi_DsCrackNames_send(TALLOC_CTX *mem_ctx,
    2329             :                                                     struct tevent_context *ev,
    2330             :                                                     struct dcerpc_binding_handle *h,
    2331             :                                                     struct policy_handle *_bind_handle /* [in] [ref] */,
    2332             :                                                     uint32_t _level /* [in]  */,
    2333             :                                                     union drsuapi_DsNameRequest *_req /* [in] [ref,switch_is(level)] */,
    2334             :                                                     uint32_t *_level_out /* [out] [ref] */,
    2335             :                                                     union drsuapi_DsNameCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
    2336             : {
    2337           0 :         struct tevent_req *req;
    2338           0 :         struct dcerpc_drsuapi_DsCrackNames_state *state;
    2339           0 :         struct tevent_req *subreq;
    2340             : 
    2341           0 :         req = tevent_req_create(mem_ctx, &state,
    2342             :                                 struct dcerpc_drsuapi_DsCrackNames_state);
    2343           0 :         if (req == NULL) {
    2344           0 :                 return NULL;
    2345             :         }
    2346           0 :         state->out_mem_ctx = NULL;
    2347             : 
    2348             :         /* In parameters */
    2349           0 :         state->orig.in.bind_handle = _bind_handle;
    2350           0 :         state->orig.in.level = _level;
    2351           0 :         state->orig.in.req = _req;
    2352             : 
    2353             :         /* Out parameters */
    2354           0 :         state->orig.out.level_out = _level_out;
    2355           0 :         state->orig.out.ctr = _ctr;
    2356             : 
    2357             :         /* Result */
    2358           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2359             : 
    2360           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2361             :                              "dcerpc_drsuapi_DsCrackNames_out_memory");
    2362           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2363           0 :                 return tevent_req_post(req, ev);
    2364             :         }
    2365             : 
    2366             :         /* make a temporary copy, that we pass to the dispatch function */
    2367           0 :         state->tmp = state->orig;
    2368             : 
    2369           0 :         subreq = dcerpc_drsuapi_DsCrackNames_r_send(state, ev, h, &state->tmp);
    2370           0 :         if (tevent_req_nomem(subreq, req)) {
    2371           0 :                 return tevent_req_post(req, ev);
    2372             :         }
    2373           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsCrackNames_done, req);
    2374           0 :         return req;
    2375             : }
    2376             : 
    2377           0 : static void dcerpc_drsuapi_DsCrackNames_done(struct tevent_req *subreq)
    2378             : {
    2379           0 :         struct tevent_req *req = tevent_req_callback_data(
    2380             :                 subreq, struct tevent_req);
    2381           0 :         struct dcerpc_drsuapi_DsCrackNames_state *state = tevent_req_data(
    2382             :                 req, struct dcerpc_drsuapi_DsCrackNames_state);
    2383           0 :         NTSTATUS status;
    2384           0 :         TALLOC_CTX *mem_ctx;
    2385             : 
    2386           0 :         if (state->out_mem_ctx) {
    2387           0 :                 mem_ctx = state->out_mem_ctx;
    2388             :         } else {
    2389           0 :                 mem_ctx = state;
    2390             :         }
    2391             : 
    2392           0 :         status = dcerpc_drsuapi_DsCrackNames_r_recv(subreq, mem_ctx);
    2393           0 :         TALLOC_FREE(subreq);
    2394           0 :         if (tevent_req_nterror(req, status)) {
    2395           0 :                 return;
    2396             :         }
    2397             : 
    2398             :         /* Copy out parameters */
    2399           0 :         *state->orig.out.level_out = *state->tmp.out.level_out;
    2400           0 :         *state->orig.out.ctr = *state->tmp.out.ctr;
    2401             : 
    2402             :         /* Copy result */
    2403           0 :         state->orig.out.result = state->tmp.out.result;
    2404             : 
    2405             :         /* Reset temporary structure */
    2406           0 :         NDR_ZERO_STRUCT(state->tmp);
    2407             : 
    2408           0 :         tevent_req_done(req);
    2409             : }
    2410             : 
    2411           0 : NTSTATUS dcerpc_drsuapi_DsCrackNames_recv(struct tevent_req *req,
    2412             :                                           TALLOC_CTX *mem_ctx,
    2413             :                                           WERROR *result)
    2414             : {
    2415           0 :         struct dcerpc_drsuapi_DsCrackNames_state *state = tevent_req_data(
    2416             :                 req, struct dcerpc_drsuapi_DsCrackNames_state);
    2417           0 :         NTSTATUS status;
    2418             : 
    2419           0 :         if (tevent_req_is_nterror(req, &status)) {
    2420           0 :                 tevent_req_received(req);
    2421           0 :                 return status;
    2422             :         }
    2423             : 
    2424             :         /* Steal possible out parameters to the callers context */
    2425           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2426             : 
    2427             :         /* Return result */
    2428           0 :         *result = state->orig.out.result;
    2429             : 
    2430           0 :         tevent_req_received(req);
    2431           0 :         return NT_STATUS_OK;
    2432             : }
    2433             : 
    2434           0 : NTSTATUS dcerpc_drsuapi_DsCrackNames(struct dcerpc_binding_handle *h,
    2435             :                                      TALLOC_CTX *mem_ctx,
    2436             :                                      struct policy_handle *_bind_handle /* [in] [ref] */,
    2437             :                                      uint32_t _level /* [in]  */,
    2438             :                                      union drsuapi_DsNameRequest *_req /* [in] [ref,switch_is(level)] */,
    2439             :                                      uint32_t *_level_out /* [out] [ref] */,
    2440             :                                      union drsuapi_DsNameCtr *_ctr /* [out] [ref,switch_is(*level_out)] */,
    2441             :                                      WERROR *result)
    2442             : {
    2443           0 :         struct drsuapi_DsCrackNames r;
    2444           0 :         NTSTATUS status;
    2445             : 
    2446             :         /* In parameters */
    2447           0 :         r.in.bind_handle = _bind_handle;
    2448           0 :         r.in.level = _level;
    2449           0 :         r.in.req = _req;
    2450             : 
    2451             :         /* Out parameters */
    2452           0 :         r.out.level_out = _level_out;
    2453           0 :         r.out.ctr = _ctr;
    2454             : 
    2455             :         /* Result */
    2456           0 :         NDR_ZERO_STRUCT(r.out.result);
    2457             : 
    2458           0 :         status = dcerpc_drsuapi_DsCrackNames_r(h, mem_ctx, &r);
    2459           0 :         if (!NT_STATUS_IS_OK(status)) {
    2460           0 :                 return status;
    2461             :         }
    2462             : 
    2463             :         /* Return variables */
    2464           0 :         *_level_out = *r.out.level_out;
    2465           0 :         *_ctr = *r.out.ctr;
    2466             : 
    2467             :         /* Return result */
    2468           0 :         *result = r.out.result;
    2469             : 
    2470           0 :         return NT_STATUS_OK;
    2471             : }
    2472             : 
    2473             : struct dcerpc_drsuapi_DsWriteAccountSpn_r_state {
    2474             :         TALLOC_CTX *out_mem_ctx;
    2475             : };
    2476             : 
    2477             : static void dcerpc_drsuapi_DsWriteAccountSpn_r_done(struct tevent_req *subreq);
    2478             : 
    2479           0 : struct tevent_req *dcerpc_drsuapi_DsWriteAccountSpn_r_send(TALLOC_CTX *mem_ctx,
    2480             :         struct tevent_context *ev,
    2481             :         struct dcerpc_binding_handle *h,
    2482             :         struct drsuapi_DsWriteAccountSpn *r)
    2483             : {
    2484           0 :         struct tevent_req *req;
    2485           0 :         struct dcerpc_drsuapi_DsWriteAccountSpn_r_state *state;
    2486           0 :         struct tevent_req *subreq;
    2487             : 
    2488           0 :         req = tevent_req_create(mem_ctx, &state,
    2489             :                                 struct dcerpc_drsuapi_DsWriteAccountSpn_r_state);
    2490           0 :         if (req == NULL) {
    2491           0 :                 return NULL;
    2492             :         }
    2493             : 
    2494           0 :         state->out_mem_ctx = talloc_new(state);
    2495           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2496           0 :                 return tevent_req_post(req, ev);
    2497             :         }
    2498             : 
    2499           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2500             :                         NULL, &ndr_table_drsuapi,
    2501           0 :                         NDR_DRSUAPI_DSWRITEACCOUNTSPN, state->out_mem_ctx, r);
    2502           0 :         if (tevent_req_nomem(subreq, req)) {
    2503           0 :                 return tevent_req_post(req, ev);
    2504             :         }
    2505           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsWriteAccountSpn_r_done, req);
    2506             : 
    2507           0 :         return req;
    2508             : }
    2509             : 
    2510           0 : static void dcerpc_drsuapi_DsWriteAccountSpn_r_done(struct tevent_req *subreq)
    2511             : {
    2512           0 :         struct tevent_req *req =
    2513           0 :                 tevent_req_callback_data(subreq,
    2514             :                 struct tevent_req);
    2515           0 :         NTSTATUS status;
    2516             : 
    2517           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2518           0 :         TALLOC_FREE(subreq);
    2519           0 :         if (tevent_req_nterror(req, status)) {
    2520           0 :                 return;
    2521             :         }
    2522             : 
    2523           0 :         tevent_req_done(req);
    2524             : }
    2525             : 
    2526           0 : NTSTATUS dcerpc_drsuapi_DsWriteAccountSpn_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2527             : {
    2528           0 :         struct dcerpc_drsuapi_DsWriteAccountSpn_r_state *state =
    2529           0 :                 tevent_req_data(req,
    2530             :                 struct dcerpc_drsuapi_DsWriteAccountSpn_r_state);
    2531           0 :         NTSTATUS status;
    2532             : 
    2533           0 :         if (tevent_req_is_nterror(req, &status)) {
    2534           0 :                 tevent_req_received(req);
    2535           0 :                 return status;
    2536             :         }
    2537             : 
    2538           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2539             : 
    2540           0 :         tevent_req_received(req);
    2541           0 :         return NT_STATUS_OK;
    2542             : }
    2543             : 
    2544           4 : NTSTATUS dcerpc_drsuapi_DsWriteAccountSpn_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsWriteAccountSpn *r)
    2545             : {
    2546           0 :         NTSTATUS status;
    2547             : 
    2548           4 :         status = dcerpc_binding_handle_call(h,
    2549             :                         NULL, &ndr_table_drsuapi,
    2550             :                         NDR_DRSUAPI_DSWRITEACCOUNTSPN, mem_ctx, r);
    2551             : 
    2552           4 :         return status;
    2553             : }
    2554             : 
    2555             : struct dcerpc_drsuapi_DsWriteAccountSpn_state {
    2556             :         struct drsuapi_DsWriteAccountSpn orig;
    2557             :         struct drsuapi_DsWriteAccountSpn tmp;
    2558             :         TALLOC_CTX *out_mem_ctx;
    2559             : };
    2560             : 
    2561             : static void dcerpc_drsuapi_DsWriteAccountSpn_done(struct tevent_req *subreq);
    2562             : 
    2563           0 : struct tevent_req *dcerpc_drsuapi_DsWriteAccountSpn_send(TALLOC_CTX *mem_ctx,
    2564             :                                                          struct tevent_context *ev,
    2565             :                                                          struct dcerpc_binding_handle *h,
    2566             :                                                          struct policy_handle *_bind_handle /* [in] [ref] */,
    2567             :                                                          uint32_t _level /* [in]  */,
    2568             :                                                          union drsuapi_DsWriteAccountSpnRequest *_req /* [in] [ref,switch_is(level)] */,
    2569             :                                                          uint32_t *_level_out /* [out] [ref] */,
    2570             :                                                          union drsuapi_DsWriteAccountSpnResult *_res /* [out] [ref,switch_is(*level_out)] */)
    2571             : {
    2572           0 :         struct tevent_req *req;
    2573           0 :         struct dcerpc_drsuapi_DsWriteAccountSpn_state *state;
    2574           0 :         struct tevent_req *subreq;
    2575             : 
    2576           0 :         req = tevent_req_create(mem_ctx, &state,
    2577             :                                 struct dcerpc_drsuapi_DsWriteAccountSpn_state);
    2578           0 :         if (req == NULL) {
    2579           0 :                 return NULL;
    2580             :         }
    2581           0 :         state->out_mem_ctx = NULL;
    2582             : 
    2583             :         /* In parameters */
    2584           0 :         state->orig.in.bind_handle = _bind_handle;
    2585           0 :         state->orig.in.level = _level;
    2586           0 :         state->orig.in.req = _req;
    2587             : 
    2588             :         /* Out parameters */
    2589           0 :         state->orig.out.level_out = _level_out;
    2590           0 :         state->orig.out.res = _res;
    2591             : 
    2592             :         /* Result */
    2593           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2594             : 
    2595           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2596             :                              "dcerpc_drsuapi_DsWriteAccountSpn_out_memory");
    2597           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2598           0 :                 return tevent_req_post(req, ev);
    2599             :         }
    2600             : 
    2601             :         /* make a temporary copy, that we pass to the dispatch function */
    2602           0 :         state->tmp = state->orig;
    2603             : 
    2604           0 :         subreq = dcerpc_drsuapi_DsWriteAccountSpn_r_send(state, ev, h, &state->tmp);
    2605           0 :         if (tevent_req_nomem(subreq, req)) {
    2606           0 :                 return tevent_req_post(req, ev);
    2607             :         }
    2608           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsWriteAccountSpn_done, req);
    2609           0 :         return req;
    2610             : }
    2611             : 
    2612           0 : static void dcerpc_drsuapi_DsWriteAccountSpn_done(struct tevent_req *subreq)
    2613             : {
    2614           0 :         struct tevent_req *req = tevent_req_callback_data(
    2615             :                 subreq, struct tevent_req);
    2616           0 :         struct dcerpc_drsuapi_DsWriteAccountSpn_state *state = tevent_req_data(
    2617             :                 req, struct dcerpc_drsuapi_DsWriteAccountSpn_state);
    2618           0 :         NTSTATUS status;
    2619           0 :         TALLOC_CTX *mem_ctx;
    2620             : 
    2621           0 :         if (state->out_mem_ctx) {
    2622           0 :                 mem_ctx = state->out_mem_ctx;
    2623             :         } else {
    2624           0 :                 mem_ctx = state;
    2625             :         }
    2626             : 
    2627           0 :         status = dcerpc_drsuapi_DsWriteAccountSpn_r_recv(subreq, mem_ctx);
    2628           0 :         TALLOC_FREE(subreq);
    2629           0 :         if (tevent_req_nterror(req, status)) {
    2630           0 :                 return;
    2631             :         }
    2632             : 
    2633             :         /* Copy out parameters */
    2634           0 :         *state->orig.out.level_out = *state->tmp.out.level_out;
    2635           0 :         *state->orig.out.res = *state->tmp.out.res;
    2636             : 
    2637             :         /* Copy result */
    2638           0 :         state->orig.out.result = state->tmp.out.result;
    2639             : 
    2640             :         /* Reset temporary structure */
    2641           0 :         NDR_ZERO_STRUCT(state->tmp);
    2642             : 
    2643           0 :         tevent_req_done(req);
    2644             : }
    2645             : 
    2646           0 : NTSTATUS dcerpc_drsuapi_DsWriteAccountSpn_recv(struct tevent_req *req,
    2647             :                                                TALLOC_CTX *mem_ctx,
    2648             :                                                WERROR *result)
    2649             : {
    2650           0 :         struct dcerpc_drsuapi_DsWriteAccountSpn_state *state = tevent_req_data(
    2651             :                 req, struct dcerpc_drsuapi_DsWriteAccountSpn_state);
    2652           0 :         NTSTATUS status;
    2653             : 
    2654           0 :         if (tevent_req_is_nterror(req, &status)) {
    2655           0 :                 tevent_req_received(req);
    2656           0 :                 return status;
    2657             :         }
    2658             : 
    2659             :         /* Steal possible out parameters to the callers context */
    2660           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2661             : 
    2662             :         /* Return result */
    2663           0 :         *result = state->orig.out.result;
    2664             : 
    2665           0 :         tevent_req_received(req);
    2666           0 :         return NT_STATUS_OK;
    2667             : }
    2668             : 
    2669           0 : NTSTATUS dcerpc_drsuapi_DsWriteAccountSpn(struct dcerpc_binding_handle *h,
    2670             :                                           TALLOC_CTX *mem_ctx,
    2671             :                                           struct policy_handle *_bind_handle /* [in] [ref] */,
    2672             :                                           uint32_t _level /* [in]  */,
    2673             :                                           union drsuapi_DsWriteAccountSpnRequest *_req /* [in] [ref,switch_is(level)] */,
    2674             :                                           uint32_t *_level_out /* [out] [ref] */,
    2675             :                                           union drsuapi_DsWriteAccountSpnResult *_res /* [out] [ref,switch_is(*level_out)] */,
    2676             :                                           WERROR *result)
    2677             : {
    2678           0 :         struct drsuapi_DsWriteAccountSpn r;
    2679           0 :         NTSTATUS status;
    2680             : 
    2681             :         /* In parameters */
    2682           0 :         r.in.bind_handle = _bind_handle;
    2683           0 :         r.in.level = _level;
    2684           0 :         r.in.req = _req;
    2685             : 
    2686             :         /* Out parameters */
    2687           0 :         r.out.level_out = _level_out;
    2688           0 :         r.out.res = _res;
    2689             : 
    2690             :         /* Result */
    2691           0 :         NDR_ZERO_STRUCT(r.out.result);
    2692             : 
    2693           0 :         status = dcerpc_drsuapi_DsWriteAccountSpn_r(h, mem_ctx, &r);
    2694           0 :         if (!NT_STATUS_IS_OK(status)) {
    2695           0 :                 return status;
    2696             :         }
    2697             : 
    2698             :         /* Return variables */
    2699           0 :         *_level_out = *r.out.level_out;
    2700           0 :         *_res = *r.out.res;
    2701             : 
    2702             :         /* Return result */
    2703           0 :         *result = r.out.result;
    2704             : 
    2705           0 :         return NT_STATUS_OK;
    2706             : }
    2707             : 
    2708             : struct dcerpc_drsuapi_DsRemoveDSServer_r_state {
    2709             :         TALLOC_CTX *out_mem_ctx;
    2710             : };
    2711             : 
    2712             : static void dcerpc_drsuapi_DsRemoveDSServer_r_done(struct tevent_req *subreq);
    2713             : 
    2714           4 : struct tevent_req *dcerpc_drsuapi_DsRemoveDSServer_r_send(TALLOC_CTX *mem_ctx,
    2715             :         struct tevent_context *ev,
    2716             :         struct dcerpc_binding_handle *h,
    2717             :         struct drsuapi_DsRemoveDSServer *r)
    2718             : {
    2719           0 :         struct tevent_req *req;
    2720           0 :         struct dcerpc_drsuapi_DsRemoveDSServer_r_state *state;
    2721           0 :         struct tevent_req *subreq;
    2722             : 
    2723           4 :         req = tevent_req_create(mem_ctx, &state,
    2724             :                                 struct dcerpc_drsuapi_DsRemoveDSServer_r_state);
    2725           4 :         if (req == NULL) {
    2726           0 :                 return NULL;
    2727             :         }
    2728             : 
    2729           4 :         state->out_mem_ctx = talloc_new(state);
    2730           4 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2731           0 :                 return tevent_req_post(req, ev);
    2732             :         }
    2733             : 
    2734           4 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2735             :                         NULL, &ndr_table_drsuapi,
    2736           4 :                         NDR_DRSUAPI_DSREMOVEDSSERVER, state->out_mem_ctx, r);
    2737           4 :         if (tevent_req_nomem(subreq, req)) {
    2738           0 :                 return tevent_req_post(req, ev);
    2739             :         }
    2740           4 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsRemoveDSServer_r_done, req);
    2741             : 
    2742           4 :         return req;
    2743             : }
    2744             : 
    2745           4 : static void dcerpc_drsuapi_DsRemoveDSServer_r_done(struct tevent_req *subreq)
    2746             : {
    2747           0 :         struct tevent_req *req =
    2748           4 :                 tevent_req_callback_data(subreq,
    2749             :                 struct tevent_req);
    2750           0 :         NTSTATUS status;
    2751             : 
    2752           4 :         status = dcerpc_binding_handle_call_recv(subreq);
    2753           4 :         TALLOC_FREE(subreq);
    2754           4 :         if (tevent_req_nterror(req, status)) {
    2755           0 :                 return;
    2756             :         }
    2757             : 
    2758           4 :         tevent_req_done(req);
    2759             : }
    2760             : 
    2761           4 : NTSTATUS dcerpc_drsuapi_DsRemoveDSServer_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2762             : {
    2763           0 :         struct dcerpc_drsuapi_DsRemoveDSServer_r_state *state =
    2764           4 :                 tevent_req_data(req,
    2765             :                 struct dcerpc_drsuapi_DsRemoveDSServer_r_state);
    2766           0 :         NTSTATUS status;
    2767             : 
    2768           4 :         if (tevent_req_is_nterror(req, &status)) {
    2769           0 :                 tevent_req_received(req);
    2770           0 :                 return status;
    2771             :         }
    2772             : 
    2773           4 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2774             : 
    2775           4 :         tevent_req_received(req);
    2776           4 :         return NT_STATUS_OK;
    2777             : }
    2778             : 
    2779           3 : NTSTATUS dcerpc_drsuapi_DsRemoveDSServer_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsRemoveDSServer *r)
    2780             : {
    2781           0 :         NTSTATUS status;
    2782             : 
    2783           3 :         status = dcerpc_binding_handle_call(h,
    2784             :                         NULL, &ndr_table_drsuapi,
    2785             :                         NDR_DRSUAPI_DSREMOVEDSSERVER, mem_ctx, r);
    2786             : 
    2787           3 :         return status;
    2788             : }
    2789             : 
    2790             : struct dcerpc_drsuapi_DsRemoveDSServer_state {
    2791             :         struct drsuapi_DsRemoveDSServer orig;
    2792             :         struct drsuapi_DsRemoveDSServer tmp;
    2793             :         TALLOC_CTX *out_mem_ctx;
    2794             : };
    2795             : 
    2796             : static void dcerpc_drsuapi_DsRemoveDSServer_done(struct tevent_req *subreq);
    2797             : 
    2798           0 : struct tevent_req *dcerpc_drsuapi_DsRemoveDSServer_send(TALLOC_CTX *mem_ctx,
    2799             :                                                         struct tevent_context *ev,
    2800             :                                                         struct dcerpc_binding_handle *h,
    2801             :                                                         struct policy_handle *_bind_handle /* [in] [ref] */,
    2802             :                                                         uint32_t _level /* [in]  */,
    2803             :                                                         union drsuapi_DsRemoveDSServerRequest *_req /* [in] [ref,switch_is(level)] */,
    2804             :                                                         uint32_t *_level_out /* [out] [ref] */,
    2805             :                                                         union drsuapi_DsRemoveDSServerResult *_res /* [out] [ref,switch_is(*level_out)] */)
    2806             : {
    2807           0 :         struct tevent_req *req;
    2808           0 :         struct dcerpc_drsuapi_DsRemoveDSServer_state *state;
    2809           0 :         struct tevent_req *subreq;
    2810             : 
    2811           0 :         req = tevent_req_create(mem_ctx, &state,
    2812             :                                 struct dcerpc_drsuapi_DsRemoveDSServer_state);
    2813           0 :         if (req == NULL) {
    2814           0 :                 return NULL;
    2815             :         }
    2816           0 :         state->out_mem_ctx = NULL;
    2817             : 
    2818             :         /* In parameters */
    2819           0 :         state->orig.in.bind_handle = _bind_handle;
    2820           0 :         state->orig.in.level = _level;
    2821           0 :         state->orig.in.req = _req;
    2822             : 
    2823             :         /* Out parameters */
    2824           0 :         state->orig.out.level_out = _level_out;
    2825           0 :         state->orig.out.res = _res;
    2826             : 
    2827             :         /* Result */
    2828           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2829             : 
    2830           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2831             :                              "dcerpc_drsuapi_DsRemoveDSServer_out_memory");
    2832           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2833           0 :                 return tevent_req_post(req, ev);
    2834             :         }
    2835             : 
    2836             :         /* make a temporary copy, that we pass to the dispatch function */
    2837           0 :         state->tmp = state->orig;
    2838             : 
    2839           0 :         subreq = dcerpc_drsuapi_DsRemoveDSServer_r_send(state, ev, h, &state->tmp);
    2840           0 :         if (tevent_req_nomem(subreq, req)) {
    2841           0 :                 return tevent_req_post(req, ev);
    2842             :         }
    2843           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsRemoveDSServer_done, req);
    2844           0 :         return req;
    2845             : }
    2846             : 
    2847           0 : static void dcerpc_drsuapi_DsRemoveDSServer_done(struct tevent_req *subreq)
    2848             : {
    2849           0 :         struct tevent_req *req = tevent_req_callback_data(
    2850             :                 subreq, struct tevent_req);
    2851           0 :         struct dcerpc_drsuapi_DsRemoveDSServer_state *state = tevent_req_data(
    2852             :                 req, struct dcerpc_drsuapi_DsRemoveDSServer_state);
    2853           0 :         NTSTATUS status;
    2854           0 :         TALLOC_CTX *mem_ctx;
    2855             : 
    2856           0 :         if (state->out_mem_ctx) {
    2857           0 :                 mem_ctx = state->out_mem_ctx;
    2858             :         } else {
    2859           0 :                 mem_ctx = state;
    2860             :         }
    2861             : 
    2862           0 :         status = dcerpc_drsuapi_DsRemoveDSServer_r_recv(subreq, mem_ctx);
    2863           0 :         TALLOC_FREE(subreq);
    2864           0 :         if (tevent_req_nterror(req, status)) {
    2865           0 :                 return;
    2866             :         }
    2867             : 
    2868             :         /* Copy out parameters */
    2869           0 :         *state->orig.out.level_out = *state->tmp.out.level_out;
    2870           0 :         *state->orig.out.res = *state->tmp.out.res;
    2871             : 
    2872             :         /* Copy result */
    2873           0 :         state->orig.out.result = state->tmp.out.result;
    2874             : 
    2875             :         /* Reset temporary structure */
    2876           0 :         NDR_ZERO_STRUCT(state->tmp);
    2877             : 
    2878           0 :         tevent_req_done(req);
    2879             : }
    2880             : 
    2881           0 : NTSTATUS dcerpc_drsuapi_DsRemoveDSServer_recv(struct tevent_req *req,
    2882             :                                               TALLOC_CTX *mem_ctx,
    2883             :                                               WERROR *result)
    2884             : {
    2885           0 :         struct dcerpc_drsuapi_DsRemoveDSServer_state *state = tevent_req_data(
    2886             :                 req, struct dcerpc_drsuapi_DsRemoveDSServer_state);
    2887           0 :         NTSTATUS status;
    2888             : 
    2889           0 :         if (tevent_req_is_nterror(req, &status)) {
    2890           0 :                 tevent_req_received(req);
    2891           0 :                 return status;
    2892             :         }
    2893             : 
    2894             :         /* Steal possible out parameters to the callers context */
    2895           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2896             : 
    2897             :         /* Return result */
    2898           0 :         *result = state->orig.out.result;
    2899             : 
    2900           0 :         tevent_req_received(req);
    2901           0 :         return NT_STATUS_OK;
    2902             : }
    2903             : 
    2904           0 : NTSTATUS dcerpc_drsuapi_DsRemoveDSServer(struct dcerpc_binding_handle *h,
    2905             :                                          TALLOC_CTX *mem_ctx,
    2906             :                                          struct policy_handle *_bind_handle /* [in] [ref] */,
    2907             :                                          uint32_t _level /* [in]  */,
    2908             :                                          union drsuapi_DsRemoveDSServerRequest *_req /* [in] [ref,switch_is(level)] */,
    2909             :                                          uint32_t *_level_out /* [out] [ref] */,
    2910             :                                          union drsuapi_DsRemoveDSServerResult *_res /* [out] [ref,switch_is(*level_out)] */,
    2911             :                                          WERROR *result)
    2912             : {
    2913           0 :         struct drsuapi_DsRemoveDSServer r;
    2914           0 :         NTSTATUS status;
    2915             : 
    2916             :         /* In parameters */
    2917           0 :         r.in.bind_handle = _bind_handle;
    2918           0 :         r.in.level = _level;
    2919           0 :         r.in.req = _req;
    2920             : 
    2921             :         /* Out parameters */
    2922           0 :         r.out.level_out = _level_out;
    2923           0 :         r.out.res = _res;
    2924             : 
    2925             :         /* Result */
    2926           0 :         NDR_ZERO_STRUCT(r.out.result);
    2927             : 
    2928           0 :         status = dcerpc_drsuapi_DsRemoveDSServer_r(h, mem_ctx, &r);
    2929           0 :         if (!NT_STATUS_IS_OK(status)) {
    2930           0 :                 return status;
    2931             :         }
    2932             : 
    2933             :         /* Return variables */
    2934           0 :         *_level_out = *r.out.level_out;
    2935           0 :         *_res = *r.out.res;
    2936             : 
    2937             :         /* Return result */
    2938           0 :         *result = r.out.result;
    2939             : 
    2940           0 :         return NT_STATUS_OK;
    2941             : }
    2942             : 
    2943             : struct dcerpc_drsuapi_DsGetDomainControllerInfo_r_state {
    2944             :         TALLOC_CTX *out_mem_ctx;
    2945             : };
    2946             : 
    2947             : static void dcerpc_drsuapi_DsGetDomainControllerInfo_r_done(struct tevent_req *subreq);
    2948             : 
    2949           0 : struct tevent_req *dcerpc_drsuapi_DsGetDomainControllerInfo_r_send(TALLOC_CTX *mem_ctx,
    2950             :         struct tevent_context *ev,
    2951             :         struct dcerpc_binding_handle *h,
    2952             :         struct drsuapi_DsGetDomainControllerInfo *r)
    2953             : {
    2954           0 :         struct tevent_req *req;
    2955           0 :         struct dcerpc_drsuapi_DsGetDomainControllerInfo_r_state *state;
    2956           0 :         struct tevent_req *subreq;
    2957             : 
    2958           0 :         req = tevent_req_create(mem_ctx, &state,
    2959             :                                 struct dcerpc_drsuapi_DsGetDomainControllerInfo_r_state);
    2960           0 :         if (req == NULL) {
    2961           0 :                 return NULL;
    2962             :         }
    2963             : 
    2964           0 :         state->out_mem_ctx = talloc_new(state);
    2965           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2966           0 :                 return tevent_req_post(req, ev);
    2967             :         }
    2968             : 
    2969           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2970             :                         NULL, &ndr_table_drsuapi,
    2971           0 :                         NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO, state->out_mem_ctx, r);
    2972           0 :         if (tevent_req_nomem(subreq, req)) {
    2973           0 :                 return tevent_req_post(req, ev);
    2974             :         }
    2975           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsGetDomainControllerInfo_r_done, req);
    2976             : 
    2977           0 :         return req;
    2978             : }
    2979             : 
    2980           0 : static void dcerpc_drsuapi_DsGetDomainControllerInfo_r_done(struct tevent_req *subreq)
    2981             : {
    2982           0 :         struct tevent_req *req =
    2983           0 :                 tevent_req_callback_data(subreq,
    2984             :                 struct tevent_req);
    2985           0 :         NTSTATUS status;
    2986             : 
    2987           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2988           0 :         TALLOC_FREE(subreq);
    2989           0 :         if (tevent_req_nterror(req, status)) {
    2990           0 :                 return;
    2991             :         }
    2992             : 
    2993           0 :         tevent_req_done(req);
    2994             : }
    2995             : 
    2996           0 : NTSTATUS dcerpc_drsuapi_DsGetDomainControllerInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2997             : {
    2998           0 :         struct dcerpc_drsuapi_DsGetDomainControllerInfo_r_state *state =
    2999           0 :                 tevent_req_data(req,
    3000             :                 struct dcerpc_drsuapi_DsGetDomainControllerInfo_r_state);
    3001           0 :         NTSTATUS status;
    3002             : 
    3003           0 :         if (tevent_req_is_nterror(req, &status)) {
    3004           0 :                 tevent_req_received(req);
    3005           0 :                 return status;
    3006             :         }
    3007             : 
    3008           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3009             : 
    3010           0 :         tevent_req_received(req);
    3011           0 :         return NT_STATUS_OK;
    3012             : }
    3013             : 
    3014           6 : NTSTATUS dcerpc_drsuapi_DsGetDomainControllerInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsGetDomainControllerInfo *r)
    3015             : {
    3016           0 :         NTSTATUS status;
    3017             : 
    3018           6 :         status = dcerpc_binding_handle_call(h,
    3019             :                         NULL, &ndr_table_drsuapi,
    3020             :                         NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO, mem_ctx, r);
    3021             : 
    3022           6 :         return status;
    3023             : }
    3024             : 
    3025             : struct dcerpc_drsuapi_DsGetDomainControllerInfo_state {
    3026             :         struct drsuapi_DsGetDomainControllerInfo orig;
    3027             :         struct drsuapi_DsGetDomainControllerInfo tmp;
    3028             :         TALLOC_CTX *out_mem_ctx;
    3029             : };
    3030             : 
    3031             : static void dcerpc_drsuapi_DsGetDomainControllerInfo_done(struct tevent_req *subreq);
    3032             : 
    3033           0 : struct tevent_req *dcerpc_drsuapi_DsGetDomainControllerInfo_send(TALLOC_CTX *mem_ctx,
    3034             :                                                                  struct tevent_context *ev,
    3035             :                                                                  struct dcerpc_binding_handle *h,
    3036             :                                                                  struct policy_handle *_bind_handle /* [in] [ref] */,
    3037             :                                                                  uint32_t _level /* [in]  */,
    3038             :                                                                  union drsuapi_DsGetDCInfoRequest *_req /* [in] [ref,switch_is(level)] */,
    3039             :                                                                  enum drsuapi_DsGetDCInfoCtrLevels *_level_out /* [out] [ref] */,
    3040             :                                                                  union drsuapi_DsGetDCInfoCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
    3041             : {
    3042           0 :         struct tevent_req *req;
    3043           0 :         struct dcerpc_drsuapi_DsGetDomainControllerInfo_state *state;
    3044           0 :         struct tevent_req *subreq;
    3045             : 
    3046           0 :         req = tevent_req_create(mem_ctx, &state,
    3047             :                                 struct dcerpc_drsuapi_DsGetDomainControllerInfo_state);
    3048           0 :         if (req == NULL) {
    3049           0 :                 return NULL;
    3050             :         }
    3051           0 :         state->out_mem_ctx = NULL;
    3052             : 
    3053             :         /* In parameters */
    3054           0 :         state->orig.in.bind_handle = _bind_handle;
    3055           0 :         state->orig.in.level = _level;
    3056           0 :         state->orig.in.req = _req;
    3057             : 
    3058             :         /* Out parameters */
    3059           0 :         state->orig.out.level_out = _level_out;
    3060           0 :         state->orig.out.ctr = _ctr;
    3061             : 
    3062             :         /* Result */
    3063           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3064             : 
    3065           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3066             :                              "dcerpc_drsuapi_DsGetDomainControllerInfo_out_memory");
    3067           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3068           0 :                 return tevent_req_post(req, ev);
    3069             :         }
    3070             : 
    3071             :         /* make a temporary copy, that we pass to the dispatch function */
    3072           0 :         state->tmp = state->orig;
    3073             : 
    3074           0 :         subreq = dcerpc_drsuapi_DsGetDomainControllerInfo_r_send(state, ev, h, &state->tmp);
    3075           0 :         if (tevent_req_nomem(subreq, req)) {
    3076           0 :                 return tevent_req_post(req, ev);
    3077             :         }
    3078           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsGetDomainControllerInfo_done, req);
    3079           0 :         return req;
    3080             : }
    3081             : 
    3082           0 : static void dcerpc_drsuapi_DsGetDomainControllerInfo_done(struct tevent_req *subreq)
    3083             : {
    3084           0 :         struct tevent_req *req = tevent_req_callback_data(
    3085             :                 subreq, struct tevent_req);
    3086           0 :         struct dcerpc_drsuapi_DsGetDomainControllerInfo_state *state = tevent_req_data(
    3087             :                 req, struct dcerpc_drsuapi_DsGetDomainControllerInfo_state);
    3088           0 :         NTSTATUS status;
    3089           0 :         TALLOC_CTX *mem_ctx;
    3090             : 
    3091           0 :         if (state->out_mem_ctx) {
    3092           0 :                 mem_ctx = state->out_mem_ctx;
    3093             :         } else {
    3094           0 :                 mem_ctx = state;
    3095             :         }
    3096             : 
    3097           0 :         status = dcerpc_drsuapi_DsGetDomainControllerInfo_r_recv(subreq, mem_ctx);
    3098           0 :         TALLOC_FREE(subreq);
    3099           0 :         if (tevent_req_nterror(req, status)) {
    3100           0 :                 return;
    3101             :         }
    3102             : 
    3103             :         /* Copy out parameters */
    3104           0 :         *state->orig.out.level_out = *state->tmp.out.level_out;
    3105           0 :         *state->orig.out.ctr = *state->tmp.out.ctr;
    3106             : 
    3107             :         /* Copy result */
    3108           0 :         state->orig.out.result = state->tmp.out.result;
    3109             : 
    3110             :         /* Reset temporary structure */
    3111           0 :         NDR_ZERO_STRUCT(state->tmp);
    3112             : 
    3113           0 :         tevent_req_done(req);
    3114             : }
    3115             : 
    3116           0 : NTSTATUS dcerpc_drsuapi_DsGetDomainControllerInfo_recv(struct tevent_req *req,
    3117             :                                                        TALLOC_CTX *mem_ctx,
    3118             :                                                        WERROR *result)
    3119             : {
    3120           0 :         struct dcerpc_drsuapi_DsGetDomainControllerInfo_state *state = tevent_req_data(
    3121             :                 req, struct dcerpc_drsuapi_DsGetDomainControllerInfo_state);
    3122           0 :         NTSTATUS status;
    3123             : 
    3124           0 :         if (tevent_req_is_nterror(req, &status)) {
    3125           0 :                 tevent_req_received(req);
    3126           0 :                 return status;
    3127             :         }
    3128             : 
    3129             :         /* Steal possible out parameters to the callers context */
    3130           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3131             : 
    3132             :         /* Return result */
    3133           0 :         *result = state->orig.out.result;
    3134             : 
    3135           0 :         tevent_req_received(req);
    3136           0 :         return NT_STATUS_OK;
    3137             : }
    3138             : 
    3139           0 : NTSTATUS dcerpc_drsuapi_DsGetDomainControllerInfo(struct dcerpc_binding_handle *h,
    3140             :                                                   TALLOC_CTX *mem_ctx,
    3141             :                                                   struct policy_handle *_bind_handle /* [in] [ref] */,
    3142             :                                                   uint32_t _level /* [in]  */,
    3143             :                                                   union drsuapi_DsGetDCInfoRequest *_req /* [in] [ref,switch_is(level)] */,
    3144             :                                                   enum drsuapi_DsGetDCInfoCtrLevels *_level_out /* [out] [ref] */,
    3145             :                                                   union drsuapi_DsGetDCInfoCtr *_ctr /* [out] [ref,switch_is(*level_out)] */,
    3146             :                                                   WERROR *result)
    3147             : {
    3148           0 :         struct drsuapi_DsGetDomainControllerInfo r;
    3149           0 :         NTSTATUS status;
    3150             : 
    3151             :         /* In parameters */
    3152           0 :         r.in.bind_handle = _bind_handle;
    3153           0 :         r.in.level = _level;
    3154           0 :         r.in.req = _req;
    3155             : 
    3156             :         /* Out parameters */
    3157           0 :         r.out.level_out = _level_out;
    3158           0 :         r.out.ctr = _ctr;
    3159             : 
    3160             :         /* Result */
    3161           0 :         NDR_ZERO_STRUCT(r.out.result);
    3162             : 
    3163           0 :         status = dcerpc_drsuapi_DsGetDomainControllerInfo_r(h, mem_ctx, &r);
    3164           0 :         if (!NT_STATUS_IS_OK(status)) {
    3165           0 :                 return status;
    3166             :         }
    3167             : 
    3168             :         /* Return variables */
    3169           0 :         *_level_out = *r.out.level_out;
    3170           0 :         *_ctr = *r.out.ctr;
    3171             : 
    3172             :         /* Return result */
    3173           0 :         *result = r.out.result;
    3174             : 
    3175           0 :         return NT_STATUS_OK;
    3176             : }
    3177             : 
    3178             : struct dcerpc_drsuapi_DsAddEntry_r_state {
    3179             :         TALLOC_CTX *out_mem_ctx;
    3180             : };
    3181             : 
    3182             : static void dcerpc_drsuapi_DsAddEntry_r_done(struct tevent_req *subreq);
    3183             : 
    3184           4 : struct tevent_req *dcerpc_drsuapi_DsAddEntry_r_send(TALLOC_CTX *mem_ctx,
    3185             :         struct tevent_context *ev,
    3186             :         struct dcerpc_binding_handle *h,
    3187             :         struct drsuapi_DsAddEntry *r)
    3188             : {
    3189           0 :         struct tevent_req *req;
    3190           0 :         struct dcerpc_drsuapi_DsAddEntry_r_state *state;
    3191           0 :         struct tevent_req *subreq;
    3192             : 
    3193           4 :         req = tevent_req_create(mem_ctx, &state,
    3194             :                                 struct dcerpc_drsuapi_DsAddEntry_r_state);
    3195           4 :         if (req == NULL) {
    3196           0 :                 return NULL;
    3197             :         }
    3198             : 
    3199           4 :         state->out_mem_ctx = talloc_new(state);
    3200           4 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3201           0 :                 return tevent_req_post(req, ev);
    3202             :         }
    3203             : 
    3204           4 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3205             :                         NULL, &ndr_table_drsuapi,
    3206           4 :                         NDR_DRSUAPI_DSADDENTRY, state->out_mem_ctx, r);
    3207           4 :         if (tevent_req_nomem(subreq, req)) {
    3208           0 :                 return tevent_req_post(req, ev);
    3209             :         }
    3210           4 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsAddEntry_r_done, req);
    3211             : 
    3212           4 :         return req;
    3213             : }
    3214             : 
    3215           4 : static void dcerpc_drsuapi_DsAddEntry_r_done(struct tevent_req *subreq)
    3216             : {
    3217           0 :         struct tevent_req *req =
    3218           4 :                 tevent_req_callback_data(subreq,
    3219             :                 struct tevent_req);
    3220           0 :         NTSTATUS status;
    3221             : 
    3222           4 :         status = dcerpc_binding_handle_call_recv(subreq);
    3223           4 :         TALLOC_FREE(subreq);
    3224           4 :         if (tevent_req_nterror(req, status)) {
    3225           0 :                 return;
    3226             :         }
    3227             : 
    3228           4 :         tevent_req_done(req);
    3229             : }
    3230             : 
    3231           4 : NTSTATUS dcerpc_drsuapi_DsAddEntry_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3232             : {
    3233           0 :         struct dcerpc_drsuapi_DsAddEntry_r_state *state =
    3234           4 :                 tevent_req_data(req,
    3235             :                 struct dcerpc_drsuapi_DsAddEntry_r_state);
    3236           0 :         NTSTATUS status;
    3237             : 
    3238           4 :         if (tevent_req_is_nterror(req, &status)) {
    3239           0 :                 tevent_req_received(req);
    3240           0 :                 return status;
    3241             :         }
    3242             : 
    3243           4 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3244             : 
    3245           4 :         tevent_req_received(req);
    3246           4 :         return NT_STATUS_OK;
    3247             : }
    3248             : 
    3249          90 : NTSTATUS dcerpc_drsuapi_DsAddEntry_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsAddEntry *r)
    3250             : {
    3251           0 :         NTSTATUS status;
    3252             : 
    3253          90 :         status = dcerpc_binding_handle_call(h,
    3254             :                         NULL, &ndr_table_drsuapi,
    3255             :                         NDR_DRSUAPI_DSADDENTRY, mem_ctx, r);
    3256             : 
    3257          90 :         return status;
    3258             : }
    3259             : 
    3260             : struct dcerpc_drsuapi_DsAddEntry_state {
    3261             :         struct drsuapi_DsAddEntry orig;
    3262             :         struct drsuapi_DsAddEntry tmp;
    3263             :         TALLOC_CTX *out_mem_ctx;
    3264             : };
    3265             : 
    3266             : static void dcerpc_drsuapi_DsAddEntry_done(struct tevent_req *subreq);
    3267             : 
    3268           0 : struct tevent_req *dcerpc_drsuapi_DsAddEntry_send(TALLOC_CTX *mem_ctx,
    3269             :                                                   struct tevent_context *ev,
    3270             :                                                   struct dcerpc_binding_handle *h,
    3271             :                                                   struct policy_handle *_bind_handle /* [in] [ref] */,
    3272             :                                                   uint32_t _level /* [in]  */,
    3273             :                                                   union drsuapi_DsAddEntryRequest *_req /* [in] [ref,switch_is(level)] */,
    3274             :                                                   uint32_t *_level_out /* [out] [ref] */,
    3275             :                                                   union drsuapi_DsAddEntryCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
    3276             : {
    3277           0 :         struct tevent_req *req;
    3278           0 :         struct dcerpc_drsuapi_DsAddEntry_state *state;
    3279           0 :         struct tevent_req *subreq;
    3280             : 
    3281           0 :         req = tevent_req_create(mem_ctx, &state,
    3282             :                                 struct dcerpc_drsuapi_DsAddEntry_state);
    3283           0 :         if (req == NULL) {
    3284           0 :                 return NULL;
    3285             :         }
    3286           0 :         state->out_mem_ctx = NULL;
    3287             : 
    3288             :         /* In parameters */
    3289           0 :         state->orig.in.bind_handle = _bind_handle;
    3290           0 :         state->orig.in.level = _level;
    3291           0 :         state->orig.in.req = _req;
    3292             : 
    3293             :         /* Out parameters */
    3294           0 :         state->orig.out.level_out = _level_out;
    3295           0 :         state->orig.out.ctr = _ctr;
    3296             : 
    3297             :         /* Result */
    3298           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3299             : 
    3300           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3301             :                              "dcerpc_drsuapi_DsAddEntry_out_memory");
    3302           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3303           0 :                 return tevent_req_post(req, ev);
    3304             :         }
    3305             : 
    3306             :         /* make a temporary copy, that we pass to the dispatch function */
    3307           0 :         state->tmp = state->orig;
    3308             : 
    3309           0 :         subreq = dcerpc_drsuapi_DsAddEntry_r_send(state, ev, h, &state->tmp);
    3310           0 :         if (tevent_req_nomem(subreq, req)) {
    3311           0 :                 return tevent_req_post(req, ev);
    3312             :         }
    3313           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsAddEntry_done, req);
    3314           0 :         return req;
    3315             : }
    3316             : 
    3317           0 : static void dcerpc_drsuapi_DsAddEntry_done(struct tevent_req *subreq)
    3318             : {
    3319           0 :         struct tevent_req *req = tevent_req_callback_data(
    3320             :                 subreq, struct tevent_req);
    3321           0 :         struct dcerpc_drsuapi_DsAddEntry_state *state = tevent_req_data(
    3322             :                 req, struct dcerpc_drsuapi_DsAddEntry_state);
    3323           0 :         NTSTATUS status;
    3324           0 :         TALLOC_CTX *mem_ctx;
    3325             : 
    3326           0 :         if (state->out_mem_ctx) {
    3327           0 :                 mem_ctx = state->out_mem_ctx;
    3328             :         } else {
    3329           0 :                 mem_ctx = state;
    3330             :         }
    3331             : 
    3332           0 :         status = dcerpc_drsuapi_DsAddEntry_r_recv(subreq, mem_ctx);
    3333           0 :         TALLOC_FREE(subreq);
    3334           0 :         if (tevent_req_nterror(req, status)) {
    3335           0 :                 return;
    3336             :         }
    3337             : 
    3338             :         /* Copy out parameters */
    3339           0 :         *state->orig.out.level_out = *state->tmp.out.level_out;
    3340           0 :         *state->orig.out.ctr = *state->tmp.out.ctr;
    3341             : 
    3342             :         /* Copy result */
    3343           0 :         state->orig.out.result = state->tmp.out.result;
    3344             : 
    3345             :         /* Reset temporary structure */
    3346           0 :         NDR_ZERO_STRUCT(state->tmp);
    3347             : 
    3348           0 :         tevent_req_done(req);
    3349             : }
    3350             : 
    3351           0 : NTSTATUS dcerpc_drsuapi_DsAddEntry_recv(struct tevent_req *req,
    3352             :                                         TALLOC_CTX *mem_ctx,
    3353             :                                         WERROR *result)
    3354             : {
    3355           0 :         struct dcerpc_drsuapi_DsAddEntry_state *state = tevent_req_data(
    3356             :                 req, struct dcerpc_drsuapi_DsAddEntry_state);
    3357           0 :         NTSTATUS status;
    3358             : 
    3359           0 :         if (tevent_req_is_nterror(req, &status)) {
    3360           0 :                 tevent_req_received(req);
    3361           0 :                 return status;
    3362             :         }
    3363             : 
    3364             :         /* Steal possible out parameters to the callers context */
    3365           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3366             : 
    3367             :         /* Return result */
    3368           0 :         *result = state->orig.out.result;
    3369             : 
    3370           0 :         tevent_req_received(req);
    3371           0 :         return NT_STATUS_OK;
    3372             : }
    3373             : 
    3374           0 : NTSTATUS dcerpc_drsuapi_DsAddEntry(struct dcerpc_binding_handle *h,
    3375             :                                    TALLOC_CTX *mem_ctx,
    3376             :                                    struct policy_handle *_bind_handle /* [in] [ref] */,
    3377             :                                    uint32_t _level /* [in]  */,
    3378             :                                    union drsuapi_DsAddEntryRequest *_req /* [in] [ref,switch_is(level)] */,
    3379             :                                    uint32_t *_level_out /* [out] [ref] */,
    3380             :                                    union drsuapi_DsAddEntryCtr *_ctr /* [out] [ref,switch_is(*level_out)] */,
    3381             :                                    WERROR *result)
    3382             : {
    3383           0 :         struct drsuapi_DsAddEntry r;
    3384           0 :         NTSTATUS status;
    3385             : 
    3386             :         /* In parameters */
    3387           0 :         r.in.bind_handle = _bind_handle;
    3388           0 :         r.in.level = _level;
    3389           0 :         r.in.req = _req;
    3390             : 
    3391             :         /* Out parameters */
    3392           0 :         r.out.level_out = _level_out;
    3393           0 :         r.out.ctr = _ctr;
    3394             : 
    3395             :         /* Result */
    3396           0 :         NDR_ZERO_STRUCT(r.out.result);
    3397             : 
    3398           0 :         status = dcerpc_drsuapi_DsAddEntry_r(h, mem_ctx, &r);
    3399           0 :         if (!NT_STATUS_IS_OK(status)) {
    3400           0 :                 return status;
    3401             :         }
    3402             : 
    3403             :         /* Return variables */
    3404           0 :         *_level_out = *r.out.level_out;
    3405           0 :         *_ctr = *r.out.ctr;
    3406             : 
    3407             :         /* Return result */
    3408           0 :         *result = r.out.result;
    3409             : 
    3410           0 :         return NT_STATUS_OK;
    3411             : }
    3412             : 
    3413             : struct dcerpc_drsuapi_DsExecuteKCC_r_state {
    3414             :         TALLOC_CTX *out_mem_ctx;
    3415             : };
    3416             : 
    3417             : static void dcerpc_drsuapi_DsExecuteKCC_r_done(struct tevent_req *subreq);
    3418             : 
    3419           0 : struct tevent_req *dcerpc_drsuapi_DsExecuteKCC_r_send(TALLOC_CTX *mem_ctx,
    3420             :         struct tevent_context *ev,
    3421             :         struct dcerpc_binding_handle *h,
    3422             :         struct drsuapi_DsExecuteKCC *r)
    3423             : {
    3424           0 :         struct tevent_req *req;
    3425           0 :         struct dcerpc_drsuapi_DsExecuteKCC_r_state *state;
    3426           0 :         struct tevent_req *subreq;
    3427             : 
    3428           0 :         req = tevent_req_create(mem_ctx, &state,
    3429             :                                 struct dcerpc_drsuapi_DsExecuteKCC_r_state);
    3430           0 :         if (req == NULL) {
    3431           0 :                 return NULL;
    3432             :         }
    3433             : 
    3434           0 :         state->out_mem_ctx = NULL;
    3435             : 
    3436           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3437             :                         NULL, &ndr_table_drsuapi,
    3438             :                         NDR_DRSUAPI_DSEXECUTEKCC, state, r);
    3439           0 :         if (tevent_req_nomem(subreq, req)) {
    3440           0 :                 return tevent_req_post(req, ev);
    3441             :         }
    3442           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsExecuteKCC_r_done, req);
    3443             : 
    3444           0 :         return req;
    3445             : }
    3446             : 
    3447           0 : static void dcerpc_drsuapi_DsExecuteKCC_r_done(struct tevent_req *subreq)
    3448             : {
    3449           0 :         struct tevent_req *req =
    3450           0 :                 tevent_req_callback_data(subreq,
    3451             :                 struct tevent_req);
    3452           0 :         NTSTATUS status;
    3453             : 
    3454           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3455           0 :         TALLOC_FREE(subreq);
    3456           0 :         if (tevent_req_nterror(req, status)) {
    3457           0 :                 return;
    3458             :         }
    3459             : 
    3460           0 :         tevent_req_done(req);
    3461             : }
    3462             : 
    3463           0 : NTSTATUS dcerpc_drsuapi_DsExecuteKCC_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3464             : {
    3465           0 :         struct dcerpc_drsuapi_DsExecuteKCC_r_state *state =
    3466           0 :                 tevent_req_data(req,
    3467             :                 struct dcerpc_drsuapi_DsExecuteKCC_r_state);
    3468           0 :         NTSTATUS status;
    3469             : 
    3470           0 :         if (tevent_req_is_nterror(req, &status)) {
    3471           0 :                 tevent_req_received(req);
    3472           0 :                 return status;
    3473             :         }
    3474             : 
    3475           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3476             : 
    3477           0 :         tevent_req_received(req);
    3478           0 :         return NT_STATUS_OK;
    3479             : }
    3480             : 
    3481           2 : NTSTATUS dcerpc_drsuapi_DsExecuteKCC_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsExecuteKCC *r)
    3482             : {
    3483           0 :         NTSTATUS status;
    3484             : 
    3485           2 :         status = dcerpc_binding_handle_call(h,
    3486             :                         NULL, &ndr_table_drsuapi,
    3487             :                         NDR_DRSUAPI_DSEXECUTEKCC, mem_ctx, r);
    3488             : 
    3489           2 :         return status;
    3490             : }
    3491             : 
    3492             : struct dcerpc_drsuapi_DsExecuteKCC_state {
    3493             :         struct drsuapi_DsExecuteKCC orig;
    3494             :         struct drsuapi_DsExecuteKCC tmp;
    3495             :         TALLOC_CTX *out_mem_ctx;
    3496             : };
    3497             : 
    3498             : static void dcerpc_drsuapi_DsExecuteKCC_done(struct tevent_req *subreq);
    3499             : 
    3500           0 : struct tevent_req *dcerpc_drsuapi_DsExecuteKCC_send(TALLOC_CTX *mem_ctx,
    3501             :                                                     struct tevent_context *ev,
    3502             :                                                     struct dcerpc_binding_handle *h,
    3503             :                                                     struct policy_handle *_bind_handle /* [in] [ref] */,
    3504             :                                                     uint32_t _level /* [in]  */,
    3505             :                                                     union drsuapi_DsExecuteKCCRequest *_req /* [in] [ref,switch_is(level)] */)
    3506             : {
    3507           0 :         struct tevent_req *req;
    3508           0 :         struct dcerpc_drsuapi_DsExecuteKCC_state *state;
    3509           0 :         struct tevent_req *subreq;
    3510             : 
    3511           0 :         req = tevent_req_create(mem_ctx, &state,
    3512             :                                 struct dcerpc_drsuapi_DsExecuteKCC_state);
    3513           0 :         if (req == NULL) {
    3514           0 :                 return NULL;
    3515             :         }
    3516           0 :         state->out_mem_ctx = NULL;
    3517             : 
    3518             :         /* In parameters */
    3519           0 :         state->orig.in.bind_handle = _bind_handle;
    3520           0 :         state->orig.in.level = _level;
    3521           0 :         state->orig.in.req = _req;
    3522             : 
    3523             :         /* Out parameters */
    3524             : 
    3525             :         /* Result */
    3526           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3527             : 
    3528             :         /* make a temporary copy, that we pass to the dispatch function */
    3529           0 :         state->tmp = state->orig;
    3530             : 
    3531           0 :         subreq = dcerpc_drsuapi_DsExecuteKCC_r_send(state, ev, h, &state->tmp);
    3532           0 :         if (tevent_req_nomem(subreq, req)) {
    3533           0 :                 return tevent_req_post(req, ev);
    3534             :         }
    3535           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsExecuteKCC_done, req);
    3536           0 :         return req;
    3537             : }
    3538             : 
    3539           0 : static void dcerpc_drsuapi_DsExecuteKCC_done(struct tevent_req *subreq)
    3540             : {
    3541           0 :         struct tevent_req *req = tevent_req_callback_data(
    3542             :                 subreq, struct tevent_req);
    3543           0 :         struct dcerpc_drsuapi_DsExecuteKCC_state *state = tevent_req_data(
    3544             :                 req, struct dcerpc_drsuapi_DsExecuteKCC_state);
    3545           0 :         NTSTATUS status;
    3546           0 :         TALLOC_CTX *mem_ctx;
    3547             : 
    3548           0 :         if (state->out_mem_ctx) {
    3549           0 :                 mem_ctx = state->out_mem_ctx;
    3550             :         } else {
    3551           0 :                 mem_ctx = state;
    3552             :         }
    3553             : 
    3554           0 :         status = dcerpc_drsuapi_DsExecuteKCC_r_recv(subreq, mem_ctx);
    3555           0 :         TALLOC_FREE(subreq);
    3556           0 :         if (tevent_req_nterror(req, status)) {
    3557           0 :                 return;
    3558             :         }
    3559             : 
    3560             :         /* Copy out parameters */
    3561             : 
    3562             :         /* Copy result */
    3563           0 :         state->orig.out.result = state->tmp.out.result;
    3564             : 
    3565             :         /* Reset temporary structure */
    3566           0 :         NDR_ZERO_STRUCT(state->tmp);
    3567             : 
    3568           0 :         tevent_req_done(req);
    3569             : }
    3570             : 
    3571           0 : NTSTATUS dcerpc_drsuapi_DsExecuteKCC_recv(struct tevent_req *req,
    3572             :                                           TALLOC_CTX *mem_ctx,
    3573             :                                           WERROR *result)
    3574             : {
    3575           0 :         struct dcerpc_drsuapi_DsExecuteKCC_state *state = tevent_req_data(
    3576             :                 req, struct dcerpc_drsuapi_DsExecuteKCC_state);
    3577           0 :         NTSTATUS status;
    3578             : 
    3579           0 :         if (tevent_req_is_nterror(req, &status)) {
    3580           0 :                 tevent_req_received(req);
    3581           0 :                 return status;
    3582             :         }
    3583             : 
    3584             :         /* Steal possible out parameters to the callers context */
    3585           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3586             : 
    3587             :         /* Return result */
    3588           0 :         *result = state->orig.out.result;
    3589             : 
    3590           0 :         tevent_req_received(req);
    3591           0 :         return NT_STATUS_OK;
    3592             : }
    3593             : 
    3594           0 : NTSTATUS dcerpc_drsuapi_DsExecuteKCC(struct dcerpc_binding_handle *h,
    3595             :                                      TALLOC_CTX *mem_ctx,
    3596             :                                      struct policy_handle *_bind_handle /* [in] [ref] */,
    3597             :                                      uint32_t _level /* [in]  */,
    3598             :                                      union drsuapi_DsExecuteKCCRequest *_req /* [in] [ref,switch_is(level)] */,
    3599             :                                      WERROR *result)
    3600             : {
    3601           0 :         struct drsuapi_DsExecuteKCC r;
    3602           0 :         NTSTATUS status;
    3603             : 
    3604             :         /* In parameters */
    3605           0 :         r.in.bind_handle = _bind_handle;
    3606           0 :         r.in.level = _level;
    3607           0 :         r.in.req = _req;
    3608             : 
    3609             :         /* Out parameters */
    3610             : 
    3611             :         /* Result */
    3612           0 :         NDR_ZERO_STRUCT(r.out.result);
    3613             : 
    3614           0 :         status = dcerpc_drsuapi_DsExecuteKCC_r(h, mem_ctx, &r);
    3615           0 :         if (!NT_STATUS_IS_OK(status)) {
    3616           0 :                 return status;
    3617             :         }
    3618             : 
    3619             :         /* Return variables */
    3620             : 
    3621             :         /* Return result */
    3622           0 :         *result = r.out.result;
    3623             : 
    3624           0 :         return NT_STATUS_OK;
    3625             : }
    3626             : 
    3627             : struct dcerpc_drsuapi_DsReplicaGetInfo_r_state {
    3628             :         TALLOC_CTX *out_mem_ctx;
    3629             : };
    3630             : 
    3631             : static void dcerpc_drsuapi_DsReplicaGetInfo_r_done(struct tevent_req *subreq);
    3632             : 
    3633           0 : struct tevent_req *dcerpc_drsuapi_DsReplicaGetInfo_r_send(TALLOC_CTX *mem_ctx,
    3634             :         struct tevent_context *ev,
    3635             :         struct dcerpc_binding_handle *h,
    3636             :         struct drsuapi_DsReplicaGetInfo *r)
    3637             : {
    3638           0 :         struct tevent_req *req;
    3639           0 :         struct dcerpc_drsuapi_DsReplicaGetInfo_r_state *state;
    3640           0 :         struct tevent_req *subreq;
    3641             : 
    3642           0 :         req = tevent_req_create(mem_ctx, &state,
    3643             :                                 struct dcerpc_drsuapi_DsReplicaGetInfo_r_state);
    3644           0 :         if (req == NULL) {
    3645           0 :                 return NULL;
    3646             :         }
    3647             : 
    3648           0 :         state->out_mem_ctx = talloc_new(state);
    3649           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3650           0 :                 return tevent_req_post(req, ev);
    3651             :         }
    3652             : 
    3653           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3654             :                         NULL, &ndr_table_drsuapi,
    3655           0 :                         NDR_DRSUAPI_DSREPLICAGETINFO, state->out_mem_ctx, r);
    3656           0 :         if (tevent_req_nomem(subreq, req)) {
    3657           0 :                 return tevent_req_post(req, ev);
    3658             :         }
    3659           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaGetInfo_r_done, req);
    3660             : 
    3661           0 :         return req;
    3662             : }
    3663             : 
    3664           0 : static void dcerpc_drsuapi_DsReplicaGetInfo_r_done(struct tevent_req *subreq)
    3665             : {
    3666           0 :         struct tevent_req *req =
    3667           0 :                 tevent_req_callback_data(subreq,
    3668             :                 struct tevent_req);
    3669           0 :         NTSTATUS status;
    3670             : 
    3671           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3672           0 :         TALLOC_FREE(subreq);
    3673           0 :         if (tevent_req_nterror(req, status)) {
    3674           0 :                 return;
    3675             :         }
    3676             : 
    3677           0 :         tevent_req_done(req);
    3678             : }
    3679             : 
    3680           0 : NTSTATUS dcerpc_drsuapi_DsReplicaGetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3681             : {
    3682           0 :         struct dcerpc_drsuapi_DsReplicaGetInfo_r_state *state =
    3683           0 :                 tevent_req_data(req,
    3684             :                 struct dcerpc_drsuapi_DsReplicaGetInfo_r_state);
    3685           0 :         NTSTATUS status;
    3686             : 
    3687           0 :         if (tevent_req_is_nterror(req, &status)) {
    3688           0 :                 tevent_req_received(req);
    3689           0 :                 return status;
    3690             :         }
    3691             : 
    3692           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3693             : 
    3694           0 :         tevent_req_received(req);
    3695           0 :         return NT_STATUS_OK;
    3696             : }
    3697             : 
    3698          10 : NTSTATUS dcerpc_drsuapi_DsReplicaGetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsReplicaGetInfo *r)
    3699             : {
    3700           0 :         NTSTATUS status;
    3701             : 
    3702          10 :         status = dcerpc_binding_handle_call(h,
    3703             :                         NULL, &ndr_table_drsuapi,
    3704             :                         NDR_DRSUAPI_DSREPLICAGETINFO, mem_ctx, r);
    3705             : 
    3706          10 :         return status;
    3707             : }
    3708             : 
    3709             : struct dcerpc_drsuapi_DsReplicaGetInfo_state {
    3710             :         struct drsuapi_DsReplicaGetInfo orig;
    3711             :         struct drsuapi_DsReplicaGetInfo tmp;
    3712             :         TALLOC_CTX *out_mem_ctx;
    3713             : };
    3714             : 
    3715             : static void dcerpc_drsuapi_DsReplicaGetInfo_done(struct tevent_req *subreq);
    3716             : 
    3717           0 : struct tevent_req *dcerpc_drsuapi_DsReplicaGetInfo_send(TALLOC_CTX *mem_ctx,
    3718             :                                                         struct tevent_context *ev,
    3719             :                                                         struct dcerpc_binding_handle *h,
    3720             :                                                         struct policy_handle *_bind_handle /* [in] [ref] */,
    3721             :                                                         enum drsuapi_DsReplicaGetInfoLevel _level /* [in]  */,
    3722             :                                                         union drsuapi_DsReplicaGetInfoRequest *_req /* [in] [ref,switch_is(level)] */,
    3723             :                                                         enum drsuapi_DsReplicaInfoType *_info_type /* [out] [ref] */,
    3724             :                                                         union drsuapi_DsReplicaInfo *_info /* [out] [ref,switch_is(*info_type)] */)
    3725             : {
    3726           0 :         struct tevent_req *req;
    3727           0 :         struct dcerpc_drsuapi_DsReplicaGetInfo_state *state;
    3728           0 :         struct tevent_req *subreq;
    3729             : 
    3730           0 :         req = tevent_req_create(mem_ctx, &state,
    3731             :                                 struct dcerpc_drsuapi_DsReplicaGetInfo_state);
    3732           0 :         if (req == NULL) {
    3733           0 :                 return NULL;
    3734             :         }
    3735           0 :         state->out_mem_ctx = NULL;
    3736             : 
    3737             :         /* In parameters */
    3738           0 :         state->orig.in.bind_handle = _bind_handle;
    3739           0 :         state->orig.in.level = _level;
    3740           0 :         state->orig.in.req = _req;
    3741             : 
    3742             :         /* Out parameters */
    3743           0 :         state->orig.out.info_type = _info_type;
    3744           0 :         state->orig.out.info = _info;
    3745             : 
    3746             :         /* Result */
    3747           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3748             : 
    3749           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3750             :                              "dcerpc_drsuapi_DsReplicaGetInfo_out_memory");
    3751           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3752           0 :                 return tevent_req_post(req, ev);
    3753             :         }
    3754             : 
    3755             :         /* make a temporary copy, that we pass to the dispatch function */
    3756           0 :         state->tmp = state->orig;
    3757             : 
    3758           0 :         subreq = dcerpc_drsuapi_DsReplicaGetInfo_r_send(state, ev, h, &state->tmp);
    3759           0 :         if (tevent_req_nomem(subreq, req)) {
    3760           0 :                 return tevent_req_post(req, ev);
    3761             :         }
    3762           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsReplicaGetInfo_done, req);
    3763           0 :         return req;
    3764             : }
    3765             : 
    3766           0 : static void dcerpc_drsuapi_DsReplicaGetInfo_done(struct tevent_req *subreq)
    3767             : {
    3768           0 :         struct tevent_req *req = tevent_req_callback_data(
    3769             :                 subreq, struct tevent_req);
    3770           0 :         struct dcerpc_drsuapi_DsReplicaGetInfo_state *state = tevent_req_data(
    3771             :                 req, struct dcerpc_drsuapi_DsReplicaGetInfo_state);
    3772           0 :         NTSTATUS status;
    3773           0 :         TALLOC_CTX *mem_ctx;
    3774             : 
    3775           0 :         if (state->out_mem_ctx) {
    3776           0 :                 mem_ctx = state->out_mem_ctx;
    3777             :         } else {
    3778           0 :                 mem_ctx = state;
    3779             :         }
    3780             : 
    3781           0 :         status = dcerpc_drsuapi_DsReplicaGetInfo_r_recv(subreq, mem_ctx);
    3782           0 :         TALLOC_FREE(subreq);
    3783           0 :         if (tevent_req_nterror(req, status)) {
    3784           0 :                 return;
    3785             :         }
    3786             : 
    3787             :         /* Copy out parameters */
    3788           0 :         *state->orig.out.info_type = *state->tmp.out.info_type;
    3789           0 :         *state->orig.out.info = *state->tmp.out.info;
    3790             : 
    3791             :         /* Copy result */
    3792           0 :         state->orig.out.result = state->tmp.out.result;
    3793             : 
    3794             :         /* Reset temporary structure */
    3795           0 :         NDR_ZERO_STRUCT(state->tmp);
    3796             : 
    3797           0 :         tevent_req_done(req);
    3798             : }
    3799             : 
    3800           0 : NTSTATUS dcerpc_drsuapi_DsReplicaGetInfo_recv(struct tevent_req *req,
    3801             :                                               TALLOC_CTX *mem_ctx,
    3802             :                                               WERROR *result)
    3803             : {
    3804           0 :         struct dcerpc_drsuapi_DsReplicaGetInfo_state *state = tevent_req_data(
    3805             :                 req, struct dcerpc_drsuapi_DsReplicaGetInfo_state);
    3806           0 :         NTSTATUS status;
    3807             : 
    3808           0 :         if (tevent_req_is_nterror(req, &status)) {
    3809           0 :                 tevent_req_received(req);
    3810           0 :                 return status;
    3811             :         }
    3812             : 
    3813             :         /* Steal possible out parameters to the callers context */
    3814           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3815             : 
    3816             :         /* Return result */
    3817           0 :         *result = state->orig.out.result;
    3818             : 
    3819           0 :         tevent_req_received(req);
    3820           0 :         return NT_STATUS_OK;
    3821             : }
    3822             : 
    3823           0 : NTSTATUS dcerpc_drsuapi_DsReplicaGetInfo(struct dcerpc_binding_handle *h,
    3824             :                                          TALLOC_CTX *mem_ctx,
    3825             :                                          struct policy_handle *_bind_handle /* [in] [ref] */,
    3826             :                                          enum drsuapi_DsReplicaGetInfoLevel _level /* [in]  */,
    3827             :                                          union drsuapi_DsReplicaGetInfoRequest *_req /* [in] [ref,switch_is(level)] */,
    3828             :                                          enum drsuapi_DsReplicaInfoType *_info_type /* [out] [ref] */,
    3829             :                                          union drsuapi_DsReplicaInfo *_info /* [out] [ref,switch_is(*info_type)] */,
    3830             :                                          WERROR *result)
    3831             : {
    3832           0 :         struct drsuapi_DsReplicaGetInfo r;
    3833           0 :         NTSTATUS status;
    3834             : 
    3835             :         /* In parameters */
    3836           0 :         r.in.bind_handle = _bind_handle;
    3837           0 :         r.in.level = _level;
    3838           0 :         r.in.req = _req;
    3839             : 
    3840             :         /* Out parameters */
    3841           0 :         r.out.info_type = _info_type;
    3842           0 :         r.out.info = _info;
    3843             : 
    3844             :         /* Result */
    3845           0 :         NDR_ZERO_STRUCT(r.out.result);
    3846             : 
    3847           0 :         status = dcerpc_drsuapi_DsReplicaGetInfo_r(h, mem_ctx, &r);
    3848           0 :         if (!NT_STATUS_IS_OK(status)) {
    3849           0 :                 return status;
    3850             :         }
    3851             : 
    3852             :         /* Return variables */
    3853           0 :         *_info_type = *r.out.info_type;
    3854           0 :         *_info = *r.out.info;
    3855             : 
    3856             :         /* Return result */
    3857           0 :         *result = r.out.result;
    3858             : 
    3859           0 :         return NT_STATUS_OK;
    3860             : }
    3861             : 
    3862             : struct dcerpc_drsuapi_DsGetMemberships2_r_state {
    3863             :         TALLOC_CTX *out_mem_ctx;
    3864             : };
    3865             : 
    3866             : static void dcerpc_drsuapi_DsGetMemberships2_r_done(struct tevent_req *subreq);
    3867             : 
    3868           0 : struct tevent_req *dcerpc_drsuapi_DsGetMemberships2_r_send(TALLOC_CTX *mem_ctx,
    3869             :         struct tevent_context *ev,
    3870             :         struct dcerpc_binding_handle *h,
    3871             :         struct drsuapi_DsGetMemberships2 *r)
    3872             : {
    3873           0 :         struct tevent_req *req;
    3874           0 :         struct dcerpc_drsuapi_DsGetMemberships2_r_state *state;
    3875           0 :         struct tevent_req *subreq;
    3876             : 
    3877           0 :         req = tevent_req_create(mem_ctx, &state,
    3878             :                                 struct dcerpc_drsuapi_DsGetMemberships2_r_state);
    3879           0 :         if (req == NULL) {
    3880           0 :                 return NULL;
    3881             :         }
    3882             : 
    3883           0 :         state->out_mem_ctx = talloc_new(state);
    3884           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3885           0 :                 return tevent_req_post(req, ev);
    3886             :         }
    3887             : 
    3888           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3889             :                         NULL, &ndr_table_drsuapi,
    3890           0 :                         NDR_DRSUAPI_DSGETMEMBERSHIPS2, state->out_mem_ctx, r);
    3891           0 :         if (tevent_req_nomem(subreq, req)) {
    3892           0 :                 return tevent_req_post(req, ev);
    3893             :         }
    3894           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsGetMemberships2_r_done, req);
    3895             : 
    3896           0 :         return req;
    3897             : }
    3898             : 
    3899           0 : static void dcerpc_drsuapi_DsGetMemberships2_r_done(struct tevent_req *subreq)
    3900             : {
    3901           0 :         struct tevent_req *req =
    3902           0 :                 tevent_req_callback_data(subreq,
    3903             :                 struct tevent_req);
    3904           0 :         NTSTATUS status;
    3905             : 
    3906           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3907           0 :         TALLOC_FREE(subreq);
    3908           0 :         if (tevent_req_nterror(req, status)) {
    3909           0 :                 return;
    3910             :         }
    3911             : 
    3912           0 :         tevent_req_done(req);
    3913             : }
    3914             : 
    3915           0 : NTSTATUS dcerpc_drsuapi_DsGetMemberships2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3916             : {
    3917           0 :         struct dcerpc_drsuapi_DsGetMemberships2_r_state *state =
    3918           0 :                 tevent_req_data(req,
    3919             :                 struct dcerpc_drsuapi_DsGetMemberships2_r_state);
    3920           0 :         NTSTATUS status;
    3921             : 
    3922           0 :         if (tevent_req_is_nterror(req, &status)) {
    3923           0 :                 tevent_req_received(req);
    3924           0 :                 return status;
    3925             :         }
    3926             : 
    3927           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3928             : 
    3929           0 :         tevent_req_received(req);
    3930           0 :         return NT_STATUS_OK;
    3931             : }
    3932             : 
    3933           0 : NTSTATUS dcerpc_drsuapi_DsGetMemberships2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_DsGetMemberships2 *r)
    3934             : {
    3935           0 :         NTSTATUS status;
    3936             : 
    3937           0 :         status = dcerpc_binding_handle_call(h,
    3938             :                         NULL, &ndr_table_drsuapi,
    3939             :                         NDR_DRSUAPI_DSGETMEMBERSHIPS2, mem_ctx, r);
    3940             : 
    3941           0 :         return status;
    3942             : }
    3943             : 
    3944             : struct dcerpc_drsuapi_DsGetMemberships2_state {
    3945             :         struct drsuapi_DsGetMemberships2 orig;
    3946             :         struct drsuapi_DsGetMemberships2 tmp;
    3947             :         TALLOC_CTX *out_mem_ctx;
    3948             : };
    3949             : 
    3950             : static void dcerpc_drsuapi_DsGetMemberships2_done(struct tevent_req *subreq);
    3951             : 
    3952           0 : struct tevent_req *dcerpc_drsuapi_DsGetMemberships2_send(TALLOC_CTX *mem_ctx,
    3953             :                                                          struct tevent_context *ev,
    3954             :                                                          struct dcerpc_binding_handle *h,
    3955             :                                                          struct policy_handle *_bind_handle /* [in] [ref] */,
    3956             :                                                          uint32_t _level /* [in]  */,
    3957             :                                                          union drsuapi_DsGetMemberships2Request *_req /* [in] [ref,switch_is(level)] */,
    3958             :                                                          uint32_t *_level_out /* [out] [ref] */,
    3959             :                                                          union drsuapi_DsGetMemberships2Ctr *_ctr /* [out] [ref,switch_is(*level_out)] */)
    3960             : {
    3961           0 :         struct tevent_req *req;
    3962           0 :         struct dcerpc_drsuapi_DsGetMemberships2_state *state;
    3963           0 :         struct tevent_req *subreq;
    3964             : 
    3965           0 :         req = tevent_req_create(mem_ctx, &state,
    3966             :                                 struct dcerpc_drsuapi_DsGetMemberships2_state);
    3967           0 :         if (req == NULL) {
    3968           0 :                 return NULL;
    3969             :         }
    3970           0 :         state->out_mem_ctx = NULL;
    3971             : 
    3972             :         /* In parameters */
    3973           0 :         state->orig.in.bind_handle = _bind_handle;
    3974           0 :         state->orig.in.level = _level;
    3975           0 :         state->orig.in.req = _req;
    3976             : 
    3977             :         /* Out parameters */
    3978           0 :         state->orig.out.level_out = _level_out;
    3979           0 :         state->orig.out.ctr = _ctr;
    3980             : 
    3981             :         /* Result */
    3982           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3983             : 
    3984           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3985             :                              "dcerpc_drsuapi_DsGetMemberships2_out_memory");
    3986           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3987           0 :                 return tevent_req_post(req, ev);
    3988             :         }
    3989             : 
    3990             :         /* make a temporary copy, that we pass to the dispatch function */
    3991           0 :         state->tmp = state->orig;
    3992             : 
    3993           0 :         subreq = dcerpc_drsuapi_DsGetMemberships2_r_send(state, ev, h, &state->tmp);
    3994           0 :         if (tevent_req_nomem(subreq, req)) {
    3995           0 :                 return tevent_req_post(req, ev);
    3996             :         }
    3997           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_DsGetMemberships2_done, req);
    3998           0 :         return req;
    3999             : }
    4000             : 
    4001           0 : static void dcerpc_drsuapi_DsGetMemberships2_done(struct tevent_req *subreq)
    4002             : {
    4003           0 :         struct tevent_req *req = tevent_req_callback_data(
    4004             :                 subreq, struct tevent_req);
    4005           0 :         struct dcerpc_drsuapi_DsGetMemberships2_state *state = tevent_req_data(
    4006             :                 req, struct dcerpc_drsuapi_DsGetMemberships2_state);
    4007           0 :         NTSTATUS status;
    4008           0 :         TALLOC_CTX *mem_ctx;
    4009             : 
    4010           0 :         if (state->out_mem_ctx) {
    4011           0 :                 mem_ctx = state->out_mem_ctx;
    4012             :         } else {
    4013           0 :                 mem_ctx = state;
    4014             :         }
    4015             : 
    4016           0 :         status = dcerpc_drsuapi_DsGetMemberships2_r_recv(subreq, mem_ctx);
    4017           0 :         TALLOC_FREE(subreq);
    4018           0 :         if (tevent_req_nterror(req, status)) {
    4019           0 :                 return;
    4020             :         }
    4021             : 
    4022             :         /* Copy out parameters */
    4023           0 :         *state->orig.out.level_out = *state->tmp.out.level_out;
    4024           0 :         *state->orig.out.ctr = *state->tmp.out.ctr;
    4025             : 
    4026             :         /* Copy result */
    4027           0 :         state->orig.out.result = state->tmp.out.result;
    4028             : 
    4029             :         /* Reset temporary structure */
    4030           0 :         NDR_ZERO_STRUCT(state->tmp);
    4031             : 
    4032           0 :         tevent_req_done(req);
    4033             : }
    4034             : 
    4035           0 : NTSTATUS dcerpc_drsuapi_DsGetMemberships2_recv(struct tevent_req *req,
    4036             :                                                TALLOC_CTX *mem_ctx,
    4037             :                                                WERROR *result)
    4038             : {
    4039           0 :         struct dcerpc_drsuapi_DsGetMemberships2_state *state = tevent_req_data(
    4040             :                 req, struct dcerpc_drsuapi_DsGetMemberships2_state);
    4041           0 :         NTSTATUS status;
    4042             : 
    4043           0 :         if (tevent_req_is_nterror(req, &status)) {
    4044           0 :                 tevent_req_received(req);
    4045           0 :                 return status;
    4046             :         }
    4047             : 
    4048             :         /* Steal possible out parameters to the callers context */
    4049           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4050             : 
    4051             :         /* Return result */
    4052           0 :         *result = state->orig.out.result;
    4053             : 
    4054           0 :         tevent_req_received(req);
    4055           0 :         return NT_STATUS_OK;
    4056             : }
    4057             : 
    4058           0 : NTSTATUS dcerpc_drsuapi_DsGetMemberships2(struct dcerpc_binding_handle *h,
    4059             :                                           TALLOC_CTX *mem_ctx,
    4060             :                                           struct policy_handle *_bind_handle /* [in] [ref] */,
    4061             :                                           uint32_t _level /* [in]  */,
    4062             :                                           union drsuapi_DsGetMemberships2Request *_req /* [in] [ref,switch_is(level)] */,
    4063             :                                           uint32_t *_level_out /* [out] [ref] */,
    4064             :                                           union drsuapi_DsGetMemberships2Ctr *_ctr /* [out] [ref,switch_is(*level_out)] */,
    4065             :                                           WERROR *result)
    4066             : {
    4067           0 :         struct drsuapi_DsGetMemberships2 r;
    4068           0 :         NTSTATUS status;
    4069             : 
    4070             :         /* In parameters */
    4071           0 :         r.in.bind_handle = _bind_handle;
    4072           0 :         r.in.level = _level;
    4073           0 :         r.in.req = _req;
    4074             : 
    4075             :         /* Out parameters */
    4076           0 :         r.out.level_out = _level_out;
    4077           0 :         r.out.ctr = _ctr;
    4078             : 
    4079             :         /* Result */
    4080           0 :         NDR_ZERO_STRUCT(r.out.result);
    4081             : 
    4082           0 :         status = dcerpc_drsuapi_DsGetMemberships2_r(h, mem_ctx, &r);
    4083           0 :         if (!NT_STATUS_IS_OK(status)) {
    4084           0 :                 return status;
    4085             :         }
    4086             : 
    4087             :         /* Return variables */
    4088           0 :         *_level_out = *r.out.level_out;
    4089           0 :         *_ctr = *r.out.ctr;
    4090             : 
    4091             :         /* Return result */
    4092           0 :         *result = r.out.result;
    4093             : 
    4094           0 :         return NT_STATUS_OK;
    4095             : }
    4096             : 
    4097             : struct dcerpc_drsuapi_QuerySitesByCost_r_state {
    4098             :         TALLOC_CTX *out_mem_ctx;
    4099             : };
    4100             : 
    4101             : static void dcerpc_drsuapi_QuerySitesByCost_r_done(struct tevent_req *subreq);
    4102             : 
    4103           0 : struct tevent_req *dcerpc_drsuapi_QuerySitesByCost_r_send(TALLOC_CTX *mem_ctx,
    4104             :         struct tevent_context *ev,
    4105             :         struct dcerpc_binding_handle *h,
    4106             :         struct drsuapi_QuerySitesByCost *r)
    4107             : {
    4108           0 :         struct tevent_req *req;
    4109           0 :         struct dcerpc_drsuapi_QuerySitesByCost_r_state *state;
    4110           0 :         struct tevent_req *subreq;
    4111             : 
    4112           0 :         req = tevent_req_create(mem_ctx, &state,
    4113             :                                 struct dcerpc_drsuapi_QuerySitesByCost_r_state);
    4114           0 :         if (req == NULL) {
    4115           0 :                 return NULL;
    4116             :         }
    4117             : 
    4118           0 :         state->out_mem_ctx = talloc_new(state);
    4119           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    4120           0 :                 return tevent_req_post(req, ev);
    4121             :         }
    4122             : 
    4123           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    4124             :                         NULL, &ndr_table_drsuapi,
    4125           0 :                         NDR_DRSUAPI_QUERYSITESBYCOST, state->out_mem_ctx, r);
    4126           0 :         if (tevent_req_nomem(subreq, req)) {
    4127           0 :                 return tevent_req_post(req, ev);
    4128             :         }
    4129           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_QuerySitesByCost_r_done, req);
    4130             : 
    4131           0 :         return req;
    4132             : }
    4133             : 
    4134           0 : static void dcerpc_drsuapi_QuerySitesByCost_r_done(struct tevent_req *subreq)
    4135             : {
    4136           0 :         struct tevent_req *req =
    4137           0 :                 tevent_req_callback_data(subreq,
    4138             :                 struct tevent_req);
    4139           0 :         NTSTATUS status;
    4140             : 
    4141           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    4142           0 :         TALLOC_FREE(subreq);
    4143           0 :         if (tevent_req_nterror(req, status)) {
    4144           0 :                 return;
    4145             :         }
    4146             : 
    4147           0 :         tevent_req_done(req);
    4148             : }
    4149             : 
    4150           0 : NTSTATUS dcerpc_drsuapi_QuerySitesByCost_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    4151             : {
    4152           0 :         struct dcerpc_drsuapi_QuerySitesByCost_r_state *state =
    4153           0 :                 tevent_req_data(req,
    4154             :                 struct dcerpc_drsuapi_QuerySitesByCost_r_state);
    4155           0 :         NTSTATUS status;
    4156             : 
    4157           0 :         if (tevent_req_is_nterror(req, &status)) {
    4158           0 :                 tevent_req_received(req);
    4159           0 :                 return status;
    4160             :         }
    4161             : 
    4162           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4163             : 
    4164           0 :         tevent_req_received(req);
    4165           0 :         return NT_STATUS_OK;
    4166             : }
    4167             : 
    4168           0 : NTSTATUS dcerpc_drsuapi_QuerySitesByCost_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct drsuapi_QuerySitesByCost *r)
    4169             : {
    4170           0 :         NTSTATUS status;
    4171             : 
    4172           0 :         status = dcerpc_binding_handle_call(h,
    4173             :                         NULL, &ndr_table_drsuapi,
    4174             :                         NDR_DRSUAPI_QUERYSITESBYCOST, mem_ctx, r);
    4175             : 
    4176           0 :         return status;
    4177             : }
    4178             : 
    4179             : struct dcerpc_drsuapi_QuerySitesByCost_state {
    4180             :         struct drsuapi_QuerySitesByCost orig;
    4181             :         struct drsuapi_QuerySitesByCost tmp;
    4182             :         TALLOC_CTX *out_mem_ctx;
    4183             : };
    4184             : 
    4185             : static void dcerpc_drsuapi_QuerySitesByCost_done(struct tevent_req *subreq);
    4186             : 
    4187           0 : struct tevent_req *dcerpc_drsuapi_QuerySitesByCost_send(TALLOC_CTX *mem_ctx,
    4188             :                                                         struct tevent_context *ev,
    4189             :                                                         struct dcerpc_binding_handle *h,
    4190             :                                                         struct policy_handle *_bind_handle /* [in] [ref] */,
    4191             :                                                         uint32_t _level /* [in]  */,
    4192             :                                                         union drsuapi_QuerySitesByCostRequest *_req /* [in] [ref,switch_is(level)] */,
    4193             :                                                         uint32_t *_level_out /* [out] [ref] */,
    4194             :                                                         union drsuapi_QuerySitesByCostCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
    4195             : {
    4196           0 :         struct tevent_req *req;
    4197           0 :         struct dcerpc_drsuapi_QuerySitesByCost_state *state;
    4198           0 :         struct tevent_req *subreq;
    4199             : 
    4200           0 :         req = tevent_req_create(mem_ctx, &state,
    4201             :                                 struct dcerpc_drsuapi_QuerySitesByCost_state);
    4202           0 :         if (req == NULL) {
    4203           0 :                 return NULL;
    4204             :         }
    4205           0 :         state->out_mem_ctx = NULL;
    4206             : 
    4207             :         /* In parameters */
    4208           0 :         state->orig.in.bind_handle = _bind_handle;
    4209           0 :         state->orig.in.level = _level;
    4210           0 :         state->orig.in.req = _req;
    4211             : 
    4212             :         /* Out parameters */
    4213           0 :         state->orig.out.level_out = _level_out;
    4214           0 :         state->orig.out.ctr = _ctr;
    4215             : 
    4216             :         /* Result */
    4217           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    4218             : 
    4219           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    4220             :                              "dcerpc_drsuapi_QuerySitesByCost_out_memory");
    4221           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    4222           0 :                 return tevent_req_post(req, ev);
    4223             :         }
    4224             : 
    4225             :         /* make a temporary copy, that we pass to the dispatch function */
    4226           0 :         state->tmp = state->orig;
    4227             : 
    4228           0 :         subreq = dcerpc_drsuapi_QuerySitesByCost_r_send(state, ev, h, &state->tmp);
    4229           0 :         if (tevent_req_nomem(subreq, req)) {
    4230           0 :                 return tevent_req_post(req, ev);
    4231             :         }
    4232           0 :         tevent_req_set_callback(subreq, dcerpc_drsuapi_QuerySitesByCost_done, req);
    4233           0 :         return req;
    4234             : }
    4235             : 
    4236           0 : static void dcerpc_drsuapi_QuerySitesByCost_done(struct tevent_req *subreq)
    4237             : {
    4238           0 :         struct tevent_req *req = tevent_req_callback_data(
    4239             :                 subreq, struct tevent_req);
    4240           0 :         struct dcerpc_drsuapi_QuerySitesByCost_state *state = tevent_req_data(
    4241             :                 req, struct dcerpc_drsuapi_QuerySitesByCost_state);
    4242           0 :         NTSTATUS status;
    4243           0 :         TALLOC_CTX *mem_ctx;
    4244             : 
    4245           0 :         if (state->out_mem_ctx) {
    4246           0 :                 mem_ctx = state->out_mem_ctx;
    4247             :         } else {
    4248           0 :                 mem_ctx = state;
    4249             :         }
    4250             : 
    4251           0 :         status = dcerpc_drsuapi_QuerySitesByCost_r_recv(subreq, mem_ctx);
    4252           0 :         TALLOC_FREE(subreq);
    4253           0 :         if (tevent_req_nterror(req, status)) {
    4254           0 :                 return;
    4255             :         }
    4256             : 
    4257             :         /* Copy out parameters */
    4258           0 :         *state->orig.out.level_out = *state->tmp.out.level_out;
    4259           0 :         *state->orig.out.ctr = *state->tmp.out.ctr;
    4260             : 
    4261             :         /* Copy result */
    4262           0 :         state->orig.out.result = state->tmp.out.result;
    4263             : 
    4264             :         /* Reset temporary structure */
    4265           0 :         NDR_ZERO_STRUCT(state->tmp);
    4266             : 
    4267           0 :         tevent_req_done(req);
    4268             : }
    4269             : 
    4270           0 : NTSTATUS dcerpc_drsuapi_QuerySitesByCost_recv(struct tevent_req *req,
    4271             :                                               TALLOC_CTX *mem_ctx,
    4272             :                                               WERROR *result)
    4273             : {
    4274           0 :         struct dcerpc_drsuapi_QuerySitesByCost_state *state = tevent_req_data(
    4275             :                 req, struct dcerpc_drsuapi_QuerySitesByCost_state);
    4276           0 :         NTSTATUS status;
    4277             : 
    4278           0 :         if (tevent_req_is_nterror(req, &status)) {
    4279           0 :                 tevent_req_received(req);
    4280           0 :                 return status;
    4281             :         }
    4282             : 
    4283             :         /* Steal possible out parameters to the callers context */
    4284           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4285             : 
    4286             :         /* Return result */
    4287           0 :         *result = state->orig.out.result;
    4288             : 
    4289           0 :         tevent_req_received(req);
    4290           0 :         return NT_STATUS_OK;
    4291             : }
    4292             : 
    4293           0 : NTSTATUS dcerpc_drsuapi_QuerySitesByCost(struct dcerpc_binding_handle *h,
    4294             :                                          TALLOC_CTX *mem_ctx,
    4295             :                                          struct policy_handle *_bind_handle /* [in] [ref] */,
    4296             :                                          uint32_t _level /* [in]  */,
    4297             :                                          union drsuapi_QuerySitesByCostRequest *_req /* [in] [ref,switch_is(level)] */,
    4298             :                                          uint32_t *_level_out /* [out] [ref] */,
    4299             :                                          union drsuapi_QuerySitesByCostCtr *_ctr /* [out] [ref,switch_is(*level_out)] */,
    4300             :                                          WERROR *result)
    4301             : {
    4302           0 :         struct drsuapi_QuerySitesByCost r;
    4303           0 :         NTSTATUS status;
    4304             : 
    4305             :         /* In parameters */
    4306           0 :         r.in.bind_handle = _bind_handle;
    4307           0 :         r.in.level = _level;
    4308           0 :         r.in.req = _req;
    4309             : 
    4310             :         /* Out parameters */
    4311           0 :         r.out.level_out = _level_out;
    4312           0 :         r.out.ctr = _ctr;
    4313             : 
    4314             :         /* Result */
    4315           0 :         NDR_ZERO_STRUCT(r.out.result);
    4316             : 
    4317           0 :         status = dcerpc_drsuapi_QuerySitesByCost_r(h, mem_ctx, &r);
    4318           0 :         if (!NT_STATUS_IS_OK(status)) {
    4319           0 :                 return status;
    4320             :         }
    4321             : 
    4322             :         /* Return variables */
    4323           0 :         *_level_out = *r.out.level_out;
    4324           0 :         *_ctr = *r.out.ctr;
    4325             : 
    4326             :         /* Return result */
    4327           0 :         *result = r.out.result;
    4328             : 
    4329           0 :         return NT_STATUS_OK;
    4330             : }
    4331             : 

Generated by: LCOV version 1.14