LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_winreg_c.c (source / functions) Hit Total Coverage
Test: coverage report for fix-15632 9995c5c2 Lines: 238 3673 6.5 %
Date: 2024-04-13 12:30:31 Functions: 30 288 10.4 %

          Line data    Source code
       1             : /* client functions auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include <tevent.h>
       5             : #include "lib/util/tevent_ntstatus.h"
       6             : #include "bin/default/librpc/gen_ndr/ndr_winreg.h"
       7             : #include "bin/default/librpc/gen_ndr/ndr_winreg_c.h"
       8             : 
       9             : /* winreg - client functions generated by pidl */
      10             : 
      11             : struct dcerpc_winreg_OpenHKCR_r_state {
      12             :         TALLOC_CTX *out_mem_ctx;
      13             : };
      14             : 
      15             : static void dcerpc_winreg_OpenHKCR_r_done(struct tevent_req *subreq);
      16             : 
      17           0 : struct tevent_req *dcerpc_winreg_OpenHKCR_r_send(TALLOC_CTX *mem_ctx,
      18             :         struct tevent_context *ev,
      19             :         struct dcerpc_binding_handle *h,
      20             :         struct winreg_OpenHKCR *r)
      21             : {
      22           0 :         struct tevent_req *req;
      23           0 :         struct dcerpc_winreg_OpenHKCR_r_state *state;
      24           0 :         struct tevent_req *subreq;
      25             : 
      26           0 :         req = tevent_req_create(mem_ctx, &state,
      27             :                                 struct dcerpc_winreg_OpenHKCR_r_state);
      28           0 :         if (req == NULL) {
      29           0 :                 return NULL;
      30             :         }
      31             : 
      32           0 :         state->out_mem_ctx = talloc_new(state);
      33           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
      34           0 :                 return tevent_req_post(req, ev);
      35             :         }
      36             : 
      37           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
      38             :                         NULL, &ndr_table_winreg,
      39           0 :                         NDR_WINREG_OPENHKCR, state->out_mem_ctx, r);
      40           0 :         if (tevent_req_nomem(subreq, req)) {
      41           0 :                 return tevent_req_post(req, ev);
      42             :         }
      43           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCR_r_done, req);
      44             : 
      45           0 :         return req;
      46             : }
      47             : 
      48           0 : static void dcerpc_winreg_OpenHKCR_r_done(struct tevent_req *subreq)
      49             : {
      50           0 :         struct tevent_req *req =
      51           0 :                 tevent_req_callback_data(subreq,
      52             :                 struct tevent_req);
      53           0 :         NTSTATUS status;
      54             : 
      55           0 :         status = dcerpc_binding_handle_call_recv(subreq);
      56           0 :         TALLOC_FREE(subreq);
      57           0 :         if (tevent_req_nterror(req, status)) {
      58           0 :                 return;
      59             :         }
      60             : 
      61           0 :         tevent_req_done(req);
      62             : }
      63             : 
      64           0 : NTSTATUS dcerpc_winreg_OpenHKCR_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
      65             : {
      66           0 :         struct dcerpc_winreg_OpenHKCR_r_state *state =
      67           0 :                 tevent_req_data(req,
      68             :                 struct dcerpc_winreg_OpenHKCR_r_state);
      69           0 :         NTSTATUS status;
      70             : 
      71           0 :         if (tevent_req_is_nterror(req, &status)) {
      72           0 :                 tevent_req_received(req);
      73           0 :                 return status;
      74             :         }
      75             : 
      76           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
      77             : 
      78           0 :         tevent_req_received(req);
      79           0 :         return NT_STATUS_OK;
      80             : }
      81             : 
      82          87 : NTSTATUS dcerpc_winreg_OpenHKCR_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKCR *r)
      83             : {
      84           0 :         NTSTATUS status;
      85             : 
      86          87 :         status = dcerpc_binding_handle_call(h,
      87             :                         NULL, &ndr_table_winreg,
      88             :                         NDR_WINREG_OPENHKCR, mem_ctx, r);
      89             : 
      90          87 :         return status;
      91             : }
      92             : 
      93             : struct dcerpc_winreg_OpenHKCR_state {
      94             :         struct winreg_OpenHKCR orig;
      95             :         struct winreg_OpenHKCR tmp;
      96             :         TALLOC_CTX *out_mem_ctx;
      97             : };
      98             : 
      99             : static void dcerpc_winreg_OpenHKCR_done(struct tevent_req *subreq);
     100             : 
     101           0 : struct tevent_req *dcerpc_winreg_OpenHKCR_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 *_handle /* [out] [ref] */)
     107             : {
     108           0 :         struct tevent_req *req;
     109           0 :         struct dcerpc_winreg_OpenHKCR_state *state;
     110           0 :         struct tevent_req *subreq;
     111             : 
     112           0 :         req = tevent_req_create(mem_ctx, &state,
     113             :                                 struct dcerpc_winreg_OpenHKCR_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.handle = _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_winreg_OpenHKCR_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_winreg_OpenHKCR_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_winreg_OpenHKCR_done, req);
     143           0 :         return req;
     144             : }
     145             : 
     146           0 : static void dcerpc_winreg_OpenHKCR_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_winreg_OpenHKCR_state *state = tevent_req_data(
     151             :                 req, struct dcerpc_winreg_OpenHKCR_state);
     152           0 :         NTSTATUS status;
     153           0 :         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_winreg_OpenHKCR_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.handle = *state->tmp.out.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_winreg_OpenHKCR_recv(struct tevent_req *req,
     180             :                                      TALLOC_CTX *mem_ctx,
     181             :                                      WERROR *result)
     182             : {
     183           0 :         struct dcerpc_winreg_OpenHKCR_state *state = tevent_req_data(
     184             :                 req, struct dcerpc_winreg_OpenHKCR_state);
     185           0 :         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_winreg_OpenHKCR(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 *_handle /* [out] [ref] */,
     207             :                                 WERROR *result)
     208             : {
     209           0 :         struct winreg_OpenHKCR r;
     210           0 :         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.handle = _handle;
     218             : 
     219             :         /* Result */
     220           0 :         NDR_ZERO_STRUCT(r.out.result);
     221             : 
     222           0 :         status = dcerpc_winreg_OpenHKCR_r(h, mem_ctx, &r);
     223           0 :         if (!NT_STATUS_IS_OK(status)) {
     224           0 :                 return status;
     225             :         }
     226             : 
     227             :         /* Return variables */
     228           0 :         *_handle = *r.out.handle;
     229             : 
     230             :         /* Return result */
     231           0 :         *result = r.out.result;
     232             : 
     233           0 :         return NT_STATUS_OK;
     234             : }
     235             : 
     236             : struct dcerpc_winreg_OpenHKCU_r_state {
     237             :         TALLOC_CTX *out_mem_ctx;
     238             : };
     239             : 
     240             : static void dcerpc_winreg_OpenHKCU_r_done(struct tevent_req *subreq);
     241             : 
     242           0 : struct tevent_req *dcerpc_winreg_OpenHKCU_r_send(TALLOC_CTX *mem_ctx,
     243             :         struct tevent_context *ev,
     244             :         struct dcerpc_binding_handle *h,
     245             :         struct winreg_OpenHKCU *r)
     246             : {
     247           0 :         struct tevent_req *req;
     248           0 :         struct dcerpc_winreg_OpenHKCU_r_state *state;
     249           0 :         struct tevent_req *subreq;
     250             : 
     251           0 :         req = tevent_req_create(mem_ctx, &state,
     252             :                                 struct dcerpc_winreg_OpenHKCU_r_state);
     253           0 :         if (req == NULL) {
     254           0 :                 return NULL;
     255             :         }
     256             : 
     257           0 :         state->out_mem_ctx = talloc_new(state);
     258           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     259           0 :                 return tevent_req_post(req, ev);
     260             :         }
     261             : 
     262           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     263             :                         NULL, &ndr_table_winreg,
     264           0 :                         NDR_WINREG_OPENHKCU, state->out_mem_ctx, r);
     265           0 :         if (tevent_req_nomem(subreq, req)) {
     266           0 :                 return tevent_req_post(req, ev);
     267             :         }
     268           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCU_r_done, req);
     269             : 
     270           0 :         return req;
     271             : }
     272             : 
     273           0 : static void dcerpc_winreg_OpenHKCU_r_done(struct tevent_req *subreq)
     274             : {
     275           0 :         struct tevent_req *req =
     276           0 :                 tevent_req_callback_data(subreq,
     277             :                 struct tevent_req);
     278           0 :         NTSTATUS status;
     279             : 
     280           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     281           0 :         TALLOC_FREE(subreq);
     282           0 :         if (tevent_req_nterror(req, status)) {
     283           0 :                 return;
     284             :         }
     285             : 
     286           0 :         tevent_req_done(req);
     287             : }
     288             : 
     289           0 : NTSTATUS dcerpc_winreg_OpenHKCU_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     290             : {
     291           0 :         struct dcerpc_winreg_OpenHKCU_r_state *state =
     292           0 :                 tevent_req_data(req,
     293             :                 struct dcerpc_winreg_OpenHKCU_r_state);
     294           0 :         NTSTATUS status;
     295             : 
     296           0 :         if (tevent_req_is_nterror(req, &status)) {
     297           0 :                 tevent_req_received(req);
     298           0 :                 return status;
     299             :         }
     300             : 
     301           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     302             : 
     303           0 :         tevent_req_received(req);
     304           0 :         return NT_STATUS_OK;
     305             : }
     306             : 
     307          87 : NTSTATUS dcerpc_winreg_OpenHKCU_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKCU *r)
     308             : {
     309           0 :         NTSTATUS status;
     310             : 
     311          87 :         status = dcerpc_binding_handle_call(h,
     312             :                         NULL, &ndr_table_winreg,
     313             :                         NDR_WINREG_OPENHKCU, mem_ctx, r);
     314             : 
     315          87 :         return status;
     316             : }
     317             : 
     318             : struct dcerpc_winreg_OpenHKCU_state {
     319             :         struct winreg_OpenHKCU orig;
     320             :         struct winreg_OpenHKCU tmp;
     321             :         TALLOC_CTX *out_mem_ctx;
     322             : };
     323             : 
     324             : static void dcerpc_winreg_OpenHKCU_done(struct tevent_req *subreq);
     325             : 
     326           0 : struct tevent_req *dcerpc_winreg_OpenHKCU_send(TALLOC_CTX *mem_ctx,
     327             :                                                struct tevent_context *ev,
     328             :                                                struct dcerpc_binding_handle *h,
     329             :                                                uint16_t *_system_name /* [in] [unique] */,
     330             :                                                uint32_t _access_mask /* [in]  */,
     331             :                                                struct policy_handle *_handle /* [out] [ref] */)
     332             : {
     333           0 :         struct tevent_req *req;
     334           0 :         struct dcerpc_winreg_OpenHKCU_state *state;
     335           0 :         struct tevent_req *subreq;
     336             : 
     337           0 :         req = tevent_req_create(mem_ctx, &state,
     338             :                                 struct dcerpc_winreg_OpenHKCU_state);
     339           0 :         if (req == NULL) {
     340           0 :                 return NULL;
     341             :         }
     342           0 :         state->out_mem_ctx = NULL;
     343             : 
     344             :         /* In parameters */
     345           0 :         state->orig.in.system_name = _system_name;
     346           0 :         state->orig.in.access_mask = _access_mask;
     347             : 
     348             :         /* Out parameters */
     349           0 :         state->orig.out.handle = _handle;
     350             : 
     351             :         /* Result */
     352           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     353             : 
     354           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     355             :                              "dcerpc_winreg_OpenHKCU_out_memory");
     356           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     357           0 :                 return tevent_req_post(req, ev);
     358             :         }
     359             : 
     360             :         /* make a temporary copy, that we pass to the dispatch function */
     361           0 :         state->tmp = state->orig;
     362             : 
     363           0 :         subreq = dcerpc_winreg_OpenHKCU_r_send(state, ev, h, &state->tmp);
     364           0 :         if (tevent_req_nomem(subreq, req)) {
     365           0 :                 return tevent_req_post(req, ev);
     366             :         }
     367           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCU_done, req);
     368           0 :         return req;
     369             : }
     370             : 
     371           0 : static void dcerpc_winreg_OpenHKCU_done(struct tevent_req *subreq)
     372             : {
     373           0 :         struct tevent_req *req = tevent_req_callback_data(
     374             :                 subreq, struct tevent_req);
     375           0 :         struct dcerpc_winreg_OpenHKCU_state *state = tevent_req_data(
     376             :                 req, struct dcerpc_winreg_OpenHKCU_state);
     377           0 :         NTSTATUS status;
     378           0 :         TALLOC_CTX *mem_ctx;
     379             : 
     380           0 :         if (state->out_mem_ctx) {
     381           0 :                 mem_ctx = state->out_mem_ctx;
     382             :         } else {
     383           0 :                 mem_ctx = state;
     384             :         }
     385             : 
     386           0 :         status = dcerpc_winreg_OpenHKCU_r_recv(subreq, mem_ctx);
     387           0 :         TALLOC_FREE(subreq);
     388           0 :         if (tevent_req_nterror(req, status)) {
     389           0 :                 return;
     390             :         }
     391             : 
     392             :         /* Copy out parameters */
     393           0 :         *state->orig.out.handle = *state->tmp.out.handle;
     394             : 
     395             :         /* Copy result */
     396           0 :         state->orig.out.result = state->tmp.out.result;
     397             : 
     398             :         /* Reset temporary structure */
     399           0 :         NDR_ZERO_STRUCT(state->tmp);
     400             : 
     401           0 :         tevent_req_done(req);
     402             : }
     403             : 
     404           0 : NTSTATUS dcerpc_winreg_OpenHKCU_recv(struct tevent_req *req,
     405             :                                      TALLOC_CTX *mem_ctx,
     406             :                                      WERROR *result)
     407             : {
     408           0 :         struct dcerpc_winreg_OpenHKCU_state *state = tevent_req_data(
     409             :                 req, struct dcerpc_winreg_OpenHKCU_state);
     410           0 :         NTSTATUS status;
     411             : 
     412           0 :         if (tevent_req_is_nterror(req, &status)) {
     413           0 :                 tevent_req_received(req);
     414           0 :                 return status;
     415             :         }
     416             : 
     417             :         /* Steal possible out parameters to the callers context */
     418           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     419             : 
     420             :         /* Return result */
     421           0 :         *result = state->orig.out.result;
     422             : 
     423           0 :         tevent_req_received(req);
     424           0 :         return NT_STATUS_OK;
     425             : }
     426             : 
     427           0 : NTSTATUS dcerpc_winreg_OpenHKCU(struct dcerpc_binding_handle *h,
     428             :                                 TALLOC_CTX *mem_ctx,
     429             :                                 uint16_t *_system_name /* [in] [unique] */,
     430             :                                 uint32_t _access_mask /* [in]  */,
     431             :                                 struct policy_handle *_handle /* [out] [ref] */,
     432             :                                 WERROR *result)
     433             : {
     434           0 :         struct winreg_OpenHKCU r;
     435           0 :         NTSTATUS status;
     436             : 
     437             :         /* In parameters */
     438           0 :         r.in.system_name = _system_name;
     439           0 :         r.in.access_mask = _access_mask;
     440             : 
     441             :         /* Out parameters */
     442           0 :         r.out.handle = _handle;
     443             : 
     444             :         /* Result */
     445           0 :         NDR_ZERO_STRUCT(r.out.result);
     446             : 
     447           0 :         status = dcerpc_winreg_OpenHKCU_r(h, mem_ctx, &r);
     448           0 :         if (!NT_STATUS_IS_OK(status)) {
     449           0 :                 return status;
     450             :         }
     451             : 
     452             :         /* Return variables */
     453           0 :         *_handle = *r.out.handle;
     454             : 
     455             :         /* Return result */
     456           0 :         *result = r.out.result;
     457             : 
     458           0 :         return NT_STATUS_OK;
     459             : }
     460             : 
     461             : struct dcerpc_winreg_OpenHKLM_r_state {
     462             :         TALLOC_CTX *out_mem_ctx;
     463             : };
     464             : 
     465             : static void dcerpc_winreg_OpenHKLM_r_done(struct tevent_req *subreq);
     466             : 
     467           0 : struct tevent_req *dcerpc_winreg_OpenHKLM_r_send(TALLOC_CTX *mem_ctx,
     468             :         struct tevent_context *ev,
     469             :         struct dcerpc_binding_handle *h,
     470             :         struct winreg_OpenHKLM *r)
     471             : {
     472           0 :         struct tevent_req *req;
     473           0 :         struct dcerpc_winreg_OpenHKLM_r_state *state;
     474           0 :         struct tevent_req *subreq;
     475             : 
     476           0 :         req = tevent_req_create(mem_ctx, &state,
     477             :                                 struct dcerpc_winreg_OpenHKLM_r_state);
     478           0 :         if (req == NULL) {
     479           0 :                 return NULL;
     480             :         }
     481             : 
     482           0 :         state->out_mem_ctx = talloc_new(state);
     483           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     484           0 :                 return tevent_req_post(req, ev);
     485             :         }
     486             : 
     487           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     488             :                         NULL, &ndr_table_winreg,
     489           0 :                         NDR_WINREG_OPENHKLM, state->out_mem_ctx, r);
     490           0 :         if (tevent_req_nomem(subreq, req)) {
     491           0 :                 return tevent_req_post(req, ev);
     492             :         }
     493           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKLM_r_done, req);
     494             : 
     495           0 :         return req;
     496             : }
     497             : 
     498           0 : static void dcerpc_winreg_OpenHKLM_r_done(struct tevent_req *subreq)
     499             : {
     500           0 :         struct tevent_req *req =
     501           0 :                 tevent_req_callback_data(subreq,
     502             :                 struct tevent_req);
     503           0 :         NTSTATUS status;
     504             : 
     505           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     506           0 :         TALLOC_FREE(subreq);
     507           0 :         if (tevent_req_nterror(req, status)) {
     508           0 :                 return;
     509             :         }
     510             : 
     511           0 :         tevent_req_done(req);
     512             : }
     513             : 
     514           0 : NTSTATUS dcerpc_winreg_OpenHKLM_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     515             : {
     516           0 :         struct dcerpc_winreg_OpenHKLM_r_state *state =
     517           0 :                 tevent_req_data(req,
     518             :                 struct dcerpc_winreg_OpenHKLM_r_state);
     519           0 :         NTSTATUS status;
     520             : 
     521           0 :         if (tevent_req_is_nterror(req, &status)) {
     522           0 :                 tevent_req_received(req);
     523           0 :                 return status;
     524             :         }
     525             : 
     526           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     527             : 
     528           0 :         tevent_req_received(req);
     529           0 :         return NT_STATUS_OK;
     530             : }
     531             : 
     532       44560 : NTSTATUS dcerpc_winreg_OpenHKLM_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKLM *r)
     533             : {
     534           0 :         NTSTATUS status;
     535             : 
     536       44560 :         status = dcerpc_binding_handle_call(h,
     537             :                         NULL, &ndr_table_winreg,
     538             :                         NDR_WINREG_OPENHKLM, mem_ctx, r);
     539             : 
     540       44560 :         return status;
     541             : }
     542             : 
     543             : struct dcerpc_winreg_OpenHKLM_state {
     544             :         struct winreg_OpenHKLM orig;
     545             :         struct winreg_OpenHKLM tmp;
     546             :         TALLOC_CTX *out_mem_ctx;
     547             : };
     548             : 
     549             : static void dcerpc_winreg_OpenHKLM_done(struct tevent_req *subreq);
     550             : 
     551           0 : struct tevent_req *dcerpc_winreg_OpenHKLM_send(TALLOC_CTX *mem_ctx,
     552             :                                                struct tevent_context *ev,
     553             :                                                struct dcerpc_binding_handle *h,
     554             :                                                uint16_t *_system_name /* [in] [unique] */,
     555             :                                                uint32_t _access_mask /* [in]  */,
     556             :                                                struct policy_handle *_handle /* [out] [ref] */)
     557             : {
     558           0 :         struct tevent_req *req;
     559           0 :         struct dcerpc_winreg_OpenHKLM_state *state;
     560           0 :         struct tevent_req *subreq;
     561             : 
     562           0 :         req = tevent_req_create(mem_ctx, &state,
     563             :                                 struct dcerpc_winreg_OpenHKLM_state);
     564           0 :         if (req == NULL) {
     565           0 :                 return NULL;
     566             :         }
     567           0 :         state->out_mem_ctx = NULL;
     568             : 
     569             :         /* In parameters */
     570           0 :         state->orig.in.system_name = _system_name;
     571           0 :         state->orig.in.access_mask = _access_mask;
     572             : 
     573             :         /* Out parameters */
     574           0 :         state->orig.out.handle = _handle;
     575             : 
     576             :         /* Result */
     577           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     578             : 
     579           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     580             :                              "dcerpc_winreg_OpenHKLM_out_memory");
     581           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     582           0 :                 return tevent_req_post(req, ev);
     583             :         }
     584             : 
     585             :         /* make a temporary copy, that we pass to the dispatch function */
     586           0 :         state->tmp = state->orig;
     587             : 
     588           0 :         subreq = dcerpc_winreg_OpenHKLM_r_send(state, ev, h, &state->tmp);
     589           0 :         if (tevent_req_nomem(subreq, req)) {
     590           0 :                 return tevent_req_post(req, ev);
     591             :         }
     592           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKLM_done, req);
     593           0 :         return req;
     594             : }
     595             : 
     596           0 : static void dcerpc_winreg_OpenHKLM_done(struct tevent_req *subreq)
     597             : {
     598           0 :         struct tevent_req *req = tevent_req_callback_data(
     599             :                 subreq, struct tevent_req);
     600           0 :         struct dcerpc_winreg_OpenHKLM_state *state = tevent_req_data(
     601             :                 req, struct dcerpc_winreg_OpenHKLM_state);
     602           0 :         NTSTATUS status;
     603           0 :         TALLOC_CTX *mem_ctx;
     604             : 
     605           0 :         if (state->out_mem_ctx) {
     606           0 :                 mem_ctx = state->out_mem_ctx;
     607             :         } else {
     608           0 :                 mem_ctx = state;
     609             :         }
     610             : 
     611           0 :         status = dcerpc_winreg_OpenHKLM_r_recv(subreq, mem_ctx);
     612           0 :         TALLOC_FREE(subreq);
     613           0 :         if (tevent_req_nterror(req, status)) {
     614           0 :                 return;
     615             :         }
     616             : 
     617             :         /* Copy out parameters */
     618           0 :         *state->orig.out.handle = *state->tmp.out.handle;
     619             : 
     620             :         /* Copy result */
     621           0 :         state->orig.out.result = state->tmp.out.result;
     622             : 
     623             :         /* Reset temporary structure */
     624           0 :         NDR_ZERO_STRUCT(state->tmp);
     625             : 
     626           0 :         tevent_req_done(req);
     627             : }
     628             : 
     629           0 : NTSTATUS dcerpc_winreg_OpenHKLM_recv(struct tevent_req *req,
     630             :                                      TALLOC_CTX *mem_ctx,
     631             :                                      WERROR *result)
     632             : {
     633           0 :         struct dcerpc_winreg_OpenHKLM_state *state = tevent_req_data(
     634             :                 req, struct dcerpc_winreg_OpenHKLM_state);
     635           0 :         NTSTATUS status;
     636             : 
     637           0 :         if (tevent_req_is_nterror(req, &status)) {
     638           0 :                 tevent_req_received(req);
     639           0 :                 return status;
     640             :         }
     641             : 
     642             :         /* Steal possible out parameters to the callers context */
     643           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     644             : 
     645             :         /* Return result */
     646           0 :         *result = state->orig.out.result;
     647             : 
     648           0 :         tevent_req_received(req);
     649           0 :         return NT_STATUS_OK;
     650             : }
     651             : 
     652       44418 : NTSTATUS dcerpc_winreg_OpenHKLM(struct dcerpc_binding_handle *h,
     653             :                                 TALLOC_CTX *mem_ctx,
     654             :                                 uint16_t *_system_name /* [in] [unique] */,
     655             :                                 uint32_t _access_mask /* [in]  */,
     656             :                                 struct policy_handle *_handle /* [out] [ref] */,
     657             :                                 WERROR *result)
     658             : {
     659           0 :         struct winreg_OpenHKLM r;
     660           0 :         NTSTATUS status;
     661             : 
     662             :         /* In parameters */
     663       44418 :         r.in.system_name = _system_name;
     664       44418 :         r.in.access_mask = _access_mask;
     665             : 
     666             :         /* Out parameters */
     667       44418 :         r.out.handle = _handle;
     668             : 
     669             :         /* Result */
     670       44418 :         NDR_ZERO_STRUCT(r.out.result);
     671             : 
     672       44418 :         status = dcerpc_winreg_OpenHKLM_r(h, mem_ctx, &r);
     673       44418 :         if (!NT_STATUS_IS_OK(status)) {
     674           0 :                 return status;
     675             :         }
     676             : 
     677             :         /* Return variables */
     678       44418 :         *_handle = *r.out.handle;
     679             : 
     680             :         /* Return result */
     681       44418 :         *result = r.out.result;
     682             : 
     683       44418 :         return NT_STATUS_OK;
     684             : }
     685             : 
     686             : struct dcerpc_winreg_OpenHKPD_r_state {
     687             :         TALLOC_CTX *out_mem_ctx;
     688             : };
     689             : 
     690             : static void dcerpc_winreg_OpenHKPD_r_done(struct tevent_req *subreq);
     691             : 
     692           0 : struct tevent_req *dcerpc_winreg_OpenHKPD_r_send(TALLOC_CTX *mem_ctx,
     693             :         struct tevent_context *ev,
     694             :         struct dcerpc_binding_handle *h,
     695             :         struct winreg_OpenHKPD *r)
     696             : {
     697           0 :         struct tevent_req *req;
     698           0 :         struct dcerpc_winreg_OpenHKPD_r_state *state;
     699           0 :         struct tevent_req *subreq;
     700             : 
     701           0 :         req = tevent_req_create(mem_ctx, &state,
     702             :                                 struct dcerpc_winreg_OpenHKPD_r_state);
     703           0 :         if (req == NULL) {
     704           0 :                 return NULL;
     705             :         }
     706             : 
     707           0 :         state->out_mem_ctx = talloc_new(state);
     708           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     709           0 :                 return tevent_req_post(req, ev);
     710             :         }
     711             : 
     712           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     713             :                         NULL, &ndr_table_winreg,
     714           0 :                         NDR_WINREG_OPENHKPD, state->out_mem_ctx, r);
     715           0 :         if (tevent_req_nomem(subreq, req)) {
     716           0 :                 return tevent_req_post(req, ev);
     717             :         }
     718           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPD_r_done, req);
     719             : 
     720           0 :         return req;
     721             : }
     722             : 
     723           0 : static void dcerpc_winreg_OpenHKPD_r_done(struct tevent_req *subreq)
     724             : {
     725           0 :         struct tevent_req *req =
     726           0 :                 tevent_req_callback_data(subreq,
     727             :                 struct tevent_req);
     728           0 :         NTSTATUS status;
     729             : 
     730           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     731           0 :         TALLOC_FREE(subreq);
     732           0 :         if (tevent_req_nterror(req, status)) {
     733           0 :                 return;
     734             :         }
     735             : 
     736           0 :         tevent_req_done(req);
     737             : }
     738             : 
     739           0 : NTSTATUS dcerpc_winreg_OpenHKPD_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     740             : {
     741           0 :         struct dcerpc_winreg_OpenHKPD_r_state *state =
     742           0 :                 tevent_req_data(req,
     743             :                 struct dcerpc_winreg_OpenHKPD_r_state);
     744           0 :         NTSTATUS status;
     745             : 
     746           0 :         if (tevent_req_is_nterror(req, &status)) {
     747           0 :                 tevent_req_received(req);
     748           0 :                 return status;
     749             :         }
     750             : 
     751           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     752             : 
     753           0 :         tevent_req_received(req);
     754           0 :         return NT_STATUS_OK;
     755             : }
     756             : 
     757           0 : NTSTATUS dcerpc_winreg_OpenHKPD_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKPD *r)
     758             : {
     759           0 :         NTSTATUS status;
     760             : 
     761           0 :         status = dcerpc_binding_handle_call(h,
     762             :                         NULL, &ndr_table_winreg,
     763             :                         NDR_WINREG_OPENHKPD, mem_ctx, r);
     764             : 
     765           0 :         return status;
     766             : }
     767             : 
     768             : struct dcerpc_winreg_OpenHKPD_state {
     769             :         struct winreg_OpenHKPD orig;
     770             :         struct winreg_OpenHKPD tmp;
     771             :         TALLOC_CTX *out_mem_ctx;
     772             : };
     773             : 
     774             : static void dcerpc_winreg_OpenHKPD_done(struct tevent_req *subreq);
     775             : 
     776           0 : struct tevent_req *dcerpc_winreg_OpenHKPD_send(TALLOC_CTX *mem_ctx,
     777             :                                                struct tevent_context *ev,
     778             :                                                struct dcerpc_binding_handle *h,
     779             :                                                uint16_t *_system_name /* [in] [unique] */,
     780             :                                                uint32_t _access_mask /* [in]  */,
     781             :                                                struct policy_handle *_handle /* [out] [ref] */)
     782             : {
     783           0 :         struct tevent_req *req;
     784           0 :         struct dcerpc_winreg_OpenHKPD_state *state;
     785           0 :         struct tevent_req *subreq;
     786             : 
     787           0 :         req = tevent_req_create(mem_ctx, &state,
     788             :                                 struct dcerpc_winreg_OpenHKPD_state);
     789           0 :         if (req == NULL) {
     790           0 :                 return NULL;
     791             :         }
     792           0 :         state->out_mem_ctx = NULL;
     793             : 
     794             :         /* In parameters */
     795           0 :         state->orig.in.system_name = _system_name;
     796           0 :         state->orig.in.access_mask = _access_mask;
     797             : 
     798             :         /* Out parameters */
     799           0 :         state->orig.out.handle = _handle;
     800             : 
     801             :         /* Result */
     802           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
     803             : 
     804           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
     805             :                              "dcerpc_winreg_OpenHKPD_out_memory");
     806           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     807           0 :                 return tevent_req_post(req, ev);
     808             :         }
     809             : 
     810             :         /* make a temporary copy, that we pass to the dispatch function */
     811           0 :         state->tmp = state->orig;
     812             : 
     813           0 :         subreq = dcerpc_winreg_OpenHKPD_r_send(state, ev, h, &state->tmp);
     814           0 :         if (tevent_req_nomem(subreq, req)) {
     815           0 :                 return tevent_req_post(req, ev);
     816             :         }
     817           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPD_done, req);
     818           0 :         return req;
     819             : }
     820             : 
     821           0 : static void dcerpc_winreg_OpenHKPD_done(struct tevent_req *subreq)
     822             : {
     823           0 :         struct tevent_req *req = tevent_req_callback_data(
     824             :                 subreq, struct tevent_req);
     825           0 :         struct dcerpc_winreg_OpenHKPD_state *state = tevent_req_data(
     826             :                 req, struct dcerpc_winreg_OpenHKPD_state);
     827           0 :         NTSTATUS status;
     828           0 :         TALLOC_CTX *mem_ctx;
     829             : 
     830           0 :         if (state->out_mem_ctx) {
     831           0 :                 mem_ctx = state->out_mem_ctx;
     832             :         } else {
     833           0 :                 mem_ctx = state;
     834             :         }
     835             : 
     836           0 :         status = dcerpc_winreg_OpenHKPD_r_recv(subreq, mem_ctx);
     837           0 :         TALLOC_FREE(subreq);
     838           0 :         if (tevent_req_nterror(req, status)) {
     839           0 :                 return;
     840             :         }
     841             : 
     842             :         /* Copy out parameters */
     843           0 :         *state->orig.out.handle = *state->tmp.out.handle;
     844             : 
     845             :         /* Copy result */
     846           0 :         state->orig.out.result = state->tmp.out.result;
     847             : 
     848             :         /* Reset temporary structure */
     849           0 :         NDR_ZERO_STRUCT(state->tmp);
     850             : 
     851           0 :         tevent_req_done(req);
     852             : }
     853             : 
     854           0 : NTSTATUS dcerpc_winreg_OpenHKPD_recv(struct tevent_req *req,
     855             :                                      TALLOC_CTX *mem_ctx,
     856             :                                      WERROR *result)
     857             : {
     858           0 :         struct dcerpc_winreg_OpenHKPD_state *state = tevent_req_data(
     859             :                 req, struct dcerpc_winreg_OpenHKPD_state);
     860           0 :         NTSTATUS status;
     861             : 
     862           0 :         if (tevent_req_is_nterror(req, &status)) {
     863           0 :                 tevent_req_received(req);
     864           0 :                 return status;
     865             :         }
     866             : 
     867             :         /* Steal possible out parameters to the callers context */
     868           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     869             : 
     870             :         /* Return result */
     871           0 :         *result = state->orig.out.result;
     872             : 
     873           0 :         tevent_req_received(req);
     874           0 :         return NT_STATUS_OK;
     875             : }
     876             : 
     877           0 : NTSTATUS dcerpc_winreg_OpenHKPD(struct dcerpc_binding_handle *h,
     878             :                                 TALLOC_CTX *mem_ctx,
     879             :                                 uint16_t *_system_name /* [in] [unique] */,
     880             :                                 uint32_t _access_mask /* [in]  */,
     881             :                                 struct policy_handle *_handle /* [out] [ref] */,
     882             :                                 WERROR *result)
     883             : {
     884           0 :         struct winreg_OpenHKPD r;
     885           0 :         NTSTATUS status;
     886             : 
     887             :         /* In parameters */
     888           0 :         r.in.system_name = _system_name;
     889           0 :         r.in.access_mask = _access_mask;
     890             : 
     891             :         /* Out parameters */
     892           0 :         r.out.handle = _handle;
     893             : 
     894             :         /* Result */
     895           0 :         NDR_ZERO_STRUCT(r.out.result);
     896             : 
     897           0 :         status = dcerpc_winreg_OpenHKPD_r(h, mem_ctx, &r);
     898           0 :         if (!NT_STATUS_IS_OK(status)) {
     899           0 :                 return status;
     900             :         }
     901             : 
     902             :         /* Return variables */
     903           0 :         *_handle = *r.out.handle;
     904             : 
     905             :         /* Return result */
     906           0 :         *result = r.out.result;
     907             : 
     908           0 :         return NT_STATUS_OK;
     909             : }
     910             : 
     911             : struct dcerpc_winreg_OpenHKU_r_state {
     912             :         TALLOC_CTX *out_mem_ctx;
     913             : };
     914             : 
     915             : static void dcerpc_winreg_OpenHKU_r_done(struct tevent_req *subreq);
     916             : 
     917           0 : struct tevent_req *dcerpc_winreg_OpenHKU_r_send(TALLOC_CTX *mem_ctx,
     918             :         struct tevent_context *ev,
     919             :         struct dcerpc_binding_handle *h,
     920             :         struct winreg_OpenHKU *r)
     921             : {
     922           0 :         struct tevent_req *req;
     923           0 :         struct dcerpc_winreg_OpenHKU_r_state *state;
     924           0 :         struct tevent_req *subreq;
     925             : 
     926           0 :         req = tevent_req_create(mem_ctx, &state,
     927             :                                 struct dcerpc_winreg_OpenHKU_r_state);
     928           0 :         if (req == NULL) {
     929           0 :                 return NULL;
     930             :         }
     931             : 
     932           0 :         state->out_mem_ctx = talloc_new(state);
     933           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
     934           0 :                 return tevent_req_post(req, ev);
     935             :         }
     936             : 
     937           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
     938             :                         NULL, &ndr_table_winreg,
     939           0 :                         NDR_WINREG_OPENHKU, state->out_mem_ctx, r);
     940           0 :         if (tevent_req_nomem(subreq, req)) {
     941           0 :                 return tevent_req_post(req, ev);
     942             :         }
     943           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKU_r_done, req);
     944             : 
     945           0 :         return req;
     946             : }
     947             : 
     948           0 : static void dcerpc_winreg_OpenHKU_r_done(struct tevent_req *subreq)
     949             : {
     950           0 :         struct tevent_req *req =
     951           0 :                 tevent_req_callback_data(subreq,
     952             :                 struct tevent_req);
     953           0 :         NTSTATUS status;
     954             : 
     955           0 :         status = dcerpc_binding_handle_call_recv(subreq);
     956           0 :         TALLOC_FREE(subreq);
     957           0 :         if (tevent_req_nterror(req, status)) {
     958           0 :                 return;
     959             :         }
     960             : 
     961           0 :         tevent_req_done(req);
     962             : }
     963             : 
     964           0 : NTSTATUS dcerpc_winreg_OpenHKU_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
     965             : {
     966           0 :         struct dcerpc_winreg_OpenHKU_r_state *state =
     967           0 :                 tevent_req_data(req,
     968             :                 struct dcerpc_winreg_OpenHKU_r_state);
     969           0 :         NTSTATUS status;
     970             : 
     971           0 :         if (tevent_req_is_nterror(req, &status)) {
     972           0 :                 tevent_req_received(req);
     973           0 :                 return status;
     974             :         }
     975             : 
     976           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
     977             : 
     978           0 :         tevent_req_received(req);
     979           0 :         return NT_STATUS_OK;
     980             : }
     981             : 
     982          87 : NTSTATUS dcerpc_winreg_OpenHKU_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKU *r)
     983             : {
     984           0 :         NTSTATUS status;
     985             : 
     986          87 :         status = dcerpc_binding_handle_call(h,
     987             :                         NULL, &ndr_table_winreg,
     988             :                         NDR_WINREG_OPENHKU, mem_ctx, r);
     989             : 
     990          87 :         return status;
     991             : }
     992             : 
     993             : struct dcerpc_winreg_OpenHKU_state {
     994             :         struct winreg_OpenHKU orig;
     995             :         struct winreg_OpenHKU tmp;
     996             :         TALLOC_CTX *out_mem_ctx;
     997             : };
     998             : 
     999             : static void dcerpc_winreg_OpenHKU_done(struct tevent_req *subreq);
    1000             : 
    1001           0 : struct tevent_req *dcerpc_winreg_OpenHKU_send(TALLOC_CTX *mem_ctx,
    1002             :                                               struct tevent_context *ev,
    1003             :                                               struct dcerpc_binding_handle *h,
    1004             :                                               uint16_t *_system_name /* [in] [unique] */,
    1005             :                                               uint32_t _access_mask /* [in]  */,
    1006             :                                               struct policy_handle *_handle /* [out] [ref] */)
    1007             : {
    1008           0 :         struct tevent_req *req;
    1009           0 :         struct dcerpc_winreg_OpenHKU_state *state;
    1010           0 :         struct tevent_req *subreq;
    1011             : 
    1012           0 :         req = tevent_req_create(mem_ctx, &state,
    1013             :                                 struct dcerpc_winreg_OpenHKU_state);
    1014           0 :         if (req == NULL) {
    1015           0 :                 return NULL;
    1016             :         }
    1017           0 :         state->out_mem_ctx = NULL;
    1018             : 
    1019             :         /* In parameters */
    1020           0 :         state->orig.in.system_name = _system_name;
    1021           0 :         state->orig.in.access_mask = _access_mask;
    1022             : 
    1023             :         /* Out parameters */
    1024           0 :         state->orig.out.handle = _handle;
    1025             : 
    1026             :         /* Result */
    1027           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1028             : 
    1029           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1030             :                              "dcerpc_winreg_OpenHKU_out_memory");
    1031           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1032           0 :                 return tevent_req_post(req, ev);
    1033             :         }
    1034             : 
    1035             :         /* make a temporary copy, that we pass to the dispatch function */
    1036           0 :         state->tmp = state->orig;
    1037             : 
    1038           0 :         subreq = dcerpc_winreg_OpenHKU_r_send(state, ev, h, &state->tmp);
    1039           0 :         if (tevent_req_nomem(subreq, req)) {
    1040           0 :                 return tevent_req_post(req, ev);
    1041             :         }
    1042           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKU_done, req);
    1043           0 :         return req;
    1044             : }
    1045             : 
    1046           0 : static void dcerpc_winreg_OpenHKU_done(struct tevent_req *subreq)
    1047             : {
    1048           0 :         struct tevent_req *req = tevent_req_callback_data(
    1049             :                 subreq, struct tevent_req);
    1050           0 :         struct dcerpc_winreg_OpenHKU_state *state = tevent_req_data(
    1051             :                 req, struct dcerpc_winreg_OpenHKU_state);
    1052           0 :         NTSTATUS status;
    1053           0 :         TALLOC_CTX *mem_ctx;
    1054             : 
    1055           0 :         if (state->out_mem_ctx) {
    1056           0 :                 mem_ctx = state->out_mem_ctx;
    1057             :         } else {
    1058           0 :                 mem_ctx = state;
    1059             :         }
    1060             : 
    1061           0 :         status = dcerpc_winreg_OpenHKU_r_recv(subreq, mem_ctx);
    1062           0 :         TALLOC_FREE(subreq);
    1063           0 :         if (tevent_req_nterror(req, status)) {
    1064           0 :                 return;
    1065             :         }
    1066             : 
    1067             :         /* Copy out parameters */
    1068           0 :         *state->orig.out.handle = *state->tmp.out.handle;
    1069             : 
    1070             :         /* Copy result */
    1071           0 :         state->orig.out.result = state->tmp.out.result;
    1072             : 
    1073             :         /* Reset temporary structure */
    1074           0 :         NDR_ZERO_STRUCT(state->tmp);
    1075             : 
    1076           0 :         tevent_req_done(req);
    1077             : }
    1078             : 
    1079           0 : NTSTATUS dcerpc_winreg_OpenHKU_recv(struct tevent_req *req,
    1080             :                                     TALLOC_CTX *mem_ctx,
    1081             :                                     WERROR *result)
    1082             : {
    1083           0 :         struct dcerpc_winreg_OpenHKU_state *state = tevent_req_data(
    1084             :                 req, struct dcerpc_winreg_OpenHKU_state);
    1085           0 :         NTSTATUS status;
    1086             : 
    1087           0 :         if (tevent_req_is_nterror(req, &status)) {
    1088           0 :                 tevent_req_received(req);
    1089           0 :                 return status;
    1090             :         }
    1091             : 
    1092             :         /* Steal possible out parameters to the callers context */
    1093           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1094             : 
    1095             :         /* Return result */
    1096           0 :         *result = state->orig.out.result;
    1097             : 
    1098           0 :         tevent_req_received(req);
    1099           0 :         return NT_STATUS_OK;
    1100             : }
    1101             : 
    1102           0 : NTSTATUS dcerpc_winreg_OpenHKU(struct dcerpc_binding_handle *h,
    1103             :                                TALLOC_CTX *mem_ctx,
    1104             :                                uint16_t *_system_name /* [in] [unique] */,
    1105             :                                uint32_t _access_mask /* [in]  */,
    1106             :                                struct policy_handle *_handle /* [out] [ref] */,
    1107             :                                WERROR *result)
    1108             : {
    1109           0 :         struct winreg_OpenHKU r;
    1110           0 :         NTSTATUS status;
    1111             : 
    1112             :         /* In parameters */
    1113           0 :         r.in.system_name = _system_name;
    1114           0 :         r.in.access_mask = _access_mask;
    1115             : 
    1116             :         /* Out parameters */
    1117           0 :         r.out.handle = _handle;
    1118             : 
    1119             :         /* Result */
    1120           0 :         NDR_ZERO_STRUCT(r.out.result);
    1121             : 
    1122           0 :         status = dcerpc_winreg_OpenHKU_r(h, mem_ctx, &r);
    1123           0 :         if (!NT_STATUS_IS_OK(status)) {
    1124           0 :                 return status;
    1125             :         }
    1126             : 
    1127             :         /* Return variables */
    1128           0 :         *_handle = *r.out.handle;
    1129             : 
    1130             :         /* Return result */
    1131           0 :         *result = r.out.result;
    1132             : 
    1133           0 :         return NT_STATUS_OK;
    1134             : }
    1135             : 
    1136             : struct dcerpc_winreg_CloseKey_r_state {
    1137             :         TALLOC_CTX *out_mem_ctx;
    1138             : };
    1139             : 
    1140             : static void dcerpc_winreg_CloseKey_r_done(struct tevent_req *subreq);
    1141             : 
    1142           0 : struct tevent_req *dcerpc_winreg_CloseKey_r_send(TALLOC_CTX *mem_ctx,
    1143             :         struct tevent_context *ev,
    1144             :         struct dcerpc_binding_handle *h,
    1145             :         struct winreg_CloseKey *r)
    1146             : {
    1147           0 :         struct tevent_req *req;
    1148           0 :         struct dcerpc_winreg_CloseKey_r_state *state;
    1149           0 :         struct tevent_req *subreq;
    1150             : 
    1151           0 :         req = tevent_req_create(mem_ctx, &state,
    1152             :                                 struct dcerpc_winreg_CloseKey_r_state);
    1153           0 :         if (req == NULL) {
    1154           0 :                 return NULL;
    1155             :         }
    1156             : 
    1157           0 :         state->out_mem_ctx = talloc_new(state);
    1158           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1159           0 :                 return tevent_req_post(req, ev);
    1160             :         }
    1161             : 
    1162           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1163             :                         NULL, &ndr_table_winreg,
    1164           0 :                         NDR_WINREG_CLOSEKEY, state->out_mem_ctx, r);
    1165           0 :         if (tevent_req_nomem(subreq, req)) {
    1166           0 :                 return tevent_req_post(req, ev);
    1167             :         }
    1168           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_CloseKey_r_done, req);
    1169             : 
    1170           0 :         return req;
    1171             : }
    1172             : 
    1173           0 : static void dcerpc_winreg_CloseKey_r_done(struct tevent_req *subreq)
    1174             : {
    1175           0 :         struct tevent_req *req =
    1176           0 :                 tevent_req_callback_data(subreq,
    1177             :                 struct tevent_req);
    1178           0 :         NTSTATUS status;
    1179             : 
    1180           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1181           0 :         TALLOC_FREE(subreq);
    1182           0 :         if (tevent_req_nterror(req, status)) {
    1183           0 :                 return;
    1184             :         }
    1185             : 
    1186           0 :         tevent_req_done(req);
    1187             : }
    1188             : 
    1189           0 : NTSTATUS dcerpc_winreg_CloseKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1190             : {
    1191           0 :         struct dcerpc_winreg_CloseKey_r_state *state =
    1192           0 :                 tevent_req_data(req,
    1193             :                 struct dcerpc_winreg_CloseKey_r_state);
    1194           0 :         NTSTATUS status;
    1195             : 
    1196           0 :         if (tevent_req_is_nterror(req, &status)) {
    1197           0 :                 tevent_req_received(req);
    1198           0 :                 return status;
    1199             :         }
    1200             : 
    1201           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1202             : 
    1203           0 :         tevent_req_received(req);
    1204           0 :         return NT_STATUS_OK;
    1205             : }
    1206             : 
    1207       90906 : NTSTATUS dcerpc_winreg_CloseKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_CloseKey *r)
    1208             : {
    1209           0 :         NTSTATUS status;
    1210             : 
    1211       90906 :         status = dcerpc_binding_handle_call(h,
    1212             :                         NULL, &ndr_table_winreg,
    1213             :                         NDR_WINREG_CLOSEKEY, mem_ctx, r);
    1214             : 
    1215       90906 :         return status;
    1216             : }
    1217             : 
    1218             : struct dcerpc_winreg_CloseKey_state {
    1219             :         struct winreg_CloseKey orig;
    1220             :         struct winreg_CloseKey tmp;
    1221             :         TALLOC_CTX *out_mem_ctx;
    1222             : };
    1223             : 
    1224             : static void dcerpc_winreg_CloseKey_done(struct tevent_req *subreq);
    1225             : 
    1226           0 : struct tevent_req *dcerpc_winreg_CloseKey_send(TALLOC_CTX *mem_ctx,
    1227             :                                                struct tevent_context *ev,
    1228             :                                                struct dcerpc_binding_handle *h,
    1229             :                                                struct policy_handle *_handle /* [in,out] [ref] */)
    1230             : {
    1231           0 :         struct tevent_req *req;
    1232           0 :         struct dcerpc_winreg_CloseKey_state *state;
    1233           0 :         struct tevent_req *subreq;
    1234             : 
    1235           0 :         req = tevent_req_create(mem_ctx, &state,
    1236             :                                 struct dcerpc_winreg_CloseKey_state);
    1237           0 :         if (req == NULL) {
    1238           0 :                 return NULL;
    1239             :         }
    1240           0 :         state->out_mem_ctx = NULL;
    1241             : 
    1242             :         /* In parameters */
    1243           0 :         state->orig.in.handle = _handle;
    1244             : 
    1245             :         /* Out parameters */
    1246           0 :         state->orig.out.handle = _handle;
    1247             : 
    1248             :         /* Result */
    1249           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1250             : 
    1251           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1252             :                              "dcerpc_winreg_CloseKey_out_memory");
    1253           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1254           0 :                 return tevent_req_post(req, ev);
    1255             :         }
    1256             : 
    1257             :         /* make a temporary copy, that we pass to the dispatch function */
    1258           0 :         state->tmp = state->orig;
    1259             : 
    1260           0 :         subreq = dcerpc_winreg_CloseKey_r_send(state, ev, h, &state->tmp);
    1261           0 :         if (tevent_req_nomem(subreq, req)) {
    1262           0 :                 return tevent_req_post(req, ev);
    1263             :         }
    1264           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_CloseKey_done, req);
    1265           0 :         return req;
    1266             : }
    1267             : 
    1268           0 : static void dcerpc_winreg_CloseKey_done(struct tevent_req *subreq)
    1269             : {
    1270           0 :         struct tevent_req *req = tevent_req_callback_data(
    1271             :                 subreq, struct tevent_req);
    1272           0 :         struct dcerpc_winreg_CloseKey_state *state = tevent_req_data(
    1273             :                 req, struct dcerpc_winreg_CloseKey_state);
    1274           0 :         NTSTATUS status;
    1275           0 :         TALLOC_CTX *mem_ctx;
    1276             : 
    1277           0 :         if (state->out_mem_ctx) {
    1278           0 :                 mem_ctx = state->out_mem_ctx;
    1279             :         } else {
    1280           0 :                 mem_ctx = state;
    1281             :         }
    1282             : 
    1283           0 :         status = dcerpc_winreg_CloseKey_r_recv(subreq, mem_ctx);
    1284           0 :         TALLOC_FREE(subreq);
    1285           0 :         if (tevent_req_nterror(req, status)) {
    1286           0 :                 return;
    1287             :         }
    1288             : 
    1289             :         /* Copy out parameters */
    1290           0 :         *state->orig.out.handle = *state->tmp.out.handle;
    1291             : 
    1292             :         /* Copy result */
    1293           0 :         state->orig.out.result = state->tmp.out.result;
    1294             : 
    1295             :         /* Reset temporary structure */
    1296           0 :         NDR_ZERO_STRUCT(state->tmp);
    1297             : 
    1298           0 :         tevent_req_done(req);
    1299             : }
    1300             : 
    1301           0 : NTSTATUS dcerpc_winreg_CloseKey_recv(struct tevent_req *req,
    1302             :                                      TALLOC_CTX *mem_ctx,
    1303             :                                      WERROR *result)
    1304             : {
    1305           0 :         struct dcerpc_winreg_CloseKey_state *state = tevent_req_data(
    1306             :                 req, struct dcerpc_winreg_CloseKey_state);
    1307           0 :         NTSTATUS status;
    1308             : 
    1309           0 :         if (tevent_req_is_nterror(req, &status)) {
    1310           0 :                 tevent_req_received(req);
    1311           0 :                 return status;
    1312             :         }
    1313             : 
    1314             :         /* Steal possible out parameters to the callers context */
    1315           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1316             : 
    1317             :         /* Return result */
    1318           0 :         *result = state->orig.out.result;
    1319             : 
    1320           0 :         tevent_req_received(req);
    1321           0 :         return NT_STATUS_OK;
    1322             : }
    1323             : 
    1324       89532 : NTSTATUS dcerpc_winreg_CloseKey(struct dcerpc_binding_handle *h,
    1325             :                                 TALLOC_CTX *mem_ctx,
    1326             :                                 struct policy_handle *_handle /* [in,out] [ref] */,
    1327             :                                 WERROR *result)
    1328             : {
    1329           0 :         struct winreg_CloseKey r;
    1330           0 :         NTSTATUS status;
    1331             : 
    1332             :         /* In parameters */
    1333       89532 :         r.in.handle = _handle;
    1334             : 
    1335             :         /* Out parameters */
    1336       89532 :         r.out.handle = _handle;
    1337             : 
    1338             :         /* Result */
    1339       89532 :         NDR_ZERO_STRUCT(r.out.result);
    1340             : 
    1341       89532 :         status = dcerpc_winreg_CloseKey_r(h, mem_ctx, &r);
    1342       89532 :         if (!NT_STATUS_IS_OK(status)) {
    1343          46 :                 return status;
    1344             :         }
    1345             : 
    1346             :         /* Return variables */
    1347       89486 :         *_handle = *r.out.handle;
    1348             : 
    1349             :         /* Return result */
    1350       89486 :         *result = r.out.result;
    1351             : 
    1352       89486 :         return NT_STATUS_OK;
    1353             : }
    1354             : 
    1355             : struct dcerpc_winreg_CreateKey_r_state {
    1356             :         TALLOC_CTX *out_mem_ctx;
    1357             : };
    1358             : 
    1359             : static void dcerpc_winreg_CreateKey_r_done(struct tevent_req *subreq);
    1360             : 
    1361           0 : struct tevent_req *dcerpc_winreg_CreateKey_r_send(TALLOC_CTX *mem_ctx,
    1362             :         struct tevent_context *ev,
    1363             :         struct dcerpc_binding_handle *h,
    1364             :         struct winreg_CreateKey *r)
    1365             : {
    1366           0 :         struct tevent_req *req;
    1367           0 :         struct dcerpc_winreg_CreateKey_r_state *state;
    1368           0 :         struct tevent_req *subreq;
    1369             : 
    1370           0 :         req = tevent_req_create(mem_ctx, &state,
    1371             :                                 struct dcerpc_winreg_CreateKey_r_state);
    1372           0 :         if (req == NULL) {
    1373           0 :                 return NULL;
    1374             :         }
    1375             : 
    1376           0 :         state->out_mem_ctx = talloc_new(state);
    1377           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1378           0 :                 return tevent_req_post(req, ev);
    1379             :         }
    1380             : 
    1381           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1382             :                         NULL, &ndr_table_winreg,
    1383           0 :                         NDR_WINREG_CREATEKEY, state->out_mem_ctx, r);
    1384           0 :         if (tevent_req_nomem(subreq, req)) {
    1385           0 :                 return tevent_req_post(req, ev);
    1386             :         }
    1387           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_CreateKey_r_done, req);
    1388             : 
    1389           0 :         return req;
    1390             : }
    1391             : 
    1392           0 : static void dcerpc_winreg_CreateKey_r_done(struct tevent_req *subreq)
    1393             : {
    1394           0 :         struct tevent_req *req =
    1395           0 :                 tevent_req_callback_data(subreq,
    1396             :                 struct tevent_req);
    1397           0 :         NTSTATUS status;
    1398             : 
    1399           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1400           0 :         TALLOC_FREE(subreq);
    1401           0 :         if (tevent_req_nterror(req, status)) {
    1402           0 :                 return;
    1403             :         }
    1404             : 
    1405           0 :         tevent_req_done(req);
    1406             : }
    1407             : 
    1408           0 : NTSTATUS dcerpc_winreg_CreateKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1409             : {
    1410           0 :         struct dcerpc_winreg_CreateKey_r_state *state =
    1411           0 :                 tevent_req_data(req,
    1412             :                 struct dcerpc_winreg_CreateKey_r_state);
    1413           0 :         NTSTATUS status;
    1414             : 
    1415           0 :         if (tevent_req_is_nterror(req, &status)) {
    1416           0 :                 tevent_req_received(req);
    1417           0 :                 return status;
    1418             :         }
    1419             : 
    1420           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1421             : 
    1422           0 :         tevent_req_received(req);
    1423           0 :         return NT_STATUS_OK;
    1424             : }
    1425             : 
    1426        7821 : NTSTATUS dcerpc_winreg_CreateKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_CreateKey *r)
    1427             : {
    1428           0 :         NTSTATUS status;
    1429             : 
    1430        7821 :         status = dcerpc_binding_handle_call(h,
    1431             :                         NULL, &ndr_table_winreg,
    1432             :                         NDR_WINREG_CREATEKEY, mem_ctx, r);
    1433             : 
    1434        7821 :         return status;
    1435             : }
    1436             : 
    1437             : struct dcerpc_winreg_CreateKey_state {
    1438             :         struct winreg_CreateKey orig;
    1439             :         struct winreg_CreateKey tmp;
    1440             :         TALLOC_CTX *out_mem_ctx;
    1441             : };
    1442             : 
    1443             : static void dcerpc_winreg_CreateKey_done(struct tevent_req *subreq);
    1444             : 
    1445           0 : struct tevent_req *dcerpc_winreg_CreateKey_send(TALLOC_CTX *mem_ctx,
    1446             :                                                 struct tevent_context *ev,
    1447             :                                                 struct dcerpc_binding_handle *h,
    1448             :                                                 struct policy_handle *_handle /* [in] [ref] */,
    1449             :                                                 struct winreg_String _name /* [in]  */,
    1450             :                                                 struct winreg_String _keyclass /* [in]  */,
    1451             :                                                 uint32_t _options /* [in]  */,
    1452             :                                                 uint32_t _access_mask /* [in]  */,
    1453             :                                                 struct winreg_SecBuf *_secdesc /* [in] [unique] */,
    1454             :                                                 struct policy_handle *_new_handle /* [out] [ref] */,
    1455             :                                                 enum winreg_CreateAction *_action_taken /* [in,out] [unique] */)
    1456             : {
    1457           0 :         struct tevent_req *req;
    1458           0 :         struct dcerpc_winreg_CreateKey_state *state;
    1459           0 :         struct tevent_req *subreq;
    1460             : 
    1461           0 :         req = tevent_req_create(mem_ctx, &state,
    1462             :                                 struct dcerpc_winreg_CreateKey_state);
    1463           0 :         if (req == NULL) {
    1464           0 :                 return NULL;
    1465             :         }
    1466           0 :         state->out_mem_ctx = NULL;
    1467             : 
    1468             :         /* In parameters */
    1469           0 :         state->orig.in.handle = _handle;
    1470           0 :         state->orig.in.name = _name;
    1471           0 :         state->orig.in.keyclass = _keyclass;
    1472           0 :         state->orig.in.options = _options;
    1473           0 :         state->orig.in.access_mask = _access_mask;
    1474           0 :         state->orig.in.secdesc = _secdesc;
    1475           0 :         state->orig.in.action_taken = _action_taken;
    1476             : 
    1477             :         /* Out parameters */
    1478           0 :         state->orig.out.new_handle = _new_handle;
    1479           0 :         state->orig.out.action_taken = _action_taken;
    1480             : 
    1481             :         /* Result */
    1482           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1483             : 
    1484           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    1485             :                              "dcerpc_winreg_CreateKey_out_memory");
    1486           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    1487           0 :                 return tevent_req_post(req, ev);
    1488             :         }
    1489             : 
    1490             :         /* make a temporary copy, that we pass to the dispatch function */
    1491           0 :         state->tmp = state->orig;
    1492             : 
    1493           0 :         subreq = dcerpc_winreg_CreateKey_r_send(state, ev, h, &state->tmp);
    1494           0 :         if (tevent_req_nomem(subreq, req)) {
    1495           0 :                 return tevent_req_post(req, ev);
    1496             :         }
    1497           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_CreateKey_done, req);
    1498           0 :         return req;
    1499             : }
    1500             : 
    1501           0 : static void dcerpc_winreg_CreateKey_done(struct tevent_req *subreq)
    1502             : {
    1503           0 :         struct tevent_req *req = tevent_req_callback_data(
    1504             :                 subreq, struct tevent_req);
    1505           0 :         struct dcerpc_winreg_CreateKey_state *state = tevent_req_data(
    1506             :                 req, struct dcerpc_winreg_CreateKey_state);
    1507           0 :         NTSTATUS status;
    1508           0 :         TALLOC_CTX *mem_ctx;
    1509             : 
    1510           0 :         if (state->out_mem_ctx) {
    1511           0 :                 mem_ctx = state->out_mem_ctx;
    1512             :         } else {
    1513           0 :                 mem_ctx = state;
    1514             :         }
    1515             : 
    1516           0 :         status = dcerpc_winreg_CreateKey_r_recv(subreq, mem_ctx);
    1517           0 :         TALLOC_FREE(subreq);
    1518           0 :         if (tevent_req_nterror(req, status)) {
    1519           0 :                 return;
    1520             :         }
    1521             : 
    1522             :         /* Copy out parameters */
    1523           0 :         *state->orig.out.new_handle = *state->tmp.out.new_handle;
    1524           0 :         if (state->orig.out.action_taken && state->tmp.out.action_taken) {
    1525           0 :                 *state->orig.out.action_taken = *state->tmp.out.action_taken;
    1526             :         }
    1527             : 
    1528             :         /* Copy result */
    1529           0 :         state->orig.out.result = state->tmp.out.result;
    1530             : 
    1531             :         /* Reset temporary structure */
    1532           0 :         NDR_ZERO_STRUCT(state->tmp);
    1533             : 
    1534           0 :         tevent_req_done(req);
    1535             : }
    1536             : 
    1537           0 : NTSTATUS dcerpc_winreg_CreateKey_recv(struct tevent_req *req,
    1538             :                                       TALLOC_CTX *mem_ctx,
    1539             :                                       WERROR *result)
    1540             : {
    1541           0 :         struct dcerpc_winreg_CreateKey_state *state = tevent_req_data(
    1542             :                 req, struct dcerpc_winreg_CreateKey_state);
    1543           0 :         NTSTATUS status;
    1544             : 
    1545           0 :         if (tevent_req_is_nterror(req, &status)) {
    1546           0 :                 tevent_req_received(req);
    1547           0 :                 return status;
    1548             :         }
    1549             : 
    1550             :         /* Steal possible out parameters to the callers context */
    1551           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1552             : 
    1553             :         /* Return result */
    1554           0 :         *result = state->orig.out.result;
    1555             : 
    1556           0 :         tevent_req_received(req);
    1557           0 :         return NT_STATUS_OK;
    1558             : }
    1559             : 
    1560        5994 : NTSTATUS dcerpc_winreg_CreateKey(struct dcerpc_binding_handle *h,
    1561             :                                  TALLOC_CTX *mem_ctx,
    1562             :                                  struct policy_handle *_handle /* [in] [ref] */,
    1563             :                                  struct winreg_String _name /* [in]  */,
    1564             :                                  struct winreg_String _keyclass /* [in]  */,
    1565             :                                  uint32_t _options /* [in]  */,
    1566             :                                  uint32_t _access_mask /* [in]  */,
    1567             :                                  struct winreg_SecBuf *_secdesc /* [in] [unique] */,
    1568             :                                  struct policy_handle *_new_handle /* [out] [ref] */,
    1569             :                                  enum winreg_CreateAction *_action_taken /* [in,out] [unique] */,
    1570             :                                  WERROR *result)
    1571             : {
    1572           0 :         struct winreg_CreateKey r;
    1573           0 :         NTSTATUS status;
    1574             : 
    1575             :         /* In parameters */
    1576        5994 :         r.in.handle = _handle;
    1577        5994 :         r.in.name = _name;
    1578        5994 :         r.in.keyclass = _keyclass;
    1579        5994 :         r.in.options = _options;
    1580        5994 :         r.in.access_mask = _access_mask;
    1581        5994 :         r.in.secdesc = _secdesc;
    1582        5994 :         r.in.action_taken = _action_taken;
    1583             : 
    1584             :         /* Out parameters */
    1585        5994 :         r.out.new_handle = _new_handle;
    1586        5994 :         r.out.action_taken = _action_taken;
    1587             : 
    1588             :         /* Result */
    1589        5994 :         NDR_ZERO_STRUCT(r.out.result);
    1590             : 
    1591        5994 :         status = dcerpc_winreg_CreateKey_r(h, mem_ctx, &r);
    1592        5994 :         if (!NT_STATUS_IS_OK(status)) {
    1593           0 :                 return status;
    1594             :         }
    1595             : 
    1596             :         /* Return variables */
    1597        5994 :         *_new_handle = *r.out.new_handle;
    1598        5994 :         if (_action_taken && r.out.action_taken) {
    1599        5994 :                 *_action_taken = *r.out.action_taken;
    1600             :         }
    1601             : 
    1602             :         /* Return result */
    1603        5994 :         *result = r.out.result;
    1604             : 
    1605        5994 :         return NT_STATUS_OK;
    1606             : }
    1607             : 
    1608             : struct dcerpc_winreg_DeleteKey_r_state {
    1609             :         TALLOC_CTX *out_mem_ctx;
    1610             : };
    1611             : 
    1612             : static void dcerpc_winreg_DeleteKey_r_done(struct tevent_req *subreq);
    1613             : 
    1614           0 : struct tevent_req *dcerpc_winreg_DeleteKey_r_send(TALLOC_CTX *mem_ctx,
    1615             :         struct tevent_context *ev,
    1616             :         struct dcerpc_binding_handle *h,
    1617             :         struct winreg_DeleteKey *r)
    1618             : {
    1619           0 :         struct tevent_req *req;
    1620           0 :         struct dcerpc_winreg_DeleteKey_r_state *state;
    1621           0 :         struct tevent_req *subreq;
    1622             : 
    1623           0 :         req = tevent_req_create(mem_ctx, &state,
    1624             :                                 struct dcerpc_winreg_DeleteKey_r_state);
    1625           0 :         if (req == NULL) {
    1626           0 :                 return NULL;
    1627             :         }
    1628             : 
    1629           0 :         state->out_mem_ctx = NULL;
    1630             : 
    1631           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1632             :                         NULL, &ndr_table_winreg,
    1633             :                         NDR_WINREG_DELETEKEY, state, r);
    1634           0 :         if (tevent_req_nomem(subreq, req)) {
    1635           0 :                 return tevent_req_post(req, ev);
    1636             :         }
    1637           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_DeleteKey_r_done, req);
    1638             : 
    1639           0 :         return req;
    1640             : }
    1641             : 
    1642           0 : static void dcerpc_winreg_DeleteKey_r_done(struct tevent_req *subreq)
    1643             : {
    1644           0 :         struct tevent_req *req =
    1645           0 :                 tevent_req_callback_data(subreq,
    1646             :                 struct tevent_req);
    1647           0 :         NTSTATUS status;
    1648             : 
    1649           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1650           0 :         TALLOC_FREE(subreq);
    1651           0 :         if (tevent_req_nterror(req, status)) {
    1652           0 :                 return;
    1653             :         }
    1654             : 
    1655           0 :         tevent_req_done(req);
    1656             : }
    1657             : 
    1658           0 : NTSTATUS dcerpc_winreg_DeleteKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1659             : {
    1660           0 :         struct dcerpc_winreg_DeleteKey_r_state *state =
    1661           0 :                 tevent_req_data(req,
    1662             :                 struct dcerpc_winreg_DeleteKey_r_state);
    1663           0 :         NTSTATUS status;
    1664             : 
    1665           0 :         if (tevent_req_is_nterror(req, &status)) {
    1666           0 :                 tevent_req_received(req);
    1667           0 :                 return status;
    1668             :         }
    1669             : 
    1670           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1671             : 
    1672           0 :         tevent_req_received(req);
    1673           0 :         return NT_STATUS_OK;
    1674             : }
    1675             : 
    1676        3748 : NTSTATUS dcerpc_winreg_DeleteKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_DeleteKey *r)
    1677             : {
    1678           0 :         NTSTATUS status;
    1679             : 
    1680        3748 :         status = dcerpc_binding_handle_call(h,
    1681             :                         NULL, &ndr_table_winreg,
    1682             :                         NDR_WINREG_DELETEKEY, mem_ctx, r);
    1683             : 
    1684        3748 :         return status;
    1685             : }
    1686             : 
    1687             : struct dcerpc_winreg_DeleteKey_state {
    1688             :         struct winreg_DeleteKey orig;
    1689             :         struct winreg_DeleteKey tmp;
    1690             :         TALLOC_CTX *out_mem_ctx;
    1691             : };
    1692             : 
    1693             : static void dcerpc_winreg_DeleteKey_done(struct tevent_req *subreq);
    1694             : 
    1695           0 : struct tevent_req *dcerpc_winreg_DeleteKey_send(TALLOC_CTX *mem_ctx,
    1696             :                                                 struct tevent_context *ev,
    1697             :                                                 struct dcerpc_binding_handle *h,
    1698             :                                                 struct policy_handle *_handle /* [in] [ref] */,
    1699             :                                                 struct winreg_String _key /* [in]  */)
    1700             : {
    1701           0 :         struct tevent_req *req;
    1702           0 :         struct dcerpc_winreg_DeleteKey_state *state;
    1703           0 :         struct tevent_req *subreq;
    1704             : 
    1705           0 :         req = tevent_req_create(mem_ctx, &state,
    1706             :                                 struct dcerpc_winreg_DeleteKey_state);
    1707           0 :         if (req == NULL) {
    1708           0 :                 return NULL;
    1709             :         }
    1710           0 :         state->out_mem_ctx = NULL;
    1711             : 
    1712             :         /* In parameters */
    1713           0 :         state->orig.in.handle = _handle;
    1714           0 :         state->orig.in.key = _key;
    1715             : 
    1716             :         /* Out parameters */
    1717             : 
    1718             :         /* Result */
    1719           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1720             : 
    1721             :         /* make a temporary copy, that we pass to the dispatch function */
    1722           0 :         state->tmp = state->orig;
    1723             : 
    1724           0 :         subreq = dcerpc_winreg_DeleteKey_r_send(state, ev, h, &state->tmp);
    1725           0 :         if (tevent_req_nomem(subreq, req)) {
    1726           0 :                 return tevent_req_post(req, ev);
    1727             :         }
    1728           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_DeleteKey_done, req);
    1729           0 :         return req;
    1730             : }
    1731             : 
    1732           0 : static void dcerpc_winreg_DeleteKey_done(struct tevent_req *subreq)
    1733             : {
    1734           0 :         struct tevent_req *req = tevent_req_callback_data(
    1735             :                 subreq, struct tevent_req);
    1736           0 :         struct dcerpc_winreg_DeleteKey_state *state = tevent_req_data(
    1737             :                 req, struct dcerpc_winreg_DeleteKey_state);
    1738           0 :         NTSTATUS status;
    1739           0 :         TALLOC_CTX *mem_ctx;
    1740             : 
    1741           0 :         if (state->out_mem_ctx) {
    1742           0 :                 mem_ctx = state->out_mem_ctx;
    1743             :         } else {
    1744           0 :                 mem_ctx = state;
    1745             :         }
    1746             : 
    1747           0 :         status = dcerpc_winreg_DeleteKey_r_recv(subreq, mem_ctx);
    1748           0 :         TALLOC_FREE(subreq);
    1749           0 :         if (tevent_req_nterror(req, status)) {
    1750           0 :                 return;
    1751             :         }
    1752             : 
    1753             :         /* Copy out parameters */
    1754             : 
    1755             :         /* Copy result */
    1756           0 :         state->orig.out.result = state->tmp.out.result;
    1757             : 
    1758             :         /* Reset temporary structure */
    1759           0 :         NDR_ZERO_STRUCT(state->tmp);
    1760             : 
    1761           0 :         tevent_req_done(req);
    1762             : }
    1763             : 
    1764           0 : NTSTATUS dcerpc_winreg_DeleteKey_recv(struct tevent_req *req,
    1765             :                                       TALLOC_CTX *mem_ctx,
    1766             :                                       WERROR *result)
    1767             : {
    1768           0 :         struct dcerpc_winreg_DeleteKey_state *state = tevent_req_data(
    1769             :                 req, struct dcerpc_winreg_DeleteKey_state);
    1770           0 :         NTSTATUS status;
    1771             : 
    1772           0 :         if (tevent_req_is_nterror(req, &status)) {
    1773           0 :                 tevent_req_received(req);
    1774           0 :                 return status;
    1775             :         }
    1776             : 
    1777             :         /* Steal possible out parameters to the callers context */
    1778           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1779             : 
    1780             :         /* Return result */
    1781           0 :         *result = state->orig.out.result;
    1782             : 
    1783           0 :         tevent_req_received(req);
    1784           0 :         return NT_STATUS_OK;
    1785             : }
    1786             : 
    1787         964 : NTSTATUS dcerpc_winreg_DeleteKey(struct dcerpc_binding_handle *h,
    1788             :                                  TALLOC_CTX *mem_ctx,
    1789             :                                  struct policy_handle *_handle /* [in] [ref] */,
    1790             :                                  struct winreg_String _key /* [in]  */,
    1791             :                                  WERROR *result)
    1792             : {
    1793           0 :         struct winreg_DeleteKey r;
    1794           0 :         NTSTATUS status;
    1795             : 
    1796             :         /* In parameters */
    1797         964 :         r.in.handle = _handle;
    1798         964 :         r.in.key = _key;
    1799             : 
    1800             :         /* Out parameters */
    1801             : 
    1802             :         /* Result */
    1803         964 :         NDR_ZERO_STRUCT(r.out.result);
    1804             : 
    1805         964 :         status = dcerpc_winreg_DeleteKey_r(h, mem_ctx, &r);
    1806         964 :         if (!NT_STATUS_IS_OK(status)) {
    1807           0 :                 return status;
    1808             :         }
    1809             : 
    1810             :         /* Return variables */
    1811             : 
    1812             :         /* Return result */
    1813         964 :         *result = r.out.result;
    1814             : 
    1815         964 :         return NT_STATUS_OK;
    1816             : }
    1817             : 
    1818             : struct dcerpc_winreg_DeleteValue_r_state {
    1819             :         TALLOC_CTX *out_mem_ctx;
    1820             : };
    1821             : 
    1822             : static void dcerpc_winreg_DeleteValue_r_done(struct tevent_req *subreq);
    1823             : 
    1824           0 : struct tevent_req *dcerpc_winreg_DeleteValue_r_send(TALLOC_CTX *mem_ctx,
    1825             :         struct tevent_context *ev,
    1826             :         struct dcerpc_binding_handle *h,
    1827             :         struct winreg_DeleteValue *r)
    1828             : {
    1829           0 :         struct tevent_req *req;
    1830           0 :         struct dcerpc_winreg_DeleteValue_r_state *state;
    1831           0 :         struct tevent_req *subreq;
    1832             : 
    1833           0 :         req = tevent_req_create(mem_ctx, &state,
    1834             :                                 struct dcerpc_winreg_DeleteValue_r_state);
    1835           0 :         if (req == NULL) {
    1836           0 :                 return NULL;
    1837             :         }
    1838             : 
    1839           0 :         state->out_mem_ctx = NULL;
    1840             : 
    1841           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    1842             :                         NULL, &ndr_table_winreg,
    1843             :                         NDR_WINREG_DELETEVALUE, state, r);
    1844           0 :         if (tevent_req_nomem(subreq, req)) {
    1845           0 :                 return tevent_req_post(req, ev);
    1846             :         }
    1847           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_DeleteValue_r_done, req);
    1848             : 
    1849           0 :         return req;
    1850             : }
    1851             : 
    1852           0 : static void dcerpc_winreg_DeleteValue_r_done(struct tevent_req *subreq)
    1853             : {
    1854           0 :         struct tevent_req *req =
    1855           0 :                 tevent_req_callback_data(subreq,
    1856             :                 struct tevent_req);
    1857           0 :         NTSTATUS status;
    1858             : 
    1859           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    1860           0 :         TALLOC_FREE(subreq);
    1861           0 :         if (tevent_req_nterror(req, status)) {
    1862           0 :                 return;
    1863             :         }
    1864             : 
    1865           0 :         tevent_req_done(req);
    1866             : }
    1867             : 
    1868           0 : NTSTATUS dcerpc_winreg_DeleteValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    1869             : {
    1870           0 :         struct dcerpc_winreg_DeleteValue_r_state *state =
    1871           0 :                 tevent_req_data(req,
    1872             :                 struct dcerpc_winreg_DeleteValue_r_state);
    1873           0 :         NTSTATUS status;
    1874             : 
    1875           0 :         if (tevent_req_is_nterror(req, &status)) {
    1876           0 :                 tevent_req_received(req);
    1877           0 :                 return status;
    1878             :         }
    1879             : 
    1880           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1881             : 
    1882           0 :         tevent_req_received(req);
    1883           0 :         return NT_STATUS_OK;
    1884             : }
    1885             : 
    1886        5560 : NTSTATUS dcerpc_winreg_DeleteValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_DeleteValue *r)
    1887             : {
    1888           0 :         NTSTATUS status;
    1889             : 
    1890        5560 :         status = dcerpc_binding_handle_call(h,
    1891             :                         NULL, &ndr_table_winreg,
    1892             :                         NDR_WINREG_DELETEVALUE, mem_ctx, r);
    1893             : 
    1894        5560 :         return status;
    1895             : }
    1896             : 
    1897             : struct dcerpc_winreg_DeleteValue_state {
    1898             :         struct winreg_DeleteValue orig;
    1899             :         struct winreg_DeleteValue tmp;
    1900             :         TALLOC_CTX *out_mem_ctx;
    1901             : };
    1902             : 
    1903             : static void dcerpc_winreg_DeleteValue_done(struct tevent_req *subreq);
    1904             : 
    1905           0 : struct tevent_req *dcerpc_winreg_DeleteValue_send(TALLOC_CTX *mem_ctx,
    1906             :                                                   struct tevent_context *ev,
    1907             :                                                   struct dcerpc_binding_handle *h,
    1908             :                                                   struct policy_handle *_handle /* [in] [ref] */,
    1909             :                                                   struct winreg_String _value /* [in]  */)
    1910             : {
    1911           0 :         struct tevent_req *req;
    1912           0 :         struct dcerpc_winreg_DeleteValue_state *state;
    1913           0 :         struct tevent_req *subreq;
    1914             : 
    1915           0 :         req = tevent_req_create(mem_ctx, &state,
    1916             :                                 struct dcerpc_winreg_DeleteValue_state);
    1917           0 :         if (req == NULL) {
    1918           0 :                 return NULL;
    1919             :         }
    1920           0 :         state->out_mem_ctx = NULL;
    1921             : 
    1922             :         /* In parameters */
    1923           0 :         state->orig.in.handle = _handle;
    1924           0 :         state->orig.in.value = _value;
    1925             : 
    1926             :         /* Out parameters */
    1927             : 
    1928             :         /* Result */
    1929           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    1930             : 
    1931             :         /* make a temporary copy, that we pass to the dispatch function */
    1932           0 :         state->tmp = state->orig;
    1933             : 
    1934           0 :         subreq = dcerpc_winreg_DeleteValue_r_send(state, ev, h, &state->tmp);
    1935           0 :         if (tevent_req_nomem(subreq, req)) {
    1936           0 :                 return tevent_req_post(req, ev);
    1937             :         }
    1938           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_DeleteValue_done, req);
    1939           0 :         return req;
    1940             : }
    1941             : 
    1942           0 : static void dcerpc_winreg_DeleteValue_done(struct tevent_req *subreq)
    1943             : {
    1944           0 :         struct tevent_req *req = tevent_req_callback_data(
    1945             :                 subreq, struct tevent_req);
    1946           0 :         struct dcerpc_winreg_DeleteValue_state *state = tevent_req_data(
    1947             :                 req, struct dcerpc_winreg_DeleteValue_state);
    1948           0 :         NTSTATUS status;
    1949           0 :         TALLOC_CTX *mem_ctx;
    1950             : 
    1951           0 :         if (state->out_mem_ctx) {
    1952           0 :                 mem_ctx = state->out_mem_ctx;
    1953             :         } else {
    1954           0 :                 mem_ctx = state;
    1955             :         }
    1956             : 
    1957           0 :         status = dcerpc_winreg_DeleteValue_r_recv(subreq, mem_ctx);
    1958           0 :         TALLOC_FREE(subreq);
    1959           0 :         if (tevent_req_nterror(req, status)) {
    1960           0 :                 return;
    1961             :         }
    1962             : 
    1963             :         /* Copy out parameters */
    1964             : 
    1965             :         /* Copy result */
    1966           0 :         state->orig.out.result = state->tmp.out.result;
    1967             : 
    1968             :         /* Reset temporary structure */
    1969           0 :         NDR_ZERO_STRUCT(state->tmp);
    1970             : 
    1971           0 :         tevent_req_done(req);
    1972             : }
    1973             : 
    1974           0 : NTSTATUS dcerpc_winreg_DeleteValue_recv(struct tevent_req *req,
    1975             :                                         TALLOC_CTX *mem_ctx,
    1976             :                                         WERROR *result)
    1977             : {
    1978           0 :         struct dcerpc_winreg_DeleteValue_state *state = tevent_req_data(
    1979             :                 req, struct dcerpc_winreg_DeleteValue_state);
    1980           0 :         NTSTATUS status;
    1981             : 
    1982           0 :         if (tevent_req_is_nterror(req, &status)) {
    1983           0 :                 tevent_req_received(req);
    1984           0 :                 return status;
    1985             :         }
    1986             : 
    1987             :         /* Steal possible out parameters to the callers context */
    1988           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    1989             : 
    1990             :         /* Return result */
    1991           0 :         *result = state->orig.out.result;
    1992             : 
    1993           0 :         tevent_req_received(req);
    1994           0 :         return NT_STATUS_OK;
    1995             : }
    1996             : 
    1997        1720 : NTSTATUS dcerpc_winreg_DeleteValue(struct dcerpc_binding_handle *h,
    1998             :                                    TALLOC_CTX *mem_ctx,
    1999             :                                    struct policy_handle *_handle /* [in] [ref] */,
    2000             :                                    struct winreg_String _value /* [in]  */,
    2001             :                                    WERROR *result)
    2002             : {
    2003           0 :         struct winreg_DeleteValue r;
    2004           0 :         NTSTATUS status;
    2005             : 
    2006             :         /* In parameters */
    2007        1720 :         r.in.handle = _handle;
    2008        1720 :         r.in.value = _value;
    2009             : 
    2010             :         /* Out parameters */
    2011             : 
    2012             :         /* Result */
    2013        1720 :         NDR_ZERO_STRUCT(r.out.result);
    2014             : 
    2015        1720 :         status = dcerpc_winreg_DeleteValue_r(h, mem_ctx, &r);
    2016        1720 :         if (!NT_STATUS_IS_OK(status)) {
    2017           0 :                 return status;
    2018             :         }
    2019             : 
    2020             :         /* Return variables */
    2021             : 
    2022             :         /* Return result */
    2023        1720 :         *result = r.out.result;
    2024             : 
    2025        1720 :         return NT_STATUS_OK;
    2026             : }
    2027             : 
    2028             : struct dcerpc_winreg_EnumKey_r_state {
    2029             :         TALLOC_CTX *out_mem_ctx;
    2030             : };
    2031             : 
    2032             : static void dcerpc_winreg_EnumKey_r_done(struct tevent_req *subreq);
    2033             : 
    2034           0 : struct tevent_req *dcerpc_winreg_EnumKey_r_send(TALLOC_CTX *mem_ctx,
    2035             :         struct tevent_context *ev,
    2036             :         struct dcerpc_binding_handle *h,
    2037             :         struct winreg_EnumKey *r)
    2038             : {
    2039           0 :         struct tevent_req *req;
    2040           0 :         struct dcerpc_winreg_EnumKey_r_state *state;
    2041           0 :         struct tevent_req *subreq;
    2042             : 
    2043           0 :         req = tevent_req_create(mem_ctx, &state,
    2044             :                                 struct dcerpc_winreg_EnumKey_r_state);
    2045           0 :         if (req == NULL) {
    2046           0 :                 return NULL;
    2047             :         }
    2048             : 
    2049           0 :         state->out_mem_ctx = talloc_new(state);
    2050           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2051           0 :                 return tevent_req_post(req, ev);
    2052             :         }
    2053             : 
    2054           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2055             :                         NULL, &ndr_table_winreg,
    2056           0 :                         NDR_WINREG_ENUMKEY, state->out_mem_ctx, r);
    2057           0 :         if (tevent_req_nomem(subreq, req)) {
    2058           0 :                 return tevent_req_post(req, ev);
    2059             :         }
    2060           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_EnumKey_r_done, req);
    2061             : 
    2062           0 :         return req;
    2063             : }
    2064             : 
    2065           0 : static void dcerpc_winreg_EnumKey_r_done(struct tevent_req *subreq)
    2066             : {
    2067           0 :         struct tevent_req *req =
    2068           0 :                 tevent_req_callback_data(subreq,
    2069             :                 struct tevent_req);
    2070           0 :         NTSTATUS status;
    2071             : 
    2072           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2073           0 :         TALLOC_FREE(subreq);
    2074           0 :         if (tevent_req_nterror(req, status)) {
    2075           0 :                 return;
    2076             :         }
    2077             : 
    2078           0 :         tevent_req_done(req);
    2079             : }
    2080             : 
    2081           0 : NTSTATUS dcerpc_winreg_EnumKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2082             : {
    2083           0 :         struct dcerpc_winreg_EnumKey_r_state *state =
    2084           0 :                 tevent_req_data(req,
    2085             :                 struct dcerpc_winreg_EnumKey_r_state);
    2086           0 :         NTSTATUS status;
    2087             : 
    2088           0 :         if (tevent_req_is_nterror(req, &status)) {
    2089           0 :                 tevent_req_received(req);
    2090           0 :                 return status;
    2091             :         }
    2092             : 
    2093           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2094             : 
    2095           0 :         tevent_req_received(req);
    2096           0 :         return NT_STATUS_OK;
    2097             : }
    2098             : 
    2099       66417 : NTSTATUS dcerpc_winreg_EnumKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_EnumKey *r)
    2100             : {
    2101           0 :         NTSTATUS status;
    2102             : 
    2103       66417 :         status = dcerpc_binding_handle_call(h,
    2104             :                         NULL, &ndr_table_winreg,
    2105             :                         NDR_WINREG_ENUMKEY, mem_ctx, r);
    2106             : 
    2107       66417 :         return status;
    2108             : }
    2109             : 
    2110             : struct dcerpc_winreg_EnumKey_state {
    2111             :         struct winreg_EnumKey orig;
    2112             :         struct winreg_EnumKey tmp;
    2113             :         TALLOC_CTX *out_mem_ctx;
    2114             : };
    2115             : 
    2116             : static void dcerpc_winreg_EnumKey_done(struct tevent_req *subreq);
    2117             : 
    2118           0 : struct tevent_req *dcerpc_winreg_EnumKey_send(TALLOC_CTX *mem_ctx,
    2119             :                                               struct tevent_context *ev,
    2120             :                                               struct dcerpc_binding_handle *h,
    2121             :                                               struct policy_handle *_handle /* [in] [ref] */,
    2122             :                                               uint32_t _enum_index /* [in]  */,
    2123             :                                               struct winreg_StringBuf *_name /* [in,out] [ref] */,
    2124             :                                               struct winreg_StringBuf *_keyclass /* [in,out] [unique] */,
    2125             :                                               NTTIME *_last_changed_time /* [in,out] [unique] */)
    2126             : {
    2127           0 :         struct tevent_req *req;
    2128           0 :         struct dcerpc_winreg_EnumKey_state *state;
    2129           0 :         struct tevent_req *subreq;
    2130             : 
    2131           0 :         req = tevent_req_create(mem_ctx, &state,
    2132             :                                 struct dcerpc_winreg_EnumKey_state);
    2133           0 :         if (req == NULL) {
    2134           0 :                 return NULL;
    2135             :         }
    2136           0 :         state->out_mem_ctx = NULL;
    2137             : 
    2138             :         /* In parameters */
    2139           0 :         state->orig.in.handle = _handle;
    2140           0 :         state->orig.in.enum_index = _enum_index;
    2141           0 :         state->orig.in.name = _name;
    2142           0 :         state->orig.in.keyclass = _keyclass;
    2143           0 :         state->orig.in.last_changed_time = _last_changed_time;
    2144             : 
    2145             :         /* Out parameters */
    2146           0 :         state->orig.out.name = _name;
    2147           0 :         state->orig.out.keyclass = _keyclass;
    2148           0 :         state->orig.out.last_changed_time = _last_changed_time;
    2149             : 
    2150             :         /* Result */
    2151           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2152             : 
    2153           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2154             :                              "dcerpc_winreg_EnumKey_out_memory");
    2155           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2156           0 :                 return tevent_req_post(req, ev);
    2157             :         }
    2158             : 
    2159             :         /* make a temporary copy, that we pass to the dispatch function */
    2160           0 :         state->tmp = state->orig;
    2161             : 
    2162           0 :         subreq = dcerpc_winreg_EnumKey_r_send(state, ev, h, &state->tmp);
    2163           0 :         if (tevent_req_nomem(subreq, req)) {
    2164           0 :                 return tevent_req_post(req, ev);
    2165             :         }
    2166           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_EnumKey_done, req);
    2167           0 :         return req;
    2168             : }
    2169             : 
    2170           0 : static void dcerpc_winreg_EnumKey_done(struct tevent_req *subreq)
    2171             : {
    2172           0 :         struct tevent_req *req = tevent_req_callback_data(
    2173             :                 subreq, struct tevent_req);
    2174           0 :         struct dcerpc_winreg_EnumKey_state *state = tevent_req_data(
    2175             :                 req, struct dcerpc_winreg_EnumKey_state);
    2176           0 :         NTSTATUS status;
    2177           0 :         TALLOC_CTX *mem_ctx;
    2178             : 
    2179           0 :         if (state->out_mem_ctx) {
    2180           0 :                 mem_ctx = state->out_mem_ctx;
    2181             :         } else {
    2182           0 :                 mem_ctx = state;
    2183             :         }
    2184             : 
    2185           0 :         status = dcerpc_winreg_EnumKey_r_recv(subreq, mem_ctx);
    2186           0 :         TALLOC_FREE(subreq);
    2187           0 :         if (tevent_req_nterror(req, status)) {
    2188           0 :                 return;
    2189             :         }
    2190             : 
    2191             :         /* Copy out parameters */
    2192           0 :         *state->orig.out.name = *state->tmp.out.name;
    2193           0 :         if (state->orig.out.keyclass && state->tmp.out.keyclass) {
    2194           0 :                 *state->orig.out.keyclass = *state->tmp.out.keyclass;
    2195             :         }
    2196           0 :         if (state->orig.out.last_changed_time && state->tmp.out.last_changed_time) {
    2197           0 :                 *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
    2198             :         }
    2199             : 
    2200             :         /* Copy result */
    2201           0 :         state->orig.out.result = state->tmp.out.result;
    2202             : 
    2203             :         /* Reset temporary structure */
    2204           0 :         NDR_ZERO_STRUCT(state->tmp);
    2205             : 
    2206           0 :         tevent_req_done(req);
    2207             : }
    2208             : 
    2209           0 : NTSTATUS dcerpc_winreg_EnumKey_recv(struct tevent_req *req,
    2210             :                                     TALLOC_CTX *mem_ctx,
    2211             :                                     WERROR *result)
    2212             : {
    2213           0 :         struct dcerpc_winreg_EnumKey_state *state = tevent_req_data(
    2214             :                 req, struct dcerpc_winreg_EnumKey_state);
    2215           0 :         NTSTATUS status;
    2216             : 
    2217           0 :         if (tevent_req_is_nterror(req, &status)) {
    2218           0 :                 tevent_req_received(req);
    2219           0 :                 return status;
    2220             :         }
    2221             : 
    2222             :         /* Steal possible out parameters to the callers context */
    2223           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2224             : 
    2225             :         /* Return result */
    2226           0 :         *result = state->orig.out.result;
    2227             : 
    2228           0 :         tevent_req_received(req);
    2229           0 :         return NT_STATUS_OK;
    2230             : }
    2231             : 
    2232       65780 : NTSTATUS dcerpc_winreg_EnumKey(struct dcerpc_binding_handle *h,
    2233             :                                TALLOC_CTX *mem_ctx,
    2234             :                                struct policy_handle *_handle /* [in] [ref] */,
    2235             :                                uint32_t _enum_index /* [in]  */,
    2236             :                                struct winreg_StringBuf *_name /* [in,out] [ref] */,
    2237             :                                struct winreg_StringBuf *_keyclass /* [in,out] [unique] */,
    2238             :                                NTTIME *_last_changed_time /* [in,out] [unique] */,
    2239             :                                WERROR *result)
    2240             : {
    2241           0 :         struct winreg_EnumKey r;
    2242           0 :         NTSTATUS status;
    2243             : 
    2244             :         /* In parameters */
    2245       65780 :         r.in.handle = _handle;
    2246       65780 :         r.in.enum_index = _enum_index;
    2247       65780 :         r.in.name = _name;
    2248       65780 :         r.in.keyclass = _keyclass;
    2249       65780 :         r.in.last_changed_time = _last_changed_time;
    2250             : 
    2251             :         /* Out parameters */
    2252       65780 :         r.out.name = _name;
    2253       65780 :         r.out.keyclass = _keyclass;
    2254       65780 :         r.out.last_changed_time = _last_changed_time;
    2255             : 
    2256             :         /* Result */
    2257       65780 :         NDR_ZERO_STRUCT(r.out.result);
    2258             : 
    2259       65780 :         status = dcerpc_winreg_EnumKey_r(h, mem_ctx, &r);
    2260       65780 :         if (!NT_STATUS_IS_OK(status)) {
    2261           0 :                 return status;
    2262             :         }
    2263             : 
    2264             :         /* Return variables */
    2265       65780 :         *_name = *r.out.name;
    2266       65780 :         if (_keyclass && r.out.keyclass) {
    2267       65780 :                 *_keyclass = *r.out.keyclass;
    2268             :         }
    2269       65780 :         if (_last_changed_time && r.out.last_changed_time) {
    2270       65780 :                 *_last_changed_time = *r.out.last_changed_time;
    2271             :         }
    2272             : 
    2273             :         /* Return result */
    2274       65780 :         *result = r.out.result;
    2275             : 
    2276       65780 :         return NT_STATUS_OK;
    2277             : }
    2278             : 
    2279             : struct dcerpc_winreg_EnumValue_r_state {
    2280             :         TALLOC_CTX *out_mem_ctx;
    2281             : };
    2282             : 
    2283             : static void dcerpc_winreg_EnumValue_r_done(struct tevent_req *subreq);
    2284             : 
    2285           0 : struct tevent_req *dcerpc_winreg_EnumValue_r_send(TALLOC_CTX *mem_ctx,
    2286             :         struct tevent_context *ev,
    2287             :         struct dcerpc_binding_handle *h,
    2288             :         struct winreg_EnumValue *r)
    2289             : {
    2290           0 :         struct tevent_req *req;
    2291           0 :         struct dcerpc_winreg_EnumValue_r_state *state;
    2292           0 :         struct tevent_req *subreq;
    2293             : 
    2294           0 :         req = tevent_req_create(mem_ctx, &state,
    2295             :                                 struct dcerpc_winreg_EnumValue_r_state);
    2296           0 :         if (req == NULL) {
    2297           0 :                 return NULL;
    2298             :         }
    2299             : 
    2300           0 :         state->out_mem_ctx = talloc_new(state);
    2301           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2302           0 :                 return tevent_req_post(req, ev);
    2303             :         }
    2304             : 
    2305           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2306             :                         NULL, &ndr_table_winreg,
    2307           0 :                         NDR_WINREG_ENUMVALUE, state->out_mem_ctx, r);
    2308           0 :         if (tevent_req_nomem(subreq, req)) {
    2309           0 :                 return tevent_req_post(req, ev);
    2310             :         }
    2311           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_EnumValue_r_done, req);
    2312             : 
    2313           0 :         return req;
    2314             : }
    2315             : 
    2316           0 : static void dcerpc_winreg_EnumValue_r_done(struct tevent_req *subreq)
    2317             : {
    2318           0 :         struct tevent_req *req =
    2319           0 :                 tevent_req_callback_data(subreq,
    2320             :                 struct tevent_req);
    2321           0 :         NTSTATUS status;
    2322             : 
    2323           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2324           0 :         TALLOC_FREE(subreq);
    2325           0 :         if (tevent_req_nterror(req, status)) {
    2326           0 :                 return;
    2327             :         }
    2328             : 
    2329           0 :         tevent_req_done(req);
    2330             : }
    2331             : 
    2332           0 : NTSTATUS dcerpc_winreg_EnumValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2333             : {
    2334           0 :         struct dcerpc_winreg_EnumValue_r_state *state =
    2335           0 :                 tevent_req_data(req,
    2336             :                 struct dcerpc_winreg_EnumValue_r_state);
    2337           0 :         NTSTATUS status;
    2338             : 
    2339           0 :         if (tevent_req_is_nterror(req, &status)) {
    2340           0 :                 tevent_req_received(req);
    2341           0 :                 return status;
    2342             :         }
    2343             : 
    2344           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2345             : 
    2346           0 :         tevent_req_received(req);
    2347           0 :         return NT_STATUS_OK;
    2348             : }
    2349             : 
    2350      194681 : NTSTATUS dcerpc_winreg_EnumValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_EnumValue *r)
    2351             : {
    2352           0 :         NTSTATUS status;
    2353             : 
    2354      194681 :         status = dcerpc_binding_handle_call(h,
    2355             :                         NULL, &ndr_table_winreg,
    2356             :                         NDR_WINREG_ENUMVALUE, mem_ctx, r);
    2357             : 
    2358      194681 :         return status;
    2359             : }
    2360             : 
    2361             : struct dcerpc_winreg_EnumValue_state {
    2362             :         struct winreg_EnumValue orig;
    2363             :         struct winreg_EnumValue tmp;
    2364             :         TALLOC_CTX *out_mem_ctx;
    2365             : };
    2366             : 
    2367             : static void dcerpc_winreg_EnumValue_done(struct tevent_req *subreq);
    2368             : 
    2369           0 : struct tevent_req *dcerpc_winreg_EnumValue_send(TALLOC_CTX *mem_ctx,
    2370             :                                                 struct tevent_context *ev,
    2371             :                                                 struct dcerpc_binding_handle *h,
    2372             :                                                 struct policy_handle *_handle /* [in] [ref] */,
    2373             :                                                 uint32_t _enum_index /* [in]  */,
    2374             :                                                 struct winreg_ValNameBuf *_name /* [in,out] [ref] */,
    2375             :                                                 enum winreg_Type *_type /* [in,out] [unique] */,
    2376             :                                                 uint8_t *_value /* [in,out] [length_is(length?*length:0),range(0,0x4000000),size_is(size?*size:0),unique] */,
    2377             :                                                 uint32_t *_size /* [in,out] [unique] */,
    2378             :                                                 uint32_t *_length /* [in,out] [unique] */)
    2379             : {
    2380           0 :         struct tevent_req *req;
    2381           0 :         struct dcerpc_winreg_EnumValue_state *state;
    2382           0 :         struct tevent_req *subreq;
    2383             : 
    2384           0 :         req = tevent_req_create(mem_ctx, &state,
    2385             :                                 struct dcerpc_winreg_EnumValue_state);
    2386           0 :         if (req == NULL) {
    2387           0 :                 return NULL;
    2388             :         }
    2389           0 :         state->out_mem_ctx = NULL;
    2390             : 
    2391             :         /* In parameters */
    2392           0 :         state->orig.in.handle = _handle;
    2393           0 :         state->orig.in.enum_index = _enum_index;
    2394           0 :         state->orig.in.name = _name;
    2395           0 :         state->orig.in.type = _type;
    2396           0 :         state->orig.in.value = _value;
    2397           0 :         state->orig.in.size = _size;
    2398           0 :         state->orig.in.length = _length;
    2399             : 
    2400             :         /* Out parameters */
    2401           0 :         state->orig.out.name = _name;
    2402           0 :         state->orig.out.type = _type;
    2403           0 :         state->orig.out.value = _value;
    2404           0 :         state->orig.out.size = _size;
    2405           0 :         state->orig.out.length = _length;
    2406             : 
    2407             :         /* Result */
    2408           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2409             : 
    2410           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2411             :                              "dcerpc_winreg_EnumValue_out_memory");
    2412           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2413           0 :                 return tevent_req_post(req, ev);
    2414             :         }
    2415             : 
    2416             :         /* make a temporary copy, that we pass to the dispatch function */
    2417           0 :         state->tmp = state->orig;
    2418             : 
    2419           0 :         subreq = dcerpc_winreg_EnumValue_r_send(state, ev, h, &state->tmp);
    2420           0 :         if (tevent_req_nomem(subreq, req)) {
    2421           0 :                 return tevent_req_post(req, ev);
    2422             :         }
    2423           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_EnumValue_done, req);
    2424           0 :         return req;
    2425             : }
    2426             : 
    2427           0 : static void dcerpc_winreg_EnumValue_done(struct tevent_req *subreq)
    2428             : {
    2429           0 :         struct tevent_req *req = tevent_req_callback_data(
    2430             :                 subreq, struct tevent_req);
    2431           0 :         struct dcerpc_winreg_EnumValue_state *state = tevent_req_data(
    2432             :                 req, struct dcerpc_winreg_EnumValue_state);
    2433           0 :         NTSTATUS status;
    2434           0 :         TALLOC_CTX *mem_ctx;
    2435             : 
    2436           0 :         if (state->out_mem_ctx) {
    2437           0 :                 mem_ctx = state->out_mem_ctx;
    2438             :         } else {
    2439           0 :                 mem_ctx = state;
    2440             :         }
    2441             : 
    2442           0 :         status = dcerpc_winreg_EnumValue_r_recv(subreq, mem_ctx);
    2443           0 :         TALLOC_FREE(subreq);
    2444           0 :         if (tevent_req_nterror(req, status)) {
    2445           0 :                 return;
    2446             :         }
    2447             : 
    2448             :         /* Copy out parameters */
    2449           0 :         *state->orig.out.name = *state->tmp.out.name;
    2450           0 :         if (state->orig.out.type && state->tmp.out.type) {
    2451           0 :                 *state->orig.out.type = *state->tmp.out.type;
    2452             :         }
    2453           0 :         if (state->orig.out.value && state->tmp.out.value) {
    2454             :                 {
    2455           0 :                         size_t _copy_len_value;
    2456           0 :                         if ((state->tmp.out.size?*state->tmp.out.size:0) > (state->tmp.in.size?*state->tmp.in.size:0)) {
    2457           0 :                                 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
    2458           0 :                                 return;
    2459             :                         }
    2460           0 :                         if ((state->tmp.out.length?*state->tmp.out.length:0) > (state->tmp.out.size?*state->tmp.out.size:0)) {
    2461           0 :                                 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
    2462           0 :                                 return;
    2463             :                         }
    2464           0 :                         _copy_len_value = state->tmp.out.length?*state->tmp.out.length:0;
    2465           0 :                         if (state->orig.out.value != state->tmp.out.value) {
    2466           0 :                                 memcpy(state->orig.out.value, state->tmp.out.value, _copy_len_value * sizeof(*state->orig.out.value));
    2467             :                         }
    2468             :                 }
    2469             :         }
    2470           0 :         if (state->orig.out.size && state->tmp.out.size) {
    2471           0 :                 *state->orig.out.size = *state->tmp.out.size;
    2472             :         }
    2473           0 :         if (state->orig.out.length && state->tmp.out.length) {
    2474           0 :                 *state->orig.out.length = *state->tmp.out.length;
    2475             :         }
    2476             : 
    2477             :         /* Copy result */
    2478           0 :         state->orig.out.result = state->tmp.out.result;
    2479             : 
    2480             :         /* Reset temporary structure */
    2481           0 :         NDR_ZERO_STRUCT(state->tmp);
    2482             : 
    2483           0 :         tevent_req_done(req);
    2484             : }
    2485             : 
    2486           0 : NTSTATUS dcerpc_winreg_EnumValue_recv(struct tevent_req *req,
    2487             :                                       TALLOC_CTX *mem_ctx,
    2488             :                                       WERROR *result)
    2489             : {
    2490           0 :         struct dcerpc_winreg_EnumValue_state *state = tevent_req_data(
    2491             :                 req, struct dcerpc_winreg_EnumValue_state);
    2492           0 :         NTSTATUS status;
    2493             : 
    2494           0 :         if (tevent_req_is_nterror(req, &status)) {
    2495           0 :                 tevent_req_received(req);
    2496           0 :                 return status;
    2497             :         }
    2498             : 
    2499             :         /* Steal possible out parameters to the callers context */
    2500           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2501             : 
    2502             :         /* Return result */
    2503           0 :         *result = state->orig.out.result;
    2504             : 
    2505           0 :         tevent_req_received(req);
    2506           0 :         return NT_STATUS_OK;
    2507             : }
    2508             : 
    2509      190272 : NTSTATUS dcerpc_winreg_EnumValue(struct dcerpc_binding_handle *h,
    2510             :                                  TALLOC_CTX *mem_ctx,
    2511             :                                  struct policy_handle *_handle /* [in] [ref] */,
    2512             :                                  uint32_t _enum_index /* [in]  */,
    2513             :                                  struct winreg_ValNameBuf *_name /* [in,out] [ref] */,
    2514             :                                  enum winreg_Type *_type /* [in,out] [unique] */,
    2515             :                                  uint8_t *_value /* [in,out] [length_is(length?*length:0),range(0,0x4000000),size_is(size?*size:0),unique] */,
    2516             :                                  uint32_t *_size /* [in,out] [unique] */,
    2517             :                                  uint32_t *_length /* [in,out] [unique] */,
    2518             :                                  WERROR *result)
    2519             : {
    2520           0 :         struct winreg_EnumValue r;
    2521           0 :         NTSTATUS status;
    2522             : 
    2523             :         /* In parameters */
    2524      190272 :         r.in.handle = _handle;
    2525      190272 :         r.in.enum_index = _enum_index;
    2526      190272 :         r.in.name = _name;
    2527      190272 :         r.in.type = _type;
    2528      190272 :         r.in.value = _value;
    2529      190272 :         r.in.size = _size;
    2530      190272 :         r.in.length = _length;
    2531             : 
    2532             :         /* Out parameters */
    2533      190272 :         r.out.name = _name;
    2534      190272 :         r.out.type = _type;
    2535      190272 :         r.out.value = _value;
    2536      190272 :         r.out.size = _size;
    2537      190272 :         r.out.length = _length;
    2538             : 
    2539             :         /* Result */
    2540      190272 :         NDR_ZERO_STRUCT(r.out.result);
    2541             : 
    2542      190272 :         status = dcerpc_winreg_EnumValue_r(h, mem_ctx, &r);
    2543      190272 :         if (!NT_STATUS_IS_OK(status)) {
    2544           0 :                 return status;
    2545             :         }
    2546             : 
    2547             :         /* Return variables */
    2548      190272 :         *_name = *r.out.name;
    2549      190272 :         if (_type && r.out.type) {
    2550      190272 :                 *_type = *r.out.type;
    2551             :         }
    2552      190272 :         if (_value && r.out.value) {
    2553             :                 {
    2554           0 :                         size_t _copy_len_value;
    2555      190200 :                         if ((r.out.size?*r.out.size:0) > (r.in.size?*r.in.size:0)) {
    2556           0 :                                 return NT_STATUS_INVALID_NETWORK_RESPONSE;
    2557             :                         }
    2558      190200 :                         if ((r.out.length?*r.out.length:0) > (r.out.size?*r.out.size:0)) {
    2559           0 :                                 return NT_STATUS_INVALID_NETWORK_RESPONSE;
    2560             :                         }
    2561      190200 :                         _copy_len_value = r.out.length?*r.out.length:0;
    2562      190200 :                         if (_value != r.out.value) {
    2563      190200 :                                 memcpy(_value, r.out.value, _copy_len_value * sizeof(*_value));
    2564             :                         }
    2565             :                 }
    2566             :         }
    2567      190272 :         if (_size && r.out.size) {
    2568      190200 :                 *_size = *r.out.size;
    2569             :         }
    2570      190272 :         if (_length && r.out.length) {
    2571      190272 :                 *_length = *r.out.length;
    2572             :         }
    2573             : 
    2574             :         /* Return result */
    2575      190272 :         *result = r.out.result;
    2576             : 
    2577      190272 :         return NT_STATUS_OK;
    2578             : }
    2579             : 
    2580             : struct dcerpc_winreg_FlushKey_r_state {
    2581             :         TALLOC_CTX *out_mem_ctx;
    2582             : };
    2583             : 
    2584             : static void dcerpc_winreg_FlushKey_r_done(struct tevent_req *subreq);
    2585             : 
    2586           0 : struct tevent_req *dcerpc_winreg_FlushKey_r_send(TALLOC_CTX *mem_ctx,
    2587             :         struct tevent_context *ev,
    2588             :         struct dcerpc_binding_handle *h,
    2589             :         struct winreg_FlushKey *r)
    2590             : {
    2591           0 :         struct tevent_req *req;
    2592           0 :         struct dcerpc_winreg_FlushKey_r_state *state;
    2593           0 :         struct tevent_req *subreq;
    2594             : 
    2595           0 :         req = tevent_req_create(mem_ctx, &state,
    2596             :                                 struct dcerpc_winreg_FlushKey_r_state);
    2597           0 :         if (req == NULL) {
    2598           0 :                 return NULL;
    2599             :         }
    2600             : 
    2601           0 :         state->out_mem_ctx = NULL;
    2602             : 
    2603           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2604             :                         NULL, &ndr_table_winreg,
    2605             :                         NDR_WINREG_FLUSHKEY, state, r);
    2606           0 :         if (tevent_req_nomem(subreq, req)) {
    2607           0 :                 return tevent_req_post(req, ev);
    2608             :         }
    2609           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_FlushKey_r_done, req);
    2610             : 
    2611           0 :         return req;
    2612             : }
    2613             : 
    2614           0 : static void dcerpc_winreg_FlushKey_r_done(struct tevent_req *subreq)
    2615             : {
    2616           0 :         struct tevent_req *req =
    2617           0 :                 tevent_req_callback_data(subreq,
    2618             :                 struct tevent_req);
    2619           0 :         NTSTATUS status;
    2620             : 
    2621           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2622           0 :         TALLOC_FREE(subreq);
    2623           0 :         if (tevent_req_nterror(req, status)) {
    2624           0 :                 return;
    2625             :         }
    2626             : 
    2627           0 :         tevent_req_done(req);
    2628             : }
    2629             : 
    2630           0 : NTSTATUS dcerpc_winreg_FlushKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2631             : {
    2632           0 :         struct dcerpc_winreg_FlushKey_r_state *state =
    2633           0 :                 tevent_req_data(req,
    2634             :                 struct dcerpc_winreg_FlushKey_r_state);
    2635           0 :         NTSTATUS status;
    2636             : 
    2637           0 :         if (tevent_req_is_nterror(req, &status)) {
    2638           0 :                 tevent_req_received(req);
    2639           0 :                 return status;
    2640             :         }
    2641             : 
    2642           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2643             : 
    2644           0 :         tevent_req_received(req);
    2645           0 :         return NT_STATUS_OK;
    2646             : }
    2647             : 
    2648         696 : NTSTATUS dcerpc_winreg_FlushKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_FlushKey *r)
    2649             : {
    2650           0 :         NTSTATUS status;
    2651             : 
    2652         696 :         status = dcerpc_binding_handle_call(h,
    2653             :                         NULL, &ndr_table_winreg,
    2654             :                         NDR_WINREG_FLUSHKEY, mem_ctx, r);
    2655             : 
    2656         696 :         return status;
    2657             : }
    2658             : 
    2659             : struct dcerpc_winreg_FlushKey_state {
    2660             :         struct winreg_FlushKey orig;
    2661             :         struct winreg_FlushKey tmp;
    2662             :         TALLOC_CTX *out_mem_ctx;
    2663             : };
    2664             : 
    2665             : static void dcerpc_winreg_FlushKey_done(struct tevent_req *subreq);
    2666             : 
    2667           0 : struct tevent_req *dcerpc_winreg_FlushKey_send(TALLOC_CTX *mem_ctx,
    2668             :                                                struct tevent_context *ev,
    2669             :                                                struct dcerpc_binding_handle *h,
    2670             :                                                struct policy_handle *_handle /* [in] [ref] */)
    2671             : {
    2672           0 :         struct tevent_req *req;
    2673           0 :         struct dcerpc_winreg_FlushKey_state *state;
    2674           0 :         struct tevent_req *subreq;
    2675             : 
    2676           0 :         req = tevent_req_create(mem_ctx, &state,
    2677             :                                 struct dcerpc_winreg_FlushKey_state);
    2678           0 :         if (req == NULL) {
    2679           0 :                 return NULL;
    2680             :         }
    2681           0 :         state->out_mem_ctx = NULL;
    2682             : 
    2683             :         /* In parameters */
    2684           0 :         state->orig.in.handle = _handle;
    2685             : 
    2686             :         /* Out parameters */
    2687             : 
    2688             :         /* Result */
    2689           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2690             : 
    2691             :         /* make a temporary copy, that we pass to the dispatch function */
    2692           0 :         state->tmp = state->orig;
    2693             : 
    2694           0 :         subreq = dcerpc_winreg_FlushKey_r_send(state, ev, h, &state->tmp);
    2695           0 :         if (tevent_req_nomem(subreq, req)) {
    2696           0 :                 return tevent_req_post(req, ev);
    2697             :         }
    2698           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_FlushKey_done, req);
    2699           0 :         return req;
    2700             : }
    2701             : 
    2702           0 : static void dcerpc_winreg_FlushKey_done(struct tevent_req *subreq)
    2703             : {
    2704           0 :         struct tevent_req *req = tevent_req_callback_data(
    2705             :                 subreq, struct tevent_req);
    2706           0 :         struct dcerpc_winreg_FlushKey_state *state = tevent_req_data(
    2707             :                 req, struct dcerpc_winreg_FlushKey_state);
    2708           0 :         NTSTATUS status;
    2709           0 :         TALLOC_CTX *mem_ctx;
    2710             : 
    2711           0 :         if (state->out_mem_ctx) {
    2712           0 :                 mem_ctx = state->out_mem_ctx;
    2713             :         } else {
    2714           0 :                 mem_ctx = state;
    2715             :         }
    2716             : 
    2717           0 :         status = dcerpc_winreg_FlushKey_r_recv(subreq, mem_ctx);
    2718           0 :         TALLOC_FREE(subreq);
    2719           0 :         if (tevent_req_nterror(req, status)) {
    2720           0 :                 return;
    2721             :         }
    2722             : 
    2723             :         /* Copy out parameters */
    2724             : 
    2725             :         /* Copy result */
    2726           0 :         state->orig.out.result = state->tmp.out.result;
    2727             : 
    2728             :         /* Reset temporary structure */
    2729           0 :         NDR_ZERO_STRUCT(state->tmp);
    2730             : 
    2731           0 :         tevent_req_done(req);
    2732             : }
    2733             : 
    2734           0 : NTSTATUS dcerpc_winreg_FlushKey_recv(struct tevent_req *req,
    2735             :                                      TALLOC_CTX *mem_ctx,
    2736             :                                      WERROR *result)
    2737             : {
    2738           0 :         struct dcerpc_winreg_FlushKey_state *state = tevent_req_data(
    2739             :                 req, struct dcerpc_winreg_FlushKey_state);
    2740           0 :         NTSTATUS status;
    2741             : 
    2742           0 :         if (tevent_req_is_nterror(req, &status)) {
    2743           0 :                 tevent_req_received(req);
    2744           0 :                 return status;
    2745             :         }
    2746             : 
    2747             :         /* Steal possible out parameters to the callers context */
    2748           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2749             : 
    2750             :         /* Return result */
    2751           0 :         *result = state->orig.out.result;
    2752             : 
    2753           0 :         tevent_req_received(req);
    2754           0 :         return NT_STATUS_OK;
    2755             : }
    2756             : 
    2757           0 : NTSTATUS dcerpc_winreg_FlushKey(struct dcerpc_binding_handle *h,
    2758             :                                 TALLOC_CTX *mem_ctx,
    2759             :                                 struct policy_handle *_handle /* [in] [ref] */,
    2760             :                                 WERROR *result)
    2761             : {
    2762           0 :         struct winreg_FlushKey r;
    2763           0 :         NTSTATUS status;
    2764             : 
    2765             :         /* In parameters */
    2766           0 :         r.in.handle = _handle;
    2767             : 
    2768             :         /* Out parameters */
    2769             : 
    2770             :         /* Result */
    2771           0 :         NDR_ZERO_STRUCT(r.out.result);
    2772             : 
    2773           0 :         status = dcerpc_winreg_FlushKey_r(h, mem_ctx, &r);
    2774           0 :         if (!NT_STATUS_IS_OK(status)) {
    2775           0 :                 return status;
    2776             :         }
    2777             : 
    2778             :         /* Return variables */
    2779             : 
    2780             :         /* Return result */
    2781           0 :         *result = r.out.result;
    2782             : 
    2783           0 :         return NT_STATUS_OK;
    2784             : }
    2785             : 
    2786             : struct dcerpc_winreg_GetKeySecurity_r_state {
    2787             :         TALLOC_CTX *out_mem_ctx;
    2788             : };
    2789             : 
    2790             : static void dcerpc_winreg_GetKeySecurity_r_done(struct tevent_req *subreq);
    2791             : 
    2792           0 : struct tevent_req *dcerpc_winreg_GetKeySecurity_r_send(TALLOC_CTX *mem_ctx,
    2793             :         struct tevent_context *ev,
    2794             :         struct dcerpc_binding_handle *h,
    2795             :         struct winreg_GetKeySecurity *r)
    2796             : {
    2797           0 :         struct tevent_req *req;
    2798           0 :         struct dcerpc_winreg_GetKeySecurity_r_state *state;
    2799           0 :         struct tevent_req *subreq;
    2800             : 
    2801           0 :         req = tevent_req_create(mem_ctx, &state,
    2802             :                                 struct dcerpc_winreg_GetKeySecurity_r_state);
    2803           0 :         if (req == NULL) {
    2804           0 :                 return NULL;
    2805             :         }
    2806             : 
    2807           0 :         state->out_mem_ctx = talloc_new(state);
    2808           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2809           0 :                 return tevent_req_post(req, ev);
    2810             :         }
    2811             : 
    2812           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    2813             :                         NULL, &ndr_table_winreg,
    2814           0 :                         NDR_WINREG_GETKEYSECURITY, state->out_mem_ctx, r);
    2815           0 :         if (tevent_req_nomem(subreq, req)) {
    2816           0 :                 return tevent_req_post(req, ev);
    2817             :         }
    2818           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_GetKeySecurity_r_done, req);
    2819             : 
    2820           0 :         return req;
    2821             : }
    2822             : 
    2823           0 : static void dcerpc_winreg_GetKeySecurity_r_done(struct tevent_req *subreq)
    2824             : {
    2825           0 :         struct tevent_req *req =
    2826           0 :                 tevent_req_callback_data(subreq,
    2827             :                 struct tevent_req);
    2828           0 :         NTSTATUS status;
    2829             : 
    2830           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    2831           0 :         TALLOC_FREE(subreq);
    2832           0 :         if (tevent_req_nterror(req, status)) {
    2833           0 :                 return;
    2834             :         }
    2835             : 
    2836           0 :         tevent_req_done(req);
    2837             : }
    2838             : 
    2839           0 : NTSTATUS dcerpc_winreg_GetKeySecurity_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    2840             : {
    2841           0 :         struct dcerpc_winreg_GetKeySecurity_r_state *state =
    2842           0 :                 tevent_req_data(req,
    2843             :                 struct dcerpc_winreg_GetKeySecurity_r_state);
    2844           0 :         NTSTATUS status;
    2845             : 
    2846           0 :         if (tevent_req_is_nterror(req, &status)) {
    2847           0 :                 tevent_req_received(req);
    2848           0 :                 return status;
    2849             :         }
    2850             : 
    2851           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2852             : 
    2853           0 :         tevent_req_received(req);
    2854           0 :         return NT_STATUS_OK;
    2855             : }
    2856             : 
    2857           0 : NTSTATUS dcerpc_winreg_GetKeySecurity_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_GetKeySecurity *r)
    2858             : {
    2859           0 :         NTSTATUS status;
    2860             : 
    2861           0 :         status = dcerpc_binding_handle_call(h,
    2862             :                         NULL, &ndr_table_winreg,
    2863             :                         NDR_WINREG_GETKEYSECURITY, mem_ctx, r);
    2864             : 
    2865           0 :         return status;
    2866             : }
    2867             : 
    2868             : struct dcerpc_winreg_GetKeySecurity_state {
    2869             :         struct winreg_GetKeySecurity orig;
    2870             :         struct winreg_GetKeySecurity tmp;
    2871             :         TALLOC_CTX *out_mem_ctx;
    2872             : };
    2873             : 
    2874             : static void dcerpc_winreg_GetKeySecurity_done(struct tevent_req *subreq);
    2875             : 
    2876           0 : struct tevent_req *dcerpc_winreg_GetKeySecurity_send(TALLOC_CTX *mem_ctx,
    2877             :                                                      struct tevent_context *ev,
    2878             :                                                      struct dcerpc_binding_handle *h,
    2879             :                                                      struct policy_handle *_handle /* [in] [ref] */,
    2880             :                                                      uint32_t _sec_info /* [in]  */,
    2881             :                                                      struct KeySecurityData *_sd /* [in,out] [ref] */)
    2882             : {
    2883           0 :         struct tevent_req *req;
    2884           0 :         struct dcerpc_winreg_GetKeySecurity_state *state;
    2885           0 :         struct tevent_req *subreq;
    2886             : 
    2887           0 :         req = tevent_req_create(mem_ctx, &state,
    2888             :                                 struct dcerpc_winreg_GetKeySecurity_state);
    2889           0 :         if (req == NULL) {
    2890           0 :                 return NULL;
    2891             :         }
    2892           0 :         state->out_mem_ctx = NULL;
    2893             : 
    2894             :         /* In parameters */
    2895           0 :         state->orig.in.handle = _handle;
    2896           0 :         state->orig.in.sec_info = _sec_info;
    2897           0 :         state->orig.in.sd = _sd;
    2898             : 
    2899             :         /* Out parameters */
    2900           0 :         state->orig.out.sd = _sd;
    2901             : 
    2902             :         /* Result */
    2903           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    2904             : 
    2905           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    2906             :                              "dcerpc_winreg_GetKeySecurity_out_memory");
    2907           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    2908           0 :                 return tevent_req_post(req, ev);
    2909             :         }
    2910             : 
    2911             :         /* make a temporary copy, that we pass to the dispatch function */
    2912           0 :         state->tmp = state->orig;
    2913             : 
    2914           0 :         subreq = dcerpc_winreg_GetKeySecurity_r_send(state, ev, h, &state->tmp);
    2915           0 :         if (tevent_req_nomem(subreq, req)) {
    2916           0 :                 return tevent_req_post(req, ev);
    2917             :         }
    2918           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_GetKeySecurity_done, req);
    2919           0 :         return req;
    2920             : }
    2921             : 
    2922           0 : static void dcerpc_winreg_GetKeySecurity_done(struct tevent_req *subreq)
    2923             : {
    2924           0 :         struct tevent_req *req = tevent_req_callback_data(
    2925             :                 subreq, struct tevent_req);
    2926           0 :         struct dcerpc_winreg_GetKeySecurity_state *state = tevent_req_data(
    2927             :                 req, struct dcerpc_winreg_GetKeySecurity_state);
    2928           0 :         NTSTATUS status;
    2929           0 :         TALLOC_CTX *mem_ctx;
    2930             : 
    2931           0 :         if (state->out_mem_ctx) {
    2932           0 :                 mem_ctx = state->out_mem_ctx;
    2933             :         } else {
    2934           0 :                 mem_ctx = state;
    2935             :         }
    2936             : 
    2937           0 :         status = dcerpc_winreg_GetKeySecurity_r_recv(subreq, mem_ctx);
    2938           0 :         TALLOC_FREE(subreq);
    2939           0 :         if (tevent_req_nterror(req, status)) {
    2940           0 :                 return;
    2941             :         }
    2942             : 
    2943             :         /* Copy out parameters */
    2944           0 :         *state->orig.out.sd = *state->tmp.out.sd;
    2945             : 
    2946             :         /* Copy result */
    2947           0 :         state->orig.out.result = state->tmp.out.result;
    2948             : 
    2949             :         /* Reset temporary structure */
    2950           0 :         NDR_ZERO_STRUCT(state->tmp);
    2951             : 
    2952           0 :         tevent_req_done(req);
    2953             : }
    2954             : 
    2955           0 : NTSTATUS dcerpc_winreg_GetKeySecurity_recv(struct tevent_req *req,
    2956             :                                            TALLOC_CTX *mem_ctx,
    2957             :                                            WERROR *result)
    2958             : {
    2959           0 :         struct dcerpc_winreg_GetKeySecurity_state *state = tevent_req_data(
    2960             :                 req, struct dcerpc_winreg_GetKeySecurity_state);
    2961           0 :         NTSTATUS status;
    2962             : 
    2963           0 :         if (tevent_req_is_nterror(req, &status)) {
    2964           0 :                 tevent_req_received(req);
    2965           0 :                 return status;
    2966             :         }
    2967             : 
    2968             :         /* Steal possible out parameters to the callers context */
    2969           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    2970             : 
    2971             :         /* Return result */
    2972           0 :         *result = state->orig.out.result;
    2973             : 
    2974           0 :         tevent_req_received(req);
    2975           0 :         return NT_STATUS_OK;
    2976             : }
    2977             : 
    2978           0 : NTSTATUS dcerpc_winreg_GetKeySecurity(struct dcerpc_binding_handle *h,
    2979             :                                       TALLOC_CTX *mem_ctx,
    2980             :                                       struct policy_handle *_handle /* [in] [ref] */,
    2981             :                                       uint32_t _sec_info /* [in]  */,
    2982             :                                       struct KeySecurityData *_sd /* [in,out] [ref] */,
    2983             :                                       WERROR *result)
    2984             : {
    2985           0 :         struct winreg_GetKeySecurity r;
    2986           0 :         NTSTATUS status;
    2987             : 
    2988             :         /* In parameters */
    2989           0 :         r.in.handle = _handle;
    2990           0 :         r.in.sec_info = _sec_info;
    2991           0 :         r.in.sd = _sd;
    2992             : 
    2993             :         /* Out parameters */
    2994           0 :         r.out.sd = _sd;
    2995             : 
    2996             :         /* Result */
    2997           0 :         NDR_ZERO_STRUCT(r.out.result);
    2998             : 
    2999           0 :         status = dcerpc_winreg_GetKeySecurity_r(h, mem_ctx, &r);
    3000           0 :         if (!NT_STATUS_IS_OK(status)) {
    3001           0 :                 return status;
    3002             :         }
    3003             : 
    3004             :         /* Return variables */
    3005           0 :         *_sd = *r.out.sd;
    3006             : 
    3007             :         /* Return result */
    3008           0 :         *result = r.out.result;
    3009             : 
    3010           0 :         return NT_STATUS_OK;
    3011             : }
    3012             : 
    3013             : struct dcerpc_winreg_LoadKey_r_state {
    3014             :         TALLOC_CTX *out_mem_ctx;
    3015             : };
    3016             : 
    3017             : static void dcerpc_winreg_LoadKey_r_done(struct tevent_req *subreq);
    3018             : 
    3019           0 : struct tevent_req *dcerpc_winreg_LoadKey_r_send(TALLOC_CTX *mem_ctx,
    3020             :         struct tevent_context *ev,
    3021             :         struct dcerpc_binding_handle *h,
    3022             :         struct winreg_LoadKey *r)
    3023             : {
    3024           0 :         struct tevent_req *req;
    3025           0 :         struct dcerpc_winreg_LoadKey_r_state *state;
    3026           0 :         struct tevent_req *subreq;
    3027             : 
    3028           0 :         req = tevent_req_create(mem_ctx, &state,
    3029             :                                 struct dcerpc_winreg_LoadKey_r_state);
    3030           0 :         if (req == NULL) {
    3031           0 :                 return NULL;
    3032             :         }
    3033             : 
    3034           0 :         state->out_mem_ctx = NULL;
    3035             : 
    3036           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3037             :                         NULL, &ndr_table_winreg,
    3038             :                         NDR_WINREG_LOADKEY, state, r);
    3039           0 :         if (tevent_req_nomem(subreq, req)) {
    3040           0 :                 return tevent_req_post(req, ev);
    3041             :         }
    3042           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_LoadKey_r_done, req);
    3043             : 
    3044           0 :         return req;
    3045             : }
    3046             : 
    3047           0 : static void dcerpc_winreg_LoadKey_r_done(struct tevent_req *subreq)
    3048             : {
    3049           0 :         struct tevent_req *req =
    3050           0 :                 tevent_req_callback_data(subreq,
    3051             :                 struct tevent_req);
    3052           0 :         NTSTATUS status;
    3053             : 
    3054           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3055           0 :         TALLOC_FREE(subreq);
    3056           0 :         if (tevent_req_nterror(req, status)) {
    3057           0 :                 return;
    3058             :         }
    3059             : 
    3060           0 :         tevent_req_done(req);
    3061             : }
    3062             : 
    3063           0 : NTSTATUS dcerpc_winreg_LoadKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3064             : {
    3065           0 :         struct dcerpc_winreg_LoadKey_r_state *state =
    3066           0 :                 tevent_req_data(req,
    3067             :                 struct dcerpc_winreg_LoadKey_r_state);
    3068           0 :         NTSTATUS status;
    3069             : 
    3070           0 :         if (tevent_req_is_nterror(req, &status)) {
    3071           0 :                 tevent_req_received(req);
    3072           0 :                 return status;
    3073             :         }
    3074             : 
    3075           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3076             : 
    3077           0 :         tevent_req_received(req);
    3078           0 :         return NT_STATUS_OK;
    3079             : }
    3080             : 
    3081           0 : NTSTATUS dcerpc_winreg_LoadKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_LoadKey *r)
    3082             : {
    3083           0 :         NTSTATUS status;
    3084             : 
    3085           0 :         status = dcerpc_binding_handle_call(h,
    3086             :                         NULL, &ndr_table_winreg,
    3087             :                         NDR_WINREG_LOADKEY, mem_ctx, r);
    3088             : 
    3089           0 :         return status;
    3090             : }
    3091             : 
    3092             : struct dcerpc_winreg_LoadKey_state {
    3093             :         struct winreg_LoadKey orig;
    3094             :         struct winreg_LoadKey tmp;
    3095             :         TALLOC_CTX *out_mem_ctx;
    3096             : };
    3097             : 
    3098             : static void dcerpc_winreg_LoadKey_done(struct tevent_req *subreq);
    3099             : 
    3100           0 : struct tevent_req *dcerpc_winreg_LoadKey_send(TALLOC_CTX *mem_ctx,
    3101             :                                               struct tevent_context *ev,
    3102             :                                               struct dcerpc_binding_handle *h,
    3103             :                                               struct policy_handle *_handle /* [in] [ref] */,
    3104             :                                               struct winreg_String *_keyname /* [in] [unique] */,
    3105             :                                               struct winreg_String *_filename /* [in] [unique] */)
    3106             : {
    3107           0 :         struct tevent_req *req;
    3108           0 :         struct dcerpc_winreg_LoadKey_state *state;
    3109           0 :         struct tevent_req *subreq;
    3110             : 
    3111           0 :         req = tevent_req_create(mem_ctx, &state,
    3112             :                                 struct dcerpc_winreg_LoadKey_state);
    3113           0 :         if (req == NULL) {
    3114           0 :                 return NULL;
    3115             :         }
    3116           0 :         state->out_mem_ctx = NULL;
    3117             : 
    3118             :         /* In parameters */
    3119           0 :         state->orig.in.handle = _handle;
    3120           0 :         state->orig.in.keyname = _keyname;
    3121           0 :         state->orig.in.filename = _filename;
    3122             : 
    3123             :         /* Out parameters */
    3124             : 
    3125             :         /* Result */
    3126           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3127             : 
    3128             :         /* make a temporary copy, that we pass to the dispatch function */
    3129           0 :         state->tmp = state->orig;
    3130             : 
    3131           0 :         subreq = dcerpc_winreg_LoadKey_r_send(state, ev, h, &state->tmp);
    3132           0 :         if (tevent_req_nomem(subreq, req)) {
    3133           0 :                 return tevent_req_post(req, ev);
    3134             :         }
    3135           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_LoadKey_done, req);
    3136           0 :         return req;
    3137             : }
    3138             : 
    3139           0 : static void dcerpc_winreg_LoadKey_done(struct tevent_req *subreq)
    3140             : {
    3141           0 :         struct tevent_req *req = tevent_req_callback_data(
    3142             :                 subreq, struct tevent_req);
    3143           0 :         struct dcerpc_winreg_LoadKey_state *state = tevent_req_data(
    3144             :                 req, struct dcerpc_winreg_LoadKey_state);
    3145           0 :         NTSTATUS status;
    3146           0 :         TALLOC_CTX *mem_ctx;
    3147             : 
    3148           0 :         if (state->out_mem_ctx) {
    3149           0 :                 mem_ctx = state->out_mem_ctx;
    3150             :         } else {
    3151           0 :                 mem_ctx = state;
    3152             :         }
    3153             : 
    3154           0 :         status = dcerpc_winreg_LoadKey_r_recv(subreq, mem_ctx);
    3155           0 :         TALLOC_FREE(subreq);
    3156           0 :         if (tevent_req_nterror(req, status)) {
    3157           0 :                 return;
    3158             :         }
    3159             : 
    3160             :         /* Copy out parameters */
    3161             : 
    3162             :         /* Copy result */
    3163           0 :         state->orig.out.result = state->tmp.out.result;
    3164             : 
    3165             :         /* Reset temporary structure */
    3166           0 :         NDR_ZERO_STRUCT(state->tmp);
    3167             : 
    3168           0 :         tevent_req_done(req);
    3169             : }
    3170             : 
    3171           0 : NTSTATUS dcerpc_winreg_LoadKey_recv(struct tevent_req *req,
    3172             :                                     TALLOC_CTX *mem_ctx,
    3173             :                                     WERROR *result)
    3174             : {
    3175           0 :         struct dcerpc_winreg_LoadKey_state *state = tevent_req_data(
    3176             :                 req, struct dcerpc_winreg_LoadKey_state);
    3177           0 :         NTSTATUS status;
    3178             : 
    3179           0 :         if (tevent_req_is_nterror(req, &status)) {
    3180           0 :                 tevent_req_received(req);
    3181           0 :                 return status;
    3182             :         }
    3183             : 
    3184             :         /* Steal possible out parameters to the callers context */
    3185           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3186             : 
    3187             :         /* Return result */
    3188           0 :         *result = state->orig.out.result;
    3189             : 
    3190           0 :         tevent_req_received(req);
    3191           0 :         return NT_STATUS_OK;
    3192             : }
    3193             : 
    3194           0 : NTSTATUS dcerpc_winreg_LoadKey(struct dcerpc_binding_handle *h,
    3195             :                                TALLOC_CTX *mem_ctx,
    3196             :                                struct policy_handle *_handle /* [in] [ref] */,
    3197             :                                struct winreg_String *_keyname /* [in] [unique] */,
    3198             :                                struct winreg_String *_filename /* [in] [unique] */,
    3199             :                                WERROR *result)
    3200             : {
    3201           0 :         struct winreg_LoadKey r;
    3202           0 :         NTSTATUS status;
    3203             : 
    3204             :         /* In parameters */
    3205           0 :         r.in.handle = _handle;
    3206           0 :         r.in.keyname = _keyname;
    3207           0 :         r.in.filename = _filename;
    3208             : 
    3209             :         /* Out parameters */
    3210             : 
    3211             :         /* Result */
    3212           0 :         NDR_ZERO_STRUCT(r.out.result);
    3213             : 
    3214           0 :         status = dcerpc_winreg_LoadKey_r(h, mem_ctx, &r);
    3215           0 :         if (!NT_STATUS_IS_OK(status)) {
    3216           0 :                 return status;
    3217             :         }
    3218             : 
    3219             :         /* Return variables */
    3220             : 
    3221             :         /* Return result */
    3222           0 :         *result = r.out.result;
    3223             : 
    3224           0 :         return NT_STATUS_OK;
    3225             : }
    3226             : 
    3227             : struct dcerpc_winreg_NotifyChangeKeyValue_r_state {
    3228             :         TALLOC_CTX *out_mem_ctx;
    3229             : };
    3230             : 
    3231             : static void dcerpc_winreg_NotifyChangeKeyValue_r_done(struct tevent_req *subreq);
    3232             : 
    3233           0 : struct tevent_req *dcerpc_winreg_NotifyChangeKeyValue_r_send(TALLOC_CTX *mem_ctx,
    3234             :         struct tevent_context *ev,
    3235             :         struct dcerpc_binding_handle *h,
    3236             :         struct winreg_NotifyChangeKeyValue *r)
    3237             : {
    3238           0 :         struct tevent_req *req;
    3239           0 :         struct dcerpc_winreg_NotifyChangeKeyValue_r_state *state;
    3240           0 :         struct tevent_req *subreq;
    3241             : 
    3242           0 :         req = tevent_req_create(mem_ctx, &state,
    3243             :                                 struct dcerpc_winreg_NotifyChangeKeyValue_r_state);
    3244           0 :         if (req == NULL) {
    3245           0 :                 return NULL;
    3246             :         }
    3247             : 
    3248           0 :         state->out_mem_ctx = NULL;
    3249             : 
    3250           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3251             :                         NULL, &ndr_table_winreg,
    3252             :                         NDR_WINREG_NOTIFYCHANGEKEYVALUE, state, r);
    3253           0 :         if (tevent_req_nomem(subreq, req)) {
    3254           0 :                 return tevent_req_post(req, ev);
    3255             :         }
    3256           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_NotifyChangeKeyValue_r_done, req);
    3257             : 
    3258           0 :         return req;
    3259             : }
    3260             : 
    3261           0 : static void dcerpc_winreg_NotifyChangeKeyValue_r_done(struct tevent_req *subreq)
    3262             : {
    3263           0 :         struct tevent_req *req =
    3264           0 :                 tevent_req_callback_data(subreq,
    3265             :                 struct tevent_req);
    3266           0 :         NTSTATUS status;
    3267             : 
    3268           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3269           0 :         TALLOC_FREE(subreq);
    3270           0 :         if (tevent_req_nterror(req, status)) {
    3271           0 :                 return;
    3272             :         }
    3273             : 
    3274           0 :         tevent_req_done(req);
    3275             : }
    3276             : 
    3277           0 : NTSTATUS dcerpc_winreg_NotifyChangeKeyValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3278             : {
    3279           0 :         struct dcerpc_winreg_NotifyChangeKeyValue_r_state *state =
    3280           0 :                 tevent_req_data(req,
    3281             :                 struct dcerpc_winreg_NotifyChangeKeyValue_r_state);
    3282           0 :         NTSTATUS status;
    3283             : 
    3284           0 :         if (tevent_req_is_nterror(req, &status)) {
    3285           0 :                 tevent_req_received(req);
    3286           0 :                 return status;
    3287             :         }
    3288             : 
    3289           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3290             : 
    3291           0 :         tevent_req_received(req);
    3292           0 :         return NT_STATUS_OK;
    3293             : }
    3294             : 
    3295         268 : NTSTATUS dcerpc_winreg_NotifyChangeKeyValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_NotifyChangeKeyValue *r)
    3296             : {
    3297           0 :         NTSTATUS status;
    3298             : 
    3299         268 :         status = dcerpc_binding_handle_call(h,
    3300             :                         NULL, &ndr_table_winreg,
    3301             :                         NDR_WINREG_NOTIFYCHANGEKEYVALUE, mem_ctx, r);
    3302             : 
    3303         268 :         return status;
    3304             : }
    3305             : 
    3306             : struct dcerpc_winreg_NotifyChangeKeyValue_state {
    3307             :         struct winreg_NotifyChangeKeyValue orig;
    3308             :         struct winreg_NotifyChangeKeyValue tmp;
    3309             :         TALLOC_CTX *out_mem_ctx;
    3310             : };
    3311             : 
    3312             : static void dcerpc_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq);
    3313             : 
    3314           0 : struct tevent_req *dcerpc_winreg_NotifyChangeKeyValue_send(TALLOC_CTX *mem_ctx,
    3315             :                                                            struct tevent_context *ev,
    3316             :                                                            struct dcerpc_binding_handle *h,
    3317             :                                                            struct policy_handle *_handle /* [in] [ref] */,
    3318             :                                                            uint8_t _watch_subtree /* [in]  */,
    3319             :                                                            uint32_t _notify_filter /* [in]  */,
    3320             :                                                            uint32_t _unknown /* [in]  */,
    3321             :                                                            struct winreg_String _string1 /* [in]  */,
    3322             :                                                            struct winreg_String _string2 /* [in]  */,
    3323             :                                                            uint32_t _unknown2 /* [in]  */)
    3324             : {
    3325           0 :         struct tevent_req *req;
    3326           0 :         struct dcerpc_winreg_NotifyChangeKeyValue_state *state;
    3327           0 :         struct tevent_req *subreq;
    3328             : 
    3329           0 :         req = tevent_req_create(mem_ctx, &state,
    3330             :                                 struct dcerpc_winreg_NotifyChangeKeyValue_state);
    3331           0 :         if (req == NULL) {
    3332           0 :                 return NULL;
    3333             :         }
    3334           0 :         state->out_mem_ctx = NULL;
    3335             : 
    3336             :         /* In parameters */
    3337           0 :         state->orig.in.handle = _handle;
    3338           0 :         state->orig.in.watch_subtree = _watch_subtree;
    3339           0 :         state->orig.in.notify_filter = _notify_filter;
    3340           0 :         state->orig.in.unknown = _unknown;
    3341           0 :         state->orig.in.string1 = _string1;
    3342           0 :         state->orig.in.string2 = _string2;
    3343           0 :         state->orig.in.unknown2 = _unknown2;
    3344             : 
    3345             :         /* Out parameters */
    3346             : 
    3347             :         /* Result */
    3348           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3349             : 
    3350             :         /* make a temporary copy, that we pass to the dispatch function */
    3351           0 :         state->tmp = state->orig;
    3352             : 
    3353           0 :         subreq = dcerpc_winreg_NotifyChangeKeyValue_r_send(state, ev, h, &state->tmp);
    3354           0 :         if (tevent_req_nomem(subreq, req)) {
    3355           0 :                 return tevent_req_post(req, ev);
    3356             :         }
    3357           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_NotifyChangeKeyValue_done, req);
    3358           0 :         return req;
    3359             : }
    3360             : 
    3361           0 : static void dcerpc_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq)
    3362             : {
    3363           0 :         struct tevent_req *req = tevent_req_callback_data(
    3364             :                 subreq, struct tevent_req);
    3365           0 :         struct dcerpc_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
    3366             :                 req, struct dcerpc_winreg_NotifyChangeKeyValue_state);
    3367           0 :         NTSTATUS status;
    3368           0 :         TALLOC_CTX *mem_ctx;
    3369             : 
    3370           0 :         if (state->out_mem_ctx) {
    3371           0 :                 mem_ctx = state->out_mem_ctx;
    3372             :         } else {
    3373           0 :                 mem_ctx = state;
    3374             :         }
    3375             : 
    3376           0 :         status = dcerpc_winreg_NotifyChangeKeyValue_r_recv(subreq, mem_ctx);
    3377           0 :         TALLOC_FREE(subreq);
    3378           0 :         if (tevent_req_nterror(req, status)) {
    3379           0 :                 return;
    3380             :         }
    3381             : 
    3382             :         /* Copy out parameters */
    3383             : 
    3384             :         /* Copy result */
    3385           0 :         state->orig.out.result = state->tmp.out.result;
    3386             : 
    3387             :         /* Reset temporary structure */
    3388           0 :         NDR_ZERO_STRUCT(state->tmp);
    3389             : 
    3390           0 :         tevent_req_done(req);
    3391             : }
    3392             : 
    3393           0 : NTSTATUS dcerpc_winreg_NotifyChangeKeyValue_recv(struct tevent_req *req,
    3394             :                                                  TALLOC_CTX *mem_ctx,
    3395             :                                                  WERROR *result)
    3396             : {
    3397           0 :         struct dcerpc_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
    3398             :                 req, struct dcerpc_winreg_NotifyChangeKeyValue_state);
    3399           0 :         NTSTATUS status;
    3400             : 
    3401           0 :         if (tevent_req_is_nterror(req, &status)) {
    3402           0 :                 tevent_req_received(req);
    3403           0 :                 return status;
    3404             :         }
    3405             : 
    3406             :         /* Steal possible out parameters to the callers context */
    3407           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3408             : 
    3409             :         /* Return result */
    3410           0 :         *result = state->orig.out.result;
    3411             : 
    3412           0 :         tevent_req_received(req);
    3413           0 :         return NT_STATUS_OK;
    3414             : }
    3415             : 
    3416           0 : NTSTATUS dcerpc_winreg_NotifyChangeKeyValue(struct dcerpc_binding_handle *h,
    3417             :                                             TALLOC_CTX *mem_ctx,
    3418             :                                             struct policy_handle *_handle /* [in] [ref] */,
    3419             :                                             uint8_t _watch_subtree /* [in]  */,
    3420             :                                             uint32_t _notify_filter /* [in]  */,
    3421             :                                             uint32_t _unknown /* [in]  */,
    3422             :                                             struct winreg_String _string1 /* [in]  */,
    3423             :                                             struct winreg_String _string2 /* [in]  */,
    3424             :                                             uint32_t _unknown2 /* [in]  */,
    3425             :                                             WERROR *result)
    3426             : {
    3427           0 :         struct winreg_NotifyChangeKeyValue r;
    3428           0 :         NTSTATUS status;
    3429             : 
    3430             :         /* In parameters */
    3431           0 :         r.in.handle = _handle;
    3432           0 :         r.in.watch_subtree = _watch_subtree;
    3433           0 :         r.in.notify_filter = _notify_filter;
    3434           0 :         r.in.unknown = _unknown;
    3435           0 :         r.in.string1 = _string1;
    3436           0 :         r.in.string2 = _string2;
    3437           0 :         r.in.unknown2 = _unknown2;
    3438             : 
    3439             :         /* Out parameters */
    3440             : 
    3441             :         /* Result */
    3442           0 :         NDR_ZERO_STRUCT(r.out.result);
    3443             : 
    3444           0 :         status = dcerpc_winreg_NotifyChangeKeyValue_r(h, mem_ctx, &r);
    3445           0 :         if (!NT_STATUS_IS_OK(status)) {
    3446           0 :                 return status;
    3447             :         }
    3448             : 
    3449             :         /* Return variables */
    3450             : 
    3451             :         /* Return result */
    3452           0 :         *result = r.out.result;
    3453             : 
    3454           0 :         return NT_STATUS_OK;
    3455             : }
    3456             : 
    3457             : struct dcerpc_winreg_OpenKey_r_state {
    3458             :         TALLOC_CTX *out_mem_ctx;
    3459             : };
    3460             : 
    3461             : static void dcerpc_winreg_OpenKey_r_done(struct tevent_req *subreq);
    3462             : 
    3463           0 : struct tevent_req *dcerpc_winreg_OpenKey_r_send(TALLOC_CTX *mem_ctx,
    3464             :         struct tevent_context *ev,
    3465             :         struct dcerpc_binding_handle *h,
    3466             :         struct winreg_OpenKey *r)
    3467             : {
    3468           0 :         struct tevent_req *req;
    3469           0 :         struct dcerpc_winreg_OpenKey_r_state *state;
    3470           0 :         struct tevent_req *subreq;
    3471             : 
    3472           0 :         req = tevent_req_create(mem_ctx, &state,
    3473             :                                 struct dcerpc_winreg_OpenKey_r_state);
    3474           0 :         if (req == NULL) {
    3475           0 :                 return NULL;
    3476             :         }
    3477             : 
    3478           0 :         state->out_mem_ctx = talloc_new(state);
    3479           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3480           0 :                 return tevent_req_post(req, ev);
    3481             :         }
    3482             : 
    3483           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3484             :                         NULL, &ndr_table_winreg,
    3485           0 :                         NDR_WINREG_OPENKEY, state->out_mem_ctx, r);
    3486           0 :         if (tevent_req_nomem(subreq, req)) {
    3487           0 :                 return tevent_req_post(req, ev);
    3488             :         }
    3489           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenKey_r_done, req);
    3490             : 
    3491           0 :         return req;
    3492             : }
    3493             : 
    3494           0 : static void dcerpc_winreg_OpenKey_r_done(struct tevent_req *subreq)
    3495             : {
    3496           0 :         struct tevent_req *req =
    3497           0 :                 tevent_req_callback_data(subreq,
    3498             :                 struct tevent_req);
    3499           0 :         NTSTATUS status;
    3500             : 
    3501           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3502           0 :         TALLOC_FREE(subreq);
    3503           0 :         if (tevent_req_nterror(req, status)) {
    3504           0 :                 return;
    3505             :         }
    3506             : 
    3507           0 :         tevent_req_done(req);
    3508             : }
    3509             : 
    3510           0 : NTSTATUS dcerpc_winreg_OpenKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3511             : {
    3512           0 :         struct dcerpc_winreg_OpenKey_r_state *state =
    3513           0 :                 tevent_req_data(req,
    3514             :                 struct dcerpc_winreg_OpenKey_r_state);
    3515           0 :         NTSTATUS status;
    3516             : 
    3517           0 :         if (tevent_req_is_nterror(req, &status)) {
    3518           0 :                 tevent_req_received(req);
    3519           0 :                 return status;
    3520             :         }
    3521             : 
    3522           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3523             : 
    3524           0 :         tevent_req_received(req);
    3525           0 :         return NT_STATUS_OK;
    3526             : }
    3527             : 
    3528       43070 : NTSTATUS dcerpc_winreg_OpenKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenKey *r)
    3529             : {
    3530           0 :         NTSTATUS status;
    3531             : 
    3532       43070 :         status = dcerpc_binding_handle_call(h,
    3533             :                         NULL, &ndr_table_winreg,
    3534             :                         NDR_WINREG_OPENKEY, mem_ctx, r);
    3535             : 
    3536       43070 :         return status;
    3537             : }
    3538             : 
    3539             : struct dcerpc_winreg_OpenKey_state {
    3540             :         struct winreg_OpenKey orig;
    3541             :         struct winreg_OpenKey tmp;
    3542             :         TALLOC_CTX *out_mem_ctx;
    3543             : };
    3544             : 
    3545             : static void dcerpc_winreg_OpenKey_done(struct tevent_req *subreq);
    3546             : 
    3547           0 : struct tevent_req *dcerpc_winreg_OpenKey_send(TALLOC_CTX *mem_ctx,
    3548             :                                               struct tevent_context *ev,
    3549             :                                               struct dcerpc_binding_handle *h,
    3550             :                                               struct policy_handle *_parent_handle /* [in] [ref] */,
    3551             :                                               struct winreg_String _keyname /* [in]  */,
    3552             :                                               uint32_t _options /* [in]  */,
    3553             :                                               uint32_t _access_mask /* [in]  */,
    3554             :                                               struct policy_handle *_handle /* [out] [ref] */)
    3555             : {
    3556           0 :         struct tevent_req *req;
    3557           0 :         struct dcerpc_winreg_OpenKey_state *state;
    3558           0 :         struct tevent_req *subreq;
    3559             : 
    3560           0 :         req = tevent_req_create(mem_ctx, &state,
    3561             :                                 struct dcerpc_winreg_OpenKey_state);
    3562           0 :         if (req == NULL) {
    3563           0 :                 return NULL;
    3564             :         }
    3565           0 :         state->out_mem_ctx = NULL;
    3566             : 
    3567             :         /* In parameters */
    3568           0 :         state->orig.in.parent_handle = _parent_handle;
    3569           0 :         state->orig.in.keyname = _keyname;
    3570           0 :         state->orig.in.options = _options;
    3571           0 :         state->orig.in.access_mask = _access_mask;
    3572             : 
    3573             :         /* Out parameters */
    3574           0 :         state->orig.out.handle = _handle;
    3575             : 
    3576             :         /* Result */
    3577           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3578             : 
    3579           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3580             :                              "dcerpc_winreg_OpenKey_out_memory");
    3581           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3582           0 :                 return tevent_req_post(req, ev);
    3583             :         }
    3584             : 
    3585             :         /* make a temporary copy, that we pass to the dispatch function */
    3586           0 :         state->tmp = state->orig;
    3587             : 
    3588           0 :         subreq = dcerpc_winreg_OpenKey_r_send(state, ev, h, &state->tmp);
    3589           0 :         if (tevent_req_nomem(subreq, req)) {
    3590           0 :                 return tevent_req_post(req, ev);
    3591             :         }
    3592           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenKey_done, req);
    3593           0 :         return req;
    3594             : }
    3595             : 
    3596           0 : static void dcerpc_winreg_OpenKey_done(struct tevent_req *subreq)
    3597             : {
    3598           0 :         struct tevent_req *req = tevent_req_callback_data(
    3599             :                 subreq, struct tevent_req);
    3600           0 :         struct dcerpc_winreg_OpenKey_state *state = tevent_req_data(
    3601             :                 req, struct dcerpc_winreg_OpenKey_state);
    3602           0 :         NTSTATUS status;
    3603           0 :         TALLOC_CTX *mem_ctx;
    3604             : 
    3605           0 :         if (state->out_mem_ctx) {
    3606           0 :                 mem_ctx = state->out_mem_ctx;
    3607             :         } else {
    3608           0 :                 mem_ctx = state;
    3609             :         }
    3610             : 
    3611           0 :         status = dcerpc_winreg_OpenKey_r_recv(subreq, mem_ctx);
    3612           0 :         TALLOC_FREE(subreq);
    3613           0 :         if (tevent_req_nterror(req, status)) {
    3614           0 :                 return;
    3615             :         }
    3616             : 
    3617             :         /* Copy out parameters */
    3618           0 :         *state->orig.out.handle = *state->tmp.out.handle;
    3619             : 
    3620             :         /* Copy result */
    3621           0 :         state->orig.out.result = state->tmp.out.result;
    3622             : 
    3623             :         /* Reset temporary structure */
    3624           0 :         NDR_ZERO_STRUCT(state->tmp);
    3625             : 
    3626           0 :         tevent_req_done(req);
    3627             : }
    3628             : 
    3629           0 : NTSTATUS dcerpc_winreg_OpenKey_recv(struct tevent_req *req,
    3630             :                                     TALLOC_CTX *mem_ctx,
    3631             :                                     WERROR *result)
    3632             : {
    3633           0 :         struct dcerpc_winreg_OpenKey_state *state = tevent_req_data(
    3634             :                 req, struct dcerpc_winreg_OpenKey_state);
    3635           0 :         NTSTATUS status;
    3636             : 
    3637           0 :         if (tevent_req_is_nterror(req, &status)) {
    3638           0 :                 tevent_req_received(req);
    3639           0 :                 return status;
    3640             :         }
    3641             : 
    3642             :         /* Steal possible out parameters to the callers context */
    3643           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3644             : 
    3645             :         /* Return result */
    3646           0 :         *result = state->orig.out.result;
    3647             : 
    3648           0 :         tevent_req_received(req);
    3649           0 :         return NT_STATUS_OK;
    3650             : }
    3651             : 
    3652       41650 : NTSTATUS dcerpc_winreg_OpenKey(struct dcerpc_binding_handle *h,
    3653             :                                TALLOC_CTX *mem_ctx,
    3654             :                                struct policy_handle *_parent_handle /* [in] [ref] */,
    3655             :                                struct winreg_String _keyname /* [in]  */,
    3656             :                                uint32_t _options /* [in]  */,
    3657             :                                uint32_t _access_mask /* [in]  */,
    3658             :                                struct policy_handle *_handle /* [out] [ref] */,
    3659             :                                WERROR *result)
    3660             : {
    3661           0 :         struct winreg_OpenKey r;
    3662           0 :         NTSTATUS status;
    3663             : 
    3664             :         /* In parameters */
    3665       41650 :         r.in.parent_handle = _parent_handle;
    3666       41650 :         r.in.keyname = _keyname;
    3667       41650 :         r.in.options = _options;
    3668       41650 :         r.in.access_mask = _access_mask;
    3669             : 
    3670             :         /* Out parameters */
    3671       41650 :         r.out.handle = _handle;
    3672             : 
    3673             :         /* Result */
    3674       41650 :         NDR_ZERO_STRUCT(r.out.result);
    3675             : 
    3676       41650 :         status = dcerpc_winreg_OpenKey_r(h, mem_ctx, &r);
    3677       41650 :         if (!NT_STATUS_IS_OK(status)) {
    3678           0 :                 return status;
    3679             :         }
    3680             : 
    3681             :         /* Return variables */
    3682       41650 :         *_handle = *r.out.handle;
    3683             : 
    3684             :         /* Return result */
    3685       41650 :         *result = r.out.result;
    3686             : 
    3687       41650 :         return NT_STATUS_OK;
    3688             : }
    3689             : 
    3690             : struct dcerpc_winreg_QueryInfoKey_r_state {
    3691             :         TALLOC_CTX *out_mem_ctx;
    3692             : };
    3693             : 
    3694             : static void dcerpc_winreg_QueryInfoKey_r_done(struct tevent_req *subreq);
    3695             : 
    3696           0 : struct tevent_req *dcerpc_winreg_QueryInfoKey_r_send(TALLOC_CTX *mem_ctx,
    3697             :         struct tevent_context *ev,
    3698             :         struct dcerpc_binding_handle *h,
    3699             :         struct winreg_QueryInfoKey *r)
    3700             : {
    3701           0 :         struct tevent_req *req;
    3702           0 :         struct dcerpc_winreg_QueryInfoKey_r_state *state;
    3703           0 :         struct tevent_req *subreq;
    3704             : 
    3705           0 :         req = tevent_req_create(mem_ctx, &state,
    3706             :                                 struct dcerpc_winreg_QueryInfoKey_r_state);
    3707           0 :         if (req == NULL) {
    3708           0 :                 return NULL;
    3709             :         }
    3710             : 
    3711           0 :         state->out_mem_ctx = talloc_new(state);
    3712           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3713           0 :                 return tevent_req_post(req, ev);
    3714             :         }
    3715             : 
    3716           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3717             :                         NULL, &ndr_table_winreg,
    3718           0 :                         NDR_WINREG_QUERYINFOKEY, state->out_mem_ctx, r);
    3719           0 :         if (tevent_req_nomem(subreq, req)) {
    3720           0 :                 return tevent_req_post(req, ev);
    3721             :         }
    3722           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_QueryInfoKey_r_done, req);
    3723             : 
    3724           0 :         return req;
    3725             : }
    3726             : 
    3727           0 : static void dcerpc_winreg_QueryInfoKey_r_done(struct tevent_req *subreq)
    3728             : {
    3729           0 :         struct tevent_req *req =
    3730           0 :                 tevent_req_callback_data(subreq,
    3731             :                 struct tevent_req);
    3732           0 :         NTSTATUS status;
    3733             : 
    3734           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    3735           0 :         TALLOC_FREE(subreq);
    3736           0 :         if (tevent_req_nterror(req, status)) {
    3737           0 :                 return;
    3738             :         }
    3739             : 
    3740           0 :         tevent_req_done(req);
    3741             : }
    3742             : 
    3743           0 : NTSTATUS dcerpc_winreg_QueryInfoKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    3744             : {
    3745           0 :         struct dcerpc_winreg_QueryInfoKey_r_state *state =
    3746           0 :                 tevent_req_data(req,
    3747             :                 struct dcerpc_winreg_QueryInfoKey_r_state);
    3748           0 :         NTSTATUS status;
    3749             : 
    3750           0 :         if (tevent_req_is_nterror(req, &status)) {
    3751           0 :                 tevent_req_received(req);
    3752           0 :                 return status;
    3753             :         }
    3754             : 
    3755           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3756             : 
    3757           0 :         tevent_req_received(req);
    3758           0 :         return NT_STATUS_OK;
    3759             : }
    3760             : 
    3761       20571 : NTSTATUS dcerpc_winreg_QueryInfoKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_QueryInfoKey *r)
    3762             : {
    3763           0 :         NTSTATUS status;
    3764             : 
    3765       20571 :         status = dcerpc_binding_handle_call(h,
    3766             :                         NULL, &ndr_table_winreg,
    3767             :                         NDR_WINREG_QUERYINFOKEY, mem_ctx, r);
    3768             : 
    3769       20571 :         return status;
    3770             : }
    3771             : 
    3772             : struct dcerpc_winreg_QueryInfoKey_state {
    3773             :         struct winreg_QueryInfoKey orig;
    3774             :         struct winreg_QueryInfoKey tmp;
    3775             :         TALLOC_CTX *out_mem_ctx;
    3776             : };
    3777             : 
    3778             : static void dcerpc_winreg_QueryInfoKey_done(struct tevent_req *subreq);
    3779             : 
    3780           0 : struct tevent_req *dcerpc_winreg_QueryInfoKey_send(TALLOC_CTX *mem_ctx,
    3781             :                                                    struct tevent_context *ev,
    3782             :                                                    struct dcerpc_binding_handle *h,
    3783             :                                                    struct policy_handle *_handle /* [in] [ref] */,
    3784             :                                                    struct winreg_String *_classname /* [in,out] [ref] */,
    3785             :                                                    uint32_t *_num_subkeys /* [out] [ref] */,
    3786             :                                                    uint32_t *_max_subkeylen /* [out] [ref] */,
    3787             :                                                    uint32_t *_max_classlen /* [out] [ref] */,
    3788             :                                                    uint32_t *_num_values /* [out] [ref] */,
    3789             :                                                    uint32_t *_max_valnamelen /* [out] [ref] */,
    3790             :                                                    uint32_t *_max_valbufsize /* [out] [ref] */,
    3791             :                                                    uint32_t *_secdescsize /* [out] [ref] */,
    3792             :                                                    NTTIME *_last_changed_time /* [out] [ref] */)
    3793             : {
    3794           0 :         struct tevent_req *req;
    3795           0 :         struct dcerpc_winreg_QueryInfoKey_state *state;
    3796           0 :         struct tevent_req *subreq;
    3797             : 
    3798           0 :         req = tevent_req_create(mem_ctx, &state,
    3799             :                                 struct dcerpc_winreg_QueryInfoKey_state);
    3800           0 :         if (req == NULL) {
    3801           0 :                 return NULL;
    3802             :         }
    3803           0 :         state->out_mem_ctx = NULL;
    3804             : 
    3805             :         /* In parameters */
    3806           0 :         state->orig.in.handle = _handle;
    3807           0 :         state->orig.in.classname = _classname;
    3808             : 
    3809             :         /* Out parameters */
    3810           0 :         state->orig.out.classname = _classname;
    3811           0 :         state->orig.out.num_subkeys = _num_subkeys;
    3812           0 :         state->orig.out.max_subkeylen = _max_subkeylen;
    3813           0 :         state->orig.out.max_classlen = _max_classlen;
    3814           0 :         state->orig.out.num_values = _num_values;
    3815           0 :         state->orig.out.max_valnamelen = _max_valnamelen;
    3816           0 :         state->orig.out.max_valbufsize = _max_valbufsize;
    3817           0 :         state->orig.out.secdescsize = _secdescsize;
    3818           0 :         state->orig.out.last_changed_time = _last_changed_time;
    3819             : 
    3820             :         /* Result */
    3821           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    3822             : 
    3823           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    3824             :                              "dcerpc_winreg_QueryInfoKey_out_memory");
    3825           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3826           0 :                 return tevent_req_post(req, ev);
    3827             :         }
    3828             : 
    3829             :         /* make a temporary copy, that we pass to the dispatch function */
    3830           0 :         state->tmp = state->orig;
    3831             : 
    3832           0 :         subreq = dcerpc_winreg_QueryInfoKey_r_send(state, ev, h, &state->tmp);
    3833           0 :         if (tevent_req_nomem(subreq, req)) {
    3834           0 :                 return tevent_req_post(req, ev);
    3835             :         }
    3836           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_QueryInfoKey_done, req);
    3837           0 :         return req;
    3838             : }
    3839             : 
    3840           0 : static void dcerpc_winreg_QueryInfoKey_done(struct tevent_req *subreq)
    3841             : {
    3842           0 :         struct tevent_req *req = tevent_req_callback_data(
    3843             :                 subreq, struct tevent_req);
    3844           0 :         struct dcerpc_winreg_QueryInfoKey_state *state = tevent_req_data(
    3845             :                 req, struct dcerpc_winreg_QueryInfoKey_state);
    3846           0 :         NTSTATUS status;
    3847           0 :         TALLOC_CTX *mem_ctx;
    3848             : 
    3849           0 :         if (state->out_mem_ctx) {
    3850           0 :                 mem_ctx = state->out_mem_ctx;
    3851             :         } else {
    3852           0 :                 mem_ctx = state;
    3853             :         }
    3854             : 
    3855           0 :         status = dcerpc_winreg_QueryInfoKey_r_recv(subreq, mem_ctx);
    3856           0 :         TALLOC_FREE(subreq);
    3857           0 :         if (tevent_req_nterror(req, status)) {
    3858           0 :                 return;
    3859             :         }
    3860             : 
    3861             :         /* Copy out parameters */
    3862           0 :         *state->orig.out.classname = *state->tmp.out.classname;
    3863           0 :         *state->orig.out.num_subkeys = *state->tmp.out.num_subkeys;
    3864           0 :         *state->orig.out.max_subkeylen = *state->tmp.out.max_subkeylen;
    3865           0 :         *state->orig.out.max_classlen = *state->tmp.out.max_classlen;
    3866           0 :         *state->orig.out.num_values = *state->tmp.out.num_values;
    3867           0 :         *state->orig.out.max_valnamelen = *state->tmp.out.max_valnamelen;
    3868           0 :         *state->orig.out.max_valbufsize = *state->tmp.out.max_valbufsize;
    3869           0 :         *state->orig.out.secdescsize = *state->tmp.out.secdescsize;
    3870           0 :         *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
    3871             : 
    3872             :         /* Copy result */
    3873           0 :         state->orig.out.result = state->tmp.out.result;
    3874             : 
    3875             :         /* Reset temporary structure */
    3876           0 :         NDR_ZERO_STRUCT(state->tmp);
    3877             : 
    3878           0 :         tevent_req_done(req);
    3879             : }
    3880             : 
    3881           0 : NTSTATUS dcerpc_winreg_QueryInfoKey_recv(struct tevent_req *req,
    3882             :                                          TALLOC_CTX *mem_ctx,
    3883             :                                          WERROR *result)
    3884             : {
    3885           0 :         struct dcerpc_winreg_QueryInfoKey_state *state = tevent_req_data(
    3886             :                 req, struct dcerpc_winreg_QueryInfoKey_state);
    3887           0 :         NTSTATUS status;
    3888             : 
    3889           0 :         if (tevent_req_is_nterror(req, &status)) {
    3890           0 :                 tevent_req_received(req);
    3891           0 :                 return status;
    3892             :         }
    3893             : 
    3894             :         /* Steal possible out parameters to the callers context */
    3895           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    3896             : 
    3897             :         /* Return result */
    3898           0 :         *result = state->orig.out.result;
    3899             : 
    3900           0 :         tevent_req_received(req);
    3901           0 :         return NT_STATUS_OK;
    3902             : }
    3903             : 
    3904       20302 : NTSTATUS dcerpc_winreg_QueryInfoKey(struct dcerpc_binding_handle *h,
    3905             :                                     TALLOC_CTX *mem_ctx,
    3906             :                                     struct policy_handle *_handle /* [in] [ref] */,
    3907             :                                     struct winreg_String *_classname /* [in,out] [ref] */,
    3908             :                                     uint32_t *_num_subkeys /* [out] [ref] */,
    3909             :                                     uint32_t *_max_subkeylen /* [out] [ref] */,
    3910             :                                     uint32_t *_max_classlen /* [out] [ref] */,
    3911             :                                     uint32_t *_num_values /* [out] [ref] */,
    3912             :                                     uint32_t *_max_valnamelen /* [out] [ref] */,
    3913             :                                     uint32_t *_max_valbufsize /* [out] [ref] */,
    3914             :                                     uint32_t *_secdescsize /* [out] [ref] */,
    3915             :                                     NTTIME *_last_changed_time /* [out] [ref] */,
    3916             :                                     WERROR *result)
    3917             : {
    3918           0 :         struct winreg_QueryInfoKey r;
    3919           0 :         NTSTATUS status;
    3920             : 
    3921             :         /* In parameters */
    3922       20302 :         r.in.handle = _handle;
    3923       20302 :         r.in.classname = _classname;
    3924             : 
    3925             :         /* Out parameters */
    3926       20302 :         r.out.classname = _classname;
    3927       20302 :         r.out.num_subkeys = _num_subkeys;
    3928       20302 :         r.out.max_subkeylen = _max_subkeylen;
    3929       20302 :         r.out.max_classlen = _max_classlen;
    3930       20302 :         r.out.num_values = _num_values;
    3931       20302 :         r.out.max_valnamelen = _max_valnamelen;
    3932       20302 :         r.out.max_valbufsize = _max_valbufsize;
    3933       20302 :         r.out.secdescsize = _secdescsize;
    3934       20302 :         r.out.last_changed_time = _last_changed_time;
    3935             : 
    3936             :         /* Result */
    3937       20302 :         NDR_ZERO_STRUCT(r.out.result);
    3938             : 
    3939       20302 :         status = dcerpc_winreg_QueryInfoKey_r(h, mem_ctx, &r);
    3940       20302 :         if (!NT_STATUS_IS_OK(status)) {
    3941           0 :                 return status;
    3942             :         }
    3943             : 
    3944             :         /* Return variables */
    3945       20302 :         *_classname = *r.out.classname;
    3946       20302 :         *_num_subkeys = *r.out.num_subkeys;
    3947       20302 :         *_max_subkeylen = *r.out.max_subkeylen;
    3948       20302 :         *_max_classlen = *r.out.max_classlen;
    3949       20302 :         *_num_values = *r.out.num_values;
    3950       20302 :         *_max_valnamelen = *r.out.max_valnamelen;
    3951       20302 :         *_max_valbufsize = *r.out.max_valbufsize;
    3952       20302 :         *_secdescsize = *r.out.secdescsize;
    3953       20302 :         *_last_changed_time = *r.out.last_changed_time;
    3954             : 
    3955             :         /* Return result */
    3956       20302 :         *result = r.out.result;
    3957             : 
    3958       20302 :         return NT_STATUS_OK;
    3959             : }
    3960             : 
    3961             : struct dcerpc_winreg_QueryValue_r_state {
    3962             :         TALLOC_CTX *out_mem_ctx;
    3963             : };
    3964             : 
    3965             : static void dcerpc_winreg_QueryValue_r_done(struct tevent_req *subreq);
    3966             : 
    3967           0 : struct tevent_req *dcerpc_winreg_QueryValue_r_send(TALLOC_CTX *mem_ctx,
    3968             :         struct tevent_context *ev,
    3969             :         struct dcerpc_binding_handle *h,
    3970             :         struct winreg_QueryValue *r)
    3971             : {
    3972           0 :         struct tevent_req *req;
    3973           0 :         struct dcerpc_winreg_QueryValue_r_state *state;
    3974           0 :         struct tevent_req *subreq;
    3975             : 
    3976           0 :         req = tevent_req_create(mem_ctx, &state,
    3977             :                                 struct dcerpc_winreg_QueryValue_r_state);
    3978           0 :         if (req == NULL) {
    3979           0 :                 return NULL;
    3980             :         }
    3981             : 
    3982           0 :         state->out_mem_ctx = talloc_new(state);
    3983           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    3984           0 :                 return tevent_req_post(req, ev);
    3985             :         }
    3986             : 
    3987           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    3988             :                         NULL, &ndr_table_winreg,
    3989           0 :                         NDR_WINREG_QUERYVALUE, state->out_mem_ctx, r);
    3990           0 :         if (tevent_req_nomem(subreq, req)) {
    3991           0 :                 return tevent_req_post(req, ev);
    3992             :         }
    3993           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_QueryValue_r_done, req);
    3994             : 
    3995           0 :         return req;
    3996             : }
    3997             : 
    3998           0 : static void dcerpc_winreg_QueryValue_r_done(struct tevent_req *subreq)
    3999             : {
    4000           0 :         struct tevent_req *req =
    4001           0 :                 tevent_req_callback_data(subreq,
    4002             :                 struct tevent_req);
    4003           0 :         NTSTATUS status;
    4004             : 
    4005           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    4006           0 :         TALLOC_FREE(subreq);
    4007           0 :         if (tevent_req_nterror(req, status)) {
    4008           0 :                 return;
    4009             :         }
    4010             : 
    4011           0 :         tevent_req_done(req);
    4012             : }
    4013             : 
    4014           0 : NTSTATUS dcerpc_winreg_QueryValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    4015             : {
    4016           0 :         struct dcerpc_winreg_QueryValue_r_state *state =
    4017           0 :                 tevent_req_data(req,
    4018             :                 struct dcerpc_winreg_QueryValue_r_state);
    4019           0 :         NTSTATUS status;
    4020             : 
    4021           0 :         if (tevent_req_is_nterror(req, &status)) {
    4022           0 :                 tevent_req_received(req);
    4023           0 :                 return status;
    4024             :         }
    4025             : 
    4026           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4027             : 
    4028           0 :         tevent_req_received(req);
    4029           0 :         return NT_STATUS_OK;
    4030             : }
    4031             : 
    4032       61688 : NTSTATUS dcerpc_winreg_QueryValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_QueryValue *r)
    4033             : {
    4034           0 :         NTSTATUS status;
    4035             : 
    4036       61688 :         status = dcerpc_binding_handle_call(h,
    4037             :                         NULL, &ndr_table_winreg,
    4038             :                         NDR_WINREG_QUERYVALUE, mem_ctx, r);
    4039             : 
    4040       61688 :         return status;
    4041             : }
    4042             : 
    4043             : struct dcerpc_winreg_QueryValue_state {
    4044             :         struct winreg_QueryValue orig;
    4045             :         struct winreg_QueryValue tmp;
    4046             :         TALLOC_CTX *out_mem_ctx;
    4047             : };
    4048             : 
    4049             : static void dcerpc_winreg_QueryValue_done(struct tevent_req *subreq);
    4050             : 
    4051           0 : struct tevent_req *dcerpc_winreg_QueryValue_send(TALLOC_CTX *mem_ctx,
    4052             :                                                  struct tevent_context *ev,
    4053             :                                                  struct dcerpc_binding_handle *h,
    4054             :                                                  struct policy_handle *_handle /* [in] [ref] */,
    4055             :                                                  struct winreg_String *_value_name /* [in] [ref] */,
    4056             :                                                  enum winreg_Type *_type /* [in,out] [unique] */,
    4057             :                                                  uint8_t *_data /* [in,out] [length_is(data_length?*data_length:0),range(0,0x4000000),size_is(data_size?*data_size:0),unique] */,
    4058             :                                                  uint32_t *_data_size /* [in,out] [unique] */,
    4059             :                                                  uint32_t *_data_length /* [in,out] [unique] */)
    4060             : {
    4061           0 :         struct tevent_req *req;
    4062           0 :         struct dcerpc_winreg_QueryValue_state *state;
    4063           0 :         struct tevent_req *subreq;
    4064             : 
    4065           0 :         req = tevent_req_create(mem_ctx, &state,
    4066             :                                 struct dcerpc_winreg_QueryValue_state);
    4067           0 :         if (req == NULL) {
    4068           0 :                 return NULL;
    4069             :         }
    4070           0 :         state->out_mem_ctx = NULL;
    4071             : 
    4072             :         /* In parameters */
    4073           0 :         state->orig.in.handle = _handle;
    4074           0 :         state->orig.in.value_name = _value_name;
    4075           0 :         state->orig.in.type = _type;
    4076           0 :         state->orig.in.data = _data;
    4077           0 :         state->orig.in.data_size = _data_size;
    4078           0 :         state->orig.in.data_length = _data_length;
    4079             : 
    4080             :         /* Out parameters */
    4081           0 :         state->orig.out.type = _type;
    4082           0 :         state->orig.out.data = _data;
    4083           0 :         state->orig.out.data_size = _data_size;
    4084           0 :         state->orig.out.data_length = _data_length;
    4085             : 
    4086             :         /* Result */
    4087           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    4088             : 
    4089           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    4090             :                              "dcerpc_winreg_QueryValue_out_memory");
    4091           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    4092           0 :                 return tevent_req_post(req, ev);
    4093             :         }
    4094             : 
    4095             :         /* make a temporary copy, that we pass to the dispatch function */
    4096           0 :         state->tmp = state->orig;
    4097             : 
    4098           0 :         subreq = dcerpc_winreg_QueryValue_r_send(state, ev, h, &state->tmp);
    4099           0 :         if (tevent_req_nomem(subreq, req)) {
    4100           0 :                 return tevent_req_post(req, ev);
    4101             :         }
    4102           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_QueryValue_done, req);
    4103           0 :         return req;
    4104             : }
    4105             : 
    4106           0 : static void dcerpc_winreg_QueryValue_done(struct tevent_req *subreq)
    4107             : {
    4108           0 :         struct tevent_req *req = tevent_req_callback_data(
    4109             :                 subreq, struct tevent_req);
    4110           0 :         struct dcerpc_winreg_QueryValue_state *state = tevent_req_data(
    4111             :                 req, struct dcerpc_winreg_QueryValue_state);
    4112           0 :         NTSTATUS status;
    4113           0 :         TALLOC_CTX *mem_ctx;
    4114             : 
    4115           0 :         if (state->out_mem_ctx) {
    4116           0 :                 mem_ctx = state->out_mem_ctx;
    4117             :         } else {
    4118           0 :                 mem_ctx = state;
    4119             :         }
    4120             : 
    4121           0 :         status = dcerpc_winreg_QueryValue_r_recv(subreq, mem_ctx);
    4122           0 :         TALLOC_FREE(subreq);
    4123           0 :         if (tevent_req_nterror(req, status)) {
    4124           0 :                 return;
    4125             :         }
    4126             : 
    4127             :         /* Copy out parameters */
    4128           0 :         if (state->orig.out.type && state->tmp.out.type) {
    4129           0 :                 *state->orig.out.type = *state->tmp.out.type;
    4130             :         }
    4131           0 :         if (state->orig.out.data && state->tmp.out.data) {
    4132             :                 {
    4133           0 :                         size_t _copy_len_data;
    4134           0 :                         if ((state->tmp.out.data_size?*state->tmp.out.data_size:0) > (state->tmp.in.data_size?*state->tmp.in.data_size:0)) {
    4135           0 :                                 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
    4136           0 :                                 return;
    4137             :                         }
    4138           0 :                         if ((state->tmp.out.data_length?*state->tmp.out.data_length:0) > (state->tmp.out.data_size?*state->tmp.out.data_size:0)) {
    4139           0 :                                 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
    4140           0 :                                 return;
    4141             :                         }
    4142           0 :                         _copy_len_data = state->tmp.out.data_length?*state->tmp.out.data_length:0;
    4143           0 :                         if (state->orig.out.data != state->tmp.out.data) {
    4144           0 :                                 memcpy(state->orig.out.data, state->tmp.out.data, _copy_len_data * sizeof(*state->orig.out.data));
    4145             :                         }
    4146             :                 }
    4147             :         }
    4148           0 :         if (state->orig.out.data_size && state->tmp.out.data_size) {
    4149           0 :                 *state->orig.out.data_size = *state->tmp.out.data_size;
    4150             :         }
    4151           0 :         if (state->orig.out.data_length && state->tmp.out.data_length) {
    4152           0 :                 *state->orig.out.data_length = *state->tmp.out.data_length;
    4153             :         }
    4154             : 
    4155             :         /* Copy result */
    4156           0 :         state->orig.out.result = state->tmp.out.result;
    4157             : 
    4158             :         /* Reset temporary structure */
    4159           0 :         NDR_ZERO_STRUCT(state->tmp);
    4160             : 
    4161           0 :         tevent_req_done(req);
    4162             : }
    4163             : 
    4164           0 : NTSTATUS dcerpc_winreg_QueryValue_recv(struct tevent_req *req,
    4165             :                                        TALLOC_CTX *mem_ctx,
    4166             :                                        WERROR *result)
    4167             : {
    4168           0 :         struct dcerpc_winreg_QueryValue_state *state = tevent_req_data(
    4169             :                 req, struct dcerpc_winreg_QueryValue_state);
    4170           0 :         NTSTATUS status;
    4171             : 
    4172           0 :         if (tevent_req_is_nterror(req, &status)) {
    4173           0 :                 tevent_req_received(req);
    4174           0 :                 return status;
    4175             :         }
    4176             : 
    4177             :         /* Steal possible out parameters to the callers context */
    4178           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4179             : 
    4180             :         /* Return result */
    4181           0 :         *result = state->orig.out.result;
    4182             : 
    4183           0 :         tevent_req_received(req);
    4184           0 :         return NT_STATUS_OK;
    4185             : }
    4186             : 
    4187       41762 : NTSTATUS dcerpc_winreg_QueryValue(struct dcerpc_binding_handle *h,
    4188             :                                   TALLOC_CTX *mem_ctx,
    4189             :                                   struct policy_handle *_handle /* [in] [ref] */,
    4190             :                                   struct winreg_String *_value_name /* [in] [ref] */,
    4191             :                                   enum winreg_Type *_type /* [in,out] [unique] */,
    4192             :                                   uint8_t *_data /* [in,out] [length_is(data_length?*data_length:0),range(0,0x4000000),size_is(data_size?*data_size:0),unique] */,
    4193             :                                   uint32_t *_data_size /* [in,out] [unique] */,
    4194             :                                   uint32_t *_data_length /* [in,out] [unique] */,
    4195             :                                   WERROR *result)
    4196             : {
    4197           0 :         struct winreg_QueryValue r;
    4198           0 :         NTSTATUS status;
    4199             : 
    4200             :         /* In parameters */
    4201       41762 :         r.in.handle = _handle;
    4202       41762 :         r.in.value_name = _value_name;
    4203       41762 :         r.in.type = _type;
    4204       41762 :         r.in.data = _data;
    4205       41762 :         r.in.data_size = _data_size;
    4206       41762 :         r.in.data_length = _data_length;
    4207             : 
    4208             :         /* Out parameters */
    4209       41762 :         r.out.type = _type;
    4210       41762 :         r.out.data = _data;
    4211       41762 :         r.out.data_size = _data_size;
    4212       41762 :         r.out.data_length = _data_length;
    4213             : 
    4214             :         /* Result */
    4215       41762 :         NDR_ZERO_STRUCT(r.out.result);
    4216             : 
    4217       41762 :         status = dcerpc_winreg_QueryValue_r(h, mem_ctx, &r);
    4218       41762 :         if (!NT_STATUS_IS_OK(status)) {
    4219           0 :                 return status;
    4220             :         }
    4221             : 
    4222             :         /* Return variables */
    4223       41762 :         if (_type && r.out.type) {
    4224       41762 :                 *_type = *r.out.type;
    4225             :         }
    4226       41762 :         if (_data && r.out.data) {
    4227             :                 {
    4228           0 :                         size_t _copy_len_data;
    4229       17052 :                         if ((r.out.data_size?*r.out.data_size:0) > (r.in.data_size?*r.in.data_size:0)) {
    4230           0 :                                 return NT_STATUS_INVALID_NETWORK_RESPONSE;
    4231             :                         }
    4232       17052 :                         if ((r.out.data_length?*r.out.data_length:0) > (r.out.data_size?*r.out.data_size:0)) {
    4233           0 :                                 return NT_STATUS_INVALID_NETWORK_RESPONSE;
    4234             :                         }
    4235       17052 :                         _copy_len_data = r.out.data_length?*r.out.data_length:0;
    4236       17052 :                         if (_data != r.out.data) {
    4237       17052 :                                 memcpy(_data, r.out.data, _copy_len_data * sizeof(*_data));
    4238             :                         }
    4239             :                 }
    4240             :         }
    4241       41762 :         if (_data_size && r.out.data_size) {
    4242       41762 :                 *_data_size = *r.out.data_size;
    4243             :         }
    4244       41762 :         if (_data_length && r.out.data_length) {
    4245       41762 :                 *_data_length = *r.out.data_length;
    4246             :         }
    4247             : 
    4248             :         /* Return result */
    4249       41762 :         *result = r.out.result;
    4250             : 
    4251       41762 :         return NT_STATUS_OK;
    4252             : }
    4253             : 
    4254             : struct dcerpc_winreg_ReplaceKey_r_state {
    4255             :         TALLOC_CTX *out_mem_ctx;
    4256             : };
    4257             : 
    4258             : static void dcerpc_winreg_ReplaceKey_r_done(struct tevent_req *subreq);
    4259             : 
    4260           0 : struct tevent_req *dcerpc_winreg_ReplaceKey_r_send(TALLOC_CTX *mem_ctx,
    4261             :         struct tevent_context *ev,
    4262             :         struct dcerpc_binding_handle *h,
    4263             :         struct winreg_ReplaceKey *r)
    4264             : {
    4265           0 :         struct tevent_req *req;
    4266           0 :         struct dcerpc_winreg_ReplaceKey_r_state *state;
    4267           0 :         struct tevent_req *subreq;
    4268             : 
    4269           0 :         req = tevent_req_create(mem_ctx, &state,
    4270             :                                 struct dcerpc_winreg_ReplaceKey_r_state);
    4271           0 :         if (req == NULL) {
    4272           0 :                 return NULL;
    4273             :         }
    4274             : 
    4275           0 :         state->out_mem_ctx = NULL;
    4276             : 
    4277           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    4278             :                         NULL, &ndr_table_winreg,
    4279             :                         NDR_WINREG_REPLACEKEY, state, r);
    4280           0 :         if (tevent_req_nomem(subreq, req)) {
    4281           0 :                 return tevent_req_post(req, ev);
    4282             :         }
    4283           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_ReplaceKey_r_done, req);
    4284             : 
    4285           0 :         return req;
    4286             : }
    4287             : 
    4288           0 : static void dcerpc_winreg_ReplaceKey_r_done(struct tevent_req *subreq)
    4289             : {
    4290           0 :         struct tevent_req *req =
    4291           0 :                 tevent_req_callback_data(subreq,
    4292             :                 struct tevent_req);
    4293           0 :         NTSTATUS status;
    4294             : 
    4295           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    4296           0 :         TALLOC_FREE(subreq);
    4297           0 :         if (tevent_req_nterror(req, status)) {
    4298           0 :                 return;
    4299             :         }
    4300             : 
    4301           0 :         tevent_req_done(req);
    4302             : }
    4303             : 
    4304           0 : NTSTATUS dcerpc_winreg_ReplaceKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    4305             : {
    4306           0 :         struct dcerpc_winreg_ReplaceKey_r_state *state =
    4307           0 :                 tevent_req_data(req,
    4308             :                 struct dcerpc_winreg_ReplaceKey_r_state);
    4309           0 :         NTSTATUS status;
    4310             : 
    4311           0 :         if (tevent_req_is_nterror(req, &status)) {
    4312           0 :                 tevent_req_received(req);
    4313           0 :                 return status;
    4314             :         }
    4315             : 
    4316           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4317             : 
    4318           0 :         tevent_req_received(req);
    4319           0 :         return NT_STATUS_OK;
    4320             : }
    4321             : 
    4322           0 : NTSTATUS dcerpc_winreg_ReplaceKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_ReplaceKey *r)
    4323             : {
    4324           0 :         NTSTATUS status;
    4325             : 
    4326           0 :         status = dcerpc_binding_handle_call(h,
    4327             :                         NULL, &ndr_table_winreg,
    4328             :                         NDR_WINREG_REPLACEKEY, mem_ctx, r);
    4329             : 
    4330           0 :         return status;
    4331             : }
    4332             : 
    4333             : struct dcerpc_winreg_ReplaceKey_state {
    4334             :         struct winreg_ReplaceKey orig;
    4335             :         struct winreg_ReplaceKey tmp;
    4336             :         TALLOC_CTX *out_mem_ctx;
    4337             : };
    4338             : 
    4339             : static void dcerpc_winreg_ReplaceKey_done(struct tevent_req *subreq);
    4340             : 
    4341           0 : struct tevent_req *dcerpc_winreg_ReplaceKey_send(TALLOC_CTX *mem_ctx,
    4342             :                                                  struct tevent_context *ev,
    4343             :                                                  struct dcerpc_binding_handle *h,
    4344             :                                                  struct policy_handle *_handle /* [in] [ref] */,
    4345             :                                                  struct winreg_String *_subkey /* [in] [ref] */,
    4346             :                                                  struct winreg_String *_new_file /* [in] [ref] */,
    4347             :                                                  struct winreg_String *_old_file /* [in] [ref] */)
    4348             : {
    4349           0 :         struct tevent_req *req;
    4350           0 :         struct dcerpc_winreg_ReplaceKey_state *state;
    4351           0 :         struct tevent_req *subreq;
    4352             : 
    4353           0 :         req = tevent_req_create(mem_ctx, &state,
    4354             :                                 struct dcerpc_winreg_ReplaceKey_state);
    4355           0 :         if (req == NULL) {
    4356           0 :                 return NULL;
    4357             :         }
    4358           0 :         state->out_mem_ctx = NULL;
    4359             : 
    4360             :         /* In parameters */
    4361           0 :         state->orig.in.handle = _handle;
    4362           0 :         state->orig.in.subkey = _subkey;
    4363           0 :         state->orig.in.new_file = _new_file;
    4364           0 :         state->orig.in.old_file = _old_file;
    4365             : 
    4366             :         /* Out parameters */
    4367             : 
    4368             :         /* Result */
    4369           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    4370             : 
    4371             :         /* make a temporary copy, that we pass to the dispatch function */
    4372           0 :         state->tmp = state->orig;
    4373             : 
    4374           0 :         subreq = dcerpc_winreg_ReplaceKey_r_send(state, ev, h, &state->tmp);
    4375           0 :         if (tevent_req_nomem(subreq, req)) {
    4376           0 :                 return tevent_req_post(req, ev);
    4377             :         }
    4378           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_ReplaceKey_done, req);
    4379           0 :         return req;
    4380             : }
    4381             : 
    4382           0 : static void dcerpc_winreg_ReplaceKey_done(struct tevent_req *subreq)
    4383             : {
    4384           0 :         struct tevent_req *req = tevent_req_callback_data(
    4385             :                 subreq, struct tevent_req);
    4386           0 :         struct dcerpc_winreg_ReplaceKey_state *state = tevent_req_data(
    4387             :                 req, struct dcerpc_winreg_ReplaceKey_state);
    4388           0 :         NTSTATUS status;
    4389           0 :         TALLOC_CTX *mem_ctx;
    4390             : 
    4391           0 :         if (state->out_mem_ctx) {
    4392           0 :                 mem_ctx = state->out_mem_ctx;
    4393             :         } else {
    4394           0 :                 mem_ctx = state;
    4395             :         }
    4396             : 
    4397           0 :         status = dcerpc_winreg_ReplaceKey_r_recv(subreq, mem_ctx);
    4398           0 :         TALLOC_FREE(subreq);
    4399           0 :         if (tevent_req_nterror(req, status)) {
    4400           0 :                 return;
    4401             :         }
    4402             : 
    4403             :         /* Copy out parameters */
    4404             : 
    4405             :         /* Copy result */
    4406           0 :         state->orig.out.result = state->tmp.out.result;
    4407             : 
    4408             :         /* Reset temporary structure */
    4409           0 :         NDR_ZERO_STRUCT(state->tmp);
    4410             : 
    4411           0 :         tevent_req_done(req);
    4412             : }
    4413             : 
    4414           0 : NTSTATUS dcerpc_winreg_ReplaceKey_recv(struct tevent_req *req,
    4415             :                                        TALLOC_CTX *mem_ctx,
    4416             :                                        WERROR *result)
    4417             : {
    4418           0 :         struct dcerpc_winreg_ReplaceKey_state *state = tevent_req_data(
    4419             :                 req, struct dcerpc_winreg_ReplaceKey_state);
    4420           0 :         NTSTATUS status;
    4421             : 
    4422           0 :         if (tevent_req_is_nterror(req, &status)) {
    4423           0 :                 tevent_req_received(req);
    4424           0 :                 return status;
    4425             :         }
    4426             : 
    4427             :         /* Steal possible out parameters to the callers context */
    4428           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4429             : 
    4430             :         /* Return result */
    4431           0 :         *result = state->orig.out.result;
    4432             : 
    4433           0 :         tevent_req_received(req);
    4434           0 :         return NT_STATUS_OK;
    4435             : }
    4436             : 
    4437           0 : NTSTATUS dcerpc_winreg_ReplaceKey(struct dcerpc_binding_handle *h,
    4438             :                                   TALLOC_CTX *mem_ctx,
    4439             :                                   struct policy_handle *_handle /* [in] [ref] */,
    4440             :                                   struct winreg_String *_subkey /* [in] [ref] */,
    4441             :                                   struct winreg_String *_new_file /* [in] [ref] */,
    4442             :                                   struct winreg_String *_old_file /* [in] [ref] */,
    4443             :                                   WERROR *result)
    4444             : {
    4445           0 :         struct winreg_ReplaceKey r;
    4446           0 :         NTSTATUS status;
    4447             : 
    4448             :         /* In parameters */
    4449           0 :         r.in.handle = _handle;
    4450           0 :         r.in.subkey = _subkey;
    4451           0 :         r.in.new_file = _new_file;
    4452           0 :         r.in.old_file = _old_file;
    4453             : 
    4454             :         /* Out parameters */
    4455             : 
    4456             :         /* Result */
    4457           0 :         NDR_ZERO_STRUCT(r.out.result);
    4458             : 
    4459           0 :         status = dcerpc_winreg_ReplaceKey_r(h, mem_ctx, &r);
    4460           0 :         if (!NT_STATUS_IS_OK(status)) {
    4461           0 :                 return status;
    4462             :         }
    4463             : 
    4464             :         /* Return variables */
    4465             : 
    4466             :         /* Return result */
    4467           0 :         *result = r.out.result;
    4468             : 
    4469           0 :         return NT_STATUS_OK;
    4470             : }
    4471             : 
    4472             : struct dcerpc_winreg_RestoreKey_r_state {
    4473             :         TALLOC_CTX *out_mem_ctx;
    4474             : };
    4475             : 
    4476             : static void dcerpc_winreg_RestoreKey_r_done(struct tevent_req *subreq);
    4477             : 
    4478           0 : struct tevent_req *dcerpc_winreg_RestoreKey_r_send(TALLOC_CTX *mem_ctx,
    4479             :         struct tevent_context *ev,
    4480             :         struct dcerpc_binding_handle *h,
    4481             :         struct winreg_RestoreKey *r)
    4482             : {
    4483           0 :         struct tevent_req *req;
    4484           0 :         struct dcerpc_winreg_RestoreKey_r_state *state;
    4485           0 :         struct tevent_req *subreq;
    4486             : 
    4487           0 :         req = tevent_req_create(mem_ctx, &state,
    4488             :                                 struct dcerpc_winreg_RestoreKey_r_state);
    4489           0 :         if (req == NULL) {
    4490           0 :                 return NULL;
    4491             :         }
    4492             : 
    4493           0 :         state->out_mem_ctx = NULL;
    4494             : 
    4495           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    4496             :                         NULL, &ndr_table_winreg,
    4497             :                         NDR_WINREG_RESTOREKEY, state, r);
    4498           0 :         if (tevent_req_nomem(subreq, req)) {
    4499           0 :                 return tevent_req_post(req, ev);
    4500             :         }
    4501           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_RestoreKey_r_done, req);
    4502             : 
    4503           0 :         return req;
    4504             : }
    4505             : 
    4506           0 : static void dcerpc_winreg_RestoreKey_r_done(struct tevent_req *subreq)
    4507             : {
    4508           0 :         struct tevent_req *req =
    4509           0 :                 tevent_req_callback_data(subreq,
    4510             :                 struct tevent_req);
    4511           0 :         NTSTATUS status;
    4512             : 
    4513           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    4514           0 :         TALLOC_FREE(subreq);
    4515           0 :         if (tevent_req_nterror(req, status)) {
    4516           0 :                 return;
    4517             :         }
    4518             : 
    4519           0 :         tevent_req_done(req);
    4520             : }
    4521             : 
    4522           0 : NTSTATUS dcerpc_winreg_RestoreKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    4523             : {
    4524           0 :         struct dcerpc_winreg_RestoreKey_r_state *state =
    4525           0 :                 tevent_req_data(req,
    4526             :                 struct dcerpc_winreg_RestoreKey_r_state);
    4527           0 :         NTSTATUS status;
    4528             : 
    4529           0 :         if (tevent_req_is_nterror(req, &status)) {
    4530           0 :                 tevent_req_received(req);
    4531           0 :                 return status;
    4532             :         }
    4533             : 
    4534           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4535             : 
    4536           0 :         tevent_req_received(req);
    4537           0 :         return NT_STATUS_OK;
    4538             : }
    4539             : 
    4540           0 : NTSTATUS dcerpc_winreg_RestoreKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_RestoreKey *r)
    4541             : {
    4542           0 :         NTSTATUS status;
    4543             : 
    4544           0 :         status = dcerpc_binding_handle_call(h,
    4545             :                         NULL, &ndr_table_winreg,
    4546             :                         NDR_WINREG_RESTOREKEY, mem_ctx, r);
    4547             : 
    4548           0 :         return status;
    4549             : }
    4550             : 
    4551             : struct dcerpc_winreg_RestoreKey_state {
    4552             :         struct winreg_RestoreKey orig;
    4553             :         struct winreg_RestoreKey tmp;
    4554             :         TALLOC_CTX *out_mem_ctx;
    4555             : };
    4556             : 
    4557             : static void dcerpc_winreg_RestoreKey_done(struct tevent_req *subreq);
    4558             : 
    4559           0 : struct tevent_req *dcerpc_winreg_RestoreKey_send(TALLOC_CTX *mem_ctx,
    4560             :                                                  struct tevent_context *ev,
    4561             :                                                  struct dcerpc_binding_handle *h,
    4562             :                                                  struct policy_handle *_handle /* [in] [ref] */,
    4563             :                                                  struct winreg_String *_filename /* [in] [ref] */,
    4564             :                                                  uint32_t _flags /* [in]  */)
    4565             : {
    4566           0 :         struct tevent_req *req;
    4567           0 :         struct dcerpc_winreg_RestoreKey_state *state;
    4568           0 :         struct tevent_req *subreq;
    4569             : 
    4570           0 :         req = tevent_req_create(mem_ctx, &state,
    4571             :                                 struct dcerpc_winreg_RestoreKey_state);
    4572           0 :         if (req == NULL) {
    4573           0 :                 return NULL;
    4574             :         }
    4575           0 :         state->out_mem_ctx = NULL;
    4576             : 
    4577             :         /* In parameters */
    4578           0 :         state->orig.in.handle = _handle;
    4579           0 :         state->orig.in.filename = _filename;
    4580           0 :         state->orig.in.flags = _flags;
    4581             : 
    4582             :         /* Out parameters */
    4583             : 
    4584             :         /* Result */
    4585           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    4586             : 
    4587             :         /* make a temporary copy, that we pass to the dispatch function */
    4588           0 :         state->tmp = state->orig;
    4589             : 
    4590           0 :         subreq = dcerpc_winreg_RestoreKey_r_send(state, ev, h, &state->tmp);
    4591           0 :         if (tevent_req_nomem(subreq, req)) {
    4592           0 :                 return tevent_req_post(req, ev);
    4593             :         }
    4594           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_RestoreKey_done, req);
    4595           0 :         return req;
    4596             : }
    4597             : 
    4598           0 : static void dcerpc_winreg_RestoreKey_done(struct tevent_req *subreq)
    4599             : {
    4600           0 :         struct tevent_req *req = tevent_req_callback_data(
    4601             :                 subreq, struct tevent_req);
    4602           0 :         struct dcerpc_winreg_RestoreKey_state *state = tevent_req_data(
    4603             :                 req, struct dcerpc_winreg_RestoreKey_state);
    4604           0 :         NTSTATUS status;
    4605           0 :         TALLOC_CTX *mem_ctx;
    4606             : 
    4607           0 :         if (state->out_mem_ctx) {
    4608           0 :                 mem_ctx = state->out_mem_ctx;
    4609             :         } else {
    4610           0 :                 mem_ctx = state;
    4611             :         }
    4612             : 
    4613           0 :         status = dcerpc_winreg_RestoreKey_r_recv(subreq, mem_ctx);
    4614           0 :         TALLOC_FREE(subreq);
    4615           0 :         if (tevent_req_nterror(req, status)) {
    4616           0 :                 return;
    4617             :         }
    4618             : 
    4619             :         /* Copy out parameters */
    4620             : 
    4621             :         /* Copy result */
    4622           0 :         state->orig.out.result = state->tmp.out.result;
    4623             : 
    4624             :         /* Reset temporary structure */
    4625           0 :         NDR_ZERO_STRUCT(state->tmp);
    4626             : 
    4627           0 :         tevent_req_done(req);
    4628             : }
    4629             : 
    4630           0 : NTSTATUS dcerpc_winreg_RestoreKey_recv(struct tevent_req *req,
    4631             :                                        TALLOC_CTX *mem_ctx,
    4632             :                                        WERROR *result)
    4633             : {
    4634           0 :         struct dcerpc_winreg_RestoreKey_state *state = tevent_req_data(
    4635             :                 req, struct dcerpc_winreg_RestoreKey_state);
    4636           0 :         NTSTATUS status;
    4637             : 
    4638           0 :         if (tevent_req_is_nterror(req, &status)) {
    4639           0 :                 tevent_req_received(req);
    4640           0 :                 return status;
    4641             :         }
    4642             : 
    4643             :         /* Steal possible out parameters to the callers context */
    4644           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4645             : 
    4646             :         /* Return result */
    4647           0 :         *result = state->orig.out.result;
    4648             : 
    4649           0 :         tevent_req_received(req);
    4650           0 :         return NT_STATUS_OK;
    4651             : }
    4652             : 
    4653           0 : NTSTATUS dcerpc_winreg_RestoreKey(struct dcerpc_binding_handle *h,
    4654             :                                   TALLOC_CTX *mem_ctx,
    4655             :                                   struct policy_handle *_handle /* [in] [ref] */,
    4656             :                                   struct winreg_String *_filename /* [in] [ref] */,
    4657             :                                   uint32_t _flags /* [in]  */,
    4658             :                                   WERROR *result)
    4659             : {
    4660           0 :         struct winreg_RestoreKey r;
    4661           0 :         NTSTATUS status;
    4662             : 
    4663             :         /* In parameters */
    4664           0 :         r.in.handle = _handle;
    4665           0 :         r.in.filename = _filename;
    4666           0 :         r.in.flags = _flags;
    4667             : 
    4668             :         /* Out parameters */
    4669             : 
    4670             :         /* Result */
    4671           0 :         NDR_ZERO_STRUCT(r.out.result);
    4672             : 
    4673           0 :         status = dcerpc_winreg_RestoreKey_r(h, mem_ctx, &r);
    4674           0 :         if (!NT_STATUS_IS_OK(status)) {
    4675           0 :                 return status;
    4676             :         }
    4677             : 
    4678             :         /* Return variables */
    4679             : 
    4680             :         /* Return result */
    4681           0 :         *result = r.out.result;
    4682             : 
    4683           0 :         return NT_STATUS_OK;
    4684             : }
    4685             : 
    4686             : struct dcerpc_winreg_SaveKey_r_state {
    4687             :         TALLOC_CTX *out_mem_ctx;
    4688             : };
    4689             : 
    4690             : static void dcerpc_winreg_SaveKey_r_done(struct tevent_req *subreq);
    4691             : 
    4692           0 : struct tevent_req *dcerpc_winreg_SaveKey_r_send(TALLOC_CTX *mem_ctx,
    4693             :         struct tevent_context *ev,
    4694             :         struct dcerpc_binding_handle *h,
    4695             :         struct winreg_SaveKey *r)
    4696             : {
    4697           0 :         struct tevent_req *req;
    4698           0 :         struct dcerpc_winreg_SaveKey_r_state *state;
    4699           0 :         struct tevent_req *subreq;
    4700             : 
    4701           0 :         req = tevent_req_create(mem_ctx, &state,
    4702             :                                 struct dcerpc_winreg_SaveKey_r_state);
    4703           0 :         if (req == NULL) {
    4704           0 :                 return NULL;
    4705             :         }
    4706             : 
    4707           0 :         state->out_mem_ctx = NULL;
    4708             : 
    4709           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    4710             :                         NULL, &ndr_table_winreg,
    4711             :                         NDR_WINREG_SAVEKEY, state, r);
    4712           0 :         if (tevent_req_nomem(subreq, req)) {
    4713           0 :                 return tevent_req_post(req, ev);
    4714             :         }
    4715           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_SaveKey_r_done, req);
    4716             : 
    4717           0 :         return req;
    4718             : }
    4719             : 
    4720           0 : static void dcerpc_winreg_SaveKey_r_done(struct tevent_req *subreq)
    4721             : {
    4722           0 :         struct tevent_req *req =
    4723           0 :                 tevent_req_callback_data(subreq,
    4724             :                 struct tevent_req);
    4725           0 :         NTSTATUS status;
    4726             : 
    4727           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    4728           0 :         TALLOC_FREE(subreq);
    4729           0 :         if (tevent_req_nterror(req, status)) {
    4730           0 :                 return;
    4731             :         }
    4732             : 
    4733           0 :         tevent_req_done(req);
    4734             : }
    4735             : 
    4736           0 : NTSTATUS dcerpc_winreg_SaveKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    4737             : {
    4738           0 :         struct dcerpc_winreg_SaveKey_r_state *state =
    4739           0 :                 tevent_req_data(req,
    4740             :                 struct dcerpc_winreg_SaveKey_r_state);
    4741           0 :         NTSTATUS status;
    4742             : 
    4743           0 :         if (tevent_req_is_nterror(req, &status)) {
    4744           0 :                 tevent_req_received(req);
    4745           0 :                 return status;
    4746             :         }
    4747             : 
    4748           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4749             : 
    4750           0 :         tevent_req_received(req);
    4751           0 :         return NT_STATUS_OK;
    4752             : }
    4753             : 
    4754           0 : NTSTATUS dcerpc_winreg_SaveKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_SaveKey *r)
    4755             : {
    4756           0 :         NTSTATUS status;
    4757             : 
    4758           0 :         status = dcerpc_binding_handle_call(h,
    4759             :                         NULL, &ndr_table_winreg,
    4760             :                         NDR_WINREG_SAVEKEY, mem_ctx, r);
    4761             : 
    4762           0 :         return status;
    4763             : }
    4764             : 
    4765             : struct dcerpc_winreg_SaveKey_state {
    4766             :         struct winreg_SaveKey orig;
    4767             :         struct winreg_SaveKey tmp;
    4768             :         TALLOC_CTX *out_mem_ctx;
    4769             : };
    4770             : 
    4771             : static void dcerpc_winreg_SaveKey_done(struct tevent_req *subreq);
    4772             : 
    4773           0 : struct tevent_req *dcerpc_winreg_SaveKey_send(TALLOC_CTX *mem_ctx,
    4774             :                                               struct tevent_context *ev,
    4775             :                                               struct dcerpc_binding_handle *h,
    4776             :                                               struct policy_handle *_handle /* [in] [ref] */,
    4777             :                                               struct winreg_String *_filename /* [in] [ref] */,
    4778             :                                               struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */)
    4779             : {
    4780           0 :         struct tevent_req *req;
    4781           0 :         struct dcerpc_winreg_SaveKey_state *state;
    4782           0 :         struct tevent_req *subreq;
    4783             : 
    4784           0 :         req = tevent_req_create(mem_ctx, &state,
    4785             :                                 struct dcerpc_winreg_SaveKey_state);
    4786           0 :         if (req == NULL) {
    4787           0 :                 return NULL;
    4788             :         }
    4789           0 :         state->out_mem_ctx = NULL;
    4790             : 
    4791             :         /* In parameters */
    4792           0 :         state->orig.in.handle = _handle;
    4793           0 :         state->orig.in.filename = _filename;
    4794           0 :         state->orig.in.sec_attrib = _sec_attrib;
    4795             : 
    4796             :         /* Out parameters */
    4797             : 
    4798             :         /* Result */
    4799           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    4800             : 
    4801             :         /* make a temporary copy, that we pass to the dispatch function */
    4802           0 :         state->tmp = state->orig;
    4803             : 
    4804           0 :         subreq = dcerpc_winreg_SaveKey_r_send(state, ev, h, &state->tmp);
    4805           0 :         if (tevent_req_nomem(subreq, req)) {
    4806           0 :                 return tevent_req_post(req, ev);
    4807             :         }
    4808           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_SaveKey_done, req);
    4809           0 :         return req;
    4810             : }
    4811             : 
    4812           0 : static void dcerpc_winreg_SaveKey_done(struct tevent_req *subreq)
    4813             : {
    4814           0 :         struct tevent_req *req = tevent_req_callback_data(
    4815             :                 subreq, struct tevent_req);
    4816           0 :         struct dcerpc_winreg_SaveKey_state *state = tevent_req_data(
    4817             :                 req, struct dcerpc_winreg_SaveKey_state);
    4818           0 :         NTSTATUS status;
    4819           0 :         TALLOC_CTX *mem_ctx;
    4820             : 
    4821           0 :         if (state->out_mem_ctx) {
    4822           0 :                 mem_ctx = state->out_mem_ctx;
    4823             :         } else {
    4824           0 :                 mem_ctx = state;
    4825             :         }
    4826             : 
    4827           0 :         status = dcerpc_winreg_SaveKey_r_recv(subreq, mem_ctx);
    4828           0 :         TALLOC_FREE(subreq);
    4829           0 :         if (tevent_req_nterror(req, status)) {
    4830           0 :                 return;
    4831             :         }
    4832             : 
    4833             :         /* Copy out parameters */
    4834             : 
    4835             :         /* Copy result */
    4836           0 :         state->orig.out.result = state->tmp.out.result;
    4837             : 
    4838             :         /* Reset temporary structure */
    4839           0 :         NDR_ZERO_STRUCT(state->tmp);
    4840             : 
    4841           0 :         tevent_req_done(req);
    4842             : }
    4843             : 
    4844           0 : NTSTATUS dcerpc_winreg_SaveKey_recv(struct tevent_req *req,
    4845             :                                     TALLOC_CTX *mem_ctx,
    4846             :                                     WERROR *result)
    4847             : {
    4848           0 :         struct dcerpc_winreg_SaveKey_state *state = tevent_req_data(
    4849             :                 req, struct dcerpc_winreg_SaveKey_state);
    4850           0 :         NTSTATUS status;
    4851             : 
    4852           0 :         if (tevent_req_is_nterror(req, &status)) {
    4853           0 :                 tevent_req_received(req);
    4854           0 :                 return status;
    4855             :         }
    4856             : 
    4857             :         /* Steal possible out parameters to the callers context */
    4858           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4859             : 
    4860             :         /* Return result */
    4861           0 :         *result = state->orig.out.result;
    4862             : 
    4863           0 :         tevent_req_received(req);
    4864           0 :         return NT_STATUS_OK;
    4865             : }
    4866             : 
    4867           0 : NTSTATUS dcerpc_winreg_SaveKey(struct dcerpc_binding_handle *h,
    4868             :                                TALLOC_CTX *mem_ctx,
    4869             :                                struct policy_handle *_handle /* [in] [ref] */,
    4870             :                                struct winreg_String *_filename /* [in] [ref] */,
    4871             :                                struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */,
    4872             :                                WERROR *result)
    4873             : {
    4874           0 :         struct winreg_SaveKey r;
    4875           0 :         NTSTATUS status;
    4876             : 
    4877             :         /* In parameters */
    4878           0 :         r.in.handle = _handle;
    4879           0 :         r.in.filename = _filename;
    4880           0 :         r.in.sec_attrib = _sec_attrib;
    4881             : 
    4882             :         /* Out parameters */
    4883             : 
    4884             :         /* Result */
    4885           0 :         NDR_ZERO_STRUCT(r.out.result);
    4886             : 
    4887           0 :         status = dcerpc_winreg_SaveKey_r(h, mem_ctx, &r);
    4888           0 :         if (!NT_STATUS_IS_OK(status)) {
    4889           0 :                 return status;
    4890             :         }
    4891             : 
    4892             :         /* Return variables */
    4893             : 
    4894             :         /* Return result */
    4895           0 :         *result = r.out.result;
    4896             : 
    4897           0 :         return NT_STATUS_OK;
    4898             : }
    4899             : 
    4900             : struct dcerpc_winreg_SetKeySecurity_r_state {
    4901             :         TALLOC_CTX *out_mem_ctx;
    4902             : };
    4903             : 
    4904             : static void dcerpc_winreg_SetKeySecurity_r_done(struct tevent_req *subreq);
    4905             : 
    4906           0 : struct tevent_req *dcerpc_winreg_SetKeySecurity_r_send(TALLOC_CTX *mem_ctx,
    4907             :         struct tevent_context *ev,
    4908             :         struct dcerpc_binding_handle *h,
    4909             :         struct winreg_SetKeySecurity *r)
    4910             : {
    4911           0 :         struct tevent_req *req;
    4912           0 :         struct dcerpc_winreg_SetKeySecurity_r_state *state;
    4913           0 :         struct tevent_req *subreq;
    4914             : 
    4915           0 :         req = tevent_req_create(mem_ctx, &state,
    4916             :                                 struct dcerpc_winreg_SetKeySecurity_r_state);
    4917           0 :         if (req == NULL) {
    4918           0 :                 return NULL;
    4919             :         }
    4920             : 
    4921           0 :         state->out_mem_ctx = NULL;
    4922             : 
    4923           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    4924             :                         NULL, &ndr_table_winreg,
    4925             :                         NDR_WINREG_SETKEYSECURITY, state, r);
    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_winreg_SetKeySecurity_r_done, req);
    4930             : 
    4931           0 :         return req;
    4932             : }
    4933             : 
    4934           0 : static void dcerpc_winreg_SetKeySecurity_r_done(struct tevent_req *subreq)
    4935             : {
    4936           0 :         struct tevent_req *req =
    4937           0 :                 tevent_req_callback_data(subreq,
    4938             :                 struct tevent_req);
    4939           0 :         NTSTATUS status;
    4940             : 
    4941           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    4942           0 :         TALLOC_FREE(subreq);
    4943           0 :         if (tevent_req_nterror(req, status)) {
    4944           0 :                 return;
    4945             :         }
    4946             : 
    4947           0 :         tevent_req_done(req);
    4948             : }
    4949             : 
    4950           0 : NTSTATUS dcerpc_winreg_SetKeySecurity_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    4951             : {
    4952           0 :         struct dcerpc_winreg_SetKeySecurity_r_state *state =
    4953           0 :                 tevent_req_data(req,
    4954             :                 struct dcerpc_winreg_SetKeySecurity_r_state);
    4955           0 :         NTSTATUS status;
    4956             : 
    4957           0 :         if (tevent_req_is_nterror(req, &status)) {
    4958           0 :                 tevent_req_received(req);
    4959           0 :                 return status;
    4960             :         }
    4961             : 
    4962           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4963             : 
    4964           0 :         tevent_req_received(req);
    4965           0 :         return NT_STATUS_OK;
    4966             : }
    4967             : 
    4968           0 : NTSTATUS dcerpc_winreg_SetKeySecurity_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_SetKeySecurity *r)
    4969             : {
    4970           0 :         NTSTATUS status;
    4971             : 
    4972           0 :         status = dcerpc_binding_handle_call(h,
    4973             :                         NULL, &ndr_table_winreg,
    4974             :                         NDR_WINREG_SETKEYSECURITY, mem_ctx, r);
    4975             : 
    4976           0 :         return status;
    4977             : }
    4978             : 
    4979             : struct dcerpc_winreg_SetKeySecurity_state {
    4980             :         struct winreg_SetKeySecurity orig;
    4981             :         struct winreg_SetKeySecurity tmp;
    4982             :         TALLOC_CTX *out_mem_ctx;
    4983             : };
    4984             : 
    4985             : static void dcerpc_winreg_SetKeySecurity_done(struct tevent_req *subreq);
    4986             : 
    4987           0 : struct tevent_req *dcerpc_winreg_SetKeySecurity_send(TALLOC_CTX *mem_ctx,
    4988             :                                                      struct tevent_context *ev,
    4989             :                                                      struct dcerpc_binding_handle *h,
    4990             :                                                      struct policy_handle *_handle /* [in] [ref] */,
    4991             :                                                      uint32_t _sec_info /* [in]  */,
    4992             :                                                      struct KeySecurityData *_sd /* [in] [ref] */)
    4993             : {
    4994           0 :         struct tevent_req *req;
    4995           0 :         struct dcerpc_winreg_SetKeySecurity_state *state;
    4996           0 :         struct tevent_req *subreq;
    4997             : 
    4998           0 :         req = tevent_req_create(mem_ctx, &state,
    4999             :                                 struct dcerpc_winreg_SetKeySecurity_state);
    5000           0 :         if (req == NULL) {
    5001           0 :                 return NULL;
    5002             :         }
    5003           0 :         state->out_mem_ctx = NULL;
    5004             : 
    5005             :         /* In parameters */
    5006           0 :         state->orig.in.handle = _handle;
    5007           0 :         state->orig.in.sec_info = _sec_info;
    5008           0 :         state->orig.in.sd = _sd;
    5009             : 
    5010             :         /* Out parameters */
    5011             : 
    5012             :         /* Result */
    5013           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    5014             : 
    5015             :         /* make a temporary copy, that we pass to the dispatch function */
    5016           0 :         state->tmp = state->orig;
    5017             : 
    5018           0 :         subreq = dcerpc_winreg_SetKeySecurity_r_send(state, ev, h, &state->tmp);
    5019           0 :         if (tevent_req_nomem(subreq, req)) {
    5020           0 :                 return tevent_req_post(req, ev);
    5021             :         }
    5022           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_SetKeySecurity_done, req);
    5023           0 :         return req;
    5024             : }
    5025             : 
    5026           0 : static void dcerpc_winreg_SetKeySecurity_done(struct tevent_req *subreq)
    5027             : {
    5028           0 :         struct tevent_req *req = tevent_req_callback_data(
    5029             :                 subreq, struct tevent_req);
    5030           0 :         struct dcerpc_winreg_SetKeySecurity_state *state = tevent_req_data(
    5031             :                 req, struct dcerpc_winreg_SetKeySecurity_state);
    5032           0 :         NTSTATUS status;
    5033           0 :         TALLOC_CTX *mem_ctx;
    5034             : 
    5035           0 :         if (state->out_mem_ctx) {
    5036           0 :                 mem_ctx = state->out_mem_ctx;
    5037             :         } else {
    5038           0 :                 mem_ctx = state;
    5039             :         }
    5040             : 
    5041           0 :         status = dcerpc_winreg_SetKeySecurity_r_recv(subreq, mem_ctx);
    5042           0 :         TALLOC_FREE(subreq);
    5043           0 :         if (tevent_req_nterror(req, status)) {
    5044           0 :                 return;
    5045             :         }
    5046             : 
    5047             :         /* Copy out parameters */
    5048             : 
    5049             :         /* Copy result */
    5050           0 :         state->orig.out.result = state->tmp.out.result;
    5051             : 
    5052             :         /* Reset temporary structure */
    5053           0 :         NDR_ZERO_STRUCT(state->tmp);
    5054             : 
    5055           0 :         tevent_req_done(req);
    5056             : }
    5057             : 
    5058           0 : NTSTATUS dcerpc_winreg_SetKeySecurity_recv(struct tevent_req *req,
    5059             :                                            TALLOC_CTX *mem_ctx,
    5060             :                                            WERROR *result)
    5061             : {
    5062           0 :         struct dcerpc_winreg_SetKeySecurity_state *state = tevent_req_data(
    5063             :                 req, struct dcerpc_winreg_SetKeySecurity_state);
    5064           0 :         NTSTATUS status;
    5065             : 
    5066           0 :         if (tevent_req_is_nterror(req, &status)) {
    5067           0 :                 tevent_req_received(req);
    5068           0 :                 return status;
    5069             :         }
    5070             : 
    5071             :         /* Steal possible out parameters to the callers context */
    5072           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5073             : 
    5074             :         /* Return result */
    5075           0 :         *result = state->orig.out.result;
    5076             : 
    5077           0 :         tevent_req_received(req);
    5078           0 :         return NT_STATUS_OK;
    5079             : }
    5080             : 
    5081           0 : NTSTATUS dcerpc_winreg_SetKeySecurity(struct dcerpc_binding_handle *h,
    5082             :                                       TALLOC_CTX *mem_ctx,
    5083             :                                       struct policy_handle *_handle /* [in] [ref] */,
    5084             :                                       uint32_t _sec_info /* [in]  */,
    5085             :                                       struct KeySecurityData *_sd /* [in] [ref] */,
    5086             :                                       WERROR *result)
    5087             : {
    5088           0 :         struct winreg_SetKeySecurity r;
    5089           0 :         NTSTATUS status;
    5090             : 
    5091             :         /* In parameters */
    5092           0 :         r.in.handle = _handle;
    5093           0 :         r.in.sec_info = _sec_info;
    5094           0 :         r.in.sd = _sd;
    5095             : 
    5096             :         /* Out parameters */
    5097             : 
    5098             :         /* Result */
    5099           0 :         NDR_ZERO_STRUCT(r.out.result);
    5100             : 
    5101           0 :         status = dcerpc_winreg_SetKeySecurity_r(h, mem_ctx, &r);
    5102           0 :         if (!NT_STATUS_IS_OK(status)) {
    5103           0 :                 return status;
    5104             :         }
    5105             : 
    5106             :         /* Return variables */
    5107             : 
    5108             :         /* Return result */
    5109           0 :         *result = r.out.result;
    5110             : 
    5111           0 :         return NT_STATUS_OK;
    5112             : }
    5113             : 
    5114             : struct dcerpc_winreg_SetValue_r_state {
    5115             :         TALLOC_CTX *out_mem_ctx;
    5116             : };
    5117             : 
    5118             : static void dcerpc_winreg_SetValue_r_done(struct tevent_req *subreq);
    5119             : 
    5120           0 : struct tevent_req *dcerpc_winreg_SetValue_r_send(TALLOC_CTX *mem_ctx,
    5121             :         struct tevent_context *ev,
    5122             :         struct dcerpc_binding_handle *h,
    5123             :         struct winreg_SetValue *r)
    5124             : {
    5125           0 :         struct tevent_req *req;
    5126           0 :         struct dcerpc_winreg_SetValue_r_state *state;
    5127           0 :         struct tevent_req *subreq;
    5128             : 
    5129           0 :         req = tevent_req_create(mem_ctx, &state,
    5130             :                                 struct dcerpc_winreg_SetValue_r_state);
    5131           0 :         if (req == NULL) {
    5132           0 :                 return NULL;
    5133             :         }
    5134             : 
    5135           0 :         state->out_mem_ctx = NULL;
    5136             : 
    5137           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    5138             :                         NULL, &ndr_table_winreg,
    5139             :                         NDR_WINREG_SETVALUE, state, r);
    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_winreg_SetValue_r_done, req);
    5144             : 
    5145           0 :         return req;
    5146             : }
    5147             : 
    5148           0 : static void dcerpc_winreg_SetValue_r_done(struct tevent_req *subreq)
    5149             : {
    5150           0 :         struct tevent_req *req =
    5151           0 :                 tevent_req_callback_data(subreq,
    5152             :                 struct tevent_req);
    5153           0 :         NTSTATUS status;
    5154             : 
    5155           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    5156           0 :         TALLOC_FREE(subreq);
    5157           0 :         if (tevent_req_nterror(req, status)) {
    5158           0 :                 return;
    5159             :         }
    5160             : 
    5161           0 :         tevent_req_done(req);
    5162             : }
    5163             : 
    5164           0 : NTSTATUS dcerpc_winreg_SetValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    5165             : {
    5166           0 :         struct dcerpc_winreg_SetValue_r_state *state =
    5167           0 :                 tevent_req_data(req,
    5168             :                 struct dcerpc_winreg_SetValue_r_state);
    5169           0 :         NTSTATUS status;
    5170             : 
    5171           0 :         if (tevent_req_is_nterror(req, &status)) {
    5172           0 :                 tevent_req_received(req);
    5173           0 :                 return status;
    5174             :         }
    5175             : 
    5176           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5177             : 
    5178           0 :         tevent_req_received(req);
    5179           0 :         return NT_STATUS_OK;
    5180             : }
    5181             : 
    5182       18358 : NTSTATUS dcerpc_winreg_SetValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_SetValue *r)
    5183             : {
    5184           0 :         NTSTATUS status;
    5185             : 
    5186       18358 :         status = dcerpc_binding_handle_call(h,
    5187             :                         NULL, &ndr_table_winreg,
    5188             :                         NDR_WINREG_SETVALUE, mem_ctx, r);
    5189             : 
    5190       18358 :         return status;
    5191             : }
    5192             : 
    5193             : struct dcerpc_winreg_SetValue_state {
    5194             :         struct winreg_SetValue orig;
    5195             :         struct winreg_SetValue tmp;
    5196             :         TALLOC_CTX *out_mem_ctx;
    5197             : };
    5198             : 
    5199             : static void dcerpc_winreg_SetValue_done(struct tevent_req *subreq);
    5200             : 
    5201           0 : struct tevent_req *dcerpc_winreg_SetValue_send(TALLOC_CTX *mem_ctx,
    5202             :                                                struct tevent_context *ev,
    5203             :                                                struct dcerpc_binding_handle *h,
    5204             :                                                struct policy_handle *_handle /* [in] [ref] */,
    5205             :                                                struct winreg_String _name /* [in]  */,
    5206             :                                                enum winreg_Type _type /* [in]  */,
    5207             :                                                uint8_t *_data /* [in] [ref,size_is(size)] */,
    5208             :                                                uint32_t _size /* [in]  */)
    5209             : {
    5210           0 :         struct tevent_req *req;
    5211           0 :         struct dcerpc_winreg_SetValue_state *state;
    5212           0 :         struct tevent_req *subreq;
    5213             : 
    5214           0 :         req = tevent_req_create(mem_ctx, &state,
    5215             :                                 struct dcerpc_winreg_SetValue_state);
    5216           0 :         if (req == NULL) {
    5217           0 :                 return NULL;
    5218             :         }
    5219           0 :         state->out_mem_ctx = NULL;
    5220             : 
    5221             :         /* In parameters */
    5222           0 :         state->orig.in.handle = _handle;
    5223           0 :         state->orig.in.name = _name;
    5224           0 :         state->orig.in.type = _type;
    5225           0 :         state->orig.in.data = _data;
    5226           0 :         state->orig.in.size = _size;
    5227             : 
    5228             :         /* Out parameters */
    5229             : 
    5230             :         /* Result */
    5231           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    5232             : 
    5233             :         /* make a temporary copy, that we pass to the dispatch function */
    5234           0 :         state->tmp = state->orig;
    5235             : 
    5236           0 :         subreq = dcerpc_winreg_SetValue_r_send(state, ev, h, &state->tmp);
    5237           0 :         if (tevent_req_nomem(subreq, req)) {
    5238           0 :                 return tevent_req_post(req, ev);
    5239             :         }
    5240           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_SetValue_done, req);
    5241           0 :         return req;
    5242             : }
    5243             : 
    5244           0 : static void dcerpc_winreg_SetValue_done(struct tevent_req *subreq)
    5245             : {
    5246           0 :         struct tevent_req *req = tevent_req_callback_data(
    5247             :                 subreq, struct tevent_req);
    5248           0 :         struct dcerpc_winreg_SetValue_state *state = tevent_req_data(
    5249             :                 req, struct dcerpc_winreg_SetValue_state);
    5250           0 :         NTSTATUS status;
    5251           0 :         TALLOC_CTX *mem_ctx;
    5252             : 
    5253           0 :         if (state->out_mem_ctx) {
    5254           0 :                 mem_ctx = state->out_mem_ctx;
    5255             :         } else {
    5256           0 :                 mem_ctx = state;
    5257             :         }
    5258             : 
    5259           0 :         status = dcerpc_winreg_SetValue_r_recv(subreq, mem_ctx);
    5260           0 :         TALLOC_FREE(subreq);
    5261           0 :         if (tevent_req_nterror(req, status)) {
    5262           0 :                 return;
    5263             :         }
    5264             : 
    5265             :         /* Copy out parameters */
    5266             : 
    5267             :         /* Copy result */
    5268           0 :         state->orig.out.result = state->tmp.out.result;
    5269             : 
    5270             :         /* Reset temporary structure */
    5271           0 :         NDR_ZERO_STRUCT(state->tmp);
    5272             : 
    5273           0 :         tevent_req_done(req);
    5274             : }
    5275             : 
    5276           0 : NTSTATUS dcerpc_winreg_SetValue_recv(struct tevent_req *req,
    5277             :                                      TALLOC_CTX *mem_ctx,
    5278             :                                      WERROR *result)
    5279             : {
    5280           0 :         struct dcerpc_winreg_SetValue_state *state = tevent_req_data(
    5281             :                 req, struct dcerpc_winreg_SetValue_state);
    5282           0 :         NTSTATUS status;
    5283             : 
    5284           0 :         if (tevent_req_is_nterror(req, &status)) {
    5285           0 :                 tevent_req_received(req);
    5286           0 :                 return status;
    5287             :         }
    5288             : 
    5289             :         /* Steal possible out parameters to the callers context */
    5290           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5291             : 
    5292             :         /* Return result */
    5293           0 :         *result = state->orig.out.result;
    5294             : 
    5295           0 :         tevent_req_received(req);
    5296           0 :         return NT_STATUS_OK;
    5297             : }
    5298             : 
    5299       14518 : NTSTATUS dcerpc_winreg_SetValue(struct dcerpc_binding_handle *h,
    5300             :                                 TALLOC_CTX *mem_ctx,
    5301             :                                 struct policy_handle *_handle /* [in] [ref] */,
    5302             :                                 struct winreg_String _name /* [in]  */,
    5303             :                                 enum winreg_Type _type /* [in]  */,
    5304             :                                 uint8_t *_data /* [in] [ref,size_is(size)] */,
    5305             :                                 uint32_t _size /* [in]  */,
    5306             :                                 WERROR *result)
    5307             : {
    5308           0 :         struct winreg_SetValue r;
    5309           0 :         NTSTATUS status;
    5310             : 
    5311             :         /* In parameters */
    5312       14518 :         r.in.handle = _handle;
    5313       14518 :         r.in.name = _name;
    5314       14518 :         r.in.type = _type;
    5315       14518 :         r.in.data = _data;
    5316       14518 :         r.in.size = _size;
    5317             : 
    5318             :         /* Out parameters */
    5319             : 
    5320             :         /* Result */
    5321       14518 :         NDR_ZERO_STRUCT(r.out.result);
    5322             : 
    5323       14518 :         status = dcerpc_winreg_SetValue_r(h, mem_ctx, &r);
    5324       14518 :         if (!NT_STATUS_IS_OK(status)) {
    5325           0 :                 return status;
    5326             :         }
    5327             : 
    5328             :         /* Return variables */
    5329             : 
    5330             :         /* Return result */
    5331       14518 :         *result = r.out.result;
    5332             : 
    5333       14518 :         return NT_STATUS_OK;
    5334             : }
    5335             : 
    5336             : struct dcerpc_winreg_UnLoadKey_r_state {
    5337             :         TALLOC_CTX *out_mem_ctx;
    5338             : };
    5339             : 
    5340             : static void dcerpc_winreg_UnLoadKey_r_done(struct tevent_req *subreq);
    5341             : 
    5342           0 : struct tevent_req *dcerpc_winreg_UnLoadKey_r_send(TALLOC_CTX *mem_ctx,
    5343             :         struct tevent_context *ev,
    5344             :         struct dcerpc_binding_handle *h,
    5345             :         struct winreg_UnLoadKey *r)
    5346             : {
    5347           0 :         struct tevent_req *req;
    5348           0 :         struct dcerpc_winreg_UnLoadKey_r_state *state;
    5349           0 :         struct tevent_req *subreq;
    5350             : 
    5351           0 :         req = tevent_req_create(mem_ctx, &state,
    5352             :                                 struct dcerpc_winreg_UnLoadKey_r_state);
    5353           0 :         if (req == NULL) {
    5354           0 :                 return NULL;
    5355             :         }
    5356             : 
    5357           0 :         state->out_mem_ctx = NULL;
    5358             : 
    5359           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    5360             :                         NULL, &ndr_table_winreg,
    5361             :                         NDR_WINREG_UNLOADKEY, state, r);
    5362           0 :         if (tevent_req_nomem(subreq, req)) {
    5363           0 :                 return tevent_req_post(req, ev);
    5364             :         }
    5365           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_UnLoadKey_r_done, req);
    5366             : 
    5367           0 :         return req;
    5368             : }
    5369             : 
    5370           0 : static void dcerpc_winreg_UnLoadKey_r_done(struct tevent_req *subreq)
    5371             : {
    5372           0 :         struct tevent_req *req =
    5373           0 :                 tevent_req_callback_data(subreq,
    5374             :                 struct tevent_req);
    5375           0 :         NTSTATUS status;
    5376             : 
    5377           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    5378           0 :         TALLOC_FREE(subreq);
    5379           0 :         if (tevent_req_nterror(req, status)) {
    5380           0 :                 return;
    5381             :         }
    5382             : 
    5383           0 :         tevent_req_done(req);
    5384             : }
    5385             : 
    5386           0 : NTSTATUS dcerpc_winreg_UnLoadKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    5387             : {
    5388           0 :         struct dcerpc_winreg_UnLoadKey_r_state *state =
    5389           0 :                 tevent_req_data(req,
    5390             :                 struct dcerpc_winreg_UnLoadKey_r_state);
    5391           0 :         NTSTATUS status;
    5392             : 
    5393           0 :         if (tevent_req_is_nterror(req, &status)) {
    5394           0 :                 tevent_req_received(req);
    5395           0 :                 return status;
    5396             :         }
    5397             : 
    5398           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5399             : 
    5400           0 :         tevent_req_received(req);
    5401           0 :         return NT_STATUS_OK;
    5402             : }
    5403             : 
    5404           0 : NTSTATUS dcerpc_winreg_UnLoadKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_UnLoadKey *r)
    5405             : {
    5406           0 :         NTSTATUS status;
    5407             : 
    5408           0 :         status = dcerpc_binding_handle_call(h,
    5409             :                         NULL, &ndr_table_winreg,
    5410             :                         NDR_WINREG_UNLOADKEY, mem_ctx, r);
    5411             : 
    5412           0 :         return status;
    5413             : }
    5414             : 
    5415             : struct dcerpc_winreg_UnLoadKey_state {
    5416             :         struct winreg_UnLoadKey orig;
    5417             :         struct winreg_UnLoadKey tmp;
    5418             :         TALLOC_CTX *out_mem_ctx;
    5419             : };
    5420             : 
    5421             : static void dcerpc_winreg_UnLoadKey_done(struct tevent_req *subreq);
    5422             : 
    5423           0 : struct tevent_req *dcerpc_winreg_UnLoadKey_send(TALLOC_CTX *mem_ctx,
    5424             :                                                 struct tevent_context *ev,
    5425             :                                                 struct dcerpc_binding_handle *h,
    5426             :                                                 struct policy_handle *_handle /* [in] [ref] */,
    5427             :                                                 struct winreg_String *_subkey /* [in] [ref] */)
    5428             : {
    5429           0 :         struct tevent_req *req;
    5430           0 :         struct dcerpc_winreg_UnLoadKey_state *state;
    5431           0 :         struct tevent_req *subreq;
    5432             : 
    5433           0 :         req = tevent_req_create(mem_ctx, &state,
    5434             :                                 struct dcerpc_winreg_UnLoadKey_state);
    5435           0 :         if (req == NULL) {
    5436           0 :                 return NULL;
    5437             :         }
    5438           0 :         state->out_mem_ctx = NULL;
    5439             : 
    5440             :         /* In parameters */
    5441           0 :         state->orig.in.handle = _handle;
    5442           0 :         state->orig.in.subkey = _subkey;
    5443             : 
    5444             :         /* Out parameters */
    5445             : 
    5446             :         /* Result */
    5447           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    5448             : 
    5449             :         /* make a temporary copy, that we pass to the dispatch function */
    5450           0 :         state->tmp = state->orig;
    5451             : 
    5452           0 :         subreq = dcerpc_winreg_UnLoadKey_r_send(state, ev, h, &state->tmp);
    5453           0 :         if (tevent_req_nomem(subreq, req)) {
    5454           0 :                 return tevent_req_post(req, ev);
    5455             :         }
    5456           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_UnLoadKey_done, req);
    5457           0 :         return req;
    5458             : }
    5459             : 
    5460           0 : static void dcerpc_winreg_UnLoadKey_done(struct tevent_req *subreq)
    5461             : {
    5462           0 :         struct tevent_req *req = tevent_req_callback_data(
    5463             :                 subreq, struct tevent_req);
    5464           0 :         struct dcerpc_winreg_UnLoadKey_state *state = tevent_req_data(
    5465             :                 req, struct dcerpc_winreg_UnLoadKey_state);
    5466           0 :         NTSTATUS status;
    5467           0 :         TALLOC_CTX *mem_ctx;
    5468             : 
    5469           0 :         if (state->out_mem_ctx) {
    5470           0 :                 mem_ctx = state->out_mem_ctx;
    5471             :         } else {
    5472           0 :                 mem_ctx = state;
    5473             :         }
    5474             : 
    5475           0 :         status = dcerpc_winreg_UnLoadKey_r_recv(subreq, mem_ctx);
    5476           0 :         TALLOC_FREE(subreq);
    5477           0 :         if (tevent_req_nterror(req, status)) {
    5478           0 :                 return;
    5479             :         }
    5480             : 
    5481             :         /* Copy out parameters */
    5482             : 
    5483             :         /* Copy result */
    5484           0 :         state->orig.out.result = state->tmp.out.result;
    5485             : 
    5486             :         /* Reset temporary structure */
    5487           0 :         NDR_ZERO_STRUCT(state->tmp);
    5488             : 
    5489           0 :         tevent_req_done(req);
    5490             : }
    5491             : 
    5492           0 : NTSTATUS dcerpc_winreg_UnLoadKey_recv(struct tevent_req *req,
    5493             :                                       TALLOC_CTX *mem_ctx,
    5494             :                                       WERROR *result)
    5495             : {
    5496           0 :         struct dcerpc_winreg_UnLoadKey_state *state = tevent_req_data(
    5497             :                 req, struct dcerpc_winreg_UnLoadKey_state);
    5498           0 :         NTSTATUS status;
    5499             : 
    5500           0 :         if (tevent_req_is_nterror(req, &status)) {
    5501           0 :                 tevent_req_received(req);
    5502           0 :                 return status;
    5503             :         }
    5504             : 
    5505             :         /* Steal possible out parameters to the callers context */
    5506           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5507             : 
    5508             :         /* Return result */
    5509           0 :         *result = state->orig.out.result;
    5510             : 
    5511           0 :         tevent_req_received(req);
    5512           0 :         return NT_STATUS_OK;
    5513             : }
    5514             : 
    5515           0 : NTSTATUS dcerpc_winreg_UnLoadKey(struct dcerpc_binding_handle *h,
    5516             :                                  TALLOC_CTX *mem_ctx,
    5517             :                                  struct policy_handle *_handle /* [in] [ref] */,
    5518             :                                  struct winreg_String *_subkey /* [in] [ref] */,
    5519             :                                  WERROR *result)
    5520             : {
    5521           0 :         struct winreg_UnLoadKey r;
    5522           0 :         NTSTATUS status;
    5523             : 
    5524             :         /* In parameters */
    5525           0 :         r.in.handle = _handle;
    5526           0 :         r.in.subkey = _subkey;
    5527             : 
    5528             :         /* Out parameters */
    5529             : 
    5530             :         /* Result */
    5531           0 :         NDR_ZERO_STRUCT(r.out.result);
    5532             : 
    5533           0 :         status = dcerpc_winreg_UnLoadKey_r(h, mem_ctx, &r);
    5534           0 :         if (!NT_STATUS_IS_OK(status)) {
    5535           0 :                 return status;
    5536             :         }
    5537             : 
    5538             :         /* Return variables */
    5539             : 
    5540             :         /* Return result */
    5541           0 :         *result = r.out.result;
    5542             : 
    5543           0 :         return NT_STATUS_OK;
    5544             : }
    5545             : 
    5546             : struct dcerpc_winreg_InitiateSystemShutdown_r_state {
    5547             :         TALLOC_CTX *out_mem_ctx;
    5548             : };
    5549             : 
    5550             : static void dcerpc_winreg_InitiateSystemShutdown_r_done(struct tevent_req *subreq);
    5551             : 
    5552           0 : struct tevent_req *dcerpc_winreg_InitiateSystemShutdown_r_send(TALLOC_CTX *mem_ctx,
    5553             :         struct tevent_context *ev,
    5554             :         struct dcerpc_binding_handle *h,
    5555             :         struct winreg_InitiateSystemShutdown *r)
    5556             : {
    5557           0 :         struct tevent_req *req;
    5558           0 :         struct dcerpc_winreg_InitiateSystemShutdown_r_state *state;
    5559           0 :         struct tevent_req *subreq;
    5560             : 
    5561           0 :         req = tevent_req_create(mem_ctx, &state,
    5562             :                                 struct dcerpc_winreg_InitiateSystemShutdown_r_state);
    5563           0 :         if (req == NULL) {
    5564           0 :                 return NULL;
    5565             :         }
    5566             : 
    5567           0 :         state->out_mem_ctx = NULL;
    5568             : 
    5569           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    5570             :                         NULL, &ndr_table_winreg,
    5571             :                         NDR_WINREG_INITIATESYSTEMSHUTDOWN, state, r);
    5572           0 :         if (tevent_req_nomem(subreq, req)) {
    5573           0 :                 return tevent_req_post(req, ev);
    5574             :         }
    5575           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_InitiateSystemShutdown_r_done, req);
    5576             : 
    5577           0 :         return req;
    5578             : }
    5579             : 
    5580           0 : static void dcerpc_winreg_InitiateSystemShutdown_r_done(struct tevent_req *subreq)
    5581             : {
    5582           0 :         struct tevent_req *req =
    5583           0 :                 tevent_req_callback_data(subreq,
    5584             :                 struct tevent_req);
    5585           0 :         NTSTATUS status;
    5586             : 
    5587           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    5588           0 :         TALLOC_FREE(subreq);
    5589           0 :         if (tevent_req_nterror(req, status)) {
    5590           0 :                 return;
    5591             :         }
    5592             : 
    5593           0 :         tevent_req_done(req);
    5594             : }
    5595             : 
    5596           0 : NTSTATUS dcerpc_winreg_InitiateSystemShutdown_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    5597             : {
    5598           0 :         struct dcerpc_winreg_InitiateSystemShutdown_r_state *state =
    5599           0 :                 tevent_req_data(req,
    5600             :                 struct dcerpc_winreg_InitiateSystemShutdown_r_state);
    5601           0 :         NTSTATUS status;
    5602             : 
    5603           0 :         if (tevent_req_is_nterror(req, &status)) {
    5604           0 :                 tevent_req_received(req);
    5605           0 :                 return status;
    5606             :         }
    5607             : 
    5608           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5609             : 
    5610           0 :         tevent_req_received(req);
    5611           0 :         return NT_STATUS_OK;
    5612             : }
    5613             : 
    5614           0 : NTSTATUS dcerpc_winreg_InitiateSystemShutdown_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_InitiateSystemShutdown *r)
    5615             : {
    5616           0 :         NTSTATUS status;
    5617             : 
    5618           0 :         status = dcerpc_binding_handle_call(h,
    5619             :                         NULL, &ndr_table_winreg,
    5620             :                         NDR_WINREG_INITIATESYSTEMSHUTDOWN, mem_ctx, r);
    5621             : 
    5622           0 :         return status;
    5623             : }
    5624             : 
    5625             : struct dcerpc_winreg_InitiateSystemShutdown_state {
    5626             :         struct winreg_InitiateSystemShutdown orig;
    5627             :         struct winreg_InitiateSystemShutdown tmp;
    5628             :         TALLOC_CTX *out_mem_ctx;
    5629             : };
    5630             : 
    5631             : static void dcerpc_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq);
    5632             : 
    5633           0 : struct tevent_req *dcerpc_winreg_InitiateSystemShutdown_send(TALLOC_CTX *mem_ctx,
    5634             :                                                              struct tevent_context *ev,
    5635             :                                                              struct dcerpc_binding_handle *h,
    5636             :                                                              uint16_t *_hostname /* [in] [unique] */,
    5637             :                                                              struct lsa_StringLarge *_message /* [in] [unique] */,
    5638             :                                                              uint32_t _timeout /* [in]  */,
    5639             :                                                              uint8_t _force_apps /* [in]  */,
    5640             :                                                              uint8_t _do_reboot /* [in]  */)
    5641             : {
    5642           0 :         struct tevent_req *req;
    5643           0 :         struct dcerpc_winreg_InitiateSystemShutdown_state *state;
    5644           0 :         struct tevent_req *subreq;
    5645             : 
    5646           0 :         req = tevent_req_create(mem_ctx, &state,
    5647             :                                 struct dcerpc_winreg_InitiateSystemShutdown_state);
    5648           0 :         if (req == NULL) {
    5649           0 :                 return NULL;
    5650             :         }
    5651           0 :         state->out_mem_ctx = NULL;
    5652             : 
    5653             :         /* In parameters */
    5654           0 :         state->orig.in.hostname = _hostname;
    5655           0 :         state->orig.in.message = _message;
    5656           0 :         state->orig.in.timeout = _timeout;
    5657           0 :         state->orig.in.force_apps = _force_apps;
    5658           0 :         state->orig.in.do_reboot = _do_reboot;
    5659             : 
    5660             :         /* Out parameters */
    5661             : 
    5662             :         /* Result */
    5663           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    5664             : 
    5665             :         /* make a temporary copy, that we pass to the dispatch function */
    5666           0 :         state->tmp = state->orig;
    5667             : 
    5668           0 :         subreq = dcerpc_winreg_InitiateSystemShutdown_r_send(state, ev, h, &state->tmp);
    5669           0 :         if (tevent_req_nomem(subreq, req)) {
    5670           0 :                 return tevent_req_post(req, ev);
    5671             :         }
    5672           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_InitiateSystemShutdown_done, req);
    5673           0 :         return req;
    5674             : }
    5675             : 
    5676           0 : static void dcerpc_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq)
    5677             : {
    5678           0 :         struct tevent_req *req = tevent_req_callback_data(
    5679             :                 subreq, struct tevent_req);
    5680           0 :         struct dcerpc_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
    5681             :                 req, struct dcerpc_winreg_InitiateSystemShutdown_state);
    5682           0 :         NTSTATUS status;
    5683           0 :         TALLOC_CTX *mem_ctx;
    5684             : 
    5685           0 :         if (state->out_mem_ctx) {
    5686           0 :                 mem_ctx = state->out_mem_ctx;
    5687             :         } else {
    5688           0 :                 mem_ctx = state;
    5689             :         }
    5690             : 
    5691           0 :         status = dcerpc_winreg_InitiateSystemShutdown_r_recv(subreq, mem_ctx);
    5692           0 :         TALLOC_FREE(subreq);
    5693           0 :         if (tevent_req_nterror(req, status)) {
    5694           0 :                 return;
    5695             :         }
    5696             : 
    5697             :         /* Copy out parameters */
    5698             : 
    5699             :         /* Copy result */
    5700           0 :         state->orig.out.result = state->tmp.out.result;
    5701             : 
    5702             :         /* Reset temporary structure */
    5703           0 :         NDR_ZERO_STRUCT(state->tmp);
    5704             : 
    5705           0 :         tevent_req_done(req);
    5706             : }
    5707             : 
    5708           0 : NTSTATUS dcerpc_winreg_InitiateSystemShutdown_recv(struct tevent_req *req,
    5709             :                                                    TALLOC_CTX *mem_ctx,
    5710             :                                                    WERROR *result)
    5711             : {
    5712           0 :         struct dcerpc_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
    5713             :                 req, struct dcerpc_winreg_InitiateSystemShutdown_state);
    5714           0 :         NTSTATUS status;
    5715             : 
    5716           0 :         if (tevent_req_is_nterror(req, &status)) {
    5717           0 :                 tevent_req_received(req);
    5718           0 :                 return status;
    5719             :         }
    5720             : 
    5721             :         /* Steal possible out parameters to the callers context */
    5722           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5723             : 
    5724             :         /* Return result */
    5725           0 :         *result = state->orig.out.result;
    5726             : 
    5727           0 :         tevent_req_received(req);
    5728           0 :         return NT_STATUS_OK;
    5729             : }
    5730             : 
    5731           0 : NTSTATUS dcerpc_winreg_InitiateSystemShutdown(struct dcerpc_binding_handle *h,
    5732             :                                               TALLOC_CTX *mem_ctx,
    5733             :                                               uint16_t *_hostname /* [in] [unique] */,
    5734             :                                               struct lsa_StringLarge *_message /* [in] [unique] */,
    5735             :                                               uint32_t _timeout /* [in]  */,
    5736             :                                               uint8_t _force_apps /* [in]  */,
    5737             :                                               uint8_t _do_reboot /* [in]  */,
    5738             :                                               WERROR *result)
    5739             : {
    5740           0 :         struct winreg_InitiateSystemShutdown r;
    5741           0 :         NTSTATUS status;
    5742             : 
    5743             :         /* In parameters */
    5744           0 :         r.in.hostname = _hostname;
    5745           0 :         r.in.message = _message;
    5746           0 :         r.in.timeout = _timeout;
    5747           0 :         r.in.force_apps = _force_apps;
    5748           0 :         r.in.do_reboot = _do_reboot;
    5749             : 
    5750             :         /* Out parameters */
    5751             : 
    5752             :         /* Result */
    5753           0 :         NDR_ZERO_STRUCT(r.out.result);
    5754             : 
    5755           0 :         status = dcerpc_winreg_InitiateSystemShutdown_r(h, mem_ctx, &r);
    5756           0 :         if (!NT_STATUS_IS_OK(status)) {
    5757           0 :                 return status;
    5758             :         }
    5759             : 
    5760             :         /* Return variables */
    5761             : 
    5762             :         /* Return result */
    5763           0 :         *result = r.out.result;
    5764             : 
    5765           0 :         return NT_STATUS_OK;
    5766             : }
    5767             : 
    5768             : struct dcerpc_winreg_AbortSystemShutdown_r_state {
    5769             :         TALLOC_CTX *out_mem_ctx;
    5770             : };
    5771             : 
    5772             : static void dcerpc_winreg_AbortSystemShutdown_r_done(struct tevent_req *subreq);
    5773             : 
    5774           0 : struct tevent_req *dcerpc_winreg_AbortSystemShutdown_r_send(TALLOC_CTX *mem_ctx,
    5775             :         struct tevent_context *ev,
    5776             :         struct dcerpc_binding_handle *h,
    5777             :         struct winreg_AbortSystemShutdown *r)
    5778             : {
    5779           0 :         struct tevent_req *req;
    5780           0 :         struct dcerpc_winreg_AbortSystemShutdown_r_state *state;
    5781           0 :         struct tevent_req *subreq;
    5782             : 
    5783           0 :         req = tevent_req_create(mem_ctx, &state,
    5784             :                                 struct dcerpc_winreg_AbortSystemShutdown_r_state);
    5785           0 :         if (req == NULL) {
    5786           0 :                 return NULL;
    5787             :         }
    5788             : 
    5789           0 :         state->out_mem_ctx = NULL;
    5790             : 
    5791           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    5792             :                         NULL, &ndr_table_winreg,
    5793             :                         NDR_WINREG_ABORTSYSTEMSHUTDOWN, state, r);
    5794           0 :         if (tevent_req_nomem(subreq, req)) {
    5795           0 :                 return tevent_req_post(req, ev);
    5796             :         }
    5797           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_AbortSystemShutdown_r_done, req);
    5798             : 
    5799           0 :         return req;
    5800             : }
    5801             : 
    5802           0 : static void dcerpc_winreg_AbortSystemShutdown_r_done(struct tevent_req *subreq)
    5803             : {
    5804           0 :         struct tevent_req *req =
    5805           0 :                 tevent_req_callback_data(subreq,
    5806             :                 struct tevent_req);
    5807           0 :         NTSTATUS status;
    5808             : 
    5809           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    5810           0 :         TALLOC_FREE(subreq);
    5811           0 :         if (tevent_req_nterror(req, status)) {
    5812           0 :                 return;
    5813             :         }
    5814             : 
    5815           0 :         tevent_req_done(req);
    5816             : }
    5817             : 
    5818           0 : NTSTATUS dcerpc_winreg_AbortSystemShutdown_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    5819             : {
    5820           0 :         struct dcerpc_winreg_AbortSystemShutdown_r_state *state =
    5821           0 :                 tevent_req_data(req,
    5822             :                 struct dcerpc_winreg_AbortSystemShutdown_r_state);
    5823           0 :         NTSTATUS status;
    5824             : 
    5825           0 :         if (tevent_req_is_nterror(req, &status)) {
    5826           0 :                 tevent_req_received(req);
    5827           0 :                 return status;
    5828             :         }
    5829             : 
    5830           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5831             : 
    5832           0 :         tevent_req_received(req);
    5833           0 :         return NT_STATUS_OK;
    5834             : }
    5835             : 
    5836           0 : NTSTATUS dcerpc_winreg_AbortSystemShutdown_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_AbortSystemShutdown *r)
    5837             : {
    5838           0 :         NTSTATUS status;
    5839             : 
    5840           0 :         status = dcerpc_binding_handle_call(h,
    5841             :                         NULL, &ndr_table_winreg,
    5842             :                         NDR_WINREG_ABORTSYSTEMSHUTDOWN, mem_ctx, r);
    5843             : 
    5844           0 :         return status;
    5845             : }
    5846             : 
    5847             : struct dcerpc_winreg_AbortSystemShutdown_state {
    5848             :         struct winreg_AbortSystemShutdown orig;
    5849             :         struct winreg_AbortSystemShutdown tmp;
    5850             :         TALLOC_CTX *out_mem_ctx;
    5851             : };
    5852             : 
    5853             : static void dcerpc_winreg_AbortSystemShutdown_done(struct tevent_req *subreq);
    5854             : 
    5855           0 : struct tevent_req *dcerpc_winreg_AbortSystemShutdown_send(TALLOC_CTX *mem_ctx,
    5856             :                                                           struct tevent_context *ev,
    5857             :                                                           struct dcerpc_binding_handle *h,
    5858             :                                                           uint16_t *_server /* [in] [unique] */)
    5859             : {
    5860           0 :         struct tevent_req *req;
    5861           0 :         struct dcerpc_winreg_AbortSystemShutdown_state *state;
    5862           0 :         struct tevent_req *subreq;
    5863             : 
    5864           0 :         req = tevent_req_create(mem_ctx, &state,
    5865             :                                 struct dcerpc_winreg_AbortSystemShutdown_state);
    5866           0 :         if (req == NULL) {
    5867           0 :                 return NULL;
    5868             :         }
    5869           0 :         state->out_mem_ctx = NULL;
    5870             : 
    5871             :         /* In parameters */
    5872           0 :         state->orig.in.server = _server;
    5873             : 
    5874             :         /* Out parameters */
    5875             : 
    5876             :         /* Result */
    5877           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    5878             : 
    5879             :         /* make a temporary copy, that we pass to the dispatch function */
    5880           0 :         state->tmp = state->orig;
    5881             : 
    5882           0 :         subreq = dcerpc_winreg_AbortSystemShutdown_r_send(state, ev, h, &state->tmp);
    5883           0 :         if (tevent_req_nomem(subreq, req)) {
    5884           0 :                 return tevent_req_post(req, ev);
    5885             :         }
    5886           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_AbortSystemShutdown_done, req);
    5887           0 :         return req;
    5888             : }
    5889             : 
    5890           0 : static void dcerpc_winreg_AbortSystemShutdown_done(struct tevent_req *subreq)
    5891             : {
    5892           0 :         struct tevent_req *req = tevent_req_callback_data(
    5893             :                 subreq, struct tevent_req);
    5894           0 :         struct dcerpc_winreg_AbortSystemShutdown_state *state = tevent_req_data(
    5895             :                 req, struct dcerpc_winreg_AbortSystemShutdown_state);
    5896           0 :         NTSTATUS status;
    5897           0 :         TALLOC_CTX *mem_ctx;
    5898             : 
    5899           0 :         if (state->out_mem_ctx) {
    5900           0 :                 mem_ctx = state->out_mem_ctx;
    5901             :         } else {
    5902           0 :                 mem_ctx = state;
    5903             :         }
    5904             : 
    5905           0 :         status = dcerpc_winreg_AbortSystemShutdown_r_recv(subreq, mem_ctx);
    5906           0 :         TALLOC_FREE(subreq);
    5907           0 :         if (tevent_req_nterror(req, status)) {
    5908           0 :                 return;
    5909             :         }
    5910             : 
    5911             :         /* Copy out parameters */
    5912             : 
    5913             :         /* Copy result */
    5914           0 :         state->orig.out.result = state->tmp.out.result;
    5915             : 
    5916             :         /* Reset temporary structure */
    5917           0 :         NDR_ZERO_STRUCT(state->tmp);
    5918             : 
    5919           0 :         tevent_req_done(req);
    5920             : }
    5921             : 
    5922           0 : NTSTATUS dcerpc_winreg_AbortSystemShutdown_recv(struct tevent_req *req,
    5923             :                                                 TALLOC_CTX *mem_ctx,
    5924             :                                                 WERROR *result)
    5925             : {
    5926           0 :         struct dcerpc_winreg_AbortSystemShutdown_state *state = tevent_req_data(
    5927             :                 req, struct dcerpc_winreg_AbortSystemShutdown_state);
    5928           0 :         NTSTATUS status;
    5929             : 
    5930           0 :         if (tevent_req_is_nterror(req, &status)) {
    5931           0 :                 tevent_req_received(req);
    5932           0 :                 return status;
    5933             :         }
    5934             : 
    5935             :         /* Steal possible out parameters to the callers context */
    5936           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    5937             : 
    5938             :         /* Return result */
    5939           0 :         *result = state->orig.out.result;
    5940             : 
    5941           0 :         tevent_req_received(req);
    5942           0 :         return NT_STATUS_OK;
    5943             : }
    5944             : 
    5945           0 : NTSTATUS dcerpc_winreg_AbortSystemShutdown(struct dcerpc_binding_handle *h,
    5946             :                                            TALLOC_CTX *mem_ctx,
    5947             :                                            uint16_t *_server /* [in] [unique] */,
    5948             :                                            WERROR *result)
    5949             : {
    5950           0 :         struct winreg_AbortSystemShutdown r;
    5951           0 :         NTSTATUS status;
    5952             : 
    5953             :         /* In parameters */
    5954           0 :         r.in.server = _server;
    5955             : 
    5956             :         /* Out parameters */
    5957             : 
    5958             :         /* Result */
    5959           0 :         NDR_ZERO_STRUCT(r.out.result);
    5960             : 
    5961           0 :         status = dcerpc_winreg_AbortSystemShutdown_r(h, mem_ctx, &r);
    5962           0 :         if (!NT_STATUS_IS_OK(status)) {
    5963           0 :                 return status;
    5964             :         }
    5965             : 
    5966             :         /* Return variables */
    5967             : 
    5968             :         /* Return result */
    5969           0 :         *result = r.out.result;
    5970             : 
    5971           0 :         return NT_STATUS_OK;
    5972             : }
    5973             : 
    5974             : struct dcerpc_winreg_GetVersion_r_state {
    5975             :         TALLOC_CTX *out_mem_ctx;
    5976             : };
    5977             : 
    5978             : static void dcerpc_winreg_GetVersion_r_done(struct tevent_req *subreq);
    5979             : 
    5980           0 : struct tevent_req *dcerpc_winreg_GetVersion_r_send(TALLOC_CTX *mem_ctx,
    5981             :         struct tevent_context *ev,
    5982             :         struct dcerpc_binding_handle *h,
    5983             :         struct winreg_GetVersion *r)
    5984             : {
    5985           0 :         struct tevent_req *req;
    5986           0 :         struct dcerpc_winreg_GetVersion_r_state *state;
    5987           0 :         struct tevent_req *subreq;
    5988             : 
    5989           0 :         req = tevent_req_create(mem_ctx, &state,
    5990             :                                 struct dcerpc_winreg_GetVersion_r_state);
    5991           0 :         if (req == NULL) {
    5992           0 :                 return NULL;
    5993             :         }
    5994             : 
    5995           0 :         state->out_mem_ctx = talloc_new(state);
    5996           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    5997           0 :                 return tevent_req_post(req, ev);
    5998             :         }
    5999             : 
    6000           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    6001             :                         NULL, &ndr_table_winreg,
    6002           0 :                         NDR_WINREG_GETVERSION, state->out_mem_ctx, r);
    6003           0 :         if (tevent_req_nomem(subreq, req)) {
    6004           0 :                 return tevent_req_post(req, ev);
    6005             :         }
    6006           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_GetVersion_r_done, req);
    6007             : 
    6008           0 :         return req;
    6009             : }
    6010             : 
    6011           0 : static void dcerpc_winreg_GetVersion_r_done(struct tevent_req *subreq)
    6012             : {
    6013           0 :         struct tevent_req *req =
    6014           0 :                 tevent_req_callback_data(subreq,
    6015             :                 struct tevent_req);
    6016           0 :         NTSTATUS status;
    6017             : 
    6018           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    6019           0 :         TALLOC_FREE(subreq);
    6020           0 :         if (tevent_req_nterror(req, status)) {
    6021           0 :                 return;
    6022             :         }
    6023             : 
    6024           0 :         tevent_req_done(req);
    6025             : }
    6026             : 
    6027           0 : NTSTATUS dcerpc_winreg_GetVersion_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    6028             : {
    6029           0 :         struct dcerpc_winreg_GetVersion_r_state *state =
    6030           0 :                 tevent_req_data(req,
    6031             :                 struct dcerpc_winreg_GetVersion_r_state);
    6032           0 :         NTSTATUS status;
    6033             : 
    6034           0 :         if (tevent_req_is_nterror(req, &status)) {
    6035           0 :                 tevent_req_received(req);
    6036           0 :                 return status;
    6037             :         }
    6038             : 
    6039           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6040             : 
    6041           0 :         tevent_req_received(req);
    6042           0 :         return NT_STATUS_OK;
    6043             : }
    6044             : 
    6045         349 : NTSTATUS dcerpc_winreg_GetVersion_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_GetVersion *r)
    6046             : {
    6047           0 :         NTSTATUS status;
    6048             : 
    6049         349 :         status = dcerpc_binding_handle_call(h,
    6050             :                         NULL, &ndr_table_winreg,
    6051             :                         NDR_WINREG_GETVERSION, mem_ctx, r);
    6052             : 
    6053         349 :         return status;
    6054             : }
    6055             : 
    6056             : struct dcerpc_winreg_GetVersion_state {
    6057             :         struct winreg_GetVersion orig;
    6058             :         struct winreg_GetVersion tmp;
    6059             :         TALLOC_CTX *out_mem_ctx;
    6060             : };
    6061             : 
    6062             : static void dcerpc_winreg_GetVersion_done(struct tevent_req *subreq);
    6063             : 
    6064           0 : struct tevent_req *dcerpc_winreg_GetVersion_send(TALLOC_CTX *mem_ctx,
    6065             :                                                  struct tevent_context *ev,
    6066             :                                                  struct dcerpc_binding_handle *h,
    6067             :                                                  struct policy_handle *_handle /* [in] [ref] */,
    6068             :                                                  uint32_t *_version /* [out] [ref] */)
    6069             : {
    6070           0 :         struct tevent_req *req;
    6071           0 :         struct dcerpc_winreg_GetVersion_state *state;
    6072           0 :         struct tevent_req *subreq;
    6073             : 
    6074           0 :         req = tevent_req_create(mem_ctx, &state,
    6075             :                                 struct dcerpc_winreg_GetVersion_state);
    6076           0 :         if (req == NULL) {
    6077           0 :                 return NULL;
    6078             :         }
    6079           0 :         state->out_mem_ctx = NULL;
    6080             : 
    6081             :         /* In parameters */
    6082           0 :         state->orig.in.handle = _handle;
    6083             : 
    6084             :         /* Out parameters */
    6085           0 :         state->orig.out.version = _version;
    6086             : 
    6087             :         /* Result */
    6088           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    6089             : 
    6090           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    6091             :                              "dcerpc_winreg_GetVersion_out_memory");
    6092           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6093           0 :                 return tevent_req_post(req, ev);
    6094             :         }
    6095             : 
    6096             :         /* make a temporary copy, that we pass to the dispatch function */
    6097           0 :         state->tmp = state->orig;
    6098             : 
    6099           0 :         subreq = dcerpc_winreg_GetVersion_r_send(state, ev, h, &state->tmp);
    6100           0 :         if (tevent_req_nomem(subreq, req)) {
    6101           0 :                 return tevent_req_post(req, ev);
    6102             :         }
    6103           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_GetVersion_done, req);
    6104           0 :         return req;
    6105             : }
    6106             : 
    6107           0 : static void dcerpc_winreg_GetVersion_done(struct tevent_req *subreq)
    6108             : {
    6109           0 :         struct tevent_req *req = tevent_req_callback_data(
    6110             :                 subreq, struct tevent_req);
    6111           0 :         struct dcerpc_winreg_GetVersion_state *state = tevent_req_data(
    6112             :                 req, struct dcerpc_winreg_GetVersion_state);
    6113           0 :         NTSTATUS status;
    6114           0 :         TALLOC_CTX *mem_ctx;
    6115             : 
    6116           0 :         if (state->out_mem_ctx) {
    6117           0 :                 mem_ctx = state->out_mem_ctx;
    6118             :         } else {
    6119           0 :                 mem_ctx = state;
    6120             :         }
    6121             : 
    6122           0 :         status = dcerpc_winreg_GetVersion_r_recv(subreq, mem_ctx);
    6123           0 :         TALLOC_FREE(subreq);
    6124           0 :         if (tevent_req_nterror(req, status)) {
    6125           0 :                 return;
    6126             :         }
    6127             : 
    6128             :         /* Copy out parameters */
    6129           0 :         *state->orig.out.version = *state->tmp.out.version;
    6130             : 
    6131             :         /* Copy result */
    6132           0 :         state->orig.out.result = state->tmp.out.result;
    6133             : 
    6134             :         /* Reset temporary structure */
    6135           0 :         NDR_ZERO_STRUCT(state->tmp);
    6136             : 
    6137           0 :         tevent_req_done(req);
    6138             : }
    6139             : 
    6140           0 : NTSTATUS dcerpc_winreg_GetVersion_recv(struct tevent_req *req,
    6141             :                                        TALLOC_CTX *mem_ctx,
    6142             :                                        WERROR *result)
    6143             : {
    6144           0 :         struct dcerpc_winreg_GetVersion_state *state = tevent_req_data(
    6145             :                 req, struct dcerpc_winreg_GetVersion_state);
    6146           0 :         NTSTATUS status;
    6147             : 
    6148           0 :         if (tevent_req_is_nterror(req, &status)) {
    6149           0 :                 tevent_req_received(req);
    6150           0 :                 return status;
    6151             :         }
    6152             : 
    6153             :         /* Steal possible out parameters to the callers context */
    6154           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6155             : 
    6156             :         /* Return result */
    6157           0 :         *result = state->orig.out.result;
    6158             : 
    6159           0 :         tevent_req_received(req);
    6160           0 :         return NT_STATUS_OK;
    6161             : }
    6162             : 
    6163           0 : NTSTATUS dcerpc_winreg_GetVersion(struct dcerpc_binding_handle *h,
    6164             :                                   TALLOC_CTX *mem_ctx,
    6165             :                                   struct policy_handle *_handle /* [in] [ref] */,
    6166             :                                   uint32_t *_version /* [out] [ref] */,
    6167             :                                   WERROR *result)
    6168             : {
    6169           0 :         struct winreg_GetVersion r;
    6170           0 :         NTSTATUS status;
    6171             : 
    6172             :         /* In parameters */
    6173           0 :         r.in.handle = _handle;
    6174             : 
    6175             :         /* Out parameters */
    6176           0 :         r.out.version = _version;
    6177             : 
    6178             :         /* Result */
    6179           0 :         NDR_ZERO_STRUCT(r.out.result);
    6180             : 
    6181           0 :         status = dcerpc_winreg_GetVersion_r(h, mem_ctx, &r);
    6182           0 :         if (!NT_STATUS_IS_OK(status)) {
    6183           0 :                 return status;
    6184             :         }
    6185             : 
    6186             :         /* Return variables */
    6187           0 :         *_version = *r.out.version;
    6188             : 
    6189             :         /* Return result */
    6190           0 :         *result = r.out.result;
    6191             : 
    6192           0 :         return NT_STATUS_OK;
    6193             : }
    6194             : 
    6195             : struct dcerpc_winreg_OpenHKCC_r_state {
    6196             :         TALLOC_CTX *out_mem_ctx;
    6197             : };
    6198             : 
    6199             : static void dcerpc_winreg_OpenHKCC_r_done(struct tevent_req *subreq);
    6200             : 
    6201           0 : struct tevent_req *dcerpc_winreg_OpenHKCC_r_send(TALLOC_CTX *mem_ctx,
    6202             :         struct tevent_context *ev,
    6203             :         struct dcerpc_binding_handle *h,
    6204             :         struct winreg_OpenHKCC *r)
    6205             : {
    6206           0 :         struct tevent_req *req;
    6207           0 :         struct dcerpc_winreg_OpenHKCC_r_state *state;
    6208           0 :         struct tevent_req *subreq;
    6209             : 
    6210           0 :         req = tevent_req_create(mem_ctx, &state,
    6211             :                                 struct dcerpc_winreg_OpenHKCC_r_state);
    6212           0 :         if (req == NULL) {
    6213           0 :                 return NULL;
    6214             :         }
    6215             : 
    6216           0 :         state->out_mem_ctx = talloc_new(state);
    6217           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6218           0 :                 return tevent_req_post(req, ev);
    6219             :         }
    6220             : 
    6221           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    6222             :                         NULL, &ndr_table_winreg,
    6223           0 :                         NDR_WINREG_OPENHKCC, state->out_mem_ctx, r);
    6224           0 :         if (tevent_req_nomem(subreq, req)) {
    6225           0 :                 return tevent_req_post(req, ev);
    6226             :         }
    6227           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCC_r_done, req);
    6228             : 
    6229           0 :         return req;
    6230             : }
    6231             : 
    6232           0 : static void dcerpc_winreg_OpenHKCC_r_done(struct tevent_req *subreq)
    6233             : {
    6234           0 :         struct tevent_req *req =
    6235           0 :                 tevent_req_callback_data(subreq,
    6236             :                 struct tevent_req);
    6237           0 :         NTSTATUS status;
    6238             : 
    6239           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    6240           0 :         TALLOC_FREE(subreq);
    6241           0 :         if (tevent_req_nterror(req, status)) {
    6242           0 :                 return;
    6243             :         }
    6244             : 
    6245           0 :         tevent_req_done(req);
    6246             : }
    6247             : 
    6248           0 : NTSTATUS dcerpc_winreg_OpenHKCC_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    6249             : {
    6250           0 :         struct dcerpc_winreg_OpenHKCC_r_state *state =
    6251           0 :                 tevent_req_data(req,
    6252             :                 struct dcerpc_winreg_OpenHKCC_r_state);
    6253           0 :         NTSTATUS status;
    6254             : 
    6255           0 :         if (tevent_req_is_nterror(req, &status)) {
    6256           0 :                 tevent_req_received(req);
    6257           0 :                 return status;
    6258             :         }
    6259             : 
    6260           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6261             : 
    6262           0 :         tevent_req_received(req);
    6263           0 :         return NT_STATUS_OK;
    6264             : }
    6265             : 
    6266           0 : NTSTATUS dcerpc_winreg_OpenHKCC_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKCC *r)
    6267             : {
    6268           0 :         NTSTATUS status;
    6269             : 
    6270           0 :         status = dcerpc_binding_handle_call(h,
    6271             :                         NULL, &ndr_table_winreg,
    6272             :                         NDR_WINREG_OPENHKCC, mem_ctx, r);
    6273             : 
    6274           0 :         return status;
    6275             : }
    6276             : 
    6277             : struct dcerpc_winreg_OpenHKCC_state {
    6278             :         struct winreg_OpenHKCC orig;
    6279             :         struct winreg_OpenHKCC tmp;
    6280             :         TALLOC_CTX *out_mem_ctx;
    6281             : };
    6282             : 
    6283             : static void dcerpc_winreg_OpenHKCC_done(struct tevent_req *subreq);
    6284             : 
    6285           0 : struct tevent_req *dcerpc_winreg_OpenHKCC_send(TALLOC_CTX *mem_ctx,
    6286             :                                                struct tevent_context *ev,
    6287             :                                                struct dcerpc_binding_handle *h,
    6288             :                                                uint16_t *_system_name /* [in] [unique] */,
    6289             :                                                uint32_t _access_mask /* [in]  */,
    6290             :                                                struct policy_handle *_handle /* [out] [ref] */)
    6291             : {
    6292           0 :         struct tevent_req *req;
    6293           0 :         struct dcerpc_winreg_OpenHKCC_state *state;
    6294           0 :         struct tevent_req *subreq;
    6295             : 
    6296           0 :         req = tevent_req_create(mem_ctx, &state,
    6297             :                                 struct dcerpc_winreg_OpenHKCC_state);
    6298           0 :         if (req == NULL) {
    6299           0 :                 return NULL;
    6300             :         }
    6301           0 :         state->out_mem_ctx = NULL;
    6302             : 
    6303             :         /* In parameters */
    6304           0 :         state->orig.in.system_name = _system_name;
    6305           0 :         state->orig.in.access_mask = _access_mask;
    6306             : 
    6307             :         /* Out parameters */
    6308           0 :         state->orig.out.handle = _handle;
    6309             : 
    6310             :         /* Result */
    6311           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    6312             : 
    6313           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    6314             :                              "dcerpc_winreg_OpenHKCC_out_memory");
    6315           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6316           0 :                 return tevent_req_post(req, ev);
    6317             :         }
    6318             : 
    6319             :         /* make a temporary copy, that we pass to the dispatch function */
    6320           0 :         state->tmp = state->orig;
    6321             : 
    6322           0 :         subreq = dcerpc_winreg_OpenHKCC_r_send(state, ev, h, &state->tmp);
    6323           0 :         if (tevent_req_nomem(subreq, req)) {
    6324           0 :                 return tevent_req_post(req, ev);
    6325             :         }
    6326           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCC_done, req);
    6327           0 :         return req;
    6328             : }
    6329             : 
    6330           0 : static void dcerpc_winreg_OpenHKCC_done(struct tevent_req *subreq)
    6331             : {
    6332           0 :         struct tevent_req *req = tevent_req_callback_data(
    6333             :                 subreq, struct tevent_req);
    6334           0 :         struct dcerpc_winreg_OpenHKCC_state *state = tevent_req_data(
    6335             :                 req, struct dcerpc_winreg_OpenHKCC_state);
    6336           0 :         NTSTATUS status;
    6337           0 :         TALLOC_CTX *mem_ctx;
    6338             : 
    6339           0 :         if (state->out_mem_ctx) {
    6340           0 :                 mem_ctx = state->out_mem_ctx;
    6341             :         } else {
    6342           0 :                 mem_ctx = state;
    6343             :         }
    6344             : 
    6345           0 :         status = dcerpc_winreg_OpenHKCC_r_recv(subreq, mem_ctx);
    6346           0 :         TALLOC_FREE(subreq);
    6347           0 :         if (tevent_req_nterror(req, status)) {
    6348           0 :                 return;
    6349             :         }
    6350             : 
    6351             :         /* Copy out parameters */
    6352           0 :         *state->orig.out.handle = *state->tmp.out.handle;
    6353             : 
    6354             :         /* Copy result */
    6355           0 :         state->orig.out.result = state->tmp.out.result;
    6356             : 
    6357             :         /* Reset temporary structure */
    6358           0 :         NDR_ZERO_STRUCT(state->tmp);
    6359             : 
    6360           0 :         tevent_req_done(req);
    6361             : }
    6362             : 
    6363           0 : NTSTATUS dcerpc_winreg_OpenHKCC_recv(struct tevent_req *req,
    6364             :                                      TALLOC_CTX *mem_ctx,
    6365             :                                      WERROR *result)
    6366             : {
    6367           0 :         struct dcerpc_winreg_OpenHKCC_state *state = tevent_req_data(
    6368             :                 req, struct dcerpc_winreg_OpenHKCC_state);
    6369           0 :         NTSTATUS status;
    6370             : 
    6371           0 :         if (tevent_req_is_nterror(req, &status)) {
    6372           0 :                 tevent_req_received(req);
    6373           0 :                 return status;
    6374             :         }
    6375             : 
    6376             :         /* Steal possible out parameters to the callers context */
    6377           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6378             : 
    6379             :         /* Return result */
    6380           0 :         *result = state->orig.out.result;
    6381             : 
    6382           0 :         tevent_req_received(req);
    6383           0 :         return NT_STATUS_OK;
    6384             : }
    6385             : 
    6386           0 : NTSTATUS dcerpc_winreg_OpenHKCC(struct dcerpc_binding_handle *h,
    6387             :                                 TALLOC_CTX *mem_ctx,
    6388             :                                 uint16_t *_system_name /* [in] [unique] */,
    6389             :                                 uint32_t _access_mask /* [in]  */,
    6390             :                                 struct policy_handle *_handle /* [out] [ref] */,
    6391             :                                 WERROR *result)
    6392             : {
    6393           0 :         struct winreg_OpenHKCC r;
    6394           0 :         NTSTATUS status;
    6395             : 
    6396             :         /* In parameters */
    6397           0 :         r.in.system_name = _system_name;
    6398           0 :         r.in.access_mask = _access_mask;
    6399             : 
    6400             :         /* Out parameters */
    6401           0 :         r.out.handle = _handle;
    6402             : 
    6403             :         /* Result */
    6404           0 :         NDR_ZERO_STRUCT(r.out.result);
    6405             : 
    6406           0 :         status = dcerpc_winreg_OpenHKCC_r(h, mem_ctx, &r);
    6407           0 :         if (!NT_STATUS_IS_OK(status)) {
    6408           0 :                 return status;
    6409             :         }
    6410             : 
    6411             :         /* Return variables */
    6412           0 :         *_handle = *r.out.handle;
    6413             : 
    6414             :         /* Return result */
    6415           0 :         *result = r.out.result;
    6416             : 
    6417           0 :         return NT_STATUS_OK;
    6418             : }
    6419             : 
    6420             : struct dcerpc_winreg_OpenHKDD_r_state {
    6421             :         TALLOC_CTX *out_mem_ctx;
    6422             : };
    6423             : 
    6424             : static void dcerpc_winreg_OpenHKDD_r_done(struct tevent_req *subreq);
    6425             : 
    6426           0 : struct tevent_req *dcerpc_winreg_OpenHKDD_r_send(TALLOC_CTX *mem_ctx,
    6427             :         struct tevent_context *ev,
    6428             :         struct dcerpc_binding_handle *h,
    6429             :         struct winreg_OpenHKDD *r)
    6430             : {
    6431           0 :         struct tevent_req *req;
    6432           0 :         struct dcerpc_winreg_OpenHKDD_r_state *state;
    6433           0 :         struct tevent_req *subreq;
    6434             : 
    6435           0 :         req = tevent_req_create(mem_ctx, &state,
    6436             :                                 struct dcerpc_winreg_OpenHKDD_r_state);
    6437           0 :         if (req == NULL) {
    6438           0 :                 return NULL;
    6439             :         }
    6440             : 
    6441           0 :         state->out_mem_ctx = talloc_new(state);
    6442           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6443           0 :                 return tevent_req_post(req, ev);
    6444             :         }
    6445             : 
    6446           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    6447             :                         NULL, &ndr_table_winreg,
    6448           0 :                         NDR_WINREG_OPENHKDD, state->out_mem_ctx, r);
    6449           0 :         if (tevent_req_nomem(subreq, req)) {
    6450           0 :                 return tevent_req_post(req, ev);
    6451             :         }
    6452           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKDD_r_done, req);
    6453             : 
    6454           0 :         return req;
    6455             : }
    6456             : 
    6457           0 : static void dcerpc_winreg_OpenHKDD_r_done(struct tevent_req *subreq)
    6458             : {
    6459           0 :         struct tevent_req *req =
    6460           0 :                 tevent_req_callback_data(subreq,
    6461             :                 struct tevent_req);
    6462           0 :         NTSTATUS status;
    6463             : 
    6464           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    6465           0 :         TALLOC_FREE(subreq);
    6466           0 :         if (tevent_req_nterror(req, status)) {
    6467           0 :                 return;
    6468             :         }
    6469             : 
    6470           0 :         tevent_req_done(req);
    6471             : }
    6472             : 
    6473           0 : NTSTATUS dcerpc_winreg_OpenHKDD_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    6474             : {
    6475           0 :         struct dcerpc_winreg_OpenHKDD_r_state *state =
    6476           0 :                 tevent_req_data(req,
    6477             :                 struct dcerpc_winreg_OpenHKDD_r_state);
    6478           0 :         NTSTATUS status;
    6479             : 
    6480           0 :         if (tevent_req_is_nterror(req, &status)) {
    6481           0 :                 tevent_req_received(req);
    6482           0 :                 return status;
    6483             :         }
    6484             : 
    6485           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6486             : 
    6487           0 :         tevent_req_received(req);
    6488           0 :         return NT_STATUS_OK;
    6489             : }
    6490             : 
    6491           0 : NTSTATUS dcerpc_winreg_OpenHKDD_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKDD *r)
    6492             : {
    6493           0 :         NTSTATUS status;
    6494             : 
    6495           0 :         status = dcerpc_binding_handle_call(h,
    6496             :                         NULL, &ndr_table_winreg,
    6497             :                         NDR_WINREG_OPENHKDD, mem_ctx, r);
    6498             : 
    6499           0 :         return status;
    6500             : }
    6501             : 
    6502             : struct dcerpc_winreg_OpenHKDD_state {
    6503             :         struct winreg_OpenHKDD orig;
    6504             :         struct winreg_OpenHKDD tmp;
    6505             :         TALLOC_CTX *out_mem_ctx;
    6506             : };
    6507             : 
    6508             : static void dcerpc_winreg_OpenHKDD_done(struct tevent_req *subreq);
    6509             : 
    6510           0 : struct tevent_req *dcerpc_winreg_OpenHKDD_send(TALLOC_CTX *mem_ctx,
    6511             :                                                struct tevent_context *ev,
    6512             :                                                struct dcerpc_binding_handle *h,
    6513             :                                                uint16_t *_system_name /* [in] [unique] */,
    6514             :                                                uint32_t _access_mask /* [in]  */,
    6515             :                                                struct policy_handle *_handle /* [out] [ref] */)
    6516             : {
    6517           0 :         struct tevent_req *req;
    6518           0 :         struct dcerpc_winreg_OpenHKDD_state *state;
    6519           0 :         struct tevent_req *subreq;
    6520             : 
    6521           0 :         req = tevent_req_create(mem_ctx, &state,
    6522             :                                 struct dcerpc_winreg_OpenHKDD_state);
    6523           0 :         if (req == NULL) {
    6524           0 :                 return NULL;
    6525             :         }
    6526           0 :         state->out_mem_ctx = NULL;
    6527             : 
    6528             :         /* In parameters */
    6529           0 :         state->orig.in.system_name = _system_name;
    6530           0 :         state->orig.in.access_mask = _access_mask;
    6531             : 
    6532             :         /* Out parameters */
    6533           0 :         state->orig.out.handle = _handle;
    6534             : 
    6535             :         /* Result */
    6536           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    6537             : 
    6538           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    6539             :                              "dcerpc_winreg_OpenHKDD_out_memory");
    6540           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6541           0 :                 return tevent_req_post(req, ev);
    6542             :         }
    6543             : 
    6544             :         /* make a temporary copy, that we pass to the dispatch function */
    6545           0 :         state->tmp = state->orig;
    6546             : 
    6547           0 :         subreq = dcerpc_winreg_OpenHKDD_r_send(state, ev, h, &state->tmp);
    6548           0 :         if (tevent_req_nomem(subreq, req)) {
    6549           0 :                 return tevent_req_post(req, ev);
    6550             :         }
    6551           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKDD_done, req);
    6552           0 :         return req;
    6553             : }
    6554             : 
    6555           0 : static void dcerpc_winreg_OpenHKDD_done(struct tevent_req *subreq)
    6556             : {
    6557           0 :         struct tevent_req *req = tevent_req_callback_data(
    6558             :                 subreq, struct tevent_req);
    6559           0 :         struct dcerpc_winreg_OpenHKDD_state *state = tevent_req_data(
    6560             :                 req, struct dcerpc_winreg_OpenHKDD_state);
    6561           0 :         NTSTATUS status;
    6562           0 :         TALLOC_CTX *mem_ctx;
    6563             : 
    6564           0 :         if (state->out_mem_ctx) {
    6565           0 :                 mem_ctx = state->out_mem_ctx;
    6566             :         } else {
    6567           0 :                 mem_ctx = state;
    6568             :         }
    6569             : 
    6570           0 :         status = dcerpc_winreg_OpenHKDD_r_recv(subreq, mem_ctx);
    6571           0 :         TALLOC_FREE(subreq);
    6572           0 :         if (tevent_req_nterror(req, status)) {
    6573           0 :                 return;
    6574             :         }
    6575             : 
    6576             :         /* Copy out parameters */
    6577           0 :         *state->orig.out.handle = *state->tmp.out.handle;
    6578             : 
    6579             :         /* Copy result */
    6580           0 :         state->orig.out.result = state->tmp.out.result;
    6581             : 
    6582             :         /* Reset temporary structure */
    6583           0 :         NDR_ZERO_STRUCT(state->tmp);
    6584             : 
    6585           0 :         tevent_req_done(req);
    6586             : }
    6587             : 
    6588           0 : NTSTATUS dcerpc_winreg_OpenHKDD_recv(struct tevent_req *req,
    6589             :                                      TALLOC_CTX *mem_ctx,
    6590             :                                      WERROR *result)
    6591             : {
    6592           0 :         struct dcerpc_winreg_OpenHKDD_state *state = tevent_req_data(
    6593             :                 req, struct dcerpc_winreg_OpenHKDD_state);
    6594           0 :         NTSTATUS status;
    6595             : 
    6596           0 :         if (tevent_req_is_nterror(req, &status)) {
    6597           0 :                 tevent_req_received(req);
    6598           0 :                 return status;
    6599             :         }
    6600             : 
    6601             :         /* Steal possible out parameters to the callers context */
    6602           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6603             : 
    6604             :         /* Return result */
    6605           0 :         *result = state->orig.out.result;
    6606             : 
    6607           0 :         tevent_req_received(req);
    6608           0 :         return NT_STATUS_OK;
    6609             : }
    6610             : 
    6611           0 : NTSTATUS dcerpc_winreg_OpenHKDD(struct dcerpc_binding_handle *h,
    6612             :                                 TALLOC_CTX *mem_ctx,
    6613             :                                 uint16_t *_system_name /* [in] [unique] */,
    6614             :                                 uint32_t _access_mask /* [in]  */,
    6615             :                                 struct policy_handle *_handle /* [out] [ref] */,
    6616             :                                 WERROR *result)
    6617             : {
    6618           0 :         struct winreg_OpenHKDD r;
    6619           0 :         NTSTATUS status;
    6620             : 
    6621             :         /* In parameters */
    6622           0 :         r.in.system_name = _system_name;
    6623           0 :         r.in.access_mask = _access_mask;
    6624             : 
    6625             :         /* Out parameters */
    6626           0 :         r.out.handle = _handle;
    6627             : 
    6628             :         /* Result */
    6629           0 :         NDR_ZERO_STRUCT(r.out.result);
    6630             : 
    6631           0 :         status = dcerpc_winreg_OpenHKDD_r(h, mem_ctx, &r);
    6632           0 :         if (!NT_STATUS_IS_OK(status)) {
    6633           0 :                 return status;
    6634             :         }
    6635             : 
    6636             :         /* Return variables */
    6637           0 :         *_handle = *r.out.handle;
    6638             : 
    6639             :         /* Return result */
    6640           0 :         *result = r.out.result;
    6641             : 
    6642           0 :         return NT_STATUS_OK;
    6643             : }
    6644             : 
    6645             : struct dcerpc_winreg_QueryMultipleValues_r_state {
    6646             :         TALLOC_CTX *out_mem_ctx;
    6647             : };
    6648             : 
    6649             : static void dcerpc_winreg_QueryMultipleValues_r_done(struct tevent_req *subreq);
    6650             : 
    6651           0 : struct tevent_req *dcerpc_winreg_QueryMultipleValues_r_send(TALLOC_CTX *mem_ctx,
    6652             :         struct tevent_context *ev,
    6653             :         struct dcerpc_binding_handle *h,
    6654             :         struct winreg_QueryMultipleValues *r)
    6655             : {
    6656           0 :         struct tevent_req *req;
    6657           0 :         struct dcerpc_winreg_QueryMultipleValues_r_state *state;
    6658           0 :         struct tevent_req *subreq;
    6659             : 
    6660           0 :         req = tevent_req_create(mem_ctx, &state,
    6661             :                                 struct dcerpc_winreg_QueryMultipleValues_r_state);
    6662           0 :         if (req == NULL) {
    6663           0 :                 return NULL;
    6664             :         }
    6665             : 
    6666           0 :         state->out_mem_ctx = talloc_new(state);
    6667           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6668           0 :                 return tevent_req_post(req, ev);
    6669             :         }
    6670             : 
    6671           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    6672             :                         NULL, &ndr_table_winreg,
    6673           0 :                         NDR_WINREG_QUERYMULTIPLEVALUES, state->out_mem_ctx, r);
    6674           0 :         if (tevent_req_nomem(subreq, req)) {
    6675           0 :                 return tevent_req_post(req, ev);
    6676             :         }
    6677           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_QueryMultipleValues_r_done, req);
    6678             : 
    6679           0 :         return req;
    6680             : }
    6681             : 
    6682           0 : static void dcerpc_winreg_QueryMultipleValues_r_done(struct tevent_req *subreq)
    6683             : {
    6684           0 :         struct tevent_req *req =
    6685           0 :                 tevent_req_callback_data(subreq,
    6686             :                 struct tevent_req);
    6687           0 :         NTSTATUS status;
    6688             : 
    6689           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    6690           0 :         TALLOC_FREE(subreq);
    6691           0 :         if (tevent_req_nterror(req, status)) {
    6692           0 :                 return;
    6693             :         }
    6694             : 
    6695           0 :         tevent_req_done(req);
    6696             : }
    6697             : 
    6698           0 : NTSTATUS dcerpc_winreg_QueryMultipleValues_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    6699             : {
    6700           0 :         struct dcerpc_winreg_QueryMultipleValues_r_state *state =
    6701           0 :                 tevent_req_data(req,
    6702             :                 struct dcerpc_winreg_QueryMultipleValues_r_state);
    6703           0 :         NTSTATUS status;
    6704             : 
    6705           0 :         if (tevent_req_is_nterror(req, &status)) {
    6706           0 :                 tevent_req_received(req);
    6707           0 :                 return status;
    6708             :         }
    6709             : 
    6710           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6711             : 
    6712           0 :         tevent_req_received(req);
    6713           0 :         return NT_STATUS_OK;
    6714             : }
    6715             : 
    6716          88 : NTSTATUS dcerpc_winreg_QueryMultipleValues_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_QueryMultipleValues *r)
    6717             : {
    6718           0 :         NTSTATUS status;
    6719             : 
    6720          88 :         status = dcerpc_binding_handle_call(h,
    6721             :                         NULL, &ndr_table_winreg,
    6722             :                         NDR_WINREG_QUERYMULTIPLEVALUES, mem_ctx, r);
    6723             : 
    6724          88 :         return status;
    6725             : }
    6726             : 
    6727             : struct dcerpc_winreg_QueryMultipleValues_state {
    6728             :         struct winreg_QueryMultipleValues orig;
    6729             :         struct winreg_QueryMultipleValues tmp;
    6730             :         TALLOC_CTX *out_mem_ctx;
    6731             : };
    6732             : 
    6733             : static void dcerpc_winreg_QueryMultipleValues_done(struct tevent_req *subreq);
    6734             : 
    6735           0 : struct tevent_req *dcerpc_winreg_QueryMultipleValues_send(TALLOC_CTX *mem_ctx,
    6736             :                                                           struct tevent_context *ev,
    6737             :                                                           struct dcerpc_binding_handle *h,
    6738             :                                                           struct policy_handle *_key_handle /* [in] [ref] */,
    6739             :                                                           struct QueryMultipleValue *_values_in /* [in] [length_is(num_values),ref,size_is(num_values)] */,
    6740             :                                                           struct QueryMultipleValue *_values_out /* [out] [length_is(num_values),ref,size_is(num_values)] */,
    6741             :                                                           uint32_t _num_values /* [in]  */,
    6742             :                                                           uint8_t *_buffer /* [in,out] [length_is(*buffer_size),size_is(*buffer_size),unique] */,
    6743             :                                                           uint32_t *_buffer_size /* [in,out] [ref] */)
    6744             : {
    6745           0 :         struct tevent_req *req;
    6746           0 :         struct dcerpc_winreg_QueryMultipleValues_state *state;
    6747           0 :         struct tevent_req *subreq;
    6748             : 
    6749           0 :         req = tevent_req_create(mem_ctx, &state,
    6750             :                                 struct dcerpc_winreg_QueryMultipleValues_state);
    6751           0 :         if (req == NULL) {
    6752           0 :                 return NULL;
    6753             :         }
    6754           0 :         state->out_mem_ctx = NULL;
    6755             : 
    6756             :         /* In parameters */
    6757           0 :         state->orig.in.key_handle = _key_handle;
    6758           0 :         state->orig.in.values_in = _values_in;
    6759           0 :         state->orig.in.num_values = _num_values;
    6760           0 :         state->orig.in.buffer = _buffer;
    6761           0 :         state->orig.in.buffer_size = _buffer_size;
    6762             : 
    6763             :         /* Out parameters */
    6764           0 :         state->orig.out.values_out = _values_out;
    6765           0 :         state->orig.out.buffer = _buffer;
    6766           0 :         state->orig.out.buffer_size = _buffer_size;
    6767             : 
    6768             :         /* Result */
    6769           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    6770             : 
    6771           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    6772             :                              "dcerpc_winreg_QueryMultipleValues_out_memory");
    6773           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    6774           0 :                 return tevent_req_post(req, ev);
    6775             :         }
    6776             : 
    6777             :         /* make a temporary copy, that we pass to the dispatch function */
    6778           0 :         state->tmp = state->orig;
    6779             : 
    6780           0 :         subreq = dcerpc_winreg_QueryMultipleValues_r_send(state, ev, h, &state->tmp);
    6781           0 :         if (tevent_req_nomem(subreq, req)) {
    6782           0 :                 return tevent_req_post(req, ev);
    6783             :         }
    6784           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_QueryMultipleValues_done, req);
    6785           0 :         return req;
    6786             : }
    6787             : 
    6788           0 : static void dcerpc_winreg_QueryMultipleValues_done(struct tevent_req *subreq)
    6789             : {
    6790           0 :         struct tevent_req *req = tevent_req_callback_data(
    6791             :                 subreq, struct tevent_req);
    6792           0 :         struct dcerpc_winreg_QueryMultipleValues_state *state = tevent_req_data(
    6793             :                 req, struct dcerpc_winreg_QueryMultipleValues_state);
    6794           0 :         NTSTATUS status;
    6795           0 :         TALLOC_CTX *mem_ctx;
    6796             : 
    6797           0 :         if (state->out_mem_ctx) {
    6798           0 :                 mem_ctx = state->out_mem_ctx;
    6799             :         } else {
    6800           0 :                 mem_ctx = state;
    6801             :         }
    6802             : 
    6803           0 :         status = dcerpc_winreg_QueryMultipleValues_r_recv(subreq, mem_ctx);
    6804           0 :         TALLOC_FREE(subreq);
    6805           0 :         if (tevent_req_nterror(req, status)) {
    6806           0 :                 return;
    6807             :         }
    6808             : 
    6809             :         /* Copy out parameters */
    6810             :         {
    6811           0 :                 size_t _copy_len_values_out;
    6812           0 :                 _copy_len_values_out = state->tmp.in.num_values;
    6813           0 :                 if (state->orig.out.values_out != state->tmp.out.values_out) {
    6814           0 :                         memcpy(state->orig.out.values_out, state->tmp.out.values_out, _copy_len_values_out * sizeof(*state->orig.out.values_out));
    6815             :                 }
    6816             :         }
    6817           0 :         if (state->orig.out.buffer && state->tmp.out.buffer) {
    6818             :                 {
    6819           0 :                         size_t _copy_len_buffer;
    6820           0 :                         if ((*state->tmp.out.buffer_size) > (*state->tmp.in.buffer_size)) {
    6821           0 :                                 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
    6822           0 :                                 return;
    6823             :                         }
    6824           0 :                         _copy_len_buffer = *state->tmp.out.buffer_size;
    6825           0 :                         if (state->orig.out.buffer != state->tmp.out.buffer) {
    6826           0 :                                 memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
    6827             :                         }
    6828             :                 }
    6829             :         }
    6830           0 :         *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
    6831             : 
    6832             :         /* Copy result */
    6833           0 :         state->orig.out.result = state->tmp.out.result;
    6834             : 
    6835             :         /* Reset temporary structure */
    6836           0 :         NDR_ZERO_STRUCT(state->tmp);
    6837             : 
    6838           0 :         tevent_req_done(req);
    6839             : }
    6840             : 
    6841           0 : NTSTATUS dcerpc_winreg_QueryMultipleValues_recv(struct tevent_req *req,
    6842             :                                                 TALLOC_CTX *mem_ctx,
    6843             :                                                 WERROR *result)
    6844             : {
    6845           0 :         struct dcerpc_winreg_QueryMultipleValues_state *state = tevent_req_data(
    6846             :                 req, struct dcerpc_winreg_QueryMultipleValues_state);
    6847           0 :         NTSTATUS status;
    6848             : 
    6849           0 :         if (tevent_req_is_nterror(req, &status)) {
    6850           0 :                 tevent_req_received(req);
    6851           0 :                 return status;
    6852             :         }
    6853             : 
    6854             :         /* Steal possible out parameters to the callers context */
    6855           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6856             : 
    6857             :         /* Return result */
    6858           0 :         *result = state->orig.out.result;
    6859             : 
    6860           0 :         tevent_req_received(req);
    6861           0 :         return NT_STATUS_OK;
    6862             : }
    6863             : 
    6864           0 : NTSTATUS dcerpc_winreg_QueryMultipleValues(struct dcerpc_binding_handle *h,
    6865             :                                            TALLOC_CTX *mem_ctx,
    6866             :                                            struct policy_handle *_key_handle /* [in] [ref] */,
    6867             :                                            struct QueryMultipleValue *_values_in /* [in] [length_is(num_values),ref,size_is(num_values)] */,
    6868             :                                            struct QueryMultipleValue *_values_out /* [out] [length_is(num_values),ref,size_is(num_values)] */,
    6869             :                                            uint32_t _num_values /* [in]  */,
    6870             :                                            uint8_t *_buffer /* [in,out] [length_is(*buffer_size),size_is(*buffer_size),unique] */,
    6871             :                                            uint32_t *_buffer_size /* [in,out] [ref] */,
    6872             :                                            WERROR *result)
    6873             : {
    6874           0 :         struct winreg_QueryMultipleValues r;
    6875           0 :         NTSTATUS status;
    6876             : 
    6877             :         /* In parameters */
    6878           0 :         r.in.key_handle = _key_handle;
    6879           0 :         r.in.values_in = _values_in;
    6880           0 :         r.in.num_values = _num_values;
    6881           0 :         r.in.buffer = _buffer;
    6882           0 :         r.in.buffer_size = _buffer_size;
    6883             : 
    6884             :         /* Out parameters */
    6885           0 :         r.out.values_out = _values_out;
    6886           0 :         r.out.buffer = _buffer;
    6887           0 :         r.out.buffer_size = _buffer_size;
    6888             : 
    6889             :         /* Result */
    6890           0 :         NDR_ZERO_STRUCT(r.out.result);
    6891             : 
    6892           0 :         status = dcerpc_winreg_QueryMultipleValues_r(h, mem_ctx, &r);
    6893           0 :         if (!NT_STATUS_IS_OK(status)) {
    6894           0 :                 return status;
    6895             :         }
    6896             : 
    6897             :         /* Return variables */
    6898             :         {
    6899           0 :                 size_t _copy_len_values_out;
    6900           0 :                 _copy_len_values_out = r.in.num_values;
    6901           0 :                 if (_values_out != r.out.values_out) {
    6902           0 :                         memcpy(_values_out, r.out.values_out, _copy_len_values_out * sizeof(*_values_out));
    6903             :                 }
    6904             :         }
    6905           0 :         if (_buffer && r.out.buffer) {
    6906             :                 {
    6907           0 :                         size_t _copy_len_buffer;
    6908           0 :                         if ((*r.out.buffer_size) > (*r.in.buffer_size)) {
    6909           0 :                                 return NT_STATUS_INVALID_NETWORK_RESPONSE;
    6910             :                         }
    6911           0 :                         _copy_len_buffer = *r.out.buffer_size;
    6912           0 :                         if (_buffer != r.out.buffer) {
    6913           0 :                                 memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
    6914             :                         }
    6915             :                 }
    6916             :         }
    6917           0 :         *_buffer_size = *r.out.buffer_size;
    6918             : 
    6919             :         /* Return result */
    6920           0 :         *result = r.out.result;
    6921             : 
    6922           0 :         return NT_STATUS_OK;
    6923             : }
    6924             : 
    6925             : struct dcerpc_winreg_InitiateSystemShutdownEx_r_state {
    6926             :         TALLOC_CTX *out_mem_ctx;
    6927             : };
    6928             : 
    6929             : static void dcerpc_winreg_InitiateSystemShutdownEx_r_done(struct tevent_req *subreq);
    6930             : 
    6931           0 : struct tevent_req *dcerpc_winreg_InitiateSystemShutdownEx_r_send(TALLOC_CTX *mem_ctx,
    6932             :         struct tevent_context *ev,
    6933             :         struct dcerpc_binding_handle *h,
    6934             :         struct winreg_InitiateSystemShutdownEx *r)
    6935             : {
    6936           0 :         struct tevent_req *req;
    6937           0 :         struct dcerpc_winreg_InitiateSystemShutdownEx_r_state *state;
    6938           0 :         struct tevent_req *subreq;
    6939             : 
    6940           0 :         req = tevent_req_create(mem_ctx, &state,
    6941             :                                 struct dcerpc_winreg_InitiateSystemShutdownEx_r_state);
    6942           0 :         if (req == NULL) {
    6943           0 :                 return NULL;
    6944             :         }
    6945             : 
    6946           0 :         state->out_mem_ctx = NULL;
    6947             : 
    6948           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    6949             :                         NULL, &ndr_table_winreg,
    6950             :                         NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, state, r);
    6951           0 :         if (tevent_req_nomem(subreq, req)) {
    6952           0 :                 return tevent_req_post(req, ev);
    6953             :         }
    6954           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_InitiateSystemShutdownEx_r_done, req);
    6955             : 
    6956           0 :         return req;
    6957             : }
    6958             : 
    6959           0 : static void dcerpc_winreg_InitiateSystemShutdownEx_r_done(struct tevent_req *subreq)
    6960             : {
    6961           0 :         struct tevent_req *req =
    6962           0 :                 tevent_req_callback_data(subreq,
    6963             :                 struct tevent_req);
    6964           0 :         NTSTATUS status;
    6965             : 
    6966           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    6967           0 :         TALLOC_FREE(subreq);
    6968           0 :         if (tevent_req_nterror(req, status)) {
    6969           0 :                 return;
    6970             :         }
    6971             : 
    6972           0 :         tevent_req_done(req);
    6973             : }
    6974             : 
    6975           0 : NTSTATUS dcerpc_winreg_InitiateSystemShutdownEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    6976             : {
    6977           0 :         struct dcerpc_winreg_InitiateSystemShutdownEx_r_state *state =
    6978           0 :                 tevent_req_data(req,
    6979             :                 struct dcerpc_winreg_InitiateSystemShutdownEx_r_state);
    6980           0 :         NTSTATUS status;
    6981             : 
    6982           0 :         if (tevent_req_is_nterror(req, &status)) {
    6983           0 :                 tevent_req_received(req);
    6984           0 :                 return status;
    6985             :         }
    6986             : 
    6987           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    6988             : 
    6989           0 :         tevent_req_received(req);
    6990           0 :         return NT_STATUS_OK;
    6991             : }
    6992             : 
    6993           0 : NTSTATUS dcerpc_winreg_InitiateSystemShutdownEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_InitiateSystemShutdownEx *r)
    6994             : {
    6995           0 :         NTSTATUS status;
    6996             : 
    6997           0 :         status = dcerpc_binding_handle_call(h,
    6998             :                         NULL, &ndr_table_winreg,
    6999             :                         NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, mem_ctx, r);
    7000             : 
    7001           0 :         return status;
    7002             : }
    7003             : 
    7004             : struct dcerpc_winreg_InitiateSystemShutdownEx_state {
    7005             :         struct winreg_InitiateSystemShutdownEx orig;
    7006             :         struct winreg_InitiateSystemShutdownEx tmp;
    7007             :         TALLOC_CTX *out_mem_ctx;
    7008             : };
    7009             : 
    7010             : static void dcerpc_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq);
    7011             : 
    7012           0 : struct tevent_req *dcerpc_winreg_InitiateSystemShutdownEx_send(TALLOC_CTX *mem_ctx,
    7013             :                                                                struct tevent_context *ev,
    7014             :                                                                struct dcerpc_binding_handle *h,
    7015             :                                                                uint16_t *_hostname /* [in] [unique] */,
    7016             :                                                                struct lsa_StringLarge *_message /* [in] [unique] */,
    7017             :                                                                uint32_t _timeout /* [in]  */,
    7018             :                                                                uint8_t _force_apps /* [in]  */,
    7019             :                                                                uint8_t _do_reboot /* [in]  */,
    7020             :                                                                uint32_t _reason /* [in]  */)
    7021             : {
    7022           0 :         struct tevent_req *req;
    7023           0 :         struct dcerpc_winreg_InitiateSystemShutdownEx_state *state;
    7024           0 :         struct tevent_req *subreq;
    7025             : 
    7026           0 :         req = tevent_req_create(mem_ctx, &state,
    7027             :                                 struct dcerpc_winreg_InitiateSystemShutdownEx_state);
    7028           0 :         if (req == NULL) {
    7029           0 :                 return NULL;
    7030             :         }
    7031           0 :         state->out_mem_ctx = NULL;
    7032             : 
    7033             :         /* In parameters */
    7034           0 :         state->orig.in.hostname = _hostname;
    7035           0 :         state->orig.in.message = _message;
    7036           0 :         state->orig.in.timeout = _timeout;
    7037           0 :         state->orig.in.force_apps = _force_apps;
    7038           0 :         state->orig.in.do_reboot = _do_reboot;
    7039           0 :         state->orig.in.reason = _reason;
    7040             : 
    7041             :         /* Out parameters */
    7042             : 
    7043             :         /* Result */
    7044           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    7045             : 
    7046             :         /* make a temporary copy, that we pass to the dispatch function */
    7047           0 :         state->tmp = state->orig;
    7048             : 
    7049           0 :         subreq = dcerpc_winreg_InitiateSystemShutdownEx_r_send(state, ev, h, &state->tmp);
    7050           0 :         if (tevent_req_nomem(subreq, req)) {
    7051           0 :                 return tevent_req_post(req, ev);
    7052             :         }
    7053           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_InitiateSystemShutdownEx_done, req);
    7054           0 :         return req;
    7055             : }
    7056             : 
    7057           0 : static void dcerpc_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq)
    7058             : {
    7059           0 :         struct tevent_req *req = tevent_req_callback_data(
    7060             :                 subreq, struct tevent_req);
    7061           0 :         struct dcerpc_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
    7062             :                 req, struct dcerpc_winreg_InitiateSystemShutdownEx_state);
    7063           0 :         NTSTATUS status;
    7064           0 :         TALLOC_CTX *mem_ctx;
    7065             : 
    7066           0 :         if (state->out_mem_ctx) {
    7067           0 :                 mem_ctx = state->out_mem_ctx;
    7068             :         } else {
    7069           0 :                 mem_ctx = state;
    7070             :         }
    7071             : 
    7072           0 :         status = dcerpc_winreg_InitiateSystemShutdownEx_r_recv(subreq, mem_ctx);
    7073           0 :         TALLOC_FREE(subreq);
    7074           0 :         if (tevent_req_nterror(req, status)) {
    7075           0 :                 return;
    7076             :         }
    7077             : 
    7078             :         /* Copy out parameters */
    7079             : 
    7080             :         /* Copy result */
    7081           0 :         state->orig.out.result = state->tmp.out.result;
    7082             : 
    7083             :         /* Reset temporary structure */
    7084           0 :         NDR_ZERO_STRUCT(state->tmp);
    7085             : 
    7086           0 :         tevent_req_done(req);
    7087             : }
    7088             : 
    7089           0 : NTSTATUS dcerpc_winreg_InitiateSystemShutdownEx_recv(struct tevent_req *req,
    7090             :                                                      TALLOC_CTX *mem_ctx,
    7091             :                                                      WERROR *result)
    7092             : {
    7093           0 :         struct dcerpc_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
    7094             :                 req, struct dcerpc_winreg_InitiateSystemShutdownEx_state);
    7095           0 :         NTSTATUS status;
    7096             : 
    7097           0 :         if (tevent_req_is_nterror(req, &status)) {
    7098           0 :                 tevent_req_received(req);
    7099           0 :                 return status;
    7100             :         }
    7101             : 
    7102             :         /* Steal possible out parameters to the callers context */
    7103           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7104             : 
    7105             :         /* Return result */
    7106           0 :         *result = state->orig.out.result;
    7107             : 
    7108           0 :         tevent_req_received(req);
    7109           0 :         return NT_STATUS_OK;
    7110             : }
    7111             : 
    7112           0 : NTSTATUS dcerpc_winreg_InitiateSystemShutdownEx(struct dcerpc_binding_handle *h,
    7113             :                                                 TALLOC_CTX *mem_ctx,
    7114             :                                                 uint16_t *_hostname /* [in] [unique] */,
    7115             :                                                 struct lsa_StringLarge *_message /* [in] [unique] */,
    7116             :                                                 uint32_t _timeout /* [in]  */,
    7117             :                                                 uint8_t _force_apps /* [in]  */,
    7118             :                                                 uint8_t _do_reboot /* [in]  */,
    7119             :                                                 uint32_t _reason /* [in]  */,
    7120             :                                                 WERROR *result)
    7121             : {
    7122           0 :         struct winreg_InitiateSystemShutdownEx r;
    7123           0 :         NTSTATUS status;
    7124             : 
    7125             :         /* In parameters */
    7126           0 :         r.in.hostname = _hostname;
    7127           0 :         r.in.message = _message;
    7128           0 :         r.in.timeout = _timeout;
    7129           0 :         r.in.force_apps = _force_apps;
    7130           0 :         r.in.do_reboot = _do_reboot;
    7131           0 :         r.in.reason = _reason;
    7132             : 
    7133             :         /* Out parameters */
    7134             : 
    7135             :         /* Result */
    7136           0 :         NDR_ZERO_STRUCT(r.out.result);
    7137             : 
    7138           0 :         status = dcerpc_winreg_InitiateSystemShutdownEx_r(h, mem_ctx, &r);
    7139           0 :         if (!NT_STATUS_IS_OK(status)) {
    7140           0 :                 return status;
    7141             :         }
    7142             : 
    7143             :         /* Return variables */
    7144             : 
    7145             :         /* Return result */
    7146           0 :         *result = r.out.result;
    7147             : 
    7148           0 :         return NT_STATUS_OK;
    7149             : }
    7150             : 
    7151             : struct dcerpc_winreg_SaveKeyEx_r_state {
    7152             :         TALLOC_CTX *out_mem_ctx;
    7153             : };
    7154             : 
    7155             : static void dcerpc_winreg_SaveKeyEx_r_done(struct tevent_req *subreq);
    7156             : 
    7157           0 : struct tevent_req *dcerpc_winreg_SaveKeyEx_r_send(TALLOC_CTX *mem_ctx,
    7158             :         struct tevent_context *ev,
    7159             :         struct dcerpc_binding_handle *h,
    7160             :         struct winreg_SaveKeyEx *r)
    7161             : {
    7162           0 :         struct tevent_req *req;
    7163           0 :         struct dcerpc_winreg_SaveKeyEx_r_state *state;
    7164           0 :         struct tevent_req *subreq;
    7165             : 
    7166           0 :         req = tevent_req_create(mem_ctx, &state,
    7167             :                                 struct dcerpc_winreg_SaveKeyEx_r_state);
    7168           0 :         if (req == NULL) {
    7169           0 :                 return NULL;
    7170             :         }
    7171             : 
    7172           0 :         state->out_mem_ctx = NULL;
    7173             : 
    7174           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    7175             :                         NULL, &ndr_table_winreg,
    7176             :                         NDR_WINREG_SAVEKEYEX, state, r);
    7177           0 :         if (tevent_req_nomem(subreq, req)) {
    7178           0 :                 return tevent_req_post(req, ev);
    7179             :         }
    7180           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_SaveKeyEx_r_done, req);
    7181             : 
    7182           0 :         return req;
    7183             : }
    7184             : 
    7185           0 : static void dcerpc_winreg_SaveKeyEx_r_done(struct tevent_req *subreq)
    7186             : {
    7187           0 :         struct tevent_req *req =
    7188           0 :                 tevent_req_callback_data(subreq,
    7189             :                 struct tevent_req);
    7190           0 :         NTSTATUS status;
    7191             : 
    7192           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    7193           0 :         TALLOC_FREE(subreq);
    7194           0 :         if (tevent_req_nterror(req, status)) {
    7195           0 :                 return;
    7196             :         }
    7197             : 
    7198           0 :         tevent_req_done(req);
    7199             : }
    7200             : 
    7201           0 : NTSTATUS dcerpc_winreg_SaveKeyEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    7202             : {
    7203           0 :         struct dcerpc_winreg_SaveKeyEx_r_state *state =
    7204           0 :                 tevent_req_data(req,
    7205             :                 struct dcerpc_winreg_SaveKeyEx_r_state);
    7206           0 :         NTSTATUS status;
    7207             : 
    7208           0 :         if (tevent_req_is_nterror(req, &status)) {
    7209           0 :                 tevent_req_received(req);
    7210           0 :                 return status;
    7211             :         }
    7212             : 
    7213           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7214             : 
    7215           0 :         tevent_req_received(req);
    7216           0 :         return NT_STATUS_OK;
    7217             : }
    7218             : 
    7219           0 : NTSTATUS dcerpc_winreg_SaveKeyEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_SaveKeyEx *r)
    7220             : {
    7221           0 :         NTSTATUS status;
    7222             : 
    7223           0 :         status = dcerpc_binding_handle_call(h,
    7224             :                         NULL, &ndr_table_winreg,
    7225             :                         NDR_WINREG_SAVEKEYEX, mem_ctx, r);
    7226             : 
    7227           0 :         return status;
    7228             : }
    7229             : 
    7230             : struct dcerpc_winreg_SaveKeyEx_state {
    7231             :         struct winreg_SaveKeyEx orig;
    7232             :         struct winreg_SaveKeyEx tmp;
    7233             :         TALLOC_CTX *out_mem_ctx;
    7234             : };
    7235             : 
    7236             : static void dcerpc_winreg_SaveKeyEx_done(struct tevent_req *subreq);
    7237             : 
    7238           0 : struct tevent_req *dcerpc_winreg_SaveKeyEx_send(TALLOC_CTX *mem_ctx,
    7239             :                                                 struct tevent_context *ev,
    7240             :                                                 struct dcerpc_binding_handle *h,
    7241             :                                                 struct policy_handle *_handle /* [in] [ref] */,
    7242             :                                                 struct winreg_String *_filename /* [in] [ref] */,
    7243             :                                                 struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */,
    7244             :                                                 uint32_t _flags /* [in]  */)
    7245             : {
    7246           0 :         struct tevent_req *req;
    7247           0 :         struct dcerpc_winreg_SaveKeyEx_state *state;
    7248           0 :         struct tevent_req *subreq;
    7249             : 
    7250           0 :         req = tevent_req_create(mem_ctx, &state,
    7251             :                                 struct dcerpc_winreg_SaveKeyEx_state);
    7252           0 :         if (req == NULL) {
    7253           0 :                 return NULL;
    7254             :         }
    7255           0 :         state->out_mem_ctx = NULL;
    7256             : 
    7257             :         /* In parameters */
    7258           0 :         state->orig.in.handle = _handle;
    7259           0 :         state->orig.in.filename = _filename;
    7260           0 :         state->orig.in.sec_attrib = _sec_attrib;
    7261           0 :         state->orig.in.flags = _flags;
    7262             : 
    7263             :         /* Out parameters */
    7264             : 
    7265             :         /* Result */
    7266           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    7267             : 
    7268             :         /* make a temporary copy, that we pass to the dispatch function */
    7269           0 :         state->tmp = state->orig;
    7270             : 
    7271           0 :         subreq = dcerpc_winreg_SaveKeyEx_r_send(state, ev, h, &state->tmp);
    7272           0 :         if (tevent_req_nomem(subreq, req)) {
    7273           0 :                 return tevent_req_post(req, ev);
    7274             :         }
    7275           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_SaveKeyEx_done, req);
    7276           0 :         return req;
    7277             : }
    7278             : 
    7279           0 : static void dcerpc_winreg_SaveKeyEx_done(struct tevent_req *subreq)
    7280             : {
    7281           0 :         struct tevent_req *req = tevent_req_callback_data(
    7282             :                 subreq, struct tevent_req);
    7283           0 :         struct dcerpc_winreg_SaveKeyEx_state *state = tevent_req_data(
    7284             :                 req, struct dcerpc_winreg_SaveKeyEx_state);
    7285           0 :         NTSTATUS status;
    7286           0 :         TALLOC_CTX *mem_ctx;
    7287             : 
    7288           0 :         if (state->out_mem_ctx) {
    7289           0 :                 mem_ctx = state->out_mem_ctx;
    7290             :         } else {
    7291           0 :                 mem_ctx = state;
    7292             :         }
    7293             : 
    7294           0 :         status = dcerpc_winreg_SaveKeyEx_r_recv(subreq, mem_ctx);
    7295           0 :         TALLOC_FREE(subreq);
    7296           0 :         if (tevent_req_nterror(req, status)) {
    7297           0 :                 return;
    7298             :         }
    7299             : 
    7300             :         /* Copy out parameters */
    7301             : 
    7302             :         /* Copy result */
    7303           0 :         state->orig.out.result = state->tmp.out.result;
    7304             : 
    7305             :         /* Reset temporary structure */
    7306           0 :         NDR_ZERO_STRUCT(state->tmp);
    7307             : 
    7308           0 :         tevent_req_done(req);
    7309             : }
    7310             : 
    7311           0 : NTSTATUS dcerpc_winreg_SaveKeyEx_recv(struct tevent_req *req,
    7312             :                                       TALLOC_CTX *mem_ctx,
    7313             :                                       WERROR *result)
    7314             : {
    7315           0 :         struct dcerpc_winreg_SaveKeyEx_state *state = tevent_req_data(
    7316             :                 req, struct dcerpc_winreg_SaveKeyEx_state);
    7317           0 :         NTSTATUS status;
    7318             : 
    7319           0 :         if (tevent_req_is_nterror(req, &status)) {
    7320           0 :                 tevent_req_received(req);
    7321           0 :                 return status;
    7322             :         }
    7323             : 
    7324             :         /* Steal possible out parameters to the callers context */
    7325           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7326             : 
    7327             :         /* Return result */
    7328           0 :         *result = state->orig.out.result;
    7329             : 
    7330           0 :         tevent_req_received(req);
    7331           0 :         return NT_STATUS_OK;
    7332             : }
    7333             : 
    7334           0 : NTSTATUS dcerpc_winreg_SaveKeyEx(struct dcerpc_binding_handle *h,
    7335             :                                  TALLOC_CTX *mem_ctx,
    7336             :                                  struct policy_handle *_handle /* [in] [ref] */,
    7337             :                                  struct winreg_String *_filename /* [in] [ref] */,
    7338             :                                  struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */,
    7339             :                                  uint32_t _flags /* [in]  */,
    7340             :                                  WERROR *result)
    7341             : {
    7342           0 :         struct winreg_SaveKeyEx r;
    7343           0 :         NTSTATUS status;
    7344             : 
    7345             :         /* In parameters */
    7346           0 :         r.in.handle = _handle;
    7347           0 :         r.in.filename = _filename;
    7348           0 :         r.in.sec_attrib = _sec_attrib;
    7349           0 :         r.in.flags = _flags;
    7350             : 
    7351             :         /* Out parameters */
    7352             : 
    7353             :         /* Result */
    7354           0 :         NDR_ZERO_STRUCT(r.out.result);
    7355             : 
    7356           0 :         status = dcerpc_winreg_SaveKeyEx_r(h, mem_ctx, &r);
    7357           0 :         if (!NT_STATUS_IS_OK(status)) {
    7358           0 :                 return status;
    7359             :         }
    7360             : 
    7361             :         /* Return variables */
    7362             : 
    7363             :         /* Return result */
    7364           0 :         *result = r.out.result;
    7365             : 
    7366           0 :         return NT_STATUS_OK;
    7367             : }
    7368             : 
    7369             : struct dcerpc_winreg_OpenHKPT_r_state {
    7370             :         TALLOC_CTX *out_mem_ctx;
    7371             : };
    7372             : 
    7373             : static void dcerpc_winreg_OpenHKPT_r_done(struct tevent_req *subreq);
    7374             : 
    7375           0 : struct tevent_req *dcerpc_winreg_OpenHKPT_r_send(TALLOC_CTX *mem_ctx,
    7376             :         struct tevent_context *ev,
    7377             :         struct dcerpc_binding_handle *h,
    7378             :         struct winreg_OpenHKPT *r)
    7379             : {
    7380           0 :         struct tevent_req *req;
    7381           0 :         struct dcerpc_winreg_OpenHKPT_r_state *state;
    7382           0 :         struct tevent_req *subreq;
    7383             : 
    7384           0 :         req = tevent_req_create(mem_ctx, &state,
    7385             :                                 struct dcerpc_winreg_OpenHKPT_r_state);
    7386           0 :         if (req == NULL) {
    7387           0 :                 return NULL;
    7388             :         }
    7389             : 
    7390           0 :         state->out_mem_ctx = talloc_new(state);
    7391           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7392           0 :                 return tevent_req_post(req, ev);
    7393             :         }
    7394             : 
    7395           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    7396             :                         NULL, &ndr_table_winreg,
    7397           0 :                         NDR_WINREG_OPENHKPT, state->out_mem_ctx, r);
    7398           0 :         if (tevent_req_nomem(subreq, req)) {
    7399           0 :                 return tevent_req_post(req, ev);
    7400             :         }
    7401           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPT_r_done, req);
    7402             : 
    7403           0 :         return req;
    7404             : }
    7405             : 
    7406           0 : static void dcerpc_winreg_OpenHKPT_r_done(struct tevent_req *subreq)
    7407             : {
    7408           0 :         struct tevent_req *req =
    7409           0 :                 tevent_req_callback_data(subreq,
    7410             :                 struct tevent_req);
    7411           0 :         NTSTATUS status;
    7412             : 
    7413           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    7414           0 :         TALLOC_FREE(subreq);
    7415           0 :         if (tevent_req_nterror(req, status)) {
    7416           0 :                 return;
    7417             :         }
    7418             : 
    7419           0 :         tevent_req_done(req);
    7420             : }
    7421             : 
    7422           0 : NTSTATUS dcerpc_winreg_OpenHKPT_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    7423             : {
    7424           0 :         struct dcerpc_winreg_OpenHKPT_r_state *state =
    7425           0 :                 tevent_req_data(req,
    7426             :                 struct dcerpc_winreg_OpenHKPT_r_state);
    7427           0 :         NTSTATUS status;
    7428             : 
    7429           0 :         if (tevent_req_is_nterror(req, &status)) {
    7430           0 :                 tevent_req_received(req);
    7431           0 :                 return status;
    7432             :         }
    7433             : 
    7434           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7435             : 
    7436           0 :         tevent_req_received(req);
    7437           0 :         return NT_STATUS_OK;
    7438             : }
    7439             : 
    7440           0 : NTSTATUS dcerpc_winreg_OpenHKPT_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKPT *r)
    7441             : {
    7442           0 :         NTSTATUS status;
    7443             : 
    7444           0 :         status = dcerpc_binding_handle_call(h,
    7445             :                         NULL, &ndr_table_winreg,
    7446             :                         NDR_WINREG_OPENHKPT, mem_ctx, r);
    7447             : 
    7448           0 :         return status;
    7449             : }
    7450             : 
    7451             : struct dcerpc_winreg_OpenHKPT_state {
    7452             :         struct winreg_OpenHKPT orig;
    7453             :         struct winreg_OpenHKPT tmp;
    7454             :         TALLOC_CTX *out_mem_ctx;
    7455             : };
    7456             : 
    7457             : static void dcerpc_winreg_OpenHKPT_done(struct tevent_req *subreq);
    7458             : 
    7459           0 : struct tevent_req *dcerpc_winreg_OpenHKPT_send(TALLOC_CTX *mem_ctx,
    7460             :                                                struct tevent_context *ev,
    7461             :                                                struct dcerpc_binding_handle *h,
    7462             :                                                uint16_t *_system_name /* [in] [unique] */,
    7463             :                                                uint32_t _access_mask /* [in]  */,
    7464             :                                                struct policy_handle *_handle /* [out] [ref] */)
    7465             : {
    7466           0 :         struct tevent_req *req;
    7467           0 :         struct dcerpc_winreg_OpenHKPT_state *state;
    7468           0 :         struct tevent_req *subreq;
    7469             : 
    7470           0 :         req = tevent_req_create(mem_ctx, &state,
    7471             :                                 struct dcerpc_winreg_OpenHKPT_state);
    7472           0 :         if (req == NULL) {
    7473           0 :                 return NULL;
    7474             :         }
    7475           0 :         state->out_mem_ctx = NULL;
    7476             : 
    7477             :         /* In parameters */
    7478           0 :         state->orig.in.system_name = _system_name;
    7479           0 :         state->orig.in.access_mask = _access_mask;
    7480             : 
    7481             :         /* Out parameters */
    7482           0 :         state->orig.out.handle = _handle;
    7483             : 
    7484             :         /* Result */
    7485           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    7486             : 
    7487           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    7488             :                              "dcerpc_winreg_OpenHKPT_out_memory");
    7489           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7490           0 :                 return tevent_req_post(req, ev);
    7491             :         }
    7492             : 
    7493             :         /* make a temporary copy, that we pass to the dispatch function */
    7494           0 :         state->tmp = state->orig;
    7495             : 
    7496           0 :         subreq = dcerpc_winreg_OpenHKPT_r_send(state, ev, h, &state->tmp);
    7497           0 :         if (tevent_req_nomem(subreq, req)) {
    7498           0 :                 return tevent_req_post(req, ev);
    7499             :         }
    7500           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPT_done, req);
    7501           0 :         return req;
    7502             : }
    7503             : 
    7504           0 : static void dcerpc_winreg_OpenHKPT_done(struct tevent_req *subreq)
    7505             : {
    7506           0 :         struct tevent_req *req = tevent_req_callback_data(
    7507             :                 subreq, struct tevent_req);
    7508           0 :         struct dcerpc_winreg_OpenHKPT_state *state = tevent_req_data(
    7509             :                 req, struct dcerpc_winreg_OpenHKPT_state);
    7510           0 :         NTSTATUS status;
    7511           0 :         TALLOC_CTX *mem_ctx;
    7512             : 
    7513           0 :         if (state->out_mem_ctx) {
    7514           0 :                 mem_ctx = state->out_mem_ctx;
    7515             :         } else {
    7516           0 :                 mem_ctx = state;
    7517             :         }
    7518             : 
    7519           0 :         status = dcerpc_winreg_OpenHKPT_r_recv(subreq, mem_ctx);
    7520           0 :         TALLOC_FREE(subreq);
    7521           0 :         if (tevent_req_nterror(req, status)) {
    7522           0 :                 return;
    7523             :         }
    7524             : 
    7525             :         /* Copy out parameters */
    7526           0 :         *state->orig.out.handle = *state->tmp.out.handle;
    7527             : 
    7528             :         /* Copy result */
    7529           0 :         state->orig.out.result = state->tmp.out.result;
    7530             : 
    7531             :         /* Reset temporary structure */
    7532           0 :         NDR_ZERO_STRUCT(state->tmp);
    7533             : 
    7534           0 :         tevent_req_done(req);
    7535             : }
    7536             : 
    7537           0 : NTSTATUS dcerpc_winreg_OpenHKPT_recv(struct tevent_req *req,
    7538             :                                      TALLOC_CTX *mem_ctx,
    7539             :                                      WERROR *result)
    7540             : {
    7541           0 :         struct dcerpc_winreg_OpenHKPT_state *state = tevent_req_data(
    7542             :                 req, struct dcerpc_winreg_OpenHKPT_state);
    7543           0 :         NTSTATUS status;
    7544             : 
    7545           0 :         if (tevent_req_is_nterror(req, &status)) {
    7546           0 :                 tevent_req_received(req);
    7547           0 :                 return status;
    7548             :         }
    7549             : 
    7550             :         /* Steal possible out parameters to the callers context */
    7551           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7552             : 
    7553             :         /* Return result */
    7554           0 :         *result = state->orig.out.result;
    7555             : 
    7556           0 :         tevent_req_received(req);
    7557           0 :         return NT_STATUS_OK;
    7558             : }
    7559             : 
    7560           0 : NTSTATUS dcerpc_winreg_OpenHKPT(struct dcerpc_binding_handle *h,
    7561             :                                 TALLOC_CTX *mem_ctx,
    7562             :                                 uint16_t *_system_name /* [in] [unique] */,
    7563             :                                 uint32_t _access_mask /* [in]  */,
    7564             :                                 struct policy_handle *_handle /* [out] [ref] */,
    7565             :                                 WERROR *result)
    7566             : {
    7567           0 :         struct winreg_OpenHKPT r;
    7568           0 :         NTSTATUS status;
    7569             : 
    7570             :         /* In parameters */
    7571           0 :         r.in.system_name = _system_name;
    7572           0 :         r.in.access_mask = _access_mask;
    7573             : 
    7574             :         /* Out parameters */
    7575           0 :         r.out.handle = _handle;
    7576             : 
    7577             :         /* Result */
    7578           0 :         NDR_ZERO_STRUCT(r.out.result);
    7579             : 
    7580           0 :         status = dcerpc_winreg_OpenHKPT_r(h, mem_ctx, &r);
    7581           0 :         if (!NT_STATUS_IS_OK(status)) {
    7582           0 :                 return status;
    7583             :         }
    7584             : 
    7585             :         /* Return variables */
    7586           0 :         *_handle = *r.out.handle;
    7587             : 
    7588             :         /* Return result */
    7589           0 :         *result = r.out.result;
    7590             : 
    7591           0 :         return NT_STATUS_OK;
    7592             : }
    7593             : 
    7594             : struct dcerpc_winreg_OpenHKPN_r_state {
    7595             :         TALLOC_CTX *out_mem_ctx;
    7596             : };
    7597             : 
    7598             : static void dcerpc_winreg_OpenHKPN_r_done(struct tevent_req *subreq);
    7599             : 
    7600           0 : struct tevent_req *dcerpc_winreg_OpenHKPN_r_send(TALLOC_CTX *mem_ctx,
    7601             :         struct tevent_context *ev,
    7602             :         struct dcerpc_binding_handle *h,
    7603             :         struct winreg_OpenHKPN *r)
    7604             : {
    7605           0 :         struct tevent_req *req;
    7606           0 :         struct dcerpc_winreg_OpenHKPN_r_state *state;
    7607           0 :         struct tevent_req *subreq;
    7608             : 
    7609           0 :         req = tevent_req_create(mem_ctx, &state,
    7610             :                                 struct dcerpc_winreg_OpenHKPN_r_state);
    7611           0 :         if (req == NULL) {
    7612           0 :                 return NULL;
    7613             :         }
    7614             : 
    7615           0 :         state->out_mem_ctx = talloc_new(state);
    7616           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7617           0 :                 return tevent_req_post(req, ev);
    7618             :         }
    7619             : 
    7620           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    7621             :                         NULL, &ndr_table_winreg,
    7622           0 :                         NDR_WINREG_OPENHKPN, state->out_mem_ctx, r);
    7623           0 :         if (tevent_req_nomem(subreq, req)) {
    7624           0 :                 return tevent_req_post(req, ev);
    7625             :         }
    7626           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPN_r_done, req);
    7627             : 
    7628           0 :         return req;
    7629             : }
    7630             : 
    7631           0 : static void dcerpc_winreg_OpenHKPN_r_done(struct tevent_req *subreq)
    7632             : {
    7633           0 :         struct tevent_req *req =
    7634           0 :                 tevent_req_callback_data(subreq,
    7635             :                 struct tevent_req);
    7636           0 :         NTSTATUS status;
    7637             : 
    7638           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    7639           0 :         TALLOC_FREE(subreq);
    7640           0 :         if (tevent_req_nterror(req, status)) {
    7641           0 :                 return;
    7642             :         }
    7643             : 
    7644           0 :         tevent_req_done(req);
    7645             : }
    7646             : 
    7647           0 : NTSTATUS dcerpc_winreg_OpenHKPN_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    7648             : {
    7649           0 :         struct dcerpc_winreg_OpenHKPN_r_state *state =
    7650           0 :                 tevent_req_data(req,
    7651             :                 struct dcerpc_winreg_OpenHKPN_r_state);
    7652           0 :         NTSTATUS status;
    7653             : 
    7654           0 :         if (tevent_req_is_nterror(req, &status)) {
    7655           0 :                 tevent_req_received(req);
    7656           0 :                 return status;
    7657             :         }
    7658             : 
    7659           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7660             : 
    7661           0 :         tevent_req_received(req);
    7662           0 :         return NT_STATUS_OK;
    7663             : }
    7664             : 
    7665           0 : NTSTATUS dcerpc_winreg_OpenHKPN_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKPN *r)
    7666             : {
    7667           0 :         NTSTATUS status;
    7668             : 
    7669           0 :         status = dcerpc_binding_handle_call(h,
    7670             :                         NULL, &ndr_table_winreg,
    7671             :                         NDR_WINREG_OPENHKPN, mem_ctx, r);
    7672             : 
    7673           0 :         return status;
    7674             : }
    7675             : 
    7676             : struct dcerpc_winreg_OpenHKPN_state {
    7677             :         struct winreg_OpenHKPN orig;
    7678             :         struct winreg_OpenHKPN tmp;
    7679             :         TALLOC_CTX *out_mem_ctx;
    7680             : };
    7681             : 
    7682             : static void dcerpc_winreg_OpenHKPN_done(struct tevent_req *subreq);
    7683             : 
    7684           0 : struct tevent_req *dcerpc_winreg_OpenHKPN_send(TALLOC_CTX *mem_ctx,
    7685             :                                                struct tevent_context *ev,
    7686             :                                                struct dcerpc_binding_handle *h,
    7687             :                                                uint16_t *_system_name /* [in] [unique] */,
    7688             :                                                uint32_t _access_mask /* [in]  */,
    7689             :                                                struct policy_handle *_handle /* [out] [ref] */)
    7690             : {
    7691           0 :         struct tevent_req *req;
    7692           0 :         struct dcerpc_winreg_OpenHKPN_state *state;
    7693           0 :         struct tevent_req *subreq;
    7694             : 
    7695           0 :         req = tevent_req_create(mem_ctx, &state,
    7696             :                                 struct dcerpc_winreg_OpenHKPN_state);
    7697           0 :         if (req == NULL) {
    7698           0 :                 return NULL;
    7699             :         }
    7700           0 :         state->out_mem_ctx = NULL;
    7701             : 
    7702             :         /* In parameters */
    7703           0 :         state->orig.in.system_name = _system_name;
    7704           0 :         state->orig.in.access_mask = _access_mask;
    7705             : 
    7706             :         /* Out parameters */
    7707           0 :         state->orig.out.handle = _handle;
    7708             : 
    7709             :         /* Result */
    7710           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    7711             : 
    7712           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    7713             :                              "dcerpc_winreg_OpenHKPN_out_memory");
    7714           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7715           0 :                 return tevent_req_post(req, ev);
    7716             :         }
    7717             : 
    7718             :         /* make a temporary copy, that we pass to the dispatch function */
    7719           0 :         state->tmp = state->orig;
    7720             : 
    7721           0 :         subreq = dcerpc_winreg_OpenHKPN_r_send(state, ev, h, &state->tmp);
    7722           0 :         if (tevent_req_nomem(subreq, req)) {
    7723           0 :                 return tevent_req_post(req, ev);
    7724             :         }
    7725           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPN_done, req);
    7726           0 :         return req;
    7727             : }
    7728             : 
    7729           0 : static void dcerpc_winreg_OpenHKPN_done(struct tevent_req *subreq)
    7730             : {
    7731           0 :         struct tevent_req *req = tevent_req_callback_data(
    7732             :                 subreq, struct tevent_req);
    7733           0 :         struct dcerpc_winreg_OpenHKPN_state *state = tevent_req_data(
    7734             :                 req, struct dcerpc_winreg_OpenHKPN_state);
    7735           0 :         NTSTATUS status;
    7736           0 :         TALLOC_CTX *mem_ctx;
    7737             : 
    7738           0 :         if (state->out_mem_ctx) {
    7739           0 :                 mem_ctx = state->out_mem_ctx;
    7740             :         } else {
    7741           0 :                 mem_ctx = state;
    7742             :         }
    7743             : 
    7744           0 :         status = dcerpc_winreg_OpenHKPN_r_recv(subreq, mem_ctx);
    7745           0 :         TALLOC_FREE(subreq);
    7746           0 :         if (tevent_req_nterror(req, status)) {
    7747           0 :                 return;
    7748             :         }
    7749             : 
    7750             :         /* Copy out parameters */
    7751           0 :         *state->orig.out.handle = *state->tmp.out.handle;
    7752             : 
    7753             :         /* Copy result */
    7754           0 :         state->orig.out.result = state->tmp.out.result;
    7755             : 
    7756             :         /* Reset temporary structure */
    7757           0 :         NDR_ZERO_STRUCT(state->tmp);
    7758             : 
    7759           0 :         tevent_req_done(req);
    7760             : }
    7761             : 
    7762           0 : NTSTATUS dcerpc_winreg_OpenHKPN_recv(struct tevent_req *req,
    7763             :                                      TALLOC_CTX *mem_ctx,
    7764             :                                      WERROR *result)
    7765             : {
    7766           0 :         struct dcerpc_winreg_OpenHKPN_state *state = tevent_req_data(
    7767             :                 req, struct dcerpc_winreg_OpenHKPN_state);
    7768           0 :         NTSTATUS status;
    7769             : 
    7770           0 :         if (tevent_req_is_nterror(req, &status)) {
    7771           0 :                 tevent_req_received(req);
    7772           0 :                 return status;
    7773             :         }
    7774             : 
    7775             :         /* Steal possible out parameters to the callers context */
    7776           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7777             : 
    7778             :         /* Return result */
    7779           0 :         *result = state->orig.out.result;
    7780             : 
    7781           0 :         tevent_req_received(req);
    7782           0 :         return NT_STATUS_OK;
    7783             : }
    7784             : 
    7785           0 : NTSTATUS dcerpc_winreg_OpenHKPN(struct dcerpc_binding_handle *h,
    7786             :                                 TALLOC_CTX *mem_ctx,
    7787             :                                 uint16_t *_system_name /* [in] [unique] */,
    7788             :                                 uint32_t _access_mask /* [in]  */,
    7789             :                                 struct policy_handle *_handle /* [out] [ref] */,
    7790             :                                 WERROR *result)
    7791             : {
    7792           0 :         struct winreg_OpenHKPN r;
    7793           0 :         NTSTATUS status;
    7794             : 
    7795             :         /* In parameters */
    7796           0 :         r.in.system_name = _system_name;
    7797           0 :         r.in.access_mask = _access_mask;
    7798             : 
    7799             :         /* Out parameters */
    7800           0 :         r.out.handle = _handle;
    7801             : 
    7802             :         /* Result */
    7803           0 :         NDR_ZERO_STRUCT(r.out.result);
    7804             : 
    7805           0 :         status = dcerpc_winreg_OpenHKPN_r(h, mem_ctx, &r);
    7806           0 :         if (!NT_STATUS_IS_OK(status)) {
    7807           0 :                 return status;
    7808             :         }
    7809             : 
    7810             :         /* Return variables */
    7811           0 :         *_handle = *r.out.handle;
    7812             : 
    7813             :         /* Return result */
    7814           0 :         *result = r.out.result;
    7815             : 
    7816           0 :         return NT_STATUS_OK;
    7817             : }
    7818             : 
    7819             : struct dcerpc_winreg_QueryMultipleValues2_r_state {
    7820             :         TALLOC_CTX *out_mem_ctx;
    7821             : };
    7822             : 
    7823             : static void dcerpc_winreg_QueryMultipleValues2_r_done(struct tevent_req *subreq);
    7824             : 
    7825           0 : struct tevent_req *dcerpc_winreg_QueryMultipleValues2_r_send(TALLOC_CTX *mem_ctx,
    7826             :         struct tevent_context *ev,
    7827             :         struct dcerpc_binding_handle *h,
    7828             :         struct winreg_QueryMultipleValues2 *r)
    7829             : {
    7830           0 :         struct tevent_req *req;
    7831           0 :         struct dcerpc_winreg_QueryMultipleValues2_r_state *state;
    7832           0 :         struct tevent_req *subreq;
    7833             : 
    7834           0 :         req = tevent_req_create(mem_ctx, &state,
    7835             :                                 struct dcerpc_winreg_QueryMultipleValues2_r_state);
    7836           0 :         if (req == NULL) {
    7837           0 :                 return NULL;
    7838             :         }
    7839             : 
    7840           0 :         state->out_mem_ctx = talloc_new(state);
    7841           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7842           0 :                 return tevent_req_post(req, ev);
    7843             :         }
    7844             : 
    7845           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    7846             :                         NULL, &ndr_table_winreg,
    7847           0 :                         NDR_WINREG_QUERYMULTIPLEVALUES2, state->out_mem_ctx, r);
    7848           0 :         if (tevent_req_nomem(subreq, req)) {
    7849           0 :                 return tevent_req_post(req, ev);
    7850             :         }
    7851           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_QueryMultipleValues2_r_done, req);
    7852             : 
    7853           0 :         return req;
    7854             : }
    7855             : 
    7856           0 : static void dcerpc_winreg_QueryMultipleValues2_r_done(struct tevent_req *subreq)
    7857             : {
    7858           0 :         struct tevent_req *req =
    7859           0 :                 tevent_req_callback_data(subreq,
    7860             :                 struct tevent_req);
    7861           0 :         NTSTATUS status;
    7862             : 
    7863           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    7864           0 :         TALLOC_FREE(subreq);
    7865           0 :         if (tevent_req_nterror(req, status)) {
    7866           0 :                 return;
    7867             :         }
    7868             : 
    7869           0 :         tevent_req_done(req);
    7870             : }
    7871             : 
    7872           0 : NTSTATUS dcerpc_winreg_QueryMultipleValues2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    7873             : {
    7874           0 :         struct dcerpc_winreg_QueryMultipleValues2_r_state *state =
    7875           0 :                 tevent_req_data(req,
    7876             :                 struct dcerpc_winreg_QueryMultipleValues2_r_state);
    7877           0 :         NTSTATUS status;
    7878             : 
    7879           0 :         if (tevent_req_is_nterror(req, &status)) {
    7880           0 :                 tevent_req_received(req);
    7881           0 :                 return status;
    7882             :         }
    7883             : 
    7884           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    7885             : 
    7886           0 :         tevent_req_received(req);
    7887           0 :         return NT_STATUS_OK;
    7888             : }
    7889             : 
    7890          88 : NTSTATUS dcerpc_winreg_QueryMultipleValues2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_QueryMultipleValues2 *r)
    7891             : {
    7892           0 :         NTSTATUS status;
    7893             : 
    7894          88 :         status = dcerpc_binding_handle_call(h,
    7895             :                         NULL, &ndr_table_winreg,
    7896             :                         NDR_WINREG_QUERYMULTIPLEVALUES2, mem_ctx, r);
    7897             : 
    7898          88 :         return status;
    7899             : }
    7900             : 
    7901             : struct dcerpc_winreg_QueryMultipleValues2_state {
    7902             :         struct winreg_QueryMultipleValues2 orig;
    7903             :         struct winreg_QueryMultipleValues2 tmp;
    7904             :         TALLOC_CTX *out_mem_ctx;
    7905             : };
    7906             : 
    7907             : static void dcerpc_winreg_QueryMultipleValues2_done(struct tevent_req *subreq);
    7908             : 
    7909           0 : struct tevent_req *dcerpc_winreg_QueryMultipleValues2_send(TALLOC_CTX *mem_ctx,
    7910             :                                                            struct tevent_context *ev,
    7911             :                                                            struct dcerpc_binding_handle *h,
    7912             :                                                            struct policy_handle *_key_handle /* [in] [ref] */,
    7913             :                                                            struct QueryMultipleValue *_values_in /* [in] [length_is(num_values),ref,size_is(num_values)] */,
    7914             :                                                            struct QueryMultipleValue *_values_out /* [out] [length_is(num_values),ref,size_is(num_values)] */,
    7915             :                                                            uint32_t _num_values /* [in]  */,
    7916             :                                                            uint8_t *_buffer /* [in,out] [length_is(*offered),size_is(*offered),unique] */,
    7917             :                                                            uint32_t *_offered /* [in] [ref] */,
    7918             :                                                            uint32_t *_needed /* [out] [ref] */)
    7919             : {
    7920           0 :         struct tevent_req *req;
    7921           0 :         struct dcerpc_winreg_QueryMultipleValues2_state *state;
    7922           0 :         struct tevent_req *subreq;
    7923             : 
    7924           0 :         req = tevent_req_create(mem_ctx, &state,
    7925             :                                 struct dcerpc_winreg_QueryMultipleValues2_state);
    7926           0 :         if (req == NULL) {
    7927           0 :                 return NULL;
    7928             :         }
    7929           0 :         state->out_mem_ctx = NULL;
    7930             : 
    7931             :         /* In parameters */
    7932           0 :         state->orig.in.key_handle = _key_handle;
    7933           0 :         state->orig.in.values_in = _values_in;
    7934           0 :         state->orig.in.num_values = _num_values;
    7935           0 :         state->orig.in.buffer = _buffer;
    7936           0 :         state->orig.in.offered = _offered;
    7937             : 
    7938             :         /* Out parameters */
    7939           0 :         state->orig.out.values_out = _values_out;
    7940           0 :         state->orig.out.buffer = _buffer;
    7941           0 :         state->orig.out.needed = _needed;
    7942             : 
    7943             :         /* Result */
    7944           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    7945             : 
    7946           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
    7947             :                              "dcerpc_winreg_QueryMultipleValues2_out_memory");
    7948           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
    7949           0 :                 return tevent_req_post(req, ev);
    7950             :         }
    7951             : 
    7952             :         /* make a temporary copy, that we pass to the dispatch function */
    7953           0 :         state->tmp = state->orig;
    7954             : 
    7955           0 :         subreq = dcerpc_winreg_QueryMultipleValues2_r_send(state, ev, h, &state->tmp);
    7956           0 :         if (tevent_req_nomem(subreq, req)) {
    7957           0 :                 return tevent_req_post(req, ev);
    7958             :         }
    7959           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_QueryMultipleValues2_done, req);
    7960           0 :         return req;
    7961             : }
    7962             : 
    7963           0 : static void dcerpc_winreg_QueryMultipleValues2_done(struct tevent_req *subreq)
    7964             : {
    7965           0 :         struct tevent_req *req = tevent_req_callback_data(
    7966             :                 subreq, struct tevent_req);
    7967           0 :         struct dcerpc_winreg_QueryMultipleValues2_state *state = tevent_req_data(
    7968             :                 req, struct dcerpc_winreg_QueryMultipleValues2_state);
    7969           0 :         NTSTATUS status;
    7970           0 :         TALLOC_CTX *mem_ctx;
    7971             : 
    7972           0 :         if (state->out_mem_ctx) {
    7973           0 :                 mem_ctx = state->out_mem_ctx;
    7974             :         } else {
    7975           0 :                 mem_ctx = state;
    7976             :         }
    7977             : 
    7978           0 :         status = dcerpc_winreg_QueryMultipleValues2_r_recv(subreq, mem_ctx);
    7979           0 :         TALLOC_FREE(subreq);
    7980           0 :         if (tevent_req_nterror(req, status)) {
    7981           0 :                 return;
    7982             :         }
    7983             : 
    7984             :         /* Copy out parameters */
    7985             :         {
    7986           0 :                 size_t _copy_len_values_out;
    7987           0 :                 _copy_len_values_out = state->tmp.in.num_values;
    7988           0 :                 if (state->orig.out.values_out != state->tmp.out.values_out) {
    7989           0 :                         memcpy(state->orig.out.values_out, state->tmp.out.values_out, _copy_len_values_out * sizeof(*state->orig.out.values_out));
    7990             :                 }
    7991             :         }
    7992           0 :         if (state->orig.out.buffer && state->tmp.out.buffer) {
    7993             :                 {
    7994           0 :                         size_t _copy_len_buffer;
    7995           0 :                         _copy_len_buffer = *state->tmp.in.offered;
    7996           0 :                         if (state->orig.out.buffer != state->tmp.out.buffer) {
    7997           0 :                                 memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
    7998             :                         }
    7999             :                 }
    8000             :         }
    8001           0 :         *state->orig.out.needed = *state->tmp.out.needed;
    8002             : 
    8003             :         /* Copy result */
    8004           0 :         state->orig.out.result = state->tmp.out.result;
    8005             : 
    8006             :         /* Reset temporary structure */
    8007           0 :         NDR_ZERO_STRUCT(state->tmp);
    8008             : 
    8009           0 :         tevent_req_done(req);
    8010             : }
    8011             : 
    8012           0 : NTSTATUS dcerpc_winreg_QueryMultipleValues2_recv(struct tevent_req *req,
    8013             :                                                  TALLOC_CTX *mem_ctx,
    8014             :                                                  WERROR *result)
    8015             : {
    8016           0 :         struct dcerpc_winreg_QueryMultipleValues2_state *state = tevent_req_data(
    8017             :                 req, struct dcerpc_winreg_QueryMultipleValues2_state);
    8018           0 :         NTSTATUS status;
    8019             : 
    8020           0 :         if (tevent_req_is_nterror(req, &status)) {
    8021           0 :                 tevent_req_received(req);
    8022           0 :                 return status;
    8023             :         }
    8024             : 
    8025             :         /* Steal possible out parameters to the callers context */
    8026           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8027             : 
    8028             :         /* Return result */
    8029           0 :         *result = state->orig.out.result;
    8030             : 
    8031           0 :         tevent_req_received(req);
    8032           0 :         return NT_STATUS_OK;
    8033             : }
    8034             : 
    8035           0 : NTSTATUS dcerpc_winreg_QueryMultipleValues2(struct dcerpc_binding_handle *h,
    8036             :                                             TALLOC_CTX *mem_ctx,
    8037             :                                             struct policy_handle *_key_handle /* [in] [ref] */,
    8038             :                                             struct QueryMultipleValue *_values_in /* [in] [length_is(num_values),ref,size_is(num_values)] */,
    8039             :                                             struct QueryMultipleValue *_values_out /* [out] [length_is(num_values),ref,size_is(num_values)] */,
    8040             :                                             uint32_t _num_values /* [in]  */,
    8041             :                                             uint8_t *_buffer /* [in,out] [length_is(*offered),size_is(*offered),unique] */,
    8042             :                                             uint32_t *_offered /* [in] [ref] */,
    8043             :                                             uint32_t *_needed /* [out] [ref] */,
    8044             :                                             WERROR *result)
    8045             : {
    8046           0 :         struct winreg_QueryMultipleValues2 r;
    8047           0 :         NTSTATUS status;
    8048             : 
    8049             :         /* In parameters */
    8050           0 :         r.in.key_handle = _key_handle;
    8051           0 :         r.in.values_in = _values_in;
    8052           0 :         r.in.num_values = _num_values;
    8053           0 :         r.in.buffer = _buffer;
    8054           0 :         r.in.offered = _offered;
    8055             : 
    8056             :         /* Out parameters */
    8057           0 :         r.out.values_out = _values_out;
    8058           0 :         r.out.buffer = _buffer;
    8059           0 :         r.out.needed = _needed;
    8060             : 
    8061             :         /* Result */
    8062           0 :         NDR_ZERO_STRUCT(r.out.result);
    8063             : 
    8064           0 :         status = dcerpc_winreg_QueryMultipleValues2_r(h, mem_ctx, &r);
    8065           0 :         if (!NT_STATUS_IS_OK(status)) {
    8066           0 :                 return status;
    8067             :         }
    8068             : 
    8069             :         /* Return variables */
    8070             :         {
    8071           0 :                 size_t _copy_len_values_out;
    8072           0 :                 _copy_len_values_out = r.in.num_values;
    8073           0 :                 if (_values_out != r.out.values_out) {
    8074           0 :                         memcpy(_values_out, r.out.values_out, _copy_len_values_out * sizeof(*_values_out));
    8075             :                 }
    8076             :         }
    8077           0 :         if (_buffer && r.out.buffer) {
    8078             :                 {
    8079           0 :                         size_t _copy_len_buffer;
    8080           0 :                         _copy_len_buffer = *r.in.offered;
    8081           0 :                         if (_buffer != r.out.buffer) {
    8082           0 :                                 memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
    8083             :                         }
    8084             :                 }
    8085             :         }
    8086           0 :         *_needed = *r.out.needed;
    8087             : 
    8088             :         /* Return result */
    8089           0 :         *result = r.out.result;
    8090             : 
    8091           0 :         return NT_STATUS_OK;
    8092             : }
    8093             : 
    8094             : struct dcerpc_winreg_DeleteKeyEx_r_state {
    8095             :         TALLOC_CTX *out_mem_ctx;
    8096             : };
    8097             : 
    8098             : static void dcerpc_winreg_DeleteKeyEx_r_done(struct tevent_req *subreq);
    8099             : 
    8100           0 : struct tevent_req *dcerpc_winreg_DeleteKeyEx_r_send(TALLOC_CTX *mem_ctx,
    8101             :         struct tevent_context *ev,
    8102             :         struct dcerpc_binding_handle *h,
    8103             :         struct winreg_DeleteKeyEx *r)
    8104             : {
    8105           0 :         struct tevent_req *req;
    8106           0 :         struct dcerpc_winreg_DeleteKeyEx_r_state *state;
    8107           0 :         struct tevent_req *subreq;
    8108             : 
    8109           0 :         req = tevent_req_create(mem_ctx, &state,
    8110             :                                 struct dcerpc_winreg_DeleteKeyEx_r_state);
    8111           0 :         if (req == NULL) {
    8112           0 :                 return NULL;
    8113             :         }
    8114             : 
    8115           0 :         state->out_mem_ctx = NULL;
    8116             : 
    8117           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
    8118             :                         NULL, &ndr_table_winreg,
    8119             :                         NDR_WINREG_DELETEKEYEX, state, r);
    8120           0 :         if (tevent_req_nomem(subreq, req)) {
    8121           0 :                 return tevent_req_post(req, ev);
    8122             :         }
    8123           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_DeleteKeyEx_r_done, req);
    8124             : 
    8125           0 :         return req;
    8126             : }
    8127             : 
    8128           0 : static void dcerpc_winreg_DeleteKeyEx_r_done(struct tevent_req *subreq)
    8129             : {
    8130           0 :         struct tevent_req *req =
    8131           0 :                 tevent_req_callback_data(subreq,
    8132             :                 struct tevent_req);
    8133           0 :         NTSTATUS status;
    8134             : 
    8135           0 :         status = dcerpc_binding_handle_call_recv(subreq);
    8136           0 :         TALLOC_FREE(subreq);
    8137           0 :         if (tevent_req_nterror(req, status)) {
    8138           0 :                 return;
    8139             :         }
    8140             : 
    8141           0 :         tevent_req_done(req);
    8142             : }
    8143             : 
    8144           0 : NTSTATUS dcerpc_winreg_DeleteKeyEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
    8145             : {
    8146           0 :         struct dcerpc_winreg_DeleteKeyEx_r_state *state =
    8147           0 :                 tevent_req_data(req,
    8148             :                 struct dcerpc_winreg_DeleteKeyEx_r_state);
    8149           0 :         NTSTATUS status;
    8150             : 
    8151           0 :         if (tevent_req_is_nterror(req, &status)) {
    8152           0 :                 tevent_req_received(req);
    8153           0 :                 return status;
    8154             :         }
    8155             : 
    8156           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8157             : 
    8158           0 :         tevent_req_received(req);
    8159           0 :         return NT_STATUS_OK;
    8160             : }
    8161             : 
    8162           0 : NTSTATUS dcerpc_winreg_DeleteKeyEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_DeleteKeyEx *r)
    8163             : {
    8164           0 :         NTSTATUS status;
    8165             : 
    8166           0 :         status = dcerpc_binding_handle_call(h,
    8167             :                         NULL, &ndr_table_winreg,
    8168             :                         NDR_WINREG_DELETEKEYEX, mem_ctx, r);
    8169             : 
    8170           0 :         return status;
    8171             : }
    8172             : 
    8173             : struct dcerpc_winreg_DeleteKeyEx_state {
    8174             :         struct winreg_DeleteKeyEx orig;
    8175             :         struct winreg_DeleteKeyEx tmp;
    8176             :         TALLOC_CTX *out_mem_ctx;
    8177             : };
    8178             : 
    8179             : static void dcerpc_winreg_DeleteKeyEx_done(struct tevent_req *subreq);
    8180             : 
    8181           0 : struct tevent_req *dcerpc_winreg_DeleteKeyEx_send(TALLOC_CTX *mem_ctx,
    8182             :                                                   struct tevent_context *ev,
    8183             :                                                   struct dcerpc_binding_handle *h,
    8184             :                                                   struct policy_handle *_handle /* [in] [ref] */,
    8185             :                                                   struct winreg_String *_key /* [in] [ref] */,
    8186             :                                                   uint32_t _access_mask /* [in]  */,
    8187             :                                                   uint32_t _reserved /* [in]  */)
    8188             : {
    8189           0 :         struct tevent_req *req;
    8190           0 :         struct dcerpc_winreg_DeleteKeyEx_state *state;
    8191           0 :         struct tevent_req *subreq;
    8192             : 
    8193           0 :         req = tevent_req_create(mem_ctx, &state,
    8194             :                                 struct dcerpc_winreg_DeleteKeyEx_state);
    8195           0 :         if (req == NULL) {
    8196           0 :                 return NULL;
    8197             :         }
    8198           0 :         state->out_mem_ctx = NULL;
    8199             : 
    8200             :         /* In parameters */
    8201           0 :         state->orig.in.handle = _handle;
    8202           0 :         state->orig.in.key = _key;
    8203           0 :         state->orig.in.access_mask = _access_mask;
    8204           0 :         state->orig.in.reserved = _reserved;
    8205             : 
    8206             :         /* Out parameters */
    8207             : 
    8208             :         /* Result */
    8209           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
    8210             : 
    8211             :         /* make a temporary copy, that we pass to the dispatch function */
    8212           0 :         state->tmp = state->orig;
    8213             : 
    8214           0 :         subreq = dcerpc_winreg_DeleteKeyEx_r_send(state, ev, h, &state->tmp);
    8215           0 :         if (tevent_req_nomem(subreq, req)) {
    8216           0 :                 return tevent_req_post(req, ev);
    8217             :         }
    8218           0 :         tevent_req_set_callback(subreq, dcerpc_winreg_DeleteKeyEx_done, req);
    8219           0 :         return req;
    8220             : }
    8221             : 
    8222           0 : static void dcerpc_winreg_DeleteKeyEx_done(struct tevent_req *subreq)
    8223             : {
    8224           0 :         struct tevent_req *req = tevent_req_callback_data(
    8225             :                 subreq, struct tevent_req);
    8226           0 :         struct dcerpc_winreg_DeleteKeyEx_state *state = tevent_req_data(
    8227             :                 req, struct dcerpc_winreg_DeleteKeyEx_state);
    8228           0 :         NTSTATUS status;
    8229           0 :         TALLOC_CTX *mem_ctx;
    8230             : 
    8231           0 :         if (state->out_mem_ctx) {
    8232           0 :                 mem_ctx = state->out_mem_ctx;
    8233             :         } else {
    8234           0 :                 mem_ctx = state;
    8235             :         }
    8236             : 
    8237           0 :         status = dcerpc_winreg_DeleteKeyEx_r_recv(subreq, mem_ctx);
    8238           0 :         TALLOC_FREE(subreq);
    8239           0 :         if (tevent_req_nterror(req, status)) {
    8240           0 :                 return;
    8241             :         }
    8242             : 
    8243             :         /* Copy out parameters */
    8244             : 
    8245             :         /* Copy result */
    8246           0 :         state->orig.out.result = state->tmp.out.result;
    8247             : 
    8248             :         /* Reset temporary structure */
    8249           0 :         NDR_ZERO_STRUCT(state->tmp);
    8250             : 
    8251           0 :         tevent_req_done(req);
    8252             : }
    8253             : 
    8254           0 : NTSTATUS dcerpc_winreg_DeleteKeyEx_recv(struct tevent_req *req,
    8255             :                                         TALLOC_CTX *mem_ctx,
    8256             :                                         WERROR *result)
    8257             : {
    8258           0 :         struct dcerpc_winreg_DeleteKeyEx_state *state = tevent_req_data(
    8259             :                 req, struct dcerpc_winreg_DeleteKeyEx_state);
    8260           0 :         NTSTATUS status;
    8261             : 
    8262           0 :         if (tevent_req_is_nterror(req, &status)) {
    8263           0 :                 tevent_req_received(req);
    8264           0 :                 return status;
    8265             :         }
    8266             : 
    8267             :         /* Steal possible out parameters to the callers context */
    8268           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    8269             : 
    8270             :         /* Return result */
    8271           0 :         *result = state->orig.out.result;
    8272             : 
    8273           0 :         tevent_req_received(req);
    8274           0 :         return NT_STATUS_OK;
    8275             : }
    8276             : 
    8277           0 : NTSTATUS dcerpc_winreg_DeleteKeyEx(struct dcerpc_binding_handle *h,
    8278             :                                    TALLOC_CTX *mem_ctx,
    8279             :                                    struct policy_handle *_handle /* [in] [ref] */,
    8280             :                                    struct winreg_String *_key /* [in] [ref] */,
    8281             :                                    uint32_t _access_mask /* [in]  */,
    8282             :                                    uint32_t _reserved /* [in]  */,
    8283             :                                    WERROR *result)
    8284             : {
    8285           0 :         struct winreg_DeleteKeyEx r;
    8286           0 :         NTSTATUS status;
    8287             : 
    8288             :         /* In parameters */
    8289           0 :         r.in.handle = _handle;
    8290           0 :         r.in.key = _key;
    8291           0 :         r.in.access_mask = _access_mask;
    8292           0 :         r.in.reserved = _reserved;
    8293             : 
    8294             :         /* Out parameters */
    8295             : 
    8296             :         /* Result */
    8297           0 :         NDR_ZERO_STRUCT(r.out.result);
    8298             : 
    8299           0 :         status = dcerpc_winreg_DeleteKeyEx_r(h, mem_ctx, &r);
    8300           0 :         if (!NT_STATUS_IS_OK(status)) {
    8301           0 :                 return status;
    8302             :         }
    8303             : 
    8304             :         /* Return variables */
    8305             : 
    8306             :         /* Return result */
    8307           0 :         *result = r.out.result;
    8308             : 
    8309           0 :         return NT_STATUS_OK;
    8310             : }
    8311             : 

Generated by: LCOV version 1.14