LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_winspool_c.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 0 6593 0.0 %
Date: 2021-09-23 10:06:22 Functions: 0 600 0.0 %

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