LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_samr_c.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 983 5758 17.1 %
Date: 2021-09-23 10:06:22 Functions: 148 544 27.2 %

          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_samr.h"
       7             : #include "bin/default/librpc/gen_ndr/ndr_samr_c.h"
       8             : 
       9             : /* samr - client functions generated by pidl */
      10             : 
      11             : struct dcerpc_samr_Connect_r_state {
      12             :         TALLOC_CTX *out_mem_ctx;
      13             : };
      14             : 
      15             : static void dcerpc_samr_Connect_r_done(struct tevent_req *subreq);
      16             : 
      17          12 : struct tevent_req *dcerpc_samr_Connect_r_send(TALLOC_CTX *mem_ctx,
      18             :         struct tevent_context *ev,
      19             :         struct dcerpc_binding_handle *h,
      20             :         struct samr_Connect *r)
      21             : {
      22             :         struct tevent_req *req;
      23             :         struct dcerpc_samr_Connect_r_state *state;
      24             :         struct tevent_req *subreq;
      25             : 
      26          12 :         req = tevent_req_create(mem_ctx, &state,
      27             :                                 struct dcerpc_samr_Connect_r_state);
      28          12 :         if (req == NULL) {
      29           0 :                 return NULL;
      30             :         }
      31             : 
      32          12 :         state->out_mem_ctx = talloc_new(state);
      33          12 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
      34           0 :                 return tevent_req_post(req, ev);
      35             :         }
      36             : 
      37          12 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
      38             :                         NULL, &ndr_table_samr,
      39          12 :                         NDR_SAMR_CONNECT, state->out_mem_ctx, r);
      40          12 :         if (tevent_req_nomem(subreq, req)) {
      41           0 :                 return tevent_req_post(req, ev);
      42             :         }
      43          12 :         tevent_req_set_callback(subreq, dcerpc_samr_Connect_r_done, req);
      44             : 
      45          12 :         return req;
      46             : }
      47             : 
      48          12 : static void dcerpc_samr_Connect_r_done(struct tevent_req *subreq)
      49             : {
      50          12 :         struct tevent_req *req =
      51          12 :                 tevent_req_callback_data(subreq,
      52             :                 struct tevent_req);
      53             :         NTSTATUS status;
      54             : 
      55          12 :         status = dcerpc_binding_handle_call_recv(subreq);
      56          12 :         TALLOC_FREE(subreq);
      57          12 :         if (tevent_req_nterror(req, status)) {
      58           0 :                 return;
      59             :         }
      60             : 
      61          12 :         tevent_req_done(req);
      62             : }
      63             : 
      64          12 : NTSTATUS dcerpc_samr_Connect_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
      65             : {
      66          12 :         struct dcerpc_samr_Connect_r_state *state =
      67          12 :                 tevent_req_data(req,
      68             :                 struct dcerpc_samr_Connect_r_state);
      69             :         NTSTATUS status;
      70             : 
      71          12 :         if (tevent_req_is_nterror(req, &status)) {
      72           0 :                 tevent_req_received(req);
      73           0 :                 return status;
      74             :         }
      75             : 
      76          12 :         talloc_steal(mem_ctx, state->out_mem_ctx);
      77             : 
      78          12 :         tevent_req_received(req);
      79          12 :         return NT_STATUS_OK;
      80             : }
      81             : 
      82        1660 : NTSTATUS dcerpc_samr_Connect_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_Connect *r)
      83             : {
      84             :         NTSTATUS status;
      85             : 
      86        1660 :         status = dcerpc_binding_handle_call(h,
      87             :                         NULL, &ndr_table_samr,
      88             :                         NDR_SAMR_CONNECT, mem_ctx, r);
      89             : 
      90        1660 :         return status;
      91             : }
      92             : 
      93             : struct dcerpc_samr_Connect_state {
      94             :         struct samr_Connect orig;
      95             :         struct samr_Connect tmp;
      96             :         TALLOC_CTX *out_mem_ctx;
      97             : };
      98             : 
      99             : static void dcerpc_samr_Connect_done(struct tevent_req *subreq);
     100             : 
     101           0 : struct tevent_req *dcerpc_samr_Connect_send(TALLOC_CTX *mem_ctx,
     102             :                                             struct tevent_context *ev,
     103             :                                             struct dcerpc_binding_handle *h,
     104             :                                             uint16_t *_system_name /* [in] [unique] */,
     105             :                                             uint32_t _access_mask /* [in]  */,
     106             :                                             struct policy_handle *_connect_handle /* [out] [ref] */)
     107             : {
     108             :         struct tevent_req *req;
     109             :         struct dcerpc_samr_Connect_state *state;
     110             :         struct tevent_req *subreq;
     111             : 
     112           0 :         req = tevent_req_create(mem_ctx, &state,
     113             :                                 struct dcerpc_samr_Connect_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.system_name = _system_name;
     121           0 :         state->orig.in.access_mask = _access_mask;
     122             : 
     123             :         /* Out parameters */
     124           0 :         state->orig.out.connect_handle = _connect_handle;
     125             : 
     126             :         /* Result */
     127           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     128             : 
     129           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     130             :                              "dcerpc_samr_Connect_out_memory");
     131           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     132           0 :                 return tevent_req_post(req, ev);
     133             :         }
     134             : 
     135             :         /* make a temporary copy, that we pass to the dispatch function */
     136           0 :         state->tmp = state->orig;
     137             : 
     138           0 :         subreq = dcerpc_samr_Connect_r_send(state, ev, h, &state->tmp);
     139           0 :         if (tevent_req_nomem(subreq, req)) {
     140           0 :                 return tevent_req_post(req, ev);
     141             :         }
     142           0 :         tevent_req_set_callback(subreq, dcerpc_samr_Connect_done, req);
     143           0 :         return req;
     144             : }
     145             : 
     146           0 : static void dcerpc_samr_Connect_done(struct tevent_req *subreq)
     147             : {
     148           0 :         struct tevent_req *req = tevent_req_callback_data(
     149             :                 subreq, struct tevent_req);
     150           0 :         struct dcerpc_samr_Connect_state *state = tevent_req_data(
     151             :                 req, struct dcerpc_samr_Connect_state);
     152             :         NTSTATUS status;
     153             :         TALLOC_CTX *mem_ctx;
     154             : 
     155           0 :         if (state->out_mem_ctx) {
     156           0 :                 mem_ctx = state->out_mem_ctx;
     157             :         } else {
     158           0 :                 mem_ctx = state;
     159             :         }
     160             : 
     161           0 :         status = dcerpc_samr_Connect_r_recv(subreq, mem_ctx);
     162           0 :         TALLOC_FREE(subreq);
     163           0 :         if (tevent_req_nterror(req, status)) {
     164           0 :                 return;
     165             :         }
     166             : 
     167             :         /* Copy out parameters */
     168           0 :         *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
     169             : 
     170             :         /* Copy result */
     171           0 :         state->orig.out.result = state->tmp.out.result;
     172             : 
     173             :         /* Reset temporary structure */
     174           0 :         NDR_ZERO_STRUCT(state->tmp);
     175             : 
     176           0 :         tevent_req_done(req);
     177             : }
     178             : 
     179           0 : NTSTATUS dcerpc_samr_Connect_recv(struct tevent_req *req,
     180             :                                   TALLOC_CTX *mem_ctx,
     181             :                                   NTSTATUS *result)
     182             : {
     183           0 :         struct dcerpc_samr_Connect_state *state = tevent_req_data(
     184             :                 req, struct dcerpc_samr_Connect_state);
     185             :         NTSTATUS status;
     186             : 
     187           0 :         if (tevent_req_is_nterror(req, &status)) {
     188           0 :                 tevent_req_received(req);
     189           0 :                 return status;
     190             :         }
     191             : 
     192             :         /* Steal possible out parameters to the callers context */
     193           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     194             : 
     195             :         /* Return result */
     196           0 :         *result = state->orig.out.result;
     197             : 
     198           0 :         tevent_req_received(req);
     199           0 :         return NT_STATUS_OK;
     200             : }
     201             : 
     202           0 : NTSTATUS dcerpc_samr_Connect(struct dcerpc_binding_handle *h,
     203             :                              TALLOC_CTX *mem_ctx,
     204             :                              uint16_t *_system_name /* [in] [unique] */,
     205             :                              uint32_t _access_mask /* [in]  */,
     206             :                              struct policy_handle *_connect_handle /* [out] [ref] */,
     207             :                              NTSTATUS *result)
     208             : {
     209             :         struct samr_Connect r;
     210             :         NTSTATUS status;
     211             : 
     212             :         /* In parameters */
     213           0 :         r.in.system_name = _system_name;
     214           0 :         r.in.access_mask = _access_mask;
     215             : 
     216             :         /* Out parameters */
     217           0 :         r.out.connect_handle = _connect_handle;
     218             : 
     219             :         /* Result */
     220           0 :         NDR_ZERO_STRUCT(r.out.result);
     221             : 
     222           0 :         status = dcerpc_samr_Connect_r(h, mem_ctx, &r);
     223           0 :         if (!NT_STATUS_IS_OK(status)) {
     224           0 :                 return status;
     225             :         }
     226             : 
     227             :         /* Return variables */
     228           0 :         *_connect_handle = *r.out.connect_handle;
     229             : 
     230             :         /* Return result */
     231           0 :         *result = r.out.result;
     232             : 
     233           0 :         return NT_STATUS_OK;
     234             : }
     235             : 
     236             : struct dcerpc_samr_Close_r_state {
     237             :         TALLOC_CTX *out_mem_ctx;
     238             : };
     239             : 
     240             : static void dcerpc_samr_Close_r_done(struct tevent_req *subreq);
     241             : 
     242          41 : struct tevent_req *dcerpc_samr_Close_r_send(TALLOC_CTX *mem_ctx,
     243             :         struct tevent_context *ev,
     244             :         struct dcerpc_binding_handle *h,
     245             :         struct samr_Close *r)
     246             : {
     247             :         struct tevent_req *req;
     248             :         struct dcerpc_samr_Close_r_state *state;
     249             :         struct tevent_req *subreq;
     250             : 
     251          41 :         req = tevent_req_create(mem_ctx, &state,
     252             :                                 struct dcerpc_samr_Close_r_state);
     253          41 :         if (req == NULL) {
     254           0 :                 return NULL;
     255             :         }
     256             : 
     257          41 :         state->out_mem_ctx = talloc_new(state);
     258          41 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     259           0 :                 return tevent_req_post(req, ev);
     260             :         }
     261             : 
     262          41 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     263             :                         NULL, &ndr_table_samr,
     264          41 :                         NDR_SAMR_CLOSE, state->out_mem_ctx, r);
     265          41 :         if (tevent_req_nomem(subreq, req)) {
     266           0 :                 return tevent_req_post(req, ev);
     267             :         }
     268          41 :         tevent_req_set_callback(subreq, dcerpc_samr_Close_r_done, req);
     269             : 
     270          41 :         return req;
     271             : }
     272             : 
     273          41 : static void dcerpc_samr_Close_r_done(struct tevent_req *subreq)
     274             : {
     275          41 :         struct tevent_req *req =
     276          41 :                 tevent_req_callback_data(subreq,
     277             :                 struct tevent_req);
     278             :         NTSTATUS status;
     279             : 
     280          41 :         status = dcerpc_binding_handle_call_recv(subreq);
     281          41 :         TALLOC_FREE(subreq);
     282          41 :         if (tevent_req_nterror(req, status)) {
     283           0 :                 return;
     284             :         }
     285             : 
     286          41 :         tevent_req_done(req);
     287             : }
     288             : 
     289          41 : NTSTATUS dcerpc_samr_Close_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     290             : {
     291          41 :         struct dcerpc_samr_Close_r_state *state =
     292          41 :                 tevent_req_data(req,
     293             :                 struct dcerpc_samr_Close_r_state);
     294             :         NTSTATUS status;
     295             : 
     296          41 :         if (tevent_req_is_nterror(req, &status)) {
     297           0 :                 tevent_req_received(req);
     298           0 :                 return status;
     299             :         }
     300             : 
     301          41 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     302             : 
     303          41 :         tevent_req_received(req);
     304          41 :         return NT_STATUS_OK;
     305             : }
     306             : 
     307        8298 : NTSTATUS dcerpc_samr_Close_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_Close *r)
     308             : {
     309             :         NTSTATUS status;
     310             : 
     311        8298 :         status = dcerpc_binding_handle_call(h,
     312             :                         NULL, &ndr_table_samr,
     313             :                         NDR_SAMR_CLOSE, mem_ctx, r);
     314             : 
     315        8298 :         return status;
     316             : }
     317             : 
     318             : struct dcerpc_samr_Close_state {
     319             :         struct samr_Close orig;
     320             :         struct samr_Close tmp;
     321             :         TALLOC_CTX *out_mem_ctx;
     322             : };
     323             : 
     324             : static void dcerpc_samr_Close_done(struct tevent_req *subreq);
     325             : 
     326           0 : struct tevent_req *dcerpc_samr_Close_send(TALLOC_CTX *mem_ctx,
     327             :                                           struct tevent_context *ev,
     328             :                                           struct dcerpc_binding_handle *h,
     329             :                                           struct policy_handle *_handle /* [in,out] [ref] */)
     330             : {
     331             :         struct tevent_req *req;
     332             :         struct dcerpc_samr_Close_state *state;
     333             :         struct tevent_req *subreq;
     334             : 
     335           0 :         req = tevent_req_create(mem_ctx, &state,
     336             :                                 struct dcerpc_samr_Close_state);
     337           0 :         if (req == NULL) {
     338           0 :                 return NULL;
     339             :         }
     340           0 :         state->out_mem_ctx = NULL;
     341             : 
     342             :         /* In parameters */
     343           0 :         state->orig.in.handle = _handle;
     344             : 
     345             :         /* Out parameters */
     346           0 :         state->orig.out.handle = _handle;
     347             : 
     348             :         /* Result */
     349           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     350             : 
     351           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     352             :                              "dcerpc_samr_Close_out_memory");
     353           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     354           0 :                 return tevent_req_post(req, ev);
     355             :         }
     356             : 
     357             :         /* make a temporary copy, that we pass to the dispatch function */
     358           0 :         state->tmp = state->orig;
     359             : 
     360           0 :         subreq = dcerpc_samr_Close_r_send(state, ev, h, &state->tmp);
     361           0 :         if (tevent_req_nomem(subreq, req)) {
     362           0 :                 return tevent_req_post(req, ev);
     363             :         }
     364           0 :         tevent_req_set_callback(subreq, dcerpc_samr_Close_done, req);
     365           0 :         return req;
     366             : }
     367             : 
     368           0 : static void dcerpc_samr_Close_done(struct tevent_req *subreq)
     369             : {
     370           0 :         struct tevent_req *req = tevent_req_callback_data(
     371             :                 subreq, struct tevent_req);
     372           0 :         struct dcerpc_samr_Close_state *state = tevent_req_data(
     373             :                 req, struct dcerpc_samr_Close_state);
     374             :         NTSTATUS status;
     375             :         TALLOC_CTX *mem_ctx;
     376             : 
     377           0 :         if (state->out_mem_ctx) {
     378           0 :                 mem_ctx = state->out_mem_ctx;
     379             :         } else {
     380           0 :                 mem_ctx = state;
     381             :         }
     382             : 
     383           0 :         status = dcerpc_samr_Close_r_recv(subreq, mem_ctx);
     384           0 :         TALLOC_FREE(subreq);
     385           0 :         if (tevent_req_nterror(req, status)) {
     386           0 :                 return;
     387             :         }
     388             : 
     389             :         /* Copy out parameters */
     390           0 :         *state->orig.out.handle = *state->tmp.out.handle;
     391             : 
     392             :         /* Copy result */
     393           0 :         state->orig.out.result = state->tmp.out.result;
     394             : 
     395             :         /* Reset temporary structure */
     396           0 :         NDR_ZERO_STRUCT(state->tmp);
     397             : 
     398           0 :         tevent_req_done(req);
     399             : }
     400             : 
     401           0 : NTSTATUS dcerpc_samr_Close_recv(struct tevent_req *req,
     402             :                                 TALLOC_CTX *mem_ctx,
     403             :                                 NTSTATUS *result)
     404             : {
     405           0 :         struct dcerpc_samr_Close_state *state = tevent_req_data(
     406             :                 req, struct dcerpc_samr_Close_state);
     407             :         NTSTATUS status;
     408             : 
     409           0 :         if (tevent_req_is_nterror(req, &status)) {
     410           0 :                 tevent_req_received(req);
     411           0 :                 return status;
     412             :         }
     413             : 
     414             :         /* Steal possible out parameters to the callers context */
     415           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     416             : 
     417             :         /* Return result */
     418           0 :         *result = state->orig.out.result;
     419             : 
     420           0 :         tevent_req_received(req);
     421           0 :         return NT_STATUS_OK;
     422             : }
     423             : 
     424        2060 : NTSTATUS dcerpc_samr_Close(struct dcerpc_binding_handle *h,
     425             :                            TALLOC_CTX *mem_ctx,
     426             :                            struct policy_handle *_handle /* [in,out] [ref] */,
     427             :                            NTSTATUS *result)
     428             : {
     429             :         struct samr_Close r;
     430             :         NTSTATUS status;
     431             : 
     432             :         /* In parameters */
     433        2060 :         r.in.handle = _handle;
     434             : 
     435             :         /* Out parameters */
     436        2060 :         r.out.handle = _handle;
     437             : 
     438             :         /* Result */
     439        2060 :         NDR_ZERO_STRUCT(r.out.result);
     440             : 
     441        2060 :         status = dcerpc_samr_Close_r(h, mem_ctx, &r);
     442        2060 :         if (!NT_STATUS_IS_OK(status)) {
     443           0 :                 return status;
     444             :         }
     445             : 
     446             :         /* Return variables */
     447        2060 :         *_handle = *r.out.handle;
     448             : 
     449             :         /* Return result */
     450        2060 :         *result = r.out.result;
     451             : 
     452        2060 :         return NT_STATUS_OK;
     453             : }
     454             : 
     455             : struct dcerpc_samr_SetSecurity_r_state {
     456             :         TALLOC_CTX *out_mem_ctx;
     457             : };
     458             : 
     459             : static void dcerpc_samr_SetSecurity_r_done(struct tevent_req *subreq);
     460             : 
     461           0 : struct tevent_req *dcerpc_samr_SetSecurity_r_send(TALLOC_CTX *mem_ctx,
     462             :         struct tevent_context *ev,
     463             :         struct dcerpc_binding_handle *h,
     464             :         struct samr_SetSecurity *r)
     465             : {
     466             :         struct tevent_req *req;
     467             :         struct dcerpc_samr_SetSecurity_r_state *state;
     468             :         struct tevent_req *subreq;
     469             : 
     470           0 :         req = tevent_req_create(mem_ctx, &state,
     471             :                                 struct dcerpc_samr_SetSecurity_r_state);
     472           0 :         if (req == NULL) {
     473           0 :                 return NULL;
     474             :         }
     475             : 
     476           0 :         state->out_mem_ctx = NULL;
     477             : 
     478           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     479             :                         NULL, &ndr_table_samr,
     480             :                         NDR_SAMR_SETSECURITY, state, r);
     481           0 :         if (tevent_req_nomem(subreq, req)) {
     482           0 :                 return tevent_req_post(req, ev);
     483             :         }
     484           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetSecurity_r_done, req);
     485             : 
     486           0 :         return req;
     487             : }
     488             : 
     489           0 : static void dcerpc_samr_SetSecurity_r_done(struct tevent_req *subreq)
     490             : {
     491           0 :         struct tevent_req *req =
     492           0 :                 tevent_req_callback_data(subreq,
     493             :                 struct tevent_req);
     494             :         NTSTATUS status;
     495             : 
     496           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     497           0 :         TALLOC_FREE(subreq);
     498           0 :         if (tevent_req_nterror(req, status)) {
     499           0 :                 return;
     500             :         }
     501             : 
     502           0 :         tevent_req_done(req);
     503             : }
     504             : 
     505           0 : NTSTATUS dcerpc_samr_SetSecurity_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     506             : {
     507           0 :         struct dcerpc_samr_SetSecurity_r_state *state =
     508           0 :                 tevent_req_data(req,
     509             :                 struct dcerpc_samr_SetSecurity_r_state);
     510             :         NTSTATUS status;
     511             : 
     512           0 :         if (tevent_req_is_nterror(req, &status)) {
     513           0 :                 tevent_req_received(req);
     514           0 :                 return status;
     515             :         }
     516             : 
     517           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     518             : 
     519           0 :         tevent_req_received(req);
     520           0 :         return NT_STATUS_OK;
     521             : }
     522             : 
     523           6 : NTSTATUS dcerpc_samr_SetSecurity_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_SetSecurity *r)
     524             : {
     525             :         NTSTATUS status;
     526             : 
     527           6 :         status = dcerpc_binding_handle_call(h,
     528             :                         NULL, &ndr_table_samr,
     529             :                         NDR_SAMR_SETSECURITY, mem_ctx, r);
     530             : 
     531           6 :         return status;
     532             : }
     533             : 
     534             : struct dcerpc_samr_SetSecurity_state {
     535             :         struct samr_SetSecurity orig;
     536             :         struct samr_SetSecurity tmp;
     537             :         TALLOC_CTX *out_mem_ctx;
     538             : };
     539             : 
     540             : static void dcerpc_samr_SetSecurity_done(struct tevent_req *subreq);
     541             : 
     542           0 : struct tevent_req *dcerpc_samr_SetSecurity_send(TALLOC_CTX *mem_ctx,
     543             :                                                 struct tevent_context *ev,
     544             :                                                 struct dcerpc_binding_handle *h,
     545             :                                                 struct policy_handle *_handle /* [in] [ref] */,
     546             :                                                 uint32_t _sec_info /* [in]  */,
     547             :                                                 struct sec_desc_buf *_sdbuf /* [in] [ref] */)
     548             : {
     549             :         struct tevent_req *req;
     550             :         struct dcerpc_samr_SetSecurity_state *state;
     551             :         struct tevent_req *subreq;
     552             : 
     553           0 :         req = tevent_req_create(mem_ctx, &state,
     554             :                                 struct dcerpc_samr_SetSecurity_state);
     555           0 :         if (req == NULL) {
     556           0 :                 return NULL;
     557             :         }
     558           0 :         state->out_mem_ctx = NULL;
     559             : 
     560             :         /* In parameters */
     561           0 :         state->orig.in.handle = _handle;
     562           0 :         state->orig.in.sec_info = _sec_info;
     563           0 :         state->orig.in.sdbuf = _sdbuf;
     564             : 
     565             :         /* Out parameters */
     566             : 
     567             :         /* Result */
     568           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     569             : 
     570             :         /* make a temporary copy, that we pass to the dispatch function */
     571           0 :         state->tmp = state->orig;
     572             : 
     573           0 :         subreq = dcerpc_samr_SetSecurity_r_send(state, ev, h, &state->tmp);
     574           0 :         if (tevent_req_nomem(subreq, req)) {
     575           0 :                 return tevent_req_post(req, ev);
     576             :         }
     577           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetSecurity_done, req);
     578           0 :         return req;
     579             : }
     580             : 
     581           0 : static void dcerpc_samr_SetSecurity_done(struct tevent_req *subreq)
     582             : {
     583           0 :         struct tevent_req *req = tevent_req_callback_data(
     584             :                 subreq, struct tevent_req);
     585           0 :         struct dcerpc_samr_SetSecurity_state *state = tevent_req_data(
     586             :                 req, struct dcerpc_samr_SetSecurity_state);
     587             :         NTSTATUS status;
     588             :         TALLOC_CTX *mem_ctx;
     589             : 
     590           0 :         if (state->out_mem_ctx) {
     591           0 :                 mem_ctx = state->out_mem_ctx;
     592             :         } else {
     593           0 :                 mem_ctx = state;
     594             :         }
     595             : 
     596           0 :         status = dcerpc_samr_SetSecurity_r_recv(subreq, mem_ctx);
     597           0 :         TALLOC_FREE(subreq);
     598           0 :         if (tevent_req_nterror(req, status)) {
     599           0 :                 return;
     600             :         }
     601             : 
     602             :         /* Copy out parameters */
     603             : 
     604             :         /* Copy result */
     605           0 :         state->orig.out.result = state->tmp.out.result;
     606             : 
     607             :         /* Reset temporary structure */
     608           0 :         NDR_ZERO_STRUCT(state->tmp);
     609             : 
     610           0 :         tevent_req_done(req);
     611             : }
     612             : 
     613           0 : NTSTATUS dcerpc_samr_SetSecurity_recv(struct tevent_req *req,
     614             :                                       TALLOC_CTX *mem_ctx,
     615             :                                       NTSTATUS *result)
     616             : {
     617           0 :         struct dcerpc_samr_SetSecurity_state *state = tevent_req_data(
     618             :                 req, struct dcerpc_samr_SetSecurity_state);
     619             :         NTSTATUS status;
     620             : 
     621           0 :         if (tevent_req_is_nterror(req, &status)) {
     622           0 :                 tevent_req_received(req);
     623           0 :                 return status;
     624             :         }
     625             : 
     626             :         /* Steal possible out parameters to the callers context */
     627           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     628             : 
     629             :         /* Return result */
     630           0 :         *result = state->orig.out.result;
     631             : 
     632           0 :         tevent_req_received(req);
     633           0 :         return NT_STATUS_OK;
     634             : }
     635             : 
     636           0 : NTSTATUS dcerpc_samr_SetSecurity(struct dcerpc_binding_handle *h,
     637             :                                  TALLOC_CTX *mem_ctx,
     638             :                                  struct policy_handle *_handle /* [in] [ref] */,
     639             :                                  uint32_t _sec_info /* [in]  */,
     640             :                                  struct sec_desc_buf *_sdbuf /* [in] [ref] */,
     641             :                                  NTSTATUS *result)
     642             : {
     643             :         struct samr_SetSecurity r;
     644             :         NTSTATUS status;
     645             : 
     646             :         /* In parameters */
     647           0 :         r.in.handle = _handle;
     648           0 :         r.in.sec_info = _sec_info;
     649           0 :         r.in.sdbuf = _sdbuf;
     650             : 
     651             :         /* Out parameters */
     652             : 
     653             :         /* Result */
     654           0 :         NDR_ZERO_STRUCT(r.out.result);
     655             : 
     656           0 :         status = dcerpc_samr_SetSecurity_r(h, mem_ctx, &r);
     657           0 :         if (!NT_STATUS_IS_OK(status)) {
     658           0 :                 return status;
     659             :         }
     660             : 
     661             :         /* Return variables */
     662             : 
     663             :         /* Return result */
     664           0 :         *result = r.out.result;
     665             : 
     666           0 :         return NT_STATUS_OK;
     667             : }
     668             : 
     669             : struct dcerpc_samr_QuerySecurity_r_state {
     670             :         TALLOC_CTX *out_mem_ctx;
     671             : };
     672             : 
     673             : static void dcerpc_samr_QuerySecurity_r_done(struct tevent_req *subreq);
     674             : 
     675           0 : struct tevent_req *dcerpc_samr_QuerySecurity_r_send(TALLOC_CTX *mem_ctx,
     676             :         struct tevent_context *ev,
     677             :         struct dcerpc_binding_handle *h,
     678             :         struct samr_QuerySecurity *r)
     679             : {
     680             :         struct tevent_req *req;
     681             :         struct dcerpc_samr_QuerySecurity_r_state *state;
     682             :         struct tevent_req *subreq;
     683             : 
     684           0 :         req = tevent_req_create(mem_ctx, &state,
     685             :                                 struct dcerpc_samr_QuerySecurity_r_state);
     686           0 :         if (req == NULL) {
     687           0 :                 return NULL;
     688             :         }
     689             : 
     690           0 :         state->out_mem_ctx = talloc_new(state);
     691           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     692           0 :                 return tevent_req_post(req, ev);
     693             :         }
     694             : 
     695           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     696             :                         NULL, &ndr_table_samr,
     697           0 :                         NDR_SAMR_QUERYSECURITY, state->out_mem_ctx, r);
     698           0 :         if (tevent_req_nomem(subreq, req)) {
     699           0 :                 return tevent_req_post(req, ev);
     700             :         }
     701           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QuerySecurity_r_done, req);
     702             : 
     703           0 :         return req;
     704             : }
     705             : 
     706           0 : static void dcerpc_samr_QuerySecurity_r_done(struct tevent_req *subreq)
     707             : {
     708           0 :         struct tevent_req *req =
     709           0 :                 tevent_req_callback_data(subreq,
     710             :                 struct tevent_req);
     711             :         NTSTATUS status;
     712             : 
     713           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     714           0 :         TALLOC_FREE(subreq);
     715           0 :         if (tevent_req_nterror(req, status)) {
     716           0 :                 return;
     717             :         }
     718             : 
     719           0 :         tevent_req_done(req);
     720             : }
     721             : 
     722           0 : NTSTATUS dcerpc_samr_QuerySecurity_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     723             : {
     724           0 :         struct dcerpc_samr_QuerySecurity_r_state *state =
     725           0 :                 tevent_req_data(req,
     726             :                 struct dcerpc_samr_QuerySecurity_r_state);
     727             :         NTSTATUS status;
     728             : 
     729           0 :         if (tevent_req_is_nterror(req, &status)) {
     730           0 :                 tevent_req_received(req);
     731           0 :                 return status;
     732             :         }
     733             : 
     734           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     735             : 
     736           0 :         tevent_req_received(req);
     737           0 :         return NT_STATUS_OK;
     738             : }
     739             : 
     740         290 : NTSTATUS dcerpc_samr_QuerySecurity_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_QuerySecurity *r)
     741             : {
     742             :         NTSTATUS status;
     743             : 
     744         290 :         status = dcerpc_binding_handle_call(h,
     745             :                         NULL, &ndr_table_samr,
     746             :                         NDR_SAMR_QUERYSECURITY, mem_ctx, r);
     747             : 
     748         290 :         return status;
     749             : }
     750             : 
     751             : struct dcerpc_samr_QuerySecurity_state {
     752             :         struct samr_QuerySecurity orig;
     753             :         struct samr_QuerySecurity tmp;
     754             :         TALLOC_CTX *out_mem_ctx;
     755             : };
     756             : 
     757             : static void dcerpc_samr_QuerySecurity_done(struct tevent_req *subreq);
     758             : 
     759           0 : struct tevent_req *dcerpc_samr_QuerySecurity_send(TALLOC_CTX *mem_ctx,
     760             :                                                   struct tevent_context *ev,
     761             :                                                   struct dcerpc_binding_handle *h,
     762             :                                                   struct policy_handle *_handle /* [in] [ref] */,
     763             :                                                   uint32_t _sec_info /* [in]  */,
     764             :                                                   struct sec_desc_buf **_sdbuf /* [out] [ref] */)
     765             : {
     766             :         struct tevent_req *req;
     767             :         struct dcerpc_samr_QuerySecurity_state *state;
     768             :         struct tevent_req *subreq;
     769             : 
     770           0 :         req = tevent_req_create(mem_ctx, &state,
     771             :                                 struct dcerpc_samr_QuerySecurity_state);
     772           0 :         if (req == NULL) {
     773           0 :                 return NULL;
     774             :         }
     775           0 :         state->out_mem_ctx = NULL;
     776             : 
     777             :         /* In parameters */
     778           0 :         state->orig.in.handle = _handle;
     779           0 :         state->orig.in.sec_info = _sec_info;
     780             : 
     781             :         /* Out parameters */
     782           0 :         state->orig.out.sdbuf = _sdbuf;
     783             : 
     784             :         /* Result */
     785           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     786             : 
     787           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     788             :                              "dcerpc_samr_QuerySecurity_out_memory");
     789           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     790           0 :                 return tevent_req_post(req, ev);
     791             :         }
     792             : 
     793             :         /* make a temporary copy, that we pass to the dispatch function */
     794           0 :         state->tmp = state->orig;
     795             : 
     796           0 :         subreq = dcerpc_samr_QuerySecurity_r_send(state, ev, h, &state->tmp);
     797           0 :         if (tevent_req_nomem(subreq, req)) {
     798           0 :                 return tevent_req_post(req, ev);
     799             :         }
     800           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QuerySecurity_done, req);
     801           0 :         return req;
     802             : }
     803             : 
     804           0 : static void dcerpc_samr_QuerySecurity_done(struct tevent_req *subreq)
     805             : {
     806           0 :         struct tevent_req *req = tevent_req_callback_data(
     807             :                 subreq, struct tevent_req);
     808           0 :         struct dcerpc_samr_QuerySecurity_state *state = tevent_req_data(
     809             :                 req, struct dcerpc_samr_QuerySecurity_state);
     810             :         NTSTATUS status;
     811             :         TALLOC_CTX *mem_ctx;
     812             : 
     813           0 :         if (state->out_mem_ctx) {
     814           0 :                 mem_ctx = state->out_mem_ctx;
     815             :         } else {
     816           0 :                 mem_ctx = state;
     817             :         }
     818             : 
     819           0 :         status = dcerpc_samr_QuerySecurity_r_recv(subreq, mem_ctx);
     820           0 :         TALLOC_FREE(subreq);
     821           0 :         if (tevent_req_nterror(req, status)) {
     822           0 :                 return;
     823             :         }
     824             : 
     825             :         /* Copy out parameters */
     826           0 :         *state->orig.out.sdbuf = *state->tmp.out.sdbuf;
     827             : 
     828             :         /* Copy result */
     829           0 :         state->orig.out.result = state->tmp.out.result;
     830             : 
     831             :         /* Reset temporary structure */
     832           0 :         NDR_ZERO_STRUCT(state->tmp);
     833             : 
     834           0 :         tevent_req_done(req);
     835             : }
     836             : 
     837           0 : NTSTATUS dcerpc_samr_QuerySecurity_recv(struct tevent_req *req,
     838             :                                         TALLOC_CTX *mem_ctx,
     839             :                                         NTSTATUS *result)
     840             : {
     841           0 :         struct dcerpc_samr_QuerySecurity_state *state = tevent_req_data(
     842             :                 req, struct dcerpc_samr_QuerySecurity_state);
     843             :         NTSTATUS status;
     844             : 
     845           0 :         if (tevent_req_is_nterror(req, &status)) {
     846           0 :                 tevent_req_received(req);
     847           0 :                 return status;
     848             :         }
     849             : 
     850             :         /* Steal possible out parameters to the callers context */
     851           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     852             : 
     853             :         /* Return result */
     854           0 :         *result = state->orig.out.result;
     855             : 
     856           0 :         tevent_req_received(req);
     857           0 :         return NT_STATUS_OK;
     858             : }
     859             : 
     860         136 : NTSTATUS dcerpc_samr_QuerySecurity(struct dcerpc_binding_handle *h,
     861             :                                    TALLOC_CTX *mem_ctx,
     862             :                                    struct policy_handle *_handle /* [in] [ref] */,
     863             :                                    uint32_t _sec_info /* [in]  */,
     864             :                                    struct sec_desc_buf **_sdbuf /* [out] [ref] */,
     865             :                                    NTSTATUS *result)
     866             : {
     867             :         struct samr_QuerySecurity r;
     868             :         NTSTATUS status;
     869             : 
     870             :         /* In parameters */
     871         136 :         r.in.handle = _handle;
     872         136 :         r.in.sec_info = _sec_info;
     873             : 
     874             :         /* Out parameters */
     875         136 :         r.out.sdbuf = _sdbuf;
     876             : 
     877             :         /* Result */
     878         136 :         NDR_ZERO_STRUCT(r.out.result);
     879             : 
     880         136 :         status = dcerpc_samr_QuerySecurity_r(h, mem_ctx, &r);
     881         136 :         if (!NT_STATUS_IS_OK(status)) {
     882           0 :                 return status;
     883             :         }
     884             : 
     885             :         /* Return variables */
     886         136 :         *_sdbuf = *r.out.sdbuf;
     887             : 
     888             :         /* Return result */
     889         136 :         *result = r.out.result;
     890             : 
     891         136 :         return NT_STATUS_OK;
     892             : }
     893             : 
     894             : struct dcerpc_samr_Shutdown_r_state {
     895             :         TALLOC_CTX *out_mem_ctx;
     896             : };
     897             : 
     898             : static void dcerpc_samr_Shutdown_r_done(struct tevent_req *subreq);
     899             : 
     900           0 : struct tevent_req *dcerpc_samr_Shutdown_r_send(TALLOC_CTX *mem_ctx,
     901             :         struct tevent_context *ev,
     902             :         struct dcerpc_binding_handle *h,
     903             :         struct samr_Shutdown *r)
     904             : {
     905             :         struct tevent_req *req;
     906             :         struct dcerpc_samr_Shutdown_r_state *state;
     907             :         struct tevent_req *subreq;
     908             : 
     909           0 :         req = tevent_req_create(mem_ctx, &state,
     910             :                                 struct dcerpc_samr_Shutdown_r_state);
     911           0 :         if (req == NULL) {
     912           0 :                 return NULL;
     913             :         }
     914             : 
     915           0 :         state->out_mem_ctx = NULL;
     916             : 
     917           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     918             :                         NULL, &ndr_table_samr,
     919             :                         NDR_SAMR_SHUTDOWN, state, r);
     920           0 :         if (tevent_req_nomem(subreq, req)) {
     921           0 :                 return tevent_req_post(req, ev);
     922             :         }
     923           0 :         tevent_req_set_callback(subreq, dcerpc_samr_Shutdown_r_done, req);
     924             : 
     925           0 :         return req;
     926             : }
     927             : 
     928           0 : static void dcerpc_samr_Shutdown_r_done(struct tevent_req *subreq)
     929             : {
     930           0 :         struct tevent_req *req =
     931           0 :                 tevent_req_callback_data(subreq,
     932             :                 struct tevent_req);
     933             :         NTSTATUS status;
     934             : 
     935           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     936           0 :         TALLOC_FREE(subreq);
     937           0 :         if (tevent_req_nterror(req, status)) {
     938           0 :                 return;
     939             :         }
     940             : 
     941           0 :         tevent_req_done(req);
     942             : }
     943             : 
     944           0 : NTSTATUS dcerpc_samr_Shutdown_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     945             : {
     946           0 :         struct dcerpc_samr_Shutdown_r_state *state =
     947           0 :                 tevent_req_data(req,
     948             :                 struct dcerpc_samr_Shutdown_r_state);
     949             :         NTSTATUS status;
     950             : 
     951           0 :         if (tevent_req_is_nterror(req, &status)) {
     952           0 :                 tevent_req_received(req);
     953           0 :                 return status;
     954             :         }
     955             : 
     956           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     957             : 
     958           0 :         tevent_req_received(req);
     959           0 :         return NT_STATUS_OK;
     960             : }
     961             : 
     962           0 : NTSTATUS dcerpc_samr_Shutdown_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_Shutdown *r)
     963             : {
     964             :         NTSTATUS status;
     965             : 
     966           0 :         status = dcerpc_binding_handle_call(h,
     967             :                         NULL, &ndr_table_samr,
     968             :                         NDR_SAMR_SHUTDOWN, mem_ctx, r);
     969             : 
     970           0 :         return status;
     971             : }
     972             : 
     973             : struct dcerpc_samr_Shutdown_state {
     974             :         struct samr_Shutdown orig;
     975             :         struct samr_Shutdown tmp;
     976             :         TALLOC_CTX *out_mem_ctx;
     977             : };
     978             : 
     979             : static void dcerpc_samr_Shutdown_done(struct tevent_req *subreq);
     980             : 
     981           0 : struct tevent_req *dcerpc_samr_Shutdown_send(TALLOC_CTX *mem_ctx,
     982             :                                              struct tevent_context *ev,
     983             :                                              struct dcerpc_binding_handle *h,
     984             :                                              struct policy_handle *_connect_handle /* [in] [ref] */)
     985             : {
     986             :         struct tevent_req *req;
     987             :         struct dcerpc_samr_Shutdown_state *state;
     988             :         struct tevent_req *subreq;
     989             : 
     990           0 :         req = tevent_req_create(mem_ctx, &state,
     991             :                                 struct dcerpc_samr_Shutdown_state);
     992           0 :         if (req == NULL) {
     993           0 :                 return NULL;
     994             :         }
     995           0 :         state->out_mem_ctx = NULL;
     996             : 
     997             :         /* In parameters */
     998           0 :         state->orig.in.connect_handle = _connect_handle;
     999             : 
    1000             :         /* Out parameters */
    1001             : 
    1002             :         /* Result */
    1003           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1004             : 
    1005             :         /* make a temporary copy, that we pass to the dispatch function */
    1006           0 :         state->tmp = state->orig;
    1007             : 
    1008           0 :         subreq = dcerpc_samr_Shutdown_r_send(state, ev, h, &state->tmp);
    1009           0 :         if (tevent_req_nomem(subreq, req)) {
    1010           0 :                 return tevent_req_post(req, ev);
    1011             :         }
    1012           0 :         tevent_req_set_callback(subreq, dcerpc_samr_Shutdown_done, req);
    1013           0 :         return req;
    1014             : }
    1015             : 
    1016           0 : static void dcerpc_samr_Shutdown_done(struct tevent_req *subreq)
    1017             : {
    1018           0 :         struct tevent_req *req = tevent_req_callback_data(
    1019             :                 subreq, struct tevent_req);
    1020           0 :         struct dcerpc_samr_Shutdown_state *state = tevent_req_data(
    1021             :                 req, struct dcerpc_samr_Shutdown_state);
    1022             :         NTSTATUS status;
    1023             :         TALLOC_CTX *mem_ctx;
    1024             : 
    1025           0 :         if (state->out_mem_ctx) {
    1026           0 :                 mem_ctx = state->out_mem_ctx;
    1027             :         } else {
    1028           0 :                 mem_ctx = state;
    1029             :         }
    1030             : 
    1031           0 :         status = dcerpc_samr_Shutdown_r_recv(subreq, mem_ctx);
    1032           0 :         TALLOC_FREE(subreq);
    1033           0 :         if (tevent_req_nterror(req, status)) {
    1034           0 :                 return;
    1035             :         }
    1036             : 
    1037             :         /* Copy out parameters */
    1038             : 
    1039             :         /* Copy result */
    1040           0 :         state->orig.out.result = state->tmp.out.result;
    1041             : 
    1042             :         /* Reset temporary structure */
    1043           0 :         NDR_ZERO_STRUCT(state->tmp);
    1044             : 
    1045           0 :         tevent_req_done(req);
    1046             : }
    1047             : 
    1048           0 : NTSTATUS dcerpc_samr_Shutdown_recv(struct tevent_req *req,
    1049             :                                    TALLOC_CTX *mem_ctx,
    1050             :                                    NTSTATUS *result)
    1051             : {
    1052           0 :         struct dcerpc_samr_Shutdown_state *state = tevent_req_data(
    1053             :                 req, struct dcerpc_samr_Shutdown_state);
    1054             :         NTSTATUS status;
    1055             : 
    1056           0 :         if (tevent_req_is_nterror(req, &status)) {
    1057           0 :                 tevent_req_received(req);
    1058           0 :                 return status;
    1059             :         }
    1060             : 
    1061             :         /* Steal possible out parameters to the callers context */
    1062           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1063             : 
    1064             :         /* Return result */
    1065           0 :         *result = state->orig.out.result;
    1066             : 
    1067           0 :         tevent_req_received(req);
    1068           0 :         return NT_STATUS_OK;
    1069             : }
    1070             : 
    1071           0 : NTSTATUS dcerpc_samr_Shutdown(struct dcerpc_binding_handle *h,
    1072             :                               TALLOC_CTX *mem_ctx,
    1073             :                               struct policy_handle *_connect_handle /* [in] [ref] */,
    1074             :                               NTSTATUS *result)
    1075             : {
    1076             :         struct samr_Shutdown r;
    1077             :         NTSTATUS status;
    1078             : 
    1079             :         /* In parameters */
    1080           0 :         r.in.connect_handle = _connect_handle;
    1081             : 
    1082             :         /* Out parameters */
    1083             : 
    1084             :         /* Result */
    1085           0 :         NDR_ZERO_STRUCT(r.out.result);
    1086             : 
    1087           0 :         status = dcerpc_samr_Shutdown_r(h, mem_ctx, &r);
    1088           0 :         if (!NT_STATUS_IS_OK(status)) {
    1089           0 :                 return status;
    1090             :         }
    1091             : 
    1092             :         /* Return variables */
    1093             : 
    1094             :         /* Return result */
    1095           0 :         *result = r.out.result;
    1096             : 
    1097           0 :         return NT_STATUS_OK;
    1098             : }
    1099             : 
    1100             : struct dcerpc_samr_LookupDomain_r_state {
    1101             :         TALLOC_CTX *out_mem_ctx;
    1102             : };
    1103             : 
    1104             : static void dcerpc_samr_LookupDomain_r_done(struct tevent_req *subreq);
    1105             : 
    1106          10 : struct tevent_req *dcerpc_samr_LookupDomain_r_send(TALLOC_CTX *mem_ctx,
    1107             :         struct tevent_context *ev,
    1108             :         struct dcerpc_binding_handle *h,
    1109             :         struct samr_LookupDomain *r)
    1110             : {
    1111             :         struct tevent_req *req;
    1112             :         struct dcerpc_samr_LookupDomain_r_state *state;
    1113             :         struct tevent_req *subreq;
    1114             : 
    1115          10 :         req = tevent_req_create(mem_ctx, &state,
    1116             :                                 struct dcerpc_samr_LookupDomain_r_state);
    1117          10 :         if (req == NULL) {
    1118           0 :                 return NULL;
    1119             :         }
    1120             : 
    1121          10 :         state->out_mem_ctx = talloc_new(state);
    1122          10 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1123           0 :                 return tevent_req_post(req, ev);
    1124             :         }
    1125             : 
    1126          10 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1127             :                         NULL, &ndr_table_samr,
    1128          10 :                         NDR_SAMR_LOOKUPDOMAIN, state->out_mem_ctx, r);
    1129          10 :         if (tevent_req_nomem(subreq, req)) {
    1130           0 :                 return tevent_req_post(req, ev);
    1131             :         }
    1132          10 :         tevent_req_set_callback(subreq, dcerpc_samr_LookupDomain_r_done, req);
    1133             : 
    1134          10 :         return req;
    1135             : }
    1136             : 
    1137          10 : static void dcerpc_samr_LookupDomain_r_done(struct tevent_req *subreq)
    1138             : {
    1139          10 :         struct tevent_req *req =
    1140          10 :                 tevent_req_callback_data(subreq,
    1141             :                 struct tevent_req);
    1142             :         NTSTATUS status;
    1143             : 
    1144          10 :         status = dcerpc_binding_handle_call_recv(subreq);
    1145          10 :         TALLOC_FREE(subreq);
    1146          10 :         if (tevent_req_nterror(req, status)) {
    1147           0 :                 return;
    1148             :         }
    1149             : 
    1150          10 :         tevent_req_done(req);
    1151             : }
    1152             : 
    1153          10 : NTSTATUS dcerpc_samr_LookupDomain_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1154             : {
    1155          10 :         struct dcerpc_samr_LookupDomain_r_state *state =
    1156          10 :                 tevent_req_data(req,
    1157             :                 struct dcerpc_samr_LookupDomain_r_state);
    1158             :         NTSTATUS status;
    1159             : 
    1160          10 :         if (tevent_req_is_nterror(req, &status)) {
    1161           0 :                 tevent_req_received(req);
    1162           0 :                 return status;
    1163             :         }
    1164             : 
    1165          10 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1166             : 
    1167          10 :         tevent_req_received(req);
    1168          10 :         return NT_STATUS_OK;
    1169             : }
    1170             : 
    1171         922 : NTSTATUS dcerpc_samr_LookupDomain_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_LookupDomain *r)
    1172             : {
    1173             :         NTSTATUS status;
    1174             : 
    1175         922 :         status = dcerpc_binding_handle_call(h,
    1176             :                         NULL, &ndr_table_samr,
    1177             :                         NDR_SAMR_LOOKUPDOMAIN, mem_ctx, r);
    1178             : 
    1179         922 :         return status;
    1180             : }
    1181             : 
    1182             : struct dcerpc_samr_LookupDomain_state {
    1183             :         struct samr_LookupDomain orig;
    1184             :         struct samr_LookupDomain tmp;
    1185             :         TALLOC_CTX *out_mem_ctx;
    1186             : };
    1187             : 
    1188             : static void dcerpc_samr_LookupDomain_done(struct tevent_req *subreq);
    1189             : 
    1190           0 : struct tevent_req *dcerpc_samr_LookupDomain_send(TALLOC_CTX *mem_ctx,
    1191             :                                                  struct tevent_context *ev,
    1192             :                                                  struct dcerpc_binding_handle *h,
    1193             :                                                  struct policy_handle *_connect_handle /* [in] [ref] */,
    1194             :                                                  struct lsa_String *_domain_name /* [in] [ref] */,
    1195             :                                                  struct dom_sid2 **_sid /* [out] [ref] */)
    1196             : {
    1197             :         struct tevent_req *req;
    1198             :         struct dcerpc_samr_LookupDomain_state *state;
    1199             :         struct tevent_req *subreq;
    1200             : 
    1201           0 :         req = tevent_req_create(mem_ctx, &state,
    1202             :                                 struct dcerpc_samr_LookupDomain_state);
    1203           0 :         if (req == NULL) {
    1204           0 :                 return NULL;
    1205             :         }
    1206           0 :         state->out_mem_ctx = NULL;
    1207             : 
    1208             :         /* In parameters */
    1209           0 :         state->orig.in.connect_handle = _connect_handle;
    1210           0 :         state->orig.in.domain_name = _domain_name;
    1211             : 
    1212             :         /* Out parameters */
    1213           0 :         state->orig.out.sid = _sid;
    1214             : 
    1215             :         /* Result */
    1216           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1217             : 
    1218           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1219             :                              "dcerpc_samr_LookupDomain_out_memory");
    1220           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1221           0 :                 return tevent_req_post(req, ev);
    1222             :         }
    1223             : 
    1224             :         /* make a temporary copy, that we pass to the dispatch function */
    1225           0 :         state->tmp = state->orig;
    1226             : 
    1227           0 :         subreq = dcerpc_samr_LookupDomain_r_send(state, ev, h, &state->tmp);
    1228           0 :         if (tevent_req_nomem(subreq, req)) {
    1229           0 :                 return tevent_req_post(req, ev);
    1230             :         }
    1231           0 :         tevent_req_set_callback(subreq, dcerpc_samr_LookupDomain_done, req);
    1232           0 :         return req;
    1233             : }
    1234             : 
    1235           0 : static void dcerpc_samr_LookupDomain_done(struct tevent_req *subreq)
    1236             : {
    1237           0 :         struct tevent_req *req = tevent_req_callback_data(
    1238             :                 subreq, struct tevent_req);
    1239           0 :         struct dcerpc_samr_LookupDomain_state *state = tevent_req_data(
    1240             :                 req, struct dcerpc_samr_LookupDomain_state);
    1241             :         NTSTATUS status;
    1242             :         TALLOC_CTX *mem_ctx;
    1243             : 
    1244           0 :         if (state->out_mem_ctx) {
    1245           0 :                 mem_ctx = state->out_mem_ctx;
    1246             :         } else {
    1247           0 :                 mem_ctx = state;
    1248             :         }
    1249             : 
    1250           0 :         status = dcerpc_samr_LookupDomain_r_recv(subreq, mem_ctx);
    1251           0 :         TALLOC_FREE(subreq);
    1252           0 :         if (tevent_req_nterror(req, status)) {
    1253           0 :                 return;
    1254             :         }
    1255             : 
    1256             :         /* Copy out parameters */
    1257           0 :         *state->orig.out.sid = *state->tmp.out.sid;
    1258             : 
    1259             :         /* Copy result */
    1260           0 :         state->orig.out.result = state->tmp.out.result;
    1261             : 
    1262             :         /* Reset temporary structure */
    1263           0 :         NDR_ZERO_STRUCT(state->tmp);
    1264             : 
    1265           0 :         tevent_req_done(req);
    1266             : }
    1267             : 
    1268           0 : NTSTATUS dcerpc_samr_LookupDomain_recv(struct tevent_req *req,
    1269             :                                        TALLOC_CTX *mem_ctx,
    1270             :                                        NTSTATUS *result)
    1271             : {
    1272           0 :         struct dcerpc_samr_LookupDomain_state *state = tevent_req_data(
    1273             :                 req, struct dcerpc_samr_LookupDomain_state);
    1274             :         NTSTATUS status;
    1275             : 
    1276           0 :         if (tevent_req_is_nterror(req, &status)) {
    1277           0 :                 tevent_req_received(req);
    1278           0 :                 return status;
    1279             :         }
    1280             : 
    1281             :         /* Steal possible out parameters to the callers context */
    1282           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1283             : 
    1284             :         /* Return result */
    1285           0 :         *result = state->orig.out.result;
    1286             : 
    1287           0 :         tevent_req_received(req);
    1288           0 :         return NT_STATUS_OK;
    1289             : }
    1290             : 
    1291         160 : NTSTATUS dcerpc_samr_LookupDomain(struct dcerpc_binding_handle *h,
    1292             :                                   TALLOC_CTX *mem_ctx,
    1293             :                                   struct policy_handle *_connect_handle /* [in] [ref] */,
    1294             :                                   struct lsa_String *_domain_name /* [in] [ref] */,
    1295             :                                   struct dom_sid2 **_sid /* [out] [ref] */,
    1296             :                                   NTSTATUS *result)
    1297             : {
    1298             :         struct samr_LookupDomain r;
    1299             :         NTSTATUS status;
    1300             : 
    1301             :         /* In parameters */
    1302         160 :         r.in.connect_handle = _connect_handle;
    1303         160 :         r.in.domain_name = _domain_name;
    1304             : 
    1305             :         /* Out parameters */
    1306         160 :         r.out.sid = _sid;
    1307             : 
    1308             :         /* Result */
    1309         160 :         NDR_ZERO_STRUCT(r.out.result);
    1310             : 
    1311         160 :         status = dcerpc_samr_LookupDomain_r(h, mem_ctx, &r);
    1312         160 :         if (!NT_STATUS_IS_OK(status)) {
    1313           0 :                 return status;
    1314             :         }
    1315             : 
    1316             :         /* Return variables */
    1317         160 :         *_sid = *r.out.sid;
    1318             : 
    1319             :         /* Return result */
    1320         160 :         *result = r.out.result;
    1321             : 
    1322         160 :         return NT_STATUS_OK;
    1323             : }
    1324             : 
    1325             : struct dcerpc_samr_EnumDomains_r_state {
    1326             :         TALLOC_CTX *out_mem_ctx;
    1327             : };
    1328             : 
    1329             : static void dcerpc_samr_EnumDomains_r_done(struct tevent_req *subreq);
    1330             : 
    1331           2 : struct tevent_req *dcerpc_samr_EnumDomains_r_send(TALLOC_CTX *mem_ctx,
    1332             :         struct tevent_context *ev,
    1333             :         struct dcerpc_binding_handle *h,
    1334             :         struct samr_EnumDomains *r)
    1335             : {
    1336             :         struct tevent_req *req;
    1337             :         struct dcerpc_samr_EnumDomains_r_state *state;
    1338             :         struct tevent_req *subreq;
    1339             : 
    1340           2 :         req = tevent_req_create(mem_ctx, &state,
    1341             :                                 struct dcerpc_samr_EnumDomains_r_state);
    1342           2 :         if (req == NULL) {
    1343           0 :                 return NULL;
    1344             :         }
    1345             : 
    1346           2 :         state->out_mem_ctx = talloc_new(state);
    1347           2 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1348           0 :                 return tevent_req_post(req, ev);
    1349             :         }
    1350             : 
    1351           2 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1352             :                         NULL, &ndr_table_samr,
    1353           2 :                         NDR_SAMR_ENUMDOMAINS, state->out_mem_ctx, r);
    1354           2 :         if (tevent_req_nomem(subreq, req)) {
    1355           0 :                 return tevent_req_post(req, ev);
    1356             :         }
    1357           2 :         tevent_req_set_callback(subreq, dcerpc_samr_EnumDomains_r_done, req);
    1358             : 
    1359           2 :         return req;
    1360             : }
    1361             : 
    1362           2 : static void dcerpc_samr_EnumDomains_r_done(struct tevent_req *subreq)
    1363             : {
    1364           2 :         struct tevent_req *req =
    1365           2 :                 tevent_req_callback_data(subreq,
    1366             :                 struct tevent_req);
    1367             :         NTSTATUS status;
    1368             : 
    1369           2 :         status = dcerpc_binding_handle_call_recv(subreq);
    1370           2 :         TALLOC_FREE(subreq);
    1371           2 :         if (tevent_req_nterror(req, status)) {
    1372           0 :                 return;
    1373             :         }
    1374             : 
    1375           2 :         tevent_req_done(req);
    1376             : }
    1377             : 
    1378           2 : NTSTATUS dcerpc_samr_EnumDomains_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1379             : {
    1380           2 :         struct dcerpc_samr_EnumDomains_r_state *state =
    1381           2 :                 tevent_req_data(req,
    1382             :                 struct dcerpc_samr_EnumDomains_r_state);
    1383             :         NTSTATUS status;
    1384             : 
    1385           2 :         if (tevent_req_is_nterror(req, &status)) {
    1386           0 :                 tevent_req_received(req);
    1387           0 :                 return status;
    1388             :         }
    1389             : 
    1390           2 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1391             : 
    1392           2 :         tevent_req_received(req);
    1393           2 :         return NT_STATUS_OK;
    1394             : }
    1395             : 
    1396         256 : NTSTATUS dcerpc_samr_EnumDomains_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_EnumDomains *r)
    1397             : {
    1398             :         NTSTATUS status;
    1399             : 
    1400         256 :         status = dcerpc_binding_handle_call(h,
    1401             :                         NULL, &ndr_table_samr,
    1402             :                         NDR_SAMR_ENUMDOMAINS, mem_ctx, r);
    1403             : 
    1404         256 :         return status;
    1405             : }
    1406             : 
    1407             : struct dcerpc_samr_EnumDomains_state {
    1408             :         struct samr_EnumDomains orig;
    1409             :         struct samr_EnumDomains tmp;
    1410             :         TALLOC_CTX *out_mem_ctx;
    1411             : };
    1412             : 
    1413             : static void dcerpc_samr_EnumDomains_done(struct tevent_req *subreq);
    1414             : 
    1415           0 : struct tevent_req *dcerpc_samr_EnumDomains_send(TALLOC_CTX *mem_ctx,
    1416             :                                                 struct tevent_context *ev,
    1417             :                                                 struct dcerpc_binding_handle *h,
    1418             :                                                 struct policy_handle *_connect_handle /* [in] [ref] */,
    1419             :                                                 uint32_t *_resume_handle /* [in,out] [ref] */,
    1420             :                                                 struct samr_SamArray **_sam /* [out] [ref] */,
    1421             :                                                 uint32_t _buf_size /* [in]  */,
    1422             :                                                 uint32_t *_num_entries /* [out] [ref] */)
    1423             : {
    1424             :         struct tevent_req *req;
    1425             :         struct dcerpc_samr_EnumDomains_state *state;
    1426             :         struct tevent_req *subreq;
    1427             : 
    1428           0 :         req = tevent_req_create(mem_ctx, &state,
    1429             :                                 struct dcerpc_samr_EnumDomains_state);
    1430           0 :         if (req == NULL) {
    1431           0 :                 return NULL;
    1432             :         }
    1433           0 :         state->out_mem_ctx = NULL;
    1434             : 
    1435             :         /* In parameters */
    1436           0 :         state->orig.in.connect_handle = _connect_handle;
    1437           0 :         state->orig.in.resume_handle = _resume_handle;
    1438           0 :         state->orig.in.buf_size = _buf_size;
    1439             : 
    1440             :         /* Out parameters */
    1441           0 :         state->orig.out.resume_handle = _resume_handle;
    1442           0 :         state->orig.out.sam = _sam;
    1443           0 :         state->orig.out.num_entries = _num_entries;
    1444             : 
    1445             :         /* Result */
    1446           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1447             : 
    1448           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1449             :                              "dcerpc_samr_EnumDomains_out_memory");
    1450           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1451           0 :                 return tevent_req_post(req, ev);
    1452             :         }
    1453             : 
    1454             :         /* make a temporary copy, that we pass to the dispatch function */
    1455           0 :         state->tmp = state->orig;
    1456             : 
    1457           0 :         subreq = dcerpc_samr_EnumDomains_r_send(state, ev, h, &state->tmp);
    1458           0 :         if (tevent_req_nomem(subreq, req)) {
    1459           0 :                 return tevent_req_post(req, ev);
    1460             :         }
    1461           0 :         tevent_req_set_callback(subreq, dcerpc_samr_EnumDomains_done, req);
    1462           0 :         return req;
    1463             : }
    1464             : 
    1465           0 : static void dcerpc_samr_EnumDomains_done(struct tevent_req *subreq)
    1466             : {
    1467           0 :         struct tevent_req *req = tevent_req_callback_data(
    1468             :                 subreq, struct tevent_req);
    1469           0 :         struct dcerpc_samr_EnumDomains_state *state = tevent_req_data(
    1470             :                 req, struct dcerpc_samr_EnumDomains_state);
    1471             :         NTSTATUS status;
    1472             :         TALLOC_CTX *mem_ctx;
    1473             : 
    1474           0 :         if (state->out_mem_ctx) {
    1475           0 :                 mem_ctx = state->out_mem_ctx;
    1476             :         } else {
    1477           0 :                 mem_ctx = state;
    1478             :         }
    1479             : 
    1480           0 :         status = dcerpc_samr_EnumDomains_r_recv(subreq, mem_ctx);
    1481           0 :         TALLOC_FREE(subreq);
    1482           0 :         if (tevent_req_nterror(req, status)) {
    1483           0 :                 return;
    1484             :         }
    1485             : 
    1486             :         /* Copy out parameters */
    1487           0 :         *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
    1488           0 :         *state->orig.out.sam = *state->tmp.out.sam;
    1489           0 :         *state->orig.out.num_entries = *state->tmp.out.num_entries;
    1490             : 
    1491             :         /* Copy result */
    1492           0 :         state->orig.out.result = state->tmp.out.result;
    1493             : 
    1494             :         /* Reset temporary structure */
    1495           0 :         NDR_ZERO_STRUCT(state->tmp);
    1496             : 
    1497           0 :         tevent_req_done(req);
    1498             : }
    1499             : 
    1500           0 : NTSTATUS dcerpc_samr_EnumDomains_recv(struct tevent_req *req,
    1501             :                                       TALLOC_CTX *mem_ctx,
    1502             :                                       NTSTATUS *result)
    1503             : {
    1504           0 :         struct dcerpc_samr_EnumDomains_state *state = tevent_req_data(
    1505             :                 req, struct dcerpc_samr_EnumDomains_state);
    1506             :         NTSTATUS status;
    1507             : 
    1508           0 :         if (tevent_req_is_nterror(req, &status)) {
    1509           0 :                 tevent_req_received(req);
    1510           0 :                 return status;
    1511             :         }
    1512             : 
    1513             :         /* Steal possible out parameters to the callers context */
    1514           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1515             : 
    1516             :         /* Return result */
    1517           0 :         *result = state->orig.out.result;
    1518             : 
    1519           0 :         tevent_req_received(req);
    1520           0 :         return NT_STATUS_OK;
    1521             : }
    1522             : 
    1523          90 : NTSTATUS dcerpc_samr_EnumDomains(struct dcerpc_binding_handle *h,
    1524             :                                  TALLOC_CTX *mem_ctx,
    1525             :                                  struct policy_handle *_connect_handle /* [in] [ref] */,
    1526             :                                  uint32_t *_resume_handle /* [in,out] [ref] */,
    1527             :                                  struct samr_SamArray **_sam /* [out] [ref] */,
    1528             :                                  uint32_t _buf_size /* [in]  */,
    1529             :                                  uint32_t *_num_entries /* [out] [ref] */,
    1530             :                                  NTSTATUS *result)
    1531             : {
    1532             :         struct samr_EnumDomains r;
    1533             :         NTSTATUS status;
    1534             : 
    1535             :         /* In parameters */
    1536          90 :         r.in.connect_handle = _connect_handle;
    1537          90 :         r.in.resume_handle = _resume_handle;
    1538          90 :         r.in.buf_size = _buf_size;
    1539             : 
    1540             :         /* Out parameters */
    1541          90 :         r.out.resume_handle = _resume_handle;
    1542          90 :         r.out.sam = _sam;
    1543          90 :         r.out.num_entries = _num_entries;
    1544             : 
    1545             :         /* Result */
    1546          90 :         NDR_ZERO_STRUCT(r.out.result);
    1547             : 
    1548          90 :         status = dcerpc_samr_EnumDomains_r(h, mem_ctx, &r);
    1549          90 :         if (!NT_STATUS_IS_OK(status)) {
    1550           0 :                 return status;
    1551             :         }
    1552             : 
    1553             :         /* Return variables */
    1554          90 :         *_resume_handle = *r.out.resume_handle;
    1555          90 :         *_sam = *r.out.sam;
    1556          90 :         *_num_entries = *r.out.num_entries;
    1557             : 
    1558             :         /* Return result */
    1559          90 :         *result = r.out.result;
    1560             : 
    1561          90 :         return NT_STATUS_OK;
    1562             : }
    1563             : 
    1564             : struct dcerpc_samr_OpenDomain_r_state {
    1565             :         TALLOC_CTX *out_mem_ctx;
    1566             : };
    1567             : 
    1568             : static void dcerpc_samr_OpenDomain_r_done(struct tevent_req *subreq);
    1569             : 
    1570          10 : struct tevent_req *dcerpc_samr_OpenDomain_r_send(TALLOC_CTX *mem_ctx,
    1571             :         struct tevent_context *ev,
    1572             :         struct dcerpc_binding_handle *h,
    1573             :         struct samr_OpenDomain *r)
    1574             : {
    1575             :         struct tevent_req *req;
    1576             :         struct dcerpc_samr_OpenDomain_r_state *state;
    1577             :         struct tevent_req *subreq;
    1578             : 
    1579          10 :         req = tevent_req_create(mem_ctx, &state,
    1580             :                                 struct dcerpc_samr_OpenDomain_r_state);
    1581          10 :         if (req == NULL) {
    1582           0 :                 return NULL;
    1583             :         }
    1584             : 
    1585          10 :         state->out_mem_ctx = talloc_new(state);
    1586          10 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1587           0 :                 return tevent_req_post(req, ev);
    1588             :         }
    1589             : 
    1590          10 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1591             :                         NULL, &ndr_table_samr,
    1592          10 :                         NDR_SAMR_OPENDOMAIN, state->out_mem_ctx, r);
    1593          10 :         if (tevent_req_nomem(subreq, req)) {
    1594           0 :                 return tevent_req_post(req, ev);
    1595             :         }
    1596          10 :         tevent_req_set_callback(subreq, dcerpc_samr_OpenDomain_r_done, req);
    1597             : 
    1598          10 :         return req;
    1599             : }
    1600             : 
    1601          10 : static void dcerpc_samr_OpenDomain_r_done(struct tevent_req *subreq)
    1602             : {
    1603          10 :         struct tevent_req *req =
    1604          10 :                 tevent_req_callback_data(subreq,
    1605             :                 struct tevent_req);
    1606             :         NTSTATUS status;
    1607             : 
    1608          10 :         status = dcerpc_binding_handle_call_recv(subreq);
    1609          10 :         TALLOC_FREE(subreq);
    1610          10 :         if (tevent_req_nterror(req, status)) {
    1611           0 :                 return;
    1612             :         }
    1613             : 
    1614          10 :         tevent_req_done(req);
    1615             : }
    1616             : 
    1617          10 : NTSTATUS dcerpc_samr_OpenDomain_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1618             : {
    1619          10 :         struct dcerpc_samr_OpenDomain_r_state *state =
    1620          10 :                 tevent_req_data(req,
    1621             :                 struct dcerpc_samr_OpenDomain_r_state);
    1622             :         NTSTATUS status;
    1623             : 
    1624          10 :         if (tevent_req_is_nterror(req, &status)) {
    1625           0 :                 tevent_req_received(req);
    1626           0 :                 return status;
    1627             :         }
    1628             : 
    1629          10 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1630             : 
    1631          10 :         tevent_req_received(req);
    1632          10 :         return NT_STATUS_OK;
    1633             : }
    1634             : 
    1635        2170 : NTSTATUS dcerpc_samr_OpenDomain_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_OpenDomain *r)
    1636             : {
    1637             :         NTSTATUS status;
    1638             : 
    1639        2170 :         status = dcerpc_binding_handle_call(h,
    1640             :                         NULL, &ndr_table_samr,
    1641             :                         NDR_SAMR_OPENDOMAIN, mem_ctx, r);
    1642             : 
    1643        2170 :         return status;
    1644             : }
    1645             : 
    1646             : struct dcerpc_samr_OpenDomain_state {
    1647             :         struct samr_OpenDomain orig;
    1648             :         struct samr_OpenDomain tmp;
    1649             :         TALLOC_CTX *out_mem_ctx;
    1650             : };
    1651             : 
    1652             : static void dcerpc_samr_OpenDomain_done(struct tevent_req *subreq);
    1653             : 
    1654           0 : struct tevent_req *dcerpc_samr_OpenDomain_send(TALLOC_CTX *mem_ctx,
    1655             :                                                struct tevent_context *ev,
    1656             :                                                struct dcerpc_binding_handle *h,
    1657             :                                                struct policy_handle *_connect_handle /* [in] [ref] */,
    1658             :                                                uint32_t _access_mask /* [in]  */,
    1659             :                                                struct dom_sid2 *_sid /* [in] [ref] */,
    1660             :                                                struct policy_handle *_domain_handle /* [out] [ref] */)
    1661             : {
    1662             :         struct tevent_req *req;
    1663             :         struct dcerpc_samr_OpenDomain_state *state;
    1664             :         struct tevent_req *subreq;
    1665             : 
    1666           0 :         req = tevent_req_create(mem_ctx, &state,
    1667             :                                 struct dcerpc_samr_OpenDomain_state);
    1668           0 :         if (req == NULL) {
    1669           0 :                 return NULL;
    1670             :         }
    1671           0 :         state->out_mem_ctx = NULL;
    1672             : 
    1673             :         /* In parameters */
    1674           0 :         state->orig.in.connect_handle = _connect_handle;
    1675           0 :         state->orig.in.access_mask = _access_mask;
    1676           0 :         state->orig.in.sid = _sid;
    1677             : 
    1678             :         /* Out parameters */
    1679           0 :         state->orig.out.domain_handle = _domain_handle;
    1680             : 
    1681             :         /* Result */
    1682           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1683             : 
    1684           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1685             :                              "dcerpc_samr_OpenDomain_out_memory");
    1686           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1687           0 :                 return tevent_req_post(req, ev);
    1688             :         }
    1689             : 
    1690             :         /* make a temporary copy, that we pass to the dispatch function */
    1691           0 :         state->tmp = state->orig;
    1692             : 
    1693           0 :         subreq = dcerpc_samr_OpenDomain_r_send(state, ev, h, &state->tmp);
    1694           0 :         if (tevent_req_nomem(subreq, req)) {
    1695           0 :                 return tevent_req_post(req, ev);
    1696             :         }
    1697           0 :         tevent_req_set_callback(subreq, dcerpc_samr_OpenDomain_done, req);
    1698           0 :         return req;
    1699             : }
    1700             : 
    1701           0 : static void dcerpc_samr_OpenDomain_done(struct tevent_req *subreq)
    1702             : {
    1703           0 :         struct tevent_req *req = tevent_req_callback_data(
    1704             :                 subreq, struct tevent_req);
    1705           0 :         struct dcerpc_samr_OpenDomain_state *state = tevent_req_data(
    1706             :                 req, struct dcerpc_samr_OpenDomain_state);
    1707             :         NTSTATUS status;
    1708             :         TALLOC_CTX *mem_ctx;
    1709             : 
    1710           0 :         if (state->out_mem_ctx) {
    1711           0 :                 mem_ctx = state->out_mem_ctx;
    1712             :         } else {
    1713           0 :                 mem_ctx = state;
    1714             :         }
    1715             : 
    1716           0 :         status = dcerpc_samr_OpenDomain_r_recv(subreq, mem_ctx);
    1717           0 :         TALLOC_FREE(subreq);
    1718           0 :         if (tevent_req_nterror(req, status)) {
    1719           0 :                 return;
    1720             :         }
    1721             : 
    1722             :         /* Copy out parameters */
    1723           0 :         *state->orig.out.domain_handle = *state->tmp.out.domain_handle;
    1724             : 
    1725             :         /* Copy result */
    1726           0 :         state->orig.out.result = state->tmp.out.result;
    1727             : 
    1728             :         /* Reset temporary structure */
    1729           0 :         NDR_ZERO_STRUCT(state->tmp);
    1730             : 
    1731           0 :         tevent_req_done(req);
    1732             : }
    1733             : 
    1734           0 : NTSTATUS dcerpc_samr_OpenDomain_recv(struct tevent_req *req,
    1735             :                                      TALLOC_CTX *mem_ctx,
    1736             :                                      NTSTATUS *result)
    1737             : {
    1738           0 :         struct dcerpc_samr_OpenDomain_state *state = tevent_req_data(
    1739             :                 req, struct dcerpc_samr_OpenDomain_state);
    1740             :         NTSTATUS status;
    1741             : 
    1742           0 :         if (tevent_req_is_nterror(req, &status)) {
    1743           0 :                 tevent_req_received(req);
    1744           0 :                 return status;
    1745             :         }
    1746             : 
    1747             :         /* Steal possible out parameters to the callers context */
    1748           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1749             : 
    1750             :         /* Return result */
    1751           0 :         *result = state->orig.out.result;
    1752             : 
    1753           0 :         tevent_req_received(req);
    1754           0 :         return NT_STATUS_OK;
    1755             : }
    1756             : 
    1757         347 : NTSTATUS dcerpc_samr_OpenDomain(struct dcerpc_binding_handle *h,
    1758             :                                 TALLOC_CTX *mem_ctx,
    1759             :                                 struct policy_handle *_connect_handle /* [in] [ref] */,
    1760             :                                 uint32_t _access_mask /* [in]  */,
    1761             :                                 struct dom_sid2 *_sid /* [in] [ref] */,
    1762             :                                 struct policy_handle *_domain_handle /* [out] [ref] */,
    1763             :                                 NTSTATUS *result)
    1764             : {
    1765             :         struct samr_OpenDomain r;
    1766             :         NTSTATUS status;
    1767             : 
    1768             :         /* In parameters */
    1769         347 :         r.in.connect_handle = _connect_handle;
    1770         347 :         r.in.access_mask = _access_mask;
    1771         347 :         r.in.sid = _sid;
    1772             : 
    1773             :         /* Out parameters */
    1774         347 :         r.out.domain_handle = _domain_handle;
    1775             : 
    1776             :         /* Result */
    1777         347 :         NDR_ZERO_STRUCT(r.out.result);
    1778             : 
    1779         347 :         status = dcerpc_samr_OpenDomain_r(h, mem_ctx, &r);
    1780         347 :         if (!NT_STATUS_IS_OK(status)) {
    1781           0 :                 return status;
    1782             :         }
    1783             : 
    1784             :         /* Return variables */
    1785         347 :         *_domain_handle = *r.out.domain_handle;
    1786             : 
    1787             :         /* Return result */
    1788         347 :         *result = r.out.result;
    1789             : 
    1790         347 :         return NT_STATUS_OK;
    1791             : }
    1792             : 
    1793             : struct dcerpc_samr_QueryDomainInfo_r_state {
    1794             :         TALLOC_CTX *out_mem_ctx;
    1795             : };
    1796             : 
    1797             : static void dcerpc_samr_QueryDomainInfo_r_done(struct tevent_req *subreq);
    1798             : 
    1799           0 : struct tevent_req *dcerpc_samr_QueryDomainInfo_r_send(TALLOC_CTX *mem_ctx,
    1800             :         struct tevent_context *ev,
    1801             :         struct dcerpc_binding_handle *h,
    1802             :         struct samr_QueryDomainInfo *r)
    1803             : {
    1804             :         struct tevent_req *req;
    1805             :         struct dcerpc_samr_QueryDomainInfo_r_state *state;
    1806             :         struct tevent_req *subreq;
    1807             : 
    1808           0 :         req = tevent_req_create(mem_ctx, &state,
    1809             :                                 struct dcerpc_samr_QueryDomainInfo_r_state);
    1810           0 :         if (req == NULL) {
    1811           0 :                 return NULL;
    1812             :         }
    1813             : 
    1814           0 :         state->out_mem_ctx = talloc_new(state);
    1815           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1816           0 :                 return tevent_req_post(req, ev);
    1817             :         }
    1818             : 
    1819           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1820             :                         NULL, &ndr_table_samr,
    1821           0 :                         NDR_SAMR_QUERYDOMAININFO, state->out_mem_ctx, r);
    1822           0 :         if (tevent_req_nomem(subreq, req)) {
    1823           0 :                 return tevent_req_post(req, ev);
    1824             :         }
    1825           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryDomainInfo_r_done, req);
    1826             : 
    1827           0 :         return req;
    1828             : }
    1829             : 
    1830           0 : static void dcerpc_samr_QueryDomainInfo_r_done(struct tevent_req *subreq)
    1831             : {
    1832           0 :         struct tevent_req *req =
    1833           0 :                 tevent_req_callback_data(subreq,
    1834             :                 struct tevent_req);
    1835             :         NTSTATUS status;
    1836             : 
    1837           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1838           0 :         TALLOC_FREE(subreq);
    1839           0 :         if (tevent_req_nterror(req, status)) {
    1840           0 :                 return;
    1841             :         }
    1842             : 
    1843           0 :         tevent_req_done(req);
    1844             : }
    1845             : 
    1846           0 : NTSTATUS dcerpc_samr_QueryDomainInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1847             : {
    1848           0 :         struct dcerpc_samr_QueryDomainInfo_r_state *state =
    1849           0 :                 tevent_req_data(req,
    1850             :                 struct dcerpc_samr_QueryDomainInfo_r_state);
    1851             :         NTSTATUS status;
    1852             : 
    1853           0 :         if (tevent_req_is_nterror(req, &status)) {
    1854           0 :                 tevent_req_received(req);
    1855           0 :                 return status;
    1856             :         }
    1857             : 
    1858           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1859             : 
    1860           0 :         tevent_req_received(req);
    1861           0 :         return NT_STATUS_OK;
    1862             : }
    1863             : 
    1864         463 : NTSTATUS dcerpc_samr_QueryDomainInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_QueryDomainInfo *r)
    1865             : {
    1866             :         NTSTATUS status;
    1867             : 
    1868         463 :         status = dcerpc_binding_handle_call(h,
    1869             :                         NULL, &ndr_table_samr,
    1870             :                         NDR_SAMR_QUERYDOMAININFO, mem_ctx, r);
    1871             : 
    1872         463 :         return status;
    1873             : }
    1874             : 
    1875             : struct dcerpc_samr_QueryDomainInfo_state {
    1876             :         struct samr_QueryDomainInfo orig;
    1877             :         struct samr_QueryDomainInfo tmp;
    1878             :         TALLOC_CTX *out_mem_ctx;
    1879             : };
    1880             : 
    1881             : static void dcerpc_samr_QueryDomainInfo_done(struct tevent_req *subreq);
    1882             : 
    1883           0 : struct tevent_req *dcerpc_samr_QueryDomainInfo_send(TALLOC_CTX *mem_ctx,
    1884             :                                                     struct tevent_context *ev,
    1885             :                                                     struct dcerpc_binding_handle *h,
    1886             :                                                     struct policy_handle *_domain_handle /* [in] [ref] */,
    1887             :                                                     enum samr_DomainInfoClass _level /* [in]  */,
    1888             :                                                     union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */)
    1889             : {
    1890             :         struct tevent_req *req;
    1891             :         struct dcerpc_samr_QueryDomainInfo_state *state;
    1892             :         struct tevent_req *subreq;
    1893             : 
    1894           0 :         req = tevent_req_create(mem_ctx, &state,
    1895             :                                 struct dcerpc_samr_QueryDomainInfo_state);
    1896           0 :         if (req == NULL) {
    1897           0 :                 return NULL;
    1898             :         }
    1899           0 :         state->out_mem_ctx = NULL;
    1900             : 
    1901             :         /* In parameters */
    1902           0 :         state->orig.in.domain_handle = _domain_handle;
    1903           0 :         state->orig.in.level = _level;
    1904             : 
    1905             :         /* Out parameters */
    1906           0 :         state->orig.out.info = _info;
    1907             : 
    1908             :         /* Result */
    1909           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1910             : 
    1911           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1912             :                              "dcerpc_samr_QueryDomainInfo_out_memory");
    1913           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1914           0 :                 return tevent_req_post(req, ev);
    1915             :         }
    1916             : 
    1917             :         /* make a temporary copy, that we pass to the dispatch function */
    1918           0 :         state->tmp = state->orig;
    1919             : 
    1920           0 :         subreq = dcerpc_samr_QueryDomainInfo_r_send(state, ev, h, &state->tmp);
    1921           0 :         if (tevent_req_nomem(subreq, req)) {
    1922           0 :                 return tevent_req_post(req, ev);
    1923             :         }
    1924           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryDomainInfo_done, req);
    1925           0 :         return req;
    1926             : }
    1927             : 
    1928           0 : static void dcerpc_samr_QueryDomainInfo_done(struct tevent_req *subreq)
    1929             : {
    1930           0 :         struct tevent_req *req = tevent_req_callback_data(
    1931             :                 subreq, struct tevent_req);
    1932           0 :         struct dcerpc_samr_QueryDomainInfo_state *state = tevent_req_data(
    1933             :                 req, struct dcerpc_samr_QueryDomainInfo_state);
    1934             :         NTSTATUS status;
    1935             :         TALLOC_CTX *mem_ctx;
    1936             : 
    1937           0 :         if (state->out_mem_ctx) {
    1938           0 :                 mem_ctx = state->out_mem_ctx;
    1939             :         } else {
    1940           0 :                 mem_ctx = state;
    1941             :         }
    1942             : 
    1943           0 :         status = dcerpc_samr_QueryDomainInfo_r_recv(subreq, mem_ctx);
    1944           0 :         TALLOC_FREE(subreq);
    1945           0 :         if (tevent_req_nterror(req, status)) {
    1946           0 :                 return;
    1947             :         }
    1948             : 
    1949             :         /* Copy out parameters */
    1950           0 :         *state->orig.out.info = *state->tmp.out.info;
    1951             : 
    1952             :         /* Copy result */
    1953           0 :         state->orig.out.result = state->tmp.out.result;
    1954             : 
    1955             :         /* Reset temporary structure */
    1956           0 :         NDR_ZERO_STRUCT(state->tmp);
    1957             : 
    1958           0 :         tevent_req_done(req);
    1959             : }
    1960             : 
    1961           0 : NTSTATUS dcerpc_samr_QueryDomainInfo_recv(struct tevent_req *req,
    1962             :                                           TALLOC_CTX *mem_ctx,
    1963             :                                           NTSTATUS *result)
    1964             : {
    1965           0 :         struct dcerpc_samr_QueryDomainInfo_state *state = tevent_req_data(
    1966             :                 req, struct dcerpc_samr_QueryDomainInfo_state);
    1967             :         NTSTATUS status;
    1968             : 
    1969           0 :         if (tevent_req_is_nterror(req, &status)) {
    1970           0 :                 tevent_req_received(req);
    1971           0 :                 return status;
    1972             :         }
    1973             : 
    1974             :         /* Steal possible out parameters to the callers context */
    1975           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1976             : 
    1977             :         /* Return result */
    1978           0 :         *result = state->orig.out.result;
    1979             : 
    1980           0 :         tevent_req_received(req);
    1981           0 :         return NT_STATUS_OK;
    1982             : }
    1983             : 
    1984          15 : NTSTATUS dcerpc_samr_QueryDomainInfo(struct dcerpc_binding_handle *h,
    1985             :                                      TALLOC_CTX *mem_ctx,
    1986             :                                      struct policy_handle *_domain_handle /* [in] [ref] */,
    1987             :                                      enum samr_DomainInfoClass _level /* [in]  */,
    1988             :                                      union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */,
    1989             :                                      NTSTATUS *result)
    1990             : {
    1991             :         struct samr_QueryDomainInfo r;
    1992             :         NTSTATUS status;
    1993             : 
    1994             :         /* In parameters */
    1995          15 :         r.in.domain_handle = _domain_handle;
    1996          15 :         r.in.level = _level;
    1997             : 
    1998             :         /* Out parameters */
    1999          15 :         r.out.info = _info;
    2000             : 
    2001             :         /* Result */
    2002          15 :         NDR_ZERO_STRUCT(r.out.result);
    2003             : 
    2004          15 :         status = dcerpc_samr_QueryDomainInfo_r(h, mem_ctx, &r);
    2005          15 :         if (!NT_STATUS_IS_OK(status)) {
    2006           0 :                 return status;
    2007             :         }
    2008             : 
    2009             :         /* Return variables */
    2010          15 :         *_info = *r.out.info;
    2011             : 
    2012             :         /* Return result */
    2013          15 :         *result = r.out.result;
    2014             : 
    2015          15 :         return NT_STATUS_OK;
    2016             : }
    2017             : 
    2018             : struct dcerpc_samr_SetDomainInfo_r_state {
    2019             :         TALLOC_CTX *out_mem_ctx;
    2020             : };
    2021             : 
    2022             : static void dcerpc_samr_SetDomainInfo_r_done(struct tevent_req *subreq);
    2023             : 
    2024           0 : struct tevent_req *dcerpc_samr_SetDomainInfo_r_send(TALLOC_CTX *mem_ctx,
    2025             :         struct tevent_context *ev,
    2026             :         struct dcerpc_binding_handle *h,
    2027             :         struct samr_SetDomainInfo *r)
    2028             : {
    2029             :         struct tevent_req *req;
    2030             :         struct dcerpc_samr_SetDomainInfo_r_state *state;
    2031             :         struct tevent_req *subreq;
    2032             : 
    2033           0 :         req = tevent_req_create(mem_ctx, &state,
    2034             :                                 struct dcerpc_samr_SetDomainInfo_r_state);
    2035           0 :         if (req == NULL) {
    2036           0 :                 return NULL;
    2037             :         }
    2038             : 
    2039           0 :         state->out_mem_ctx = NULL;
    2040             : 
    2041           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2042             :                         NULL, &ndr_table_samr,
    2043             :                         NDR_SAMR_SETDOMAININFO, state, r);
    2044           0 :         if (tevent_req_nomem(subreq, req)) {
    2045           0 :                 return tevent_req_post(req, ev);
    2046             :         }
    2047           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetDomainInfo_r_done, req);
    2048             : 
    2049           0 :         return req;
    2050             : }
    2051             : 
    2052           0 : static void dcerpc_samr_SetDomainInfo_r_done(struct tevent_req *subreq)
    2053             : {
    2054           0 :         struct tevent_req *req =
    2055           0 :                 tevent_req_callback_data(subreq,
    2056             :                 struct tevent_req);
    2057             :         NTSTATUS status;
    2058             : 
    2059           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2060           0 :         TALLOC_FREE(subreq);
    2061           0 :         if (tevent_req_nterror(req, status)) {
    2062           0 :                 return;
    2063             :         }
    2064             : 
    2065           0 :         tevent_req_done(req);
    2066             : }
    2067             : 
    2068           0 : NTSTATUS dcerpc_samr_SetDomainInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2069             : {
    2070           0 :         struct dcerpc_samr_SetDomainInfo_r_state *state =
    2071           0 :                 tevent_req_data(req,
    2072             :                 struct dcerpc_samr_SetDomainInfo_r_state);
    2073             :         NTSTATUS status;
    2074             : 
    2075           0 :         if (tevent_req_is_nterror(req, &status)) {
    2076           0 :                 tevent_req_received(req);
    2077           0 :                 return status;
    2078             :         }
    2079             : 
    2080           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2081             : 
    2082           0 :         tevent_req_received(req);
    2083           0 :         return NT_STATUS_OK;
    2084             : }
    2085             : 
    2086         346 : NTSTATUS dcerpc_samr_SetDomainInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_SetDomainInfo *r)
    2087             : {
    2088             :         NTSTATUS status;
    2089             : 
    2090         346 :         status = dcerpc_binding_handle_call(h,
    2091             :                         NULL, &ndr_table_samr,
    2092             :                         NDR_SAMR_SETDOMAININFO, mem_ctx, r);
    2093             : 
    2094         346 :         return status;
    2095             : }
    2096             : 
    2097             : struct dcerpc_samr_SetDomainInfo_state {
    2098             :         struct samr_SetDomainInfo orig;
    2099             :         struct samr_SetDomainInfo tmp;
    2100             :         TALLOC_CTX *out_mem_ctx;
    2101             : };
    2102             : 
    2103             : static void dcerpc_samr_SetDomainInfo_done(struct tevent_req *subreq);
    2104             : 
    2105           0 : struct tevent_req *dcerpc_samr_SetDomainInfo_send(TALLOC_CTX *mem_ctx,
    2106             :                                                   struct tevent_context *ev,
    2107             :                                                   struct dcerpc_binding_handle *h,
    2108             :                                                   struct policy_handle *_domain_handle /* [in] [ref] */,
    2109             :                                                   enum samr_DomainInfoClass _level /* [in]  */,
    2110             :                                                   union samr_DomainInfo *_info /* [in] [ref,switch_is(level)] */)
    2111             : {
    2112             :         struct tevent_req *req;
    2113             :         struct dcerpc_samr_SetDomainInfo_state *state;
    2114             :         struct tevent_req *subreq;
    2115             : 
    2116           0 :         req = tevent_req_create(mem_ctx, &state,
    2117             :                                 struct dcerpc_samr_SetDomainInfo_state);
    2118           0 :         if (req == NULL) {
    2119           0 :                 return NULL;
    2120             :         }
    2121           0 :         state->out_mem_ctx = NULL;
    2122             : 
    2123             :         /* In parameters */
    2124           0 :         state->orig.in.domain_handle = _domain_handle;
    2125           0 :         state->orig.in.level = _level;
    2126           0 :         state->orig.in.info = _info;
    2127             : 
    2128             :         /* Out parameters */
    2129             : 
    2130             :         /* Result */
    2131           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2132             : 
    2133             :         /* make a temporary copy, that we pass to the dispatch function */
    2134           0 :         state->tmp = state->orig;
    2135             : 
    2136           0 :         subreq = dcerpc_samr_SetDomainInfo_r_send(state, ev, h, &state->tmp);
    2137           0 :         if (tevent_req_nomem(subreq, req)) {
    2138           0 :                 return tevent_req_post(req, ev);
    2139             :         }
    2140           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetDomainInfo_done, req);
    2141           0 :         return req;
    2142             : }
    2143             : 
    2144           0 : static void dcerpc_samr_SetDomainInfo_done(struct tevent_req *subreq)
    2145             : {
    2146           0 :         struct tevent_req *req = tevent_req_callback_data(
    2147             :                 subreq, struct tevent_req);
    2148           0 :         struct dcerpc_samr_SetDomainInfo_state *state = tevent_req_data(
    2149             :                 req, struct dcerpc_samr_SetDomainInfo_state);
    2150             :         NTSTATUS status;
    2151             :         TALLOC_CTX *mem_ctx;
    2152             : 
    2153           0 :         if (state->out_mem_ctx) {
    2154           0 :                 mem_ctx = state->out_mem_ctx;
    2155             :         } else {
    2156           0 :                 mem_ctx = state;
    2157             :         }
    2158             : 
    2159           0 :         status = dcerpc_samr_SetDomainInfo_r_recv(subreq, mem_ctx);
    2160           0 :         TALLOC_FREE(subreq);
    2161           0 :         if (tevent_req_nterror(req, status)) {
    2162           0 :                 return;
    2163             :         }
    2164             : 
    2165             :         /* Copy out parameters */
    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_samr_SetDomainInfo_recv(struct tevent_req *req,
    2177             :                                         TALLOC_CTX *mem_ctx,
    2178             :                                         NTSTATUS *result)
    2179             : {
    2180           0 :         struct dcerpc_samr_SetDomainInfo_state *state = tevent_req_data(
    2181             :                 req, struct dcerpc_samr_SetDomainInfo_state);
    2182             :         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           2 : NTSTATUS dcerpc_samr_SetDomainInfo(struct dcerpc_binding_handle *h,
    2200             :                                    TALLOC_CTX *mem_ctx,
    2201             :                                    struct policy_handle *_domain_handle /* [in] [ref] */,
    2202             :                                    enum samr_DomainInfoClass _level /* [in]  */,
    2203             :                                    union samr_DomainInfo *_info /* [in] [ref,switch_is(level)] */,
    2204             :                                    NTSTATUS *result)
    2205             : {
    2206             :         struct samr_SetDomainInfo r;
    2207             :         NTSTATUS status;
    2208             : 
    2209             :         /* In parameters */
    2210           2 :         r.in.domain_handle = _domain_handle;
    2211           2 :         r.in.level = _level;
    2212           2 :         r.in.info = _info;
    2213             : 
    2214             :         /* Out parameters */
    2215             : 
    2216             :         /* Result */
    2217           2 :         NDR_ZERO_STRUCT(r.out.result);
    2218             : 
    2219           2 :         status = dcerpc_samr_SetDomainInfo_r(h, mem_ctx, &r);
    2220           2 :         if (!NT_STATUS_IS_OK(status)) {
    2221           0 :                 return status;
    2222             :         }
    2223             : 
    2224             :         /* Return variables */
    2225             : 
    2226             :         /* Return result */
    2227           2 :         *result = r.out.result;
    2228             : 
    2229           2 :         return NT_STATUS_OK;
    2230             : }
    2231             : 
    2232             : struct dcerpc_samr_CreateDomainGroup_r_state {
    2233             :         TALLOC_CTX *out_mem_ctx;
    2234             : };
    2235             : 
    2236             : static void dcerpc_samr_CreateDomainGroup_r_done(struct tevent_req *subreq);
    2237             : 
    2238           2 : struct tevent_req *dcerpc_samr_CreateDomainGroup_r_send(TALLOC_CTX *mem_ctx,
    2239             :         struct tevent_context *ev,
    2240             :         struct dcerpc_binding_handle *h,
    2241             :         struct samr_CreateDomainGroup *r)
    2242             : {
    2243             :         struct tevent_req *req;
    2244             :         struct dcerpc_samr_CreateDomainGroup_r_state *state;
    2245             :         struct tevent_req *subreq;
    2246             : 
    2247           2 :         req = tevent_req_create(mem_ctx, &state,
    2248             :                                 struct dcerpc_samr_CreateDomainGroup_r_state);
    2249           2 :         if (req == NULL) {
    2250           0 :                 return NULL;
    2251             :         }
    2252             : 
    2253           2 :         state->out_mem_ctx = talloc_new(state);
    2254           2 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2255           0 :                 return tevent_req_post(req, ev);
    2256             :         }
    2257             : 
    2258           2 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2259             :                         NULL, &ndr_table_samr,
    2260           2 :                         NDR_SAMR_CREATEDOMAINGROUP, state->out_mem_ctx, r);
    2261           2 :         if (tevent_req_nomem(subreq, req)) {
    2262           0 :                 return tevent_req_post(req, ev);
    2263             :         }
    2264           2 :         tevent_req_set_callback(subreq, dcerpc_samr_CreateDomainGroup_r_done, req);
    2265             : 
    2266           2 :         return req;
    2267             : }
    2268             : 
    2269           2 : static void dcerpc_samr_CreateDomainGroup_r_done(struct tevent_req *subreq)
    2270             : {
    2271           2 :         struct tevent_req *req =
    2272           2 :                 tevent_req_callback_data(subreq,
    2273             :                 struct tevent_req);
    2274             :         NTSTATUS status;
    2275             : 
    2276           2 :         status = dcerpc_binding_handle_call_recv(subreq);
    2277           2 :         TALLOC_FREE(subreq);
    2278           2 :         if (tevent_req_nterror(req, status)) {
    2279           0 :                 return;
    2280             :         }
    2281             : 
    2282           2 :         tevent_req_done(req);
    2283             : }
    2284             : 
    2285           2 : NTSTATUS dcerpc_samr_CreateDomainGroup_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2286             : {
    2287           2 :         struct dcerpc_samr_CreateDomainGroup_r_state *state =
    2288           2 :                 tevent_req_data(req,
    2289             :                 struct dcerpc_samr_CreateDomainGroup_r_state);
    2290             :         NTSTATUS status;
    2291             : 
    2292           2 :         if (tevent_req_is_nterror(req, &status)) {
    2293           0 :                 tevent_req_received(req);
    2294           0 :                 return status;
    2295             :         }
    2296             : 
    2297           2 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2298             : 
    2299           2 :         tevent_req_received(req);
    2300           2 :         return NT_STATUS_OK;
    2301             : }
    2302             : 
    2303        2188 : NTSTATUS dcerpc_samr_CreateDomainGroup_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_CreateDomainGroup *r)
    2304             : {
    2305             :         NTSTATUS status;
    2306             : 
    2307        2188 :         status = dcerpc_binding_handle_call(h,
    2308             :                         NULL, &ndr_table_samr,
    2309             :                         NDR_SAMR_CREATEDOMAINGROUP, mem_ctx, r);
    2310             : 
    2311        2188 :         return status;
    2312             : }
    2313             : 
    2314             : struct dcerpc_samr_CreateDomainGroup_state {
    2315             :         struct samr_CreateDomainGroup orig;
    2316             :         struct samr_CreateDomainGroup tmp;
    2317             :         TALLOC_CTX *out_mem_ctx;
    2318             : };
    2319             : 
    2320             : static void dcerpc_samr_CreateDomainGroup_done(struct tevent_req *subreq);
    2321             : 
    2322           0 : struct tevent_req *dcerpc_samr_CreateDomainGroup_send(TALLOC_CTX *mem_ctx,
    2323             :                                                       struct tevent_context *ev,
    2324             :                                                       struct dcerpc_binding_handle *h,
    2325             :                                                       struct policy_handle *_domain_handle /* [in] [ref] */,
    2326             :                                                       struct lsa_String *_name /* [in] [ref] */,
    2327             :                                                       uint32_t _access_mask /* [in]  */,
    2328             :                                                       struct policy_handle *_group_handle /* [out] [ref] */,
    2329             :                                                       uint32_t *_rid /* [out] [ref] */)
    2330             : {
    2331             :         struct tevent_req *req;
    2332             :         struct dcerpc_samr_CreateDomainGroup_state *state;
    2333             :         struct tevent_req *subreq;
    2334             : 
    2335           0 :         req = tevent_req_create(mem_ctx, &state,
    2336             :                                 struct dcerpc_samr_CreateDomainGroup_state);
    2337           0 :         if (req == NULL) {
    2338           0 :                 return NULL;
    2339             :         }
    2340           0 :         state->out_mem_ctx = NULL;
    2341             : 
    2342             :         /* In parameters */
    2343           0 :         state->orig.in.domain_handle = _domain_handle;
    2344           0 :         state->orig.in.name = _name;
    2345           0 :         state->orig.in.access_mask = _access_mask;
    2346             : 
    2347             :         /* Out parameters */
    2348           0 :         state->orig.out.group_handle = _group_handle;
    2349           0 :         state->orig.out.rid = _rid;
    2350             : 
    2351             :         /* Result */
    2352           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2353             : 
    2354           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2355             :                              "dcerpc_samr_CreateDomainGroup_out_memory");
    2356           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2357           0 :                 return tevent_req_post(req, ev);
    2358             :         }
    2359             : 
    2360             :         /* make a temporary copy, that we pass to the dispatch function */
    2361           0 :         state->tmp = state->orig;
    2362             : 
    2363           0 :         subreq = dcerpc_samr_CreateDomainGroup_r_send(state, ev, h, &state->tmp);
    2364           0 :         if (tevent_req_nomem(subreq, req)) {
    2365           0 :                 return tevent_req_post(req, ev);
    2366             :         }
    2367           0 :         tevent_req_set_callback(subreq, dcerpc_samr_CreateDomainGroup_done, req);
    2368           0 :         return req;
    2369             : }
    2370             : 
    2371           0 : static void dcerpc_samr_CreateDomainGroup_done(struct tevent_req *subreq)
    2372             : {
    2373           0 :         struct tevent_req *req = tevent_req_callback_data(
    2374             :                 subreq, struct tevent_req);
    2375           0 :         struct dcerpc_samr_CreateDomainGroup_state *state = tevent_req_data(
    2376             :                 req, struct dcerpc_samr_CreateDomainGroup_state);
    2377             :         NTSTATUS status;
    2378             :         TALLOC_CTX *mem_ctx;
    2379             : 
    2380           0 :         if (state->out_mem_ctx) {
    2381           0 :                 mem_ctx = state->out_mem_ctx;
    2382             :         } else {
    2383           0 :                 mem_ctx = state;
    2384             :         }
    2385             : 
    2386           0 :         status = dcerpc_samr_CreateDomainGroup_r_recv(subreq, mem_ctx);
    2387           0 :         TALLOC_FREE(subreq);
    2388           0 :         if (tevent_req_nterror(req, status)) {
    2389           0 :                 return;
    2390             :         }
    2391             : 
    2392             :         /* Copy out parameters */
    2393           0 :         *state->orig.out.group_handle = *state->tmp.out.group_handle;
    2394           0 :         *state->orig.out.rid = *state->tmp.out.rid;
    2395             : 
    2396             :         /* Copy result */
    2397           0 :         state->orig.out.result = state->tmp.out.result;
    2398             : 
    2399             :         /* Reset temporary structure */
    2400           0 :         NDR_ZERO_STRUCT(state->tmp);
    2401             : 
    2402           0 :         tevent_req_done(req);
    2403             : }
    2404             : 
    2405           0 : NTSTATUS dcerpc_samr_CreateDomainGroup_recv(struct tevent_req *req,
    2406             :                                             TALLOC_CTX *mem_ctx,
    2407             :                                             NTSTATUS *result)
    2408             : {
    2409           0 :         struct dcerpc_samr_CreateDomainGroup_state *state = tevent_req_data(
    2410             :                 req, struct dcerpc_samr_CreateDomainGroup_state);
    2411             :         NTSTATUS status;
    2412             : 
    2413           0 :         if (tevent_req_is_nterror(req, &status)) {
    2414           0 :                 tevent_req_received(req);
    2415           0 :                 return status;
    2416             :         }
    2417             : 
    2418             :         /* Steal possible out parameters to the callers context */
    2419           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2420             : 
    2421             :         /* Return result */
    2422           0 :         *result = state->orig.out.result;
    2423             : 
    2424           0 :         tevent_req_received(req);
    2425           0 :         return NT_STATUS_OK;
    2426             : }
    2427             : 
    2428          72 : NTSTATUS dcerpc_samr_CreateDomainGroup(struct dcerpc_binding_handle *h,
    2429             :                                        TALLOC_CTX *mem_ctx,
    2430             :                                        struct policy_handle *_domain_handle /* [in] [ref] */,
    2431             :                                        struct lsa_String *_name /* [in] [ref] */,
    2432             :                                        uint32_t _access_mask /* [in]  */,
    2433             :                                        struct policy_handle *_group_handle /* [out] [ref] */,
    2434             :                                        uint32_t *_rid /* [out] [ref] */,
    2435             :                                        NTSTATUS *result)
    2436             : {
    2437             :         struct samr_CreateDomainGroup r;
    2438             :         NTSTATUS status;
    2439             : 
    2440             :         /* In parameters */
    2441          72 :         r.in.domain_handle = _domain_handle;
    2442          72 :         r.in.name = _name;
    2443          72 :         r.in.access_mask = _access_mask;
    2444             : 
    2445             :         /* Out parameters */
    2446          72 :         r.out.group_handle = _group_handle;
    2447          72 :         r.out.rid = _rid;
    2448             : 
    2449             :         /* Result */
    2450          72 :         NDR_ZERO_STRUCT(r.out.result);
    2451             : 
    2452          72 :         status = dcerpc_samr_CreateDomainGroup_r(h, mem_ctx, &r);
    2453          72 :         if (!NT_STATUS_IS_OK(status)) {
    2454           0 :                 return status;
    2455             :         }
    2456             : 
    2457             :         /* Return variables */
    2458          72 :         *_group_handle = *r.out.group_handle;
    2459          72 :         *_rid = *r.out.rid;
    2460             : 
    2461             :         /* Return result */
    2462          72 :         *result = r.out.result;
    2463             : 
    2464          72 :         return NT_STATUS_OK;
    2465             : }
    2466             : 
    2467             : struct dcerpc_samr_EnumDomainGroups_r_state {
    2468             :         TALLOC_CTX *out_mem_ctx;
    2469             : };
    2470             : 
    2471             : static void dcerpc_samr_EnumDomainGroups_r_done(struct tevent_req *subreq);
    2472             : 
    2473           4 : struct tevent_req *dcerpc_samr_EnumDomainGroups_r_send(TALLOC_CTX *mem_ctx,
    2474             :         struct tevent_context *ev,
    2475             :         struct dcerpc_binding_handle *h,
    2476             :         struct samr_EnumDomainGroups *r)
    2477             : {
    2478             :         struct tevent_req *req;
    2479             :         struct dcerpc_samr_EnumDomainGroups_r_state *state;
    2480             :         struct tevent_req *subreq;
    2481             : 
    2482           4 :         req = tevent_req_create(mem_ctx, &state,
    2483             :                                 struct dcerpc_samr_EnumDomainGroups_r_state);
    2484           4 :         if (req == NULL) {
    2485           0 :                 return NULL;
    2486             :         }
    2487             : 
    2488           4 :         state->out_mem_ctx = talloc_new(state);
    2489           4 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2490           0 :                 return tevent_req_post(req, ev);
    2491             :         }
    2492             : 
    2493           4 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2494             :                         NULL, &ndr_table_samr,
    2495           4 :                         NDR_SAMR_ENUMDOMAINGROUPS, state->out_mem_ctx, r);
    2496           4 :         if (tevent_req_nomem(subreq, req)) {
    2497           0 :                 return tevent_req_post(req, ev);
    2498             :         }
    2499           4 :         tevent_req_set_callback(subreq, dcerpc_samr_EnumDomainGroups_r_done, req);
    2500             : 
    2501           4 :         return req;
    2502             : }
    2503             : 
    2504           4 : static void dcerpc_samr_EnumDomainGroups_r_done(struct tevent_req *subreq)
    2505             : {
    2506           4 :         struct tevent_req *req =
    2507           4 :                 tevent_req_callback_data(subreq,
    2508             :                 struct tevent_req);
    2509             :         NTSTATUS status;
    2510             : 
    2511           4 :         status = dcerpc_binding_handle_call_recv(subreq);
    2512           4 :         TALLOC_FREE(subreq);
    2513           4 :         if (tevent_req_nterror(req, status)) {
    2514           0 :                 return;
    2515             :         }
    2516             : 
    2517           4 :         tevent_req_done(req);
    2518             : }
    2519             : 
    2520           4 : NTSTATUS dcerpc_samr_EnumDomainGroups_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2521             : {
    2522           4 :         struct dcerpc_samr_EnumDomainGroups_r_state *state =
    2523           4 :                 tevent_req_data(req,
    2524             :                 struct dcerpc_samr_EnumDomainGroups_r_state);
    2525             :         NTSTATUS status;
    2526             : 
    2527           4 :         if (tevent_req_is_nterror(req, &status)) {
    2528           0 :                 tevent_req_received(req);
    2529           0 :                 return status;
    2530             :         }
    2531             : 
    2532           4 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2533             : 
    2534           4 :         tevent_req_received(req);
    2535           4 :         return NT_STATUS_OK;
    2536             : }
    2537             : 
    2538         172 : NTSTATUS dcerpc_samr_EnumDomainGroups_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_EnumDomainGroups *r)
    2539             : {
    2540             :         NTSTATUS status;
    2541             : 
    2542         172 :         status = dcerpc_binding_handle_call(h,
    2543             :                         NULL, &ndr_table_samr,
    2544             :                         NDR_SAMR_ENUMDOMAINGROUPS, mem_ctx, r);
    2545             : 
    2546         172 :         return status;
    2547             : }
    2548             : 
    2549             : struct dcerpc_samr_EnumDomainGroups_state {
    2550             :         struct samr_EnumDomainGroups orig;
    2551             :         struct samr_EnumDomainGroups tmp;
    2552             :         TALLOC_CTX *out_mem_ctx;
    2553             : };
    2554             : 
    2555             : static void dcerpc_samr_EnumDomainGroups_done(struct tevent_req *subreq);
    2556             : 
    2557           0 : struct tevent_req *dcerpc_samr_EnumDomainGroups_send(TALLOC_CTX *mem_ctx,
    2558             :                                                      struct tevent_context *ev,
    2559             :                                                      struct dcerpc_binding_handle *h,
    2560             :                                                      struct policy_handle *_domain_handle /* [in] [ref] */,
    2561             :                                                      uint32_t *_resume_handle /* [in,out] [ref] */,
    2562             :                                                      struct samr_SamArray **_sam /* [out] [ref] */,
    2563             :                                                      uint32_t _max_size /* [in]  */,
    2564             :                                                      uint32_t *_num_entries /* [out] [ref] */)
    2565             : {
    2566             :         struct tevent_req *req;
    2567             :         struct dcerpc_samr_EnumDomainGroups_state *state;
    2568             :         struct tevent_req *subreq;
    2569             : 
    2570           0 :         req = tevent_req_create(mem_ctx, &state,
    2571             :                                 struct dcerpc_samr_EnumDomainGroups_state);
    2572           0 :         if (req == NULL) {
    2573           0 :                 return NULL;
    2574             :         }
    2575           0 :         state->out_mem_ctx = NULL;
    2576             : 
    2577             :         /* In parameters */
    2578           0 :         state->orig.in.domain_handle = _domain_handle;
    2579           0 :         state->orig.in.resume_handle = _resume_handle;
    2580           0 :         state->orig.in.max_size = _max_size;
    2581             : 
    2582             :         /* Out parameters */
    2583           0 :         state->orig.out.resume_handle = _resume_handle;
    2584           0 :         state->orig.out.sam = _sam;
    2585           0 :         state->orig.out.num_entries = _num_entries;
    2586             : 
    2587             :         /* Result */
    2588           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2589             : 
    2590           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2591             :                              "dcerpc_samr_EnumDomainGroups_out_memory");
    2592           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2593           0 :                 return tevent_req_post(req, ev);
    2594             :         }
    2595             : 
    2596             :         /* make a temporary copy, that we pass to the dispatch function */
    2597           0 :         state->tmp = state->orig;
    2598             : 
    2599           0 :         subreq = dcerpc_samr_EnumDomainGroups_r_send(state, ev, h, &state->tmp);
    2600           0 :         if (tevent_req_nomem(subreq, req)) {
    2601           0 :                 return tevent_req_post(req, ev);
    2602             :         }
    2603           0 :         tevent_req_set_callback(subreq, dcerpc_samr_EnumDomainGroups_done, req);
    2604           0 :         return req;
    2605             : }
    2606             : 
    2607           0 : static void dcerpc_samr_EnumDomainGroups_done(struct tevent_req *subreq)
    2608             : {
    2609           0 :         struct tevent_req *req = tevent_req_callback_data(
    2610             :                 subreq, struct tevent_req);
    2611           0 :         struct dcerpc_samr_EnumDomainGroups_state *state = tevent_req_data(
    2612             :                 req, struct dcerpc_samr_EnumDomainGroups_state);
    2613             :         NTSTATUS status;
    2614             :         TALLOC_CTX *mem_ctx;
    2615             : 
    2616           0 :         if (state->out_mem_ctx) {
    2617           0 :                 mem_ctx = state->out_mem_ctx;
    2618             :         } else {
    2619           0 :                 mem_ctx = state;
    2620             :         }
    2621             : 
    2622           0 :         status = dcerpc_samr_EnumDomainGroups_r_recv(subreq, mem_ctx);
    2623           0 :         TALLOC_FREE(subreq);
    2624           0 :         if (tevent_req_nterror(req, status)) {
    2625           0 :                 return;
    2626             :         }
    2627             : 
    2628             :         /* Copy out parameters */
    2629           0 :         *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
    2630           0 :         *state->orig.out.sam = *state->tmp.out.sam;
    2631           0 :         *state->orig.out.num_entries = *state->tmp.out.num_entries;
    2632             : 
    2633             :         /* Copy result */
    2634           0 :         state->orig.out.result = state->tmp.out.result;
    2635             : 
    2636             :         /* Reset temporary structure */
    2637           0 :         NDR_ZERO_STRUCT(state->tmp);
    2638             : 
    2639           0 :         tevent_req_done(req);
    2640             : }
    2641             : 
    2642           0 : NTSTATUS dcerpc_samr_EnumDomainGroups_recv(struct tevent_req *req,
    2643             :                                            TALLOC_CTX *mem_ctx,
    2644             :                                            NTSTATUS *result)
    2645             : {
    2646           0 :         struct dcerpc_samr_EnumDomainGroups_state *state = tevent_req_data(
    2647             :                 req, struct dcerpc_samr_EnumDomainGroups_state);
    2648             :         NTSTATUS status;
    2649             : 
    2650           0 :         if (tevent_req_is_nterror(req, &status)) {
    2651           0 :                 tevent_req_received(req);
    2652           0 :                 return status;
    2653             :         }
    2654             : 
    2655             :         /* Steal possible out parameters to the callers context */
    2656           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2657             : 
    2658             :         /* Return result */
    2659           0 :         *result = state->orig.out.result;
    2660             : 
    2661           0 :         tevent_req_received(req);
    2662           0 :         return NT_STATUS_OK;
    2663             : }
    2664             : 
    2665           0 : NTSTATUS dcerpc_samr_EnumDomainGroups(struct dcerpc_binding_handle *h,
    2666             :                                       TALLOC_CTX *mem_ctx,
    2667             :                                       struct policy_handle *_domain_handle /* [in] [ref] */,
    2668             :                                       uint32_t *_resume_handle /* [in,out] [ref] */,
    2669             :                                       struct samr_SamArray **_sam /* [out] [ref] */,
    2670             :                                       uint32_t _max_size /* [in]  */,
    2671             :                                       uint32_t *_num_entries /* [out] [ref] */,
    2672             :                                       NTSTATUS *result)
    2673             : {
    2674             :         struct samr_EnumDomainGroups r;
    2675             :         NTSTATUS status;
    2676             : 
    2677             :         /* In parameters */
    2678           0 :         r.in.domain_handle = _domain_handle;
    2679           0 :         r.in.resume_handle = _resume_handle;
    2680           0 :         r.in.max_size = _max_size;
    2681             : 
    2682             :         /* Out parameters */
    2683           0 :         r.out.resume_handle = _resume_handle;
    2684           0 :         r.out.sam = _sam;
    2685           0 :         r.out.num_entries = _num_entries;
    2686             : 
    2687             :         /* Result */
    2688           0 :         NDR_ZERO_STRUCT(r.out.result);
    2689             : 
    2690           0 :         status = dcerpc_samr_EnumDomainGroups_r(h, mem_ctx, &r);
    2691           0 :         if (!NT_STATUS_IS_OK(status)) {
    2692           0 :                 return status;
    2693             :         }
    2694             : 
    2695             :         /* Return variables */
    2696           0 :         *_resume_handle = *r.out.resume_handle;
    2697           0 :         *_sam = *r.out.sam;
    2698           0 :         *_num_entries = *r.out.num_entries;
    2699             : 
    2700             :         /* Return result */
    2701           0 :         *result = r.out.result;
    2702             : 
    2703           0 :         return NT_STATUS_OK;
    2704             : }
    2705             : 
    2706             : struct dcerpc_samr_CreateUser_r_state {
    2707             :         TALLOC_CTX *out_mem_ctx;
    2708             : };
    2709             : 
    2710             : static void dcerpc_samr_CreateUser_r_done(struct tevent_req *subreq);
    2711             : 
    2712           3 : struct tevent_req *dcerpc_samr_CreateUser_r_send(TALLOC_CTX *mem_ctx,
    2713             :         struct tevent_context *ev,
    2714             :         struct dcerpc_binding_handle *h,
    2715             :         struct samr_CreateUser *r)
    2716             : {
    2717             :         struct tevent_req *req;
    2718             :         struct dcerpc_samr_CreateUser_r_state *state;
    2719             :         struct tevent_req *subreq;
    2720             : 
    2721           3 :         req = tevent_req_create(mem_ctx, &state,
    2722             :                                 struct dcerpc_samr_CreateUser_r_state);
    2723           3 :         if (req == NULL) {
    2724           0 :                 return NULL;
    2725             :         }
    2726             : 
    2727           3 :         state->out_mem_ctx = talloc_new(state);
    2728           3 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2729           0 :                 return tevent_req_post(req, ev);
    2730             :         }
    2731             : 
    2732           3 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2733             :                         NULL, &ndr_table_samr,
    2734           3 :                         NDR_SAMR_CREATEUSER, state->out_mem_ctx, r);
    2735           3 :         if (tevent_req_nomem(subreq, req)) {
    2736           0 :                 return tevent_req_post(req, ev);
    2737             :         }
    2738           3 :         tevent_req_set_callback(subreq, dcerpc_samr_CreateUser_r_done, req);
    2739             : 
    2740           3 :         return req;
    2741             : }
    2742             : 
    2743           3 : static void dcerpc_samr_CreateUser_r_done(struct tevent_req *subreq)
    2744             : {
    2745           3 :         struct tevent_req *req =
    2746           3 :                 tevent_req_callback_data(subreq,
    2747             :                 struct tevent_req);
    2748             :         NTSTATUS status;
    2749             : 
    2750           3 :         status = dcerpc_binding_handle_call_recv(subreq);
    2751           3 :         TALLOC_FREE(subreq);
    2752           3 :         if (tevent_req_nterror(req, status)) {
    2753           0 :                 return;
    2754             :         }
    2755             : 
    2756           3 :         tevent_req_done(req);
    2757             : }
    2758             : 
    2759           3 : NTSTATUS dcerpc_samr_CreateUser_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2760             : {
    2761           3 :         struct dcerpc_samr_CreateUser_r_state *state =
    2762           3 :                 tevent_req_data(req,
    2763             :                 struct dcerpc_samr_CreateUser_r_state);
    2764             :         NTSTATUS status;
    2765             : 
    2766           3 :         if (tevent_req_is_nterror(req, &status)) {
    2767           0 :                 tevent_req_received(req);
    2768           0 :                 return status;
    2769             :         }
    2770             : 
    2771           3 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2772             : 
    2773           3 :         tevent_req_received(req);
    2774           3 :         return NT_STATUS_OK;
    2775             : }
    2776             : 
    2777        2188 : NTSTATUS dcerpc_samr_CreateUser_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_CreateUser *r)
    2778             : {
    2779             :         NTSTATUS status;
    2780             : 
    2781        2188 :         status = dcerpc_binding_handle_call(h,
    2782             :                         NULL, &ndr_table_samr,
    2783             :                         NDR_SAMR_CREATEUSER, mem_ctx, r);
    2784             : 
    2785        2188 :         return status;
    2786             : }
    2787             : 
    2788             : struct dcerpc_samr_CreateUser_state {
    2789             :         struct samr_CreateUser orig;
    2790             :         struct samr_CreateUser tmp;
    2791             :         TALLOC_CTX *out_mem_ctx;
    2792             : };
    2793             : 
    2794             : static void dcerpc_samr_CreateUser_done(struct tevent_req *subreq);
    2795             : 
    2796           0 : struct tevent_req *dcerpc_samr_CreateUser_send(TALLOC_CTX *mem_ctx,
    2797             :                                                struct tevent_context *ev,
    2798             :                                                struct dcerpc_binding_handle *h,
    2799             :                                                struct policy_handle *_domain_handle /* [in] [ref] */,
    2800             :                                                struct lsa_String *_account_name /* [in] [ref] */,
    2801             :                                                uint32_t _access_mask /* [in]  */,
    2802             :                                                struct policy_handle *_user_handle /* [out] [ref] */,
    2803             :                                                uint32_t *_rid /* [out] [ref] */)
    2804             : {
    2805             :         struct tevent_req *req;
    2806             :         struct dcerpc_samr_CreateUser_state *state;
    2807             :         struct tevent_req *subreq;
    2808             : 
    2809           0 :         req = tevent_req_create(mem_ctx, &state,
    2810             :                                 struct dcerpc_samr_CreateUser_state);
    2811           0 :         if (req == NULL) {
    2812           0 :                 return NULL;
    2813             :         }
    2814           0 :         state->out_mem_ctx = NULL;
    2815             : 
    2816             :         /* In parameters */
    2817           0 :         state->orig.in.domain_handle = _domain_handle;
    2818           0 :         state->orig.in.account_name = _account_name;
    2819           0 :         state->orig.in.access_mask = _access_mask;
    2820             : 
    2821             :         /* Out parameters */
    2822           0 :         state->orig.out.user_handle = _user_handle;
    2823           0 :         state->orig.out.rid = _rid;
    2824             : 
    2825             :         /* Result */
    2826           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2827             : 
    2828           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2829             :                              "dcerpc_samr_CreateUser_out_memory");
    2830           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2831           0 :                 return tevent_req_post(req, ev);
    2832             :         }
    2833             : 
    2834             :         /* make a temporary copy, that we pass to the dispatch function */
    2835           0 :         state->tmp = state->orig;
    2836             : 
    2837           0 :         subreq = dcerpc_samr_CreateUser_r_send(state, ev, h, &state->tmp);
    2838           0 :         if (tevent_req_nomem(subreq, req)) {
    2839           0 :                 return tevent_req_post(req, ev);
    2840             :         }
    2841           0 :         tevent_req_set_callback(subreq, dcerpc_samr_CreateUser_done, req);
    2842           0 :         return req;
    2843             : }
    2844             : 
    2845           0 : static void dcerpc_samr_CreateUser_done(struct tevent_req *subreq)
    2846             : {
    2847           0 :         struct tevent_req *req = tevent_req_callback_data(
    2848             :                 subreq, struct tevent_req);
    2849           0 :         struct dcerpc_samr_CreateUser_state *state = tevent_req_data(
    2850             :                 req, struct dcerpc_samr_CreateUser_state);
    2851             :         NTSTATUS status;
    2852             :         TALLOC_CTX *mem_ctx;
    2853             : 
    2854           0 :         if (state->out_mem_ctx) {
    2855           0 :                 mem_ctx = state->out_mem_ctx;
    2856             :         } else {
    2857           0 :                 mem_ctx = state;
    2858             :         }
    2859             : 
    2860           0 :         status = dcerpc_samr_CreateUser_r_recv(subreq, mem_ctx);
    2861           0 :         TALLOC_FREE(subreq);
    2862           0 :         if (tevent_req_nterror(req, status)) {
    2863           0 :                 return;
    2864             :         }
    2865             : 
    2866             :         /* Copy out parameters */
    2867           0 :         *state->orig.out.user_handle = *state->tmp.out.user_handle;
    2868           0 :         *state->orig.out.rid = *state->tmp.out.rid;
    2869             : 
    2870             :         /* Copy result */
    2871           0 :         state->orig.out.result = state->tmp.out.result;
    2872             : 
    2873             :         /* Reset temporary structure */
    2874           0 :         NDR_ZERO_STRUCT(state->tmp);
    2875             : 
    2876           0 :         tevent_req_done(req);
    2877             : }
    2878             : 
    2879           0 : NTSTATUS dcerpc_samr_CreateUser_recv(struct tevent_req *req,
    2880             :                                      TALLOC_CTX *mem_ctx,
    2881             :                                      NTSTATUS *result)
    2882             : {
    2883           0 :         struct dcerpc_samr_CreateUser_state *state = tevent_req_data(
    2884             :                 req, struct dcerpc_samr_CreateUser_state);
    2885             :         NTSTATUS status;
    2886             : 
    2887           0 :         if (tevent_req_is_nterror(req, &status)) {
    2888           0 :                 tevent_req_received(req);
    2889           0 :                 return status;
    2890             :         }
    2891             : 
    2892             :         /* Steal possible out parameters to the callers context */
    2893           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2894             : 
    2895             :         /* Return result */
    2896           0 :         *result = state->orig.out.result;
    2897             : 
    2898           0 :         tevent_req_received(req);
    2899           0 :         return NT_STATUS_OK;
    2900             : }
    2901             : 
    2902           0 : NTSTATUS dcerpc_samr_CreateUser(struct dcerpc_binding_handle *h,
    2903             :                                 TALLOC_CTX *mem_ctx,
    2904             :                                 struct policy_handle *_domain_handle /* [in] [ref] */,
    2905             :                                 struct lsa_String *_account_name /* [in] [ref] */,
    2906             :                                 uint32_t _access_mask /* [in]  */,
    2907             :                                 struct policy_handle *_user_handle /* [out] [ref] */,
    2908             :                                 uint32_t *_rid /* [out] [ref] */,
    2909             :                                 NTSTATUS *result)
    2910             : {
    2911             :         struct samr_CreateUser r;
    2912             :         NTSTATUS status;
    2913             : 
    2914             :         /* In parameters */
    2915           0 :         r.in.domain_handle = _domain_handle;
    2916           0 :         r.in.account_name = _account_name;
    2917           0 :         r.in.access_mask = _access_mask;
    2918             : 
    2919             :         /* Out parameters */
    2920           0 :         r.out.user_handle = _user_handle;
    2921           0 :         r.out.rid = _rid;
    2922             : 
    2923             :         /* Result */
    2924           0 :         NDR_ZERO_STRUCT(r.out.result);
    2925             : 
    2926           0 :         status = dcerpc_samr_CreateUser_r(h, mem_ctx, &r);
    2927           0 :         if (!NT_STATUS_IS_OK(status)) {
    2928           0 :                 return status;
    2929             :         }
    2930             : 
    2931             :         /* Return variables */
    2932           0 :         *_user_handle = *r.out.user_handle;
    2933           0 :         *_rid = *r.out.rid;
    2934             : 
    2935             :         /* Return result */
    2936           0 :         *result = r.out.result;
    2937             : 
    2938           0 :         return NT_STATUS_OK;
    2939             : }
    2940             : 
    2941             : struct dcerpc_samr_EnumDomainUsers_r_state {
    2942             :         TALLOC_CTX *out_mem_ctx;
    2943             : };
    2944             : 
    2945             : static void dcerpc_samr_EnumDomainUsers_r_done(struct tevent_req *subreq);
    2946             : 
    2947           4 : struct tevent_req *dcerpc_samr_EnumDomainUsers_r_send(TALLOC_CTX *mem_ctx,
    2948             :         struct tevent_context *ev,
    2949             :         struct dcerpc_binding_handle *h,
    2950             :         struct samr_EnumDomainUsers *r)
    2951             : {
    2952             :         struct tevent_req *req;
    2953             :         struct dcerpc_samr_EnumDomainUsers_r_state *state;
    2954             :         struct tevent_req *subreq;
    2955             : 
    2956           4 :         req = tevent_req_create(mem_ctx, &state,
    2957             :                                 struct dcerpc_samr_EnumDomainUsers_r_state);
    2958           4 :         if (req == NULL) {
    2959           0 :                 return NULL;
    2960             :         }
    2961             : 
    2962           4 :         state->out_mem_ctx = talloc_new(state);
    2963           4 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2964           0 :                 return tevent_req_post(req, ev);
    2965             :         }
    2966             : 
    2967           4 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2968             :                         NULL, &ndr_table_samr,
    2969           4 :                         NDR_SAMR_ENUMDOMAINUSERS, state->out_mem_ctx, r);
    2970           4 :         if (tevent_req_nomem(subreq, req)) {
    2971           0 :                 return tevent_req_post(req, ev);
    2972             :         }
    2973           4 :         tevent_req_set_callback(subreq, dcerpc_samr_EnumDomainUsers_r_done, req);
    2974             : 
    2975           4 :         return req;
    2976             : }
    2977             : 
    2978           4 : static void dcerpc_samr_EnumDomainUsers_r_done(struct tevent_req *subreq)
    2979             : {
    2980           4 :         struct tevent_req *req =
    2981           4 :                 tevent_req_callback_data(subreq,
    2982             :                 struct tevent_req);
    2983             :         NTSTATUS status;
    2984             : 
    2985           4 :         status = dcerpc_binding_handle_call_recv(subreq);
    2986           4 :         TALLOC_FREE(subreq);
    2987           4 :         if (tevent_req_nterror(req, status)) {
    2988           0 :                 return;
    2989             :         }
    2990             : 
    2991           4 :         tevent_req_done(req);
    2992             : }
    2993             : 
    2994           4 : NTSTATUS dcerpc_samr_EnumDomainUsers_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2995             : {
    2996           4 :         struct dcerpc_samr_EnumDomainUsers_r_state *state =
    2997           4 :                 tevent_req_data(req,
    2998             :                 struct dcerpc_samr_EnumDomainUsers_r_state);
    2999             :         NTSTATUS status;
    3000             : 
    3001           4 :         if (tevent_req_is_nterror(req, &status)) {
    3002           0 :                 tevent_req_received(req);
    3003           0 :                 return status;
    3004             :         }
    3005             : 
    3006           4 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3007             : 
    3008           4 :         tevent_req_received(req);
    3009           4 :         return NT_STATUS_OK;
    3010             : }
    3011             : 
    3012         121 : NTSTATUS dcerpc_samr_EnumDomainUsers_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_EnumDomainUsers *r)
    3013             : {
    3014             :         NTSTATUS status;
    3015             : 
    3016         121 :         status = dcerpc_binding_handle_call(h,
    3017             :                         NULL, &ndr_table_samr,
    3018             :                         NDR_SAMR_ENUMDOMAINUSERS, mem_ctx, r);
    3019             : 
    3020         121 :         return status;
    3021             : }
    3022             : 
    3023             : struct dcerpc_samr_EnumDomainUsers_state {
    3024             :         struct samr_EnumDomainUsers orig;
    3025             :         struct samr_EnumDomainUsers tmp;
    3026             :         TALLOC_CTX *out_mem_ctx;
    3027             : };
    3028             : 
    3029             : static void dcerpc_samr_EnumDomainUsers_done(struct tevent_req *subreq);
    3030             : 
    3031           0 : struct tevent_req *dcerpc_samr_EnumDomainUsers_send(TALLOC_CTX *mem_ctx,
    3032             :                                                     struct tevent_context *ev,
    3033             :                                                     struct dcerpc_binding_handle *h,
    3034             :                                                     struct policy_handle *_domain_handle /* [in] [ref] */,
    3035             :                                                     uint32_t *_resume_handle /* [in,out] [ref] */,
    3036             :                                                     uint32_t _acct_flags /* [in]  */,
    3037             :                                                     struct samr_SamArray **_sam /* [out] [ref] */,
    3038             :                                                     uint32_t _max_size /* [in]  */,
    3039             :                                                     uint32_t *_num_entries /* [out] [ref] */)
    3040             : {
    3041             :         struct tevent_req *req;
    3042             :         struct dcerpc_samr_EnumDomainUsers_state *state;
    3043             :         struct tevent_req *subreq;
    3044             : 
    3045           0 :         req = tevent_req_create(mem_ctx, &state,
    3046             :                                 struct dcerpc_samr_EnumDomainUsers_state);
    3047           0 :         if (req == NULL) {
    3048           0 :                 return NULL;
    3049             :         }
    3050           0 :         state->out_mem_ctx = NULL;
    3051             : 
    3052             :         /* In parameters */
    3053           0 :         state->orig.in.domain_handle = _domain_handle;
    3054           0 :         state->orig.in.resume_handle = _resume_handle;
    3055           0 :         state->orig.in.acct_flags = _acct_flags;
    3056           0 :         state->orig.in.max_size = _max_size;
    3057             : 
    3058             :         /* Out parameters */
    3059           0 :         state->orig.out.resume_handle = _resume_handle;
    3060           0 :         state->orig.out.sam = _sam;
    3061           0 :         state->orig.out.num_entries = _num_entries;
    3062             : 
    3063             :         /* Result */
    3064           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3065             : 
    3066           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3067             :                              "dcerpc_samr_EnumDomainUsers_out_memory");
    3068           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3069           0 :                 return tevent_req_post(req, ev);
    3070             :         }
    3071             : 
    3072             :         /* make a temporary copy, that we pass to the dispatch function */
    3073           0 :         state->tmp = state->orig;
    3074             : 
    3075           0 :         subreq = dcerpc_samr_EnumDomainUsers_r_send(state, ev, h, &state->tmp);
    3076           0 :         if (tevent_req_nomem(subreq, req)) {
    3077           0 :                 return tevent_req_post(req, ev);
    3078             :         }
    3079           0 :         tevent_req_set_callback(subreq, dcerpc_samr_EnumDomainUsers_done, req);
    3080           0 :         return req;
    3081             : }
    3082             : 
    3083           0 : static void dcerpc_samr_EnumDomainUsers_done(struct tevent_req *subreq)
    3084             : {
    3085           0 :         struct tevent_req *req = tevent_req_callback_data(
    3086             :                 subreq, struct tevent_req);
    3087           0 :         struct dcerpc_samr_EnumDomainUsers_state *state = tevent_req_data(
    3088             :                 req, struct dcerpc_samr_EnumDomainUsers_state);
    3089             :         NTSTATUS status;
    3090             :         TALLOC_CTX *mem_ctx;
    3091             : 
    3092           0 :         if (state->out_mem_ctx) {
    3093           0 :                 mem_ctx = state->out_mem_ctx;
    3094             :         } else {
    3095           0 :                 mem_ctx = state;
    3096             :         }
    3097             : 
    3098           0 :         status = dcerpc_samr_EnumDomainUsers_r_recv(subreq, mem_ctx);
    3099           0 :         TALLOC_FREE(subreq);
    3100           0 :         if (tevent_req_nterror(req, status)) {
    3101           0 :                 return;
    3102             :         }
    3103             : 
    3104             :         /* Copy out parameters */
    3105           0 :         *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
    3106           0 :         *state->orig.out.sam = *state->tmp.out.sam;
    3107           0 :         *state->orig.out.num_entries = *state->tmp.out.num_entries;
    3108             : 
    3109             :         /* Copy result */
    3110           0 :         state->orig.out.result = state->tmp.out.result;
    3111             : 
    3112             :         /* Reset temporary structure */
    3113           0 :         NDR_ZERO_STRUCT(state->tmp);
    3114             : 
    3115           0 :         tevent_req_done(req);
    3116             : }
    3117             : 
    3118           0 : NTSTATUS dcerpc_samr_EnumDomainUsers_recv(struct tevent_req *req,
    3119             :                                           TALLOC_CTX *mem_ctx,
    3120             :                                           NTSTATUS *result)
    3121             : {
    3122           0 :         struct dcerpc_samr_EnumDomainUsers_state *state = tevent_req_data(
    3123             :                 req, struct dcerpc_samr_EnumDomainUsers_state);
    3124             :         NTSTATUS status;
    3125             : 
    3126           0 :         if (tevent_req_is_nterror(req, &status)) {
    3127           0 :                 tevent_req_received(req);
    3128           0 :                 return status;
    3129             :         }
    3130             : 
    3131             :         /* Steal possible out parameters to the callers context */
    3132           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3133             : 
    3134             :         /* Return result */
    3135           0 :         *result = state->orig.out.result;
    3136             : 
    3137           0 :         tevent_req_received(req);
    3138           0 :         return NT_STATUS_OK;
    3139             : }
    3140             : 
    3141           9 : NTSTATUS dcerpc_samr_EnumDomainUsers(struct dcerpc_binding_handle *h,
    3142             :                                      TALLOC_CTX *mem_ctx,
    3143             :                                      struct policy_handle *_domain_handle /* [in] [ref] */,
    3144             :                                      uint32_t *_resume_handle /* [in,out] [ref] */,
    3145             :                                      uint32_t _acct_flags /* [in]  */,
    3146             :                                      struct samr_SamArray **_sam /* [out] [ref] */,
    3147             :                                      uint32_t _max_size /* [in]  */,
    3148             :                                      uint32_t *_num_entries /* [out] [ref] */,
    3149             :                                      NTSTATUS *result)
    3150             : {
    3151             :         struct samr_EnumDomainUsers r;
    3152             :         NTSTATUS status;
    3153             : 
    3154             :         /* In parameters */
    3155           9 :         r.in.domain_handle = _domain_handle;
    3156           9 :         r.in.resume_handle = _resume_handle;
    3157           9 :         r.in.acct_flags = _acct_flags;
    3158           9 :         r.in.max_size = _max_size;
    3159             : 
    3160             :         /* Out parameters */
    3161           9 :         r.out.resume_handle = _resume_handle;
    3162           9 :         r.out.sam = _sam;
    3163           9 :         r.out.num_entries = _num_entries;
    3164             : 
    3165             :         /* Result */
    3166           9 :         NDR_ZERO_STRUCT(r.out.result);
    3167             : 
    3168           9 :         status = dcerpc_samr_EnumDomainUsers_r(h, mem_ctx, &r);
    3169           9 :         if (!NT_STATUS_IS_OK(status)) {
    3170           0 :                 return status;
    3171             :         }
    3172             : 
    3173             :         /* Return variables */
    3174           9 :         *_resume_handle = *r.out.resume_handle;
    3175           9 :         *_sam = *r.out.sam;
    3176           9 :         *_num_entries = *r.out.num_entries;
    3177             : 
    3178             :         /* Return result */
    3179           9 :         *result = r.out.result;
    3180             : 
    3181           9 :         return NT_STATUS_OK;
    3182             : }
    3183             : 
    3184             : struct dcerpc_samr_CreateDomAlias_r_state {
    3185             :         TALLOC_CTX *out_mem_ctx;
    3186             : };
    3187             : 
    3188             : static void dcerpc_samr_CreateDomAlias_r_done(struct tevent_req *subreq);
    3189             : 
    3190           0 : struct tevent_req *dcerpc_samr_CreateDomAlias_r_send(TALLOC_CTX *mem_ctx,
    3191             :         struct tevent_context *ev,
    3192             :         struct dcerpc_binding_handle *h,
    3193             :         struct samr_CreateDomAlias *r)
    3194             : {
    3195             :         struct tevent_req *req;
    3196             :         struct dcerpc_samr_CreateDomAlias_r_state *state;
    3197             :         struct tevent_req *subreq;
    3198             : 
    3199           0 :         req = tevent_req_create(mem_ctx, &state,
    3200             :                                 struct dcerpc_samr_CreateDomAlias_r_state);
    3201           0 :         if (req == NULL) {
    3202           0 :                 return NULL;
    3203             :         }
    3204             : 
    3205           0 :         state->out_mem_ctx = talloc_new(state);
    3206           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3207           0 :                 return tevent_req_post(req, ev);
    3208             :         }
    3209             : 
    3210           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3211             :                         NULL, &ndr_table_samr,
    3212           0 :                         NDR_SAMR_CREATEDOMALIAS, state->out_mem_ctx, r);
    3213           0 :         if (tevent_req_nomem(subreq, req)) {
    3214           0 :                 return tevent_req_post(req, ev);
    3215             :         }
    3216           0 :         tevent_req_set_callback(subreq, dcerpc_samr_CreateDomAlias_r_done, req);
    3217             : 
    3218           0 :         return req;
    3219             : }
    3220             : 
    3221           0 : static void dcerpc_samr_CreateDomAlias_r_done(struct tevent_req *subreq)
    3222             : {
    3223           0 :         struct tevent_req *req =
    3224           0 :                 tevent_req_callback_data(subreq,
    3225             :                 struct tevent_req);
    3226             :         NTSTATUS status;
    3227             : 
    3228           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3229           0 :         TALLOC_FREE(subreq);
    3230           0 :         if (tevent_req_nterror(req, status)) {
    3231           0 :                 return;
    3232             :         }
    3233             : 
    3234           0 :         tevent_req_done(req);
    3235             : }
    3236             : 
    3237           0 : NTSTATUS dcerpc_samr_CreateDomAlias_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3238             : {
    3239           0 :         struct dcerpc_samr_CreateDomAlias_r_state *state =
    3240           0 :                 tevent_req_data(req,
    3241             :                 struct dcerpc_samr_CreateDomAlias_r_state);
    3242             :         NTSTATUS status;
    3243             : 
    3244           0 :         if (tevent_req_is_nterror(req, &status)) {
    3245           0 :                 tevent_req_received(req);
    3246           0 :                 return status;
    3247             :         }
    3248             : 
    3249           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3250             : 
    3251           0 :         tevent_req_received(req);
    3252           0 :         return NT_STATUS_OK;
    3253             : }
    3254             : 
    3255        2114 : NTSTATUS dcerpc_samr_CreateDomAlias_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_CreateDomAlias *r)
    3256             : {
    3257             :         NTSTATUS status;
    3258             : 
    3259        2114 :         status = dcerpc_binding_handle_call(h,
    3260             :                         NULL, &ndr_table_samr,
    3261             :                         NDR_SAMR_CREATEDOMALIAS, mem_ctx, r);
    3262             : 
    3263        2114 :         return status;
    3264             : }
    3265             : 
    3266             : struct dcerpc_samr_CreateDomAlias_state {
    3267             :         struct samr_CreateDomAlias orig;
    3268             :         struct samr_CreateDomAlias tmp;
    3269             :         TALLOC_CTX *out_mem_ctx;
    3270             : };
    3271             : 
    3272             : static void dcerpc_samr_CreateDomAlias_done(struct tevent_req *subreq);
    3273             : 
    3274           0 : struct tevent_req *dcerpc_samr_CreateDomAlias_send(TALLOC_CTX *mem_ctx,
    3275             :                                                    struct tevent_context *ev,
    3276             :                                                    struct dcerpc_binding_handle *h,
    3277             :                                                    struct policy_handle *_domain_handle /* [in] [ref] */,
    3278             :                                                    struct lsa_String *_alias_name /* [in] [ref] */,
    3279             :                                                    uint32_t _access_mask /* [in]  */,
    3280             :                                                    struct policy_handle *_alias_handle /* [out] [ref] */,
    3281             :                                                    uint32_t *_rid /* [out] [ref] */)
    3282             : {
    3283             :         struct tevent_req *req;
    3284             :         struct dcerpc_samr_CreateDomAlias_state *state;
    3285             :         struct tevent_req *subreq;
    3286             : 
    3287           0 :         req = tevent_req_create(mem_ctx, &state,
    3288             :                                 struct dcerpc_samr_CreateDomAlias_state);
    3289           0 :         if (req == NULL) {
    3290           0 :                 return NULL;
    3291             :         }
    3292           0 :         state->out_mem_ctx = NULL;
    3293             : 
    3294             :         /* In parameters */
    3295           0 :         state->orig.in.domain_handle = _domain_handle;
    3296           0 :         state->orig.in.alias_name = _alias_name;
    3297           0 :         state->orig.in.access_mask = _access_mask;
    3298             : 
    3299             :         /* Out parameters */
    3300           0 :         state->orig.out.alias_handle = _alias_handle;
    3301           0 :         state->orig.out.rid = _rid;
    3302             : 
    3303             :         /* Result */
    3304           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3305             : 
    3306           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3307             :                              "dcerpc_samr_CreateDomAlias_out_memory");
    3308           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3309           0 :                 return tevent_req_post(req, ev);
    3310             :         }
    3311             : 
    3312             :         /* make a temporary copy, that we pass to the dispatch function */
    3313           0 :         state->tmp = state->orig;
    3314             : 
    3315           0 :         subreq = dcerpc_samr_CreateDomAlias_r_send(state, ev, h, &state->tmp);
    3316           0 :         if (tevent_req_nomem(subreq, req)) {
    3317           0 :                 return tevent_req_post(req, ev);
    3318             :         }
    3319           0 :         tevent_req_set_callback(subreq, dcerpc_samr_CreateDomAlias_done, req);
    3320           0 :         return req;
    3321             : }
    3322             : 
    3323           0 : static void dcerpc_samr_CreateDomAlias_done(struct tevent_req *subreq)
    3324             : {
    3325           0 :         struct tevent_req *req = tevent_req_callback_data(
    3326             :                 subreq, struct tevent_req);
    3327           0 :         struct dcerpc_samr_CreateDomAlias_state *state = tevent_req_data(
    3328             :                 req, struct dcerpc_samr_CreateDomAlias_state);
    3329             :         NTSTATUS status;
    3330             :         TALLOC_CTX *mem_ctx;
    3331             : 
    3332           0 :         if (state->out_mem_ctx) {
    3333           0 :                 mem_ctx = state->out_mem_ctx;
    3334             :         } else {
    3335           0 :                 mem_ctx = state;
    3336             :         }
    3337             : 
    3338           0 :         status = dcerpc_samr_CreateDomAlias_r_recv(subreq, mem_ctx);
    3339           0 :         TALLOC_FREE(subreq);
    3340           0 :         if (tevent_req_nterror(req, status)) {
    3341           0 :                 return;
    3342             :         }
    3343             : 
    3344             :         /* Copy out parameters */
    3345           0 :         *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
    3346           0 :         *state->orig.out.rid = *state->tmp.out.rid;
    3347             : 
    3348             :         /* Copy result */
    3349           0 :         state->orig.out.result = state->tmp.out.result;
    3350             : 
    3351             :         /* Reset temporary structure */
    3352           0 :         NDR_ZERO_STRUCT(state->tmp);
    3353             : 
    3354           0 :         tevent_req_done(req);
    3355             : }
    3356             : 
    3357           0 : NTSTATUS dcerpc_samr_CreateDomAlias_recv(struct tevent_req *req,
    3358             :                                          TALLOC_CTX *mem_ctx,
    3359             :                                          NTSTATUS *result)
    3360             : {
    3361           0 :         struct dcerpc_samr_CreateDomAlias_state *state = tevent_req_data(
    3362             :                 req, struct dcerpc_samr_CreateDomAlias_state);
    3363             :         NTSTATUS status;
    3364             : 
    3365           0 :         if (tevent_req_is_nterror(req, &status)) {
    3366           0 :                 tevent_req_received(req);
    3367           0 :                 return status;
    3368             :         }
    3369             : 
    3370             :         /* Steal possible out parameters to the callers context */
    3371           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3372             : 
    3373             :         /* Return result */
    3374           0 :         *result = state->orig.out.result;
    3375             : 
    3376           0 :         tevent_req_received(req);
    3377           0 :         return NT_STATUS_OK;
    3378             : }
    3379             : 
    3380           0 : NTSTATUS dcerpc_samr_CreateDomAlias(struct dcerpc_binding_handle *h,
    3381             :                                     TALLOC_CTX *mem_ctx,
    3382             :                                     struct policy_handle *_domain_handle /* [in] [ref] */,
    3383             :                                     struct lsa_String *_alias_name /* [in] [ref] */,
    3384             :                                     uint32_t _access_mask /* [in]  */,
    3385             :                                     struct policy_handle *_alias_handle /* [out] [ref] */,
    3386             :                                     uint32_t *_rid /* [out] [ref] */,
    3387             :                                     NTSTATUS *result)
    3388             : {
    3389             :         struct samr_CreateDomAlias r;
    3390             :         NTSTATUS status;
    3391             : 
    3392             :         /* In parameters */
    3393           0 :         r.in.domain_handle = _domain_handle;
    3394           0 :         r.in.alias_name = _alias_name;
    3395           0 :         r.in.access_mask = _access_mask;
    3396             : 
    3397             :         /* Out parameters */
    3398           0 :         r.out.alias_handle = _alias_handle;
    3399           0 :         r.out.rid = _rid;
    3400             : 
    3401             :         /* Result */
    3402           0 :         NDR_ZERO_STRUCT(r.out.result);
    3403             : 
    3404           0 :         status = dcerpc_samr_CreateDomAlias_r(h, mem_ctx, &r);
    3405           0 :         if (!NT_STATUS_IS_OK(status)) {
    3406           0 :                 return status;
    3407             :         }
    3408             : 
    3409             :         /* Return variables */
    3410           0 :         *_alias_handle = *r.out.alias_handle;
    3411           0 :         *_rid = *r.out.rid;
    3412             : 
    3413             :         /* Return result */
    3414           0 :         *result = r.out.result;
    3415             : 
    3416           0 :         return NT_STATUS_OK;
    3417             : }
    3418             : 
    3419             : struct dcerpc_samr_EnumDomainAliases_r_state {
    3420             :         TALLOC_CTX *out_mem_ctx;
    3421             : };
    3422             : 
    3423             : static void dcerpc_samr_EnumDomainAliases_r_done(struct tevent_req *subreq);
    3424             : 
    3425           0 : struct tevent_req *dcerpc_samr_EnumDomainAliases_r_send(TALLOC_CTX *mem_ctx,
    3426             :         struct tevent_context *ev,
    3427             :         struct dcerpc_binding_handle *h,
    3428             :         struct samr_EnumDomainAliases *r)
    3429             : {
    3430             :         struct tevent_req *req;
    3431             :         struct dcerpc_samr_EnumDomainAliases_r_state *state;
    3432             :         struct tevent_req *subreq;
    3433             : 
    3434           0 :         req = tevent_req_create(mem_ctx, &state,
    3435             :                                 struct dcerpc_samr_EnumDomainAliases_r_state);
    3436           0 :         if (req == NULL) {
    3437           0 :                 return NULL;
    3438             :         }
    3439             : 
    3440           0 :         state->out_mem_ctx = talloc_new(state);
    3441           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3442           0 :                 return tevent_req_post(req, ev);
    3443             :         }
    3444             : 
    3445           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3446             :                         NULL, &ndr_table_samr,
    3447           0 :                         NDR_SAMR_ENUMDOMAINALIASES, state->out_mem_ctx, r);
    3448           0 :         if (tevent_req_nomem(subreq, req)) {
    3449           0 :                 return tevent_req_post(req, ev);
    3450             :         }
    3451           0 :         tevent_req_set_callback(subreq, dcerpc_samr_EnumDomainAliases_r_done, req);
    3452             : 
    3453           0 :         return req;
    3454             : }
    3455             : 
    3456           0 : static void dcerpc_samr_EnumDomainAliases_r_done(struct tevent_req *subreq)
    3457             : {
    3458           0 :         struct tevent_req *req =
    3459           0 :                 tevent_req_callback_data(subreq,
    3460             :                 struct tevent_req);
    3461             :         NTSTATUS status;
    3462             : 
    3463           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3464           0 :         TALLOC_FREE(subreq);
    3465           0 :         if (tevent_req_nterror(req, status)) {
    3466           0 :                 return;
    3467             :         }
    3468             : 
    3469           0 :         tevent_req_done(req);
    3470             : }
    3471             : 
    3472           0 : NTSTATUS dcerpc_samr_EnumDomainAliases_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3473             : {
    3474           0 :         struct dcerpc_samr_EnumDomainAliases_r_state *state =
    3475           0 :                 tevent_req_data(req,
    3476             :                 struct dcerpc_samr_EnumDomainAliases_r_state);
    3477             :         NTSTATUS status;
    3478             : 
    3479           0 :         if (tevent_req_is_nterror(req, &status)) {
    3480           0 :                 tevent_req_received(req);
    3481           0 :                 return status;
    3482             :         }
    3483             : 
    3484           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3485             : 
    3486           0 :         tevent_req_received(req);
    3487           0 :         return NT_STATUS_OK;
    3488             : }
    3489             : 
    3490          57 : NTSTATUS dcerpc_samr_EnumDomainAliases_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_EnumDomainAliases *r)
    3491             : {
    3492             :         NTSTATUS status;
    3493             : 
    3494          57 :         status = dcerpc_binding_handle_call(h,
    3495             :                         NULL, &ndr_table_samr,
    3496             :                         NDR_SAMR_ENUMDOMAINALIASES, mem_ctx, r);
    3497             : 
    3498          57 :         return status;
    3499             : }
    3500             : 
    3501             : struct dcerpc_samr_EnumDomainAliases_state {
    3502             :         struct samr_EnumDomainAliases orig;
    3503             :         struct samr_EnumDomainAliases tmp;
    3504             :         TALLOC_CTX *out_mem_ctx;
    3505             : };
    3506             : 
    3507             : static void dcerpc_samr_EnumDomainAliases_done(struct tevent_req *subreq);
    3508             : 
    3509           0 : struct tevent_req *dcerpc_samr_EnumDomainAliases_send(TALLOC_CTX *mem_ctx,
    3510             :                                                       struct tevent_context *ev,
    3511             :                                                       struct dcerpc_binding_handle *h,
    3512             :                                                       struct policy_handle *_domain_handle /* [in] [ref] */,
    3513             :                                                       uint32_t *_resume_handle /* [in,out] [ref] */,
    3514             :                                                       struct samr_SamArray **_sam /* [out] [ref] */,
    3515             :                                                       uint32_t _max_size /* [in]  */,
    3516             :                                                       uint32_t *_num_entries /* [out] [ref] */)
    3517             : {
    3518             :         struct tevent_req *req;
    3519             :         struct dcerpc_samr_EnumDomainAliases_state *state;
    3520             :         struct tevent_req *subreq;
    3521             : 
    3522           0 :         req = tevent_req_create(mem_ctx, &state,
    3523             :                                 struct dcerpc_samr_EnumDomainAliases_state);
    3524           0 :         if (req == NULL) {
    3525           0 :                 return NULL;
    3526             :         }
    3527           0 :         state->out_mem_ctx = NULL;
    3528             : 
    3529             :         /* In parameters */
    3530           0 :         state->orig.in.domain_handle = _domain_handle;
    3531           0 :         state->orig.in.resume_handle = _resume_handle;
    3532           0 :         state->orig.in.max_size = _max_size;
    3533             : 
    3534             :         /* Out parameters */
    3535           0 :         state->orig.out.resume_handle = _resume_handle;
    3536           0 :         state->orig.out.sam = _sam;
    3537           0 :         state->orig.out.num_entries = _num_entries;
    3538             : 
    3539             :         /* Result */
    3540           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3541             : 
    3542           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3543             :                              "dcerpc_samr_EnumDomainAliases_out_memory");
    3544           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3545           0 :                 return tevent_req_post(req, ev);
    3546             :         }
    3547             : 
    3548             :         /* make a temporary copy, that we pass to the dispatch function */
    3549           0 :         state->tmp = state->orig;
    3550             : 
    3551           0 :         subreq = dcerpc_samr_EnumDomainAliases_r_send(state, ev, h, &state->tmp);
    3552           0 :         if (tevent_req_nomem(subreq, req)) {
    3553           0 :                 return tevent_req_post(req, ev);
    3554             :         }
    3555           0 :         tevent_req_set_callback(subreq, dcerpc_samr_EnumDomainAliases_done, req);
    3556           0 :         return req;
    3557             : }
    3558             : 
    3559           0 : static void dcerpc_samr_EnumDomainAliases_done(struct tevent_req *subreq)
    3560             : {
    3561           0 :         struct tevent_req *req = tevent_req_callback_data(
    3562             :                 subreq, struct tevent_req);
    3563           0 :         struct dcerpc_samr_EnumDomainAliases_state *state = tevent_req_data(
    3564             :                 req, struct dcerpc_samr_EnumDomainAliases_state);
    3565             :         NTSTATUS status;
    3566             :         TALLOC_CTX *mem_ctx;
    3567             : 
    3568           0 :         if (state->out_mem_ctx) {
    3569           0 :                 mem_ctx = state->out_mem_ctx;
    3570             :         } else {
    3571           0 :                 mem_ctx = state;
    3572             :         }
    3573             : 
    3574           0 :         status = dcerpc_samr_EnumDomainAliases_r_recv(subreq, mem_ctx);
    3575           0 :         TALLOC_FREE(subreq);
    3576           0 :         if (tevent_req_nterror(req, status)) {
    3577           0 :                 return;
    3578             :         }
    3579             : 
    3580             :         /* Copy out parameters */
    3581           0 :         *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
    3582           0 :         *state->orig.out.sam = *state->tmp.out.sam;
    3583           0 :         *state->orig.out.num_entries = *state->tmp.out.num_entries;
    3584             : 
    3585             :         /* Copy result */
    3586           0 :         state->orig.out.result = state->tmp.out.result;
    3587             : 
    3588             :         /* Reset temporary structure */
    3589           0 :         NDR_ZERO_STRUCT(state->tmp);
    3590             : 
    3591           0 :         tevent_req_done(req);
    3592             : }
    3593             : 
    3594           0 : NTSTATUS dcerpc_samr_EnumDomainAliases_recv(struct tevent_req *req,
    3595             :                                             TALLOC_CTX *mem_ctx,
    3596             :                                             NTSTATUS *result)
    3597             : {
    3598           0 :         struct dcerpc_samr_EnumDomainAliases_state *state = tevent_req_data(
    3599             :                 req, struct dcerpc_samr_EnumDomainAliases_state);
    3600             :         NTSTATUS status;
    3601             : 
    3602           0 :         if (tevent_req_is_nterror(req, &status)) {
    3603           0 :                 tevent_req_received(req);
    3604           0 :                 return status;
    3605             :         }
    3606             : 
    3607             :         /* Steal possible out parameters to the callers context */
    3608           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3609             : 
    3610             :         /* Return result */
    3611           0 :         *result = state->orig.out.result;
    3612             : 
    3613           0 :         tevent_req_received(req);
    3614           0 :         return NT_STATUS_OK;
    3615             : }
    3616             : 
    3617          16 : NTSTATUS dcerpc_samr_EnumDomainAliases(struct dcerpc_binding_handle *h,
    3618             :                                        TALLOC_CTX *mem_ctx,
    3619             :                                        struct policy_handle *_domain_handle /* [in] [ref] */,
    3620             :                                        uint32_t *_resume_handle /* [in,out] [ref] */,
    3621             :                                        struct samr_SamArray **_sam /* [out] [ref] */,
    3622             :                                        uint32_t _max_size /* [in]  */,
    3623             :                                        uint32_t *_num_entries /* [out] [ref] */,
    3624             :                                        NTSTATUS *result)
    3625             : {
    3626             :         struct samr_EnumDomainAliases r;
    3627             :         NTSTATUS status;
    3628             : 
    3629             :         /* In parameters */
    3630          16 :         r.in.domain_handle = _domain_handle;
    3631          16 :         r.in.resume_handle = _resume_handle;
    3632          16 :         r.in.max_size = _max_size;
    3633             : 
    3634             :         /* Out parameters */
    3635          16 :         r.out.resume_handle = _resume_handle;
    3636          16 :         r.out.sam = _sam;
    3637          16 :         r.out.num_entries = _num_entries;
    3638             : 
    3639             :         /* Result */
    3640          16 :         NDR_ZERO_STRUCT(r.out.result);
    3641             : 
    3642          16 :         status = dcerpc_samr_EnumDomainAliases_r(h, mem_ctx, &r);
    3643          16 :         if (!NT_STATUS_IS_OK(status)) {
    3644           0 :                 return status;
    3645             :         }
    3646             : 
    3647             :         /* Return variables */
    3648          16 :         *_resume_handle = *r.out.resume_handle;
    3649          16 :         *_sam = *r.out.sam;
    3650          16 :         *_num_entries = *r.out.num_entries;
    3651             : 
    3652             :         /* Return result */
    3653          16 :         *result = r.out.result;
    3654             : 
    3655          16 :         return NT_STATUS_OK;
    3656             : }
    3657             : 
    3658             : struct dcerpc_samr_GetAliasMembership_r_state {
    3659             :         TALLOC_CTX *out_mem_ctx;
    3660             : };
    3661             : 
    3662             : static void dcerpc_samr_GetAliasMembership_r_done(struct tevent_req *subreq);
    3663             : 
    3664           0 : struct tevent_req *dcerpc_samr_GetAliasMembership_r_send(TALLOC_CTX *mem_ctx,
    3665             :         struct tevent_context *ev,
    3666             :         struct dcerpc_binding_handle *h,
    3667             :         struct samr_GetAliasMembership *r)
    3668             : {
    3669             :         struct tevent_req *req;
    3670             :         struct dcerpc_samr_GetAliasMembership_r_state *state;
    3671             :         struct tevent_req *subreq;
    3672             : 
    3673           0 :         req = tevent_req_create(mem_ctx, &state,
    3674             :                                 struct dcerpc_samr_GetAliasMembership_r_state);
    3675           0 :         if (req == NULL) {
    3676           0 :                 return NULL;
    3677             :         }
    3678             : 
    3679           0 :         state->out_mem_ctx = talloc_new(state);
    3680           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3681           0 :                 return tevent_req_post(req, ev);
    3682             :         }
    3683             : 
    3684           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3685             :                         NULL, &ndr_table_samr,
    3686           0 :                         NDR_SAMR_GETALIASMEMBERSHIP, state->out_mem_ctx, r);
    3687           0 :         if (tevent_req_nomem(subreq, req)) {
    3688           0 :                 return tevent_req_post(req, ev);
    3689             :         }
    3690           0 :         tevent_req_set_callback(subreq, dcerpc_samr_GetAliasMembership_r_done, req);
    3691             : 
    3692           0 :         return req;
    3693             : }
    3694             : 
    3695           0 : static void dcerpc_samr_GetAliasMembership_r_done(struct tevent_req *subreq)
    3696             : {
    3697           0 :         struct tevent_req *req =
    3698           0 :                 tevent_req_callback_data(subreq,
    3699             :                 struct tevent_req);
    3700             :         NTSTATUS status;
    3701             : 
    3702           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3703           0 :         TALLOC_FREE(subreq);
    3704           0 :         if (tevent_req_nterror(req, status)) {
    3705           0 :                 return;
    3706             :         }
    3707             : 
    3708           0 :         tevent_req_done(req);
    3709             : }
    3710             : 
    3711           0 : NTSTATUS dcerpc_samr_GetAliasMembership_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3712             : {
    3713           0 :         struct dcerpc_samr_GetAliasMembership_r_state *state =
    3714           0 :                 tevent_req_data(req,
    3715             :                 struct dcerpc_samr_GetAliasMembership_r_state);
    3716             :         NTSTATUS status;
    3717             : 
    3718           0 :         if (tevent_req_is_nterror(req, &status)) {
    3719           0 :                 tevent_req_received(req);
    3720           0 :                 return status;
    3721             :         }
    3722             : 
    3723           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3724             : 
    3725           0 :         tevent_req_received(req);
    3726           0 :         return NT_STATUS_OK;
    3727             : }
    3728             : 
    3729         743 : NTSTATUS dcerpc_samr_GetAliasMembership_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_GetAliasMembership *r)
    3730             : {
    3731             :         NTSTATUS status;
    3732             : 
    3733         743 :         status = dcerpc_binding_handle_call(h,
    3734             :                         NULL, &ndr_table_samr,
    3735             :                         NDR_SAMR_GETALIASMEMBERSHIP, mem_ctx, r);
    3736             : 
    3737         743 :         return status;
    3738             : }
    3739             : 
    3740             : struct dcerpc_samr_GetAliasMembership_state {
    3741             :         struct samr_GetAliasMembership orig;
    3742             :         struct samr_GetAliasMembership tmp;
    3743             :         TALLOC_CTX *out_mem_ctx;
    3744             : };
    3745             : 
    3746             : static void dcerpc_samr_GetAliasMembership_done(struct tevent_req *subreq);
    3747             : 
    3748           0 : struct tevent_req *dcerpc_samr_GetAliasMembership_send(TALLOC_CTX *mem_ctx,
    3749             :                                                        struct tevent_context *ev,
    3750             :                                                        struct dcerpc_binding_handle *h,
    3751             :                                                        struct policy_handle *_domain_handle /* [in] [ref] */,
    3752             :                                                        struct lsa_SidArray *_sids /* [in] [ref] */,
    3753             :                                                        struct samr_Ids *_rids /* [out] [ref] */)
    3754             : {
    3755             :         struct tevent_req *req;
    3756             :         struct dcerpc_samr_GetAliasMembership_state *state;
    3757             :         struct tevent_req *subreq;
    3758             : 
    3759           0 :         req = tevent_req_create(mem_ctx, &state,
    3760             :                                 struct dcerpc_samr_GetAliasMembership_state);
    3761           0 :         if (req == NULL) {
    3762           0 :                 return NULL;
    3763             :         }
    3764           0 :         state->out_mem_ctx = NULL;
    3765             : 
    3766             :         /* In parameters */
    3767           0 :         state->orig.in.domain_handle = _domain_handle;
    3768           0 :         state->orig.in.sids = _sids;
    3769             : 
    3770             :         /* Out parameters */
    3771           0 :         state->orig.out.rids = _rids;
    3772             : 
    3773             :         /* Result */
    3774           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3775             : 
    3776           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3777             :                              "dcerpc_samr_GetAliasMembership_out_memory");
    3778           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3779           0 :                 return tevent_req_post(req, ev);
    3780             :         }
    3781             : 
    3782             :         /* make a temporary copy, that we pass to the dispatch function */
    3783           0 :         state->tmp = state->orig;
    3784             : 
    3785           0 :         subreq = dcerpc_samr_GetAliasMembership_r_send(state, ev, h, &state->tmp);
    3786           0 :         if (tevent_req_nomem(subreq, req)) {
    3787           0 :                 return tevent_req_post(req, ev);
    3788             :         }
    3789           0 :         tevent_req_set_callback(subreq, dcerpc_samr_GetAliasMembership_done, req);
    3790           0 :         return req;
    3791             : }
    3792             : 
    3793           0 : static void dcerpc_samr_GetAliasMembership_done(struct tevent_req *subreq)
    3794             : {
    3795           0 :         struct tevent_req *req = tevent_req_callback_data(
    3796             :                 subreq, struct tevent_req);
    3797           0 :         struct dcerpc_samr_GetAliasMembership_state *state = tevent_req_data(
    3798             :                 req, struct dcerpc_samr_GetAliasMembership_state);
    3799             :         NTSTATUS status;
    3800             :         TALLOC_CTX *mem_ctx;
    3801             : 
    3802           0 :         if (state->out_mem_ctx) {
    3803           0 :                 mem_ctx = state->out_mem_ctx;
    3804             :         } else {
    3805           0 :                 mem_ctx = state;
    3806             :         }
    3807             : 
    3808           0 :         status = dcerpc_samr_GetAliasMembership_r_recv(subreq, mem_ctx);
    3809           0 :         TALLOC_FREE(subreq);
    3810           0 :         if (tevent_req_nterror(req, status)) {
    3811           0 :                 return;
    3812             :         }
    3813             : 
    3814             :         /* Copy out parameters */
    3815           0 :         *state->orig.out.rids = *state->tmp.out.rids;
    3816             : 
    3817             :         /* Copy result */
    3818           0 :         state->orig.out.result = state->tmp.out.result;
    3819             : 
    3820             :         /* Reset temporary structure */
    3821           0 :         NDR_ZERO_STRUCT(state->tmp);
    3822             : 
    3823           0 :         tevent_req_done(req);
    3824             : }
    3825             : 
    3826           0 : NTSTATUS dcerpc_samr_GetAliasMembership_recv(struct tevent_req *req,
    3827             :                                              TALLOC_CTX *mem_ctx,
    3828             :                                              NTSTATUS *result)
    3829             : {
    3830           0 :         struct dcerpc_samr_GetAliasMembership_state *state = tevent_req_data(
    3831             :                 req, struct dcerpc_samr_GetAliasMembership_state);
    3832             :         NTSTATUS status;
    3833             : 
    3834           0 :         if (tevent_req_is_nterror(req, &status)) {
    3835           0 :                 tevent_req_received(req);
    3836           0 :                 return status;
    3837             :         }
    3838             : 
    3839             :         /* Steal possible out parameters to the callers context */
    3840           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3841             : 
    3842             :         /* Return result */
    3843           0 :         *result = state->orig.out.result;
    3844             : 
    3845           0 :         tevent_req_received(req);
    3846           0 :         return NT_STATUS_OK;
    3847             : }
    3848             : 
    3849          85 : NTSTATUS dcerpc_samr_GetAliasMembership(struct dcerpc_binding_handle *h,
    3850             :                                         TALLOC_CTX *mem_ctx,
    3851             :                                         struct policy_handle *_domain_handle /* [in] [ref] */,
    3852             :                                         struct lsa_SidArray *_sids /* [in] [ref] */,
    3853             :                                         struct samr_Ids *_rids /* [out] [ref] */,
    3854             :                                         NTSTATUS *result)
    3855             : {
    3856             :         struct samr_GetAliasMembership r;
    3857             :         NTSTATUS status;
    3858             : 
    3859             :         /* In parameters */
    3860          85 :         r.in.domain_handle = _domain_handle;
    3861          85 :         r.in.sids = _sids;
    3862             : 
    3863             :         /* Out parameters */
    3864          85 :         r.out.rids = _rids;
    3865             : 
    3866             :         /* Result */
    3867          85 :         NDR_ZERO_STRUCT(r.out.result);
    3868             : 
    3869          85 :         status = dcerpc_samr_GetAliasMembership_r(h, mem_ctx, &r);
    3870          85 :         if (!NT_STATUS_IS_OK(status)) {
    3871           0 :                 return status;
    3872             :         }
    3873             : 
    3874             :         /* Return variables */
    3875          85 :         *_rids = *r.out.rids;
    3876             : 
    3877             :         /* Return result */
    3878          85 :         *result = r.out.result;
    3879             : 
    3880          85 :         return NT_STATUS_OK;
    3881             : }
    3882             : 
    3883             : struct dcerpc_samr_LookupNames_r_state {
    3884             :         TALLOC_CTX *out_mem_ctx;
    3885             : };
    3886             : 
    3887             : static void dcerpc_samr_LookupNames_r_done(struct tevent_req *subreq);
    3888             : 
    3889          45 : struct tevent_req *dcerpc_samr_LookupNames_r_send(TALLOC_CTX *mem_ctx,
    3890             :         struct tevent_context *ev,
    3891             :         struct dcerpc_binding_handle *h,
    3892             :         struct samr_LookupNames *r)
    3893             : {
    3894             :         struct tevent_req *req;
    3895             :         struct dcerpc_samr_LookupNames_r_state *state;
    3896             :         struct tevent_req *subreq;
    3897             : 
    3898          45 :         req = tevent_req_create(mem_ctx, &state,
    3899             :                                 struct dcerpc_samr_LookupNames_r_state);
    3900          45 :         if (req == NULL) {
    3901           0 :                 return NULL;
    3902             :         }
    3903             : 
    3904          45 :         state->out_mem_ctx = talloc_new(state);
    3905          45 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3906           0 :                 return tevent_req_post(req, ev);
    3907             :         }
    3908             : 
    3909          45 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3910             :                         NULL, &ndr_table_samr,
    3911          45 :                         NDR_SAMR_LOOKUPNAMES, state->out_mem_ctx, r);
    3912          45 :         if (tevent_req_nomem(subreq, req)) {
    3913           0 :                 return tevent_req_post(req, ev);
    3914             :         }
    3915          45 :         tevent_req_set_callback(subreq, dcerpc_samr_LookupNames_r_done, req);
    3916             : 
    3917          45 :         return req;
    3918             : }
    3919             : 
    3920          45 : static void dcerpc_samr_LookupNames_r_done(struct tevent_req *subreq)
    3921             : {
    3922          45 :         struct tevent_req *req =
    3923          45 :                 tevent_req_callback_data(subreq,
    3924             :                 struct tevent_req);
    3925             :         NTSTATUS status;
    3926             : 
    3927          45 :         status = dcerpc_binding_handle_call_recv(subreq);
    3928          45 :         TALLOC_FREE(subreq);
    3929          45 :         if (tevent_req_nterror(req, status)) {
    3930           0 :                 return;
    3931             :         }
    3932             : 
    3933          45 :         tevent_req_done(req);
    3934             : }
    3935             : 
    3936          45 : NTSTATUS dcerpc_samr_LookupNames_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3937             : {
    3938          45 :         struct dcerpc_samr_LookupNames_r_state *state =
    3939          45 :                 tevent_req_data(req,
    3940             :                 struct dcerpc_samr_LookupNames_r_state);
    3941             :         NTSTATUS status;
    3942             : 
    3943          45 :         if (tevent_req_is_nterror(req, &status)) {
    3944           0 :                 tevent_req_received(req);
    3945           0 :                 return status;
    3946             :         }
    3947             : 
    3948          45 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3949             : 
    3950          45 :         tevent_req_received(req);
    3951          45 :         return NT_STATUS_OK;
    3952             : }
    3953             : 
    3954        2351 : NTSTATUS dcerpc_samr_LookupNames_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_LookupNames *r)
    3955             : {
    3956             :         NTSTATUS status;
    3957             : 
    3958        2351 :         status = dcerpc_binding_handle_call(h,
    3959             :                         NULL, &ndr_table_samr,
    3960             :                         NDR_SAMR_LOOKUPNAMES, mem_ctx, r);
    3961             : 
    3962        2351 :         return status;
    3963             : }
    3964             : 
    3965             : struct dcerpc_samr_LookupNames_state {
    3966             :         struct samr_LookupNames orig;
    3967             :         struct samr_LookupNames tmp;
    3968             :         TALLOC_CTX *out_mem_ctx;
    3969             : };
    3970             : 
    3971             : static void dcerpc_samr_LookupNames_done(struct tevent_req *subreq);
    3972             : 
    3973           0 : struct tevent_req *dcerpc_samr_LookupNames_send(TALLOC_CTX *mem_ctx,
    3974             :                                                 struct tevent_context *ev,
    3975             :                                                 struct dcerpc_binding_handle *h,
    3976             :                                                 struct policy_handle *_domain_handle /* [in] [ref] */,
    3977             :                                                 uint32_t _num_names /* [in] [range(0,1000)] */,
    3978             :                                                 struct lsa_String *_names /* [in] [length_is(num_names),size_is(1000)] */,
    3979             :                                                 struct samr_Ids *_rids /* [out] [ref] */,
    3980             :                                                 struct samr_Ids *_types /* [out] [ref] */)
    3981             : {
    3982             :         struct tevent_req *req;
    3983             :         struct dcerpc_samr_LookupNames_state *state;
    3984             :         struct tevent_req *subreq;
    3985             : 
    3986           0 :         req = tevent_req_create(mem_ctx, &state,
    3987             :                                 struct dcerpc_samr_LookupNames_state);
    3988           0 :         if (req == NULL) {
    3989           0 :                 return NULL;
    3990             :         }
    3991           0 :         state->out_mem_ctx = NULL;
    3992             : 
    3993             :         /* In parameters */
    3994           0 :         state->orig.in.domain_handle = _domain_handle;
    3995           0 :         state->orig.in.num_names = _num_names;
    3996           0 :         state->orig.in.names = _names;
    3997             : 
    3998             :         /* Out parameters */
    3999           0 :         state->orig.out.rids = _rids;
    4000           0 :         state->orig.out.types = _types;
    4001             : 
    4002             :         /* Result */
    4003           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    4004             : 
    4005           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    4006             :                              "dcerpc_samr_LookupNames_out_memory");
    4007           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    4008           0 :                 return tevent_req_post(req, ev);
    4009             :         }
    4010             : 
    4011             :         /* make a temporary copy, that we pass to the dispatch function */
    4012           0 :         state->tmp = state->orig;
    4013             : 
    4014           0 :         subreq = dcerpc_samr_LookupNames_r_send(state, ev, h, &state->tmp);
    4015           0 :         if (tevent_req_nomem(subreq, req)) {
    4016           0 :                 return tevent_req_post(req, ev);
    4017             :         }
    4018           0 :         tevent_req_set_callback(subreq, dcerpc_samr_LookupNames_done, req);
    4019           0 :         return req;
    4020             : }
    4021             : 
    4022           0 : static void dcerpc_samr_LookupNames_done(struct tevent_req *subreq)
    4023             : {
    4024           0 :         struct tevent_req *req = tevent_req_callback_data(
    4025             :                 subreq, struct tevent_req);
    4026           0 :         struct dcerpc_samr_LookupNames_state *state = tevent_req_data(
    4027             :                 req, struct dcerpc_samr_LookupNames_state);
    4028             :         NTSTATUS status;
    4029             :         TALLOC_CTX *mem_ctx;
    4030             : 
    4031           0 :         if (state->out_mem_ctx) {
    4032           0 :                 mem_ctx = state->out_mem_ctx;
    4033             :         } else {
    4034           0 :                 mem_ctx = state;
    4035             :         }
    4036             : 
    4037           0 :         status = dcerpc_samr_LookupNames_r_recv(subreq, mem_ctx);
    4038           0 :         TALLOC_FREE(subreq);
    4039           0 :         if (tevent_req_nterror(req, status)) {
    4040           0 :                 return;
    4041             :         }
    4042             : 
    4043             :         /* Copy out parameters */
    4044           0 :         *state->orig.out.rids = *state->tmp.out.rids;
    4045           0 :         *state->orig.out.types = *state->tmp.out.types;
    4046             : 
    4047             :         /* Copy result */
    4048           0 :         state->orig.out.result = state->tmp.out.result;
    4049             : 
    4050             :         /* Reset temporary structure */
    4051           0 :         NDR_ZERO_STRUCT(state->tmp);
    4052             : 
    4053           0 :         tevent_req_done(req);
    4054             : }
    4055             : 
    4056           0 : NTSTATUS dcerpc_samr_LookupNames_recv(struct tevent_req *req,
    4057             :                                       TALLOC_CTX *mem_ctx,
    4058             :                                       NTSTATUS *result)
    4059             : {
    4060           0 :         struct dcerpc_samr_LookupNames_state *state = tevent_req_data(
    4061             :                 req, struct dcerpc_samr_LookupNames_state);
    4062             :         NTSTATUS status;
    4063             : 
    4064           0 :         if (tevent_req_is_nterror(req, &status)) {
    4065           0 :                 tevent_req_received(req);
    4066           0 :                 return status;
    4067             :         }
    4068             : 
    4069             :         /* Steal possible out parameters to the callers context */
    4070           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4071             : 
    4072             :         /* Return result */
    4073           0 :         *result = state->orig.out.result;
    4074             : 
    4075           0 :         tevent_req_received(req);
    4076           0 :         return NT_STATUS_OK;
    4077             : }
    4078             : 
    4079         281 : NTSTATUS dcerpc_samr_LookupNames(struct dcerpc_binding_handle *h,
    4080             :                                  TALLOC_CTX *mem_ctx,
    4081             :                                  struct policy_handle *_domain_handle /* [in] [ref] */,
    4082             :                                  uint32_t _num_names /* [in] [range(0,1000)] */,
    4083             :                                  struct lsa_String *_names /* [in] [length_is(num_names),size_is(1000)] */,
    4084             :                                  struct samr_Ids *_rids /* [out] [ref] */,
    4085             :                                  struct samr_Ids *_types /* [out] [ref] */,
    4086             :                                  NTSTATUS *result)
    4087             : {
    4088             :         struct samr_LookupNames r;
    4089             :         NTSTATUS status;
    4090             : 
    4091             :         /* In parameters */
    4092         281 :         r.in.domain_handle = _domain_handle;
    4093         281 :         r.in.num_names = _num_names;
    4094         281 :         r.in.names = _names;
    4095             : 
    4096             :         /* Out parameters */
    4097         281 :         r.out.rids = _rids;
    4098         281 :         r.out.types = _types;
    4099             : 
    4100             :         /* Result */
    4101         281 :         NDR_ZERO_STRUCT(r.out.result);
    4102             : 
    4103         281 :         status = dcerpc_samr_LookupNames_r(h, mem_ctx, &r);
    4104         281 :         if (!NT_STATUS_IS_OK(status)) {
    4105           0 :                 return status;
    4106             :         }
    4107             : 
    4108             :         /* Return variables */
    4109         281 :         *_rids = *r.out.rids;
    4110         281 :         *_types = *r.out.types;
    4111             : 
    4112             :         /* Return result */
    4113         281 :         *result = r.out.result;
    4114             : 
    4115         281 :         return NT_STATUS_OK;
    4116             : }
    4117             : 
    4118             : struct dcerpc_samr_LookupRids_r_state {
    4119             :         TALLOC_CTX *out_mem_ctx;
    4120             : };
    4121             : 
    4122             : static void dcerpc_samr_LookupRids_r_done(struct tevent_req *subreq);
    4123             : 
    4124           0 : struct tevent_req *dcerpc_samr_LookupRids_r_send(TALLOC_CTX *mem_ctx,
    4125             :         struct tevent_context *ev,
    4126             :         struct dcerpc_binding_handle *h,
    4127             :         struct samr_LookupRids *r)
    4128             : {
    4129             :         struct tevent_req *req;
    4130             :         struct dcerpc_samr_LookupRids_r_state *state;
    4131             :         struct tevent_req *subreq;
    4132             : 
    4133           0 :         req = tevent_req_create(mem_ctx, &state,
    4134             :                                 struct dcerpc_samr_LookupRids_r_state);
    4135           0 :         if (req == NULL) {
    4136           0 :                 return NULL;
    4137             :         }
    4138             : 
    4139           0 :         state->out_mem_ctx = talloc_new(state);
    4140           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    4141           0 :                 return tevent_req_post(req, ev);
    4142             :         }
    4143             : 
    4144           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    4145             :                         NULL, &ndr_table_samr,
    4146           0 :                         NDR_SAMR_LOOKUPRIDS, state->out_mem_ctx, r);
    4147           0 :         if (tevent_req_nomem(subreq, req)) {
    4148           0 :                 return tevent_req_post(req, ev);
    4149             :         }
    4150           0 :         tevent_req_set_callback(subreq, dcerpc_samr_LookupRids_r_done, req);
    4151             : 
    4152           0 :         return req;
    4153             : }
    4154             : 
    4155           0 : static void dcerpc_samr_LookupRids_r_done(struct tevent_req *subreq)
    4156             : {
    4157           0 :         struct tevent_req *req =
    4158           0 :                 tevent_req_callback_data(subreq,
    4159             :                 struct tevent_req);
    4160             :         NTSTATUS status;
    4161             : 
    4162           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    4163           0 :         TALLOC_FREE(subreq);
    4164           0 :         if (tevent_req_nterror(req, status)) {
    4165           0 :                 return;
    4166             :         }
    4167             : 
    4168           0 :         tevent_req_done(req);
    4169             : }
    4170             : 
    4171           0 : NTSTATUS dcerpc_samr_LookupRids_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    4172             : {
    4173           0 :         struct dcerpc_samr_LookupRids_r_state *state =
    4174           0 :                 tevent_req_data(req,
    4175             :                 struct dcerpc_samr_LookupRids_r_state);
    4176             :         NTSTATUS status;
    4177             : 
    4178           0 :         if (tevent_req_is_nterror(req, &status)) {
    4179           0 :                 tevent_req_received(req);
    4180           0 :                 return status;
    4181             :         }
    4182             : 
    4183           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4184             : 
    4185           0 :         tevent_req_received(req);
    4186           0 :         return NT_STATUS_OK;
    4187             : }
    4188             : 
    4189        1976 : NTSTATUS dcerpc_samr_LookupRids_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_LookupRids *r)
    4190             : {
    4191             :         NTSTATUS status;
    4192             : 
    4193        1976 :         status = dcerpc_binding_handle_call(h,
    4194             :                         NULL, &ndr_table_samr,
    4195             :                         NDR_SAMR_LOOKUPRIDS, mem_ctx, r);
    4196             : 
    4197        1976 :         return status;
    4198             : }
    4199             : 
    4200             : struct dcerpc_samr_LookupRids_state {
    4201             :         struct samr_LookupRids orig;
    4202             :         struct samr_LookupRids tmp;
    4203             :         TALLOC_CTX *out_mem_ctx;
    4204             : };
    4205             : 
    4206             : static void dcerpc_samr_LookupRids_done(struct tevent_req *subreq);
    4207             : 
    4208           0 : struct tevent_req *dcerpc_samr_LookupRids_send(TALLOC_CTX *mem_ctx,
    4209             :                                                struct tevent_context *ev,
    4210             :                                                struct dcerpc_binding_handle *h,
    4211             :                                                struct policy_handle *_domain_handle /* [in] [ref] */,
    4212             :                                                uint32_t _num_rids /* [in] [range(0,1000)] */,
    4213             :                                                uint32_t *_rids /* [in] [length_is(num_rids),size_is(1000)] */,
    4214             :                                                struct lsa_Strings *_names /* [out] [ref] */,
    4215             :                                                struct samr_Ids *_types /* [out] [ref] */)
    4216             : {
    4217             :         struct tevent_req *req;
    4218             :         struct dcerpc_samr_LookupRids_state *state;
    4219             :         struct tevent_req *subreq;
    4220             : 
    4221           0 :         req = tevent_req_create(mem_ctx, &state,
    4222             :                                 struct dcerpc_samr_LookupRids_state);
    4223           0 :         if (req == NULL) {
    4224           0 :                 return NULL;
    4225             :         }
    4226           0 :         state->out_mem_ctx = NULL;
    4227             : 
    4228             :         /* In parameters */
    4229           0 :         state->orig.in.domain_handle = _domain_handle;
    4230           0 :         state->orig.in.num_rids = _num_rids;
    4231           0 :         state->orig.in.rids = _rids;
    4232             : 
    4233             :         /* Out parameters */
    4234           0 :         state->orig.out.names = _names;
    4235           0 :         state->orig.out.types = _types;
    4236             : 
    4237             :         /* Result */
    4238           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    4239             : 
    4240           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    4241             :                              "dcerpc_samr_LookupRids_out_memory");
    4242           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    4243           0 :                 return tevent_req_post(req, ev);
    4244             :         }
    4245             : 
    4246             :         /* make a temporary copy, that we pass to the dispatch function */
    4247           0 :         state->tmp = state->orig;
    4248             : 
    4249           0 :         subreq = dcerpc_samr_LookupRids_r_send(state, ev, h, &state->tmp);
    4250           0 :         if (tevent_req_nomem(subreq, req)) {
    4251           0 :                 return tevent_req_post(req, ev);
    4252             :         }
    4253           0 :         tevent_req_set_callback(subreq, dcerpc_samr_LookupRids_done, req);
    4254           0 :         return req;
    4255             : }
    4256             : 
    4257           0 : static void dcerpc_samr_LookupRids_done(struct tevent_req *subreq)
    4258             : {
    4259           0 :         struct tevent_req *req = tevent_req_callback_data(
    4260             :                 subreq, struct tevent_req);
    4261           0 :         struct dcerpc_samr_LookupRids_state *state = tevent_req_data(
    4262             :                 req, struct dcerpc_samr_LookupRids_state);
    4263             :         NTSTATUS status;
    4264             :         TALLOC_CTX *mem_ctx;
    4265             : 
    4266           0 :         if (state->out_mem_ctx) {
    4267           0 :                 mem_ctx = state->out_mem_ctx;
    4268             :         } else {
    4269           0 :                 mem_ctx = state;
    4270             :         }
    4271             : 
    4272           0 :         status = dcerpc_samr_LookupRids_r_recv(subreq, mem_ctx);
    4273           0 :         TALLOC_FREE(subreq);
    4274           0 :         if (tevent_req_nterror(req, status)) {
    4275           0 :                 return;
    4276             :         }
    4277             : 
    4278             :         /* Copy out parameters */
    4279           0 :         *state->orig.out.names = *state->tmp.out.names;
    4280           0 :         *state->orig.out.types = *state->tmp.out.types;
    4281             : 
    4282             :         /* Copy result */
    4283           0 :         state->orig.out.result = state->tmp.out.result;
    4284             : 
    4285             :         /* Reset temporary structure */
    4286           0 :         NDR_ZERO_STRUCT(state->tmp);
    4287             : 
    4288           0 :         tevent_req_done(req);
    4289             : }
    4290             : 
    4291           0 : NTSTATUS dcerpc_samr_LookupRids_recv(struct tevent_req *req,
    4292             :                                      TALLOC_CTX *mem_ctx,
    4293             :                                      NTSTATUS *result)
    4294             : {
    4295           0 :         struct dcerpc_samr_LookupRids_state *state = tevent_req_data(
    4296             :                 req, struct dcerpc_samr_LookupRids_state);
    4297             :         NTSTATUS status;
    4298             : 
    4299           0 :         if (tevent_req_is_nterror(req, &status)) {
    4300           0 :                 tevent_req_received(req);
    4301           0 :                 return status;
    4302             :         }
    4303             : 
    4304             :         /* Steal possible out parameters to the callers context */
    4305           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4306             : 
    4307             :         /* Return result */
    4308           0 :         *result = state->orig.out.result;
    4309             : 
    4310           0 :         tevent_req_received(req);
    4311           0 :         return NT_STATUS_OK;
    4312             : }
    4313             : 
    4314           9 : NTSTATUS dcerpc_samr_LookupRids(struct dcerpc_binding_handle *h,
    4315             :                                 TALLOC_CTX *mem_ctx,
    4316             :                                 struct policy_handle *_domain_handle /* [in] [ref] */,
    4317             :                                 uint32_t _num_rids /* [in] [range(0,1000)] */,
    4318             :                                 uint32_t *_rids /* [in] [length_is(num_rids),size_is(1000)] */,
    4319             :                                 struct lsa_Strings *_names /* [out] [ref] */,
    4320             :                                 struct samr_Ids *_types /* [out] [ref] */,
    4321             :                                 NTSTATUS *result)
    4322             : {
    4323             :         struct samr_LookupRids r;
    4324             :         NTSTATUS status;
    4325             : 
    4326             :         /* In parameters */
    4327           9 :         r.in.domain_handle = _domain_handle;
    4328           9 :         r.in.num_rids = _num_rids;
    4329           9 :         r.in.rids = _rids;
    4330             : 
    4331             :         /* Out parameters */
    4332           9 :         r.out.names = _names;
    4333           9 :         r.out.types = _types;
    4334             : 
    4335             :         /* Result */
    4336           9 :         NDR_ZERO_STRUCT(r.out.result);
    4337             : 
    4338           9 :         status = dcerpc_samr_LookupRids_r(h, mem_ctx, &r);
    4339           9 :         if (!NT_STATUS_IS_OK(status)) {
    4340           0 :                 return status;
    4341             :         }
    4342             : 
    4343             :         /* Return variables */
    4344           9 :         *_names = *r.out.names;
    4345           9 :         *_types = *r.out.types;
    4346             : 
    4347             :         /* Return result */
    4348           9 :         *result = r.out.result;
    4349             : 
    4350           9 :         return NT_STATUS_OK;
    4351             : }
    4352             : 
    4353             : struct dcerpc_samr_OpenGroup_r_state {
    4354             :         TALLOC_CTX *out_mem_ctx;
    4355             : };
    4356             : 
    4357             : static void dcerpc_samr_OpenGroup_r_done(struct tevent_req *subreq);
    4358             : 
    4359           3 : struct tevent_req *dcerpc_samr_OpenGroup_r_send(TALLOC_CTX *mem_ctx,
    4360             :         struct tevent_context *ev,
    4361             :         struct dcerpc_binding_handle *h,
    4362             :         struct samr_OpenGroup *r)
    4363             : {
    4364             :         struct tevent_req *req;
    4365             :         struct dcerpc_samr_OpenGroup_r_state *state;
    4366             :         struct tevent_req *subreq;
    4367             : 
    4368           3 :         req = tevent_req_create(mem_ctx, &state,
    4369             :                                 struct dcerpc_samr_OpenGroup_r_state);
    4370           3 :         if (req == NULL) {
    4371           0 :                 return NULL;
    4372             :         }
    4373             : 
    4374           3 :         state->out_mem_ctx = talloc_new(state);
    4375           3 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    4376           0 :                 return tevent_req_post(req, ev);
    4377             :         }
    4378             : 
    4379           3 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    4380             :                         NULL, &ndr_table_samr,
    4381           3 :                         NDR_SAMR_OPENGROUP, state->out_mem_ctx, r);
    4382           3 :         if (tevent_req_nomem(subreq, req)) {
    4383           0 :                 return tevent_req_post(req, ev);
    4384             :         }
    4385           3 :         tevent_req_set_callback(subreq, dcerpc_samr_OpenGroup_r_done, req);
    4386             : 
    4387           3 :         return req;
    4388             : }
    4389             : 
    4390           3 : static void dcerpc_samr_OpenGroup_r_done(struct tevent_req *subreq)
    4391             : {
    4392           3 :         struct tevent_req *req =
    4393           3 :                 tevent_req_callback_data(subreq,
    4394             :                 struct tevent_req);
    4395             :         NTSTATUS status;
    4396             : 
    4397           3 :         status = dcerpc_binding_handle_call_recv(subreq);
    4398           3 :         TALLOC_FREE(subreq);
    4399           3 :         if (tevent_req_nterror(req, status)) {
    4400           0 :                 return;
    4401             :         }
    4402             : 
    4403           3 :         tevent_req_done(req);
    4404             : }
    4405             : 
    4406           3 : NTSTATUS dcerpc_samr_OpenGroup_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    4407             : {
    4408           3 :         struct dcerpc_samr_OpenGroup_r_state *state =
    4409           3 :                 tevent_req_data(req,
    4410             :                 struct dcerpc_samr_OpenGroup_r_state);
    4411             :         NTSTATUS status;
    4412             : 
    4413           3 :         if (tevent_req_is_nterror(req, &status)) {
    4414           0 :                 tevent_req_received(req);
    4415           0 :                 return status;
    4416             :         }
    4417             : 
    4418           3 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4419             : 
    4420           3 :         tevent_req_received(req);
    4421           3 :         return NT_STATUS_OK;
    4422             : }
    4423             : 
    4424         912 : NTSTATUS dcerpc_samr_OpenGroup_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_OpenGroup *r)
    4425             : {
    4426             :         NTSTATUS status;
    4427             : 
    4428         912 :         status = dcerpc_binding_handle_call(h,
    4429             :                         NULL, &ndr_table_samr,
    4430             :                         NDR_SAMR_OPENGROUP, mem_ctx, r);
    4431             : 
    4432         912 :         return status;
    4433             : }
    4434             : 
    4435             : struct dcerpc_samr_OpenGroup_state {
    4436             :         struct samr_OpenGroup orig;
    4437             :         struct samr_OpenGroup tmp;
    4438             :         TALLOC_CTX *out_mem_ctx;
    4439             : };
    4440             : 
    4441             : static void dcerpc_samr_OpenGroup_done(struct tevent_req *subreq);
    4442             : 
    4443           0 : struct tevent_req *dcerpc_samr_OpenGroup_send(TALLOC_CTX *mem_ctx,
    4444             :                                               struct tevent_context *ev,
    4445             :                                               struct dcerpc_binding_handle *h,
    4446             :                                               struct policy_handle *_domain_handle /* [in] [ref] */,
    4447             :                                               uint32_t _access_mask /* [in]  */,
    4448             :                                               uint32_t _rid /* [in]  */,
    4449             :                                               struct policy_handle *_group_handle /* [out] [ref] */)
    4450             : {
    4451             :         struct tevent_req *req;
    4452             :         struct dcerpc_samr_OpenGroup_state *state;
    4453             :         struct tevent_req *subreq;
    4454             : 
    4455           0 :         req = tevent_req_create(mem_ctx, &state,
    4456             :                                 struct dcerpc_samr_OpenGroup_state);
    4457           0 :         if (req == NULL) {
    4458           0 :                 return NULL;
    4459             :         }
    4460           0 :         state->out_mem_ctx = NULL;
    4461             : 
    4462             :         /* In parameters */
    4463           0 :         state->orig.in.domain_handle = _domain_handle;
    4464           0 :         state->orig.in.access_mask = _access_mask;
    4465           0 :         state->orig.in.rid = _rid;
    4466             : 
    4467             :         /* Out parameters */
    4468           0 :         state->orig.out.group_handle = _group_handle;
    4469             : 
    4470             :         /* Result */
    4471           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    4472             : 
    4473           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    4474             :                              "dcerpc_samr_OpenGroup_out_memory");
    4475           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    4476           0 :                 return tevent_req_post(req, ev);
    4477             :         }
    4478             : 
    4479             :         /* make a temporary copy, that we pass to the dispatch function */
    4480           0 :         state->tmp = state->orig;
    4481             : 
    4482           0 :         subreq = dcerpc_samr_OpenGroup_r_send(state, ev, h, &state->tmp);
    4483           0 :         if (tevent_req_nomem(subreq, req)) {
    4484           0 :                 return tevent_req_post(req, ev);
    4485             :         }
    4486           0 :         tevent_req_set_callback(subreq, dcerpc_samr_OpenGroup_done, req);
    4487           0 :         return req;
    4488             : }
    4489             : 
    4490           0 : static void dcerpc_samr_OpenGroup_done(struct tevent_req *subreq)
    4491             : {
    4492           0 :         struct tevent_req *req = tevent_req_callback_data(
    4493             :                 subreq, struct tevent_req);
    4494           0 :         struct dcerpc_samr_OpenGroup_state *state = tevent_req_data(
    4495             :                 req, struct dcerpc_samr_OpenGroup_state);
    4496             :         NTSTATUS status;
    4497             :         TALLOC_CTX *mem_ctx;
    4498             : 
    4499           0 :         if (state->out_mem_ctx) {
    4500           0 :                 mem_ctx = state->out_mem_ctx;
    4501             :         } else {
    4502           0 :                 mem_ctx = state;
    4503             :         }
    4504             : 
    4505           0 :         status = dcerpc_samr_OpenGroup_r_recv(subreq, mem_ctx);
    4506           0 :         TALLOC_FREE(subreq);
    4507           0 :         if (tevent_req_nterror(req, status)) {
    4508           0 :                 return;
    4509             :         }
    4510             : 
    4511             :         /* Copy out parameters */
    4512           0 :         *state->orig.out.group_handle = *state->tmp.out.group_handle;
    4513             : 
    4514             :         /* Copy result */
    4515           0 :         state->orig.out.result = state->tmp.out.result;
    4516             : 
    4517             :         /* Reset temporary structure */
    4518           0 :         NDR_ZERO_STRUCT(state->tmp);
    4519             : 
    4520           0 :         tevent_req_done(req);
    4521             : }
    4522             : 
    4523           0 : NTSTATUS dcerpc_samr_OpenGroup_recv(struct tevent_req *req,
    4524             :                                     TALLOC_CTX *mem_ctx,
    4525             :                                     NTSTATUS *result)
    4526             : {
    4527           0 :         struct dcerpc_samr_OpenGroup_state *state = tevent_req_data(
    4528             :                 req, struct dcerpc_samr_OpenGroup_state);
    4529             :         NTSTATUS status;
    4530             : 
    4531           0 :         if (tevent_req_is_nterror(req, &status)) {
    4532           0 :                 tevent_req_received(req);
    4533           0 :                 return status;
    4534             :         }
    4535             : 
    4536             :         /* Steal possible out parameters to the callers context */
    4537           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4538             : 
    4539             :         /* Return result */
    4540           0 :         *result = state->orig.out.result;
    4541             : 
    4542           0 :         tevent_req_received(req);
    4543           0 :         return NT_STATUS_OK;
    4544             : }
    4545             : 
    4546         159 : NTSTATUS dcerpc_samr_OpenGroup(struct dcerpc_binding_handle *h,
    4547             :                                TALLOC_CTX *mem_ctx,
    4548             :                                struct policy_handle *_domain_handle /* [in] [ref] */,
    4549             :                                uint32_t _access_mask /* [in]  */,
    4550             :                                uint32_t _rid /* [in]  */,
    4551             :                                struct policy_handle *_group_handle /* [out] [ref] */,
    4552             :                                NTSTATUS *result)
    4553             : {
    4554             :         struct samr_OpenGroup r;
    4555             :         NTSTATUS status;
    4556             : 
    4557             :         /* In parameters */
    4558         159 :         r.in.domain_handle = _domain_handle;
    4559         159 :         r.in.access_mask = _access_mask;
    4560         159 :         r.in.rid = _rid;
    4561             : 
    4562             :         /* Out parameters */
    4563         159 :         r.out.group_handle = _group_handle;
    4564             : 
    4565             :         /* Result */
    4566         159 :         NDR_ZERO_STRUCT(r.out.result);
    4567             : 
    4568         159 :         status = dcerpc_samr_OpenGroup_r(h, mem_ctx, &r);
    4569         159 :         if (!NT_STATUS_IS_OK(status)) {
    4570           0 :                 return status;
    4571             :         }
    4572             : 
    4573             :         /* Return variables */
    4574         159 :         *_group_handle = *r.out.group_handle;
    4575             : 
    4576             :         /* Return result */
    4577         159 :         *result = r.out.result;
    4578             : 
    4579         159 :         return NT_STATUS_OK;
    4580             : }
    4581             : 
    4582             : struct dcerpc_samr_QueryGroupInfo_r_state {
    4583             :         TALLOC_CTX *out_mem_ctx;
    4584             : };
    4585             : 
    4586             : static void dcerpc_samr_QueryGroupInfo_r_done(struct tevent_req *subreq);
    4587             : 
    4588           3 : struct tevent_req *dcerpc_samr_QueryGroupInfo_r_send(TALLOC_CTX *mem_ctx,
    4589             :         struct tevent_context *ev,
    4590             :         struct dcerpc_binding_handle *h,
    4591             :         struct samr_QueryGroupInfo *r)
    4592             : {
    4593             :         struct tevent_req *req;
    4594             :         struct dcerpc_samr_QueryGroupInfo_r_state *state;
    4595             :         struct tevent_req *subreq;
    4596             : 
    4597           3 :         req = tevent_req_create(mem_ctx, &state,
    4598             :                                 struct dcerpc_samr_QueryGroupInfo_r_state);
    4599           3 :         if (req == NULL) {
    4600           0 :                 return NULL;
    4601             :         }
    4602             : 
    4603           3 :         state->out_mem_ctx = talloc_new(state);
    4604           3 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    4605           0 :                 return tevent_req_post(req, ev);
    4606             :         }
    4607             : 
    4608           3 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    4609             :                         NULL, &ndr_table_samr,
    4610           3 :                         NDR_SAMR_QUERYGROUPINFO, state->out_mem_ctx, r);
    4611           3 :         if (tevent_req_nomem(subreq, req)) {
    4612           0 :                 return tevent_req_post(req, ev);
    4613             :         }
    4614           3 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryGroupInfo_r_done, req);
    4615             : 
    4616           3 :         return req;
    4617             : }
    4618             : 
    4619           3 : static void dcerpc_samr_QueryGroupInfo_r_done(struct tevent_req *subreq)
    4620             : {
    4621           3 :         struct tevent_req *req =
    4622           3 :                 tevent_req_callback_data(subreq,
    4623             :                 struct tevent_req);
    4624             :         NTSTATUS status;
    4625             : 
    4626           3 :         status = dcerpc_binding_handle_call_recv(subreq);
    4627           3 :         TALLOC_FREE(subreq);
    4628           3 :         if (tevent_req_nterror(req, status)) {
    4629           0 :                 return;
    4630             :         }
    4631             : 
    4632           3 :         tevent_req_done(req);
    4633             : }
    4634             : 
    4635           3 : NTSTATUS dcerpc_samr_QueryGroupInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    4636             : {
    4637           3 :         struct dcerpc_samr_QueryGroupInfo_r_state *state =
    4638           3 :                 tevent_req_data(req,
    4639             :                 struct dcerpc_samr_QueryGroupInfo_r_state);
    4640             :         NTSTATUS status;
    4641             : 
    4642           3 :         if (tevent_req_is_nterror(req, &status)) {
    4643           0 :                 tevent_req_received(req);
    4644           0 :                 return status;
    4645             :         }
    4646             : 
    4647           3 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4648             : 
    4649           3 :         tevent_req_received(req);
    4650           3 :         return NT_STATUS_OK;
    4651             : }
    4652             : 
    4653         383 : NTSTATUS dcerpc_samr_QueryGroupInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_QueryGroupInfo *r)
    4654             : {
    4655             :         NTSTATUS status;
    4656             : 
    4657         383 :         status = dcerpc_binding_handle_call(h,
    4658             :                         NULL, &ndr_table_samr,
    4659             :                         NDR_SAMR_QUERYGROUPINFO, mem_ctx, r);
    4660             : 
    4661         383 :         return status;
    4662             : }
    4663             : 
    4664             : struct dcerpc_samr_QueryGroupInfo_state {
    4665             :         struct samr_QueryGroupInfo orig;
    4666             :         struct samr_QueryGroupInfo tmp;
    4667             :         TALLOC_CTX *out_mem_ctx;
    4668             : };
    4669             : 
    4670             : static void dcerpc_samr_QueryGroupInfo_done(struct tevent_req *subreq);
    4671             : 
    4672           0 : struct tevent_req *dcerpc_samr_QueryGroupInfo_send(TALLOC_CTX *mem_ctx,
    4673             :                                                    struct tevent_context *ev,
    4674             :                                                    struct dcerpc_binding_handle *h,
    4675             :                                                    struct policy_handle *_group_handle /* [in] [ref] */,
    4676             :                                                    enum samr_GroupInfoEnum _level /* [in]  */,
    4677             :                                                    union samr_GroupInfo **_info /* [out] [ref,switch_is(level)] */)
    4678             : {
    4679             :         struct tevent_req *req;
    4680             :         struct dcerpc_samr_QueryGroupInfo_state *state;
    4681             :         struct tevent_req *subreq;
    4682             : 
    4683           0 :         req = tevent_req_create(mem_ctx, &state,
    4684             :                                 struct dcerpc_samr_QueryGroupInfo_state);
    4685           0 :         if (req == NULL) {
    4686           0 :                 return NULL;
    4687             :         }
    4688           0 :         state->out_mem_ctx = NULL;
    4689             : 
    4690             :         /* In parameters */
    4691           0 :         state->orig.in.group_handle = _group_handle;
    4692           0 :         state->orig.in.level = _level;
    4693             : 
    4694             :         /* Out parameters */
    4695           0 :         state->orig.out.info = _info;
    4696             : 
    4697             :         /* Result */
    4698           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    4699             : 
    4700           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    4701             :                              "dcerpc_samr_QueryGroupInfo_out_memory");
    4702           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    4703           0 :                 return tevent_req_post(req, ev);
    4704             :         }
    4705             : 
    4706             :         /* make a temporary copy, that we pass to the dispatch function */
    4707           0 :         state->tmp = state->orig;
    4708             : 
    4709           0 :         subreq = dcerpc_samr_QueryGroupInfo_r_send(state, ev, h, &state->tmp);
    4710           0 :         if (tevent_req_nomem(subreq, req)) {
    4711           0 :                 return tevent_req_post(req, ev);
    4712             :         }
    4713           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryGroupInfo_done, req);
    4714           0 :         return req;
    4715             : }
    4716             : 
    4717           0 : static void dcerpc_samr_QueryGroupInfo_done(struct tevent_req *subreq)
    4718             : {
    4719           0 :         struct tevent_req *req = tevent_req_callback_data(
    4720             :                 subreq, struct tevent_req);
    4721           0 :         struct dcerpc_samr_QueryGroupInfo_state *state = tevent_req_data(
    4722             :                 req, struct dcerpc_samr_QueryGroupInfo_state);
    4723             :         NTSTATUS status;
    4724             :         TALLOC_CTX *mem_ctx;
    4725             : 
    4726           0 :         if (state->out_mem_ctx) {
    4727           0 :                 mem_ctx = state->out_mem_ctx;
    4728             :         } else {
    4729           0 :                 mem_ctx = state;
    4730             :         }
    4731             : 
    4732           0 :         status = dcerpc_samr_QueryGroupInfo_r_recv(subreq, mem_ctx);
    4733           0 :         TALLOC_FREE(subreq);
    4734           0 :         if (tevent_req_nterror(req, status)) {
    4735           0 :                 return;
    4736             :         }
    4737             : 
    4738             :         /* Copy out parameters */
    4739           0 :         *state->orig.out.info = *state->tmp.out.info;
    4740             : 
    4741             :         /* Copy result */
    4742           0 :         state->orig.out.result = state->tmp.out.result;
    4743             : 
    4744             :         /* Reset temporary structure */
    4745           0 :         NDR_ZERO_STRUCT(state->tmp);
    4746             : 
    4747           0 :         tevent_req_done(req);
    4748             : }
    4749             : 
    4750           0 : NTSTATUS dcerpc_samr_QueryGroupInfo_recv(struct tevent_req *req,
    4751             :                                          TALLOC_CTX *mem_ctx,
    4752             :                                          NTSTATUS *result)
    4753             : {
    4754           0 :         struct dcerpc_samr_QueryGroupInfo_state *state = tevent_req_data(
    4755             :                 req, struct dcerpc_samr_QueryGroupInfo_state);
    4756             :         NTSTATUS status;
    4757             : 
    4758           0 :         if (tevent_req_is_nterror(req, &status)) {
    4759           0 :                 tevent_req_received(req);
    4760           0 :                 return status;
    4761             :         }
    4762             : 
    4763             :         /* Steal possible out parameters to the callers context */
    4764           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4765             : 
    4766             :         /* Return result */
    4767           0 :         *result = state->orig.out.result;
    4768             : 
    4769           0 :         tevent_req_received(req);
    4770           0 :         return NT_STATUS_OK;
    4771             : }
    4772             : 
    4773          10 : NTSTATUS dcerpc_samr_QueryGroupInfo(struct dcerpc_binding_handle *h,
    4774             :                                     TALLOC_CTX *mem_ctx,
    4775             :                                     struct policy_handle *_group_handle /* [in] [ref] */,
    4776             :                                     enum samr_GroupInfoEnum _level /* [in]  */,
    4777             :                                     union samr_GroupInfo **_info /* [out] [ref,switch_is(level)] */,
    4778             :                                     NTSTATUS *result)
    4779             : {
    4780             :         struct samr_QueryGroupInfo r;
    4781             :         NTSTATUS status;
    4782             : 
    4783             :         /* In parameters */
    4784          10 :         r.in.group_handle = _group_handle;
    4785          10 :         r.in.level = _level;
    4786             : 
    4787             :         /* Out parameters */
    4788          10 :         r.out.info = _info;
    4789             : 
    4790             :         /* Result */
    4791          10 :         NDR_ZERO_STRUCT(r.out.result);
    4792             : 
    4793          10 :         status = dcerpc_samr_QueryGroupInfo_r(h, mem_ctx, &r);
    4794          10 :         if (!NT_STATUS_IS_OK(status)) {
    4795           0 :                 return status;
    4796             :         }
    4797             : 
    4798             :         /* Return variables */
    4799          10 :         *_info = *r.out.info;
    4800             : 
    4801             :         /* Return result */
    4802          10 :         *result = r.out.result;
    4803             : 
    4804          10 :         return NT_STATUS_OK;
    4805             : }
    4806             : 
    4807             : struct dcerpc_samr_SetGroupInfo_r_state {
    4808             :         TALLOC_CTX *out_mem_ctx;
    4809             : };
    4810             : 
    4811             : static void dcerpc_samr_SetGroupInfo_r_done(struct tevent_req *subreq);
    4812             : 
    4813           0 : struct tevent_req *dcerpc_samr_SetGroupInfo_r_send(TALLOC_CTX *mem_ctx,
    4814             :         struct tevent_context *ev,
    4815             :         struct dcerpc_binding_handle *h,
    4816             :         struct samr_SetGroupInfo *r)
    4817             : {
    4818             :         struct tevent_req *req;
    4819             :         struct dcerpc_samr_SetGroupInfo_r_state *state;
    4820             :         struct tevent_req *subreq;
    4821             : 
    4822           0 :         req = tevent_req_create(mem_ctx, &state,
    4823             :                                 struct dcerpc_samr_SetGroupInfo_r_state);
    4824           0 :         if (req == NULL) {
    4825           0 :                 return NULL;
    4826             :         }
    4827             : 
    4828           0 :         state->out_mem_ctx = NULL;
    4829             : 
    4830           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    4831             :                         NULL, &ndr_table_samr,
    4832             :                         NDR_SAMR_SETGROUPINFO, state, r);
    4833           0 :         if (tevent_req_nomem(subreq, req)) {
    4834           0 :                 return tevent_req_post(req, ev);
    4835             :         }
    4836           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetGroupInfo_r_done, req);
    4837             : 
    4838           0 :         return req;
    4839             : }
    4840             : 
    4841           0 : static void dcerpc_samr_SetGroupInfo_r_done(struct tevent_req *subreq)
    4842             : {
    4843           0 :         struct tevent_req *req =
    4844           0 :                 tevent_req_callback_data(subreq,
    4845             :                 struct tevent_req);
    4846             :         NTSTATUS status;
    4847             : 
    4848           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    4849           0 :         TALLOC_FREE(subreq);
    4850           0 :         if (tevent_req_nterror(req, status)) {
    4851           0 :                 return;
    4852             :         }
    4853             : 
    4854           0 :         tevent_req_done(req);
    4855             : }
    4856             : 
    4857           0 : NTSTATUS dcerpc_samr_SetGroupInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    4858             : {
    4859           0 :         struct dcerpc_samr_SetGroupInfo_r_state *state =
    4860           0 :                 tevent_req_data(req,
    4861             :                 struct dcerpc_samr_SetGroupInfo_r_state);
    4862             :         NTSTATUS status;
    4863             : 
    4864           0 :         if (tevent_req_is_nterror(req, &status)) {
    4865           0 :                 tevent_req_received(req);
    4866           0 :                 return status;
    4867             :         }
    4868             : 
    4869           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4870             : 
    4871           0 :         tevent_req_received(req);
    4872           0 :         return NT_STATUS_OK;
    4873             : }
    4874             : 
    4875          29 : NTSTATUS dcerpc_samr_SetGroupInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_SetGroupInfo *r)
    4876             : {
    4877             :         NTSTATUS status;
    4878             : 
    4879          29 :         status = dcerpc_binding_handle_call(h,
    4880             :                         NULL, &ndr_table_samr,
    4881             :                         NDR_SAMR_SETGROUPINFO, mem_ctx, r);
    4882             : 
    4883          29 :         return status;
    4884             : }
    4885             : 
    4886             : struct dcerpc_samr_SetGroupInfo_state {
    4887             :         struct samr_SetGroupInfo orig;
    4888             :         struct samr_SetGroupInfo tmp;
    4889             :         TALLOC_CTX *out_mem_ctx;
    4890             : };
    4891             : 
    4892             : static void dcerpc_samr_SetGroupInfo_done(struct tevent_req *subreq);
    4893             : 
    4894           0 : struct tevent_req *dcerpc_samr_SetGroupInfo_send(TALLOC_CTX *mem_ctx,
    4895             :                                                  struct tevent_context *ev,
    4896             :                                                  struct dcerpc_binding_handle *h,
    4897             :                                                  struct policy_handle *_group_handle /* [in] [ref] */,
    4898             :                                                  enum samr_GroupInfoEnum _level /* [in]  */,
    4899             :                                                  union samr_GroupInfo *_info /* [in] [ref,switch_is(level)] */)
    4900             : {
    4901             :         struct tevent_req *req;
    4902             :         struct dcerpc_samr_SetGroupInfo_state *state;
    4903             :         struct tevent_req *subreq;
    4904             : 
    4905           0 :         req = tevent_req_create(mem_ctx, &state,
    4906             :                                 struct dcerpc_samr_SetGroupInfo_state);
    4907           0 :         if (req == NULL) {
    4908           0 :                 return NULL;
    4909             :         }
    4910           0 :         state->out_mem_ctx = NULL;
    4911             : 
    4912             :         /* In parameters */
    4913           0 :         state->orig.in.group_handle = _group_handle;
    4914           0 :         state->orig.in.level = _level;
    4915           0 :         state->orig.in.info = _info;
    4916             : 
    4917             :         /* Out parameters */
    4918             : 
    4919             :         /* Result */
    4920           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    4921             : 
    4922             :         /* make a temporary copy, that we pass to the dispatch function */
    4923           0 :         state->tmp = state->orig;
    4924             : 
    4925           0 :         subreq = dcerpc_samr_SetGroupInfo_r_send(state, ev, h, &state->tmp);
    4926           0 :         if (tevent_req_nomem(subreq, req)) {
    4927           0 :                 return tevent_req_post(req, ev);
    4928             :         }
    4929           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetGroupInfo_done, req);
    4930           0 :         return req;
    4931             : }
    4932             : 
    4933           0 : static void dcerpc_samr_SetGroupInfo_done(struct tevent_req *subreq)
    4934             : {
    4935           0 :         struct tevent_req *req = tevent_req_callback_data(
    4936             :                 subreq, struct tevent_req);
    4937           0 :         struct dcerpc_samr_SetGroupInfo_state *state = tevent_req_data(
    4938             :                 req, struct dcerpc_samr_SetGroupInfo_state);
    4939             :         NTSTATUS status;
    4940             :         TALLOC_CTX *mem_ctx;
    4941             : 
    4942           0 :         if (state->out_mem_ctx) {
    4943           0 :                 mem_ctx = state->out_mem_ctx;
    4944             :         } else {
    4945           0 :                 mem_ctx = state;
    4946             :         }
    4947             : 
    4948           0 :         status = dcerpc_samr_SetGroupInfo_r_recv(subreq, mem_ctx);
    4949           0 :         TALLOC_FREE(subreq);
    4950           0 :         if (tevent_req_nterror(req, status)) {
    4951           0 :                 return;
    4952             :         }
    4953             : 
    4954             :         /* Copy out parameters */
    4955             : 
    4956             :         /* Copy result */
    4957           0 :         state->orig.out.result = state->tmp.out.result;
    4958             : 
    4959             :         /* Reset temporary structure */
    4960           0 :         NDR_ZERO_STRUCT(state->tmp);
    4961             : 
    4962           0 :         tevent_req_done(req);
    4963             : }
    4964             : 
    4965           0 : NTSTATUS dcerpc_samr_SetGroupInfo_recv(struct tevent_req *req,
    4966             :                                        TALLOC_CTX *mem_ctx,
    4967             :                                        NTSTATUS *result)
    4968             : {
    4969           0 :         struct dcerpc_samr_SetGroupInfo_state *state = tevent_req_data(
    4970             :                 req, struct dcerpc_samr_SetGroupInfo_state);
    4971             :         NTSTATUS status;
    4972             : 
    4973           0 :         if (tevent_req_is_nterror(req, &status)) {
    4974           0 :                 tevent_req_received(req);
    4975           0 :                 return status;
    4976             :         }
    4977             : 
    4978             :         /* Steal possible out parameters to the callers context */
    4979           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4980             : 
    4981             :         /* Return result */
    4982           0 :         *result = state->orig.out.result;
    4983             : 
    4984           0 :         tevent_req_received(req);
    4985           0 :         return NT_STATUS_OK;
    4986             : }
    4987             : 
    4988           1 : NTSTATUS dcerpc_samr_SetGroupInfo(struct dcerpc_binding_handle *h,
    4989             :                                   TALLOC_CTX *mem_ctx,
    4990             :                                   struct policy_handle *_group_handle /* [in] [ref] */,
    4991             :                                   enum samr_GroupInfoEnum _level /* [in]  */,
    4992             :                                   union samr_GroupInfo *_info /* [in] [ref,switch_is(level)] */,
    4993             :                                   NTSTATUS *result)
    4994             : {
    4995             :         struct samr_SetGroupInfo r;
    4996             :         NTSTATUS status;
    4997             : 
    4998             :         /* In parameters */
    4999           1 :         r.in.group_handle = _group_handle;
    5000           1 :         r.in.level = _level;
    5001           1 :         r.in.info = _info;
    5002             : 
    5003             :         /* Out parameters */
    5004             : 
    5005             :         /* Result */
    5006           1 :         NDR_ZERO_STRUCT(r.out.result);
    5007             : 
    5008           1 :         status = dcerpc_samr_SetGroupInfo_r(h, mem_ctx, &r);
    5009           1 :         if (!NT_STATUS_IS_OK(status)) {
    5010           0 :                 return status;
    5011             :         }
    5012             : 
    5013             :         /* Return variables */
    5014             : 
    5015             :         /* Return result */
    5016           1 :         *result = r.out.result;
    5017             : 
    5018           1 :         return NT_STATUS_OK;
    5019             : }
    5020             : 
    5021             : struct dcerpc_samr_AddGroupMember_r_state {
    5022             :         TALLOC_CTX *out_mem_ctx;
    5023             : };
    5024             : 
    5025             : static void dcerpc_samr_AddGroupMember_r_done(struct tevent_req *subreq);
    5026             : 
    5027           0 : struct tevent_req *dcerpc_samr_AddGroupMember_r_send(TALLOC_CTX *mem_ctx,
    5028             :         struct tevent_context *ev,
    5029             :         struct dcerpc_binding_handle *h,
    5030             :         struct samr_AddGroupMember *r)
    5031             : {
    5032             :         struct tevent_req *req;
    5033             :         struct dcerpc_samr_AddGroupMember_r_state *state;
    5034             :         struct tevent_req *subreq;
    5035             : 
    5036           0 :         req = tevent_req_create(mem_ctx, &state,
    5037             :                                 struct dcerpc_samr_AddGroupMember_r_state);
    5038           0 :         if (req == NULL) {
    5039           0 :                 return NULL;
    5040             :         }
    5041             : 
    5042           0 :         state->out_mem_ctx = NULL;
    5043             : 
    5044           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    5045             :                         NULL, &ndr_table_samr,
    5046             :                         NDR_SAMR_ADDGROUPMEMBER, state, r);
    5047           0 :         if (tevent_req_nomem(subreq, req)) {
    5048           0 :                 return tevent_req_post(req, ev);
    5049             :         }
    5050           0 :         tevent_req_set_callback(subreq, dcerpc_samr_AddGroupMember_r_done, req);
    5051             : 
    5052           0 :         return req;
    5053             : }
    5054             : 
    5055           0 : static void dcerpc_samr_AddGroupMember_r_done(struct tevent_req *subreq)
    5056             : {
    5057           0 :         struct tevent_req *req =
    5058           0 :                 tevent_req_callback_data(subreq,
    5059             :                 struct tevent_req);
    5060             :         NTSTATUS status;
    5061             : 
    5062           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    5063           0 :         TALLOC_FREE(subreq);
    5064           0 :         if (tevent_req_nterror(req, status)) {
    5065           0 :                 return;
    5066             :         }
    5067             : 
    5068           0 :         tevent_req_done(req);
    5069             : }
    5070             : 
    5071           0 : NTSTATUS dcerpc_samr_AddGroupMember_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    5072             : {
    5073           0 :         struct dcerpc_samr_AddGroupMember_r_state *state =
    5074           0 :                 tevent_req_data(req,
    5075             :                 struct dcerpc_samr_AddGroupMember_r_state);
    5076             :         NTSTATUS status;
    5077             : 
    5078           0 :         if (tevent_req_is_nterror(req, &status)) {
    5079           0 :                 tevent_req_received(req);
    5080           0 :                 return status;
    5081             :         }
    5082             : 
    5083           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5084             : 
    5085           0 :         tevent_req_received(req);
    5086           0 :         return NT_STATUS_OK;
    5087             : }
    5088             : 
    5089          78 : NTSTATUS dcerpc_samr_AddGroupMember_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_AddGroupMember *r)
    5090             : {
    5091             :         NTSTATUS status;
    5092             : 
    5093          78 :         status = dcerpc_binding_handle_call(h,
    5094             :                         NULL, &ndr_table_samr,
    5095             :                         NDR_SAMR_ADDGROUPMEMBER, mem_ctx, r);
    5096             : 
    5097          78 :         return status;
    5098             : }
    5099             : 
    5100             : struct dcerpc_samr_AddGroupMember_state {
    5101             :         struct samr_AddGroupMember orig;
    5102             :         struct samr_AddGroupMember tmp;
    5103             :         TALLOC_CTX *out_mem_ctx;
    5104             : };
    5105             : 
    5106             : static void dcerpc_samr_AddGroupMember_done(struct tevent_req *subreq);
    5107             : 
    5108           0 : struct tevent_req *dcerpc_samr_AddGroupMember_send(TALLOC_CTX *mem_ctx,
    5109             :                                                    struct tevent_context *ev,
    5110             :                                                    struct dcerpc_binding_handle *h,
    5111             :                                                    struct policy_handle *_group_handle /* [in] [ref] */,
    5112             :                                                    uint32_t _rid /* [in]  */,
    5113             :                                                    uint32_t _flags /* [in]  */)
    5114             : {
    5115             :         struct tevent_req *req;
    5116             :         struct dcerpc_samr_AddGroupMember_state *state;
    5117             :         struct tevent_req *subreq;
    5118             : 
    5119           0 :         req = tevent_req_create(mem_ctx, &state,
    5120             :                                 struct dcerpc_samr_AddGroupMember_state);
    5121           0 :         if (req == NULL) {
    5122           0 :                 return NULL;
    5123             :         }
    5124           0 :         state->out_mem_ctx = NULL;
    5125             : 
    5126             :         /* In parameters */
    5127           0 :         state->orig.in.group_handle = _group_handle;
    5128           0 :         state->orig.in.rid = _rid;
    5129           0 :         state->orig.in.flags = _flags;
    5130             : 
    5131             :         /* Out parameters */
    5132             : 
    5133             :         /* Result */
    5134           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    5135             : 
    5136             :         /* make a temporary copy, that we pass to the dispatch function */
    5137           0 :         state->tmp = state->orig;
    5138             : 
    5139           0 :         subreq = dcerpc_samr_AddGroupMember_r_send(state, ev, h, &state->tmp);
    5140           0 :         if (tevent_req_nomem(subreq, req)) {
    5141           0 :                 return tevent_req_post(req, ev);
    5142             :         }
    5143           0 :         tevent_req_set_callback(subreq, dcerpc_samr_AddGroupMember_done, req);
    5144           0 :         return req;
    5145             : }
    5146             : 
    5147           0 : static void dcerpc_samr_AddGroupMember_done(struct tevent_req *subreq)
    5148             : {
    5149           0 :         struct tevent_req *req = tevent_req_callback_data(
    5150             :                 subreq, struct tevent_req);
    5151           0 :         struct dcerpc_samr_AddGroupMember_state *state = tevent_req_data(
    5152             :                 req, struct dcerpc_samr_AddGroupMember_state);
    5153             :         NTSTATUS status;
    5154             :         TALLOC_CTX *mem_ctx;
    5155             : 
    5156           0 :         if (state->out_mem_ctx) {
    5157           0 :                 mem_ctx = state->out_mem_ctx;
    5158             :         } else {
    5159           0 :                 mem_ctx = state;
    5160             :         }
    5161             : 
    5162           0 :         status = dcerpc_samr_AddGroupMember_r_recv(subreq, mem_ctx);
    5163           0 :         TALLOC_FREE(subreq);
    5164           0 :         if (tevent_req_nterror(req, status)) {
    5165           0 :                 return;
    5166             :         }
    5167             : 
    5168             :         /* Copy out parameters */
    5169             : 
    5170             :         /* Copy result */
    5171           0 :         state->orig.out.result = state->tmp.out.result;
    5172             : 
    5173             :         /* Reset temporary structure */
    5174           0 :         NDR_ZERO_STRUCT(state->tmp);
    5175             : 
    5176           0 :         tevent_req_done(req);
    5177             : }
    5178             : 
    5179           0 : NTSTATUS dcerpc_samr_AddGroupMember_recv(struct tevent_req *req,
    5180             :                                          TALLOC_CTX *mem_ctx,
    5181             :                                          NTSTATUS *result)
    5182             : {
    5183           0 :         struct dcerpc_samr_AddGroupMember_state *state = tevent_req_data(
    5184             :                 req, struct dcerpc_samr_AddGroupMember_state);
    5185             :         NTSTATUS status;
    5186             : 
    5187           0 :         if (tevent_req_is_nterror(req, &status)) {
    5188           0 :                 tevent_req_received(req);
    5189           0 :                 return status;
    5190             :         }
    5191             : 
    5192             :         /* Steal possible out parameters to the callers context */
    5193           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5194             : 
    5195             :         /* Return result */
    5196           0 :         *result = state->orig.out.result;
    5197             : 
    5198           0 :         tevent_req_received(req);
    5199           0 :         return NT_STATUS_OK;
    5200             : }
    5201             : 
    5202          72 : NTSTATUS dcerpc_samr_AddGroupMember(struct dcerpc_binding_handle *h,
    5203             :                                     TALLOC_CTX *mem_ctx,
    5204             :                                     struct policy_handle *_group_handle /* [in] [ref] */,
    5205             :                                     uint32_t _rid /* [in]  */,
    5206             :                                     uint32_t _flags /* [in]  */,
    5207             :                                     NTSTATUS *result)
    5208             : {
    5209             :         struct samr_AddGroupMember r;
    5210             :         NTSTATUS status;
    5211             : 
    5212             :         /* In parameters */
    5213          72 :         r.in.group_handle = _group_handle;
    5214          72 :         r.in.rid = _rid;
    5215          72 :         r.in.flags = _flags;
    5216             : 
    5217             :         /* Out parameters */
    5218             : 
    5219             :         /* Result */
    5220          72 :         NDR_ZERO_STRUCT(r.out.result);
    5221             : 
    5222          72 :         status = dcerpc_samr_AddGroupMember_r(h, mem_ctx, &r);
    5223          72 :         if (!NT_STATUS_IS_OK(status)) {
    5224           0 :                 return status;
    5225             :         }
    5226             : 
    5227             :         /* Return variables */
    5228             : 
    5229             :         /* Return result */
    5230          72 :         *result = r.out.result;
    5231             : 
    5232          72 :         return NT_STATUS_OK;
    5233             : }
    5234             : 
    5235             : struct dcerpc_samr_DeleteDomainGroup_r_state {
    5236             :         TALLOC_CTX *out_mem_ctx;
    5237             : };
    5238             : 
    5239             : static void dcerpc_samr_DeleteDomainGroup_r_done(struct tevent_req *subreq);
    5240             : 
    5241           0 : struct tevent_req *dcerpc_samr_DeleteDomainGroup_r_send(TALLOC_CTX *mem_ctx,
    5242             :         struct tevent_context *ev,
    5243             :         struct dcerpc_binding_handle *h,
    5244             :         struct samr_DeleteDomainGroup *r)
    5245             : {
    5246             :         struct tevent_req *req;
    5247             :         struct dcerpc_samr_DeleteDomainGroup_r_state *state;
    5248             :         struct tevent_req *subreq;
    5249             : 
    5250           0 :         req = tevent_req_create(mem_ctx, &state,
    5251             :                                 struct dcerpc_samr_DeleteDomainGroup_r_state);
    5252           0 :         if (req == NULL) {
    5253           0 :                 return NULL;
    5254             :         }
    5255             : 
    5256           0 :         state->out_mem_ctx = talloc_new(state);
    5257           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    5258           0 :                 return tevent_req_post(req, ev);
    5259             :         }
    5260             : 
    5261           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    5262             :                         NULL, &ndr_table_samr,
    5263           0 :                         NDR_SAMR_DELETEDOMAINGROUP, state->out_mem_ctx, r);
    5264           0 :         if (tevent_req_nomem(subreq, req)) {
    5265           0 :                 return tevent_req_post(req, ev);
    5266             :         }
    5267           0 :         tevent_req_set_callback(subreq, dcerpc_samr_DeleteDomainGroup_r_done, req);
    5268             : 
    5269           0 :         return req;
    5270             : }
    5271             : 
    5272           0 : static void dcerpc_samr_DeleteDomainGroup_r_done(struct tevent_req *subreq)
    5273             : {
    5274           0 :         struct tevent_req *req =
    5275           0 :                 tevent_req_callback_data(subreq,
    5276             :                 struct tevent_req);
    5277             :         NTSTATUS status;
    5278             : 
    5279           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    5280           0 :         TALLOC_FREE(subreq);
    5281           0 :         if (tevent_req_nterror(req, status)) {
    5282           0 :                 return;
    5283             :         }
    5284             : 
    5285           0 :         tevent_req_done(req);
    5286             : }
    5287             : 
    5288           0 : NTSTATUS dcerpc_samr_DeleteDomainGroup_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    5289             : {
    5290           0 :         struct dcerpc_samr_DeleteDomainGroup_r_state *state =
    5291           0 :                 tevent_req_data(req,
    5292             :                 struct dcerpc_samr_DeleteDomainGroup_r_state);
    5293             :         NTSTATUS status;
    5294             : 
    5295           0 :         if (tevent_req_is_nterror(req, &status)) {
    5296           0 :                 tevent_req_received(req);
    5297           0 :                 return status;
    5298             :         }
    5299             : 
    5300           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5301             : 
    5302           0 :         tevent_req_received(req);
    5303           0 :         return NT_STATUS_OK;
    5304             : }
    5305             : 
    5306         532 : NTSTATUS dcerpc_samr_DeleteDomainGroup_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_DeleteDomainGroup *r)
    5307             : {
    5308             :         NTSTATUS status;
    5309             : 
    5310         532 :         status = dcerpc_binding_handle_call(h,
    5311             :                         NULL, &ndr_table_samr,
    5312             :                         NDR_SAMR_DELETEDOMAINGROUP, mem_ctx, r);
    5313             : 
    5314         532 :         return status;
    5315             : }
    5316             : 
    5317             : struct dcerpc_samr_DeleteDomainGroup_state {
    5318             :         struct samr_DeleteDomainGroup orig;
    5319             :         struct samr_DeleteDomainGroup tmp;
    5320             :         TALLOC_CTX *out_mem_ctx;
    5321             : };
    5322             : 
    5323             : static void dcerpc_samr_DeleteDomainGroup_done(struct tevent_req *subreq);
    5324             : 
    5325           0 : struct tevent_req *dcerpc_samr_DeleteDomainGroup_send(TALLOC_CTX *mem_ctx,
    5326             :                                                       struct tevent_context *ev,
    5327             :                                                       struct dcerpc_binding_handle *h,
    5328             :                                                       struct policy_handle *_group_handle /* [in,out] [ref] */)
    5329             : {
    5330             :         struct tevent_req *req;
    5331             :         struct dcerpc_samr_DeleteDomainGroup_state *state;
    5332             :         struct tevent_req *subreq;
    5333             : 
    5334           0 :         req = tevent_req_create(mem_ctx, &state,
    5335             :                                 struct dcerpc_samr_DeleteDomainGroup_state);
    5336           0 :         if (req == NULL) {
    5337           0 :                 return NULL;
    5338             :         }
    5339           0 :         state->out_mem_ctx = NULL;
    5340             : 
    5341             :         /* In parameters */
    5342           0 :         state->orig.in.group_handle = _group_handle;
    5343             : 
    5344             :         /* Out parameters */
    5345           0 :         state->orig.out.group_handle = _group_handle;
    5346             : 
    5347             :         /* Result */
    5348           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    5349             : 
    5350           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    5351             :                              "dcerpc_samr_DeleteDomainGroup_out_memory");
    5352           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    5353           0 :                 return tevent_req_post(req, ev);
    5354             :         }
    5355             : 
    5356             :         /* make a temporary copy, that we pass to the dispatch function */
    5357           0 :         state->tmp = state->orig;
    5358             : 
    5359           0 :         subreq = dcerpc_samr_DeleteDomainGroup_r_send(state, ev, h, &state->tmp);
    5360           0 :         if (tevent_req_nomem(subreq, req)) {
    5361           0 :                 return tevent_req_post(req, ev);
    5362             :         }
    5363           0 :         tevent_req_set_callback(subreq, dcerpc_samr_DeleteDomainGroup_done, req);
    5364           0 :         return req;
    5365             : }
    5366             : 
    5367           0 : static void dcerpc_samr_DeleteDomainGroup_done(struct tevent_req *subreq)
    5368             : {
    5369           0 :         struct tevent_req *req = tevent_req_callback_data(
    5370             :                 subreq, struct tevent_req);
    5371           0 :         struct dcerpc_samr_DeleteDomainGroup_state *state = tevent_req_data(
    5372             :                 req, struct dcerpc_samr_DeleteDomainGroup_state);
    5373             :         NTSTATUS status;
    5374             :         TALLOC_CTX *mem_ctx;
    5375             : 
    5376           0 :         if (state->out_mem_ctx) {
    5377           0 :                 mem_ctx = state->out_mem_ctx;
    5378             :         } else {
    5379           0 :                 mem_ctx = state;
    5380             :         }
    5381             : 
    5382           0 :         status = dcerpc_samr_DeleteDomainGroup_r_recv(subreq, mem_ctx);
    5383           0 :         TALLOC_FREE(subreq);
    5384           0 :         if (tevent_req_nterror(req, status)) {
    5385           0 :                 return;
    5386             :         }
    5387             : 
    5388             :         /* Copy out parameters */
    5389           0 :         *state->orig.out.group_handle = *state->tmp.out.group_handle;
    5390             : 
    5391             :         /* Copy result */
    5392           0 :         state->orig.out.result = state->tmp.out.result;
    5393             : 
    5394             :         /* Reset temporary structure */
    5395           0 :         NDR_ZERO_STRUCT(state->tmp);
    5396             : 
    5397           0 :         tevent_req_done(req);
    5398             : }
    5399             : 
    5400           0 : NTSTATUS dcerpc_samr_DeleteDomainGroup_recv(struct tevent_req *req,
    5401             :                                             TALLOC_CTX *mem_ctx,
    5402             :                                             NTSTATUS *result)
    5403             : {
    5404           0 :         struct dcerpc_samr_DeleteDomainGroup_state *state = tevent_req_data(
    5405             :                 req, struct dcerpc_samr_DeleteDomainGroup_state);
    5406             :         NTSTATUS status;
    5407             : 
    5408           0 :         if (tevent_req_is_nterror(req, &status)) {
    5409           0 :                 tevent_req_received(req);
    5410           0 :                 return status;
    5411             :         }
    5412             : 
    5413             :         /* Steal possible out parameters to the callers context */
    5414           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5415             : 
    5416             :         /* Return result */
    5417           0 :         *result = state->orig.out.result;
    5418             : 
    5419           0 :         tevent_req_received(req);
    5420           0 :         return NT_STATUS_OK;
    5421             : }
    5422             : 
    5423          71 : NTSTATUS dcerpc_samr_DeleteDomainGroup(struct dcerpc_binding_handle *h,
    5424             :                                        TALLOC_CTX *mem_ctx,
    5425             :                                        struct policy_handle *_group_handle /* [in,out] [ref] */,
    5426             :                                        NTSTATUS *result)
    5427             : {
    5428             :         struct samr_DeleteDomainGroup r;
    5429             :         NTSTATUS status;
    5430             : 
    5431             :         /* In parameters */
    5432          71 :         r.in.group_handle = _group_handle;
    5433             : 
    5434             :         /* Out parameters */
    5435          71 :         r.out.group_handle = _group_handle;
    5436             : 
    5437             :         /* Result */
    5438          71 :         NDR_ZERO_STRUCT(r.out.result);
    5439             : 
    5440          71 :         status = dcerpc_samr_DeleteDomainGroup_r(h, mem_ctx, &r);
    5441          71 :         if (!NT_STATUS_IS_OK(status)) {
    5442           0 :                 return status;
    5443             :         }
    5444             : 
    5445             :         /* Return variables */
    5446          71 :         *_group_handle = *r.out.group_handle;
    5447             : 
    5448             :         /* Return result */
    5449          71 :         *result = r.out.result;
    5450             : 
    5451          71 :         return NT_STATUS_OK;
    5452             : }
    5453             : 
    5454             : struct dcerpc_samr_DeleteGroupMember_r_state {
    5455             :         TALLOC_CTX *out_mem_ctx;
    5456             : };
    5457             : 
    5458             : static void dcerpc_samr_DeleteGroupMember_r_done(struct tevent_req *subreq);
    5459             : 
    5460           0 : struct tevent_req *dcerpc_samr_DeleteGroupMember_r_send(TALLOC_CTX *mem_ctx,
    5461             :         struct tevent_context *ev,
    5462             :         struct dcerpc_binding_handle *h,
    5463             :         struct samr_DeleteGroupMember *r)
    5464             : {
    5465             :         struct tevent_req *req;
    5466             :         struct dcerpc_samr_DeleteGroupMember_r_state *state;
    5467             :         struct tevent_req *subreq;
    5468             : 
    5469           0 :         req = tevent_req_create(mem_ctx, &state,
    5470             :                                 struct dcerpc_samr_DeleteGroupMember_r_state);
    5471           0 :         if (req == NULL) {
    5472           0 :                 return NULL;
    5473             :         }
    5474             : 
    5475           0 :         state->out_mem_ctx = NULL;
    5476             : 
    5477           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    5478             :                         NULL, &ndr_table_samr,
    5479             :                         NDR_SAMR_DELETEGROUPMEMBER, state, r);
    5480           0 :         if (tevent_req_nomem(subreq, req)) {
    5481           0 :                 return tevent_req_post(req, ev);
    5482             :         }
    5483           0 :         tevent_req_set_callback(subreq, dcerpc_samr_DeleteGroupMember_r_done, req);
    5484             : 
    5485           0 :         return req;
    5486             : }
    5487             : 
    5488           0 : static void dcerpc_samr_DeleteGroupMember_r_done(struct tevent_req *subreq)
    5489             : {
    5490           0 :         struct tevent_req *req =
    5491           0 :                 tevent_req_callback_data(subreq,
    5492             :                 struct tevent_req);
    5493             :         NTSTATUS status;
    5494             : 
    5495           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    5496           0 :         TALLOC_FREE(subreq);
    5497           0 :         if (tevent_req_nterror(req, status)) {
    5498           0 :                 return;
    5499             :         }
    5500             : 
    5501           0 :         tevent_req_done(req);
    5502             : }
    5503             : 
    5504           0 : NTSTATUS dcerpc_samr_DeleteGroupMember_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    5505             : {
    5506           0 :         struct dcerpc_samr_DeleteGroupMember_r_state *state =
    5507           0 :                 tevent_req_data(req,
    5508             :                 struct dcerpc_samr_DeleteGroupMember_r_state);
    5509             :         NTSTATUS status;
    5510             : 
    5511           0 :         if (tevent_req_is_nterror(req, &status)) {
    5512           0 :                 tevent_req_received(req);
    5513           0 :                 return status;
    5514             :         }
    5515             : 
    5516           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5517             : 
    5518           0 :         tevent_req_received(req);
    5519           0 :         return NT_STATUS_OK;
    5520             : }
    5521             : 
    5522          80 : NTSTATUS dcerpc_samr_DeleteGroupMember_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_DeleteGroupMember *r)
    5523             : {
    5524             :         NTSTATUS status;
    5525             : 
    5526          80 :         status = dcerpc_binding_handle_call(h,
    5527             :                         NULL, &ndr_table_samr,
    5528             :                         NDR_SAMR_DELETEGROUPMEMBER, mem_ctx, r);
    5529             : 
    5530          80 :         return status;
    5531             : }
    5532             : 
    5533             : struct dcerpc_samr_DeleteGroupMember_state {
    5534             :         struct samr_DeleteGroupMember orig;
    5535             :         struct samr_DeleteGroupMember tmp;
    5536             :         TALLOC_CTX *out_mem_ctx;
    5537             : };
    5538             : 
    5539             : static void dcerpc_samr_DeleteGroupMember_done(struct tevent_req *subreq);
    5540             : 
    5541           0 : struct tevent_req *dcerpc_samr_DeleteGroupMember_send(TALLOC_CTX *mem_ctx,
    5542             :                                                       struct tevent_context *ev,
    5543             :                                                       struct dcerpc_binding_handle *h,
    5544             :                                                       struct policy_handle *_group_handle /* [in] [ref] */,
    5545             :                                                       uint32_t _rid /* [in]  */)
    5546             : {
    5547             :         struct tevent_req *req;
    5548             :         struct dcerpc_samr_DeleteGroupMember_state *state;
    5549             :         struct tevent_req *subreq;
    5550             : 
    5551           0 :         req = tevent_req_create(mem_ctx, &state,
    5552             :                                 struct dcerpc_samr_DeleteGroupMember_state);
    5553           0 :         if (req == NULL) {
    5554           0 :                 return NULL;
    5555             :         }
    5556           0 :         state->out_mem_ctx = NULL;
    5557             : 
    5558             :         /* In parameters */
    5559           0 :         state->orig.in.group_handle = _group_handle;
    5560           0 :         state->orig.in.rid = _rid;
    5561             : 
    5562             :         /* Out parameters */
    5563             : 
    5564             :         /* Result */
    5565           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    5566             : 
    5567             :         /* make a temporary copy, that we pass to the dispatch function */
    5568           0 :         state->tmp = state->orig;
    5569             : 
    5570           0 :         subreq = dcerpc_samr_DeleteGroupMember_r_send(state, ev, h, &state->tmp);
    5571           0 :         if (tevent_req_nomem(subreq, req)) {
    5572           0 :                 return tevent_req_post(req, ev);
    5573             :         }
    5574           0 :         tevent_req_set_callback(subreq, dcerpc_samr_DeleteGroupMember_done, req);
    5575           0 :         return req;
    5576             : }
    5577             : 
    5578           0 : static void dcerpc_samr_DeleteGroupMember_done(struct tevent_req *subreq)
    5579             : {
    5580           0 :         struct tevent_req *req = tevent_req_callback_data(
    5581             :                 subreq, struct tevent_req);
    5582           0 :         struct dcerpc_samr_DeleteGroupMember_state *state = tevent_req_data(
    5583             :                 req, struct dcerpc_samr_DeleteGroupMember_state);
    5584             :         NTSTATUS status;
    5585             :         TALLOC_CTX *mem_ctx;
    5586             : 
    5587           0 :         if (state->out_mem_ctx) {
    5588           0 :                 mem_ctx = state->out_mem_ctx;
    5589             :         } else {
    5590           0 :                 mem_ctx = state;
    5591             :         }
    5592             : 
    5593           0 :         status = dcerpc_samr_DeleteGroupMember_r_recv(subreq, mem_ctx);
    5594           0 :         TALLOC_FREE(subreq);
    5595           0 :         if (tevent_req_nterror(req, status)) {
    5596           0 :                 return;
    5597             :         }
    5598             : 
    5599             :         /* Copy out parameters */
    5600             : 
    5601             :         /* Copy result */
    5602           0 :         state->orig.out.result = state->tmp.out.result;
    5603             : 
    5604             :         /* Reset temporary structure */
    5605           0 :         NDR_ZERO_STRUCT(state->tmp);
    5606             : 
    5607           0 :         tevent_req_done(req);
    5608             : }
    5609             : 
    5610           0 : NTSTATUS dcerpc_samr_DeleteGroupMember_recv(struct tevent_req *req,
    5611             :                                             TALLOC_CTX *mem_ctx,
    5612             :                                             NTSTATUS *result)
    5613             : {
    5614           0 :         struct dcerpc_samr_DeleteGroupMember_state *state = tevent_req_data(
    5615             :                 req, struct dcerpc_samr_DeleteGroupMember_state);
    5616             :         NTSTATUS status;
    5617             : 
    5618           0 :         if (tevent_req_is_nterror(req, &status)) {
    5619           0 :                 tevent_req_received(req);
    5620           0 :                 return status;
    5621             :         }
    5622             : 
    5623             :         /* Steal possible out parameters to the callers context */
    5624           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5625             : 
    5626             :         /* Return result */
    5627           0 :         *result = state->orig.out.result;
    5628             : 
    5629           0 :         tevent_req_received(req);
    5630           0 :         return NT_STATUS_OK;
    5631             : }
    5632             : 
    5633          71 : NTSTATUS dcerpc_samr_DeleteGroupMember(struct dcerpc_binding_handle *h,
    5634             :                                        TALLOC_CTX *mem_ctx,
    5635             :                                        struct policy_handle *_group_handle /* [in] [ref] */,
    5636             :                                        uint32_t _rid /* [in]  */,
    5637             :                                        NTSTATUS *result)
    5638             : {
    5639             :         struct samr_DeleteGroupMember r;
    5640             :         NTSTATUS status;
    5641             : 
    5642             :         /* In parameters */
    5643          71 :         r.in.group_handle = _group_handle;
    5644          71 :         r.in.rid = _rid;
    5645             : 
    5646             :         /* Out parameters */
    5647             : 
    5648             :         /* Result */
    5649          71 :         NDR_ZERO_STRUCT(r.out.result);
    5650             : 
    5651          71 :         status = dcerpc_samr_DeleteGroupMember_r(h, mem_ctx, &r);
    5652          71 :         if (!NT_STATUS_IS_OK(status)) {
    5653           0 :                 return status;
    5654             :         }
    5655             : 
    5656             :         /* Return variables */
    5657             : 
    5658             :         /* Return result */
    5659          71 :         *result = r.out.result;
    5660             : 
    5661          71 :         return NT_STATUS_OK;
    5662             : }
    5663             : 
    5664             : struct dcerpc_samr_QueryGroupMember_r_state {
    5665             :         TALLOC_CTX *out_mem_ctx;
    5666             : };
    5667             : 
    5668             : static void dcerpc_samr_QueryGroupMember_r_done(struct tevent_req *subreq);
    5669             : 
    5670           0 : struct tevent_req *dcerpc_samr_QueryGroupMember_r_send(TALLOC_CTX *mem_ctx,
    5671             :         struct tevent_context *ev,
    5672             :         struct dcerpc_binding_handle *h,
    5673             :         struct samr_QueryGroupMember *r)
    5674             : {
    5675             :         struct tevent_req *req;
    5676             :         struct dcerpc_samr_QueryGroupMember_r_state *state;
    5677             :         struct tevent_req *subreq;
    5678             : 
    5679           0 :         req = tevent_req_create(mem_ctx, &state,
    5680             :                                 struct dcerpc_samr_QueryGroupMember_r_state);
    5681           0 :         if (req == NULL) {
    5682           0 :                 return NULL;
    5683             :         }
    5684             : 
    5685           0 :         state->out_mem_ctx = talloc_new(state);
    5686           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    5687           0 :                 return tevent_req_post(req, ev);
    5688             :         }
    5689             : 
    5690           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    5691             :                         NULL, &ndr_table_samr,
    5692           0 :                         NDR_SAMR_QUERYGROUPMEMBER, state->out_mem_ctx, r);
    5693           0 :         if (tevent_req_nomem(subreq, req)) {
    5694           0 :                 return tevent_req_post(req, ev);
    5695             :         }
    5696           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryGroupMember_r_done, req);
    5697             : 
    5698           0 :         return req;
    5699             : }
    5700             : 
    5701           0 : static void dcerpc_samr_QueryGroupMember_r_done(struct tevent_req *subreq)
    5702             : {
    5703           0 :         struct tevent_req *req =
    5704           0 :                 tevent_req_callback_data(subreq,
    5705             :                 struct tevent_req);
    5706             :         NTSTATUS status;
    5707             : 
    5708           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    5709           0 :         TALLOC_FREE(subreq);
    5710           0 :         if (tevent_req_nterror(req, status)) {
    5711           0 :                 return;
    5712             :         }
    5713             : 
    5714           0 :         tevent_req_done(req);
    5715             : }
    5716             : 
    5717           0 : NTSTATUS dcerpc_samr_QueryGroupMember_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    5718             : {
    5719           0 :         struct dcerpc_samr_QueryGroupMember_r_state *state =
    5720           0 :                 tevent_req_data(req,
    5721             :                 struct dcerpc_samr_QueryGroupMember_r_state);
    5722             :         NTSTATUS status;
    5723             : 
    5724           0 :         if (tevent_req_is_nterror(req, &status)) {
    5725           0 :                 tevent_req_received(req);
    5726           0 :                 return status;
    5727             :         }
    5728             : 
    5729           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5730             : 
    5731           0 :         tevent_req_received(req);
    5732           0 :         return NT_STATUS_OK;
    5733             : }
    5734             : 
    5735         816 : NTSTATUS dcerpc_samr_QueryGroupMember_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_QueryGroupMember *r)
    5736             : {
    5737             :         NTSTATUS status;
    5738             : 
    5739         816 :         status = dcerpc_binding_handle_call(h,
    5740             :                         NULL, &ndr_table_samr,
    5741             :                         NDR_SAMR_QUERYGROUPMEMBER, mem_ctx, r);
    5742             : 
    5743         816 :         return status;
    5744             : }
    5745             : 
    5746             : struct dcerpc_samr_QueryGroupMember_state {
    5747             :         struct samr_QueryGroupMember orig;
    5748             :         struct samr_QueryGroupMember tmp;
    5749             :         TALLOC_CTX *out_mem_ctx;
    5750             : };
    5751             : 
    5752             : static void dcerpc_samr_QueryGroupMember_done(struct tevent_req *subreq);
    5753             : 
    5754           0 : struct tevent_req *dcerpc_samr_QueryGroupMember_send(TALLOC_CTX *mem_ctx,
    5755             :                                                      struct tevent_context *ev,
    5756             :                                                      struct dcerpc_binding_handle *h,
    5757             :                                                      struct policy_handle *_group_handle /* [in] [ref] */,
    5758             :                                                      struct samr_RidAttrArray **_rids /* [out] [ref] */)
    5759             : {
    5760             :         struct tevent_req *req;
    5761             :         struct dcerpc_samr_QueryGroupMember_state *state;
    5762             :         struct tevent_req *subreq;
    5763             : 
    5764           0 :         req = tevent_req_create(mem_ctx, &state,
    5765             :                                 struct dcerpc_samr_QueryGroupMember_state);
    5766           0 :         if (req == NULL) {
    5767           0 :                 return NULL;
    5768             :         }
    5769           0 :         state->out_mem_ctx = NULL;
    5770             : 
    5771             :         /* In parameters */
    5772           0 :         state->orig.in.group_handle = _group_handle;
    5773             : 
    5774             :         /* Out parameters */
    5775           0 :         state->orig.out.rids = _rids;
    5776             : 
    5777             :         /* Result */
    5778           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    5779             : 
    5780           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    5781             :                              "dcerpc_samr_QueryGroupMember_out_memory");
    5782           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    5783           0 :                 return tevent_req_post(req, ev);
    5784             :         }
    5785             : 
    5786             :         /* make a temporary copy, that we pass to the dispatch function */
    5787           0 :         state->tmp = state->orig;
    5788             : 
    5789           0 :         subreq = dcerpc_samr_QueryGroupMember_r_send(state, ev, h, &state->tmp);
    5790           0 :         if (tevent_req_nomem(subreq, req)) {
    5791           0 :                 return tevent_req_post(req, ev);
    5792             :         }
    5793           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryGroupMember_done, req);
    5794           0 :         return req;
    5795             : }
    5796             : 
    5797           0 : static void dcerpc_samr_QueryGroupMember_done(struct tevent_req *subreq)
    5798             : {
    5799           0 :         struct tevent_req *req = tevent_req_callback_data(
    5800             :                 subreq, struct tevent_req);
    5801           0 :         struct dcerpc_samr_QueryGroupMember_state *state = tevent_req_data(
    5802             :                 req, struct dcerpc_samr_QueryGroupMember_state);
    5803             :         NTSTATUS status;
    5804             :         TALLOC_CTX *mem_ctx;
    5805             : 
    5806           0 :         if (state->out_mem_ctx) {
    5807           0 :                 mem_ctx = state->out_mem_ctx;
    5808             :         } else {
    5809           0 :                 mem_ctx = state;
    5810             :         }
    5811             : 
    5812           0 :         status = dcerpc_samr_QueryGroupMember_r_recv(subreq, mem_ctx);
    5813           0 :         TALLOC_FREE(subreq);
    5814           0 :         if (tevent_req_nterror(req, status)) {
    5815           0 :                 return;
    5816             :         }
    5817             : 
    5818             :         /* Copy out parameters */
    5819           0 :         *state->orig.out.rids = *state->tmp.out.rids;
    5820             : 
    5821             :         /* Copy result */
    5822           0 :         state->orig.out.result = state->tmp.out.result;
    5823             : 
    5824             :         /* Reset temporary structure */
    5825           0 :         NDR_ZERO_STRUCT(state->tmp);
    5826             : 
    5827           0 :         tevent_req_done(req);
    5828             : }
    5829             : 
    5830           0 : NTSTATUS dcerpc_samr_QueryGroupMember_recv(struct tevent_req *req,
    5831             :                                            TALLOC_CTX *mem_ctx,
    5832             :                                            NTSTATUS *result)
    5833             : {
    5834           0 :         struct dcerpc_samr_QueryGroupMember_state *state = tevent_req_data(
    5835             :                 req, struct dcerpc_samr_QueryGroupMember_state);
    5836             :         NTSTATUS status;
    5837             : 
    5838           0 :         if (tevent_req_is_nterror(req, &status)) {
    5839           0 :                 tevent_req_received(req);
    5840           0 :                 return status;
    5841             :         }
    5842             : 
    5843             :         /* Steal possible out parameters to the callers context */
    5844           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5845             : 
    5846             :         /* Return result */
    5847           0 :         *result = state->orig.out.result;
    5848             : 
    5849           0 :         tevent_req_received(req);
    5850           0 :         return NT_STATUS_OK;
    5851             : }
    5852             : 
    5853          78 : NTSTATUS dcerpc_samr_QueryGroupMember(struct dcerpc_binding_handle *h,
    5854             :                                       TALLOC_CTX *mem_ctx,
    5855             :                                       struct policy_handle *_group_handle /* [in] [ref] */,
    5856             :                                       struct samr_RidAttrArray **_rids /* [out] [ref] */,
    5857             :                                       NTSTATUS *result)
    5858             : {
    5859             :         struct samr_QueryGroupMember r;
    5860             :         NTSTATUS status;
    5861             : 
    5862             :         /* In parameters */
    5863          78 :         r.in.group_handle = _group_handle;
    5864             : 
    5865             :         /* Out parameters */
    5866          78 :         r.out.rids = _rids;
    5867             : 
    5868             :         /* Result */
    5869          78 :         NDR_ZERO_STRUCT(r.out.result);
    5870             : 
    5871          78 :         status = dcerpc_samr_QueryGroupMember_r(h, mem_ctx, &r);
    5872          78 :         if (!NT_STATUS_IS_OK(status)) {
    5873           0 :                 return status;
    5874             :         }
    5875             : 
    5876             :         /* Return variables */
    5877          78 :         *_rids = *r.out.rids;
    5878             : 
    5879             :         /* Return result */
    5880          78 :         *result = r.out.result;
    5881             : 
    5882          78 :         return NT_STATUS_OK;
    5883             : }
    5884             : 
    5885             : struct dcerpc_samr_SetMemberAttributesOfGroup_r_state {
    5886             :         TALLOC_CTX *out_mem_ctx;
    5887             : };
    5888             : 
    5889             : static void dcerpc_samr_SetMemberAttributesOfGroup_r_done(struct tevent_req *subreq);
    5890             : 
    5891           0 : struct tevent_req *dcerpc_samr_SetMemberAttributesOfGroup_r_send(TALLOC_CTX *mem_ctx,
    5892             :         struct tevent_context *ev,
    5893             :         struct dcerpc_binding_handle *h,
    5894             :         struct samr_SetMemberAttributesOfGroup *r)
    5895             : {
    5896             :         struct tevent_req *req;
    5897             :         struct dcerpc_samr_SetMemberAttributesOfGroup_r_state *state;
    5898             :         struct tevent_req *subreq;
    5899             : 
    5900           0 :         req = tevent_req_create(mem_ctx, &state,
    5901             :                                 struct dcerpc_samr_SetMemberAttributesOfGroup_r_state);
    5902           0 :         if (req == NULL) {
    5903           0 :                 return NULL;
    5904             :         }
    5905             : 
    5906           0 :         state->out_mem_ctx = NULL;
    5907             : 
    5908           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    5909             :                         NULL, &ndr_table_samr,
    5910             :                         NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP, state, r);
    5911           0 :         if (tevent_req_nomem(subreq, req)) {
    5912           0 :                 return tevent_req_post(req, ev);
    5913             :         }
    5914           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetMemberAttributesOfGroup_r_done, req);
    5915             : 
    5916           0 :         return req;
    5917             : }
    5918             : 
    5919           0 : static void dcerpc_samr_SetMemberAttributesOfGroup_r_done(struct tevent_req *subreq)
    5920             : {
    5921           0 :         struct tevent_req *req =
    5922           0 :                 tevent_req_callback_data(subreq,
    5923             :                 struct tevent_req);
    5924             :         NTSTATUS status;
    5925             : 
    5926           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    5927           0 :         TALLOC_FREE(subreq);
    5928           0 :         if (tevent_req_nterror(req, status)) {
    5929           0 :                 return;
    5930             :         }
    5931             : 
    5932           0 :         tevent_req_done(req);
    5933             : }
    5934             : 
    5935           0 : NTSTATUS dcerpc_samr_SetMemberAttributesOfGroup_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    5936             : {
    5937           0 :         struct dcerpc_samr_SetMemberAttributesOfGroup_r_state *state =
    5938           0 :                 tevent_req_data(req,
    5939             :                 struct dcerpc_samr_SetMemberAttributesOfGroup_r_state);
    5940             :         NTSTATUS status;
    5941             : 
    5942           0 :         if (tevent_req_is_nterror(req, &status)) {
    5943           0 :                 tevent_req_received(req);
    5944           0 :                 return status;
    5945             :         }
    5946             : 
    5947           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5948             : 
    5949           0 :         tevent_req_received(req);
    5950           0 :         return NT_STATUS_OK;
    5951             : }
    5952             : 
    5953           0 : NTSTATUS dcerpc_samr_SetMemberAttributesOfGroup_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_SetMemberAttributesOfGroup *r)
    5954             : {
    5955             :         NTSTATUS status;
    5956             : 
    5957           0 :         status = dcerpc_binding_handle_call(h,
    5958             :                         NULL, &ndr_table_samr,
    5959             :                         NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP, mem_ctx, r);
    5960             : 
    5961           0 :         return status;
    5962             : }
    5963             : 
    5964             : struct dcerpc_samr_SetMemberAttributesOfGroup_state {
    5965             :         struct samr_SetMemberAttributesOfGroup orig;
    5966             :         struct samr_SetMemberAttributesOfGroup tmp;
    5967             :         TALLOC_CTX *out_mem_ctx;
    5968             : };
    5969             : 
    5970             : static void dcerpc_samr_SetMemberAttributesOfGroup_done(struct tevent_req *subreq);
    5971             : 
    5972           0 : struct tevent_req *dcerpc_samr_SetMemberAttributesOfGroup_send(TALLOC_CTX *mem_ctx,
    5973             :                                                                struct tevent_context *ev,
    5974             :                                                                struct dcerpc_binding_handle *h,
    5975             :                                                                struct policy_handle *_group_handle /* [in] [ref] */,
    5976             :                                                                uint32_t _unknown1 /* [in]  */,
    5977             :                                                                uint32_t _unknown2 /* [in]  */)
    5978             : {
    5979             :         struct tevent_req *req;
    5980             :         struct dcerpc_samr_SetMemberAttributesOfGroup_state *state;
    5981             :         struct tevent_req *subreq;
    5982             : 
    5983           0 :         req = tevent_req_create(mem_ctx, &state,
    5984             :                                 struct dcerpc_samr_SetMemberAttributesOfGroup_state);
    5985           0 :         if (req == NULL) {
    5986           0 :                 return NULL;
    5987             :         }
    5988           0 :         state->out_mem_ctx = NULL;
    5989             : 
    5990             :         /* In parameters */
    5991           0 :         state->orig.in.group_handle = _group_handle;
    5992           0 :         state->orig.in.unknown1 = _unknown1;
    5993           0 :         state->orig.in.unknown2 = _unknown2;
    5994             : 
    5995             :         /* Out parameters */
    5996             : 
    5997             :         /* Result */
    5998           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    5999             : 
    6000             :         /* make a temporary copy, that we pass to the dispatch function */
    6001           0 :         state->tmp = state->orig;
    6002             : 
    6003           0 :         subreq = dcerpc_samr_SetMemberAttributesOfGroup_r_send(state, ev, h, &state->tmp);
    6004           0 :         if (tevent_req_nomem(subreq, req)) {
    6005           0 :                 return tevent_req_post(req, ev);
    6006             :         }
    6007           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetMemberAttributesOfGroup_done, req);
    6008           0 :         return req;
    6009             : }
    6010             : 
    6011           0 : static void dcerpc_samr_SetMemberAttributesOfGroup_done(struct tevent_req *subreq)
    6012             : {
    6013           0 :         struct tevent_req *req = tevent_req_callback_data(
    6014             :                 subreq, struct tevent_req);
    6015           0 :         struct dcerpc_samr_SetMemberAttributesOfGroup_state *state = tevent_req_data(
    6016             :                 req, struct dcerpc_samr_SetMemberAttributesOfGroup_state);
    6017             :         NTSTATUS status;
    6018             :         TALLOC_CTX *mem_ctx;
    6019             : 
    6020           0 :         if (state->out_mem_ctx) {
    6021           0 :                 mem_ctx = state->out_mem_ctx;
    6022             :         } else {
    6023           0 :                 mem_ctx = state;
    6024             :         }
    6025             : 
    6026           0 :         status = dcerpc_samr_SetMemberAttributesOfGroup_r_recv(subreq, mem_ctx);
    6027           0 :         TALLOC_FREE(subreq);
    6028           0 :         if (tevent_req_nterror(req, status)) {
    6029           0 :                 return;
    6030             :         }
    6031             : 
    6032             :         /* Copy out parameters */
    6033             : 
    6034             :         /* Copy result */
    6035           0 :         state->orig.out.result = state->tmp.out.result;
    6036             : 
    6037             :         /* Reset temporary structure */
    6038           0 :         NDR_ZERO_STRUCT(state->tmp);
    6039             : 
    6040           0 :         tevent_req_done(req);
    6041             : }
    6042             : 
    6043           0 : NTSTATUS dcerpc_samr_SetMemberAttributesOfGroup_recv(struct tevent_req *req,
    6044             :                                                      TALLOC_CTX *mem_ctx,
    6045             :                                                      NTSTATUS *result)
    6046             : {
    6047           0 :         struct dcerpc_samr_SetMemberAttributesOfGroup_state *state = tevent_req_data(
    6048             :                 req, struct dcerpc_samr_SetMemberAttributesOfGroup_state);
    6049             :         NTSTATUS status;
    6050             : 
    6051           0 :         if (tevent_req_is_nterror(req, &status)) {
    6052           0 :                 tevent_req_received(req);
    6053           0 :                 return status;
    6054             :         }
    6055             : 
    6056             :         /* Steal possible out parameters to the callers context */
    6057           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6058             : 
    6059             :         /* Return result */
    6060           0 :         *result = state->orig.out.result;
    6061             : 
    6062           0 :         tevent_req_received(req);
    6063           0 :         return NT_STATUS_OK;
    6064             : }
    6065             : 
    6066           0 : NTSTATUS dcerpc_samr_SetMemberAttributesOfGroup(struct dcerpc_binding_handle *h,
    6067             :                                                 TALLOC_CTX *mem_ctx,
    6068             :                                                 struct policy_handle *_group_handle /* [in] [ref] */,
    6069             :                                                 uint32_t _unknown1 /* [in]  */,
    6070             :                                                 uint32_t _unknown2 /* [in]  */,
    6071             :                                                 NTSTATUS *result)
    6072             : {
    6073             :         struct samr_SetMemberAttributesOfGroup r;
    6074             :         NTSTATUS status;
    6075             : 
    6076             :         /* In parameters */
    6077           0 :         r.in.group_handle = _group_handle;
    6078           0 :         r.in.unknown1 = _unknown1;
    6079           0 :         r.in.unknown2 = _unknown2;
    6080             : 
    6081             :         /* Out parameters */
    6082             : 
    6083             :         /* Result */
    6084           0 :         NDR_ZERO_STRUCT(r.out.result);
    6085             : 
    6086           0 :         status = dcerpc_samr_SetMemberAttributesOfGroup_r(h, mem_ctx, &r);
    6087           0 :         if (!NT_STATUS_IS_OK(status)) {
    6088           0 :                 return status;
    6089             :         }
    6090             : 
    6091             :         /* Return variables */
    6092             : 
    6093             :         /* Return result */
    6094           0 :         *result = r.out.result;
    6095             : 
    6096           0 :         return NT_STATUS_OK;
    6097             : }
    6098             : 
    6099             : struct dcerpc_samr_OpenAlias_r_state {
    6100             :         TALLOC_CTX *out_mem_ctx;
    6101             : };
    6102             : 
    6103             : static void dcerpc_samr_OpenAlias_r_done(struct tevent_req *subreq);
    6104             : 
    6105           0 : struct tevent_req *dcerpc_samr_OpenAlias_r_send(TALLOC_CTX *mem_ctx,
    6106             :         struct tevent_context *ev,
    6107             :         struct dcerpc_binding_handle *h,
    6108             :         struct samr_OpenAlias *r)
    6109             : {
    6110             :         struct tevent_req *req;
    6111             :         struct dcerpc_samr_OpenAlias_r_state *state;
    6112             :         struct tevent_req *subreq;
    6113             : 
    6114           0 :         req = tevent_req_create(mem_ctx, &state,
    6115             :                                 struct dcerpc_samr_OpenAlias_r_state);
    6116           0 :         if (req == NULL) {
    6117           0 :                 return NULL;
    6118             :         }
    6119             : 
    6120           0 :         state->out_mem_ctx = talloc_new(state);
    6121           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6122           0 :                 return tevent_req_post(req, ev);
    6123             :         }
    6124             : 
    6125           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    6126             :                         NULL, &ndr_table_samr,
    6127           0 :                         NDR_SAMR_OPENALIAS, state->out_mem_ctx, r);
    6128           0 :         if (tevent_req_nomem(subreq, req)) {
    6129           0 :                 return tevent_req_post(req, ev);
    6130             :         }
    6131           0 :         tevent_req_set_callback(subreq, dcerpc_samr_OpenAlias_r_done, req);
    6132             : 
    6133           0 :         return req;
    6134             : }
    6135             : 
    6136           0 : static void dcerpc_samr_OpenAlias_r_done(struct tevent_req *subreq)
    6137             : {
    6138           0 :         struct tevent_req *req =
    6139           0 :                 tevent_req_callback_data(subreq,
    6140             :                 struct tevent_req);
    6141             :         NTSTATUS status;
    6142             : 
    6143           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    6144           0 :         TALLOC_FREE(subreq);
    6145           0 :         if (tevent_req_nterror(req, status)) {
    6146           0 :                 return;
    6147             :         }
    6148             : 
    6149           0 :         tevent_req_done(req);
    6150             : }
    6151             : 
    6152           0 : NTSTATUS dcerpc_samr_OpenAlias_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    6153             : {
    6154           0 :         struct dcerpc_samr_OpenAlias_r_state *state =
    6155           0 :                 tevent_req_data(req,
    6156             :                 struct dcerpc_samr_OpenAlias_r_state);
    6157             :         NTSTATUS status;
    6158             : 
    6159           0 :         if (tevent_req_is_nterror(req, &status)) {
    6160           0 :                 tevent_req_received(req);
    6161           0 :                 return status;
    6162             :         }
    6163             : 
    6164           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6165             : 
    6166           0 :         tevent_req_received(req);
    6167           0 :         return NT_STATUS_OK;
    6168             : }
    6169             : 
    6170        1365 : NTSTATUS dcerpc_samr_OpenAlias_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_OpenAlias *r)
    6171             : {
    6172             :         NTSTATUS status;
    6173             : 
    6174        1365 :         status = dcerpc_binding_handle_call(h,
    6175             :                         NULL, &ndr_table_samr,
    6176             :                         NDR_SAMR_OPENALIAS, mem_ctx, r);
    6177             : 
    6178        1365 :         return status;
    6179             : }
    6180             : 
    6181             : struct dcerpc_samr_OpenAlias_state {
    6182             :         struct samr_OpenAlias orig;
    6183             :         struct samr_OpenAlias tmp;
    6184             :         TALLOC_CTX *out_mem_ctx;
    6185             : };
    6186             : 
    6187             : static void dcerpc_samr_OpenAlias_done(struct tevent_req *subreq);
    6188             : 
    6189           0 : struct tevent_req *dcerpc_samr_OpenAlias_send(TALLOC_CTX *mem_ctx,
    6190             :                                               struct tevent_context *ev,
    6191             :                                               struct dcerpc_binding_handle *h,
    6192             :                                               struct policy_handle *_domain_handle /* [in] [ref] */,
    6193             :                                               uint32_t _access_mask /* [in]  */,
    6194             :                                               uint32_t _rid /* [in]  */,
    6195             :                                               struct policy_handle *_alias_handle /* [out] [ref] */)
    6196             : {
    6197             :         struct tevent_req *req;
    6198             :         struct dcerpc_samr_OpenAlias_state *state;
    6199             :         struct tevent_req *subreq;
    6200             : 
    6201           0 :         req = tevent_req_create(mem_ctx, &state,
    6202             :                                 struct dcerpc_samr_OpenAlias_state);
    6203           0 :         if (req == NULL) {
    6204           0 :                 return NULL;
    6205             :         }
    6206           0 :         state->out_mem_ctx = NULL;
    6207             : 
    6208             :         /* In parameters */
    6209           0 :         state->orig.in.domain_handle = _domain_handle;
    6210           0 :         state->orig.in.access_mask = _access_mask;
    6211           0 :         state->orig.in.rid = _rid;
    6212             : 
    6213             :         /* Out parameters */
    6214           0 :         state->orig.out.alias_handle = _alias_handle;
    6215             : 
    6216             :         /* Result */
    6217           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    6218             : 
    6219           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    6220             :                              "dcerpc_samr_OpenAlias_out_memory");
    6221           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6222           0 :                 return tevent_req_post(req, ev);
    6223             :         }
    6224             : 
    6225             :         /* make a temporary copy, that we pass to the dispatch function */
    6226           0 :         state->tmp = state->orig;
    6227             : 
    6228           0 :         subreq = dcerpc_samr_OpenAlias_r_send(state, ev, h, &state->tmp);
    6229           0 :         if (tevent_req_nomem(subreq, req)) {
    6230           0 :                 return tevent_req_post(req, ev);
    6231             :         }
    6232           0 :         tevent_req_set_callback(subreq, dcerpc_samr_OpenAlias_done, req);
    6233           0 :         return req;
    6234             : }
    6235             : 
    6236           0 : static void dcerpc_samr_OpenAlias_done(struct tevent_req *subreq)
    6237             : {
    6238           0 :         struct tevent_req *req = tevent_req_callback_data(
    6239             :                 subreq, struct tevent_req);
    6240           0 :         struct dcerpc_samr_OpenAlias_state *state = tevent_req_data(
    6241             :                 req, struct dcerpc_samr_OpenAlias_state);
    6242             :         NTSTATUS status;
    6243             :         TALLOC_CTX *mem_ctx;
    6244             : 
    6245           0 :         if (state->out_mem_ctx) {
    6246           0 :                 mem_ctx = state->out_mem_ctx;
    6247             :         } else {
    6248           0 :                 mem_ctx = state;
    6249             :         }
    6250             : 
    6251           0 :         status = dcerpc_samr_OpenAlias_r_recv(subreq, mem_ctx);
    6252           0 :         TALLOC_FREE(subreq);
    6253           0 :         if (tevent_req_nterror(req, status)) {
    6254           0 :                 return;
    6255             :         }
    6256             : 
    6257             :         /* Copy out parameters */
    6258           0 :         *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
    6259             : 
    6260             :         /* Copy result */
    6261           0 :         state->orig.out.result = state->tmp.out.result;
    6262             : 
    6263             :         /* Reset temporary structure */
    6264           0 :         NDR_ZERO_STRUCT(state->tmp);
    6265             : 
    6266           0 :         tevent_req_done(req);
    6267             : }
    6268             : 
    6269           0 : NTSTATUS dcerpc_samr_OpenAlias_recv(struct tevent_req *req,
    6270             :                                     TALLOC_CTX *mem_ctx,
    6271             :                                     NTSTATUS *result)
    6272             : {
    6273           0 :         struct dcerpc_samr_OpenAlias_state *state = tevent_req_data(
    6274             :                 req, struct dcerpc_samr_OpenAlias_state);
    6275             :         NTSTATUS status;
    6276             : 
    6277           0 :         if (tevent_req_is_nterror(req, &status)) {
    6278           0 :                 tevent_req_received(req);
    6279           0 :                 return status;
    6280             :         }
    6281             : 
    6282             :         /* Steal possible out parameters to the callers context */
    6283           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6284             : 
    6285             :         /* Return result */
    6286           0 :         *result = state->orig.out.result;
    6287             : 
    6288           0 :         tevent_req_received(req);
    6289           0 :         return NT_STATUS_OK;
    6290             : }
    6291             : 
    6292        1224 : NTSTATUS dcerpc_samr_OpenAlias(struct dcerpc_binding_handle *h,
    6293             :                                TALLOC_CTX *mem_ctx,
    6294             :                                struct policy_handle *_domain_handle /* [in] [ref] */,
    6295             :                                uint32_t _access_mask /* [in]  */,
    6296             :                                uint32_t _rid /* [in]  */,
    6297             :                                struct policy_handle *_alias_handle /* [out] [ref] */,
    6298             :                                NTSTATUS *result)
    6299             : {
    6300             :         struct samr_OpenAlias r;
    6301             :         NTSTATUS status;
    6302             : 
    6303             :         /* In parameters */
    6304        1224 :         r.in.domain_handle = _domain_handle;
    6305        1224 :         r.in.access_mask = _access_mask;
    6306        1224 :         r.in.rid = _rid;
    6307             : 
    6308             :         /* Out parameters */
    6309        1224 :         r.out.alias_handle = _alias_handle;
    6310             : 
    6311             :         /* Result */
    6312        1224 :         NDR_ZERO_STRUCT(r.out.result);
    6313             : 
    6314        1224 :         status = dcerpc_samr_OpenAlias_r(h, mem_ctx, &r);
    6315        1224 :         if (!NT_STATUS_IS_OK(status)) {
    6316           0 :                 return status;
    6317             :         }
    6318             : 
    6319             :         /* Return variables */
    6320        1224 :         *_alias_handle = *r.out.alias_handle;
    6321             : 
    6322             :         /* Return result */
    6323        1224 :         *result = r.out.result;
    6324             : 
    6325        1224 :         return NT_STATUS_OK;
    6326             : }
    6327             : 
    6328             : struct dcerpc_samr_QueryAliasInfo_r_state {
    6329             :         TALLOC_CTX *out_mem_ctx;
    6330             : };
    6331             : 
    6332             : static void dcerpc_samr_QueryAliasInfo_r_done(struct tevent_req *subreq);
    6333             : 
    6334           0 : struct tevent_req *dcerpc_samr_QueryAliasInfo_r_send(TALLOC_CTX *mem_ctx,
    6335             :         struct tevent_context *ev,
    6336             :         struct dcerpc_binding_handle *h,
    6337             :         struct samr_QueryAliasInfo *r)
    6338             : {
    6339             :         struct tevent_req *req;
    6340             :         struct dcerpc_samr_QueryAliasInfo_r_state *state;
    6341             :         struct tevent_req *subreq;
    6342             : 
    6343           0 :         req = tevent_req_create(mem_ctx, &state,
    6344             :                                 struct dcerpc_samr_QueryAliasInfo_r_state);
    6345           0 :         if (req == NULL) {
    6346           0 :                 return NULL;
    6347             :         }
    6348             : 
    6349           0 :         state->out_mem_ctx = talloc_new(state);
    6350           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6351           0 :                 return tevent_req_post(req, ev);
    6352             :         }
    6353             : 
    6354           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    6355             :                         NULL, &ndr_table_samr,
    6356           0 :                         NDR_SAMR_QUERYALIASINFO, state->out_mem_ctx, r);
    6357           0 :         if (tevent_req_nomem(subreq, req)) {
    6358           0 :                 return tevent_req_post(req, ev);
    6359             :         }
    6360           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryAliasInfo_r_done, req);
    6361             : 
    6362           0 :         return req;
    6363             : }
    6364             : 
    6365           0 : static void dcerpc_samr_QueryAliasInfo_r_done(struct tevent_req *subreq)
    6366             : {
    6367           0 :         struct tevent_req *req =
    6368           0 :                 tevent_req_callback_data(subreq,
    6369             :                 struct tevent_req);
    6370             :         NTSTATUS status;
    6371             : 
    6372           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    6373           0 :         TALLOC_FREE(subreq);
    6374           0 :         if (tevent_req_nterror(req, status)) {
    6375           0 :                 return;
    6376             :         }
    6377             : 
    6378           0 :         tevent_req_done(req);
    6379             : }
    6380             : 
    6381           0 : NTSTATUS dcerpc_samr_QueryAliasInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    6382             : {
    6383           0 :         struct dcerpc_samr_QueryAliasInfo_r_state *state =
    6384           0 :                 tevent_req_data(req,
    6385             :                 struct dcerpc_samr_QueryAliasInfo_r_state);
    6386             :         NTSTATUS status;
    6387             : 
    6388           0 :         if (tevent_req_is_nterror(req, &status)) {
    6389           0 :                 tevent_req_received(req);
    6390           0 :                 return status;
    6391             :         }
    6392             : 
    6393           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6394             : 
    6395           0 :         tevent_req_received(req);
    6396           0 :         return NT_STATUS_OK;
    6397             : }
    6398             : 
    6399         458 : NTSTATUS dcerpc_samr_QueryAliasInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_QueryAliasInfo *r)
    6400             : {
    6401             :         NTSTATUS status;
    6402             : 
    6403         458 :         status = dcerpc_binding_handle_call(h,
    6404             :                         NULL, &ndr_table_samr,
    6405             :                         NDR_SAMR_QUERYALIASINFO, mem_ctx, r);
    6406             : 
    6407         458 :         return status;
    6408             : }
    6409             : 
    6410             : struct dcerpc_samr_QueryAliasInfo_state {
    6411             :         struct samr_QueryAliasInfo orig;
    6412             :         struct samr_QueryAliasInfo tmp;
    6413             :         TALLOC_CTX *out_mem_ctx;
    6414             : };
    6415             : 
    6416             : static void dcerpc_samr_QueryAliasInfo_done(struct tevent_req *subreq);
    6417             : 
    6418           0 : struct tevent_req *dcerpc_samr_QueryAliasInfo_send(TALLOC_CTX *mem_ctx,
    6419             :                                                    struct tevent_context *ev,
    6420             :                                                    struct dcerpc_binding_handle *h,
    6421             :                                                    struct policy_handle *_alias_handle /* [in] [ref] */,
    6422             :                                                    enum samr_AliasInfoEnum _level /* [in]  */,
    6423             :                                                    union samr_AliasInfo **_info /* [out] [ref,switch_is(level)] */)
    6424             : {
    6425             :         struct tevent_req *req;
    6426             :         struct dcerpc_samr_QueryAliasInfo_state *state;
    6427             :         struct tevent_req *subreq;
    6428             : 
    6429           0 :         req = tevent_req_create(mem_ctx, &state,
    6430             :                                 struct dcerpc_samr_QueryAliasInfo_state);
    6431           0 :         if (req == NULL) {
    6432           0 :                 return NULL;
    6433             :         }
    6434           0 :         state->out_mem_ctx = NULL;
    6435             : 
    6436             :         /* In parameters */
    6437           0 :         state->orig.in.alias_handle = _alias_handle;
    6438           0 :         state->orig.in.level = _level;
    6439             : 
    6440             :         /* Out parameters */
    6441           0 :         state->orig.out.info = _info;
    6442             : 
    6443             :         /* Result */
    6444           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    6445             : 
    6446           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    6447             :                              "dcerpc_samr_QueryAliasInfo_out_memory");
    6448           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6449           0 :                 return tevent_req_post(req, ev);
    6450             :         }
    6451             : 
    6452             :         /* make a temporary copy, that we pass to the dispatch function */
    6453           0 :         state->tmp = state->orig;
    6454             : 
    6455           0 :         subreq = dcerpc_samr_QueryAliasInfo_r_send(state, ev, h, &state->tmp);
    6456           0 :         if (tevent_req_nomem(subreq, req)) {
    6457           0 :                 return tevent_req_post(req, ev);
    6458             :         }
    6459           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryAliasInfo_done, req);
    6460           0 :         return req;
    6461             : }
    6462             : 
    6463           0 : static void dcerpc_samr_QueryAliasInfo_done(struct tevent_req *subreq)
    6464             : {
    6465           0 :         struct tevent_req *req = tevent_req_callback_data(
    6466             :                 subreq, struct tevent_req);
    6467           0 :         struct dcerpc_samr_QueryAliasInfo_state *state = tevent_req_data(
    6468             :                 req, struct dcerpc_samr_QueryAliasInfo_state);
    6469             :         NTSTATUS status;
    6470             :         TALLOC_CTX *mem_ctx;
    6471             : 
    6472           0 :         if (state->out_mem_ctx) {
    6473           0 :                 mem_ctx = state->out_mem_ctx;
    6474             :         } else {
    6475           0 :                 mem_ctx = state;
    6476             :         }
    6477             : 
    6478           0 :         status = dcerpc_samr_QueryAliasInfo_r_recv(subreq, mem_ctx);
    6479           0 :         TALLOC_FREE(subreq);
    6480           0 :         if (tevent_req_nterror(req, status)) {
    6481           0 :                 return;
    6482             :         }
    6483             : 
    6484             :         /* Copy out parameters */
    6485           0 :         *state->orig.out.info = *state->tmp.out.info;
    6486             : 
    6487             :         /* Copy result */
    6488           0 :         state->orig.out.result = state->tmp.out.result;
    6489             : 
    6490             :         /* Reset temporary structure */
    6491           0 :         NDR_ZERO_STRUCT(state->tmp);
    6492             : 
    6493           0 :         tevent_req_done(req);
    6494             : }
    6495             : 
    6496           0 : NTSTATUS dcerpc_samr_QueryAliasInfo_recv(struct tevent_req *req,
    6497             :                                          TALLOC_CTX *mem_ctx,
    6498             :                                          NTSTATUS *result)
    6499             : {
    6500           0 :         struct dcerpc_samr_QueryAliasInfo_state *state = tevent_req_data(
    6501             :                 req, struct dcerpc_samr_QueryAliasInfo_state);
    6502             :         NTSTATUS status;
    6503             : 
    6504           0 :         if (tevent_req_is_nterror(req, &status)) {
    6505           0 :                 tevent_req_received(req);
    6506           0 :                 return status;
    6507             :         }
    6508             : 
    6509             :         /* Steal possible out parameters to the callers context */
    6510           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6511             : 
    6512             :         /* Return result */
    6513           0 :         *result = state->orig.out.result;
    6514             : 
    6515           0 :         tevent_req_received(req);
    6516           0 :         return NT_STATUS_OK;
    6517             : }
    6518             : 
    6519           0 : NTSTATUS dcerpc_samr_QueryAliasInfo(struct dcerpc_binding_handle *h,
    6520             :                                     TALLOC_CTX *mem_ctx,
    6521             :                                     struct policy_handle *_alias_handle /* [in] [ref] */,
    6522             :                                     enum samr_AliasInfoEnum _level /* [in]  */,
    6523             :                                     union samr_AliasInfo **_info /* [out] [ref,switch_is(level)] */,
    6524             :                                     NTSTATUS *result)
    6525             : {
    6526             :         struct samr_QueryAliasInfo r;
    6527             :         NTSTATUS status;
    6528             : 
    6529             :         /* In parameters */
    6530           0 :         r.in.alias_handle = _alias_handle;
    6531           0 :         r.in.level = _level;
    6532             : 
    6533             :         /* Out parameters */
    6534           0 :         r.out.info = _info;
    6535             : 
    6536             :         /* Result */
    6537           0 :         NDR_ZERO_STRUCT(r.out.result);
    6538             : 
    6539           0 :         status = dcerpc_samr_QueryAliasInfo_r(h, mem_ctx, &r);
    6540           0 :         if (!NT_STATUS_IS_OK(status)) {
    6541           0 :                 return status;
    6542             :         }
    6543             : 
    6544             :         /* Return variables */
    6545           0 :         *_info = *r.out.info;
    6546             : 
    6547             :         /* Return result */
    6548           0 :         *result = r.out.result;
    6549             : 
    6550           0 :         return NT_STATUS_OK;
    6551             : }
    6552             : 
    6553             : struct dcerpc_samr_SetAliasInfo_r_state {
    6554             :         TALLOC_CTX *out_mem_ctx;
    6555             : };
    6556             : 
    6557             : static void dcerpc_samr_SetAliasInfo_r_done(struct tevent_req *subreq);
    6558             : 
    6559           0 : struct tevent_req *dcerpc_samr_SetAliasInfo_r_send(TALLOC_CTX *mem_ctx,
    6560             :         struct tevent_context *ev,
    6561             :         struct dcerpc_binding_handle *h,
    6562             :         struct samr_SetAliasInfo *r)
    6563             : {
    6564             :         struct tevent_req *req;
    6565             :         struct dcerpc_samr_SetAliasInfo_r_state *state;
    6566             :         struct tevent_req *subreq;
    6567             : 
    6568           0 :         req = tevent_req_create(mem_ctx, &state,
    6569             :                                 struct dcerpc_samr_SetAliasInfo_r_state);
    6570           0 :         if (req == NULL) {
    6571           0 :                 return NULL;
    6572             :         }
    6573             : 
    6574           0 :         state->out_mem_ctx = NULL;
    6575             : 
    6576           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    6577             :                         NULL, &ndr_table_samr,
    6578             :                         NDR_SAMR_SETALIASINFO, state, r);
    6579           0 :         if (tevent_req_nomem(subreq, req)) {
    6580           0 :                 return tevent_req_post(req, ev);
    6581             :         }
    6582           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetAliasInfo_r_done, req);
    6583             : 
    6584           0 :         return req;
    6585             : }
    6586             : 
    6587           0 : static void dcerpc_samr_SetAliasInfo_r_done(struct tevent_req *subreq)
    6588             : {
    6589           0 :         struct tevent_req *req =
    6590           0 :                 tevent_req_callback_data(subreq,
    6591             :                 struct tevent_req);
    6592             :         NTSTATUS status;
    6593             : 
    6594           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    6595           0 :         TALLOC_FREE(subreq);
    6596           0 :         if (tevent_req_nterror(req, status)) {
    6597           0 :                 return;
    6598             :         }
    6599             : 
    6600           0 :         tevent_req_done(req);
    6601             : }
    6602             : 
    6603           0 : NTSTATUS dcerpc_samr_SetAliasInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    6604             : {
    6605           0 :         struct dcerpc_samr_SetAliasInfo_r_state *state =
    6606           0 :                 tevent_req_data(req,
    6607             :                 struct dcerpc_samr_SetAliasInfo_r_state);
    6608             :         NTSTATUS status;
    6609             : 
    6610           0 :         if (tevent_req_is_nterror(req, &status)) {
    6611           0 :                 tevent_req_received(req);
    6612           0 :                 return status;
    6613             :         }
    6614             : 
    6615           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6616             : 
    6617           0 :         tevent_req_received(req);
    6618           0 :         return NT_STATUS_OK;
    6619             : }
    6620             : 
    6621          14 : NTSTATUS dcerpc_samr_SetAliasInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_SetAliasInfo *r)
    6622             : {
    6623             :         NTSTATUS status;
    6624             : 
    6625          14 :         status = dcerpc_binding_handle_call(h,
    6626             :                         NULL, &ndr_table_samr,
    6627             :                         NDR_SAMR_SETALIASINFO, mem_ctx, r);
    6628             : 
    6629          14 :         return status;
    6630             : }
    6631             : 
    6632             : struct dcerpc_samr_SetAliasInfo_state {
    6633             :         struct samr_SetAliasInfo orig;
    6634             :         struct samr_SetAliasInfo tmp;
    6635             :         TALLOC_CTX *out_mem_ctx;
    6636             : };
    6637             : 
    6638             : static void dcerpc_samr_SetAliasInfo_done(struct tevent_req *subreq);
    6639             : 
    6640           0 : struct tevent_req *dcerpc_samr_SetAliasInfo_send(TALLOC_CTX *mem_ctx,
    6641             :                                                  struct tevent_context *ev,
    6642             :                                                  struct dcerpc_binding_handle *h,
    6643             :                                                  struct policy_handle *_alias_handle /* [in] [ref] */,
    6644             :                                                  enum samr_AliasInfoEnum _level /* [in]  */,
    6645             :                                                  union samr_AliasInfo *_info /* [in] [ref,switch_is(level)] */)
    6646             : {
    6647             :         struct tevent_req *req;
    6648             :         struct dcerpc_samr_SetAliasInfo_state *state;
    6649             :         struct tevent_req *subreq;
    6650             : 
    6651           0 :         req = tevent_req_create(mem_ctx, &state,
    6652             :                                 struct dcerpc_samr_SetAliasInfo_state);
    6653           0 :         if (req == NULL) {
    6654           0 :                 return NULL;
    6655             :         }
    6656           0 :         state->out_mem_ctx = NULL;
    6657             : 
    6658             :         /* In parameters */
    6659           0 :         state->orig.in.alias_handle = _alias_handle;
    6660           0 :         state->orig.in.level = _level;
    6661           0 :         state->orig.in.info = _info;
    6662             : 
    6663             :         /* Out parameters */
    6664             : 
    6665             :         /* Result */
    6666           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    6667             : 
    6668             :         /* make a temporary copy, that we pass to the dispatch function */
    6669           0 :         state->tmp = state->orig;
    6670             : 
    6671           0 :         subreq = dcerpc_samr_SetAliasInfo_r_send(state, ev, h, &state->tmp);
    6672           0 :         if (tevent_req_nomem(subreq, req)) {
    6673           0 :                 return tevent_req_post(req, ev);
    6674             :         }
    6675           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetAliasInfo_done, req);
    6676           0 :         return req;
    6677             : }
    6678             : 
    6679           0 : static void dcerpc_samr_SetAliasInfo_done(struct tevent_req *subreq)
    6680             : {
    6681           0 :         struct tevent_req *req = tevent_req_callback_data(
    6682             :                 subreq, struct tevent_req);
    6683           0 :         struct dcerpc_samr_SetAliasInfo_state *state = tevent_req_data(
    6684             :                 req, struct dcerpc_samr_SetAliasInfo_state);
    6685             :         NTSTATUS status;
    6686             :         TALLOC_CTX *mem_ctx;
    6687             : 
    6688           0 :         if (state->out_mem_ctx) {
    6689           0 :                 mem_ctx = state->out_mem_ctx;
    6690             :         } else {
    6691           0 :                 mem_ctx = state;
    6692             :         }
    6693             : 
    6694           0 :         status = dcerpc_samr_SetAliasInfo_r_recv(subreq, mem_ctx);
    6695           0 :         TALLOC_FREE(subreq);
    6696           0 :         if (tevent_req_nterror(req, status)) {
    6697           0 :                 return;
    6698             :         }
    6699             : 
    6700             :         /* Copy out parameters */
    6701             : 
    6702             :         /* Copy result */
    6703           0 :         state->orig.out.result = state->tmp.out.result;
    6704             : 
    6705             :         /* Reset temporary structure */
    6706           0 :         NDR_ZERO_STRUCT(state->tmp);
    6707             : 
    6708           0 :         tevent_req_done(req);
    6709             : }
    6710             : 
    6711           0 : NTSTATUS dcerpc_samr_SetAliasInfo_recv(struct tevent_req *req,
    6712             :                                        TALLOC_CTX *mem_ctx,
    6713             :                                        NTSTATUS *result)
    6714             : {
    6715           0 :         struct dcerpc_samr_SetAliasInfo_state *state = tevent_req_data(
    6716             :                 req, struct dcerpc_samr_SetAliasInfo_state);
    6717             :         NTSTATUS status;
    6718             : 
    6719           0 :         if (tevent_req_is_nterror(req, &status)) {
    6720           0 :                 tevent_req_received(req);
    6721           0 :                 return status;
    6722             :         }
    6723             : 
    6724             :         /* Steal possible out parameters to the callers context */
    6725           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6726             : 
    6727             :         /* Return result */
    6728           0 :         *result = state->orig.out.result;
    6729             : 
    6730           0 :         tevent_req_received(req);
    6731           0 :         return NT_STATUS_OK;
    6732             : }
    6733             : 
    6734           0 : NTSTATUS dcerpc_samr_SetAliasInfo(struct dcerpc_binding_handle *h,
    6735             :                                   TALLOC_CTX *mem_ctx,
    6736             :                                   struct policy_handle *_alias_handle /* [in] [ref] */,
    6737             :                                   enum samr_AliasInfoEnum _level /* [in]  */,
    6738             :                                   union samr_AliasInfo *_info /* [in] [ref,switch_is(level)] */,
    6739             :                                   NTSTATUS *result)
    6740             : {
    6741             :         struct samr_SetAliasInfo r;
    6742             :         NTSTATUS status;
    6743             : 
    6744             :         /* In parameters */
    6745           0 :         r.in.alias_handle = _alias_handle;
    6746           0 :         r.in.level = _level;
    6747           0 :         r.in.info = _info;
    6748             : 
    6749             :         /* Out parameters */
    6750             : 
    6751             :         /* Result */
    6752           0 :         NDR_ZERO_STRUCT(r.out.result);
    6753             : 
    6754           0 :         status = dcerpc_samr_SetAliasInfo_r(h, mem_ctx, &r);
    6755           0 :         if (!NT_STATUS_IS_OK(status)) {
    6756           0 :                 return status;
    6757             :         }
    6758             : 
    6759             :         /* Return variables */
    6760             : 
    6761             :         /* Return result */
    6762           0 :         *result = r.out.result;
    6763             : 
    6764           0 :         return NT_STATUS_OK;
    6765             : }
    6766             : 
    6767             : struct dcerpc_samr_DeleteDomAlias_r_state {
    6768             :         TALLOC_CTX *out_mem_ctx;
    6769             : };
    6770             : 
    6771             : static void dcerpc_samr_DeleteDomAlias_r_done(struct tevent_req *subreq);
    6772             : 
    6773           0 : struct tevent_req *dcerpc_samr_DeleteDomAlias_r_send(TALLOC_CTX *mem_ctx,
    6774             :         struct tevent_context *ev,
    6775             :         struct dcerpc_binding_handle *h,
    6776             :         struct samr_DeleteDomAlias *r)
    6777             : {
    6778             :         struct tevent_req *req;
    6779             :         struct dcerpc_samr_DeleteDomAlias_r_state *state;
    6780             :         struct tevent_req *subreq;
    6781             : 
    6782           0 :         req = tevent_req_create(mem_ctx, &state,
    6783             :                                 struct dcerpc_samr_DeleteDomAlias_r_state);
    6784           0 :         if (req == NULL) {
    6785           0 :                 return NULL;
    6786             :         }
    6787             : 
    6788           0 :         state->out_mem_ctx = talloc_new(state);
    6789           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6790           0 :                 return tevent_req_post(req, ev);
    6791             :         }
    6792             : 
    6793           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    6794             :                         NULL, &ndr_table_samr,
    6795           0 :                         NDR_SAMR_DELETEDOMALIAS, state->out_mem_ctx, r);
    6796           0 :         if (tevent_req_nomem(subreq, req)) {
    6797           0 :                 return tevent_req_post(req, ev);
    6798             :         }
    6799           0 :         tevent_req_set_callback(subreq, dcerpc_samr_DeleteDomAlias_r_done, req);
    6800             : 
    6801           0 :         return req;
    6802             : }
    6803             : 
    6804           0 : static void dcerpc_samr_DeleteDomAlias_r_done(struct tevent_req *subreq)
    6805             : {
    6806           0 :         struct tevent_req *req =
    6807           0 :                 tevent_req_callback_data(subreq,
    6808             :                 struct tevent_req);
    6809             :         NTSTATUS status;
    6810             : 
    6811           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    6812           0 :         TALLOC_FREE(subreq);
    6813           0 :         if (tevent_req_nterror(req, status)) {
    6814           0 :                 return;
    6815             :         }
    6816             : 
    6817           0 :         tevent_req_done(req);
    6818             : }
    6819             : 
    6820           0 : NTSTATUS dcerpc_samr_DeleteDomAlias_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    6821             : {
    6822           0 :         struct dcerpc_samr_DeleteDomAlias_r_state *state =
    6823           0 :                 tevent_req_data(req,
    6824             :                 struct dcerpc_samr_DeleteDomAlias_r_state);
    6825             :         NTSTATUS status;
    6826             : 
    6827           0 :         if (tevent_req_is_nterror(req, &status)) {
    6828           0 :                 tevent_req_received(req);
    6829           0 :                 return status;
    6830             :         }
    6831             : 
    6832           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6833             : 
    6834           0 :         tevent_req_received(req);
    6835           0 :         return NT_STATUS_OK;
    6836             : }
    6837             : 
    6838         457 : NTSTATUS dcerpc_samr_DeleteDomAlias_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_DeleteDomAlias *r)
    6839             : {
    6840             :         NTSTATUS status;
    6841             : 
    6842         457 :         status = dcerpc_binding_handle_call(h,
    6843             :                         NULL, &ndr_table_samr,
    6844             :                         NDR_SAMR_DELETEDOMALIAS, mem_ctx, r);
    6845             : 
    6846         457 :         return status;
    6847             : }
    6848             : 
    6849             : struct dcerpc_samr_DeleteDomAlias_state {
    6850             :         struct samr_DeleteDomAlias orig;
    6851             :         struct samr_DeleteDomAlias tmp;
    6852             :         TALLOC_CTX *out_mem_ctx;
    6853             : };
    6854             : 
    6855             : static void dcerpc_samr_DeleteDomAlias_done(struct tevent_req *subreq);
    6856             : 
    6857           0 : struct tevent_req *dcerpc_samr_DeleteDomAlias_send(TALLOC_CTX *mem_ctx,
    6858             :                                                    struct tevent_context *ev,
    6859             :                                                    struct dcerpc_binding_handle *h,
    6860             :                                                    struct policy_handle *_alias_handle /* [in,out] [ref] */)
    6861             : {
    6862             :         struct tevent_req *req;
    6863             :         struct dcerpc_samr_DeleteDomAlias_state *state;
    6864             :         struct tevent_req *subreq;
    6865             : 
    6866           0 :         req = tevent_req_create(mem_ctx, &state,
    6867             :                                 struct dcerpc_samr_DeleteDomAlias_state);
    6868           0 :         if (req == NULL) {
    6869           0 :                 return NULL;
    6870             :         }
    6871           0 :         state->out_mem_ctx = NULL;
    6872             : 
    6873             :         /* In parameters */
    6874           0 :         state->orig.in.alias_handle = _alias_handle;
    6875             : 
    6876             :         /* Out parameters */
    6877           0 :         state->orig.out.alias_handle = _alias_handle;
    6878             : 
    6879             :         /* Result */
    6880           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    6881             : 
    6882           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    6883             :                              "dcerpc_samr_DeleteDomAlias_out_memory");
    6884           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6885           0 :                 return tevent_req_post(req, ev);
    6886             :         }
    6887             : 
    6888             :         /* make a temporary copy, that we pass to the dispatch function */
    6889           0 :         state->tmp = state->orig;
    6890             : 
    6891           0 :         subreq = dcerpc_samr_DeleteDomAlias_r_send(state, ev, h, &state->tmp);
    6892           0 :         if (tevent_req_nomem(subreq, req)) {
    6893           0 :                 return tevent_req_post(req, ev);
    6894             :         }
    6895           0 :         tevent_req_set_callback(subreq, dcerpc_samr_DeleteDomAlias_done, req);
    6896           0 :         return req;
    6897             : }
    6898             : 
    6899           0 : static void dcerpc_samr_DeleteDomAlias_done(struct tevent_req *subreq)
    6900             : {
    6901           0 :         struct tevent_req *req = tevent_req_callback_data(
    6902             :                 subreq, struct tevent_req);
    6903           0 :         struct dcerpc_samr_DeleteDomAlias_state *state = tevent_req_data(
    6904             :                 req, struct dcerpc_samr_DeleteDomAlias_state);
    6905             :         NTSTATUS status;
    6906             :         TALLOC_CTX *mem_ctx;
    6907             : 
    6908           0 :         if (state->out_mem_ctx) {
    6909           0 :                 mem_ctx = state->out_mem_ctx;
    6910             :         } else {
    6911           0 :                 mem_ctx = state;
    6912             :         }
    6913             : 
    6914           0 :         status = dcerpc_samr_DeleteDomAlias_r_recv(subreq, mem_ctx);
    6915           0 :         TALLOC_FREE(subreq);
    6916           0 :         if (tevent_req_nterror(req, status)) {
    6917           0 :                 return;
    6918             :         }
    6919             : 
    6920             :         /* Copy out parameters */
    6921           0 :         *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
    6922             : 
    6923             :         /* Copy result */
    6924           0 :         state->orig.out.result = state->tmp.out.result;
    6925             : 
    6926             :         /* Reset temporary structure */
    6927           0 :         NDR_ZERO_STRUCT(state->tmp);
    6928             : 
    6929           0 :         tevent_req_done(req);
    6930             : }
    6931             : 
    6932           0 : NTSTATUS dcerpc_samr_DeleteDomAlias_recv(struct tevent_req *req,
    6933             :                                          TALLOC_CTX *mem_ctx,
    6934             :                                          NTSTATUS *result)
    6935             : {
    6936           0 :         struct dcerpc_samr_DeleteDomAlias_state *state = tevent_req_data(
    6937             :                 req, struct dcerpc_samr_DeleteDomAlias_state);
    6938             :         NTSTATUS status;
    6939             : 
    6940           0 :         if (tevent_req_is_nterror(req, &status)) {
    6941           0 :                 tevent_req_received(req);
    6942           0 :                 return status;
    6943             :         }
    6944             : 
    6945             :         /* Steal possible out parameters to the callers context */
    6946           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6947             : 
    6948             :         /* Return result */
    6949           0 :         *result = state->orig.out.result;
    6950             : 
    6951           0 :         tevent_req_received(req);
    6952           0 :         return NT_STATUS_OK;
    6953             : }
    6954             : 
    6955           0 : NTSTATUS dcerpc_samr_DeleteDomAlias(struct dcerpc_binding_handle *h,
    6956             :                                     TALLOC_CTX *mem_ctx,
    6957             :                                     struct policy_handle *_alias_handle /* [in,out] [ref] */,
    6958             :                                     NTSTATUS *result)
    6959             : {
    6960             :         struct samr_DeleteDomAlias r;
    6961             :         NTSTATUS status;
    6962             : 
    6963             :         /* In parameters */
    6964           0 :         r.in.alias_handle = _alias_handle;
    6965             : 
    6966             :         /* Out parameters */
    6967           0 :         r.out.alias_handle = _alias_handle;
    6968             : 
    6969             :         /* Result */
    6970           0 :         NDR_ZERO_STRUCT(r.out.result);
    6971             : 
    6972           0 :         status = dcerpc_samr_DeleteDomAlias_r(h, mem_ctx, &r);
    6973           0 :         if (!NT_STATUS_IS_OK(status)) {
    6974           0 :                 return status;
    6975             :         }
    6976             : 
    6977             :         /* Return variables */
    6978           0 :         *_alias_handle = *r.out.alias_handle;
    6979             : 
    6980             :         /* Return result */
    6981           0 :         *result = r.out.result;
    6982             : 
    6983           0 :         return NT_STATUS_OK;
    6984             : }
    6985             : 
    6986             : struct dcerpc_samr_AddAliasMember_r_state {
    6987             :         TALLOC_CTX *out_mem_ctx;
    6988             : };
    6989             : 
    6990             : static void dcerpc_samr_AddAliasMember_r_done(struct tevent_req *subreq);
    6991             : 
    6992           0 : struct tevent_req *dcerpc_samr_AddAliasMember_r_send(TALLOC_CTX *mem_ctx,
    6993             :         struct tevent_context *ev,
    6994             :         struct dcerpc_binding_handle *h,
    6995             :         struct samr_AddAliasMember *r)
    6996             : {
    6997             :         struct tevent_req *req;
    6998             :         struct dcerpc_samr_AddAliasMember_r_state *state;
    6999             :         struct tevent_req *subreq;
    7000             : 
    7001           0 :         req = tevent_req_create(mem_ctx, &state,
    7002             :                                 struct dcerpc_samr_AddAliasMember_r_state);
    7003           0 :         if (req == NULL) {
    7004           0 :                 return NULL;
    7005             :         }
    7006             : 
    7007           0 :         state->out_mem_ctx = NULL;
    7008             : 
    7009           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    7010             :                         NULL, &ndr_table_samr,
    7011             :                         NDR_SAMR_ADDALIASMEMBER, state, r);
    7012           0 :         if (tevent_req_nomem(subreq, req)) {
    7013           0 :                 return tevent_req_post(req, ev);
    7014             :         }
    7015           0 :         tevent_req_set_callback(subreq, dcerpc_samr_AddAliasMember_r_done, req);
    7016             : 
    7017           0 :         return req;
    7018             : }
    7019             : 
    7020           0 : static void dcerpc_samr_AddAliasMember_r_done(struct tevent_req *subreq)
    7021             : {
    7022           0 :         struct tevent_req *req =
    7023           0 :                 tevent_req_callback_data(subreq,
    7024             :                 struct tevent_req);
    7025             :         NTSTATUS status;
    7026             : 
    7027           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    7028           0 :         TALLOC_FREE(subreq);
    7029           0 :         if (tevent_req_nterror(req, status)) {
    7030           0 :                 return;
    7031             :         }
    7032             : 
    7033           0 :         tevent_req_done(req);
    7034             : }
    7035             : 
    7036           0 : NTSTATUS dcerpc_samr_AddAliasMember_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    7037             : {
    7038           0 :         struct dcerpc_samr_AddAliasMember_r_state *state =
    7039           0 :                 tevent_req_data(req,
    7040             :                 struct dcerpc_samr_AddAliasMember_r_state);
    7041             :         NTSTATUS status;
    7042             : 
    7043           0 :         if (tevent_req_is_nterror(req, &status)) {
    7044           0 :                 tevent_req_received(req);
    7045           0 :                 return status;
    7046             :         }
    7047             : 
    7048           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7049             : 
    7050           0 :         tevent_req_received(req);
    7051           0 :         return NT_STATUS_OK;
    7052             : }
    7053             : 
    7054           7 : NTSTATUS dcerpc_samr_AddAliasMember_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_AddAliasMember *r)
    7055             : {
    7056             :         NTSTATUS status;
    7057             : 
    7058           7 :         status = dcerpc_binding_handle_call(h,
    7059             :                         NULL, &ndr_table_samr,
    7060             :                         NDR_SAMR_ADDALIASMEMBER, mem_ctx, r);
    7061             : 
    7062           7 :         return status;
    7063             : }
    7064             : 
    7065             : struct dcerpc_samr_AddAliasMember_state {
    7066             :         struct samr_AddAliasMember orig;
    7067             :         struct samr_AddAliasMember tmp;
    7068             :         TALLOC_CTX *out_mem_ctx;
    7069             : };
    7070             : 
    7071             : static void dcerpc_samr_AddAliasMember_done(struct tevent_req *subreq);
    7072             : 
    7073           0 : struct tevent_req *dcerpc_samr_AddAliasMember_send(TALLOC_CTX *mem_ctx,
    7074             :                                                    struct tevent_context *ev,
    7075             :                                                    struct dcerpc_binding_handle *h,
    7076             :                                                    struct policy_handle *_alias_handle /* [in] [ref] */,
    7077             :                                                    struct dom_sid2 *_sid /* [in] [ref] */)
    7078             : {
    7079             :         struct tevent_req *req;
    7080             :         struct dcerpc_samr_AddAliasMember_state *state;
    7081             :         struct tevent_req *subreq;
    7082             : 
    7083           0 :         req = tevent_req_create(mem_ctx, &state,
    7084             :                                 struct dcerpc_samr_AddAliasMember_state);
    7085           0 :         if (req == NULL) {
    7086           0 :                 return NULL;
    7087             :         }
    7088           0 :         state->out_mem_ctx = NULL;
    7089             : 
    7090             :         /* In parameters */
    7091           0 :         state->orig.in.alias_handle = _alias_handle;
    7092           0 :         state->orig.in.sid = _sid;
    7093             : 
    7094             :         /* Out parameters */
    7095             : 
    7096             :         /* Result */
    7097           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    7098             : 
    7099             :         /* make a temporary copy, that we pass to the dispatch function */
    7100           0 :         state->tmp = state->orig;
    7101             : 
    7102           0 :         subreq = dcerpc_samr_AddAliasMember_r_send(state, ev, h, &state->tmp);
    7103           0 :         if (tevent_req_nomem(subreq, req)) {
    7104           0 :                 return tevent_req_post(req, ev);
    7105             :         }
    7106           0 :         tevent_req_set_callback(subreq, dcerpc_samr_AddAliasMember_done, req);
    7107           0 :         return req;
    7108             : }
    7109             : 
    7110           0 : static void dcerpc_samr_AddAliasMember_done(struct tevent_req *subreq)
    7111             : {
    7112           0 :         struct tevent_req *req = tevent_req_callback_data(
    7113             :                 subreq, struct tevent_req);
    7114           0 :         struct dcerpc_samr_AddAliasMember_state *state = tevent_req_data(
    7115             :                 req, struct dcerpc_samr_AddAliasMember_state);
    7116             :         NTSTATUS status;
    7117             :         TALLOC_CTX *mem_ctx;
    7118             : 
    7119           0 :         if (state->out_mem_ctx) {
    7120           0 :                 mem_ctx = state->out_mem_ctx;
    7121             :         } else {
    7122           0 :                 mem_ctx = state;
    7123             :         }
    7124             : 
    7125           0 :         status = dcerpc_samr_AddAliasMember_r_recv(subreq, mem_ctx);
    7126           0 :         TALLOC_FREE(subreq);
    7127           0 :         if (tevent_req_nterror(req, status)) {
    7128           0 :                 return;
    7129             :         }
    7130             : 
    7131             :         /* Copy out parameters */
    7132             : 
    7133             :         /* Copy result */
    7134           0 :         state->orig.out.result = state->tmp.out.result;
    7135             : 
    7136             :         /* Reset temporary structure */
    7137           0 :         NDR_ZERO_STRUCT(state->tmp);
    7138             : 
    7139           0 :         tevent_req_done(req);
    7140             : }
    7141             : 
    7142           0 : NTSTATUS dcerpc_samr_AddAliasMember_recv(struct tevent_req *req,
    7143             :                                          TALLOC_CTX *mem_ctx,
    7144             :                                          NTSTATUS *result)
    7145             : {
    7146           0 :         struct dcerpc_samr_AddAliasMember_state *state = tevent_req_data(
    7147             :                 req, struct dcerpc_samr_AddAliasMember_state);
    7148             :         NTSTATUS status;
    7149             : 
    7150           0 :         if (tevent_req_is_nterror(req, &status)) {
    7151           0 :                 tevent_req_received(req);
    7152           0 :                 return status;
    7153             :         }
    7154             : 
    7155             :         /* Steal possible out parameters to the callers context */
    7156           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7157             : 
    7158             :         /* Return result */
    7159           0 :         *result = state->orig.out.result;
    7160             : 
    7161           0 :         tevent_req_received(req);
    7162           0 :         return NT_STATUS_OK;
    7163             : }
    7164             : 
    7165           0 : NTSTATUS dcerpc_samr_AddAliasMember(struct dcerpc_binding_handle *h,
    7166             :                                     TALLOC_CTX *mem_ctx,
    7167             :                                     struct policy_handle *_alias_handle /* [in] [ref] */,
    7168             :                                     struct dom_sid2 *_sid /* [in] [ref] */,
    7169             :                                     NTSTATUS *result)
    7170             : {
    7171             :         struct samr_AddAliasMember r;
    7172             :         NTSTATUS status;
    7173             : 
    7174             :         /* In parameters */
    7175           0 :         r.in.alias_handle = _alias_handle;
    7176           0 :         r.in.sid = _sid;
    7177             : 
    7178             :         /* Out parameters */
    7179             : 
    7180             :         /* Result */
    7181           0 :         NDR_ZERO_STRUCT(r.out.result);
    7182             : 
    7183           0 :         status = dcerpc_samr_AddAliasMember_r(h, mem_ctx, &r);
    7184           0 :         if (!NT_STATUS_IS_OK(status)) {
    7185           0 :                 return status;
    7186             :         }
    7187             : 
    7188             :         /* Return variables */
    7189             : 
    7190             :         /* Return result */
    7191           0 :         *result = r.out.result;
    7192             : 
    7193           0 :         return NT_STATUS_OK;
    7194             : }
    7195             : 
    7196             : struct dcerpc_samr_DeleteAliasMember_r_state {
    7197             :         TALLOC_CTX *out_mem_ctx;
    7198             : };
    7199             : 
    7200             : static void dcerpc_samr_DeleteAliasMember_r_done(struct tevent_req *subreq);
    7201             : 
    7202           0 : struct tevent_req *dcerpc_samr_DeleteAliasMember_r_send(TALLOC_CTX *mem_ctx,
    7203             :         struct tevent_context *ev,
    7204             :         struct dcerpc_binding_handle *h,
    7205             :         struct samr_DeleteAliasMember *r)
    7206             : {
    7207             :         struct tevent_req *req;
    7208             :         struct dcerpc_samr_DeleteAliasMember_r_state *state;
    7209             :         struct tevent_req *subreq;
    7210             : 
    7211           0 :         req = tevent_req_create(mem_ctx, &state,
    7212             :                                 struct dcerpc_samr_DeleteAliasMember_r_state);
    7213           0 :         if (req == NULL) {
    7214           0 :                 return NULL;
    7215             :         }
    7216             : 
    7217           0 :         state->out_mem_ctx = NULL;
    7218             : 
    7219           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    7220             :                         NULL, &ndr_table_samr,
    7221             :                         NDR_SAMR_DELETEALIASMEMBER, state, r);
    7222           0 :         if (tevent_req_nomem(subreq, req)) {
    7223           0 :                 return tevent_req_post(req, ev);
    7224             :         }
    7225           0 :         tevent_req_set_callback(subreq, dcerpc_samr_DeleteAliasMember_r_done, req);
    7226             : 
    7227           0 :         return req;
    7228             : }
    7229             : 
    7230           0 : static void dcerpc_samr_DeleteAliasMember_r_done(struct tevent_req *subreq)
    7231             : {
    7232           0 :         struct tevent_req *req =
    7233           0 :                 tevent_req_callback_data(subreq,
    7234             :                 struct tevent_req);
    7235             :         NTSTATUS status;
    7236             : 
    7237           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    7238           0 :         TALLOC_FREE(subreq);
    7239           0 :         if (tevent_req_nterror(req, status)) {
    7240           0 :                 return;
    7241             :         }
    7242             : 
    7243           0 :         tevent_req_done(req);
    7244             : }
    7245             : 
    7246           0 : NTSTATUS dcerpc_samr_DeleteAliasMember_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    7247             : {
    7248           0 :         struct dcerpc_samr_DeleteAliasMember_r_state *state =
    7249           0 :                 tevent_req_data(req,
    7250             :                 struct dcerpc_samr_DeleteAliasMember_r_state);
    7251             :         NTSTATUS status;
    7252             : 
    7253           0 :         if (tevent_req_is_nterror(req, &status)) {
    7254           0 :                 tevent_req_received(req);
    7255           0 :                 return status;
    7256             :         }
    7257             : 
    7258           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7259             : 
    7260           0 :         tevent_req_received(req);
    7261           0 :         return NT_STATUS_OK;
    7262             : }
    7263             : 
    7264           7 : NTSTATUS dcerpc_samr_DeleteAliasMember_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_DeleteAliasMember *r)
    7265             : {
    7266             :         NTSTATUS status;
    7267             : 
    7268           7 :         status = dcerpc_binding_handle_call(h,
    7269             :                         NULL, &ndr_table_samr,
    7270             :                         NDR_SAMR_DELETEALIASMEMBER, mem_ctx, r);
    7271             : 
    7272           7 :         return status;
    7273             : }
    7274             : 
    7275             : struct dcerpc_samr_DeleteAliasMember_state {
    7276             :         struct samr_DeleteAliasMember orig;
    7277             :         struct samr_DeleteAliasMember tmp;
    7278             :         TALLOC_CTX *out_mem_ctx;
    7279             : };
    7280             : 
    7281             : static void dcerpc_samr_DeleteAliasMember_done(struct tevent_req *subreq);
    7282             : 
    7283           0 : struct tevent_req *dcerpc_samr_DeleteAliasMember_send(TALLOC_CTX *mem_ctx,
    7284             :                                                       struct tevent_context *ev,
    7285             :                                                       struct dcerpc_binding_handle *h,
    7286             :                                                       struct policy_handle *_alias_handle /* [in] [ref] */,
    7287             :                                                       struct dom_sid2 *_sid /* [in] [ref] */)
    7288             : {
    7289             :         struct tevent_req *req;
    7290             :         struct dcerpc_samr_DeleteAliasMember_state *state;
    7291             :         struct tevent_req *subreq;
    7292             : 
    7293           0 :         req = tevent_req_create(mem_ctx, &state,
    7294             :                                 struct dcerpc_samr_DeleteAliasMember_state);
    7295           0 :         if (req == NULL) {
    7296           0 :                 return NULL;
    7297             :         }
    7298           0 :         state->out_mem_ctx = NULL;
    7299             : 
    7300             :         /* In parameters */
    7301           0 :         state->orig.in.alias_handle = _alias_handle;
    7302           0 :         state->orig.in.sid = _sid;
    7303             : 
    7304             :         /* Out parameters */
    7305             : 
    7306             :         /* Result */
    7307           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    7308             : 
    7309             :         /* make a temporary copy, that we pass to the dispatch function */
    7310           0 :         state->tmp = state->orig;
    7311             : 
    7312           0 :         subreq = dcerpc_samr_DeleteAliasMember_r_send(state, ev, h, &state->tmp);
    7313           0 :         if (tevent_req_nomem(subreq, req)) {
    7314           0 :                 return tevent_req_post(req, ev);
    7315             :         }
    7316           0 :         tevent_req_set_callback(subreq, dcerpc_samr_DeleteAliasMember_done, req);
    7317           0 :         return req;
    7318             : }
    7319             : 
    7320           0 : static void dcerpc_samr_DeleteAliasMember_done(struct tevent_req *subreq)
    7321             : {
    7322           0 :         struct tevent_req *req = tevent_req_callback_data(
    7323             :                 subreq, struct tevent_req);
    7324           0 :         struct dcerpc_samr_DeleteAliasMember_state *state = tevent_req_data(
    7325             :                 req, struct dcerpc_samr_DeleteAliasMember_state);
    7326             :         NTSTATUS status;
    7327             :         TALLOC_CTX *mem_ctx;
    7328             : 
    7329           0 :         if (state->out_mem_ctx) {
    7330           0 :                 mem_ctx = state->out_mem_ctx;
    7331             :         } else {
    7332           0 :                 mem_ctx = state;
    7333             :         }
    7334             : 
    7335           0 :         status = dcerpc_samr_DeleteAliasMember_r_recv(subreq, mem_ctx);
    7336           0 :         TALLOC_FREE(subreq);
    7337           0 :         if (tevent_req_nterror(req, status)) {
    7338           0 :                 return;
    7339             :         }
    7340             : 
    7341             :         /* Copy out parameters */
    7342             : 
    7343             :         /* Copy result */
    7344           0 :         state->orig.out.result = state->tmp.out.result;
    7345             : 
    7346             :         /* Reset temporary structure */
    7347           0 :         NDR_ZERO_STRUCT(state->tmp);
    7348             : 
    7349           0 :         tevent_req_done(req);
    7350             : }
    7351             : 
    7352           0 : NTSTATUS dcerpc_samr_DeleteAliasMember_recv(struct tevent_req *req,
    7353             :                                             TALLOC_CTX *mem_ctx,
    7354             :                                             NTSTATUS *result)
    7355             : {
    7356           0 :         struct dcerpc_samr_DeleteAliasMember_state *state = tevent_req_data(
    7357             :                 req, struct dcerpc_samr_DeleteAliasMember_state);
    7358             :         NTSTATUS status;
    7359             : 
    7360           0 :         if (tevent_req_is_nterror(req, &status)) {
    7361           0 :                 tevent_req_received(req);
    7362           0 :                 return status;
    7363             :         }
    7364             : 
    7365             :         /* Steal possible out parameters to the callers context */
    7366           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7367             : 
    7368             :         /* Return result */
    7369           0 :         *result = state->orig.out.result;
    7370             : 
    7371           0 :         tevent_req_received(req);
    7372           0 :         return NT_STATUS_OK;
    7373             : }
    7374             : 
    7375           0 : NTSTATUS dcerpc_samr_DeleteAliasMember(struct dcerpc_binding_handle *h,
    7376             :                                        TALLOC_CTX *mem_ctx,
    7377             :                                        struct policy_handle *_alias_handle /* [in] [ref] */,
    7378             :                                        struct dom_sid2 *_sid /* [in] [ref] */,
    7379             :                                        NTSTATUS *result)
    7380             : {
    7381             :         struct samr_DeleteAliasMember r;
    7382             :         NTSTATUS status;
    7383             : 
    7384             :         /* In parameters */
    7385           0 :         r.in.alias_handle = _alias_handle;
    7386           0 :         r.in.sid = _sid;
    7387             : 
    7388             :         /* Out parameters */
    7389             : 
    7390             :         /* Result */
    7391           0 :         NDR_ZERO_STRUCT(r.out.result);
    7392             : 
    7393           0 :         status = dcerpc_samr_DeleteAliasMember_r(h, mem_ctx, &r);
    7394           0 :         if (!NT_STATUS_IS_OK(status)) {
    7395           0 :                 return status;
    7396             :         }
    7397             : 
    7398             :         /* Return variables */
    7399             : 
    7400             :         /* Return result */
    7401           0 :         *result = r.out.result;
    7402             : 
    7403           0 :         return NT_STATUS_OK;
    7404             : }
    7405             : 
    7406             : struct dcerpc_samr_GetMembersInAlias_r_state {
    7407             :         TALLOC_CTX *out_mem_ctx;
    7408             : };
    7409             : 
    7410             : static void dcerpc_samr_GetMembersInAlias_r_done(struct tevent_req *subreq);
    7411             : 
    7412           0 : struct tevent_req *dcerpc_samr_GetMembersInAlias_r_send(TALLOC_CTX *mem_ctx,
    7413             :         struct tevent_context *ev,
    7414             :         struct dcerpc_binding_handle *h,
    7415             :         struct samr_GetMembersInAlias *r)
    7416             : {
    7417             :         struct tevent_req *req;
    7418             :         struct dcerpc_samr_GetMembersInAlias_r_state *state;
    7419             :         struct tevent_req *subreq;
    7420             : 
    7421           0 :         req = tevent_req_create(mem_ctx, &state,
    7422             :                                 struct dcerpc_samr_GetMembersInAlias_r_state);
    7423           0 :         if (req == NULL) {
    7424           0 :                 return NULL;
    7425             :         }
    7426             : 
    7427           0 :         state->out_mem_ctx = talloc_new(state);
    7428           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7429           0 :                 return tevent_req_post(req, ev);
    7430             :         }
    7431             : 
    7432           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    7433             :                         NULL, &ndr_table_samr,
    7434           0 :                         NDR_SAMR_GETMEMBERSINALIAS, state->out_mem_ctx, r);
    7435           0 :         if (tevent_req_nomem(subreq, req)) {
    7436           0 :                 return tevent_req_post(req, ev);
    7437             :         }
    7438           0 :         tevent_req_set_callback(subreq, dcerpc_samr_GetMembersInAlias_r_done, req);
    7439             : 
    7440           0 :         return req;
    7441             : }
    7442             : 
    7443           0 : static void dcerpc_samr_GetMembersInAlias_r_done(struct tevent_req *subreq)
    7444             : {
    7445           0 :         struct tevent_req *req =
    7446           0 :                 tevent_req_callback_data(subreq,
    7447             :                 struct tevent_req);
    7448             :         NTSTATUS status;
    7449             : 
    7450           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    7451           0 :         TALLOC_FREE(subreq);
    7452           0 :         if (tevent_req_nterror(req, status)) {
    7453           0 :                 return;
    7454             :         }
    7455             : 
    7456           0 :         tevent_req_done(req);
    7457             : }
    7458             : 
    7459           0 : NTSTATUS dcerpc_samr_GetMembersInAlias_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    7460             : {
    7461           0 :         struct dcerpc_samr_GetMembersInAlias_r_state *state =
    7462           0 :                 tevent_req_data(req,
    7463             :                 struct dcerpc_samr_GetMembersInAlias_r_state);
    7464             :         NTSTATUS status;
    7465             : 
    7466           0 :         if (tevent_req_is_nterror(req, &status)) {
    7467           0 :                 tevent_req_received(req);
    7468           0 :                 return status;
    7469             :         }
    7470             : 
    7471           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7472             : 
    7473           0 :         tevent_req_received(req);
    7474           0 :         return NT_STATUS_OK;
    7475             : }
    7476             : 
    7477        1365 : NTSTATUS dcerpc_samr_GetMembersInAlias_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_GetMembersInAlias *r)
    7478             : {
    7479             :         NTSTATUS status;
    7480             : 
    7481        1365 :         status = dcerpc_binding_handle_call(h,
    7482             :                         NULL, &ndr_table_samr,
    7483             :                         NDR_SAMR_GETMEMBERSINALIAS, mem_ctx, r);
    7484             : 
    7485        1365 :         return status;
    7486             : }
    7487             : 
    7488             : struct dcerpc_samr_GetMembersInAlias_state {
    7489             :         struct samr_GetMembersInAlias orig;
    7490             :         struct samr_GetMembersInAlias tmp;
    7491             :         TALLOC_CTX *out_mem_ctx;
    7492             : };
    7493             : 
    7494             : static void dcerpc_samr_GetMembersInAlias_done(struct tevent_req *subreq);
    7495             : 
    7496           0 : struct tevent_req *dcerpc_samr_GetMembersInAlias_send(TALLOC_CTX *mem_ctx,
    7497             :                                                       struct tevent_context *ev,
    7498             :                                                       struct dcerpc_binding_handle *h,
    7499             :                                                       struct policy_handle *_alias_handle /* [in] [ref] */,
    7500             :                                                       struct lsa_SidArray *_sids /* [out] [ref] */)
    7501             : {
    7502             :         struct tevent_req *req;
    7503             :         struct dcerpc_samr_GetMembersInAlias_state *state;
    7504             :         struct tevent_req *subreq;
    7505             : 
    7506           0 :         req = tevent_req_create(mem_ctx, &state,
    7507             :                                 struct dcerpc_samr_GetMembersInAlias_state);
    7508           0 :         if (req == NULL) {
    7509           0 :                 return NULL;
    7510             :         }
    7511           0 :         state->out_mem_ctx = NULL;
    7512             : 
    7513             :         /* In parameters */
    7514           0 :         state->orig.in.alias_handle = _alias_handle;
    7515             : 
    7516             :         /* Out parameters */
    7517           0 :         state->orig.out.sids = _sids;
    7518             : 
    7519             :         /* Result */
    7520           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    7521             : 
    7522           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    7523             :                              "dcerpc_samr_GetMembersInAlias_out_memory");
    7524           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7525           0 :                 return tevent_req_post(req, ev);
    7526             :         }
    7527             : 
    7528             :         /* make a temporary copy, that we pass to the dispatch function */
    7529           0 :         state->tmp = state->orig;
    7530             : 
    7531           0 :         subreq = dcerpc_samr_GetMembersInAlias_r_send(state, ev, h, &state->tmp);
    7532           0 :         if (tevent_req_nomem(subreq, req)) {
    7533           0 :                 return tevent_req_post(req, ev);
    7534             :         }
    7535           0 :         tevent_req_set_callback(subreq, dcerpc_samr_GetMembersInAlias_done, req);
    7536           0 :         return req;
    7537             : }
    7538             : 
    7539           0 : static void dcerpc_samr_GetMembersInAlias_done(struct tevent_req *subreq)
    7540             : {
    7541           0 :         struct tevent_req *req = tevent_req_callback_data(
    7542             :                 subreq, struct tevent_req);
    7543           0 :         struct dcerpc_samr_GetMembersInAlias_state *state = tevent_req_data(
    7544             :                 req, struct dcerpc_samr_GetMembersInAlias_state);
    7545             :         NTSTATUS status;
    7546             :         TALLOC_CTX *mem_ctx;
    7547             : 
    7548           0 :         if (state->out_mem_ctx) {
    7549           0 :                 mem_ctx = state->out_mem_ctx;
    7550             :         } else {
    7551           0 :                 mem_ctx = state;
    7552             :         }
    7553             : 
    7554           0 :         status = dcerpc_samr_GetMembersInAlias_r_recv(subreq, mem_ctx);
    7555           0 :         TALLOC_FREE(subreq);
    7556           0 :         if (tevent_req_nterror(req, status)) {
    7557           0 :                 return;
    7558             :         }
    7559             : 
    7560             :         /* Copy out parameters */
    7561           0 :         *state->orig.out.sids = *state->tmp.out.sids;
    7562             : 
    7563             :         /* Copy result */
    7564           0 :         state->orig.out.result = state->tmp.out.result;
    7565             : 
    7566             :         /* Reset temporary structure */
    7567           0 :         NDR_ZERO_STRUCT(state->tmp);
    7568             : 
    7569           0 :         tevent_req_done(req);
    7570             : }
    7571             : 
    7572           0 : NTSTATUS dcerpc_samr_GetMembersInAlias_recv(struct tevent_req *req,
    7573             :                                             TALLOC_CTX *mem_ctx,
    7574             :                                             NTSTATUS *result)
    7575             : {
    7576           0 :         struct dcerpc_samr_GetMembersInAlias_state *state = tevent_req_data(
    7577             :                 req, struct dcerpc_samr_GetMembersInAlias_state);
    7578             :         NTSTATUS status;
    7579             : 
    7580           0 :         if (tevent_req_is_nterror(req, &status)) {
    7581           0 :                 tevent_req_received(req);
    7582           0 :                 return status;
    7583             :         }
    7584             : 
    7585             :         /* Steal possible out parameters to the callers context */
    7586           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7587             : 
    7588             :         /* Return result */
    7589           0 :         *result = state->orig.out.result;
    7590             : 
    7591           0 :         tevent_req_received(req);
    7592           0 :         return NT_STATUS_OK;
    7593             : }
    7594             : 
    7595        1224 : NTSTATUS dcerpc_samr_GetMembersInAlias(struct dcerpc_binding_handle *h,
    7596             :                                        TALLOC_CTX *mem_ctx,
    7597             :                                        struct policy_handle *_alias_handle /* [in] [ref] */,
    7598             :                                        struct lsa_SidArray *_sids /* [out] [ref] */,
    7599             :                                        NTSTATUS *result)
    7600             : {
    7601             :         struct samr_GetMembersInAlias r;
    7602             :         NTSTATUS status;
    7603             : 
    7604             :         /* In parameters */
    7605        1224 :         r.in.alias_handle = _alias_handle;
    7606             : 
    7607             :         /* Out parameters */
    7608        1224 :         r.out.sids = _sids;
    7609             : 
    7610             :         /* Result */
    7611        1224 :         NDR_ZERO_STRUCT(r.out.result);
    7612             : 
    7613        1224 :         status = dcerpc_samr_GetMembersInAlias_r(h, mem_ctx, &r);
    7614        1224 :         if (!NT_STATUS_IS_OK(status)) {
    7615           0 :                 return status;
    7616             :         }
    7617             : 
    7618             :         /* Return variables */
    7619        1224 :         *_sids = *r.out.sids;
    7620             : 
    7621             :         /* Return result */
    7622        1224 :         *result = r.out.result;
    7623             : 
    7624        1224 :         return NT_STATUS_OK;
    7625             : }
    7626             : 
    7627             : struct dcerpc_samr_OpenUser_r_state {
    7628             :         TALLOC_CTX *out_mem_ctx;
    7629             : };
    7630             : 
    7631             : static void dcerpc_samr_OpenUser_r_done(struct tevent_req *subreq);
    7632             : 
    7633          57 : struct tevent_req *dcerpc_samr_OpenUser_r_send(TALLOC_CTX *mem_ctx,
    7634             :         struct tevent_context *ev,
    7635             :         struct dcerpc_binding_handle *h,
    7636             :         struct samr_OpenUser *r)
    7637             : {
    7638             :         struct tevent_req *req;
    7639             :         struct dcerpc_samr_OpenUser_r_state *state;
    7640             :         struct tevent_req *subreq;
    7641             : 
    7642          57 :         req = tevent_req_create(mem_ctx, &state,
    7643             :                                 struct dcerpc_samr_OpenUser_r_state);
    7644          57 :         if (req == NULL) {
    7645           0 :                 return NULL;
    7646             :         }
    7647             : 
    7648          57 :         state->out_mem_ctx = talloc_new(state);
    7649          57 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7650           0 :                 return tevent_req_post(req, ev);
    7651             :         }
    7652             : 
    7653          57 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    7654             :                         NULL, &ndr_table_samr,
    7655          57 :                         NDR_SAMR_OPENUSER, state->out_mem_ctx, r);
    7656          57 :         if (tevent_req_nomem(subreq, req)) {
    7657           0 :                 return tevent_req_post(req, ev);
    7658             :         }
    7659          57 :         tevent_req_set_callback(subreq, dcerpc_samr_OpenUser_r_done, req);
    7660             : 
    7661          57 :         return req;
    7662             : }
    7663             : 
    7664          57 : static void dcerpc_samr_OpenUser_r_done(struct tevent_req *subreq)
    7665             : {
    7666          57 :         struct tevent_req *req =
    7667          57 :                 tevent_req_callback_data(subreq,
    7668             :                 struct tevent_req);
    7669             :         NTSTATUS status;
    7670             : 
    7671          57 :         status = dcerpc_binding_handle_call_recv(subreq);
    7672          57 :         TALLOC_FREE(subreq);
    7673          57 :         if (tevent_req_nterror(req, status)) {
    7674           0 :                 return;
    7675             :         }
    7676             : 
    7677          57 :         tevent_req_done(req);
    7678             : }
    7679             : 
    7680          57 : NTSTATUS dcerpc_samr_OpenUser_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    7681             : {
    7682          57 :         struct dcerpc_samr_OpenUser_r_state *state =
    7683          57 :                 tevent_req_data(req,
    7684             :                 struct dcerpc_samr_OpenUser_r_state);
    7685             :         NTSTATUS status;
    7686             : 
    7687          57 :         if (tevent_req_is_nterror(req, &status)) {
    7688           0 :                 tevent_req_received(req);
    7689           0 :                 return status;
    7690             :         }
    7691             : 
    7692          57 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7693             : 
    7694          57 :         tevent_req_received(req);
    7695          57 :         return NT_STATUS_OK;
    7696             : }
    7697             : 
    7698        2301 : NTSTATUS dcerpc_samr_OpenUser_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_OpenUser *r)
    7699             : {
    7700             :         NTSTATUS status;
    7701             : 
    7702        2301 :         status = dcerpc_binding_handle_call(h,
    7703             :                         NULL, &ndr_table_samr,
    7704             :                         NDR_SAMR_OPENUSER, mem_ctx, r);
    7705             : 
    7706        2301 :         return status;
    7707             : }
    7708             : 
    7709             : struct dcerpc_samr_OpenUser_state {
    7710             :         struct samr_OpenUser orig;
    7711             :         struct samr_OpenUser tmp;
    7712             :         TALLOC_CTX *out_mem_ctx;
    7713             : };
    7714             : 
    7715             : static void dcerpc_samr_OpenUser_done(struct tevent_req *subreq);
    7716             : 
    7717           0 : struct tevent_req *dcerpc_samr_OpenUser_send(TALLOC_CTX *mem_ctx,
    7718             :                                              struct tevent_context *ev,
    7719             :                                              struct dcerpc_binding_handle *h,
    7720             :                                              struct policy_handle *_domain_handle /* [in] [ref] */,
    7721             :                                              uint32_t _access_mask /* [in]  */,
    7722             :                                              uint32_t _rid /* [in]  */,
    7723             :                                              struct policy_handle *_user_handle /* [out] [ref] */)
    7724             : {
    7725             :         struct tevent_req *req;
    7726             :         struct dcerpc_samr_OpenUser_state *state;
    7727             :         struct tevent_req *subreq;
    7728             : 
    7729           0 :         req = tevent_req_create(mem_ctx, &state,
    7730             :                                 struct dcerpc_samr_OpenUser_state);
    7731           0 :         if (req == NULL) {
    7732           0 :                 return NULL;
    7733             :         }
    7734           0 :         state->out_mem_ctx = NULL;
    7735             : 
    7736             :         /* In parameters */
    7737           0 :         state->orig.in.domain_handle = _domain_handle;
    7738           0 :         state->orig.in.access_mask = _access_mask;
    7739           0 :         state->orig.in.rid = _rid;
    7740             : 
    7741             :         /* Out parameters */
    7742           0 :         state->orig.out.user_handle = _user_handle;
    7743             : 
    7744             :         /* Result */
    7745           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    7746             : 
    7747           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    7748             :                              "dcerpc_samr_OpenUser_out_memory");
    7749           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7750           0 :                 return tevent_req_post(req, ev);
    7751             :         }
    7752             : 
    7753             :         /* make a temporary copy, that we pass to the dispatch function */
    7754           0 :         state->tmp = state->orig;
    7755             : 
    7756           0 :         subreq = dcerpc_samr_OpenUser_r_send(state, ev, h, &state->tmp);
    7757           0 :         if (tevent_req_nomem(subreq, req)) {
    7758           0 :                 return tevent_req_post(req, ev);
    7759             :         }
    7760           0 :         tevent_req_set_callback(subreq, dcerpc_samr_OpenUser_done, req);
    7761           0 :         return req;
    7762             : }
    7763             : 
    7764           0 : static void dcerpc_samr_OpenUser_done(struct tevent_req *subreq)
    7765             : {
    7766           0 :         struct tevent_req *req = tevent_req_callback_data(
    7767             :                 subreq, struct tevent_req);
    7768           0 :         struct dcerpc_samr_OpenUser_state *state = tevent_req_data(
    7769             :                 req, struct dcerpc_samr_OpenUser_state);
    7770             :         NTSTATUS status;
    7771             :         TALLOC_CTX *mem_ctx;
    7772             : 
    7773           0 :         if (state->out_mem_ctx) {
    7774           0 :                 mem_ctx = state->out_mem_ctx;
    7775             :         } else {
    7776           0 :                 mem_ctx = state;
    7777             :         }
    7778             : 
    7779           0 :         status = dcerpc_samr_OpenUser_r_recv(subreq, mem_ctx);
    7780           0 :         TALLOC_FREE(subreq);
    7781           0 :         if (tevent_req_nterror(req, status)) {
    7782           0 :                 return;
    7783             :         }
    7784             : 
    7785             :         /* Copy out parameters */
    7786           0 :         *state->orig.out.user_handle = *state->tmp.out.user_handle;
    7787             : 
    7788             :         /* Copy result */
    7789           0 :         state->orig.out.result = state->tmp.out.result;
    7790             : 
    7791             :         /* Reset temporary structure */
    7792           0 :         NDR_ZERO_STRUCT(state->tmp);
    7793             : 
    7794           0 :         tevent_req_done(req);
    7795             : }
    7796             : 
    7797           0 : NTSTATUS dcerpc_samr_OpenUser_recv(struct tevent_req *req,
    7798             :                                    TALLOC_CTX *mem_ctx,
    7799             :                                    NTSTATUS *result)
    7800             : {
    7801           0 :         struct dcerpc_samr_OpenUser_state *state = tevent_req_data(
    7802             :                 req, struct dcerpc_samr_OpenUser_state);
    7803             :         NTSTATUS status;
    7804             : 
    7805           0 :         if (tevent_req_is_nterror(req, &status)) {
    7806           0 :                 tevent_req_received(req);
    7807           0 :                 return status;
    7808             :         }
    7809             : 
    7810             :         /* Steal possible out parameters to the callers context */
    7811           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7812             : 
    7813             :         /* Return result */
    7814           0 :         *result = state->orig.out.result;
    7815             : 
    7816           0 :         tevent_req_received(req);
    7817           0 :         return NT_STATUS_OK;
    7818             : }
    7819             : 
    7820         301 : NTSTATUS dcerpc_samr_OpenUser(struct dcerpc_binding_handle *h,
    7821             :                               TALLOC_CTX *mem_ctx,
    7822             :                               struct policy_handle *_domain_handle /* [in] [ref] */,
    7823             :                               uint32_t _access_mask /* [in]  */,
    7824             :                               uint32_t _rid /* [in]  */,
    7825             :                               struct policy_handle *_user_handle /* [out] [ref] */,
    7826             :                               NTSTATUS *result)
    7827             : {
    7828             :         struct samr_OpenUser r;
    7829             :         NTSTATUS status;
    7830             : 
    7831             :         /* In parameters */
    7832         301 :         r.in.domain_handle = _domain_handle;
    7833         301 :         r.in.access_mask = _access_mask;
    7834         301 :         r.in.rid = _rid;
    7835             : 
    7836             :         /* Out parameters */
    7837         301 :         r.out.user_handle = _user_handle;
    7838             : 
    7839             :         /* Result */
    7840         301 :         NDR_ZERO_STRUCT(r.out.result);
    7841             : 
    7842         301 :         status = dcerpc_samr_OpenUser_r(h, mem_ctx, &r);
    7843         301 :         if (!NT_STATUS_IS_OK(status)) {
    7844           0 :                 return status;
    7845             :         }
    7846             : 
    7847             :         /* Return variables */
    7848         301 :         *_user_handle = *r.out.user_handle;
    7849             : 
    7850             :         /* Return result */
    7851         301 :         *result = r.out.result;
    7852             : 
    7853         301 :         return NT_STATUS_OK;
    7854             : }
    7855             : 
    7856             : struct dcerpc_samr_DeleteUser_r_state {
    7857             :         TALLOC_CTX *out_mem_ctx;
    7858             : };
    7859             : 
    7860             : static void dcerpc_samr_DeleteUser_r_done(struct tevent_req *subreq);
    7861             : 
    7862           2 : struct tevent_req *dcerpc_samr_DeleteUser_r_send(TALLOC_CTX *mem_ctx,
    7863             :         struct tevent_context *ev,
    7864             :         struct dcerpc_binding_handle *h,
    7865             :         struct samr_DeleteUser *r)
    7866             : {
    7867             :         struct tevent_req *req;
    7868             :         struct dcerpc_samr_DeleteUser_r_state *state;
    7869             :         struct tevent_req *subreq;
    7870             : 
    7871           2 :         req = tevent_req_create(mem_ctx, &state,
    7872             :                                 struct dcerpc_samr_DeleteUser_r_state);
    7873           2 :         if (req == NULL) {
    7874           0 :                 return NULL;
    7875             :         }
    7876             : 
    7877           2 :         state->out_mem_ctx = talloc_new(state);
    7878           2 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7879           0 :                 return tevent_req_post(req, ev);
    7880             :         }
    7881             : 
    7882           2 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    7883             :                         NULL, &ndr_table_samr,
    7884           2 :                         NDR_SAMR_DELETEUSER, state->out_mem_ctx, r);
    7885           2 :         if (tevent_req_nomem(subreq, req)) {
    7886           0 :                 return tevent_req_post(req, ev);
    7887             :         }
    7888           2 :         tevent_req_set_callback(subreq, dcerpc_samr_DeleteUser_r_done, req);
    7889             : 
    7890           2 :         return req;
    7891             : }
    7892             : 
    7893           2 : static void dcerpc_samr_DeleteUser_r_done(struct tevent_req *subreq)
    7894             : {
    7895           2 :         struct tevent_req *req =
    7896           2 :                 tevent_req_callback_data(subreq,
    7897             :                 struct tevent_req);
    7898             :         NTSTATUS status;
    7899             : 
    7900           2 :         status = dcerpc_binding_handle_call_recv(subreq);
    7901           2 :         TALLOC_FREE(subreq);
    7902           2 :         if (tevent_req_nterror(req, status)) {
    7903           0 :                 return;
    7904             :         }
    7905             : 
    7906           2 :         tevent_req_done(req);
    7907             : }
    7908             : 
    7909           2 : NTSTATUS dcerpc_samr_DeleteUser_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    7910             : {
    7911           2 :         struct dcerpc_samr_DeleteUser_r_state *state =
    7912           2 :                 tevent_req_data(req,
    7913             :                 struct dcerpc_samr_DeleteUser_r_state);
    7914             :         NTSTATUS status;
    7915             : 
    7916           2 :         if (tevent_req_is_nterror(req, &status)) {
    7917           0 :                 tevent_req_received(req);
    7918           0 :                 return status;
    7919             :         }
    7920             : 
    7921           2 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7922             : 
    7923           2 :         tevent_req_received(req);
    7924           2 :         return NT_STATUS_OK;
    7925             : }
    7926             : 
    7927        1130 : NTSTATUS dcerpc_samr_DeleteUser_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_DeleteUser *r)
    7928             : {
    7929             :         NTSTATUS status;
    7930             : 
    7931        1130 :         status = dcerpc_binding_handle_call(h,
    7932             :                         NULL, &ndr_table_samr,
    7933             :                         NDR_SAMR_DELETEUSER, mem_ctx, r);
    7934             : 
    7935        1130 :         return status;
    7936             : }
    7937             : 
    7938             : struct dcerpc_samr_DeleteUser_state {
    7939             :         struct samr_DeleteUser orig;
    7940             :         struct samr_DeleteUser tmp;
    7941             :         TALLOC_CTX *out_mem_ctx;
    7942             : };
    7943             : 
    7944             : static void dcerpc_samr_DeleteUser_done(struct tevent_req *subreq);
    7945             : 
    7946           0 : struct tevent_req *dcerpc_samr_DeleteUser_send(TALLOC_CTX *mem_ctx,
    7947             :                                                struct tevent_context *ev,
    7948             :                                                struct dcerpc_binding_handle *h,
    7949             :                                                struct policy_handle *_user_handle /* [in,out] [ref] */)
    7950             : {
    7951             :         struct tevent_req *req;
    7952             :         struct dcerpc_samr_DeleteUser_state *state;
    7953             :         struct tevent_req *subreq;
    7954             : 
    7955           0 :         req = tevent_req_create(mem_ctx, &state,
    7956             :                                 struct dcerpc_samr_DeleteUser_state);
    7957           0 :         if (req == NULL) {
    7958           0 :                 return NULL;
    7959             :         }
    7960           0 :         state->out_mem_ctx = NULL;
    7961             : 
    7962             :         /* In parameters */
    7963           0 :         state->orig.in.user_handle = _user_handle;
    7964             : 
    7965             :         /* Out parameters */
    7966           0 :         state->orig.out.user_handle = _user_handle;
    7967             : 
    7968             :         /* Result */
    7969           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    7970             : 
    7971           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    7972             :                              "dcerpc_samr_DeleteUser_out_memory");
    7973           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7974           0 :                 return tevent_req_post(req, ev);
    7975             :         }
    7976             : 
    7977             :         /* make a temporary copy, that we pass to the dispatch function */
    7978           0 :         state->tmp = state->orig;
    7979             : 
    7980           0 :         subreq = dcerpc_samr_DeleteUser_r_send(state, ev, h, &state->tmp);
    7981           0 :         if (tevent_req_nomem(subreq, req)) {
    7982           0 :                 return tevent_req_post(req, ev);
    7983             :         }
    7984           0 :         tevent_req_set_callback(subreq, dcerpc_samr_DeleteUser_done, req);
    7985           0 :         return req;
    7986             : }
    7987             : 
    7988           0 : static void dcerpc_samr_DeleteUser_done(struct tevent_req *subreq)
    7989             : {
    7990           0 :         struct tevent_req *req = tevent_req_callback_data(
    7991             :                 subreq, struct tevent_req);
    7992           0 :         struct dcerpc_samr_DeleteUser_state *state = tevent_req_data(
    7993             :                 req, struct dcerpc_samr_DeleteUser_state);
    7994             :         NTSTATUS status;
    7995             :         TALLOC_CTX *mem_ctx;
    7996             : 
    7997           0 :         if (state->out_mem_ctx) {
    7998           0 :                 mem_ctx = state->out_mem_ctx;
    7999             :         } else {
    8000           0 :                 mem_ctx = state;
    8001             :         }
    8002             : 
    8003           0 :         status = dcerpc_samr_DeleteUser_r_recv(subreq, mem_ctx);
    8004           0 :         TALLOC_FREE(subreq);
    8005           0 :         if (tevent_req_nterror(req, status)) {
    8006           0 :                 return;
    8007             :         }
    8008             : 
    8009             :         /* Copy out parameters */
    8010           0 :         *state->orig.out.user_handle = *state->tmp.out.user_handle;
    8011             : 
    8012             :         /* Copy result */
    8013           0 :         state->orig.out.result = state->tmp.out.result;
    8014             : 
    8015             :         /* Reset temporary structure */
    8016           0 :         NDR_ZERO_STRUCT(state->tmp);
    8017             : 
    8018           0 :         tevent_req_done(req);
    8019             : }
    8020             : 
    8021           0 : NTSTATUS dcerpc_samr_DeleteUser_recv(struct tevent_req *req,
    8022             :                                      TALLOC_CTX *mem_ctx,
    8023             :                                      NTSTATUS *result)
    8024             : {
    8025           0 :         struct dcerpc_samr_DeleteUser_state *state = tevent_req_data(
    8026             :                 req, struct dcerpc_samr_DeleteUser_state);
    8027             :         NTSTATUS status;
    8028             : 
    8029           0 :         if (tevent_req_is_nterror(req, &status)) {
    8030           0 :                 tevent_req_received(req);
    8031           0 :                 return status;
    8032             :         }
    8033             : 
    8034             :         /* Steal possible out parameters to the callers context */
    8035           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8036             : 
    8037             :         /* Return result */
    8038           0 :         *result = state->orig.out.result;
    8039             : 
    8040           0 :         tevent_req_received(req);
    8041           0 :         return NT_STATUS_OK;
    8042             : }
    8043             : 
    8044           6 : NTSTATUS dcerpc_samr_DeleteUser(struct dcerpc_binding_handle *h,
    8045             :                                 TALLOC_CTX *mem_ctx,
    8046             :                                 struct policy_handle *_user_handle /* [in,out] [ref] */,
    8047             :                                 NTSTATUS *result)
    8048             : {
    8049             :         struct samr_DeleteUser r;
    8050             :         NTSTATUS status;
    8051             : 
    8052             :         /* In parameters */
    8053           6 :         r.in.user_handle = _user_handle;
    8054             : 
    8055             :         /* Out parameters */
    8056           6 :         r.out.user_handle = _user_handle;
    8057             : 
    8058             :         /* Result */
    8059           6 :         NDR_ZERO_STRUCT(r.out.result);
    8060             : 
    8061           6 :         status = dcerpc_samr_DeleteUser_r(h, mem_ctx, &r);
    8062           6 :         if (!NT_STATUS_IS_OK(status)) {
    8063           0 :                 return status;
    8064             :         }
    8065             : 
    8066             :         /* Return variables */
    8067           6 :         *_user_handle = *r.out.user_handle;
    8068             : 
    8069             :         /* Return result */
    8070           6 :         *result = r.out.result;
    8071             : 
    8072           6 :         return NT_STATUS_OK;
    8073             : }
    8074             : 
    8075             : struct dcerpc_samr_QueryUserInfo_r_state {
    8076             :         TALLOC_CTX *out_mem_ctx;
    8077             : };
    8078             : 
    8079             : static void dcerpc_samr_QueryUserInfo_r_done(struct tevent_req *subreq);
    8080             : 
    8081          48 : struct tevent_req *dcerpc_samr_QueryUserInfo_r_send(TALLOC_CTX *mem_ctx,
    8082             :         struct tevent_context *ev,
    8083             :         struct dcerpc_binding_handle *h,
    8084             :         struct samr_QueryUserInfo *r)
    8085             : {
    8086             :         struct tevent_req *req;
    8087             :         struct dcerpc_samr_QueryUserInfo_r_state *state;
    8088             :         struct tevent_req *subreq;
    8089             : 
    8090          48 :         req = tevent_req_create(mem_ctx, &state,
    8091             :                                 struct dcerpc_samr_QueryUserInfo_r_state);
    8092          48 :         if (req == NULL) {
    8093           0 :                 return NULL;
    8094             :         }
    8095             : 
    8096          48 :         state->out_mem_ctx = talloc_new(state);
    8097          48 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    8098           0 :                 return tevent_req_post(req, ev);
    8099             :         }
    8100             : 
    8101          48 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    8102             :                         NULL, &ndr_table_samr,
    8103          48 :                         NDR_SAMR_QUERYUSERINFO, state->out_mem_ctx, r);
    8104          48 :         if (tevent_req_nomem(subreq, req)) {
    8105           0 :                 return tevent_req_post(req, ev);
    8106             :         }
    8107          48 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryUserInfo_r_done, req);
    8108             : 
    8109          48 :         return req;
    8110             : }
    8111             : 
    8112          48 : static void dcerpc_samr_QueryUserInfo_r_done(struct tevent_req *subreq)
    8113             : {
    8114          48 :         struct tevent_req *req =
    8115          48 :                 tevent_req_callback_data(subreq,
    8116             :                 struct tevent_req);
    8117             :         NTSTATUS status;
    8118             : 
    8119          48 :         status = dcerpc_binding_handle_call_recv(subreq);
    8120          48 :         TALLOC_FREE(subreq);
    8121          48 :         if (tevent_req_nterror(req, status)) {
    8122           0 :                 return;
    8123             :         }
    8124             : 
    8125          48 :         tevent_req_done(req);
    8126             : }
    8127             : 
    8128          48 : NTSTATUS dcerpc_samr_QueryUserInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    8129             : {
    8130          48 :         struct dcerpc_samr_QueryUserInfo_r_state *state =
    8131          48 :                 tevent_req_data(req,
    8132             :                 struct dcerpc_samr_QueryUserInfo_r_state);
    8133             :         NTSTATUS status;
    8134             : 
    8135          48 :         if (tevent_req_is_nterror(req, &status)) {
    8136           0 :                 tevent_req_received(req);
    8137           0 :                 return status;
    8138             :         }
    8139             : 
    8140          48 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8141             : 
    8142          48 :         tevent_req_received(req);
    8143          48 :         return NT_STATUS_OK;
    8144             : }
    8145             : 
    8146       12218 : NTSTATUS dcerpc_samr_QueryUserInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_QueryUserInfo *r)
    8147             : {
    8148             :         NTSTATUS status;
    8149             : 
    8150       12218 :         status = dcerpc_binding_handle_call(h,
    8151             :                         NULL, &ndr_table_samr,
    8152             :                         NDR_SAMR_QUERYUSERINFO, mem_ctx, r);
    8153             : 
    8154       12218 :         return status;
    8155             : }
    8156             : 
    8157             : struct dcerpc_samr_QueryUserInfo_state {
    8158             :         struct samr_QueryUserInfo orig;
    8159             :         struct samr_QueryUserInfo tmp;
    8160             :         TALLOC_CTX *out_mem_ctx;
    8161             : };
    8162             : 
    8163             : static void dcerpc_samr_QueryUserInfo_done(struct tevent_req *subreq);
    8164             : 
    8165           0 : struct tevent_req *dcerpc_samr_QueryUserInfo_send(TALLOC_CTX *mem_ctx,
    8166             :                                                   struct tevent_context *ev,
    8167             :                                                   struct dcerpc_binding_handle *h,
    8168             :                                                   struct policy_handle *_user_handle /* [in] [ref] */,
    8169             :                                                   enum samr_UserInfoLevel _level /* [in]  */,
    8170             :                                                   union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */)
    8171             : {
    8172             :         struct tevent_req *req;
    8173             :         struct dcerpc_samr_QueryUserInfo_state *state;
    8174             :         struct tevent_req *subreq;
    8175             : 
    8176           0 :         req = tevent_req_create(mem_ctx, &state,
    8177             :                                 struct dcerpc_samr_QueryUserInfo_state);
    8178           0 :         if (req == NULL) {
    8179           0 :                 return NULL;
    8180             :         }
    8181           0 :         state->out_mem_ctx = NULL;
    8182             : 
    8183             :         /* In parameters */
    8184           0 :         state->orig.in.user_handle = _user_handle;
    8185           0 :         state->orig.in.level = _level;
    8186             : 
    8187             :         /* Out parameters */
    8188           0 :         state->orig.out.info = _info;
    8189             : 
    8190             :         /* Result */
    8191           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    8192             : 
    8193           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    8194             :                              "dcerpc_samr_QueryUserInfo_out_memory");
    8195           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    8196           0 :                 return tevent_req_post(req, ev);
    8197             :         }
    8198             : 
    8199             :         /* make a temporary copy, that we pass to the dispatch function */
    8200           0 :         state->tmp = state->orig;
    8201             : 
    8202           0 :         subreq = dcerpc_samr_QueryUserInfo_r_send(state, ev, h, &state->tmp);
    8203           0 :         if (tevent_req_nomem(subreq, req)) {
    8204           0 :                 return tevent_req_post(req, ev);
    8205             :         }
    8206           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryUserInfo_done, req);
    8207           0 :         return req;
    8208             : }
    8209             : 
    8210           0 : static void dcerpc_samr_QueryUserInfo_done(struct tevent_req *subreq)
    8211             : {
    8212           0 :         struct tevent_req *req = tevent_req_callback_data(
    8213             :                 subreq, struct tevent_req);
    8214           0 :         struct dcerpc_samr_QueryUserInfo_state *state = tevent_req_data(
    8215             :                 req, struct dcerpc_samr_QueryUserInfo_state);
    8216             :         NTSTATUS status;
    8217             :         TALLOC_CTX *mem_ctx;
    8218             : 
    8219           0 :         if (state->out_mem_ctx) {
    8220           0 :                 mem_ctx = state->out_mem_ctx;
    8221             :         } else {
    8222           0 :                 mem_ctx = state;
    8223             :         }
    8224             : 
    8225           0 :         status = dcerpc_samr_QueryUserInfo_r_recv(subreq, mem_ctx);
    8226           0 :         TALLOC_FREE(subreq);
    8227           0 :         if (tevent_req_nterror(req, status)) {
    8228           0 :                 return;
    8229             :         }
    8230             : 
    8231             :         /* Copy out parameters */
    8232           0 :         *state->orig.out.info = *state->tmp.out.info;
    8233             : 
    8234             :         /* Copy result */
    8235           0 :         state->orig.out.result = state->tmp.out.result;
    8236             : 
    8237             :         /* Reset temporary structure */
    8238           0 :         NDR_ZERO_STRUCT(state->tmp);
    8239             : 
    8240           0 :         tevent_req_done(req);
    8241             : }
    8242             : 
    8243           0 : NTSTATUS dcerpc_samr_QueryUserInfo_recv(struct tevent_req *req,
    8244             :                                         TALLOC_CTX *mem_ctx,
    8245             :                                         NTSTATUS *result)
    8246             : {
    8247           0 :         struct dcerpc_samr_QueryUserInfo_state *state = tevent_req_data(
    8248             :                 req, struct dcerpc_samr_QueryUserInfo_state);
    8249             :         NTSTATUS status;
    8250             : 
    8251           0 :         if (tevent_req_is_nterror(req, &status)) {
    8252           0 :                 tevent_req_received(req);
    8253           0 :                 return status;
    8254             :         }
    8255             : 
    8256             :         /* Steal possible out parameters to the callers context */
    8257           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8258             : 
    8259             :         /* Return result */
    8260           0 :         *result = state->orig.out.result;
    8261             : 
    8262           0 :         tevent_req_received(req);
    8263           0 :         return NT_STATUS_OK;
    8264             : }
    8265             : 
    8266         214 : NTSTATUS dcerpc_samr_QueryUserInfo(struct dcerpc_binding_handle *h,
    8267             :                                    TALLOC_CTX *mem_ctx,
    8268             :                                    struct policy_handle *_user_handle /* [in] [ref] */,
    8269             :                                    enum samr_UserInfoLevel _level /* [in]  */,
    8270             :                                    union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */,
    8271             :                                    NTSTATUS *result)
    8272             : {
    8273             :         struct samr_QueryUserInfo r;
    8274             :         NTSTATUS status;
    8275             : 
    8276             :         /* In parameters */
    8277         214 :         r.in.user_handle = _user_handle;
    8278         214 :         r.in.level = _level;
    8279             : 
    8280             :         /* Out parameters */
    8281         214 :         r.out.info = _info;
    8282             : 
    8283             :         /* Result */
    8284         214 :         NDR_ZERO_STRUCT(r.out.result);
    8285             : 
    8286         214 :         status = dcerpc_samr_QueryUserInfo_r(h, mem_ctx, &r);
    8287         214 :         if (!NT_STATUS_IS_OK(status)) {
    8288           0 :                 return status;
    8289             :         }
    8290             : 
    8291             :         /* Return variables */
    8292         214 :         *_info = *r.out.info;
    8293             : 
    8294             :         /* Return result */
    8295         214 :         *result = r.out.result;
    8296             : 
    8297         214 :         return NT_STATUS_OK;
    8298             : }
    8299             : 
    8300             : struct dcerpc_samr_SetUserInfo_r_state {
    8301             :         TALLOC_CTX *out_mem_ctx;
    8302             : };
    8303             : 
    8304             : static void dcerpc_samr_SetUserInfo_r_done(struct tevent_req *subreq);
    8305             : 
    8306          58 : struct tevent_req *dcerpc_samr_SetUserInfo_r_send(TALLOC_CTX *mem_ctx,
    8307             :         struct tevent_context *ev,
    8308             :         struct dcerpc_binding_handle *h,
    8309             :         struct samr_SetUserInfo *r)
    8310             : {
    8311             :         struct tevent_req *req;
    8312             :         struct dcerpc_samr_SetUserInfo_r_state *state;
    8313             :         struct tevent_req *subreq;
    8314             : 
    8315          58 :         req = tevent_req_create(mem_ctx, &state,
    8316             :                                 struct dcerpc_samr_SetUserInfo_r_state);
    8317          58 :         if (req == NULL) {
    8318           0 :                 return NULL;
    8319             :         }
    8320             : 
    8321          58 :         state->out_mem_ctx = NULL;
    8322             : 
    8323          58 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    8324             :                         NULL, &ndr_table_samr,
    8325             :                         NDR_SAMR_SETUSERINFO, state, r);
    8326          58 :         if (tevent_req_nomem(subreq, req)) {
    8327           0 :                 return tevent_req_post(req, ev);
    8328             :         }
    8329          58 :         tevent_req_set_callback(subreq, dcerpc_samr_SetUserInfo_r_done, req);
    8330             : 
    8331          58 :         return req;
    8332             : }
    8333             : 
    8334          58 : static void dcerpc_samr_SetUserInfo_r_done(struct tevent_req *subreq)
    8335             : {
    8336          58 :         struct tevent_req *req =
    8337          58 :                 tevent_req_callback_data(subreq,
    8338             :                 struct tevent_req);
    8339             :         NTSTATUS status;
    8340             : 
    8341          58 :         status = dcerpc_binding_handle_call_recv(subreq);
    8342          58 :         TALLOC_FREE(subreq);
    8343          58 :         if (tevent_req_nterror(req, status)) {
    8344           0 :                 return;
    8345             :         }
    8346             : 
    8347          58 :         tevent_req_done(req);
    8348             : }
    8349             : 
    8350          58 : NTSTATUS dcerpc_samr_SetUserInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    8351             : {
    8352          58 :         struct dcerpc_samr_SetUserInfo_r_state *state =
    8353          58 :                 tevent_req_data(req,
    8354             :                 struct dcerpc_samr_SetUserInfo_r_state);
    8355             :         NTSTATUS status;
    8356             : 
    8357          58 :         if (tevent_req_is_nterror(req, &status)) {
    8358           0 :                 tevent_req_received(req);
    8359           0 :                 return status;
    8360             :         }
    8361             : 
    8362          58 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8363             : 
    8364          58 :         tevent_req_received(req);
    8365          58 :         return NT_STATUS_OK;
    8366             : }
    8367             : 
    8368        3228 : NTSTATUS dcerpc_samr_SetUserInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_SetUserInfo *r)
    8369             : {
    8370             :         NTSTATUS status;
    8371             : 
    8372        3228 :         status = dcerpc_binding_handle_call(h,
    8373             :                         NULL, &ndr_table_samr,
    8374             :                         NDR_SAMR_SETUSERINFO, mem_ctx, r);
    8375             : 
    8376        3228 :         return status;
    8377             : }
    8378             : 
    8379             : struct dcerpc_samr_SetUserInfo_state {
    8380             :         struct samr_SetUserInfo orig;
    8381             :         struct samr_SetUserInfo tmp;
    8382             :         TALLOC_CTX *out_mem_ctx;
    8383             : };
    8384             : 
    8385             : static void dcerpc_samr_SetUserInfo_done(struct tevent_req *subreq);
    8386             : 
    8387           0 : struct tevent_req *dcerpc_samr_SetUserInfo_send(TALLOC_CTX *mem_ctx,
    8388             :                                                 struct tevent_context *ev,
    8389             :                                                 struct dcerpc_binding_handle *h,
    8390             :                                                 struct policy_handle *_user_handle /* [in] [ref] */,
    8391             :                                                 enum samr_UserInfoLevel _level /* [in]  */,
    8392             :                                                 union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */)
    8393             : {
    8394             :         struct tevent_req *req;
    8395             :         struct dcerpc_samr_SetUserInfo_state *state;
    8396             :         struct tevent_req *subreq;
    8397             : 
    8398           0 :         req = tevent_req_create(mem_ctx, &state,
    8399             :                                 struct dcerpc_samr_SetUserInfo_state);
    8400           0 :         if (req == NULL) {
    8401           0 :                 return NULL;
    8402             :         }
    8403           0 :         state->out_mem_ctx = NULL;
    8404             : 
    8405             :         /* In parameters */
    8406           0 :         state->orig.in.user_handle = _user_handle;
    8407           0 :         state->orig.in.level = _level;
    8408           0 :         state->orig.in.info = _info;
    8409             : 
    8410             :         /* Out parameters */
    8411             : 
    8412             :         /* Result */
    8413           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    8414             : 
    8415             :         /* make a temporary copy, that we pass to the dispatch function */
    8416           0 :         state->tmp = state->orig;
    8417             : 
    8418           0 :         subreq = dcerpc_samr_SetUserInfo_r_send(state, ev, h, &state->tmp);
    8419           0 :         if (tevent_req_nomem(subreq, req)) {
    8420           0 :                 return tevent_req_post(req, ev);
    8421             :         }
    8422           0 :         tevent_req_set_callback(subreq, dcerpc_samr_SetUserInfo_done, req);
    8423           0 :         return req;
    8424             : }
    8425             : 
    8426           0 : static void dcerpc_samr_SetUserInfo_done(struct tevent_req *subreq)
    8427             : {
    8428           0 :         struct tevent_req *req = tevent_req_callback_data(
    8429             :                 subreq, struct tevent_req);
    8430           0 :         struct dcerpc_samr_SetUserInfo_state *state = tevent_req_data(
    8431             :                 req, struct dcerpc_samr_SetUserInfo_state);
    8432             :         NTSTATUS status;
    8433             :         TALLOC_CTX *mem_ctx;
    8434             : 
    8435           0 :         if (state->out_mem_ctx) {
    8436           0 :                 mem_ctx = state->out_mem_ctx;
    8437             :         } else {
    8438           0 :                 mem_ctx = state;
    8439             :         }
    8440             : 
    8441           0 :         status = dcerpc_samr_SetUserInfo_r_recv(subreq, mem_ctx);
    8442           0 :         TALLOC_FREE(subreq);
    8443           0 :         if (tevent_req_nterror(req, status)) {
    8444           0 :                 return;
    8445             :         }
    8446             : 
    8447             :         /* Copy out parameters */
    8448             : 
    8449             :         /* Copy result */
    8450           0 :         state->orig.out.result = state->tmp.out.result;
    8451             : 
    8452             :         /* Reset temporary structure */
    8453           0 :         NDR_ZERO_STRUCT(state->tmp);
    8454             : 
    8455           0 :         tevent_req_done(req);
    8456             : }
    8457             : 
    8458           0 : NTSTATUS dcerpc_samr_SetUserInfo_recv(struct tevent_req *req,
    8459             :                                       TALLOC_CTX *mem_ctx,
    8460             :                                       NTSTATUS *result)
    8461             : {
    8462           0 :         struct dcerpc_samr_SetUserInfo_state *state = tevent_req_data(
    8463             :                 req, struct dcerpc_samr_SetUserInfo_state);
    8464             :         NTSTATUS status;
    8465             : 
    8466           0 :         if (tevent_req_is_nterror(req, &status)) {
    8467           0 :                 tevent_req_received(req);
    8468           0 :                 return status;
    8469             :         }
    8470             : 
    8471             :         /* Steal possible out parameters to the callers context */
    8472           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8473             : 
    8474             :         /* Return result */
    8475           0 :         *result = state->orig.out.result;
    8476             : 
    8477           0 :         tevent_req_received(req);
    8478           0 :         return NT_STATUS_OK;
    8479             : }
    8480             : 
    8481           4 : NTSTATUS dcerpc_samr_SetUserInfo(struct dcerpc_binding_handle *h,
    8482             :                                  TALLOC_CTX *mem_ctx,
    8483             :                                  struct policy_handle *_user_handle /* [in] [ref] */,
    8484             :                                  enum samr_UserInfoLevel _level /* [in]  */,
    8485             :                                  union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */,
    8486             :                                  NTSTATUS *result)
    8487             : {
    8488             :         struct samr_SetUserInfo r;
    8489             :         NTSTATUS status;
    8490             : 
    8491             :         /* In parameters */
    8492           4 :         r.in.user_handle = _user_handle;
    8493           4 :         r.in.level = _level;
    8494           4 :         r.in.info = _info;
    8495             : 
    8496             :         /* Out parameters */
    8497             : 
    8498             :         /* Result */
    8499           4 :         NDR_ZERO_STRUCT(r.out.result);
    8500             : 
    8501           4 :         status = dcerpc_samr_SetUserInfo_r(h, mem_ctx, &r);
    8502           4 :         if (!NT_STATUS_IS_OK(status)) {
    8503           0 :                 return status;
    8504             :         }
    8505             : 
    8506             :         /* Return variables */
    8507             : 
    8508             :         /* Return result */
    8509           4 :         *result = r.out.result;
    8510             : 
    8511           4 :         return NT_STATUS_OK;
    8512             : }
    8513             : 
    8514             : struct dcerpc_samr_ChangePasswordUser_r_state {
    8515             :         TALLOC_CTX *out_mem_ctx;
    8516             : };
    8517             : 
    8518             : static void dcerpc_samr_ChangePasswordUser_r_done(struct tevent_req *subreq);
    8519             : 
    8520           0 : struct tevent_req *dcerpc_samr_ChangePasswordUser_r_send(TALLOC_CTX *mem_ctx,
    8521             :         struct tevent_context *ev,
    8522             :         struct dcerpc_binding_handle *h,
    8523             :         struct samr_ChangePasswordUser *r)
    8524             : {
    8525             :         struct tevent_req *req;
    8526             :         struct dcerpc_samr_ChangePasswordUser_r_state *state;
    8527             :         struct tevent_req *subreq;
    8528             : 
    8529           0 :         req = tevent_req_create(mem_ctx, &state,
    8530             :                                 struct dcerpc_samr_ChangePasswordUser_r_state);
    8531           0 :         if (req == NULL) {
    8532           0 :                 return NULL;
    8533             :         }
    8534             : 
    8535           0 :         state->out_mem_ctx = NULL;
    8536             : 
    8537           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    8538             :                         NULL, &ndr_table_samr,
    8539             :                         NDR_SAMR_CHANGEPASSWORDUSER, state, r);
    8540           0 :         if (tevent_req_nomem(subreq, req)) {
    8541           0 :                 return tevent_req_post(req, ev);
    8542             :         }
    8543           0 :         tevent_req_set_callback(subreq, dcerpc_samr_ChangePasswordUser_r_done, req);
    8544             : 
    8545           0 :         return req;
    8546             : }
    8547             : 
    8548           0 : static void dcerpc_samr_ChangePasswordUser_r_done(struct tevent_req *subreq)
    8549             : {
    8550           0 :         struct tevent_req *req =
    8551           0 :                 tevent_req_callback_data(subreq,
    8552             :                 struct tevent_req);
    8553             :         NTSTATUS status;
    8554             : 
    8555           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    8556           0 :         TALLOC_FREE(subreq);
    8557           0 :         if (tevent_req_nterror(req, status)) {
    8558           0 :                 return;
    8559             :         }
    8560             : 
    8561           0 :         tevent_req_done(req);
    8562             : }
    8563             : 
    8564           0 : NTSTATUS dcerpc_samr_ChangePasswordUser_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    8565             : {
    8566           0 :         struct dcerpc_samr_ChangePasswordUser_r_state *state =
    8567           0 :                 tevent_req_data(req,
    8568             :                 struct dcerpc_samr_ChangePasswordUser_r_state);
    8569             :         NTSTATUS status;
    8570             : 
    8571           0 :         if (tevent_req_is_nterror(req, &status)) {
    8572           0 :                 tevent_req_received(req);
    8573           0 :                 return status;
    8574             :         }
    8575             : 
    8576           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8577             : 
    8578           0 :         tevent_req_received(req);
    8579           0 :         return NT_STATUS_OK;
    8580             : }
    8581             : 
    8582           8 : NTSTATUS dcerpc_samr_ChangePasswordUser_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_ChangePasswordUser *r)
    8583             : {
    8584             :         NTSTATUS status;
    8585             : 
    8586           8 :         status = dcerpc_binding_handle_call(h,
    8587             :                         NULL, &ndr_table_samr,
    8588             :                         NDR_SAMR_CHANGEPASSWORDUSER, mem_ctx, r);
    8589             : 
    8590           8 :         return status;
    8591             : }
    8592             : 
    8593             : struct dcerpc_samr_ChangePasswordUser_state {
    8594             :         struct samr_ChangePasswordUser orig;
    8595             :         struct samr_ChangePasswordUser tmp;
    8596             :         TALLOC_CTX *out_mem_ctx;
    8597             : };
    8598             : 
    8599             : static void dcerpc_samr_ChangePasswordUser_done(struct tevent_req *subreq);
    8600             : 
    8601           0 : struct tevent_req *dcerpc_samr_ChangePasswordUser_send(TALLOC_CTX *mem_ctx,
    8602             :                                                        struct tevent_context *ev,
    8603             :                                                        struct dcerpc_binding_handle *h,
    8604             :                                                        struct policy_handle *_user_handle /* [in] [ref] */,
    8605             :                                                        uint8_t _lm_present /* [in]  */,
    8606             :                                                        struct samr_Password *_old_lm_crypted /* [in] [unique] */,
    8607             :                                                        struct samr_Password *_new_lm_crypted /* [in] [unique] */,
    8608             :                                                        uint8_t _nt_present /* [in]  */,
    8609             :                                                        struct samr_Password *_old_nt_crypted /* [in] [unique] */,
    8610             :                                                        struct samr_Password *_new_nt_crypted /* [in] [unique] */,
    8611             :                                                        uint8_t _cross1_present /* [in]  */,
    8612             :                                                        struct samr_Password *_nt_cross /* [in] [unique] */,
    8613             :                                                        uint8_t _cross2_present /* [in]  */,
    8614             :                                                        struct samr_Password *_lm_cross /* [in] [unique] */)
    8615             : {
    8616             :         struct tevent_req *req;
    8617             :         struct dcerpc_samr_ChangePasswordUser_state *state;
    8618             :         struct tevent_req *subreq;
    8619             : 
    8620           0 :         req = tevent_req_create(mem_ctx, &state,
    8621             :                                 struct dcerpc_samr_ChangePasswordUser_state);
    8622           0 :         if (req == NULL) {
    8623           0 :                 return NULL;
    8624             :         }
    8625           0 :         state->out_mem_ctx = NULL;
    8626             : 
    8627             :         /* In parameters */
    8628           0 :         state->orig.in.user_handle = _user_handle;
    8629           0 :         state->orig.in.lm_present = _lm_present;
    8630           0 :         state->orig.in.old_lm_crypted = _old_lm_crypted;
    8631           0 :         state->orig.in.new_lm_crypted = _new_lm_crypted;
    8632           0 :         state->orig.in.nt_present = _nt_present;
    8633           0 :         state->orig.in.old_nt_crypted = _old_nt_crypted;
    8634           0 :         state->orig.in.new_nt_crypted = _new_nt_crypted;
    8635           0 :         state->orig.in.cross1_present = _cross1_present;
    8636           0 :         state->orig.in.nt_cross = _nt_cross;
    8637           0 :         state->orig.in.cross2_present = _cross2_present;
    8638           0 :         state->orig.in.lm_cross = _lm_cross;
    8639             : 
    8640             :         /* Out parameters */
    8641             : 
    8642             :         /* Result */
    8643           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    8644             : 
    8645             :         /* make a temporary copy, that we pass to the dispatch function */
    8646           0 :         state->tmp = state->orig;
    8647             : 
    8648           0 :         subreq = dcerpc_samr_ChangePasswordUser_r_send(state, ev, h, &state->tmp);
    8649           0 :         if (tevent_req_nomem(subreq, req)) {
    8650           0 :                 return tevent_req_post(req, ev);
    8651             :         }
    8652           0 :         tevent_req_set_callback(subreq, dcerpc_samr_ChangePasswordUser_done, req);
    8653           0 :         return req;
    8654             : }
    8655             : 
    8656           0 : static void dcerpc_samr_ChangePasswordUser_done(struct tevent_req *subreq)
    8657             : {
    8658           0 :         struct tevent_req *req = tevent_req_callback_data(
    8659             :                 subreq, struct tevent_req);
    8660           0 :         struct dcerpc_samr_ChangePasswordUser_state *state = tevent_req_data(
    8661             :                 req, struct dcerpc_samr_ChangePasswordUser_state);
    8662             :         NTSTATUS status;
    8663             :         TALLOC_CTX *mem_ctx;
    8664             : 
    8665           0 :         if (state->out_mem_ctx) {
    8666           0 :                 mem_ctx = state->out_mem_ctx;
    8667             :         } else {
    8668           0 :                 mem_ctx = state;
    8669             :         }
    8670             : 
    8671           0 :         status = dcerpc_samr_ChangePasswordUser_r_recv(subreq, mem_ctx);
    8672           0 :         TALLOC_FREE(subreq);
    8673           0 :         if (tevent_req_nterror(req, status)) {
    8674           0 :                 return;
    8675             :         }
    8676             : 
    8677             :         /* Copy out parameters */
    8678             : 
    8679             :         /* Copy result */
    8680           0 :         state->orig.out.result = state->tmp.out.result;
    8681             : 
    8682             :         /* Reset temporary structure */
    8683           0 :         NDR_ZERO_STRUCT(state->tmp);
    8684             : 
    8685           0 :         tevent_req_done(req);
    8686             : }
    8687             : 
    8688           0 : NTSTATUS dcerpc_samr_ChangePasswordUser_recv(struct tevent_req *req,
    8689             :                                              TALLOC_CTX *mem_ctx,
    8690             :                                              NTSTATUS *result)
    8691             : {
    8692           0 :         struct dcerpc_samr_ChangePasswordUser_state *state = tevent_req_data(
    8693             :                 req, struct dcerpc_samr_ChangePasswordUser_state);
    8694             :         NTSTATUS status;
    8695             : 
    8696           0 :         if (tevent_req_is_nterror(req, &status)) {
    8697           0 :                 tevent_req_received(req);
    8698           0 :                 return status;
    8699             :         }
    8700             : 
    8701             :         /* Steal possible out parameters to the callers context */
    8702           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8703             : 
    8704             :         /* Return result */
    8705           0 :         *result = state->orig.out.result;
    8706             : 
    8707           0 :         tevent_req_received(req);
    8708           0 :         return NT_STATUS_OK;
    8709             : }
    8710             : 
    8711           0 : NTSTATUS dcerpc_samr_ChangePasswordUser(struct dcerpc_binding_handle *h,
    8712             :                                         TALLOC_CTX *mem_ctx,
    8713             :                                         struct policy_handle *_user_handle /* [in] [ref] */,
    8714             :                                         uint8_t _lm_present /* [in]  */,
    8715             :                                         struct samr_Password *_old_lm_crypted /* [in] [unique] */,
    8716             :                                         struct samr_Password *_new_lm_crypted /* [in] [unique] */,
    8717             :                                         uint8_t _nt_present /* [in]  */,
    8718             :                                         struct samr_Password *_old_nt_crypted /* [in] [unique] */,
    8719             :                                         struct samr_Password *_new_nt_crypted /* [in] [unique] */,
    8720             :                                         uint8_t _cross1_present /* [in]  */,
    8721             :                                         struct samr_Password *_nt_cross /* [in] [unique] */,
    8722             :                                         uint8_t _cross2_present /* [in]  */,
    8723             :                                         struct samr_Password *_lm_cross /* [in] [unique] */,
    8724             :                                         NTSTATUS *result)
    8725             : {
    8726             :         struct samr_ChangePasswordUser r;
    8727             :         NTSTATUS status;
    8728             : 
    8729             :         /* In parameters */
    8730           0 :         r.in.user_handle = _user_handle;
    8731           0 :         r.in.lm_present = _lm_present;
    8732           0 :         r.in.old_lm_crypted = _old_lm_crypted;
    8733           0 :         r.in.new_lm_crypted = _new_lm_crypted;
    8734           0 :         r.in.nt_present = _nt_present;
    8735           0 :         r.in.old_nt_crypted = _old_nt_crypted;
    8736           0 :         r.in.new_nt_crypted = _new_nt_crypted;
    8737           0 :         r.in.cross1_present = _cross1_present;
    8738           0 :         r.in.nt_cross = _nt_cross;
    8739           0 :         r.in.cross2_present = _cross2_present;
    8740           0 :         r.in.lm_cross = _lm_cross;
    8741             : 
    8742             :         /* Out parameters */
    8743             : 
    8744             :         /* Result */
    8745           0 :         NDR_ZERO_STRUCT(r.out.result);
    8746             : 
    8747           0 :         status = dcerpc_samr_ChangePasswordUser_r(h, mem_ctx, &r);
    8748           0 :         if (!NT_STATUS_IS_OK(status)) {
    8749           0 :                 return status;
    8750             :         }
    8751             : 
    8752             :         /* Return variables */
    8753             : 
    8754             :         /* Return result */
    8755           0 :         *result = r.out.result;
    8756             : 
    8757           0 :         return NT_STATUS_OK;
    8758             : }
    8759             : 
    8760             : struct dcerpc_samr_GetGroupsForUser_r_state {
    8761             :         TALLOC_CTX *out_mem_ctx;
    8762             : };
    8763             : 
    8764             : static void dcerpc_samr_GetGroupsForUser_r_done(struct tevent_req *subreq);
    8765             : 
    8766           0 : struct tevent_req *dcerpc_samr_GetGroupsForUser_r_send(TALLOC_CTX *mem_ctx,
    8767             :         struct tevent_context *ev,
    8768             :         struct dcerpc_binding_handle *h,
    8769             :         struct samr_GetGroupsForUser *r)
    8770             : {
    8771             :         struct tevent_req *req;
    8772             :         struct dcerpc_samr_GetGroupsForUser_r_state *state;
    8773             :         struct tevent_req *subreq;
    8774             : 
    8775           0 :         req = tevent_req_create(mem_ctx, &state,
    8776             :                                 struct dcerpc_samr_GetGroupsForUser_r_state);
    8777           0 :         if (req == NULL) {
    8778           0 :                 return NULL;
    8779             :         }
    8780             : 
    8781           0 :         state->out_mem_ctx = talloc_new(state);
    8782           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    8783           0 :                 return tevent_req_post(req, ev);
    8784             :         }
    8785             : 
    8786           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    8787             :                         NULL, &ndr_table_samr,
    8788           0 :                         NDR_SAMR_GETGROUPSFORUSER, state->out_mem_ctx, r);
    8789           0 :         if (tevent_req_nomem(subreq, req)) {
    8790           0 :                 return tevent_req_post(req, ev);
    8791             :         }
    8792           0 :         tevent_req_set_callback(subreq, dcerpc_samr_GetGroupsForUser_r_done, req);
    8793             : 
    8794           0 :         return req;
    8795             : }
    8796             : 
    8797           0 : static void dcerpc_samr_GetGroupsForUser_r_done(struct tevent_req *subreq)
    8798             : {
    8799           0 :         struct tevent_req *req =
    8800           0 :                 tevent_req_callback_data(subreq,
    8801             :                 struct tevent_req);
    8802             :         NTSTATUS status;
    8803             : 
    8804           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    8805           0 :         TALLOC_FREE(subreq);
    8806           0 :         if (tevent_req_nterror(req, status)) {
    8807           0 :                 return;
    8808             :         }
    8809             : 
    8810           0 :         tevent_req_done(req);
    8811             : }
    8812             : 
    8813           0 : NTSTATUS dcerpc_samr_GetGroupsForUser_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    8814             : {
    8815           0 :         struct dcerpc_samr_GetGroupsForUser_r_state *state =
    8816           0 :                 tevent_req_data(req,
    8817             :                 struct dcerpc_samr_GetGroupsForUser_r_state);
    8818             :         NTSTATUS status;
    8819             : 
    8820           0 :         if (tevent_req_is_nterror(req, &status)) {
    8821           0 :                 tevent_req_received(req);
    8822           0 :                 return status;
    8823             :         }
    8824             : 
    8825           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8826             : 
    8827           0 :         tevent_req_received(req);
    8828           0 :         return NT_STATUS_OK;
    8829             : }
    8830             : 
    8831         767 : NTSTATUS dcerpc_samr_GetGroupsForUser_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_GetGroupsForUser *r)
    8832             : {
    8833             :         NTSTATUS status;
    8834             : 
    8835         767 :         status = dcerpc_binding_handle_call(h,
    8836             :                         NULL, &ndr_table_samr,
    8837             :                         NDR_SAMR_GETGROUPSFORUSER, mem_ctx, r);
    8838             : 
    8839         767 :         return status;
    8840             : }
    8841             : 
    8842             : struct dcerpc_samr_GetGroupsForUser_state {
    8843             :         struct samr_GetGroupsForUser orig;
    8844             :         struct samr_GetGroupsForUser tmp;
    8845             :         TALLOC_CTX *out_mem_ctx;
    8846             : };
    8847             : 
    8848             : static void dcerpc_samr_GetGroupsForUser_done(struct tevent_req *subreq);
    8849             : 
    8850           0 : struct tevent_req *dcerpc_samr_GetGroupsForUser_send(TALLOC_CTX *mem_ctx,
    8851             :                                                      struct tevent_context *ev,
    8852             :                                                      struct dcerpc_binding_handle *h,
    8853             :                                                      struct policy_handle *_user_handle /* [in] [ref] */,
    8854             :                                                      struct samr_RidWithAttributeArray **_rids /* [out] [ref] */)
    8855             : {
    8856             :         struct tevent_req *req;
    8857             :         struct dcerpc_samr_GetGroupsForUser_state *state;
    8858             :         struct tevent_req *subreq;
    8859             : 
    8860           0 :         req = tevent_req_create(mem_ctx, &state,
    8861             :                                 struct dcerpc_samr_GetGroupsForUser_state);
    8862           0 :         if (req == NULL) {
    8863           0 :                 return NULL;
    8864             :         }
    8865           0 :         state->out_mem_ctx = NULL;
    8866             : 
    8867             :         /* In parameters */
    8868           0 :         state->orig.in.user_handle = _user_handle;
    8869             : 
    8870             :         /* Out parameters */
    8871           0 :         state->orig.out.rids = _rids;
    8872             : 
    8873             :         /* Result */
    8874           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    8875             : 
    8876           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    8877             :                              "dcerpc_samr_GetGroupsForUser_out_memory");
    8878           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    8879           0 :                 return tevent_req_post(req, ev);
    8880             :         }
    8881             : 
    8882             :         /* make a temporary copy, that we pass to the dispatch function */
    8883           0 :         state->tmp = state->orig;
    8884             : 
    8885           0 :         subreq = dcerpc_samr_GetGroupsForUser_r_send(state, ev, h, &state->tmp);
    8886           0 :         if (tevent_req_nomem(subreq, req)) {
    8887           0 :                 return tevent_req_post(req, ev);
    8888             :         }
    8889           0 :         tevent_req_set_callback(subreq, dcerpc_samr_GetGroupsForUser_done, req);
    8890           0 :         return req;
    8891             : }
    8892             : 
    8893           0 : static void dcerpc_samr_GetGroupsForUser_done(struct tevent_req *subreq)
    8894             : {
    8895           0 :         struct tevent_req *req = tevent_req_callback_data(
    8896             :                 subreq, struct tevent_req);
    8897           0 :         struct dcerpc_samr_GetGroupsForUser_state *state = tevent_req_data(
    8898             :                 req, struct dcerpc_samr_GetGroupsForUser_state);
    8899             :         NTSTATUS status;
    8900             :         TALLOC_CTX *mem_ctx;
    8901             : 
    8902           0 :         if (state->out_mem_ctx) {
    8903           0 :                 mem_ctx = state->out_mem_ctx;
    8904             :         } else {
    8905           0 :                 mem_ctx = state;
    8906             :         }
    8907             : 
    8908           0 :         status = dcerpc_samr_GetGroupsForUser_r_recv(subreq, mem_ctx);
    8909           0 :         TALLOC_FREE(subreq);
    8910           0 :         if (tevent_req_nterror(req, status)) {
    8911           0 :                 return;
    8912             :         }
    8913             : 
    8914             :         /* Copy out parameters */
    8915           0 :         *state->orig.out.rids = *state->tmp.out.rids;
    8916             : 
    8917             :         /* Copy result */
    8918           0 :         state->orig.out.result = state->tmp.out.result;
    8919             : 
    8920             :         /* Reset temporary structure */
    8921           0 :         NDR_ZERO_STRUCT(state->tmp);
    8922             : 
    8923           0 :         tevent_req_done(req);
    8924             : }
    8925             : 
    8926           0 : NTSTATUS dcerpc_samr_GetGroupsForUser_recv(struct tevent_req *req,
    8927             :                                            TALLOC_CTX *mem_ctx,
    8928             :                                            NTSTATUS *result)
    8929             : {
    8930           0 :         struct dcerpc_samr_GetGroupsForUser_state *state = tevent_req_data(
    8931             :                 req, struct dcerpc_samr_GetGroupsForUser_state);
    8932             :         NTSTATUS status;
    8933             : 
    8934           0 :         if (tevent_req_is_nterror(req, &status)) {
    8935           0 :                 tevent_req_received(req);
    8936           0 :                 return status;
    8937             :         }
    8938             : 
    8939             :         /* Steal possible out parameters to the callers context */
    8940           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8941             : 
    8942             :         /* Return result */
    8943           0 :         *result = state->orig.out.result;
    8944             : 
    8945           0 :         tevent_req_received(req);
    8946           0 :         return NT_STATUS_OK;
    8947             : }
    8948             : 
    8949          87 : NTSTATUS dcerpc_samr_GetGroupsForUser(struct dcerpc_binding_handle *h,
    8950             :                                       TALLOC_CTX *mem_ctx,
    8951             :                                       struct policy_handle *_user_handle /* [in] [ref] */,
    8952             :                                       struct samr_RidWithAttributeArray **_rids /* [out] [ref] */,
    8953             :                                       NTSTATUS *result)
    8954             : {
    8955             :         struct samr_GetGroupsForUser r;
    8956             :         NTSTATUS status;
    8957             : 
    8958             :         /* In parameters */
    8959          87 :         r.in.user_handle = _user_handle;
    8960             : 
    8961             :         /* Out parameters */
    8962          87 :         r.out.rids = _rids;
    8963             : 
    8964             :         /* Result */
    8965          87 :         NDR_ZERO_STRUCT(r.out.result);
    8966             : 
    8967          87 :         status = dcerpc_samr_GetGroupsForUser_r(h, mem_ctx, &r);
    8968          87 :         if (!NT_STATUS_IS_OK(status)) {
    8969           0 :                 return status;
    8970             :         }
    8971             : 
    8972             :         /* Return variables */
    8973          87 :         *_rids = *r.out.rids;
    8974             : 
    8975             :         /* Return result */
    8976          87 :         *result = r.out.result;
    8977             : 
    8978          87 :         return NT_STATUS_OK;
    8979             : }
    8980             : 
    8981             : struct dcerpc_samr_QueryDisplayInfo_r_state {
    8982             :         TALLOC_CTX *out_mem_ctx;
    8983             : };
    8984             : 
    8985             : static void dcerpc_samr_QueryDisplayInfo_r_done(struct tevent_req *subreq);
    8986             : 
    8987           0 : struct tevent_req *dcerpc_samr_QueryDisplayInfo_r_send(TALLOC_CTX *mem_ctx,
    8988             :         struct tevent_context *ev,
    8989             :         struct dcerpc_binding_handle *h,
    8990             :         struct samr_QueryDisplayInfo *r)
    8991             : {
    8992             :         struct tevent_req *req;
    8993             :         struct dcerpc_samr_QueryDisplayInfo_r_state *state;
    8994             :         struct tevent_req *subreq;
    8995             : 
    8996           0 :         req = tevent_req_create(mem_ctx, &state,
    8997             :                                 struct dcerpc_samr_QueryDisplayInfo_r_state);
    8998           0 :         if (req == NULL) {
    8999           0 :                 return NULL;
    9000             :         }
    9001             : 
    9002           0 :         state->out_mem_ctx = talloc_new(state);
    9003           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    9004           0 :                 return tevent_req_post(req, ev);
    9005             :         }
    9006             : 
    9007           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    9008             :                         NULL, &ndr_table_samr,
    9009           0 :                         NDR_SAMR_QUERYDISPLAYINFO, state->out_mem_ctx, r);
    9010           0 :         if (tevent_req_nomem(subreq, req)) {
    9011           0 :                 return tevent_req_post(req, ev);
    9012             :         }
    9013           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryDisplayInfo_r_done, req);
    9014             : 
    9015           0 :         return req;
    9016             : }
    9017             : 
    9018           0 : static void dcerpc_samr_QueryDisplayInfo_r_done(struct tevent_req *subreq)
    9019             : {
    9020           0 :         struct tevent_req *req =
    9021           0 :                 tevent_req_callback_data(subreq,
    9022             :                 struct tevent_req);
    9023             :         NTSTATUS status;
    9024             : 
    9025           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    9026           0 :         TALLOC_FREE(subreq);
    9027           0 :         if (tevent_req_nterror(req, status)) {
    9028           0 :                 return;
    9029             :         }
    9030             : 
    9031           0 :         tevent_req_done(req);
    9032             : }
    9033             : 
    9034           0 : NTSTATUS dcerpc_samr_QueryDisplayInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    9035             : {
    9036           0 :         struct dcerpc_samr_QueryDisplayInfo_r_state *state =
    9037           0 :                 tevent_req_data(req,
    9038             :                 struct dcerpc_samr_QueryDisplayInfo_r_state);
    9039             :         NTSTATUS status;
    9040             : 
    9041           0 :         if (tevent_req_is_nterror(req, &status)) {
    9042           0 :                 tevent_req_received(req);
    9043           0 :                 return status;
    9044             :         }
    9045             : 
    9046           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    9047             : 
    9048           0 :         tevent_req_received(req);
    9049           0 :         return NT_STATUS_OK;
    9050             : }
    9051             : 
    9052         551 : NTSTATUS dcerpc_samr_QueryDisplayInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_QueryDisplayInfo *r)
    9053             : {
    9054             :         NTSTATUS status;
    9055             : 
    9056         551 :         status = dcerpc_binding_handle_call(h,
    9057             :                         NULL, &ndr_table_samr,
    9058             :                         NDR_SAMR_QUERYDISPLAYINFO, mem_ctx, r);
    9059             : 
    9060         551 :         return status;
    9061             : }
    9062             : 
    9063             : struct dcerpc_samr_QueryDisplayInfo_state {
    9064             :         struct samr_QueryDisplayInfo orig;
    9065             :         struct samr_QueryDisplayInfo tmp;
    9066             :         TALLOC_CTX *out_mem_ctx;
    9067             : };
    9068             : 
    9069             : static void dcerpc_samr_QueryDisplayInfo_done(struct tevent_req *subreq);
    9070             : 
    9071           0 : struct tevent_req *dcerpc_samr_QueryDisplayInfo_send(TALLOC_CTX *mem_ctx,
    9072             :                                                      struct tevent_context *ev,
    9073             :                                                      struct dcerpc_binding_handle *h,
    9074             :                                                      struct policy_handle *_domain_handle /* [in] [ref] */,
    9075             :                                                      uint16_t _level /* [in]  */,
    9076             :                                                      uint32_t _start_idx /* [in]  */,
    9077             :                                                      uint32_t _max_entries /* [in]  */,
    9078             :                                                      uint32_t _buf_size /* [in]  */,
    9079             :                                                      uint32_t *_total_size /* [out] [ref] */,
    9080             :                                                      uint32_t *_returned_size /* [out] [ref] */,
    9081             :                                                      union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
    9082             : {
    9083             :         struct tevent_req *req;
    9084             :         struct dcerpc_samr_QueryDisplayInfo_state *state;
    9085             :         struct tevent_req *subreq;
    9086             : 
    9087           0 :         req = tevent_req_create(mem_ctx, &state,
    9088             :                                 struct dcerpc_samr_QueryDisplayInfo_state);
    9089           0 :         if (req == NULL) {
    9090           0 :                 return NULL;
    9091             :         }
    9092           0 :         state->out_mem_ctx = NULL;
    9093             : 
    9094             :         /* In parameters */
    9095           0 :         state->orig.in.domain_handle = _domain_handle;
    9096           0 :         state->orig.in.level = _level;
    9097           0 :         state->orig.in.start_idx = _start_idx;
    9098           0 :         state->orig.in.max_entries = _max_entries;
    9099           0 :         state->orig.in.buf_size = _buf_size;
    9100             : 
    9101             :         /* Out parameters */
    9102           0 :         state->orig.out.total_size = _total_size;
    9103           0 :         state->orig.out.returned_size = _returned_size;
    9104           0 :         state->orig.out.info = _info;
    9105             : 
    9106             :         /* Result */
    9107           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    9108             : 
    9109           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    9110             :                              "dcerpc_samr_QueryDisplayInfo_out_memory");
    9111           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    9112           0 :                 return tevent_req_post(req, ev);
    9113             :         }
    9114             : 
    9115             :         /* make a temporary copy, that we pass to the dispatch function */
    9116           0 :         state->tmp = state->orig;
    9117             : 
    9118           0 :         subreq = dcerpc_samr_QueryDisplayInfo_r_send(state, ev, h, &state->tmp);
    9119           0 :         if (tevent_req_nomem(subreq, req)) {
    9120           0 :                 return tevent_req_post(req, ev);
    9121             :         }
    9122           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryDisplayInfo_done, req);
    9123           0 :         return req;
    9124             : }
    9125             : 
    9126           0 : static void dcerpc_samr_QueryDisplayInfo_done(struct tevent_req *subreq)
    9127             : {
    9128           0 :         struct tevent_req *req = tevent_req_callback_data(
    9129             :                 subreq, struct tevent_req);
    9130           0 :         struct dcerpc_samr_QueryDisplayInfo_state *state = tevent_req_data(
    9131             :                 req, struct dcerpc_samr_QueryDisplayInfo_state);
    9132             :         NTSTATUS status;
    9133             :         TALLOC_CTX *mem_ctx;
    9134             : 
    9135           0 :         if (state->out_mem_ctx) {
    9136           0 :                 mem_ctx = state->out_mem_ctx;
    9137             :         } else {
    9138           0 :                 mem_ctx = state;
    9139             :         }
    9140             : 
    9141           0 :         status = dcerpc_samr_QueryDisplayInfo_r_recv(subreq, mem_ctx);
    9142           0 :         TALLOC_FREE(subreq);
    9143           0 :         if (tevent_req_nterror(req, status)) {
    9144           0 :                 return;
    9145             :         }
    9146             : 
    9147             :         /* Copy out parameters */
    9148           0 :         *state->orig.out.total_size = *state->tmp.out.total_size;
    9149           0 :         *state->orig.out.returned_size = *state->tmp.out.returned_size;
    9150           0 :         *state->orig.out.info = *state->tmp.out.info;
    9151             : 
    9152             :         /* Copy result */
    9153           0 :         state->orig.out.result = state->tmp.out.result;
    9154             : 
    9155             :         /* Reset temporary structure */
    9156           0 :         NDR_ZERO_STRUCT(state->tmp);
    9157             : 
    9158           0 :         tevent_req_done(req);
    9159             : }
    9160             : 
    9161           0 : NTSTATUS dcerpc_samr_QueryDisplayInfo_recv(struct tevent_req *req,
    9162             :                                            TALLOC_CTX *mem_ctx,
    9163             :                                            NTSTATUS *result)
    9164             : {
    9165           0 :         struct dcerpc_samr_QueryDisplayInfo_state *state = tevent_req_data(
    9166             :                 req, struct dcerpc_samr_QueryDisplayInfo_state);
    9167             :         NTSTATUS status;
    9168             : 
    9169           0 :         if (tevent_req_is_nterror(req, &status)) {
    9170           0 :                 tevent_req_received(req);
    9171           0 :                 return status;
    9172             :         }
    9173             : 
    9174             :         /* Steal possible out parameters to the callers context */
    9175           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    9176             : 
    9177             :         /* Return result */
    9178           0 :         *result = state->orig.out.result;
    9179             : 
    9180           0 :         tevent_req_received(req);
    9181           0 :         return NT_STATUS_OK;
    9182             : }
    9183             : 
    9184           0 : NTSTATUS dcerpc_samr_QueryDisplayInfo(struct dcerpc_binding_handle *h,
    9185             :                                       TALLOC_CTX *mem_ctx,
    9186             :                                       struct policy_handle *_domain_handle /* [in] [ref] */,
    9187             :                                       uint16_t _level /* [in]  */,
    9188             :                                       uint32_t _start_idx /* [in]  */,
    9189             :                                       uint32_t _max_entries /* [in]  */,
    9190             :                                       uint32_t _buf_size /* [in]  */,
    9191             :                                       uint32_t *_total_size /* [out] [ref] */,
    9192             :                                       uint32_t *_returned_size /* [out] [ref] */,
    9193             :                                       union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */,
    9194             :                                       NTSTATUS *result)
    9195             : {
    9196             :         struct samr_QueryDisplayInfo r;
    9197             :         NTSTATUS status;
    9198             : 
    9199             :         /* In parameters */
    9200           0 :         r.in.domain_handle = _domain_handle;
    9201           0 :         r.in.level = _level;
    9202           0 :         r.in.start_idx = _start_idx;
    9203           0 :         r.in.max_entries = _max_entries;
    9204           0 :         r.in.buf_size = _buf_size;
    9205             : 
    9206             :         /* Out parameters */
    9207           0 :         r.out.total_size = _total_size;
    9208           0 :         r.out.returned_size = _returned_size;
    9209           0 :         r.out.info = _info;
    9210             : 
    9211             :         /* Result */
    9212           0 :         NDR_ZERO_STRUCT(r.out.result);
    9213             : 
    9214           0 :         status = dcerpc_samr_QueryDisplayInfo_r(h, mem_ctx, &r);
    9215           0 :         if (!NT_STATUS_IS_OK(status)) {
    9216           0 :                 return status;
    9217             :         }
    9218             : 
    9219             :         /* Return variables */
    9220           0 :         *_total_size = *r.out.total_size;
    9221           0 :         *_returned_size = *r.out.returned_size;
    9222           0 :         *_info = *r.out.info;
    9223             : 
    9224             :         /* Return result */
    9225           0 :         *result = r.out.result;
    9226             : 
    9227           0 :         return NT_STATUS_OK;
    9228             : }
    9229             : 
    9230             : struct dcerpc_samr_GetDisplayEnumerationIndex_r_state {
    9231             :         TALLOC_CTX *out_mem_ctx;
    9232             : };
    9233             : 
    9234             : static void dcerpc_samr_GetDisplayEnumerationIndex_r_done(struct tevent_req *subreq);
    9235             : 
    9236           0 : struct tevent_req *dcerpc_samr_GetDisplayEnumerationIndex_r_send(TALLOC_CTX *mem_ctx,
    9237             :         struct tevent_context *ev,
    9238             :         struct dcerpc_binding_handle *h,
    9239             :         struct samr_GetDisplayEnumerationIndex *r)
    9240             : {
    9241             :         struct tevent_req *req;
    9242             :         struct dcerpc_samr_GetDisplayEnumerationIndex_r_state *state;
    9243             :         struct tevent_req *subreq;
    9244             : 
    9245           0 :         req = tevent_req_create(mem_ctx, &state,
    9246             :                                 struct dcerpc_samr_GetDisplayEnumerationIndex_r_state);
    9247           0 :         if (req == NULL) {
    9248           0 :                 return NULL;
    9249             :         }
    9250             : 
    9251           0 :         state->out_mem_ctx = talloc_new(state);
    9252           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    9253           0 :                 return tevent_req_post(req, ev);
    9254             :         }
    9255             : 
    9256           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    9257             :                         NULL, &ndr_table_samr,
    9258           0 :                         NDR_SAMR_GETDISPLAYENUMERATIONINDEX, state->out_mem_ctx, r);
    9259           0 :         if (tevent_req_nomem(subreq, req)) {
    9260           0 :                 return tevent_req_post(req, ev);
    9261             :         }
    9262           0 :         tevent_req_set_callback(subreq, dcerpc_samr_GetDisplayEnumerationIndex_r_done, req);
    9263             : 
    9264           0 :         return req;
    9265             : }
    9266             : 
    9267           0 : static void dcerpc_samr_GetDisplayEnumerationIndex_r_done(struct tevent_req *subreq)
    9268             : {
    9269           0 :         struct tevent_req *req =
    9270           0 :                 tevent_req_callback_data(subreq,
    9271             :                 struct tevent_req);
    9272             :         NTSTATUS status;
    9273             : 
    9274           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    9275           0 :         TALLOC_FREE(subreq);
    9276           0 :         if (tevent_req_nterror(req, status)) {
    9277           0 :                 return;
    9278             :         }
    9279             : 
    9280           0 :         tevent_req_done(req);
    9281             : }
    9282             : 
    9283           0 : NTSTATUS dcerpc_samr_GetDisplayEnumerationIndex_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    9284             : {
    9285           0 :         struct dcerpc_samr_GetDisplayEnumerationIndex_r_state *state =
    9286           0 :                 tevent_req_data(req,
    9287             :                 struct dcerpc_samr_GetDisplayEnumerationIndex_r_state);
    9288             :         NTSTATUS status;
    9289             : 
    9290           0 :         if (tevent_req_is_nterror(req, &status)) {
    9291           0 :                 tevent_req_received(req);
    9292           0 :                 return status;
    9293             :         }
    9294             : 
    9295           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    9296             : 
    9297           0 :         tevent_req_received(req);
    9298           0 :         return NT_STATUS_OK;
    9299             : }
    9300             : 
    9301          44 : NTSTATUS dcerpc_samr_GetDisplayEnumerationIndex_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_GetDisplayEnumerationIndex *r)
    9302             : {
    9303             :         NTSTATUS status;
    9304             : 
    9305          44 :         status = dcerpc_binding_handle_call(h,
    9306             :                         NULL, &ndr_table_samr,
    9307             :                         NDR_SAMR_GETDISPLAYENUMERATIONINDEX, mem_ctx, r);
    9308             : 
    9309          44 :         return status;
    9310             : }
    9311             : 
    9312             : struct dcerpc_samr_GetDisplayEnumerationIndex_state {
    9313             :         struct samr_GetDisplayEnumerationIndex orig;
    9314             :         struct samr_GetDisplayEnumerationIndex tmp;
    9315             :         TALLOC_CTX *out_mem_ctx;
    9316             : };
    9317             : 
    9318             : static void dcerpc_samr_GetDisplayEnumerationIndex_done(struct tevent_req *subreq);
    9319             : 
    9320           0 : struct tevent_req *dcerpc_samr_GetDisplayEnumerationIndex_send(TALLOC_CTX *mem_ctx,
    9321             :                                                                struct tevent_context *ev,
    9322             :                                                                struct dcerpc_binding_handle *h,
    9323             :                                                                struct policy_handle *_domain_handle /* [in] [ref] */,
    9324             :                                                                uint16_t _level /* [in]  */,
    9325             :                                                                struct lsa_String *_name /* [in] [ref] */,
    9326             :                                                                uint32_t *_idx /* [out] [ref] */)
    9327             : {
    9328             :         struct tevent_req *req;
    9329             :         struct dcerpc_samr_GetDisplayEnumerationIndex_state *state;
    9330             :         struct tevent_req *subreq;
    9331             : 
    9332           0 :         req = tevent_req_create(mem_ctx, &state,
    9333             :                                 struct dcerpc_samr_GetDisplayEnumerationIndex_state);
    9334           0 :         if (req == NULL) {
    9335           0 :                 return NULL;
    9336             :         }
    9337           0 :         state->out_mem_ctx = NULL;
    9338             : 
    9339             :         /* In parameters */
    9340           0 :         state->orig.in.domain_handle = _domain_handle;
    9341           0 :         state->orig.in.level = _level;
    9342           0 :         state->orig.in.name = _name;
    9343             : 
    9344             :         /* Out parameters */
    9345           0 :         state->orig.out.idx = _idx;
    9346             : 
    9347             :         /* Result */
    9348           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    9349             : 
    9350           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    9351             :                              "dcerpc_samr_GetDisplayEnumerationIndex_out_memory");
    9352           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    9353           0 :                 return tevent_req_post(req, ev);
    9354             :         }
    9355             : 
    9356             :         /* make a temporary copy, that we pass to the dispatch function */
    9357           0 :         state->tmp = state->orig;
    9358             : 
    9359           0 :         subreq = dcerpc_samr_GetDisplayEnumerationIndex_r_send(state, ev, h, &state->tmp);
    9360           0 :         if (tevent_req_nomem(subreq, req)) {
    9361           0 :                 return tevent_req_post(req, ev);
    9362             :         }
    9363           0 :         tevent_req_set_callback(subreq, dcerpc_samr_GetDisplayEnumerationIndex_done, req);
    9364           0 :         return req;
    9365             : }
    9366             : 
    9367           0 : static void dcerpc_samr_GetDisplayEnumerationIndex_done(struct tevent_req *subreq)
    9368             : {
    9369           0 :         struct tevent_req *req = tevent_req_callback_data(
    9370             :                 subreq, struct tevent_req);
    9371           0 :         struct dcerpc_samr_GetDisplayEnumerationIndex_state *state = tevent_req_data(
    9372             :                 req, struct dcerpc_samr_GetDisplayEnumerationIndex_state);
    9373             :         NTSTATUS status;
    9374             :         TALLOC_CTX *mem_ctx;
    9375             : 
    9376           0 :         if (state->out_mem_ctx) {
    9377           0 :                 mem_ctx = state->out_mem_ctx;
    9378             :         } else {
    9379           0 :                 mem_ctx = state;
    9380             :         }
    9381             : 
    9382           0 :         status = dcerpc_samr_GetDisplayEnumerationIndex_r_recv(subreq, mem_ctx);
    9383           0 :         TALLOC_FREE(subreq);
    9384           0 :         if (tevent_req_nterror(req, status)) {
    9385           0 :                 return;
    9386             :         }
    9387             : 
    9388             :         /* Copy out parameters */
    9389           0 :         *state->orig.out.idx = *state->tmp.out.idx;
    9390             : 
    9391             :         /* Copy result */
    9392           0 :         state->orig.out.result = state->tmp.out.result;
    9393             : 
    9394             :         /* Reset temporary structure */
    9395           0 :         NDR_ZERO_STRUCT(state->tmp);
    9396             : 
    9397           0 :         tevent_req_done(req);
    9398             : }
    9399             : 
    9400           0 : NTSTATUS dcerpc_samr_GetDisplayEnumerationIndex_recv(struct tevent_req *req,
    9401             :                                                      TALLOC_CTX *mem_ctx,
    9402             :                                                      NTSTATUS *result)
    9403             : {
    9404           0 :         struct dcerpc_samr_GetDisplayEnumerationIndex_state *state = tevent_req_data(
    9405             :                 req, struct dcerpc_samr_GetDisplayEnumerationIndex_state);
    9406             :         NTSTATUS status;
    9407             : 
    9408           0 :         if (tevent_req_is_nterror(req, &status)) {
    9409           0 :                 tevent_req_received(req);
    9410           0 :                 return status;
    9411             :         }
    9412             : 
    9413             :         /* Steal possible out parameters to the callers context */
    9414           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    9415             : 
    9416             :         /* Return result */
    9417           0 :         *result = state->orig.out.result;
    9418             : 
    9419           0 :         tevent_req_received(req);
    9420           0 :         return NT_STATUS_OK;
    9421             : }
    9422             : 
    9423           0 : NTSTATUS dcerpc_samr_GetDisplayEnumerationIndex(struct dcerpc_binding_handle *h,
    9424             :                                                 TALLOC_CTX *mem_ctx,
    9425             :                                                 struct policy_handle *_domain_handle /* [in] [ref] */,
    9426             :                                                 uint16_t _level /* [in]  */,
    9427             :                                                 struct lsa_String *_name /* [in] [ref] */,
    9428             :                                                 uint32_t *_idx /* [out] [ref] */,
    9429             :                                                 NTSTATUS *result)
    9430             : {
    9431             :         struct samr_GetDisplayEnumerationIndex r;
    9432             :         NTSTATUS status;
    9433             : 
    9434             :         /* In parameters */
    9435           0 :         r.in.domain_handle = _domain_handle;
    9436           0 :         r.in.level = _level;
    9437           0 :         r.in.name = _name;
    9438             : 
    9439             :         /* Out parameters */
    9440           0 :         r.out.idx = _idx;
    9441             : 
    9442             :         /* Result */
    9443           0 :         NDR_ZERO_STRUCT(r.out.result);
    9444             : 
    9445           0 :         status = dcerpc_samr_GetDisplayEnumerationIndex_r(h, mem_ctx, &r);
    9446           0 :         if (!NT_STATUS_IS_OK(status)) {
    9447           0 :                 return status;
    9448             :         }
    9449             : 
    9450             :         /* Return variables */
    9451           0 :         *_idx = *r.out.idx;
    9452             : 
    9453             :         /* Return result */
    9454           0 :         *result = r.out.result;
    9455             : 
    9456           0 :         return NT_STATUS_OK;
    9457             : }
    9458             : 
    9459             : struct dcerpc_samr_TestPrivateFunctionsDomain_r_state {
    9460             :         TALLOC_CTX *out_mem_ctx;
    9461             : };
    9462             : 
    9463             : static void dcerpc_samr_TestPrivateFunctionsDomain_r_done(struct tevent_req *subreq);
    9464             : 
    9465           0 : struct tevent_req *dcerpc_samr_TestPrivateFunctionsDomain_r_send(TALLOC_CTX *mem_ctx,
    9466             :         struct tevent_context *ev,
    9467             :         struct dcerpc_binding_handle *h,
    9468             :         struct samr_TestPrivateFunctionsDomain *r)
    9469             : {
    9470             :         struct tevent_req *req;
    9471             :         struct dcerpc_samr_TestPrivateFunctionsDomain_r_state *state;
    9472             :         struct tevent_req *subreq;
    9473             : 
    9474           0 :         req = tevent_req_create(mem_ctx, &state,
    9475             :                                 struct dcerpc_samr_TestPrivateFunctionsDomain_r_state);
    9476           0 :         if (req == NULL) {
    9477           0 :                 return NULL;
    9478             :         }
    9479             : 
    9480           0 :         state->out_mem_ctx = NULL;
    9481             : 
    9482           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    9483             :                         NULL, &ndr_table_samr,
    9484             :                         NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN, state, r);
    9485           0 :         if (tevent_req_nomem(subreq, req)) {
    9486           0 :                 return tevent_req_post(req, ev);
    9487             :         }
    9488           0 :         tevent_req_set_callback(subreq, dcerpc_samr_TestPrivateFunctionsDomain_r_done, req);
    9489             : 
    9490           0 :         return req;
    9491             : }
    9492             : 
    9493           0 : static void dcerpc_samr_TestPrivateFunctionsDomain_r_done(struct tevent_req *subreq)
    9494             : {
    9495           0 :         struct tevent_req *req =
    9496           0 :                 tevent_req_callback_data(subreq,
    9497             :                 struct tevent_req);
    9498             :         NTSTATUS status;
    9499             : 
    9500           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    9501           0 :         TALLOC_FREE(subreq);
    9502           0 :         if (tevent_req_nterror(req, status)) {
    9503           0 :                 return;
    9504             :         }
    9505             : 
    9506           0 :         tevent_req_done(req);
    9507             : }
    9508             : 
    9509           0 : NTSTATUS dcerpc_samr_TestPrivateFunctionsDomain_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    9510             : {
    9511           0 :         struct dcerpc_samr_TestPrivateFunctionsDomain_r_state *state =
    9512           0 :                 tevent_req_data(req,
    9513             :                 struct dcerpc_samr_TestPrivateFunctionsDomain_r_state);
    9514             :         NTSTATUS status;
    9515             : 
    9516           0 :         if (tevent_req_is_nterror(req, &status)) {
    9517           0 :                 tevent_req_received(req);
    9518           0 :                 return status;
    9519             :         }
    9520             : 
    9521           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    9522             : 
    9523           0 :         tevent_req_received(req);
    9524           0 :         return NT_STATUS_OK;
    9525             : }
    9526             : 
    9527          14 : NTSTATUS dcerpc_samr_TestPrivateFunctionsDomain_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_TestPrivateFunctionsDomain *r)
    9528             : {
    9529             :         NTSTATUS status;
    9530             : 
    9531          14 :         status = dcerpc_binding_handle_call(h,
    9532             :                         NULL, &ndr_table_samr,
    9533             :                         NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN, mem_ctx, r);
    9534             : 
    9535          14 :         return status;
    9536             : }
    9537             : 
    9538             : struct dcerpc_samr_TestPrivateFunctionsDomain_state {
    9539             :         struct samr_TestPrivateFunctionsDomain orig;
    9540             :         struct samr_TestPrivateFunctionsDomain tmp;
    9541             :         TALLOC_CTX *out_mem_ctx;
    9542             : };
    9543             : 
    9544             : static void dcerpc_samr_TestPrivateFunctionsDomain_done(struct tevent_req *subreq);
    9545             : 
    9546           0 : struct tevent_req *dcerpc_samr_TestPrivateFunctionsDomain_send(TALLOC_CTX *mem_ctx,
    9547             :                                                                struct tevent_context *ev,
    9548             :                                                                struct dcerpc_binding_handle *h,
    9549             :                                                                struct policy_handle *_domain_handle /* [in] [ref] */)
    9550             : {
    9551             :         struct tevent_req *req;
    9552             :         struct dcerpc_samr_TestPrivateFunctionsDomain_state *state;
    9553             :         struct tevent_req *subreq;
    9554             : 
    9555           0 :         req = tevent_req_create(mem_ctx, &state,
    9556             :                                 struct dcerpc_samr_TestPrivateFunctionsDomain_state);
    9557           0 :         if (req == NULL) {
    9558           0 :                 return NULL;
    9559             :         }
    9560           0 :         state->out_mem_ctx = NULL;
    9561             : 
    9562             :         /* In parameters */
    9563           0 :         state->orig.in.domain_handle = _domain_handle;
    9564             : 
    9565             :         /* Out parameters */
    9566             : 
    9567             :         /* Result */
    9568           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    9569             : 
    9570             :         /* make a temporary copy, that we pass to the dispatch function */
    9571           0 :         state->tmp = state->orig;
    9572             : 
    9573           0 :         subreq = dcerpc_samr_TestPrivateFunctionsDomain_r_send(state, ev, h, &state->tmp);
    9574           0 :         if (tevent_req_nomem(subreq, req)) {
    9575           0 :                 return tevent_req_post(req, ev);
    9576             :         }
    9577           0 :         tevent_req_set_callback(subreq, dcerpc_samr_TestPrivateFunctionsDomain_done, req);
    9578           0 :         return req;
    9579             : }
    9580             : 
    9581           0 : static void dcerpc_samr_TestPrivateFunctionsDomain_done(struct tevent_req *subreq)
    9582             : {
    9583           0 :         struct tevent_req *req = tevent_req_callback_data(
    9584             :                 subreq, struct tevent_req);
    9585           0 :         struct dcerpc_samr_TestPrivateFunctionsDomain_state *state = tevent_req_data(
    9586             :                 req, struct dcerpc_samr_TestPrivateFunctionsDomain_state);
    9587             :         NTSTATUS status;
    9588             :         TALLOC_CTX *mem_ctx;
    9589             : 
    9590           0 :         if (state->out_mem_ctx) {
    9591           0 :                 mem_ctx = state->out_mem_ctx;
    9592             :         } else {
    9593           0 :                 mem_ctx = state;
    9594             :         }
    9595             : 
    9596           0 :         status = dcerpc_samr_TestPrivateFunctionsDomain_r_recv(subreq, mem_ctx);
    9597           0 :         TALLOC_FREE(subreq);
    9598           0 :         if (tevent_req_nterror(req, status)) {
    9599           0 :                 return;
    9600             :         }
    9601             : 
    9602             :         /* Copy out parameters */
    9603             : 
    9604             :         /* Copy result */
    9605           0 :         state->orig.out.result = state->tmp.out.result;
    9606             : 
    9607             :         /* Reset temporary structure */
    9608           0 :         NDR_ZERO_STRUCT(state->tmp);
    9609             : 
    9610           0 :         tevent_req_done(req);
    9611             : }
    9612             : 
    9613           0 : NTSTATUS dcerpc_samr_TestPrivateFunctionsDomain_recv(struct tevent_req *req,
    9614             :                                                      TALLOC_CTX *mem_ctx,
    9615             :                                                      NTSTATUS *result)
    9616             : {
    9617           0 :         struct dcerpc_samr_TestPrivateFunctionsDomain_state *state = tevent_req_data(
    9618             :                 req, struct dcerpc_samr_TestPrivateFunctionsDomain_state);
    9619             :         NTSTATUS status;
    9620             : 
    9621           0 :         if (tevent_req_is_nterror(req, &status)) {
    9622           0 :                 tevent_req_received(req);
    9623           0 :                 return status;
    9624             :         }
    9625             : 
    9626             :         /* Steal possible out parameters to the callers context */
    9627           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    9628             : 
    9629             :         /* Return result */
    9630           0 :         *result = state->orig.out.result;
    9631             : 
    9632           0 :         tevent_req_received(req);
    9633           0 :         return NT_STATUS_OK;
    9634             : }
    9635             : 
    9636           0 : NTSTATUS dcerpc_samr_TestPrivateFunctionsDomain(struct dcerpc_binding_handle *h,
    9637             :                                                 TALLOC_CTX *mem_ctx,
    9638             :                                                 struct policy_handle *_domain_handle /* [in] [ref] */,
    9639             :                                                 NTSTATUS *result)
    9640             : {
    9641             :         struct samr_TestPrivateFunctionsDomain r;
    9642             :         NTSTATUS status;
    9643             : 
    9644             :         /* In parameters */
    9645           0 :         r.in.domain_handle = _domain_handle;
    9646             : 
    9647             :         /* Out parameters */
    9648             : 
    9649             :         /* Result */
    9650           0 :         NDR_ZERO_STRUCT(r.out.result);
    9651             : 
    9652           0 :         status = dcerpc_samr_TestPrivateFunctionsDomain_r(h, mem_ctx, &r);
    9653           0 :         if (!NT_STATUS_IS_OK(status)) {
    9654           0 :                 return status;
    9655             :         }
    9656             : 
    9657             :         /* Return variables */
    9658             : 
    9659             :         /* Return result */
    9660           0 :         *result = r.out.result;
    9661             : 
    9662           0 :         return NT_STATUS_OK;
    9663             : }
    9664             : 
    9665             : struct dcerpc_samr_TestPrivateFunctionsUser_r_state {
    9666             :         TALLOC_CTX *out_mem_ctx;
    9667             : };
    9668             : 
    9669             : static void dcerpc_samr_TestPrivateFunctionsUser_r_done(struct tevent_req *subreq);
    9670             : 
    9671           0 : struct tevent_req *dcerpc_samr_TestPrivateFunctionsUser_r_send(TALLOC_CTX *mem_ctx,
    9672             :         struct tevent_context *ev,
    9673             :         struct dcerpc_binding_handle *h,
    9674             :         struct samr_TestPrivateFunctionsUser *r)
    9675             : {
    9676             :         struct tevent_req *req;
    9677             :         struct dcerpc_samr_TestPrivateFunctionsUser_r_state *state;
    9678             :         struct tevent_req *subreq;
    9679             : 
    9680           0 :         req = tevent_req_create(mem_ctx, &state,
    9681             :                                 struct dcerpc_samr_TestPrivateFunctionsUser_r_state);
    9682           0 :         if (req == NULL) {
    9683           0 :                 return NULL;
    9684             :         }
    9685             : 
    9686           0 :         state->out_mem_ctx = NULL;
    9687             : 
    9688           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    9689             :                         NULL, &ndr_table_samr,
    9690             :                         NDR_SAMR_TESTPRIVATEFUNCTIONSUSER, state, r);
    9691           0 :         if (tevent_req_nomem(subreq, req)) {
    9692           0 :                 return tevent_req_post(req, ev);
    9693             :         }
    9694           0 :         tevent_req_set_callback(subreq, dcerpc_samr_TestPrivateFunctionsUser_r_done, req);
    9695             : 
    9696           0 :         return req;
    9697             : }
    9698             : 
    9699           0 : static void dcerpc_samr_TestPrivateFunctionsUser_r_done(struct tevent_req *subreq)
    9700             : {
    9701           0 :         struct tevent_req *req =
    9702           0 :                 tevent_req_callback_data(subreq,
    9703             :                 struct tevent_req);
    9704             :         NTSTATUS status;
    9705             : 
    9706           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    9707           0 :         TALLOC_FREE(subreq);
    9708           0 :         if (tevent_req_nterror(req, status)) {
    9709           0 :                 return;
    9710             :         }
    9711             : 
    9712           0 :         tevent_req_done(req);
    9713             : }
    9714             : 
    9715           0 : NTSTATUS dcerpc_samr_TestPrivateFunctionsUser_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    9716             : {
    9717           0 :         struct dcerpc_samr_TestPrivateFunctionsUser_r_state *state =
    9718           0 :                 tevent_req_data(req,
    9719             :                 struct dcerpc_samr_TestPrivateFunctionsUser_r_state);
    9720             :         NTSTATUS status;
    9721             : 
    9722           0 :         if (tevent_req_is_nterror(req, &status)) {
    9723           0 :                 tevent_req_received(req);
    9724           0 :                 return status;
    9725             :         }
    9726             : 
    9727           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    9728             : 
    9729           0 :         tevent_req_received(req);
    9730           0 :         return NT_STATUS_OK;
    9731             : }
    9732             : 
    9733          16 : NTSTATUS dcerpc_samr_TestPrivateFunctionsUser_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_TestPrivateFunctionsUser *r)
    9734             : {
    9735             :         NTSTATUS status;
    9736             : 
    9737          16 :         status = dcerpc_binding_handle_call(h,
    9738             :                         NULL, &ndr_table_samr,
    9739             :                         NDR_SAMR_TESTPRIVATEFUNCTIONSUSER, mem_ctx, r);
    9740             : 
    9741          16 :         return status;
    9742             : }
    9743             : 
    9744             : struct dcerpc_samr_TestPrivateFunctionsUser_state {
    9745             :         struct samr_TestPrivateFunctionsUser orig;
    9746             :         struct samr_TestPrivateFunctionsUser tmp;
    9747             :         TALLOC_CTX *out_mem_ctx;
    9748             : };
    9749             : 
    9750             : static void dcerpc_samr_TestPrivateFunctionsUser_done(struct tevent_req *subreq);
    9751             : 
    9752           0 : struct tevent_req *dcerpc_samr_TestPrivateFunctionsUser_send(TALLOC_CTX *mem_ctx,
    9753             :                                                              struct tevent_context *ev,
    9754             :                                                              struct dcerpc_binding_handle *h,
    9755             :                                                              struct policy_handle *_user_handle /* [in] [ref] */)
    9756             : {
    9757             :         struct tevent_req *req;
    9758             :         struct dcerpc_samr_TestPrivateFunctionsUser_state *state;
    9759             :         struct tevent_req *subreq;
    9760             : 
    9761           0 :         req = tevent_req_create(mem_ctx, &state,
    9762             :                                 struct dcerpc_samr_TestPrivateFunctionsUser_state);
    9763           0 :         if (req == NULL) {
    9764           0 :                 return NULL;
    9765             :         }
    9766           0 :         state->out_mem_ctx = NULL;
    9767             : 
    9768             :         /* In parameters */
    9769           0 :         state->orig.in.user_handle = _user_handle;
    9770             : 
    9771             :         /* Out parameters */
    9772             : 
    9773             :         /* Result */
    9774           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    9775             : 
    9776             :         /* make a temporary copy, that we pass to the dispatch function */
    9777           0 :         state->tmp = state->orig;
    9778             : 
    9779           0 :         subreq = dcerpc_samr_TestPrivateFunctionsUser_r_send(state, ev, h, &state->tmp);
    9780           0 :         if (tevent_req_nomem(subreq, req)) {
    9781           0 :                 return tevent_req_post(req, ev);
    9782             :         }
    9783           0 :         tevent_req_set_callback(subreq, dcerpc_samr_TestPrivateFunctionsUser_done, req);
    9784           0 :         return req;
    9785             : }
    9786             : 
    9787           0 : static void dcerpc_samr_TestPrivateFunctionsUser_done(struct tevent_req *subreq)
    9788             : {
    9789           0 :         struct tevent_req *req = tevent_req_callback_data(
    9790             :                 subreq, struct tevent_req);
    9791           0 :         struct dcerpc_samr_TestPrivateFunctionsUser_state *state = tevent_req_data(
    9792             :                 req, struct dcerpc_samr_TestPrivateFunctionsUser_state);
    9793             :         NTSTATUS status;
    9794             :         TALLOC_CTX *mem_ctx;
    9795             : 
    9796           0 :         if (state->out_mem_ctx) {
    9797           0 :                 mem_ctx = state->out_mem_ctx;
    9798             :         } else {
    9799           0 :                 mem_ctx = state;
    9800             :         }
    9801             : 
    9802           0 :         status = dcerpc_samr_TestPrivateFunctionsUser_r_recv(subreq, mem_ctx);
    9803           0 :         TALLOC_FREE(subreq);
    9804           0 :         if (tevent_req_nterror(req, status)) {
    9805           0 :                 return;
    9806             :         }
    9807             : 
    9808             :         /* Copy out parameters */
    9809             : 
    9810             :         /* Copy result */
    9811           0 :         state->orig.out.result = state->tmp.out.result;
    9812             : 
    9813             :         /* Reset temporary structure */
    9814           0 :         NDR_ZERO_STRUCT(state->tmp);
    9815             : 
    9816           0 :         tevent_req_done(req);
    9817             : }
    9818             : 
    9819           0 : NTSTATUS dcerpc_samr_TestPrivateFunctionsUser_recv(struct tevent_req *req,
    9820             :                                                    TALLOC_CTX *mem_ctx,
    9821             :                                                    NTSTATUS *result)
    9822             : {
    9823           0 :         struct dcerpc_samr_TestPrivateFunctionsUser_state *state = tevent_req_data(
    9824             :                 req, struct dcerpc_samr_TestPrivateFunctionsUser_state);
    9825             :         NTSTATUS status;
    9826             : 
    9827           0 :         if (tevent_req_is_nterror(req, &status)) {
    9828           0 :                 tevent_req_received(req);
    9829           0 :                 return status;
    9830             :         }
    9831             : 
    9832             :         /* Steal possible out parameters to the callers context */
    9833           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    9834             : 
    9835             :         /* Return result */
    9836           0 :         *result = state->orig.out.result;
    9837             : 
    9838           0 :         tevent_req_received(req);
    9839           0 :         return NT_STATUS_OK;
    9840             : }
    9841             : 
    9842           0 : NTSTATUS dcerpc_samr_TestPrivateFunctionsUser(struct dcerpc_binding_handle *h,
    9843             :                                               TALLOC_CTX *mem_ctx,
    9844             :                                               struct policy_handle *_user_handle /* [in] [ref] */,
    9845             :                                               NTSTATUS *result)
    9846             : {
    9847             :         struct samr_TestPrivateFunctionsUser r;
    9848             :         NTSTATUS status;
    9849             : 
    9850             :         /* In parameters */
    9851           0 :         r.in.user_handle = _user_handle;
    9852             : 
    9853             :         /* Out parameters */
    9854             : 
    9855             :         /* Result */
    9856           0 :         NDR_ZERO_STRUCT(r.out.result);
    9857             : 
    9858           0 :         status = dcerpc_samr_TestPrivateFunctionsUser_r(h, mem_ctx, &r);
    9859           0 :         if (!NT_STATUS_IS_OK(status)) {
    9860           0 :                 return status;
    9861             :         }
    9862             : 
    9863             :         /* Return variables */
    9864             : 
    9865             :         /* Return result */
    9866           0 :         *result = r.out.result;
    9867             : 
    9868           0 :         return NT_STATUS_OK;
    9869             : }
    9870             : 
    9871             : struct dcerpc_samr_GetUserPwInfo_r_state {
    9872             :         TALLOC_CTX *out_mem_ctx;
    9873             : };
    9874             : 
    9875             : static void dcerpc_samr_GetUserPwInfo_r_done(struct tevent_req *subreq);
    9876             : 
    9877           0 : struct tevent_req *dcerpc_samr_GetUserPwInfo_r_send(TALLOC_CTX *mem_ctx,
    9878             :         struct tevent_context *ev,
    9879             :         struct dcerpc_binding_handle *h,
    9880             :         struct samr_GetUserPwInfo *r)
    9881             : {
    9882             :         struct tevent_req *req;
    9883             :         struct dcerpc_samr_GetUserPwInfo_r_state *state;
    9884             :         struct tevent_req *subreq;
    9885             : 
    9886           0 :         req = tevent_req_create(mem_ctx, &state,
    9887             :                                 struct dcerpc_samr_GetUserPwInfo_r_state);
    9888           0 :         if (req == NULL) {
    9889           0 :                 return NULL;
    9890             :         }
    9891             : 
    9892           0 :         state->out_mem_ctx = talloc_new(state);
    9893           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    9894           0 :                 return tevent_req_post(req, ev);
    9895             :         }
    9896             : 
    9897           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    9898             :                         NULL, &ndr_table_samr,
    9899           0 :                         NDR_SAMR_GETUSERPWINFO, state->out_mem_ctx, r);
    9900           0 :         if (tevent_req_nomem(subreq, req)) {
    9901           0 :                 return tevent_req_post(req, ev);
    9902             :         }
    9903           0 :         tevent_req_set_callback(subreq, dcerpc_samr_GetUserPwInfo_r_done, req);
    9904             : 
    9905           0 :         return req;
    9906             : }
    9907             : 
    9908           0 : static void dcerpc_samr_GetUserPwInfo_r_done(struct tevent_req *subreq)
    9909             : {
    9910           0 :         struct tevent_req *req =
    9911           0 :                 tevent_req_callback_data(subreq,
    9912             :                 struct tevent_req);
    9913             :         NTSTATUS status;
    9914             : 
    9915           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    9916           0 :         TALLOC_FREE(subreq);
    9917           0 :         if (tevent_req_nterror(req, status)) {
    9918           0 :                 return;
    9919             :         }
    9920             : 
    9921           0 :         tevent_req_done(req);
    9922             : }
    9923             : 
    9924           0 : NTSTATUS dcerpc_samr_GetUserPwInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    9925             : {
    9926           0 :         struct dcerpc_samr_GetUserPwInfo_r_state *state =
    9927           0 :                 tevent_req_data(req,
    9928             :                 struct dcerpc_samr_GetUserPwInfo_r_state);
    9929             :         NTSTATUS status;
    9930             : 
    9931           0 :         if (tevent_req_is_nterror(req, &status)) {
    9932           0 :                 tevent_req_received(req);
    9933           0 :                 return status;
    9934             :         }
    9935             : 
    9936           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    9937             : 
    9938           0 :         tevent_req_received(req);
    9939           0 :         return NT_STATUS_OK;
    9940             : }
    9941             : 
    9942        1687 : NTSTATUS dcerpc_samr_GetUserPwInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_GetUserPwInfo *r)
    9943             : {
    9944             :         NTSTATUS status;
    9945             : 
    9946        1687 :         status = dcerpc_binding_handle_call(h,
    9947             :                         NULL, &ndr_table_samr,
    9948             :                         NDR_SAMR_GETUSERPWINFO, mem_ctx, r);
    9949             : 
    9950        1687 :         return status;
    9951             : }
    9952             : 
    9953             : struct dcerpc_samr_GetUserPwInfo_state {
    9954             :         struct samr_GetUserPwInfo orig;
    9955             :         struct samr_GetUserPwInfo tmp;
    9956             :         TALLOC_CTX *out_mem_ctx;
    9957             : };
    9958             : 
    9959             : static void dcerpc_samr_GetUserPwInfo_done(struct tevent_req *subreq);
    9960             : 
    9961           0 : struct tevent_req *dcerpc_samr_GetUserPwInfo_send(TALLOC_CTX *mem_ctx,
    9962             :                                                   struct tevent_context *ev,
    9963             :                                                   struct dcerpc_binding_handle *h,
    9964             :                                                   struct policy_handle *_user_handle /* [in] [ref] */,
    9965             :                                                   struct samr_PwInfo *_info /* [out] [ref] */)
    9966             : {
    9967             :         struct tevent_req *req;
    9968             :         struct dcerpc_samr_GetUserPwInfo_state *state;
    9969             :         struct tevent_req *subreq;
    9970             : 
    9971           0 :         req = tevent_req_create(mem_ctx, &state,
    9972             :                                 struct dcerpc_samr_GetUserPwInfo_state);
    9973           0 :         if (req == NULL) {
    9974           0 :                 return NULL;
    9975             :         }
    9976           0 :         state->out_mem_ctx = NULL;
    9977             : 
    9978             :         /* In parameters */
    9979           0 :         state->orig.in.user_handle = _user_handle;
    9980             : 
    9981             :         /* Out parameters */
    9982           0 :         state->orig.out.info = _info;
    9983             : 
    9984             :         /* Result */
    9985           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    9986             : 
    9987           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    9988             :                              "dcerpc_samr_GetUserPwInfo_out_memory");
    9989           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    9990           0 :                 return tevent_req_post(req, ev);
    9991             :         }
    9992             : 
    9993             :         /* make a temporary copy, that we pass to the dispatch function */
    9994           0 :         state->tmp = state->orig;
    9995             : 
    9996           0 :         subreq = dcerpc_samr_GetUserPwInfo_r_send(state, ev, h, &state->tmp);
    9997           0 :         if (tevent_req_nomem(subreq, req)) {
    9998           0 :                 return tevent_req_post(req, ev);
    9999             :         }
   10000           0 :         tevent_req_set_callback(subreq, dcerpc_samr_GetUserPwInfo_done, req);
   10001           0 :         return req;
   10002             : }
   10003             : 
   10004           0 : static void dcerpc_samr_GetUserPwInfo_done(struct tevent_req *subreq)
   10005             : {
   10006           0 :         struct tevent_req *req = tevent_req_callback_data(
   10007             :                 subreq, struct tevent_req);
   10008           0 :         struct dcerpc_samr_GetUserPwInfo_state *state = tevent_req_data(
   10009             :                 req, struct dcerpc_samr_GetUserPwInfo_state);
   10010             :         NTSTATUS status;
   10011             :         TALLOC_CTX *mem_ctx;
   10012             : 
   10013           0 :         if (state->out_mem_ctx) {
   10014           0 :                 mem_ctx = state->out_mem_ctx;
   10015             :         } else {
   10016           0 :                 mem_ctx = state;
   10017             :         }
   10018             : 
   10019           0 :         status = dcerpc_samr_GetUserPwInfo_r_recv(subreq, mem_ctx);
   10020           0 :         TALLOC_FREE(subreq);
   10021           0 :         if (tevent_req_nterror(req, status)) {
   10022           0 :                 return;
   10023             :         }
   10024             : 
   10025             :         /* Copy out parameters */
   10026           0 :         *state->orig.out.info = *state->tmp.out.info;
   10027             : 
   10028             :         /* Copy result */
   10029           0 :         state->orig.out.result = state->tmp.out.result;
   10030             : 
   10031             :         /* Reset temporary structure */
   10032           0 :         NDR_ZERO_STRUCT(state->tmp);
   10033             : 
   10034           0 :         tevent_req_done(req);
   10035             : }
   10036             : 
   10037           0 : NTSTATUS dcerpc_samr_GetUserPwInfo_recv(struct tevent_req *req,
   10038             :                                         TALLOC_CTX *mem_ctx,
   10039             :                                         NTSTATUS *result)
   10040             : {
   10041           0 :         struct dcerpc_samr_GetUserPwInfo_state *state = tevent_req_data(
   10042             :                 req, struct dcerpc_samr_GetUserPwInfo_state);
   10043             :         NTSTATUS status;
   10044             : 
   10045           0 :         if (tevent_req_is_nterror(req, &status)) {
   10046           0 :                 tevent_req_received(req);
   10047           0 :                 return status;
   10048             :         }
   10049             : 
   10050             :         /* Steal possible out parameters to the callers context */
   10051           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10052             : 
   10053             :         /* Return result */
   10054           0 :         *result = state->orig.out.result;
   10055             : 
   10056           0 :         tevent_req_received(req);
   10057           0 :         return NT_STATUS_OK;
   10058             : }
   10059             : 
   10060           6 : NTSTATUS dcerpc_samr_GetUserPwInfo(struct dcerpc_binding_handle *h,
   10061             :                                    TALLOC_CTX *mem_ctx,
   10062             :                                    struct policy_handle *_user_handle /* [in] [ref] */,
   10063             :                                    struct samr_PwInfo *_info /* [out] [ref] */,
   10064             :                                    NTSTATUS *result)
   10065             : {
   10066             :         struct samr_GetUserPwInfo r;
   10067             :         NTSTATUS status;
   10068             : 
   10069             :         /* In parameters */
   10070           6 :         r.in.user_handle = _user_handle;
   10071             : 
   10072             :         /* Out parameters */
   10073           6 :         r.out.info = _info;
   10074             : 
   10075             :         /* Result */
   10076           6 :         NDR_ZERO_STRUCT(r.out.result);
   10077             : 
   10078           6 :         status = dcerpc_samr_GetUserPwInfo_r(h, mem_ctx, &r);
   10079           6 :         if (!NT_STATUS_IS_OK(status)) {
   10080           0 :                 return status;
   10081             :         }
   10082             : 
   10083             :         /* Return variables */
   10084           6 :         *_info = *r.out.info;
   10085             : 
   10086             :         /* Return result */
   10087           6 :         *result = r.out.result;
   10088             : 
   10089           6 :         return NT_STATUS_OK;
   10090             : }
   10091             : 
   10092             : struct dcerpc_samr_RemoveMemberFromForeignDomain_r_state {
   10093             :         TALLOC_CTX *out_mem_ctx;
   10094             : };
   10095             : 
   10096             : static void dcerpc_samr_RemoveMemberFromForeignDomain_r_done(struct tevent_req *subreq);
   10097             : 
   10098           0 : struct tevent_req *dcerpc_samr_RemoveMemberFromForeignDomain_r_send(TALLOC_CTX *mem_ctx,
   10099             :         struct tevent_context *ev,
   10100             :         struct dcerpc_binding_handle *h,
   10101             :         struct samr_RemoveMemberFromForeignDomain *r)
   10102             : {
   10103             :         struct tevent_req *req;
   10104             :         struct dcerpc_samr_RemoveMemberFromForeignDomain_r_state *state;
   10105             :         struct tevent_req *subreq;
   10106             : 
   10107           0 :         req = tevent_req_create(mem_ctx, &state,
   10108             :                                 struct dcerpc_samr_RemoveMemberFromForeignDomain_r_state);
   10109           0 :         if (req == NULL) {
   10110           0 :                 return NULL;
   10111             :         }
   10112             : 
   10113           0 :         state->out_mem_ctx = NULL;
   10114             : 
   10115           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   10116             :                         NULL, &ndr_table_samr,
   10117             :                         NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN, state, r);
   10118           0 :         if (tevent_req_nomem(subreq, req)) {
   10119           0 :                 return tevent_req_post(req, ev);
   10120             :         }
   10121           0 :         tevent_req_set_callback(subreq, dcerpc_samr_RemoveMemberFromForeignDomain_r_done, req);
   10122             : 
   10123           0 :         return req;
   10124             : }
   10125             : 
   10126           0 : static void dcerpc_samr_RemoveMemberFromForeignDomain_r_done(struct tevent_req *subreq)
   10127             : {
   10128           0 :         struct tevent_req *req =
   10129           0 :                 tevent_req_callback_data(subreq,
   10130             :                 struct tevent_req);
   10131             :         NTSTATUS status;
   10132             : 
   10133           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   10134           0 :         TALLOC_FREE(subreq);
   10135           0 :         if (tevent_req_nterror(req, status)) {
   10136           0 :                 return;
   10137             :         }
   10138             : 
   10139           0 :         tevent_req_done(req);
   10140             : }
   10141             : 
   10142           0 : NTSTATUS dcerpc_samr_RemoveMemberFromForeignDomain_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   10143             : {
   10144           0 :         struct dcerpc_samr_RemoveMemberFromForeignDomain_r_state *state =
   10145           0 :                 tevent_req_data(req,
   10146             :                 struct dcerpc_samr_RemoveMemberFromForeignDomain_r_state);
   10147             :         NTSTATUS status;
   10148             : 
   10149           0 :         if (tevent_req_is_nterror(req, &status)) {
   10150           0 :                 tevent_req_received(req);
   10151           0 :                 return status;
   10152             :         }
   10153             : 
   10154           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10155             : 
   10156           0 :         tevent_req_received(req);
   10157           0 :         return NT_STATUS_OK;
   10158             : }
   10159             : 
   10160          20 : NTSTATUS dcerpc_samr_RemoveMemberFromForeignDomain_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_RemoveMemberFromForeignDomain *r)
   10161             : {
   10162             :         NTSTATUS status;
   10163             : 
   10164          20 :         status = dcerpc_binding_handle_call(h,
   10165             :                         NULL, &ndr_table_samr,
   10166             :                         NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN, mem_ctx, r);
   10167             : 
   10168          20 :         return status;
   10169             : }
   10170             : 
   10171             : struct dcerpc_samr_RemoveMemberFromForeignDomain_state {
   10172             :         struct samr_RemoveMemberFromForeignDomain orig;
   10173             :         struct samr_RemoveMemberFromForeignDomain tmp;
   10174             :         TALLOC_CTX *out_mem_ctx;
   10175             : };
   10176             : 
   10177             : static void dcerpc_samr_RemoveMemberFromForeignDomain_done(struct tevent_req *subreq);
   10178             : 
   10179           0 : struct tevent_req *dcerpc_samr_RemoveMemberFromForeignDomain_send(TALLOC_CTX *mem_ctx,
   10180             :                                                                   struct tevent_context *ev,
   10181             :                                                                   struct dcerpc_binding_handle *h,
   10182             :                                                                   struct policy_handle *_domain_handle /* [in] [ref] */,
   10183             :                                                                   struct dom_sid2 *_sid /* [in] [ref] */)
   10184             : {
   10185             :         struct tevent_req *req;
   10186             :         struct dcerpc_samr_RemoveMemberFromForeignDomain_state *state;
   10187             :         struct tevent_req *subreq;
   10188             : 
   10189           0 :         req = tevent_req_create(mem_ctx, &state,
   10190             :                                 struct dcerpc_samr_RemoveMemberFromForeignDomain_state);
   10191           0 :         if (req == NULL) {
   10192           0 :                 return NULL;
   10193             :         }
   10194           0 :         state->out_mem_ctx = NULL;
   10195             : 
   10196             :         /* In parameters */
   10197           0 :         state->orig.in.domain_handle = _domain_handle;
   10198           0 :         state->orig.in.sid = _sid;
   10199             : 
   10200             :         /* Out parameters */
   10201             : 
   10202             :         /* Result */
   10203           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   10204             : 
   10205             :         /* make a temporary copy, that we pass to the dispatch function */
   10206           0 :         state->tmp = state->orig;
   10207             : 
   10208           0 :         subreq = dcerpc_samr_RemoveMemberFromForeignDomain_r_send(state, ev, h, &state->tmp);
   10209           0 :         if (tevent_req_nomem(subreq, req)) {
   10210           0 :                 return tevent_req_post(req, ev);
   10211             :         }
   10212           0 :         tevent_req_set_callback(subreq, dcerpc_samr_RemoveMemberFromForeignDomain_done, req);
   10213           0 :         return req;
   10214             : }
   10215             : 
   10216           0 : static void dcerpc_samr_RemoveMemberFromForeignDomain_done(struct tevent_req *subreq)
   10217             : {
   10218           0 :         struct tevent_req *req = tevent_req_callback_data(
   10219             :                 subreq, struct tevent_req);
   10220           0 :         struct dcerpc_samr_RemoveMemberFromForeignDomain_state *state = tevent_req_data(
   10221             :                 req, struct dcerpc_samr_RemoveMemberFromForeignDomain_state);
   10222             :         NTSTATUS status;
   10223             :         TALLOC_CTX *mem_ctx;
   10224             : 
   10225           0 :         if (state->out_mem_ctx) {
   10226           0 :                 mem_ctx = state->out_mem_ctx;
   10227             :         } else {
   10228           0 :                 mem_ctx = state;
   10229             :         }
   10230             : 
   10231           0 :         status = dcerpc_samr_RemoveMemberFromForeignDomain_r_recv(subreq, mem_ctx);
   10232           0 :         TALLOC_FREE(subreq);
   10233           0 :         if (tevent_req_nterror(req, status)) {
   10234           0 :                 return;
   10235             :         }
   10236             : 
   10237             :         /* Copy out parameters */
   10238             : 
   10239             :         /* Copy result */
   10240           0 :         state->orig.out.result = state->tmp.out.result;
   10241             : 
   10242             :         /* Reset temporary structure */
   10243           0 :         NDR_ZERO_STRUCT(state->tmp);
   10244             : 
   10245           0 :         tevent_req_done(req);
   10246             : }
   10247             : 
   10248           0 : NTSTATUS dcerpc_samr_RemoveMemberFromForeignDomain_recv(struct tevent_req *req,
   10249             :                                                         TALLOC_CTX *mem_ctx,
   10250             :                                                         NTSTATUS *result)
   10251             : {
   10252           0 :         struct dcerpc_samr_RemoveMemberFromForeignDomain_state *state = tevent_req_data(
   10253             :                 req, struct dcerpc_samr_RemoveMemberFromForeignDomain_state);
   10254             :         NTSTATUS status;
   10255             : 
   10256           0 :         if (tevent_req_is_nterror(req, &status)) {
   10257           0 :                 tevent_req_received(req);
   10258           0 :                 return status;
   10259             :         }
   10260             : 
   10261             :         /* Steal possible out parameters to the callers context */
   10262           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10263             : 
   10264             :         /* Return result */
   10265           0 :         *result = state->orig.out.result;
   10266             : 
   10267           0 :         tevent_req_received(req);
   10268           0 :         return NT_STATUS_OK;
   10269             : }
   10270             : 
   10271           6 : NTSTATUS dcerpc_samr_RemoveMemberFromForeignDomain(struct dcerpc_binding_handle *h,
   10272             :                                                    TALLOC_CTX *mem_ctx,
   10273             :                                                    struct policy_handle *_domain_handle /* [in] [ref] */,
   10274             :                                                    struct dom_sid2 *_sid /* [in] [ref] */,
   10275             :                                                    NTSTATUS *result)
   10276             : {
   10277             :         struct samr_RemoveMemberFromForeignDomain r;
   10278             :         NTSTATUS status;
   10279             : 
   10280             :         /* In parameters */
   10281           6 :         r.in.domain_handle = _domain_handle;
   10282           6 :         r.in.sid = _sid;
   10283             : 
   10284             :         /* Out parameters */
   10285             : 
   10286             :         /* Result */
   10287           6 :         NDR_ZERO_STRUCT(r.out.result);
   10288             : 
   10289           6 :         status = dcerpc_samr_RemoveMemberFromForeignDomain_r(h, mem_ctx, &r);
   10290           6 :         if (!NT_STATUS_IS_OK(status)) {
   10291           0 :                 return status;
   10292             :         }
   10293             : 
   10294             :         /* Return variables */
   10295             : 
   10296             :         /* Return result */
   10297           6 :         *result = r.out.result;
   10298             : 
   10299           6 :         return NT_STATUS_OK;
   10300             : }
   10301             : 
   10302             : struct dcerpc_samr_QueryDomainInfo2_r_state {
   10303             :         TALLOC_CTX *out_mem_ctx;
   10304             : };
   10305             : 
   10306             : static void dcerpc_samr_QueryDomainInfo2_r_done(struct tevent_req *subreq);
   10307             : 
   10308           0 : struct tevent_req *dcerpc_samr_QueryDomainInfo2_r_send(TALLOC_CTX *mem_ctx,
   10309             :         struct tevent_context *ev,
   10310             :         struct dcerpc_binding_handle *h,
   10311             :         struct samr_QueryDomainInfo2 *r)
   10312             : {
   10313             :         struct tevent_req *req;
   10314             :         struct dcerpc_samr_QueryDomainInfo2_r_state *state;
   10315             :         struct tevent_req *subreq;
   10316             : 
   10317           0 :         req = tevent_req_create(mem_ctx, &state,
   10318             :                                 struct dcerpc_samr_QueryDomainInfo2_r_state);
   10319           0 :         if (req == NULL) {
   10320           0 :                 return NULL;
   10321             :         }
   10322             : 
   10323           0 :         state->out_mem_ctx = talloc_new(state);
   10324           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   10325           0 :                 return tevent_req_post(req, ev);
   10326             :         }
   10327             : 
   10328           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   10329             :                         NULL, &ndr_table_samr,
   10330           0 :                         NDR_SAMR_QUERYDOMAININFO2, state->out_mem_ctx, r);
   10331           0 :         if (tevent_req_nomem(subreq, req)) {
   10332           0 :                 return tevent_req_post(req, ev);
   10333             :         }
   10334           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryDomainInfo2_r_done, req);
   10335             : 
   10336           0 :         return req;
   10337             : }
   10338             : 
   10339           0 : static void dcerpc_samr_QueryDomainInfo2_r_done(struct tevent_req *subreq)
   10340             : {
   10341           0 :         struct tevent_req *req =
   10342           0 :                 tevent_req_callback_data(subreq,
   10343             :                 struct tevent_req);
   10344             :         NTSTATUS status;
   10345             : 
   10346           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   10347           0 :         TALLOC_FREE(subreq);
   10348           0 :         if (tevent_req_nterror(req, status)) {
   10349           0 :                 return;
   10350             :         }
   10351             : 
   10352           0 :         tevent_req_done(req);
   10353             : }
   10354             : 
   10355           0 : NTSTATUS dcerpc_samr_QueryDomainInfo2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   10356             : {
   10357           0 :         struct dcerpc_samr_QueryDomainInfo2_r_state *state =
   10358           0 :                 tevent_req_data(req,
   10359             :                 struct dcerpc_samr_QueryDomainInfo2_r_state);
   10360             :         NTSTATUS status;
   10361             : 
   10362           0 :         if (tevent_req_is_nterror(req, &status)) {
   10363           0 :                 tevent_req_received(req);
   10364           0 :                 return status;
   10365             :         }
   10366             : 
   10367           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10368             : 
   10369           0 :         tevent_req_received(req);
   10370           0 :         return NT_STATUS_OK;
   10371             : }
   10372             : 
   10373         239 : NTSTATUS dcerpc_samr_QueryDomainInfo2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_QueryDomainInfo2 *r)
   10374             : {
   10375             :         NTSTATUS status;
   10376             : 
   10377         239 :         status = dcerpc_binding_handle_call(h,
   10378             :                         NULL, &ndr_table_samr,
   10379             :                         NDR_SAMR_QUERYDOMAININFO2, mem_ctx, r);
   10380             : 
   10381         239 :         return status;
   10382             : }
   10383             : 
   10384             : struct dcerpc_samr_QueryDomainInfo2_state {
   10385             :         struct samr_QueryDomainInfo2 orig;
   10386             :         struct samr_QueryDomainInfo2 tmp;
   10387             :         TALLOC_CTX *out_mem_ctx;
   10388             : };
   10389             : 
   10390             : static void dcerpc_samr_QueryDomainInfo2_done(struct tevent_req *subreq);
   10391             : 
   10392           0 : struct tevent_req *dcerpc_samr_QueryDomainInfo2_send(TALLOC_CTX *mem_ctx,
   10393             :                                                      struct tevent_context *ev,
   10394             :                                                      struct dcerpc_binding_handle *h,
   10395             :                                                      struct policy_handle *_domain_handle /* [in] [ref] */,
   10396             :                                                      enum samr_DomainInfoClass _level /* [in]  */,
   10397             :                                                      union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */)
   10398             : {
   10399             :         struct tevent_req *req;
   10400             :         struct dcerpc_samr_QueryDomainInfo2_state *state;
   10401             :         struct tevent_req *subreq;
   10402             : 
   10403           0 :         req = tevent_req_create(mem_ctx, &state,
   10404             :                                 struct dcerpc_samr_QueryDomainInfo2_state);
   10405           0 :         if (req == NULL) {
   10406           0 :                 return NULL;
   10407             :         }
   10408           0 :         state->out_mem_ctx = NULL;
   10409             : 
   10410             :         /* In parameters */
   10411           0 :         state->orig.in.domain_handle = _domain_handle;
   10412           0 :         state->orig.in.level = _level;
   10413             : 
   10414             :         /* Out parameters */
   10415           0 :         state->orig.out.info = _info;
   10416             : 
   10417             :         /* Result */
   10418           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   10419             : 
   10420           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   10421             :                              "dcerpc_samr_QueryDomainInfo2_out_memory");
   10422           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   10423           0 :                 return tevent_req_post(req, ev);
   10424             :         }
   10425             : 
   10426             :         /* make a temporary copy, that we pass to the dispatch function */
   10427           0 :         state->tmp = state->orig;
   10428             : 
   10429           0 :         subreq = dcerpc_samr_QueryDomainInfo2_r_send(state, ev, h, &state->tmp);
   10430           0 :         if (tevent_req_nomem(subreq, req)) {
   10431           0 :                 return tevent_req_post(req, ev);
   10432             :         }
   10433           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryDomainInfo2_done, req);
   10434           0 :         return req;
   10435             : }
   10436             : 
   10437           0 : static void dcerpc_samr_QueryDomainInfo2_done(struct tevent_req *subreq)
   10438             : {
   10439           0 :         struct tevent_req *req = tevent_req_callback_data(
   10440             :                 subreq, struct tevent_req);
   10441           0 :         struct dcerpc_samr_QueryDomainInfo2_state *state = tevent_req_data(
   10442             :                 req, struct dcerpc_samr_QueryDomainInfo2_state);
   10443             :         NTSTATUS status;
   10444             :         TALLOC_CTX *mem_ctx;
   10445             : 
   10446           0 :         if (state->out_mem_ctx) {
   10447           0 :                 mem_ctx = state->out_mem_ctx;
   10448             :         } else {
   10449           0 :                 mem_ctx = state;
   10450             :         }
   10451             : 
   10452           0 :         status = dcerpc_samr_QueryDomainInfo2_r_recv(subreq, mem_ctx);
   10453           0 :         TALLOC_FREE(subreq);
   10454           0 :         if (tevent_req_nterror(req, status)) {
   10455           0 :                 return;
   10456             :         }
   10457             : 
   10458             :         /* Copy out parameters */
   10459           0 :         *state->orig.out.info = *state->tmp.out.info;
   10460             : 
   10461             :         /* Copy result */
   10462           0 :         state->orig.out.result = state->tmp.out.result;
   10463             : 
   10464             :         /* Reset temporary structure */
   10465           0 :         NDR_ZERO_STRUCT(state->tmp);
   10466             : 
   10467           0 :         tevent_req_done(req);
   10468             : }
   10469             : 
   10470           0 : NTSTATUS dcerpc_samr_QueryDomainInfo2_recv(struct tevent_req *req,
   10471             :                                            TALLOC_CTX *mem_ctx,
   10472             :                                            NTSTATUS *result)
   10473             : {
   10474           0 :         struct dcerpc_samr_QueryDomainInfo2_state *state = tevent_req_data(
   10475             :                 req, struct dcerpc_samr_QueryDomainInfo2_state);
   10476             :         NTSTATUS status;
   10477             : 
   10478           0 :         if (tevent_req_is_nterror(req, &status)) {
   10479           0 :                 tevent_req_received(req);
   10480           0 :                 return status;
   10481             :         }
   10482             : 
   10483             :         /* Steal possible out parameters to the callers context */
   10484           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10485             : 
   10486             :         /* Return result */
   10487           0 :         *result = state->orig.out.result;
   10488             : 
   10489           0 :         tevent_req_received(req);
   10490           0 :         return NT_STATUS_OK;
   10491             : }
   10492             : 
   10493           1 : NTSTATUS dcerpc_samr_QueryDomainInfo2(struct dcerpc_binding_handle *h,
   10494             :                                       TALLOC_CTX *mem_ctx,
   10495             :                                       struct policy_handle *_domain_handle /* [in] [ref] */,
   10496             :                                       enum samr_DomainInfoClass _level /* [in]  */,
   10497             :                                       union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */,
   10498             :                                       NTSTATUS *result)
   10499             : {
   10500             :         struct samr_QueryDomainInfo2 r;
   10501             :         NTSTATUS status;
   10502             : 
   10503             :         /* In parameters */
   10504           1 :         r.in.domain_handle = _domain_handle;
   10505           1 :         r.in.level = _level;
   10506             : 
   10507             :         /* Out parameters */
   10508           1 :         r.out.info = _info;
   10509             : 
   10510             :         /* Result */
   10511           1 :         NDR_ZERO_STRUCT(r.out.result);
   10512             : 
   10513           1 :         status = dcerpc_samr_QueryDomainInfo2_r(h, mem_ctx, &r);
   10514           1 :         if (!NT_STATUS_IS_OK(status)) {
   10515           0 :                 return status;
   10516             :         }
   10517             : 
   10518             :         /* Return variables */
   10519           1 :         *_info = *r.out.info;
   10520             : 
   10521             :         /* Return result */
   10522           1 :         *result = r.out.result;
   10523             : 
   10524           1 :         return NT_STATUS_OK;
   10525             : }
   10526             : 
   10527             : struct dcerpc_samr_QueryUserInfo2_r_state {
   10528             :         TALLOC_CTX *out_mem_ctx;
   10529             : };
   10530             : 
   10531             : static void dcerpc_samr_QueryUserInfo2_r_done(struct tevent_req *subreq);
   10532             : 
   10533           0 : struct tevent_req *dcerpc_samr_QueryUserInfo2_r_send(TALLOC_CTX *mem_ctx,
   10534             :         struct tevent_context *ev,
   10535             :         struct dcerpc_binding_handle *h,
   10536             :         struct samr_QueryUserInfo2 *r)
   10537             : {
   10538             :         struct tevent_req *req;
   10539             :         struct dcerpc_samr_QueryUserInfo2_r_state *state;
   10540             :         struct tevent_req *subreq;
   10541             : 
   10542           0 :         req = tevent_req_create(mem_ctx, &state,
   10543             :                                 struct dcerpc_samr_QueryUserInfo2_r_state);
   10544           0 :         if (req == NULL) {
   10545           0 :                 return NULL;
   10546             :         }
   10547             : 
   10548           0 :         state->out_mem_ctx = talloc_new(state);
   10549           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   10550           0 :                 return tevent_req_post(req, ev);
   10551             :         }
   10552             : 
   10553           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   10554             :                         NULL, &ndr_table_samr,
   10555           0 :                         NDR_SAMR_QUERYUSERINFO2, state->out_mem_ctx, r);
   10556           0 :         if (tevent_req_nomem(subreq, req)) {
   10557           0 :                 return tevent_req_post(req, ev);
   10558             :         }
   10559           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryUserInfo2_r_done, req);
   10560             : 
   10561           0 :         return req;
   10562             : }
   10563             : 
   10564           0 : static void dcerpc_samr_QueryUserInfo2_r_done(struct tevent_req *subreq)
   10565             : {
   10566           0 :         struct tevent_req *req =
   10567           0 :                 tevent_req_callback_data(subreq,
   10568             :                 struct tevent_req);
   10569             :         NTSTATUS status;
   10570             : 
   10571           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   10572           0 :         TALLOC_FREE(subreq);
   10573           0 :         if (tevent_req_nterror(req, status)) {
   10574           0 :                 return;
   10575             :         }
   10576             : 
   10577           0 :         tevent_req_done(req);
   10578             : }
   10579             : 
   10580           0 : NTSTATUS dcerpc_samr_QueryUserInfo2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   10581             : {
   10582           0 :         struct dcerpc_samr_QueryUserInfo2_r_state *state =
   10583           0 :                 tevent_req_data(req,
   10584             :                 struct dcerpc_samr_QueryUserInfo2_r_state);
   10585             :         NTSTATUS status;
   10586             : 
   10587           0 :         if (tevent_req_is_nterror(req, &status)) {
   10588           0 :                 tevent_req_received(req);
   10589           0 :                 return status;
   10590             :         }
   10591             : 
   10592           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10593             : 
   10594           0 :         tevent_req_received(req);
   10595           0 :         return NT_STATUS_OK;
   10596             : }
   10597             : 
   10598         444 : NTSTATUS dcerpc_samr_QueryUserInfo2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct samr_QueryUserInfo2 *r)
   10599             : {
   10600             :         NTSTATUS status;
   10601             : 
   10602         444 :         status = dcerpc_binding_handle_call(h,
   10603             :                         NULL, &ndr_table_samr,
   10604             :                         NDR_SAMR_QUERYUSERINFO2, mem_ctx, r);
   10605             : 
   10606         444 :         return status;
   10607             : }
   10608             : 
   10609             : struct dcerpc_samr_QueryUserInfo2_state {
   10610             :         struct samr_QueryUserInfo2 orig;
   10611             :         struct samr_QueryUserInfo2 tmp;
   10612             :         TALLOC_CTX *out_mem_ctx;
   10613             : };
   10614             : 
   10615             : static void dcerpc_samr_QueryUserInfo2_done(struct tevent_req *subreq);
   10616             : 
   10617           0 : struct tevent_req *dcerpc_samr_QueryUserInfo2_send(TALLOC_CTX *mem_ctx,
   10618             :                                                    struct tevent_context *ev,
   10619             :                                                    struct dcerpc_binding_handle *h,
   10620             :                                                    struct policy_handle *_user_handle /* [in] [ref] */,
   10621             :                                                    enum samr_UserInfoLevel _level /* [in]  */,
   10622             :                                                    union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */)
   10623             : {
   10624             :         struct tevent_req *req;
   10625             :         struct dcerpc_samr_QueryUserInfo2_state *state;
   10626             :         struct tevent_req *subreq;
   10627             : 
   10628           0 :         req = tevent_req_create(mem_ctx, &state,
   10629             :                                 struct dcerpc_samr_QueryUserInfo2_state);
   10630           0 :         if (req == NULL) {
   10631           0 :                 return NULL;
   10632             :         }
   10633           0 :         state->out_mem_ctx = NULL;
   10634             : 
   10635             :         /* In parameters */
   10636           0 :         state->orig.in.user_handle = _user_handle;
   10637           0 :         state->orig.in.level = _level;
   10638             : 
   10639             :         /* Out parameters */
   10640           0 :         state->orig.out.info = _info;
   10641             : 
   10642             :         /* Result */
   10643           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   10644             : 
   10645           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   10646             :                              "dcerpc_samr_QueryUserInfo2_out_memory");
   10647           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   10648           0 :                 return tevent_req_post(req, ev);
   10649             :         }
   10650             : 
   10651             :         /* make a temporary copy, that we pass to the dispatch function */
   10652           0 :         state->tmp = state->orig;
   10653             : 
   10654           0 :         subreq = dcerpc_samr_QueryUserInfo2_r_send(state, ev, h, &state->tmp);
   10655           0 :         if (tevent_req_nomem(subreq, req)) {
   10656           0 :                 return tevent_req_post(req, ev);
   10657             :         }
   10658           0 :         tevent_req_set_callback(subreq, dcerpc_samr_QueryUserInfo2_done, req);
   10659           0 :         return req;
   10660             : }
   10661             : 
   10662           0 : static void dcerpc_samr_QueryUserInfo2_done(struct tevent_req *subreq)
   10663             : {
   10664           0 :         struct tevent_req *req = tevent_req_callback_data(
   10665             :                 subreq, struct tevent_req);
   10666           0 :         struct dcerpc_samr_QueryUserInfo2_state *state = tevent_req_data(
   10667             :                 req, struct dcerpc_samr_QueryUserInfo2_state);
   10668             :         NTSTATUS status;
   10669             :         TALLOC_CTX *mem_ctx;
   10670             : 
   10671           0 :         if (state->out_mem_ctx) {
   10672           0 :                 mem_ctx = state->out_mem_ctx;
   10673             :         } else {
   10674           0 :                 mem_ctx = state;
   10675             :         }
   10676             : 
   10677           0 :         status = dcerpc_samr_QueryUserInfo2_r_recv(subreq, mem_ctx);
   10678           0 :         TALLOC_FREE(subreq);
   10679           0 :         if (tevent_req_nterror(req, status)) {
   10680           0 :                 return;
   10681             :         }
   10682             : 
   10683             :         /* Copy out parameters */
   10684           0 :         *state->orig.out.info = *state->tmp.out.info;
   10685             : 
   10686             :         /* Copy result */
   10687           0 :         state->orig.out.result = state->tmp.out.result;
   10688             : 
   10689             :         /* Reset temporary structure */
   10690           0 :         NDR_ZERO_STRUCT(state->tmp);
   10691             : 
   10692           0 :         tevent_req_done(req);
   10693             : }
   10694             : 
   10695           0 : NTSTATUS dcerpc_samr_QueryUserInfo2_recv(struct tevent_req *req,
   10696             :                                          TALLOC_CTX *mem_ctx,
   10697             :                                          NTSTATUS *result)
   10698             : {
   10699           0 :         struct dcerpc_samr_QueryUserInfo2_state *state = tevent_req_data(
   10700             :                 req, struct dcerpc_samr_QueryUserInfo2_state);
   10701             :         NTSTATUS status;
   10702             : 
   10703           0 :         if (tevent_req_is_nterror(req, &status)) {
   10704           0 :                 tevent_req_received(req);
   10705           0 :                 return status;
   10706             :         }
   10707             : 
   10708             :         /* Steal possible out parameters to the callers context */
   10709           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10710             : 
   10711             :         /* Return result */
   10712           0 :         *result = state->orig.out.result;
   10713             : 
   10714           0 :         tevent_req_received(req);
   10715           0 :         return NT_STATUS_OK;
   10716             : }
   10717             : 
   10718         120 : NTSTATUS dcerpc_samr_QueryUserInfo2(struct dcerpc_binding_handle *h,
   10719             :                                     TALLOC_CTX *mem_ctx,
   10720             :                                     struct policy_handle *_user_handle /* [in] [ref] */,
   10721             :                                     enum samr_UserInfoLevel _level /* [in]  */,
   10722             :                                     union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */,
   10723             :                                     NTSTATUS *result)
   10724             : {
   10725             :         struct samr_QueryUserInfo2 r;
   10726             :         NTSTATUS status;
   10727             : 
   10728             :         /* In parameters */
   10729         120 :         r.in.user_handle = _user_handle;
   10730         120 :         r.in.level = _level;
   10731             : 
   10732             :         /* Out parameters */
   10733         120 :         r.out.info = _info;
   10734             : 
   10735             :         /* Result */
   10736         120 :         NDR_ZERO_STRUCT(r.out.result);
   10737             : 
   10738         120 :         status = dcerpc_samr_QueryUserInfo2_r(h, mem_ctx, &r);
   10739         120 :         if (!NT_STATUS_IS_OK(status)) {
   10740           0 :                 return status;
   10741             :         }
   10742             : 
   10743             :         /* Return variables */
   10744         120 :         *_info = *r.out.info;
   10745             : 
   10746             :         /* Return result */
   10747         120 :         *result = r.out.result;
   10748             : 
   10749         120 :         return NT_STATUS_OK;
   10750             : }
   10751             : 
   10752             : struct dcerpc_samr_QueryDisplayInfo2_r_state {
   10753             :         TALLOC_CTX *out_mem_ctx;
   10754             : };
   10755             : 
   10756             : static void dcerpc_samr_QueryDisplayInfo2_r_done(struct tevent_req *subreq);
   10757             : 
   10758           0 : struct tevent_req *dcerpc_samr_QueryDisplayInfo2_r_send(TALLOC_CTX *mem_ctx,
   10759             :         struct tevent_context *ev,
   10760             :         struct dcerpc_binding_handle *h,
   10761             :         struct samr_QueryDisplayInfo2 *r)
   10762             : {
   10763             :         struct tevent_req *req;
   10764             :         struct dcerpc_samr_QueryDisplayInfo2_r_state *state;
   10765             :         struct tevent_req *subreq;
   10766             : 
   10767           0 :         req = tevent_req_create(mem_ctx, &state,