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 master 2f515e9b Lines: 0 7699 0.0 %
Date: 2024-04-21 15:09:00 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           0 :         struct tevent_req *req;
      23           0 :         struct dcerpc_winspool_AsyncOpenPrinter_r_state *state;
      24           0 :         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           0 :         NTSTATUS status;
      54             : 
      55           0 :         status = dcerpc_binding_handle_call_recv(subreq);
      56           0 :         TALLOC_FREE(subreq);
      57           0 :         if (tevent_req_nterror(req, status)) {
      58           0 :                 return;
      59             :         }
      60             : 
      61           0 :         tevent_req_done(req);
      62             : }
      63             : 
      64           0 : NTSTATUS dcerpc_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           0 :         NTSTATUS status;
      70             : 
      71           0 :         if (tevent_req_is_nterror(req, &status)) {
      72           0 :                 tevent_req_received(req);
      73           0 :                 return status;
      74             :         }
      75             : 
      76           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
      77             : 
      78           0 :         tevent_req_received(req);
      79           0 :         return NT_STATUS_OK;
      80             : }
      81             : 
      82           0 : NTSTATUS dcerpc_winspool_AsyncOpenPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncOpenPrinter *r)
      83             : {
      84           0 :         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           0 :         struct tevent_req *req;
     112           0 :         struct dcerpc_winspool_AsyncOpenPrinter_state *state;
     113           0 :         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           0 :         NTSTATUS status;
     159           0 :         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           0 :         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           0 :         struct winspool_AsyncOpenPrinter r;
     219           0 :         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           0 :         struct tevent_req *req;
     260           0 :         struct dcerpc_winspool_AsyncAddPrinter_r_state *state;
     261           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
     349           0 :         struct dcerpc_winspool_AsyncAddPrinter_state *state;
     350           0 :         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           0 :         NTSTATUS status;
     396           0 :         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           0 :         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           0 :         struct winspool_AsyncAddPrinter r;
     456           0 :         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           0 :         struct tevent_req *req;
     497           0 :         struct dcerpc_winspool_AsyncSetJob_r_state *state;
     498           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
     581           0 :         struct dcerpc_winspool_AsyncSetJob_state *state;
     582           0 :         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           0 :         NTSTATUS status;
     620           0 :         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           0 :         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           0 :         struct winspool_AsyncSetJob r;
     677           0 :         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           0 :         struct tevent_req *req;
     715           0 :         struct dcerpc_winspool_AsyncGetJob_r_state *state;
     716           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
     804           0 :         struct dcerpc_winspool_AsyncGetJob_state *state;
     805           0 :         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           0 :         NTSTATUS status;
     852           0 :         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           0 :                         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           0 :         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           0 :         struct winspool_AsyncGetJob r;
     921           0 :         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           0 :                         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           0 :         struct tevent_req *req;
     972           0 :         struct dcerpc_winspool_AsyncEnumJobs_r_state *state;
     973           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    1063           0 :         struct dcerpc_winspool_AsyncEnumJobs_state *state;
    1064           0 :         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           0 :         NTSTATUS status;
    1113           0 :         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           0 :                         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           0 :         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           0 :         struct winspool_AsyncEnumJobs r;
    1185           0 :         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           0 :                         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           0 :         struct tevent_req *req;
    1239           0 :         struct dcerpc_winspool_AsyncAddJob_r_state *state;
    1240           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    1327           0 :         struct dcerpc_winspool_AsyncAddJob_state *state;
    1328           0 :         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           0 :         NTSTATUS status;
    1374           0 :         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           0 :                         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           0 :         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           0 :         struct winspool_AsyncAddJob r;
    1442           0 :         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           0 :                         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           0 :         struct tevent_req *req;
    1492           0 :         struct dcerpc_winspool_AsyncScheduleJob_r_state *state;
    1493           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    1574           0 :         struct dcerpc_winspool_AsyncScheduleJob_state *state;
    1575           0 :         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           0 :         NTSTATUS status;
    1611           0 :         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           0 :         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           0 :         struct winspool_AsyncScheduleJob r;
    1666           0 :         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           0 :         struct tevent_req *req;
    1702           0 :         struct dcerpc_winspool_AsyncDeletePrinter_r_state *state;
    1703           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    1783           0 :         struct dcerpc_winspool_AsyncDeletePrinter_state *state;
    1784           0 :         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           0 :         NTSTATUS status;
    1819           0 :         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           0 :         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           0 :         struct winspool_AsyncDeletePrinter r;
    1873           0 :         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           0 :         struct tevent_req *req;
    1908           0 :         struct dcerpc_winspool_AsyncSetPrinter_r_state *state;
    1909           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    1993           0 :         struct dcerpc_winspool_AsyncSetPrinter_state *state;
    1994           0 :         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           0 :         NTSTATUS status;
    2033           0 :         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           0 :         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           0 :         struct winspool_AsyncSetPrinter r;
    2091           0 :         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           0 :         struct tevent_req *req;
    2130           0 :         struct dcerpc_winspool_AsyncGetPrinter_r_state *state;
    2131           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    2218           0 :         struct dcerpc_winspool_AsyncGetPrinter_state *state;
    2219           0 :         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           0 :         NTSTATUS status;
    2265           0 :         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           0 :                         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           0 :         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           0 :         struct winspool_AsyncGetPrinter r;
    2333           0 :         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           0 :                         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           0 :         struct tevent_req *req;
    2383           0 :         struct dcerpc_winspool_AsyncStartDocPrinter_r_state *state;
    2384           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    2469           0 :         struct dcerpc_winspool_AsyncStartDocPrinter_state *state;
    2470           0 :         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           0 :         NTSTATUS status;
    2513           0 :         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           0 :         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           0 :         struct winspool_AsyncStartDocPrinter r;
    2570           0 :         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           0 :         struct tevent_req *req;
    2608           0 :         struct dcerpc_winspool_AsyncStartPagePrinter_r_state *state;
    2609           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    2689           0 :         struct dcerpc_winspool_AsyncStartPagePrinter_state *state;
    2690           0 :         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           0 :         NTSTATUS status;
    2725           0 :         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           0 :         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           0 :         struct winspool_AsyncStartPagePrinter r;
    2779           0 :         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           0 :         struct tevent_req *req;
    2814           0 :         struct dcerpc_winspool_AsyncWritePrinter_r_state *state;
    2815           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    2901           0 :         struct dcerpc_winspool_AsyncWritePrinter_state *state;
    2902           0 :         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           0 :         NTSTATUS status;
    2946           0 :         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           0 :         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           0 :         struct winspool_AsyncWritePrinter r;
    3004           0 :         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           0 :         struct tevent_req *req;
    3043           0 :         struct dcerpc_winspool_AsyncEndPagePrinter_r_state *state;
    3044           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    3124           0 :         struct dcerpc_winspool_AsyncEndPagePrinter_state *state;
    3125           0 :         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           0 :         NTSTATUS status;
    3160           0 :         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           0 :         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           0 :         struct winspool_AsyncEndPagePrinter r;
    3214           0 :         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           0 :         struct tevent_req *req;
    3249           0 :         struct dcerpc_winspool_AsyncEndDocPrinter_r_state *state;
    3250           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    3330           0 :         struct dcerpc_winspool_AsyncEndDocPrinter_state *state;
    3331           0 :         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           0 :         NTSTATUS status;
    3366           0 :         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           0 :         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           0 :         struct winspool_AsyncEndDocPrinter r;
    3420           0 :         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           0 :         struct tevent_req *req;
    3455           0 :         struct dcerpc_winspool_AsyncAbortPrinter_r_state *state;
    3456           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    3536           0 :         struct dcerpc_winspool_AsyncAbortPrinter_state *state;
    3537           0 :         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           0 :         NTSTATUS status;
    3572           0 :         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           0 :         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           0 :         struct winspool_AsyncAbortPrinter r;
    3626           0 :         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           0 :         struct tevent_req *req;
    3661           0 :         struct dcerpc_winspool_AsyncGetPrinterData_r_state *state;
    3662           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    3750           0 :         struct dcerpc_winspool_AsyncGetPrinterData_state *state;
    3751           0 :         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           0 :         NTSTATUS status;
    3797           0 :         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           0 :                 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           0 :         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           0 :         struct winspool_AsyncGetPrinterData r;
    3865           0 :         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           0 :                 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           0 :         struct tevent_req *req;
    3914           0 :         struct dcerpc_winspool_AsyncGetPrinterDataEx_r_state *state;
    3915           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    4004           0 :         struct dcerpc_winspool_AsyncGetPrinterDataEx_state *state;
    4005           0 :         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           0 :         NTSTATUS status;
    4052           0 :         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           0 :                 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           0 :         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           0 :         struct winspool_AsyncGetPrinterDataEx r;
    4121           0 :         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           0 :                 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           0 :         struct tevent_req *req;
    4171           0 :         struct dcerpc_winspool_AsyncSetPrinterData_r_state *state;
    4172           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    4256           0 :         struct dcerpc_winspool_AsyncSetPrinterData_state *state;
    4257           0 :         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           0 :         NTSTATUS status;
    4296           0 :         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           0 :         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           0 :         struct winspool_AsyncSetPrinterData r;
    4354           0 :         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           0 :         struct tevent_req *req;
    4393           0 :         struct dcerpc_winspool_AsyncSetPrinterDataEx_r_state *state;
    4394           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    4479           0 :         struct dcerpc_winspool_AsyncSetPrinterDataEx_state *state;
    4480           0 :         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           0 :         NTSTATUS status;
    4520           0 :         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           0 :         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           0 :         struct winspool_AsyncSetPrinterDataEx r;
    4579           0 :         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           0 :         struct tevent_req *req;
    4619           0 :         struct dcerpc_winspool_AsyncClosePrinter_r_state *state;
    4620           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    4703           0 :         struct dcerpc_winspool_AsyncClosePrinter_state *state;
    4704           0 :         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           0 :         NTSTATUS status;
    4746           0 :         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           0 :         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           0 :         struct winspool_AsyncClosePrinter r;
    4801           0 :         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           0 :         struct tevent_req *req;
    4838           0 :         struct dcerpc_winspool_AsyncAddForm_r_state *state;
    4839           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    4920           0 :         struct dcerpc_winspool_AsyncAddForm_state *state;
    4921           0 :         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           0 :         NTSTATUS status;
    4957           0 :         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           0 :         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           0 :         struct winspool_AsyncAddForm r;
    5012           0 :         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           0 :         struct tevent_req *req;
    5048           0 :         struct dcerpc_winspool_AsyncDeleteForm_r_state *state;
    5049           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    5130           0 :         struct dcerpc_winspool_AsyncDeleteForm_state *state;
    5131           0 :         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           0 :         NTSTATUS status;
    5167           0 :         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           0 :         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           0 :         struct winspool_AsyncDeleteForm r;
    5222           0 :         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           0 :         struct tevent_req *req;
    5258           0 :         struct dcerpc_winspool_AsyncGetForm_r_state *state;
    5259           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    5347           0 :         struct dcerpc_winspool_AsyncGetForm_state *state;
    5348           0 :         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           0 :         NTSTATUS status;
    5395           0 :         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           0 :                         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           0 :         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           0 :         struct winspool_AsyncGetForm r;
    5464           0 :         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           0 :                         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           0 :         struct tevent_req *req;
    5515           0 :         struct dcerpc_winspool_AsyncSetForm_r_state *state;
    5516           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    5598           0 :         struct dcerpc_winspool_AsyncSetForm_state *state;
    5599           0 :         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           0 :         NTSTATUS status;
    5636           0 :         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           0 :         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           0 :         struct winspool_AsyncSetForm r;
    5692           0 :         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           0 :         struct tevent_req *req;
    5729           0 :         struct dcerpc_winspool_AsyncEnumForms_r_state *state;
    5730           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    5818           0 :         struct dcerpc_winspool_AsyncEnumForms_state *state;
    5819           0 :         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           0 :         NTSTATUS status;
    5866           0 :         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           0 :                         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           0 :         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           0 :         struct winspool_AsyncEnumForms r;
    5936           0 :         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           0 :                         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           0 :         struct tevent_req *req;
    5988           0 :         struct dcerpc_winspool_AsyncGetPrinterDriver_r_state *state;
    5989           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    6081           0 :         struct dcerpc_winspool_AsyncGetPrinterDriver_state *state;
    6082           0 :         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           0 :         NTSTATUS status;
    6133           0 :         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           0 :                         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           0 :         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           0 :         struct winspool_AsyncGetPrinterDriver r;
    6208           0 :         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           0 :                         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           0 :         struct tevent_req *req;
    6265           0 :         struct dcerpc_winspool_AsyncEnumPrinterData_r_state *state;
    6266           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    6357           0 :         struct dcerpc_winspool_AsyncEnumPrinterData_state *state;
    6358           0 :         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           0 :         NTSTATUS status;
    6407           0 :         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           0 :                 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           0 :                 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           0 :         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           0 :         struct winspool_AsyncEnumPrinterData r;
    6486           0 :         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           0 :                 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           0 :                 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           0 :         struct tevent_req *req;
    6546           0 :         struct dcerpc_winspool_AsyncEnumPrinterDataEx_r_state *state;
    6547           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    6635           0 :         struct dcerpc_winspool_AsyncEnumPrinterDataEx_state *state;
    6636           0 :         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           0 :         NTSTATUS status;
    6682           0 :         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           0 :                 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           0 :         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           0 :         struct winspool_AsyncEnumPrinterDataEx r;
    6750           0 :         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           0 :                 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           0 :         struct tevent_req *req;
    6799           0 :         struct dcerpc_winspool_AsyncEnumPrinterKey_r_state *state;
    6800           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    6887           0 :         struct dcerpc_winspool_AsyncEnumPrinterKey_state *state;
    6888           0 :         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           0 :         NTSTATUS status;
    6933           0 :         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           0 :                 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           0 :         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           0 :         struct winspool_AsyncEnumPrinterKey r;
    6999           0 :         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           0 :                 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           0 :         struct tevent_req *req;
    7046           0 :         struct dcerpc_winspool_AsyncDeletePrinterData_r_state *state;
    7047           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    7128           0 :         struct dcerpc_winspool_AsyncDeletePrinterData_state *state;
    7129           0 :         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           0 :         NTSTATUS status;
    7165           0 :         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           0 :         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           0 :         struct winspool_AsyncDeletePrinterData r;
    7220           0 :         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           0 :         struct tevent_req *req;
    7256           0 :         struct dcerpc_winspool_AsyncDeletePrinterDataEx_r_state *state;
    7257           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    7339           0 :         struct dcerpc_winspool_AsyncDeletePrinterDataEx_state *state;
    7340           0 :         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           0 :         NTSTATUS status;
    7377           0 :         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           0 :         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           0 :         struct winspool_AsyncDeletePrinterDataEx r;
    7433           0 :         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           0 :         struct tevent_req *req;
    7470           0 :         struct dcerpc_winspool_AsyncDeletePrinterKey_r_state *state;
    7471           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    7552           0 :         struct dcerpc_winspool_AsyncDeletePrinterKey_state *state;
    7553           0 :         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           0 :         NTSTATUS status;
    7589           0 :         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           0 :         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           0 :         struct winspool_AsyncDeletePrinterKey r;
    7644           0 :         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           0 :         struct tevent_req *req;
    7680           0 :         struct dcerpc_winspool_AsyncXcvData_r_state *state;
    7681           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    7771           0 :         struct dcerpc_winspool_AsyncXcvData_state *state;
    7772           0 :         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           0 :         NTSTATUS status;
    7821           0 :         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           0 :                 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           0 :         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           0 :         struct winspool_AsyncXcvData r;
    7891           0 :         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           0 :                 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           0 :         struct tevent_req *req;
    7943           0 :         struct dcerpc_winspool_AsyncSendRecvBidiData_r_state *state;
    7944           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    8030           0 :         struct dcerpc_winspool_AsyncSendRecvBidiData_state *state;
    8031           0 :         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           0 :         NTSTATUS status;
    8075           0 :         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           0 :         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           0 :         struct winspool_AsyncSendRecvBidiData r;
    8133           0 :         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           0 :         struct tevent_req *req;
    8172           0 :         struct dcerpc_winspool_AsyncCreatePrinterIC_r_state *state;
    8173           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    8258           0 :         struct dcerpc_winspool_AsyncCreatePrinterIC_state *state;
    8259           0 :         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           0 :         NTSTATUS status;
    8302           0 :         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           0 :         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           0 :         struct winspool_AsyncCreatePrinterIC r;
    8359           0 :         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           0 :         struct tevent_req *req;
    8397           0 :         struct dcerpc_winspool_AsyncPlayGdiScriptOnPrinterIC_r_state *state;
    8398           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    8486           0 :         struct dcerpc_winspool_AsyncPlayGdiScriptOnPrinterIC_state *state;
    8487           0 :         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           0 :         NTSTATUS status;
    8533           0 :         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           0 :                 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           0 :         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           0 :         struct winspool_AsyncPlayGdiScriptOnPrinterIC r;
    8599           0 :         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           0 :                 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           0 :         struct tevent_req *req;
    8646           0 :         struct dcerpc_winspool_AsyncDeletePrinterIC_r_state *state;
    8647           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    8730           0 :         struct dcerpc_winspool_AsyncDeletePrinterIC_state *state;
    8731           0 :         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           0 :         NTSTATUS status;
    8773           0 :         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           0 :         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           0 :         struct winspool_AsyncDeletePrinterIC r;
    8828           0 :         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           0 :         struct tevent_req *req;
    8865           0 :         struct dcerpc_winspool_AsyncEnumPrinters_r_state *state;
    8866           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    8955           0 :         struct dcerpc_winspool_AsyncEnumPrinters_state *state;
    8956           0 :         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           0 :         NTSTATUS status;
    9004           0 :         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           0 :                         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           0 :         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           0 :         struct winspool_AsyncEnumPrinters r;
    9075           0 :         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           0 :                         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           0 :         struct tevent_req *req;
    9128           0 :         struct dcerpc_winspool_AsyncAddPrinterDriver_r_state *state;
    9129           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    9211           0 :         struct dcerpc_winspool_AsyncAddPrinterDriver_state *state;
    9212           0 :         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           0 :         NTSTATUS status;
    9249           0 :         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           0 :         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           0 :         struct winspool_AsyncAddPrinterDriver r;
    9305           0 :         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           0 :         struct tevent_req *req;
    9342           0 :         struct dcerpc_winspool_AsyncEnumPrinterDrivers_r_state *state;
    9343           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    9432           0 :         struct dcerpc_winspool_AsyncEnumPrinterDrivers_state *state;
    9433           0 :         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           0 :         NTSTATUS status;
    9481           0 :         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           0 :                         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           0 :         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           0 :         struct winspool_AsyncEnumPrinterDrivers r;
    9552           0 :         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           0 :                         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           0 :         struct tevent_req *req;
    9605           0 :         struct dcerpc_winspool_AsyncGetPrinterDriverDirectory_r_state *state;
    9606           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    9694           0 :         struct dcerpc_winspool_AsyncGetPrinterDriverDirectory_state *state;
    9695           0 :         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           0 :         NTSTATUS status;
    9742           0 :         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           0 :                         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           0 :         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           0 :         struct winspool_AsyncGetPrinterDriverDirectory r;
    9811           0 :         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           0 :                         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           0 :         struct tevent_req *req;
    9862           0 :         struct dcerpc_winspool_AsyncDeletePrinterDriver_r_state *state;
    9863           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    9945           0 :         struct dcerpc_winspool_AsyncDeletePrinterDriver_state *state;
    9946           0 :         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           0 :         NTSTATUS status;
    9983           0 :         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           0 :         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           0 :         struct winspool_AsyncDeletePrinterDriver r;
   10039           0 :         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           0 :         struct tevent_req *req;
   10076           0 :         struct dcerpc_winspool_AsyncDeletePrinterDriverEx_r_state *state;
   10077           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
   10161           0 :         struct dcerpc_winspool_AsyncDeletePrinterDriverEx_state *state;
   10162           0 :         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           0 :         NTSTATUS status;
   10201           0 :         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           0 :         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           0 :         struct winspool_AsyncDeletePrinterDriverEx r;
   10259           0 :         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           0 :         struct tevent_req *req;
   10298           0 :         struct dcerpc_winspool_AsyncAddPrintProcessor_r_state *state;
   10299           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
   10382           0 :         struct dcerpc_winspool_AsyncAddPrintProcessor_state *state;
   10383           0 :         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           0 :         NTSTATUS status;
   10421           0 :         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           0 :         NTSTATUS status;
   10453             : 
   10454           0 :         if (tevent_req_is_nterror(req, &status)) {
   10455           0 :                 tevent_req_received(req);
   10456           0 :                 return status;
   10457             :         }
   10458             : 
   10459             :         /* Steal possible out parameters to the callers context */
   10460           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10461             : 
   10462             :         /* Return result */
   10463           0 :         *result = state->orig.out.result;
   10464             : 
   10465           0 :         tevent_req_received(req);
   10466           0 :         return NT_STATUS_OK;
   10467             : }
   10468             : 
   10469           0 : NTSTATUS dcerpc_winspool_AsyncAddPrintProcessor(struct dcerpc_binding_handle *h,
   10470             :                                                 TALLOC_CTX *mem_ctx,
   10471             :                                                 const char *_pName /* [in] [charset(UTF16),unique] */,
   10472             :                                                 const char *_pEnvironment /* [in] [charset(UTF16),ref] */,
   10473             :                                                 const char *_pPathName /* [in] [charset(UTF16),ref] */,
   10474             :                                                 const char *_pPrintProcessorName /* [in] [charset(UTF16),ref] */,
   10475             :                                                 WERROR *result)
   10476             : {
   10477           0 :         struct winspool_AsyncAddPrintProcessor r;
   10478           0 :         NTSTATUS status;
   10479             : 
   10480             :         /* In parameters */
   10481           0 :         r.in.pName = _pName;
   10482           0 :         r.in.pEnvironment = _pEnvironment;
   10483           0 :         r.in.pPathName = _pPathName;
   10484           0 :         r.in.pPrintProcessorName = _pPrintProcessorName;
   10485             : 
   10486             :         /* Out parameters */
   10487             : 
   10488             :         /* Result */
   10489           0 :         NDR_ZERO_STRUCT(r.out.result);
   10490             : 
   10491           0 :         status = dcerpc_winspool_AsyncAddPrintProcessor_r(h, mem_ctx, &r);
   10492           0 :         if (!NT_STATUS_IS_OK(status)) {
   10493           0 :                 return status;
   10494             :         }
   10495             : 
   10496             :         /* Return variables */
   10497             : 
   10498             :         /* Return result */
   10499           0 :         *result = r.out.result;
   10500             : 
   10501           0 :         return NT_STATUS_OK;
   10502             : }
   10503             : 
   10504             : struct dcerpc_winspool_AsyncEnumPrintProcessors_r_state {
   10505             :         TALLOC_CTX *out_mem_ctx;
   10506             : };
   10507             : 
   10508             : static void dcerpc_winspool_AsyncEnumPrintProcessors_r_done(struct tevent_req *subreq);
   10509             : 
   10510           0 : struct tevent_req *dcerpc_winspool_AsyncEnumPrintProcessors_r_send(TALLOC_CTX *mem_ctx,
   10511             :         struct tevent_context *ev,
   10512             :         struct dcerpc_binding_handle *h,
   10513             :         struct winspool_AsyncEnumPrintProcessors *r)
   10514             : {
   10515           0 :         struct tevent_req *req;
   10516           0 :         struct dcerpc_winspool_AsyncEnumPrintProcessors_r_state *state;
   10517           0 :         struct tevent_req *subreq;
   10518             : 
   10519           0 :         req = tevent_req_create(mem_ctx, &state,
   10520             :                                 struct dcerpc_winspool_AsyncEnumPrintProcessors_r_state);
   10521           0 :         if (req == NULL) {
   10522           0 :                 return NULL;
   10523             :         }
   10524             : 
   10525           0 :         state->out_mem_ctx = talloc_new(state);
   10526           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   10527           0 :                 return tevent_req_post(req, ev);
   10528             :         }
   10529             : 
   10530           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   10531             :                         NULL, &ndr_table_iremotewinspool,
   10532           0 :                         NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORS, state->out_mem_ctx, r);
   10533           0 :         if (tevent_req_nomem(subreq, req)) {
   10534           0 :                 return tevent_req_post(req, ev);
   10535             :         }
   10536           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumPrintProcessors_r_done, req);
   10537             : 
   10538           0 :         return req;
   10539             : }
   10540             : 
   10541           0 : static void dcerpc_winspool_AsyncEnumPrintProcessors_r_done(struct tevent_req *subreq)
   10542             : {
   10543           0 :         struct tevent_req *req =
   10544           0 :                 tevent_req_callback_data(subreq,
   10545             :                 struct tevent_req);
   10546           0 :         NTSTATUS status;
   10547             : 
   10548           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   10549           0 :         TALLOC_FREE(subreq);
   10550           0 :         if (tevent_req_nterror(req, status)) {
   10551           0 :                 return;
   10552             :         }
   10553             : 
   10554           0 :         tevent_req_done(req);
   10555             : }
   10556             : 
   10557           0 : NTSTATUS dcerpc_winspool_AsyncEnumPrintProcessors_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   10558             : {
   10559           0 :         struct dcerpc_winspool_AsyncEnumPrintProcessors_r_state *state =
   10560           0 :                 tevent_req_data(req,
   10561             :                 struct dcerpc_winspool_AsyncEnumPrintProcessors_r_state);
   10562           0 :         NTSTATUS status;
   10563             : 
   10564           0 :         if (tevent_req_is_nterror(req, &status)) {
   10565           0 :                 tevent_req_received(req);
   10566           0 :                 return status;
   10567             :         }
   10568             : 
   10569           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10570             : 
   10571           0 :         tevent_req_received(req);
   10572           0 :         return NT_STATUS_OK;
   10573             : }
   10574             : 
   10575           0 : NTSTATUS dcerpc_winspool_AsyncEnumPrintProcessors_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncEnumPrintProcessors *r)
   10576             : {
   10577           0 :         NTSTATUS status;
   10578             : 
   10579           0 :         status = dcerpc_binding_handle_call(h,
   10580             :                         NULL, &ndr_table_iremotewinspool,
   10581             :                         NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORS, mem_ctx, r);
   10582             : 
   10583           0 :         return status;
   10584             : }
   10585             : 
   10586             : struct dcerpc_winspool_AsyncEnumPrintProcessors_state {
   10587             :         struct winspool_AsyncEnumPrintProcessors orig;
   10588             :         struct winspool_AsyncEnumPrintProcessors tmp;
   10589             :         TALLOC_CTX *out_mem_ctx;
   10590             : };
   10591             : 
   10592             : static void dcerpc_winspool_AsyncEnumPrintProcessors_done(struct tevent_req *subreq);
   10593             : 
   10594           0 : struct tevent_req *dcerpc_winspool_AsyncEnumPrintProcessors_send(TALLOC_CTX *mem_ctx,
   10595             :                                                                  struct tevent_context *ev,
   10596             :                                                                  struct dcerpc_binding_handle *h,
   10597             :                                                                  const char *_pName /* [in] [charset(UTF16),unique] */,
   10598             :                                                                  const char *_pEnvironment /* [in] [charset(UTF16),unique] */,
   10599             :                                                                  uint32_t _Level /* [in]  */,
   10600             :                                                                  uint8_t *_pPrintProcessorInfo /* [in,out] [size_is(cbBuf),unique] */,
   10601             :                                                                  uint32_t _cbBuf /* [in]  */,
   10602             :                                                                  uint32_t *_pcbNeeded /* [out] [ref] */,
   10603             :                                                                  uint32_t *_pcReturned /* [out] [ref] */)
   10604             : {
   10605           0 :         struct tevent_req *req;
   10606           0 :         struct dcerpc_winspool_AsyncEnumPrintProcessors_state *state;
   10607           0 :         struct tevent_req *subreq;
   10608             : 
   10609           0 :         req = tevent_req_create(mem_ctx, &state,
   10610             :                                 struct dcerpc_winspool_AsyncEnumPrintProcessors_state);
   10611           0 :         if (req == NULL) {
   10612           0 :                 return NULL;
   10613             :         }
   10614           0 :         state->out_mem_ctx = NULL;
   10615             : 
   10616             :         /* In parameters */
   10617           0 :         state->orig.in.pName = _pName;
   10618           0 :         state->orig.in.pEnvironment = _pEnvironment;
   10619           0 :         state->orig.in.Level = _Level;
   10620           0 :         state->orig.in.pPrintProcessorInfo = _pPrintProcessorInfo;
   10621           0 :         state->orig.in.cbBuf = _cbBuf;
   10622             : 
   10623             :         /* Out parameters */
   10624           0 :         state->orig.out.pPrintProcessorInfo = _pPrintProcessorInfo;
   10625           0 :         state->orig.out.pcbNeeded = _pcbNeeded;
   10626           0 :         state->orig.out.pcReturned = _pcReturned;
   10627             : 
   10628             :         /* Result */
   10629           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   10630             : 
   10631           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   10632             :                              "dcerpc_winspool_AsyncEnumPrintProcessors_out_memory");
   10633           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   10634           0 :                 return tevent_req_post(req, ev);
   10635             :         }
   10636             : 
   10637             :         /* make a temporary copy, that we pass to the dispatch function */
   10638           0 :         state->tmp = state->orig;
   10639             : 
   10640           0 :         subreq = dcerpc_winspool_AsyncEnumPrintProcessors_r_send(state, ev, h, &state->tmp);
   10641           0 :         if (tevent_req_nomem(subreq, req)) {
   10642           0 :                 return tevent_req_post(req, ev);
   10643             :         }
   10644           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumPrintProcessors_done, req);
   10645           0 :         return req;
   10646             : }
   10647             : 
   10648           0 : static void dcerpc_winspool_AsyncEnumPrintProcessors_done(struct tevent_req *subreq)
   10649             : {
   10650           0 :         struct tevent_req *req = tevent_req_callback_data(
   10651             :                 subreq, struct tevent_req);
   10652           0 :         struct dcerpc_winspool_AsyncEnumPrintProcessors_state *state = tevent_req_data(
   10653             :                 req, struct dcerpc_winspool_AsyncEnumPrintProcessors_state);
   10654           0 :         NTSTATUS status;
   10655           0 :         TALLOC_CTX *mem_ctx;
   10656             : 
   10657           0 :         if (state->out_mem_ctx) {
   10658           0 :                 mem_ctx = state->out_mem_ctx;
   10659             :         } else {
   10660           0 :                 mem_ctx = state;
   10661             :         }
   10662             : 
   10663           0 :         status = dcerpc_winspool_AsyncEnumPrintProcessors_r_recv(subreq, mem_ctx);
   10664           0 :         TALLOC_FREE(subreq);
   10665           0 :         if (tevent_req_nterror(req, status)) {
   10666           0 :                 return;
   10667             :         }
   10668             : 
   10669             :         /* Copy out parameters */
   10670           0 :         if (state->orig.out.pPrintProcessorInfo && state->tmp.out.pPrintProcessorInfo) {
   10671             :                 {
   10672           0 :                         size_t _copy_len_pPrintProcessorInfo;
   10673           0 :                         _copy_len_pPrintProcessorInfo = state->tmp.in.cbBuf;
   10674           0 :                         if (state->orig.out.pPrintProcessorInfo != state->tmp.out.pPrintProcessorInfo) {
   10675           0 :                                 memcpy(state->orig.out.pPrintProcessorInfo, state->tmp.out.pPrintProcessorInfo, _copy_len_pPrintProcessorInfo * sizeof(*state->orig.out.pPrintProcessorInfo));
   10676             :                         }
   10677             :                 }
   10678             :         }
   10679           0 :         *state->orig.out.pcbNeeded = *state->tmp.out.pcbNeeded;
   10680           0 :         *state->orig.out.pcReturned = *state->tmp.out.pcReturned;
   10681             : 
   10682             :         /* Copy result */
   10683           0 :         state->orig.out.result = state->tmp.out.result;
   10684             : 
   10685             :         /* Reset temporary structure */
   10686           0 :         NDR_ZERO_STRUCT(state->tmp);
   10687             : 
   10688           0 :         tevent_req_done(req);
   10689             : }
   10690             : 
   10691           0 : NTSTATUS dcerpc_winspool_AsyncEnumPrintProcessors_recv(struct tevent_req *req,
   10692             :                                                        TALLOC_CTX *mem_ctx,
   10693             :                                                        WERROR *result)
   10694             : {
   10695           0 :         struct dcerpc_winspool_AsyncEnumPrintProcessors_state *state = tevent_req_data(
   10696             :                 req, struct dcerpc_winspool_AsyncEnumPrintProcessors_state);
   10697           0 :         NTSTATUS status;
   10698             : 
   10699           0 :         if (tevent_req_is_nterror(req, &status)) {
   10700           0 :                 tevent_req_received(req);
   10701           0 :                 return status;
   10702             :         }
   10703             : 
   10704             :         /* Steal possible out parameters to the callers context */
   10705           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10706             : 
   10707             :         /* Return result */
   10708           0 :         *result = state->orig.out.result;
   10709             : 
   10710           0 :         tevent_req_received(req);
   10711           0 :         return NT_STATUS_OK;
   10712             : }
   10713             : 
   10714           0 : NTSTATUS dcerpc_winspool_AsyncEnumPrintProcessors(struct dcerpc_binding_handle *h,
   10715             :                                                   TALLOC_CTX *mem_ctx,
   10716             :                                                   const char *_pName /* [in] [charset(UTF16),unique] */,
   10717             :                                                   const char *_pEnvironment /* [in] [charset(UTF16),unique] */,
   10718             :                                                   uint32_t _Level /* [in]  */,
   10719             :                                                   uint8_t *_pPrintProcessorInfo /* [in,out] [size_is(cbBuf),unique] */,
   10720             :                                                   uint32_t _cbBuf /* [in]  */,
   10721             :                                                   uint32_t *_pcbNeeded /* [out] [ref] */,
   10722             :                                                   uint32_t *_pcReturned /* [out] [ref] */,
   10723             :                                                   WERROR *result)
   10724             : {
   10725           0 :         struct winspool_AsyncEnumPrintProcessors r;
   10726           0 :         NTSTATUS status;
   10727             : 
   10728             :         /* In parameters */
   10729           0 :         r.in.pName = _pName;
   10730           0 :         r.in.pEnvironment = _pEnvironment;
   10731           0 :         r.in.Level = _Level;
   10732           0 :         r.in.pPrintProcessorInfo = _pPrintProcessorInfo;
   10733           0 :         r.in.cbBuf = _cbBuf;
   10734             : 
   10735             :         /* Out parameters */
   10736           0 :         r.out.pPrintProcessorInfo = _pPrintProcessorInfo;
   10737           0 :         r.out.pcbNeeded = _pcbNeeded;
   10738           0 :         r.out.pcReturned = _pcReturned;
   10739             : 
   10740             :         /* Result */
   10741           0 :         NDR_ZERO_STRUCT(r.out.result);
   10742             : 
   10743           0 :         status = dcerpc_winspool_AsyncEnumPrintProcessors_r(h, mem_ctx, &r);
   10744           0 :         if (!NT_STATUS_IS_OK(status)) {
   10745           0 :                 return status;
   10746             :         }
   10747             : 
   10748             :         /* Return variables */
   10749           0 :         if (_pPrintProcessorInfo && r.out.pPrintProcessorInfo) {
   10750             :                 {
   10751           0 :                         size_t _copy_len_pPrintProcessorInfo;
   10752           0 :                         _copy_len_pPrintProcessorInfo = r.in.cbBuf;
   10753           0 :                         if (_pPrintProcessorInfo != r.out.pPrintProcessorInfo) {
   10754           0 :                                 memcpy(_pPrintProcessorInfo, r.out.pPrintProcessorInfo, _copy_len_pPrintProcessorInfo * sizeof(*_pPrintProcessorInfo));
   10755             :                         }
   10756             :                 }
   10757             :         }
   10758           0 :         *_pcbNeeded = *r.out.pcbNeeded;
   10759           0 :         *_pcReturned = *r.out.pcReturned;
   10760             : 
   10761             :         /* Return result */
   10762           0 :         *result = r.out.result;
   10763             : 
   10764           0 :         return NT_STATUS_OK;
   10765             : }
   10766             : 
   10767             : struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_state {
   10768             :         TALLOC_CTX *out_mem_ctx;
   10769             : };
   10770             : 
   10771             : static void dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_done(struct tevent_req *subreq);
   10772             : 
   10773           0 : struct tevent_req *dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_send(TALLOC_CTX *mem_ctx,
   10774             :         struct tevent_context *ev,
   10775             :         struct dcerpc_binding_handle *h,
   10776             :         struct winspool_AsyncGetPrintProcessorDirectory *r)
   10777             : {
   10778           0 :         struct tevent_req *req;
   10779           0 :         struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_state *state;
   10780           0 :         struct tevent_req *subreq;
   10781             : 
   10782           0 :         req = tevent_req_create(mem_ctx, &state,
   10783             :                                 struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_state);
   10784           0 :         if (req == NULL) {
   10785           0 :                 return NULL;
   10786             :         }
   10787             : 
   10788           0 :         state->out_mem_ctx = talloc_new(state);
   10789           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   10790           0 :                 return tevent_req_post(req, ev);
   10791             :         }
   10792             : 
   10793           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   10794             :                         NULL, &ndr_table_iremotewinspool,
   10795           0 :                         NDR_WINSPOOL_ASYNCGETPRINTPROCESSORDIRECTORY, state->out_mem_ctx, r);
   10796           0 :         if (tevent_req_nomem(subreq, req)) {
   10797           0 :                 return tevent_req_post(req, ev);
   10798             :         }
   10799           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_done, req);
   10800             : 
   10801           0 :         return req;
   10802             : }
   10803             : 
   10804           0 : static void dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_done(struct tevent_req *subreq)
   10805             : {
   10806           0 :         struct tevent_req *req =
   10807           0 :                 tevent_req_callback_data(subreq,
   10808             :                 struct tevent_req);
   10809           0 :         NTSTATUS status;
   10810             : 
   10811           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   10812           0 :         TALLOC_FREE(subreq);
   10813           0 :         if (tevent_req_nterror(req, status)) {
   10814           0 :                 return;
   10815             :         }
   10816             : 
   10817           0 :         tevent_req_done(req);
   10818             : }
   10819             : 
   10820           0 : NTSTATUS dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   10821             : {
   10822           0 :         struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_state *state =
   10823           0 :                 tevent_req_data(req,
   10824             :                 struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_state);
   10825           0 :         NTSTATUS status;
   10826             : 
   10827           0 :         if (tevent_req_is_nterror(req, &status)) {
   10828           0 :                 tevent_req_received(req);
   10829           0 :                 return status;
   10830             :         }
   10831             : 
   10832           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10833             : 
   10834           0 :         tevent_req_received(req);
   10835           0 :         return NT_STATUS_OK;
   10836             : }
   10837             : 
   10838           0 : NTSTATUS dcerpc_winspool_AsyncGetPrintProcessorDirectory_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncGetPrintProcessorDirectory *r)
   10839             : {
   10840           0 :         NTSTATUS status;
   10841             : 
   10842           0 :         status = dcerpc_binding_handle_call(h,
   10843             :                         NULL, &ndr_table_iremotewinspool,
   10844             :                         NDR_WINSPOOL_ASYNCGETPRINTPROCESSORDIRECTORY, mem_ctx, r);
   10845             : 
   10846           0 :         return status;
   10847             : }
   10848             : 
   10849             : struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_state {
   10850             :         struct winspool_AsyncGetPrintProcessorDirectory orig;
   10851             :         struct winspool_AsyncGetPrintProcessorDirectory tmp;
   10852             :         TALLOC_CTX *out_mem_ctx;
   10853             : };
   10854             : 
   10855             : static void dcerpc_winspool_AsyncGetPrintProcessorDirectory_done(struct tevent_req *subreq);
   10856             : 
   10857           0 : struct tevent_req *dcerpc_winspool_AsyncGetPrintProcessorDirectory_send(TALLOC_CTX *mem_ctx,
   10858             :                                                                         struct tevent_context *ev,
   10859             :                                                                         struct dcerpc_binding_handle *h,
   10860             :                                                                         const char *_pName /* [in] [charset(UTF16),unique] */,
   10861             :                                                                         const char *_pEnvironment /* [in] [charset(UTF16),unique] */,
   10862             :                                                                         uint32_t _Level /* [in]  */,
   10863             :                                                                         uint8_t *_pPrintProcessorDirectory /* [in,out] [size_is(cbBuf),unique] */,
   10864             :                                                                         uint32_t _cbBuf /* [in]  */,
   10865             :                                                                         uint32_t *_pcbNeeded /* [out] [ref] */)
   10866             : {
   10867           0 :         struct tevent_req *req;
   10868           0 :         struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_state *state;
   10869           0 :         struct tevent_req *subreq;
   10870             : 
   10871           0 :         req = tevent_req_create(mem_ctx, &state,
   10872             :                                 struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_state);
   10873           0 :         if (req == NULL) {
   10874           0 :                 return NULL;
   10875             :         }
   10876           0 :         state->out_mem_ctx = NULL;
   10877             : 
   10878             :         /* In parameters */
   10879           0 :         state->orig.in.pName = _pName;
   10880           0 :         state->orig.in.pEnvironment = _pEnvironment;
   10881           0 :         state->orig.in.Level = _Level;
   10882           0 :         state->orig.in.pPrintProcessorDirectory = _pPrintProcessorDirectory;
   10883           0 :         state->orig.in.cbBuf = _cbBuf;
   10884             : 
   10885             :         /* Out parameters */
   10886           0 :         state->orig.out.pPrintProcessorDirectory = _pPrintProcessorDirectory;
   10887           0 :         state->orig.out.pcbNeeded = _pcbNeeded;
   10888             : 
   10889             :         /* Result */
   10890           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   10891             : 
   10892           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   10893             :                              "dcerpc_winspool_AsyncGetPrintProcessorDirectory_out_memory");
   10894           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   10895           0 :                 return tevent_req_post(req, ev);
   10896             :         }
   10897             : 
   10898             :         /* make a temporary copy, that we pass to the dispatch function */
   10899           0 :         state->tmp = state->orig;
   10900             : 
   10901           0 :         subreq = dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_send(state, ev, h, &state->tmp);
   10902           0 :         if (tevent_req_nomem(subreq, req)) {
   10903           0 :                 return tevent_req_post(req, ev);
   10904             :         }
   10905           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncGetPrintProcessorDirectory_done, req);
   10906           0 :         return req;
   10907             : }
   10908             : 
   10909           0 : static void dcerpc_winspool_AsyncGetPrintProcessorDirectory_done(struct tevent_req *subreq)
   10910             : {
   10911           0 :         struct tevent_req *req = tevent_req_callback_data(
   10912             :                 subreq, struct tevent_req);
   10913           0 :         struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_state *state = tevent_req_data(
   10914             :                 req, struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_state);
   10915           0 :         NTSTATUS status;
   10916           0 :         TALLOC_CTX *mem_ctx;
   10917             : 
   10918           0 :         if (state->out_mem_ctx) {
   10919           0 :                 mem_ctx = state->out_mem_ctx;
   10920             :         } else {
   10921           0 :                 mem_ctx = state;
   10922             :         }
   10923             : 
   10924           0 :         status = dcerpc_winspool_AsyncGetPrintProcessorDirectory_r_recv(subreq, mem_ctx);
   10925           0 :         TALLOC_FREE(subreq);
   10926           0 :         if (tevent_req_nterror(req, status)) {
   10927           0 :                 return;
   10928             :         }
   10929             : 
   10930             :         /* Copy out parameters */
   10931           0 :         if (state->orig.out.pPrintProcessorDirectory && state->tmp.out.pPrintProcessorDirectory) {
   10932             :                 {
   10933           0 :                         size_t _copy_len_pPrintProcessorDirectory;
   10934           0 :                         _copy_len_pPrintProcessorDirectory = state->tmp.in.cbBuf;
   10935           0 :                         if (state->orig.out.pPrintProcessorDirectory != state->tmp.out.pPrintProcessorDirectory) {
   10936           0 :                                 memcpy(state->orig.out.pPrintProcessorDirectory, state->tmp.out.pPrintProcessorDirectory, _copy_len_pPrintProcessorDirectory * sizeof(*state->orig.out.pPrintProcessorDirectory));
   10937             :                         }
   10938             :                 }
   10939             :         }
   10940           0 :         *state->orig.out.pcbNeeded = *state->tmp.out.pcbNeeded;
   10941             : 
   10942             :         /* Copy result */
   10943           0 :         state->orig.out.result = state->tmp.out.result;
   10944             : 
   10945             :         /* Reset temporary structure */
   10946           0 :         NDR_ZERO_STRUCT(state->tmp);
   10947             : 
   10948           0 :         tevent_req_done(req);
   10949             : }
   10950             : 
   10951           0 : NTSTATUS dcerpc_winspool_AsyncGetPrintProcessorDirectory_recv(struct tevent_req *req,
   10952             :                                                               TALLOC_CTX *mem_ctx,
   10953             :                                                               WERROR *result)
   10954             : {
   10955           0 :         struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_state *state = tevent_req_data(
   10956             :                 req, struct dcerpc_winspool_AsyncGetPrintProcessorDirectory_state);
   10957           0 :         NTSTATUS status;
   10958             : 
   10959           0 :         if (tevent_req_is_nterror(req, &status)) {
   10960           0 :                 tevent_req_received(req);
   10961           0 :                 return status;
   10962             :         }
   10963             : 
   10964             :         /* Steal possible out parameters to the callers context */
   10965           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10966             : 
   10967             :         /* Return result */
   10968           0 :         *result = state->orig.out.result;
   10969             : 
   10970           0 :         tevent_req_received(req);
   10971           0 :         return NT_STATUS_OK;
   10972             : }
   10973             : 
   10974           0 : NTSTATUS dcerpc_winspool_AsyncGetPrintProcessorDirectory(struct dcerpc_binding_handle *h,
   10975             :                                                          TALLOC_CTX *mem_ctx,
   10976             :                                                          const char *_pName /* [in] [charset(UTF16),unique] */,
   10977             :                                                          const char *_pEnvironment /* [in] [charset(UTF16),unique] */,
   10978             :                                                          uint32_t _Level /* [in]  */,
   10979             :                                                          uint8_t *_pPrintProcessorDirectory /* [in,out] [size_is(cbBuf),unique] */,
   10980             :                                                          uint32_t _cbBuf /* [in]  */,
   10981             :                                                          uint32_t *_pcbNeeded /* [out] [ref] */,
   10982             :                                                          WERROR *result)
   10983             : {
   10984           0 :         struct winspool_AsyncGetPrintProcessorDirectory r;
   10985           0 :         NTSTATUS status;
   10986             : 
   10987             :         /* In parameters */
   10988           0 :         r.in.pName = _pName;
   10989           0 :         r.in.pEnvironment = _pEnvironment;
   10990           0 :         r.in.Level = _Level;
   10991           0 :         r.in.pPrintProcessorDirectory = _pPrintProcessorDirectory;
   10992           0 :         r.in.cbBuf = _cbBuf;
   10993             : 
   10994             :         /* Out parameters */
   10995           0 :         r.out.pPrintProcessorDirectory = _pPrintProcessorDirectory;
   10996           0 :         r.out.pcbNeeded = _pcbNeeded;
   10997             : 
   10998             :         /* Result */
   10999           0 :         NDR_ZERO_STRUCT(r.out.result);
   11000             : 
   11001           0 :         status = dcerpc_winspool_AsyncGetPrintProcessorDirectory_r(h, mem_ctx, &r);
   11002           0 :         if (!NT_STATUS_IS_OK(status)) {
   11003           0 :                 return status;
   11004             :         }
   11005             : 
   11006             :         /* Return variables */
   11007           0 :         if (_pPrintProcessorDirectory && r.out.pPrintProcessorDirectory) {
   11008             :                 {
   11009           0 :                         size_t _copy_len_pPrintProcessorDirectory;
   11010           0 :                         _copy_len_pPrintProcessorDirectory = r.in.cbBuf;
   11011           0 :                         if (_pPrintProcessorDirectory != r.out.pPrintProcessorDirectory) {
   11012           0 :                                 memcpy(_pPrintProcessorDirectory, r.out.pPrintProcessorDirectory, _copy_len_pPrintProcessorDirectory * sizeof(*_pPrintProcessorDirectory));
   11013             :                         }
   11014             :                 }
   11015             :         }
   11016           0 :         *_pcbNeeded = *r.out.pcbNeeded;
   11017             : 
   11018             :         /* Return result */
   11019           0 :         *result = r.out.result;
   11020             : 
   11021           0 :         return NT_STATUS_OK;
   11022             : }
   11023             : 
   11024             : struct dcerpc_winspool_AsyncEnumPorts_r_state {
   11025             :         TALLOC_CTX *out_mem_ctx;
   11026             : };
   11027             : 
   11028             : static void dcerpc_winspool_AsyncEnumPorts_r_done(struct tevent_req *subreq);
   11029             : 
   11030           0 : struct tevent_req *dcerpc_winspool_AsyncEnumPorts_r_send(TALLOC_CTX *mem_ctx,
   11031             :         struct tevent_context *ev,
   11032             :         struct dcerpc_binding_handle *h,
   11033             :         struct winspool_AsyncEnumPorts *r)
   11034             : {
   11035           0 :         struct tevent_req *req;
   11036           0 :         struct dcerpc_winspool_AsyncEnumPorts_r_state *state;
   11037           0 :         struct tevent_req *subreq;
   11038             : 
   11039           0 :         req = tevent_req_create(mem_ctx, &state,
   11040             :                                 struct dcerpc_winspool_AsyncEnumPorts_r_state);
   11041           0 :         if (req == NULL) {
   11042           0 :                 return NULL;
   11043             :         }
   11044             : 
   11045           0 :         state->out_mem_ctx = talloc_new(state);
   11046           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   11047           0 :                 return tevent_req_post(req, ev);
   11048             :         }
   11049             : 
   11050           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   11051             :                         NULL, &ndr_table_iremotewinspool,
   11052           0 :                         NDR_WINSPOOL_ASYNCENUMPORTS, state->out_mem_ctx, r);
   11053           0 :         if (tevent_req_nomem(subreq, req)) {
   11054           0 :                 return tevent_req_post(req, ev);
   11055             :         }
   11056           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumPorts_r_done, req);
   11057             : 
   11058           0 :         return req;
   11059             : }
   11060             : 
   11061           0 : static void dcerpc_winspool_AsyncEnumPorts_r_done(struct tevent_req *subreq)
   11062             : {
   11063           0 :         struct tevent_req *req =
   11064           0 :                 tevent_req_callback_data(subreq,
   11065             :                 struct tevent_req);
   11066           0 :         NTSTATUS status;
   11067             : 
   11068           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   11069           0 :         TALLOC_FREE(subreq);
   11070           0 :         if (tevent_req_nterror(req, status)) {
   11071           0 :                 return;
   11072             :         }
   11073             : 
   11074           0 :         tevent_req_done(req);
   11075             : }
   11076             : 
   11077           0 : NTSTATUS dcerpc_winspool_AsyncEnumPorts_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   11078             : {
   11079           0 :         struct dcerpc_winspool_AsyncEnumPorts_r_state *state =
   11080           0 :                 tevent_req_data(req,
   11081             :                 struct dcerpc_winspool_AsyncEnumPorts_r_state);
   11082           0 :         NTSTATUS status;
   11083             : 
   11084           0 :         if (tevent_req_is_nterror(req, &status)) {
   11085           0 :                 tevent_req_received(req);
   11086           0 :                 return status;
   11087             :         }
   11088             : 
   11089           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11090             : 
   11091           0 :         tevent_req_received(req);
   11092           0 :         return NT_STATUS_OK;
   11093             : }
   11094             : 
   11095           0 : NTSTATUS dcerpc_winspool_AsyncEnumPorts_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncEnumPorts *r)
   11096             : {
   11097           0 :         NTSTATUS status;
   11098             : 
   11099           0 :         status = dcerpc_binding_handle_call(h,
   11100             :                         NULL, &ndr_table_iremotewinspool,
   11101             :                         NDR_WINSPOOL_ASYNCENUMPORTS, mem_ctx, r);
   11102             : 
   11103           0 :         return status;
   11104             : }
   11105             : 
   11106             : struct dcerpc_winspool_AsyncEnumPorts_state {
   11107             :         struct winspool_AsyncEnumPorts orig;
   11108             :         struct winspool_AsyncEnumPorts tmp;
   11109             :         TALLOC_CTX *out_mem_ctx;
   11110             : };
   11111             : 
   11112             : static void dcerpc_winspool_AsyncEnumPorts_done(struct tevent_req *subreq);
   11113             : 
   11114           0 : struct tevent_req *dcerpc_winspool_AsyncEnumPorts_send(TALLOC_CTX *mem_ctx,
   11115             :                                                        struct tevent_context *ev,
   11116             :                                                        struct dcerpc_binding_handle *h,
   11117             :                                                        const char *_pName /* [in] [charset(UTF16),unique] */,
   11118             :                                                        uint32_t _Level /* [in]  */,
   11119             :                                                        uint8_t *_pPort /* [in,out] [size_is(cbBuf),unique] */,
   11120             :                                                        uint32_t _cbBuf /* [in]  */,
   11121             :                                                        uint32_t *_pcbNeeded /* [out] [ref] */,
   11122             :                                                        uint32_t *_pcReturned /* [out] [ref] */)
   11123             : {
   11124           0 :         struct tevent_req *req;
   11125           0 :         struct dcerpc_winspool_AsyncEnumPorts_state *state;
   11126           0 :         struct tevent_req *subreq;
   11127             : 
   11128           0 :         req = tevent_req_create(mem_ctx, &state,
   11129             :                                 struct dcerpc_winspool_AsyncEnumPorts_state);
   11130           0 :         if (req == NULL) {
   11131           0 :                 return NULL;
   11132             :         }
   11133           0 :         state->out_mem_ctx = NULL;
   11134             : 
   11135             :         /* In parameters */
   11136           0 :         state->orig.in.pName = _pName;
   11137           0 :         state->orig.in.Level = _Level;
   11138           0 :         state->orig.in.pPort = _pPort;
   11139           0 :         state->orig.in.cbBuf = _cbBuf;
   11140             : 
   11141             :         /* Out parameters */
   11142           0 :         state->orig.out.pPort = _pPort;
   11143           0 :         state->orig.out.pcbNeeded = _pcbNeeded;
   11144           0 :         state->orig.out.pcReturned = _pcReturned;
   11145             : 
   11146             :         /* Result */
   11147           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   11148             : 
   11149           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   11150             :                              "dcerpc_winspool_AsyncEnumPorts_out_memory");
   11151           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   11152           0 :                 return tevent_req_post(req, ev);
   11153             :         }
   11154             : 
   11155             :         /* make a temporary copy, that we pass to the dispatch function */
   11156           0 :         state->tmp = state->orig;
   11157             : 
   11158           0 :         subreq = dcerpc_winspool_AsyncEnumPorts_r_send(state, ev, h, &state->tmp);
   11159           0 :         if (tevent_req_nomem(subreq, req)) {
   11160           0 :                 return tevent_req_post(req, ev);
   11161             :         }
   11162           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumPorts_done, req);
   11163           0 :         return req;
   11164             : }
   11165             : 
   11166           0 : static void dcerpc_winspool_AsyncEnumPorts_done(struct tevent_req *subreq)
   11167             : {
   11168           0 :         struct tevent_req *req = tevent_req_callback_data(
   11169             :                 subreq, struct tevent_req);
   11170           0 :         struct dcerpc_winspool_AsyncEnumPorts_state *state = tevent_req_data(
   11171             :                 req, struct dcerpc_winspool_AsyncEnumPorts_state);
   11172           0 :         NTSTATUS status;
   11173           0 :         TALLOC_CTX *mem_ctx;
   11174             : 
   11175           0 :         if (state->out_mem_ctx) {
   11176           0 :                 mem_ctx = state->out_mem_ctx;
   11177             :         } else {
   11178           0 :                 mem_ctx = state;
   11179             :         }
   11180             : 
   11181           0 :         status = dcerpc_winspool_AsyncEnumPorts_r_recv(subreq, mem_ctx);
   11182           0 :         TALLOC_FREE(subreq);
   11183           0 :         if (tevent_req_nterror(req, status)) {
   11184           0 :                 return;
   11185             :         }
   11186             : 
   11187             :         /* Copy out parameters */
   11188           0 :         if (state->orig.out.pPort && state->tmp.out.pPort) {
   11189             :                 {
   11190           0 :                         size_t _copy_len_pPort;
   11191           0 :                         _copy_len_pPort = state->tmp.in.cbBuf;
   11192           0 :                         if (state->orig.out.pPort != state->tmp.out.pPort) {
   11193           0 :                                 memcpy(state->orig.out.pPort, state->tmp.out.pPort, _copy_len_pPort * sizeof(*state->orig.out.pPort));
   11194             :                         }
   11195             :                 }
   11196             :         }
   11197           0 :         *state->orig.out.pcbNeeded = *state->tmp.out.pcbNeeded;
   11198           0 :         *state->orig.out.pcReturned = *state->tmp.out.pcReturned;
   11199             : 
   11200             :         /* Copy result */
   11201           0 :         state->orig.out.result = state->tmp.out.result;
   11202             : 
   11203             :         /* Reset temporary structure */
   11204           0 :         NDR_ZERO_STRUCT(state->tmp);
   11205             : 
   11206           0 :         tevent_req_done(req);
   11207             : }
   11208             : 
   11209           0 : NTSTATUS dcerpc_winspool_AsyncEnumPorts_recv(struct tevent_req *req,
   11210             :                                              TALLOC_CTX *mem_ctx,
   11211             :                                              WERROR *result)
   11212             : {
   11213           0 :         struct dcerpc_winspool_AsyncEnumPorts_state *state = tevent_req_data(
   11214             :                 req, struct dcerpc_winspool_AsyncEnumPorts_state);
   11215           0 :         NTSTATUS status;
   11216             : 
   11217           0 :         if (tevent_req_is_nterror(req, &status)) {
   11218           0 :                 tevent_req_received(req);
   11219           0 :                 return status;
   11220             :         }
   11221             : 
   11222             :         /* Steal possible out parameters to the callers context */
   11223           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11224             : 
   11225             :         /* Return result */
   11226           0 :         *result = state->orig.out.result;
   11227             : 
   11228           0 :         tevent_req_received(req);
   11229           0 :         return NT_STATUS_OK;
   11230             : }
   11231             : 
   11232           0 : NTSTATUS dcerpc_winspool_AsyncEnumPorts(struct dcerpc_binding_handle *h,
   11233             :                                         TALLOC_CTX *mem_ctx,
   11234             :                                         const char *_pName /* [in] [charset(UTF16),unique] */,
   11235             :                                         uint32_t _Level /* [in]  */,
   11236             :                                         uint8_t *_pPort /* [in,out] [size_is(cbBuf),unique] */,
   11237             :                                         uint32_t _cbBuf /* [in]  */,
   11238             :                                         uint32_t *_pcbNeeded /* [out] [ref] */,
   11239             :                                         uint32_t *_pcReturned /* [out] [ref] */,
   11240             :                                         WERROR *result)
   11241             : {
   11242           0 :         struct winspool_AsyncEnumPorts r;
   11243           0 :         NTSTATUS status;
   11244             : 
   11245             :         /* In parameters */
   11246           0 :         r.in.pName = _pName;
   11247           0 :         r.in.Level = _Level;
   11248           0 :         r.in.pPort = _pPort;
   11249           0 :         r.in.cbBuf = _cbBuf;
   11250             : 
   11251             :         /* Out parameters */
   11252           0 :         r.out.pPort = _pPort;
   11253           0 :         r.out.pcbNeeded = _pcbNeeded;
   11254           0 :         r.out.pcReturned = _pcReturned;
   11255             : 
   11256             :         /* Result */
   11257           0 :         NDR_ZERO_STRUCT(r.out.result);
   11258             : 
   11259           0 :         status = dcerpc_winspool_AsyncEnumPorts_r(h, mem_ctx, &r);
   11260           0 :         if (!NT_STATUS_IS_OK(status)) {
   11261           0 :                 return status;
   11262             :         }
   11263             : 
   11264             :         /* Return variables */
   11265           0 :         if (_pPort && r.out.pPort) {
   11266             :                 {
   11267           0 :                         size_t _copy_len_pPort;
   11268           0 :                         _copy_len_pPort = r.in.cbBuf;
   11269           0 :                         if (_pPort != r.out.pPort) {
   11270           0 :                                 memcpy(_pPort, r.out.pPort, _copy_len_pPort * sizeof(*_pPort));
   11271             :                         }
   11272             :                 }
   11273             :         }
   11274           0 :         *_pcbNeeded = *r.out.pcbNeeded;
   11275           0 :         *_pcReturned = *r.out.pcReturned;
   11276             : 
   11277             :         /* Return result */
   11278           0 :         *result = r.out.result;
   11279             : 
   11280           0 :         return NT_STATUS_OK;
   11281             : }
   11282             : 
   11283             : struct dcerpc_winspool_AsyncEnumMonitors_r_state {
   11284             :         TALLOC_CTX *out_mem_ctx;
   11285             : };
   11286             : 
   11287             : static void dcerpc_winspool_AsyncEnumMonitors_r_done(struct tevent_req *subreq);
   11288             : 
   11289           0 : struct tevent_req *dcerpc_winspool_AsyncEnumMonitors_r_send(TALLOC_CTX *mem_ctx,
   11290             :         struct tevent_context *ev,
   11291             :         struct dcerpc_binding_handle *h,
   11292             :         struct winspool_AsyncEnumMonitors *r)
   11293             : {
   11294           0 :         struct tevent_req *req;
   11295           0 :         struct dcerpc_winspool_AsyncEnumMonitors_r_state *state;
   11296           0 :         struct tevent_req *subreq;
   11297             : 
   11298           0 :         req = tevent_req_create(mem_ctx, &state,
   11299             :                                 struct dcerpc_winspool_AsyncEnumMonitors_r_state);
   11300           0 :         if (req == NULL) {
   11301           0 :                 return NULL;
   11302             :         }
   11303             : 
   11304           0 :         state->out_mem_ctx = talloc_new(state);
   11305           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   11306           0 :                 return tevent_req_post(req, ev);
   11307             :         }
   11308             : 
   11309           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   11310             :                         NULL, &ndr_table_iremotewinspool,
   11311           0 :                         NDR_WINSPOOL_ASYNCENUMMONITORS, state->out_mem_ctx, r);
   11312           0 :         if (tevent_req_nomem(subreq, req)) {
   11313           0 :                 return tevent_req_post(req, ev);
   11314             :         }
   11315           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumMonitors_r_done, req);
   11316             : 
   11317           0 :         return req;
   11318             : }
   11319             : 
   11320           0 : static void dcerpc_winspool_AsyncEnumMonitors_r_done(struct tevent_req *subreq)
   11321             : {
   11322           0 :         struct tevent_req *req =
   11323           0 :                 tevent_req_callback_data(subreq,
   11324             :                 struct tevent_req);
   11325           0 :         NTSTATUS status;
   11326             : 
   11327           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   11328           0 :         TALLOC_FREE(subreq);
   11329           0 :         if (tevent_req_nterror(req, status)) {
   11330           0 :                 return;
   11331             :         }
   11332             : 
   11333           0 :         tevent_req_done(req);
   11334             : }
   11335             : 
   11336           0 : NTSTATUS dcerpc_winspool_AsyncEnumMonitors_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   11337             : {
   11338           0 :         struct dcerpc_winspool_AsyncEnumMonitors_r_state *state =
   11339           0 :                 tevent_req_data(req,
   11340             :                 struct dcerpc_winspool_AsyncEnumMonitors_r_state);
   11341           0 :         NTSTATUS status;
   11342             : 
   11343           0 :         if (tevent_req_is_nterror(req, &status)) {
   11344           0 :                 tevent_req_received(req);
   11345           0 :                 return status;
   11346             :         }
   11347             : 
   11348           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11349             : 
   11350           0 :         tevent_req_received(req);
   11351           0 :         return NT_STATUS_OK;
   11352             : }
   11353             : 
   11354           0 : NTSTATUS dcerpc_winspool_AsyncEnumMonitors_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncEnumMonitors *r)
   11355             : {
   11356           0 :         NTSTATUS status;
   11357             : 
   11358           0 :         status = dcerpc_binding_handle_call(h,
   11359             :                         NULL, &ndr_table_iremotewinspool,
   11360             :                         NDR_WINSPOOL_ASYNCENUMMONITORS, mem_ctx, r);
   11361             : 
   11362           0 :         return status;
   11363             : }
   11364             : 
   11365             : struct dcerpc_winspool_AsyncEnumMonitors_state {
   11366             :         struct winspool_AsyncEnumMonitors orig;
   11367             :         struct winspool_AsyncEnumMonitors tmp;
   11368             :         TALLOC_CTX *out_mem_ctx;
   11369             : };
   11370             : 
   11371             : static void dcerpc_winspool_AsyncEnumMonitors_done(struct tevent_req *subreq);
   11372             : 
   11373           0 : struct tevent_req *dcerpc_winspool_AsyncEnumMonitors_send(TALLOC_CTX *mem_ctx,
   11374             :                                                           struct tevent_context *ev,
   11375             :                                                           struct dcerpc_binding_handle *h,
   11376             :                                                           const char *_pName /* [in] [charset(UTF16),unique] */,
   11377             :                                                           uint32_t _Level /* [in]  */,
   11378             :                                                           uint8_t *_pMonitor /* [in,out] [size_is(cbBuf),unique] */,
   11379             :                                                           uint32_t _cbBuf /* [in]  */,
   11380             :                                                           uint32_t *_pcbNeeded /* [out] [ref] */,
   11381             :                                                           uint32_t *_pcReturned /* [out] [ref] */)
   11382             : {
   11383           0 :         struct tevent_req *req;
   11384           0 :         struct dcerpc_winspool_AsyncEnumMonitors_state *state;
   11385           0 :         struct tevent_req *subreq;
   11386             : 
   11387           0 :         req = tevent_req_create(mem_ctx, &state,
   11388             :                                 struct dcerpc_winspool_AsyncEnumMonitors_state);
   11389           0 :         if (req == NULL) {
   11390           0 :                 return NULL;
   11391             :         }
   11392           0 :         state->out_mem_ctx = NULL;
   11393             : 
   11394             :         /* In parameters */
   11395           0 :         state->orig.in.pName = _pName;
   11396           0 :         state->orig.in.Level = _Level;
   11397           0 :         state->orig.in.pMonitor = _pMonitor;
   11398           0 :         state->orig.in.cbBuf = _cbBuf;
   11399             : 
   11400             :         /* Out parameters */
   11401           0 :         state->orig.out.pMonitor = _pMonitor;
   11402           0 :         state->orig.out.pcbNeeded = _pcbNeeded;
   11403           0 :         state->orig.out.pcReturned = _pcReturned;
   11404             : 
   11405             :         /* Result */
   11406           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   11407             : 
   11408           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   11409             :                              "dcerpc_winspool_AsyncEnumMonitors_out_memory");
   11410           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   11411           0 :                 return tevent_req_post(req, ev);
   11412             :         }
   11413             : 
   11414             :         /* make a temporary copy, that we pass to the dispatch function */
   11415           0 :         state->tmp = state->orig;
   11416             : 
   11417           0 :         subreq = dcerpc_winspool_AsyncEnumMonitors_r_send(state, ev, h, &state->tmp);
   11418           0 :         if (tevent_req_nomem(subreq, req)) {
   11419           0 :                 return tevent_req_post(req, ev);
   11420             :         }
   11421           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumMonitors_done, req);
   11422           0 :         return req;
   11423             : }
   11424             : 
   11425           0 : static void dcerpc_winspool_AsyncEnumMonitors_done(struct tevent_req *subreq)
   11426             : {
   11427           0 :         struct tevent_req *req = tevent_req_callback_data(
   11428             :                 subreq, struct tevent_req);
   11429           0 :         struct dcerpc_winspool_AsyncEnumMonitors_state *state = tevent_req_data(
   11430             :                 req, struct dcerpc_winspool_AsyncEnumMonitors_state);
   11431           0 :         NTSTATUS status;
   11432           0 :         TALLOC_CTX *mem_ctx;
   11433             : 
   11434           0 :         if (state->out_mem_ctx) {
   11435           0 :                 mem_ctx = state->out_mem_ctx;
   11436             :         } else {
   11437           0 :                 mem_ctx = state;
   11438             :         }
   11439             : 
   11440           0 :         status = dcerpc_winspool_AsyncEnumMonitors_r_recv(subreq, mem_ctx);
   11441           0 :         TALLOC_FREE(subreq);
   11442           0 :         if (tevent_req_nterror(req, status)) {
   11443           0 :                 return;
   11444             :         }
   11445             : 
   11446             :         /* Copy out parameters */
   11447           0 :         if (state->orig.out.pMonitor && state->tmp.out.pMonitor) {
   11448             :                 {
   11449           0 :                         size_t _copy_len_pMonitor;
   11450           0 :                         _copy_len_pMonitor = state->tmp.in.cbBuf;
   11451           0 :                         if (state->orig.out.pMonitor != state->tmp.out.pMonitor) {
   11452           0 :                                 memcpy(state->orig.out.pMonitor, state->tmp.out.pMonitor, _copy_len_pMonitor * sizeof(*state->orig.out.pMonitor));
   11453             :                         }
   11454             :                 }
   11455             :         }
   11456           0 :         *state->orig.out.pcbNeeded = *state->tmp.out.pcbNeeded;
   11457           0 :         *state->orig.out.pcReturned = *state->tmp.out.pcReturned;
   11458             : 
   11459             :         /* Copy result */
   11460           0 :         state->orig.out.result = state->tmp.out.result;
   11461             : 
   11462             :         /* Reset temporary structure */
   11463           0 :         NDR_ZERO_STRUCT(state->tmp);
   11464             : 
   11465           0 :         tevent_req_done(req);
   11466             : }
   11467             : 
   11468           0 : NTSTATUS dcerpc_winspool_AsyncEnumMonitors_recv(struct tevent_req *req,
   11469             :                                                 TALLOC_CTX *mem_ctx,
   11470             :                                                 WERROR *result)
   11471             : {
   11472           0 :         struct dcerpc_winspool_AsyncEnumMonitors_state *state = tevent_req_data(
   11473             :                 req, struct dcerpc_winspool_AsyncEnumMonitors_state);
   11474           0 :         NTSTATUS status;
   11475             : 
   11476           0 :         if (tevent_req_is_nterror(req, &status)) {
   11477           0 :                 tevent_req_received(req);
   11478           0 :                 return status;
   11479             :         }
   11480             : 
   11481             :         /* Steal possible out parameters to the callers context */
   11482           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11483             : 
   11484             :         /* Return result */
   11485           0 :         *result = state->orig.out.result;
   11486             : 
   11487           0 :         tevent_req_received(req);
   11488           0 :         return NT_STATUS_OK;
   11489             : }
   11490             : 
   11491           0 : NTSTATUS dcerpc_winspool_AsyncEnumMonitors(struct dcerpc_binding_handle *h,
   11492             :                                            TALLOC_CTX *mem_ctx,
   11493             :                                            const char *_pName /* [in] [charset(UTF16),unique] */,
   11494             :                                            uint32_t _Level /* [in]  */,
   11495             :                                            uint8_t *_pMonitor /* [in,out] [size_is(cbBuf),unique] */,
   11496             :                                            uint32_t _cbBuf /* [in]  */,
   11497             :                                            uint32_t *_pcbNeeded /* [out] [ref] */,
   11498             :                                            uint32_t *_pcReturned /* [out] [ref] */,
   11499             :                                            WERROR *result)
   11500             : {
   11501           0 :         struct winspool_AsyncEnumMonitors r;
   11502           0 :         NTSTATUS status;
   11503             : 
   11504             :         /* In parameters */
   11505           0 :         r.in.pName = _pName;
   11506           0 :         r.in.Level = _Level;
   11507           0 :         r.in.pMonitor = _pMonitor;
   11508           0 :         r.in.cbBuf = _cbBuf;
   11509             : 
   11510             :         /* Out parameters */
   11511           0 :         r.out.pMonitor = _pMonitor;
   11512           0 :         r.out.pcbNeeded = _pcbNeeded;
   11513           0 :         r.out.pcReturned = _pcReturned;
   11514             : 
   11515             :         /* Result */
   11516           0 :         NDR_ZERO_STRUCT(r.out.result);
   11517             : 
   11518           0 :         status = dcerpc_winspool_AsyncEnumMonitors_r(h, mem_ctx, &r);
   11519           0 :         if (!NT_STATUS_IS_OK(status)) {
   11520           0 :                 return status;
   11521             :         }
   11522             : 
   11523             :         /* Return variables */
   11524           0 :         if (_pMonitor && r.out.pMonitor) {
   11525             :                 {
   11526           0 :                         size_t _copy_len_pMonitor;
   11527           0 :                         _copy_len_pMonitor = r.in.cbBuf;
   11528           0 :                         if (_pMonitor != r.out.pMonitor) {
   11529           0 :                                 memcpy(_pMonitor, r.out.pMonitor, _copy_len_pMonitor * sizeof(*_pMonitor));
   11530             :                         }
   11531             :                 }
   11532             :         }
   11533           0 :         *_pcbNeeded = *r.out.pcbNeeded;
   11534           0 :         *_pcReturned = *r.out.pcReturned;
   11535             : 
   11536             :         /* Return result */
   11537           0 :         *result = r.out.result;
   11538             : 
   11539           0 :         return NT_STATUS_OK;
   11540             : }
   11541             : 
   11542             : struct dcerpc_winspool_AsyncAddPort_r_state {
   11543             :         TALLOC_CTX *out_mem_ctx;
   11544             : };
   11545             : 
   11546             : static void dcerpc_winspool_AsyncAddPort_r_done(struct tevent_req *subreq);
   11547             : 
   11548           0 : struct tevent_req *dcerpc_winspool_AsyncAddPort_r_send(TALLOC_CTX *mem_ctx,
   11549             :         struct tevent_context *ev,
   11550             :         struct dcerpc_binding_handle *h,
   11551             :         struct winspool_AsyncAddPort *r)
   11552             : {
   11553           0 :         struct tevent_req *req;
   11554           0 :         struct dcerpc_winspool_AsyncAddPort_r_state *state;
   11555           0 :         struct tevent_req *subreq;
   11556             : 
   11557           0 :         req = tevent_req_create(mem_ctx, &state,
   11558             :                                 struct dcerpc_winspool_AsyncAddPort_r_state);
   11559           0 :         if (req == NULL) {
   11560           0 :                 return NULL;
   11561             :         }
   11562             : 
   11563           0 :         state->out_mem_ctx = NULL;
   11564             : 
   11565           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   11566             :                         NULL, &ndr_table_iremotewinspool,
   11567             :                         NDR_WINSPOOL_ASYNCADDPORT, state, r);
   11568           0 :         if (tevent_req_nomem(subreq, req)) {
   11569           0 :                 return tevent_req_post(req, ev);
   11570             :         }
   11571           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncAddPort_r_done, req);
   11572             : 
   11573           0 :         return req;
   11574             : }
   11575             : 
   11576           0 : static void dcerpc_winspool_AsyncAddPort_r_done(struct tevent_req *subreq)
   11577             : {
   11578           0 :         struct tevent_req *req =
   11579           0 :                 tevent_req_callback_data(subreq,
   11580             :                 struct tevent_req);
   11581           0 :         NTSTATUS status;
   11582             : 
   11583           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   11584           0 :         TALLOC_FREE(subreq);
   11585           0 :         if (tevent_req_nterror(req, status)) {
   11586           0 :                 return;
   11587             :         }
   11588             : 
   11589           0 :         tevent_req_done(req);
   11590             : }
   11591             : 
   11592           0 : NTSTATUS dcerpc_winspool_AsyncAddPort_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   11593             : {
   11594           0 :         struct dcerpc_winspool_AsyncAddPort_r_state *state =
   11595           0 :                 tevent_req_data(req,
   11596             :                 struct dcerpc_winspool_AsyncAddPort_r_state);
   11597           0 :         NTSTATUS status;
   11598             : 
   11599           0 :         if (tevent_req_is_nterror(req, &status)) {
   11600           0 :                 tevent_req_received(req);
   11601           0 :                 return status;
   11602             :         }
   11603             : 
   11604           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11605             : 
   11606           0 :         tevent_req_received(req);
   11607           0 :         return NT_STATUS_OK;
   11608             : }
   11609             : 
   11610           0 : NTSTATUS dcerpc_winspool_AsyncAddPort_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncAddPort *r)
   11611             : {
   11612           0 :         NTSTATUS status;
   11613             : 
   11614           0 :         status = dcerpc_binding_handle_call(h,
   11615             :                         NULL, &ndr_table_iremotewinspool,
   11616             :                         NDR_WINSPOOL_ASYNCADDPORT, mem_ctx, r);
   11617             : 
   11618           0 :         return status;
   11619             : }
   11620             : 
   11621             : struct dcerpc_winspool_AsyncAddPort_state {
   11622             :         struct winspool_AsyncAddPort orig;
   11623             :         struct winspool_AsyncAddPort tmp;
   11624             :         TALLOC_CTX *out_mem_ctx;
   11625             : };
   11626             : 
   11627             : static void dcerpc_winspool_AsyncAddPort_done(struct tevent_req *subreq);
   11628             : 
   11629           0 : struct tevent_req *dcerpc_winspool_AsyncAddPort_send(TALLOC_CTX *mem_ctx,
   11630             :                                                      struct tevent_context *ev,
   11631             :                                                      struct dcerpc_binding_handle *h,
   11632             :                                                      const char *_pName /* [in] [charset(UTF16),unique] */,
   11633             :                                                      struct spoolss_SetPortInfoContainer *_pPortContainer /* [in] [ref] */,
   11634             :                                                      struct spoolss_PortVarContainer *_pPortVarContainer /* [in] [ref] */,
   11635             :                                                      const char *_pMonitorName /* [in] [charset(UTF16),ref] */)
   11636             : {
   11637           0 :         struct tevent_req *req;
   11638           0 :         struct dcerpc_winspool_AsyncAddPort_state *state;
   11639           0 :         struct tevent_req *subreq;
   11640             : 
   11641           0 :         req = tevent_req_create(mem_ctx, &state,
   11642             :                                 struct dcerpc_winspool_AsyncAddPort_state);
   11643           0 :         if (req == NULL) {
   11644           0 :                 return NULL;
   11645             :         }
   11646           0 :         state->out_mem_ctx = NULL;
   11647             : 
   11648             :         /* In parameters */
   11649           0 :         state->orig.in.pName = _pName;
   11650           0 :         state->orig.in.pPortContainer = _pPortContainer;
   11651           0 :         state->orig.in.pPortVarContainer = _pPortVarContainer;
   11652           0 :         state->orig.in.pMonitorName = _pMonitorName;
   11653             : 
   11654             :         /* Out parameters */
   11655             : 
   11656             :         /* Result */
   11657           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   11658             : 
   11659             :         /* make a temporary copy, that we pass to the dispatch function */
   11660           0 :         state->tmp = state->orig;
   11661             : 
   11662           0 :         subreq = dcerpc_winspool_AsyncAddPort_r_send(state, ev, h, &state->tmp);
   11663           0 :         if (tevent_req_nomem(subreq, req)) {
   11664           0 :                 return tevent_req_post(req, ev);
   11665             :         }
   11666           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncAddPort_done, req);
   11667           0 :         return req;
   11668             : }
   11669             : 
   11670           0 : static void dcerpc_winspool_AsyncAddPort_done(struct tevent_req *subreq)
   11671             : {
   11672           0 :         struct tevent_req *req = tevent_req_callback_data(
   11673             :                 subreq, struct tevent_req);
   11674           0 :         struct dcerpc_winspool_AsyncAddPort_state *state = tevent_req_data(
   11675             :                 req, struct dcerpc_winspool_AsyncAddPort_state);
   11676           0 :         NTSTATUS status;
   11677           0 :         TALLOC_CTX *mem_ctx;
   11678             : 
   11679           0 :         if (state->out_mem_ctx) {
   11680           0 :                 mem_ctx = state->out_mem_ctx;
   11681             :         } else {
   11682           0 :                 mem_ctx = state;
   11683             :         }
   11684             : 
   11685           0 :         status = dcerpc_winspool_AsyncAddPort_r_recv(subreq, mem_ctx);
   11686           0 :         TALLOC_FREE(subreq);
   11687           0 :         if (tevent_req_nterror(req, status)) {
   11688           0 :                 return;
   11689             :         }
   11690             : 
   11691             :         /* Copy out parameters */
   11692             : 
   11693             :         /* Copy result */
   11694           0 :         state->orig.out.result = state->tmp.out.result;
   11695             : 
   11696             :         /* Reset temporary structure */
   11697           0 :         NDR_ZERO_STRUCT(state->tmp);
   11698             : 
   11699           0 :         tevent_req_done(req);
   11700             : }
   11701             : 
   11702           0 : NTSTATUS dcerpc_winspool_AsyncAddPort_recv(struct tevent_req *req,
   11703             :                                            TALLOC_CTX *mem_ctx,
   11704             :                                            WERROR *result)
   11705             : {
   11706           0 :         struct dcerpc_winspool_AsyncAddPort_state *state = tevent_req_data(
   11707             :                 req, struct dcerpc_winspool_AsyncAddPort_state);
   11708           0 :         NTSTATUS status;
   11709             : 
   11710           0 :         if (tevent_req_is_nterror(req, &status)) {
   11711           0 :                 tevent_req_received(req);
   11712           0 :                 return status;
   11713             :         }
   11714             : 
   11715             :         /* Steal possible out parameters to the callers context */
   11716           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11717             : 
   11718             :         /* Return result */
   11719           0 :         *result = state->orig.out.result;
   11720             : 
   11721           0 :         tevent_req_received(req);
   11722           0 :         return NT_STATUS_OK;
   11723             : }
   11724             : 
   11725           0 : NTSTATUS dcerpc_winspool_AsyncAddPort(struct dcerpc_binding_handle *h,
   11726             :                                       TALLOC_CTX *mem_ctx,
   11727             :                                       const char *_pName /* [in] [charset(UTF16),unique] */,
   11728             :                                       struct spoolss_SetPortInfoContainer *_pPortContainer /* [in] [ref] */,
   11729             :                                       struct spoolss_PortVarContainer *_pPortVarContainer /* [in] [ref] */,
   11730             :                                       const char *_pMonitorName /* [in] [charset(UTF16),ref] */,
   11731             :                                       WERROR *result)
   11732             : {
   11733           0 :         struct winspool_AsyncAddPort r;
   11734           0 :         NTSTATUS status;
   11735             : 
   11736             :         /* In parameters */
   11737           0 :         r.in.pName = _pName;
   11738           0 :         r.in.pPortContainer = _pPortContainer;
   11739           0 :         r.in.pPortVarContainer = _pPortVarContainer;
   11740           0 :         r.in.pMonitorName = _pMonitorName;
   11741             : 
   11742             :         /* Out parameters */
   11743             : 
   11744             :         /* Result */
   11745           0 :         NDR_ZERO_STRUCT(r.out.result);
   11746             : 
   11747           0 :         status = dcerpc_winspool_AsyncAddPort_r(h, mem_ctx, &r);
   11748           0 :         if (!NT_STATUS_IS_OK(status)) {
   11749           0 :                 return status;
   11750             :         }
   11751             : 
   11752             :         /* Return variables */
   11753             : 
   11754             :         /* Return result */
   11755           0 :         *result = r.out.result;
   11756             : 
   11757           0 :         return NT_STATUS_OK;
   11758             : }
   11759             : 
   11760             : struct dcerpc_winspool_AsyncSetPort_r_state {
   11761             :         TALLOC_CTX *out_mem_ctx;
   11762             : };
   11763             : 
   11764             : static void dcerpc_winspool_AsyncSetPort_r_done(struct tevent_req *subreq);
   11765             : 
   11766           0 : struct tevent_req *dcerpc_winspool_AsyncSetPort_r_send(TALLOC_CTX *mem_ctx,
   11767             :         struct tevent_context *ev,
   11768             :         struct dcerpc_binding_handle *h,
   11769             :         struct winspool_AsyncSetPort *r)
   11770             : {
   11771           0 :         struct tevent_req *req;
   11772           0 :         struct dcerpc_winspool_AsyncSetPort_r_state *state;
   11773           0 :         struct tevent_req *subreq;
   11774             : 
   11775           0 :         req = tevent_req_create(mem_ctx, &state,
   11776             :                                 struct dcerpc_winspool_AsyncSetPort_r_state);
   11777           0 :         if (req == NULL) {
   11778           0 :                 return NULL;
   11779             :         }
   11780             : 
   11781           0 :         state->out_mem_ctx = NULL;
   11782             : 
   11783           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   11784             :                         NULL, &ndr_table_iremotewinspool,
   11785             :                         NDR_WINSPOOL_ASYNCSETPORT, state, r);
   11786           0 :         if (tevent_req_nomem(subreq, req)) {
   11787           0 :                 return tevent_req_post(req, ev);
   11788             :         }
   11789           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncSetPort_r_done, req);
   11790             : 
   11791           0 :         return req;
   11792             : }
   11793             : 
   11794           0 : static void dcerpc_winspool_AsyncSetPort_r_done(struct tevent_req *subreq)
   11795             : {
   11796           0 :         struct tevent_req *req =
   11797           0 :                 tevent_req_callback_data(subreq,
   11798             :                 struct tevent_req);
   11799           0 :         NTSTATUS status;
   11800             : 
   11801           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   11802           0 :         TALLOC_FREE(subreq);
   11803           0 :         if (tevent_req_nterror(req, status)) {
   11804           0 :                 return;
   11805             :         }
   11806             : 
   11807           0 :         tevent_req_done(req);
   11808             : }
   11809             : 
   11810           0 : NTSTATUS dcerpc_winspool_AsyncSetPort_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   11811             : {
   11812           0 :         struct dcerpc_winspool_AsyncSetPort_r_state *state =
   11813           0 :                 tevent_req_data(req,
   11814             :                 struct dcerpc_winspool_AsyncSetPort_r_state);
   11815           0 :         NTSTATUS status;
   11816             : 
   11817           0 :         if (tevent_req_is_nterror(req, &status)) {
   11818           0 :                 tevent_req_received(req);
   11819           0 :                 return status;
   11820             :         }
   11821             : 
   11822           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11823             : 
   11824           0 :         tevent_req_received(req);
   11825           0 :         return NT_STATUS_OK;
   11826             : }
   11827             : 
   11828           0 : NTSTATUS dcerpc_winspool_AsyncSetPort_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncSetPort *r)
   11829             : {
   11830           0 :         NTSTATUS status;
   11831             : 
   11832           0 :         status = dcerpc_binding_handle_call(h,
   11833             :                         NULL, &ndr_table_iremotewinspool,
   11834             :                         NDR_WINSPOOL_ASYNCSETPORT, mem_ctx, r);
   11835             : 
   11836           0 :         return status;
   11837             : }
   11838             : 
   11839             : struct dcerpc_winspool_AsyncSetPort_state {
   11840             :         struct winspool_AsyncSetPort orig;
   11841             :         struct winspool_AsyncSetPort tmp;
   11842             :         TALLOC_CTX *out_mem_ctx;
   11843             : };
   11844             : 
   11845             : static void dcerpc_winspool_AsyncSetPort_done(struct tevent_req *subreq);
   11846             : 
   11847           0 : struct tevent_req *dcerpc_winspool_AsyncSetPort_send(TALLOC_CTX *mem_ctx,
   11848             :                                                      struct tevent_context *ev,
   11849             :                                                      struct dcerpc_binding_handle *h,
   11850             :                                                      const char *_pName /* [in] [charset(UTF16),unique] */,
   11851             :                                                      const char *_pPortName /* [in] [charset(UTF16),unique] */,
   11852             :                                                      struct spoolss_SetPortInfoContainer *_pPortContainer /* [in] [ref] */)
   11853             : {
   11854           0 :         struct tevent_req *req;
   11855           0 :         struct dcerpc_winspool_AsyncSetPort_state *state;
   11856           0 :         struct tevent_req *subreq;
   11857             : 
   11858           0 :         req = tevent_req_create(mem_ctx, &state,
   11859             :                                 struct dcerpc_winspool_AsyncSetPort_state);
   11860           0 :         if (req == NULL) {
   11861           0 :                 return NULL;
   11862             :         }
   11863           0 :         state->out_mem_ctx = NULL;
   11864             : 
   11865             :         /* In parameters */
   11866           0 :         state->orig.in.pName = _pName;
   11867           0 :         state->orig.in.pPortName = _pPortName;
   11868           0 :         state->orig.in.pPortContainer = _pPortContainer;
   11869             : 
   11870             :         /* Out parameters */
   11871             : 
   11872             :         /* Result */
   11873           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   11874             : 
   11875             :         /* make a temporary copy, that we pass to the dispatch function */
   11876           0 :         state->tmp = state->orig;
   11877             : 
   11878           0 :         subreq = dcerpc_winspool_AsyncSetPort_r_send(state, ev, h, &state->tmp);
   11879           0 :         if (tevent_req_nomem(subreq, req)) {
   11880           0 :                 return tevent_req_post(req, ev);
   11881             :         }
   11882           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncSetPort_done, req);
   11883           0 :         return req;
   11884             : }
   11885             : 
   11886           0 : static void dcerpc_winspool_AsyncSetPort_done(struct tevent_req *subreq)
   11887             : {
   11888           0 :         struct tevent_req *req = tevent_req_callback_data(
   11889             :                 subreq, struct tevent_req);
   11890           0 :         struct dcerpc_winspool_AsyncSetPort_state *state = tevent_req_data(
   11891             :                 req, struct dcerpc_winspool_AsyncSetPort_state);
   11892           0 :         NTSTATUS status;
   11893           0 :         TALLOC_CTX *mem_ctx;
   11894             : 
   11895           0 :         if (state->out_mem_ctx) {
   11896           0 :                 mem_ctx = state->out_mem_ctx;
   11897             :         } else {
   11898           0 :                 mem_ctx = state;
   11899             :         }
   11900             : 
   11901           0 :         status = dcerpc_winspool_AsyncSetPort_r_recv(subreq, mem_ctx);
   11902           0 :         TALLOC_FREE(subreq);
   11903           0 :         if (tevent_req_nterror(req, status)) {
   11904           0 :                 return;
   11905             :         }
   11906             : 
   11907             :         /* Copy out parameters */
   11908             : 
   11909             :         /* Copy result */
   11910           0 :         state->orig.out.result = state->tmp.out.result;
   11911             : 
   11912             :         /* Reset temporary structure */
   11913           0 :         NDR_ZERO_STRUCT(state->tmp);
   11914             : 
   11915           0 :         tevent_req_done(req);
   11916             : }
   11917             : 
   11918           0 : NTSTATUS dcerpc_winspool_AsyncSetPort_recv(struct tevent_req *req,
   11919             :                                            TALLOC_CTX *mem_ctx,
   11920             :                                            WERROR *result)
   11921             : {
   11922           0 :         struct dcerpc_winspool_AsyncSetPort_state *state = tevent_req_data(
   11923             :                 req, struct dcerpc_winspool_AsyncSetPort_state);
   11924           0 :         NTSTATUS status;
   11925             : 
   11926           0 :         if (tevent_req_is_nterror(req, &status)) {
   11927           0 :                 tevent_req_received(req);
   11928           0 :                 return status;
   11929             :         }
   11930             : 
   11931             :         /* Steal possible out parameters to the callers context */
   11932           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11933             : 
   11934             :         /* Return result */
   11935           0 :         *result = state->orig.out.result;
   11936             : 
   11937           0 :         tevent_req_received(req);
   11938           0 :         return NT_STATUS_OK;
   11939             : }
   11940             : 
   11941           0 : NTSTATUS dcerpc_winspool_AsyncSetPort(struct dcerpc_binding_handle *h,
   11942             :                                       TALLOC_CTX *mem_ctx,
   11943             :                                       const char *_pName /* [in] [charset(UTF16),unique] */,
   11944             :                                       const char *_pPortName /* [in] [charset(UTF16),unique] */,
   11945             :                                       struct spoolss_SetPortInfoContainer *_pPortContainer /* [in] [ref] */,
   11946             :                                       WERROR *result)
   11947             : {
   11948           0 :         struct winspool_AsyncSetPort r;
   11949           0 :         NTSTATUS status;
   11950             : 
   11951             :         /* In parameters */
   11952           0 :         r.in.pName = _pName;
   11953           0 :         r.in.pPortName = _pPortName;
   11954           0 :         r.in.pPortContainer = _pPortContainer;
   11955             : 
   11956             :         /* Out parameters */
   11957             : 
   11958             :         /* Result */
   11959           0 :         NDR_ZERO_STRUCT(r.out.result);
   11960             : 
   11961           0 :         status = dcerpc_winspool_AsyncSetPort_r(h, mem_ctx, &r);
   11962           0 :         if (!NT_STATUS_IS_OK(status)) {
   11963           0 :                 return status;
   11964             :         }
   11965             : 
   11966             :         /* Return variables */
   11967             : 
   11968             :         /* Return result */
   11969           0 :         *result = r.out.result;
   11970             : 
   11971           0 :         return NT_STATUS_OK;
   11972             : }
   11973             : 
   11974             : struct dcerpc_winspool_AsyncAddMonitor_r_state {
   11975             :         TALLOC_CTX *out_mem_ctx;
   11976             : };
   11977             : 
   11978             : static void dcerpc_winspool_AsyncAddMonitor_r_done(struct tevent_req *subreq);
   11979             : 
   11980           0 : struct tevent_req *dcerpc_winspool_AsyncAddMonitor_r_send(TALLOC_CTX *mem_ctx,
   11981             :         struct tevent_context *ev,
   11982             :         struct dcerpc_binding_handle *h,
   11983             :         struct winspool_AsyncAddMonitor *r)
   11984             : {
   11985           0 :         struct tevent_req *req;
   11986           0 :         struct dcerpc_winspool_AsyncAddMonitor_r_state *state;
   11987           0 :         struct tevent_req *subreq;
   11988             : 
   11989           0 :         req = tevent_req_create(mem_ctx, &state,
   11990             :                                 struct dcerpc_winspool_AsyncAddMonitor_r_state);
   11991           0 :         if (req == NULL) {
   11992           0 :                 return NULL;
   11993             :         }
   11994             : 
   11995           0 :         state->out_mem_ctx = NULL;
   11996             : 
   11997           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   11998             :                         NULL, &ndr_table_iremotewinspool,
   11999             :                         NDR_WINSPOOL_ASYNCADDMONITOR, state, r);
   12000           0 :         if (tevent_req_nomem(subreq, req)) {
   12001           0 :                 return tevent_req_post(req, ev);
   12002             :         }
   12003           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncAddMonitor_r_done, req);
   12004             : 
   12005           0 :         return req;
   12006             : }
   12007             : 
   12008           0 : static void dcerpc_winspool_AsyncAddMonitor_r_done(struct tevent_req *subreq)
   12009             : {
   12010           0 :         struct tevent_req *req =
   12011           0 :                 tevent_req_callback_data(subreq,
   12012             :                 struct tevent_req);
   12013           0 :         NTSTATUS status;
   12014             : 
   12015           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   12016           0 :         TALLOC_FREE(subreq);
   12017           0 :         if (tevent_req_nterror(req, status)) {
   12018           0 :                 return;
   12019             :         }
   12020             : 
   12021           0 :         tevent_req_done(req);
   12022             : }
   12023             : 
   12024           0 : NTSTATUS dcerpc_winspool_AsyncAddMonitor_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   12025             : {
   12026           0 :         struct dcerpc_winspool_AsyncAddMonitor_r_state *state =
   12027           0 :                 tevent_req_data(req,
   12028             :                 struct dcerpc_winspool_AsyncAddMonitor_r_state);
   12029           0 :         NTSTATUS status;
   12030             : 
   12031           0 :         if (tevent_req_is_nterror(req, &status)) {
   12032           0 :                 tevent_req_received(req);
   12033           0 :                 return status;
   12034             :         }
   12035             : 
   12036           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12037             : 
   12038           0 :         tevent_req_received(req);
   12039           0 :         return NT_STATUS_OK;
   12040             : }
   12041             : 
   12042           0 : NTSTATUS dcerpc_winspool_AsyncAddMonitor_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncAddMonitor *r)
   12043             : {
   12044           0 :         NTSTATUS status;
   12045             : 
   12046           0 :         status = dcerpc_binding_handle_call(h,
   12047             :                         NULL, &ndr_table_iremotewinspool,
   12048             :                         NDR_WINSPOOL_ASYNCADDMONITOR, mem_ctx, r);
   12049             : 
   12050           0 :         return status;
   12051             : }
   12052             : 
   12053             : struct dcerpc_winspool_AsyncAddMonitor_state {
   12054             :         struct winspool_AsyncAddMonitor orig;
   12055             :         struct winspool_AsyncAddMonitor tmp;
   12056             :         TALLOC_CTX *out_mem_ctx;
   12057             : };
   12058             : 
   12059             : static void dcerpc_winspool_AsyncAddMonitor_done(struct tevent_req *subreq);
   12060             : 
   12061           0 : struct tevent_req *dcerpc_winspool_AsyncAddMonitor_send(TALLOC_CTX *mem_ctx,
   12062             :                                                         struct tevent_context *ev,
   12063             :                                                         struct dcerpc_binding_handle *h,
   12064             :                                                         const char *_Name /* [in] [charset(UTF16),unique] */,
   12065             :                                                         struct spoolss_MonitorContainer *_pMonitorContainer /* [in] [ref] */)
   12066             : {
   12067           0 :         struct tevent_req *req;
   12068           0 :         struct dcerpc_winspool_AsyncAddMonitor_state *state;
   12069           0 :         struct tevent_req *subreq;
   12070             : 
   12071           0 :         req = tevent_req_create(mem_ctx, &state,
   12072             :                                 struct dcerpc_winspool_AsyncAddMonitor_state);
   12073           0 :         if (req == NULL) {
   12074           0 :                 return NULL;
   12075             :         }
   12076           0 :         state->out_mem_ctx = NULL;
   12077             : 
   12078             :         /* In parameters */
   12079           0 :         state->orig.in.Name = _Name;
   12080           0 :         state->orig.in.pMonitorContainer = _pMonitorContainer;
   12081             : 
   12082             :         /* Out parameters */
   12083             : 
   12084             :         /* Result */
   12085           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   12086             : 
   12087             :         /* make a temporary copy, that we pass to the dispatch function */
   12088           0 :         state->tmp = state->orig;
   12089             : 
   12090           0 :         subreq = dcerpc_winspool_AsyncAddMonitor_r_send(state, ev, h, &state->tmp);
   12091           0 :         if (tevent_req_nomem(subreq, req)) {
   12092           0 :                 return tevent_req_post(req, ev);
   12093             :         }
   12094           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncAddMonitor_done, req);
   12095           0 :         return req;
   12096             : }
   12097             : 
   12098           0 : static void dcerpc_winspool_AsyncAddMonitor_done(struct tevent_req *subreq)
   12099             : {
   12100           0 :         struct tevent_req *req = tevent_req_callback_data(
   12101             :                 subreq, struct tevent_req);
   12102           0 :         struct dcerpc_winspool_AsyncAddMonitor_state *state = tevent_req_data(
   12103             :                 req, struct dcerpc_winspool_AsyncAddMonitor_state);
   12104           0 :         NTSTATUS status;
   12105           0 :         TALLOC_CTX *mem_ctx;
   12106             : 
   12107           0 :         if (state->out_mem_ctx) {
   12108           0 :                 mem_ctx = state->out_mem_ctx;
   12109             :         } else {
   12110           0 :                 mem_ctx = state;
   12111             :         }
   12112             : 
   12113           0 :         status = dcerpc_winspool_AsyncAddMonitor_r_recv(subreq, mem_ctx);
   12114           0 :         TALLOC_FREE(subreq);
   12115           0 :         if (tevent_req_nterror(req, status)) {
   12116           0 :                 return;
   12117             :         }
   12118             : 
   12119             :         /* Copy out parameters */
   12120             : 
   12121             :         /* Copy result */
   12122           0 :         state->orig.out.result = state->tmp.out.result;
   12123             : 
   12124             :         /* Reset temporary structure */
   12125           0 :         NDR_ZERO_STRUCT(state->tmp);
   12126             : 
   12127           0 :         tevent_req_done(req);
   12128             : }
   12129             : 
   12130           0 : NTSTATUS dcerpc_winspool_AsyncAddMonitor_recv(struct tevent_req *req,
   12131             :                                               TALLOC_CTX *mem_ctx,
   12132             :                                               WERROR *result)
   12133             : {
   12134           0 :         struct dcerpc_winspool_AsyncAddMonitor_state *state = tevent_req_data(
   12135             :                 req, struct dcerpc_winspool_AsyncAddMonitor_state);
   12136           0 :         NTSTATUS status;
   12137             : 
   12138           0 :         if (tevent_req_is_nterror(req, &status)) {
   12139           0 :                 tevent_req_received(req);
   12140           0 :                 return status;
   12141             :         }
   12142             : 
   12143             :         /* Steal possible out parameters to the callers context */
   12144           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12145             : 
   12146             :         /* Return result */
   12147           0 :         *result = state->orig.out.result;
   12148             : 
   12149           0 :         tevent_req_received(req);
   12150           0 :         return NT_STATUS_OK;
   12151             : }
   12152             : 
   12153           0 : NTSTATUS dcerpc_winspool_AsyncAddMonitor(struct dcerpc_binding_handle *h,
   12154             :                                          TALLOC_CTX *mem_ctx,
   12155             :                                          const char *_Name /* [in] [charset(UTF16),unique] */,
   12156             :                                          struct spoolss_MonitorContainer *_pMonitorContainer /* [in] [ref] */,
   12157             :                                          WERROR *result)
   12158             : {
   12159           0 :         struct winspool_AsyncAddMonitor r;
   12160           0 :         NTSTATUS status;
   12161             : 
   12162             :         /* In parameters */
   12163           0 :         r.in.Name = _Name;
   12164           0 :         r.in.pMonitorContainer = _pMonitorContainer;
   12165             : 
   12166             :         /* Out parameters */
   12167             : 
   12168             :         /* Result */
   12169           0 :         NDR_ZERO_STRUCT(r.out.result);
   12170             : 
   12171           0 :         status = dcerpc_winspool_AsyncAddMonitor_r(h, mem_ctx, &r);
   12172           0 :         if (!NT_STATUS_IS_OK(status)) {
   12173           0 :                 return status;
   12174             :         }
   12175             : 
   12176             :         /* Return variables */
   12177             : 
   12178             :         /* Return result */
   12179           0 :         *result = r.out.result;
   12180             : 
   12181           0 :         return NT_STATUS_OK;
   12182             : }
   12183             : 
   12184             : struct dcerpc_winspool_AsyncDeleteMonitor_r_state {
   12185             :         TALLOC_CTX *out_mem_ctx;
   12186             : };
   12187             : 
   12188             : static void dcerpc_winspool_AsyncDeleteMonitor_r_done(struct tevent_req *subreq);
   12189             : 
   12190           0 : struct tevent_req *dcerpc_winspool_AsyncDeleteMonitor_r_send(TALLOC_CTX *mem_ctx,
   12191             :         struct tevent_context *ev,
   12192             :         struct dcerpc_binding_handle *h,
   12193             :         struct winspool_AsyncDeleteMonitor *r)
   12194             : {
   12195           0 :         struct tevent_req *req;
   12196           0 :         struct dcerpc_winspool_AsyncDeleteMonitor_r_state *state;
   12197           0 :         struct tevent_req *subreq;
   12198             : 
   12199           0 :         req = tevent_req_create(mem_ctx, &state,
   12200             :                                 struct dcerpc_winspool_AsyncDeleteMonitor_r_state);
   12201           0 :         if (req == NULL) {
   12202           0 :                 return NULL;
   12203             :         }
   12204             : 
   12205           0 :         state->out_mem_ctx = NULL;
   12206             : 
   12207           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   12208             :                         NULL, &ndr_table_iremotewinspool,
   12209             :                         NDR_WINSPOOL_ASYNCDELETEMONITOR, state, r);
   12210           0 :         if (tevent_req_nomem(subreq, req)) {
   12211           0 :                 return tevent_req_post(req, ev);
   12212             :         }
   12213           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncDeleteMonitor_r_done, req);
   12214             : 
   12215           0 :         return req;
   12216             : }
   12217             : 
   12218           0 : static void dcerpc_winspool_AsyncDeleteMonitor_r_done(struct tevent_req *subreq)
   12219             : {
   12220           0 :         struct tevent_req *req =
   12221           0 :                 tevent_req_callback_data(subreq,
   12222             :                 struct tevent_req);
   12223           0 :         NTSTATUS status;
   12224             : 
   12225           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   12226           0 :         TALLOC_FREE(subreq);
   12227           0 :         if (tevent_req_nterror(req, status)) {
   12228           0 :                 return;
   12229             :         }
   12230             : 
   12231           0 :         tevent_req_done(req);
   12232             : }
   12233             : 
   12234           0 : NTSTATUS dcerpc_winspool_AsyncDeleteMonitor_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   12235             : {
   12236           0 :         struct dcerpc_winspool_AsyncDeleteMonitor_r_state *state =
   12237           0 :                 tevent_req_data(req,
   12238             :                 struct dcerpc_winspool_AsyncDeleteMonitor_r_state);
   12239           0 :         NTSTATUS status;
   12240             : 
   12241           0 :         if (tevent_req_is_nterror(req, &status)) {
   12242           0 :                 tevent_req_received(req);
   12243           0 :                 return status;
   12244             :         }
   12245             : 
   12246           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12247             : 
   12248           0 :         tevent_req_received(req);
   12249           0 :         return NT_STATUS_OK;
   12250             : }
   12251             : 
   12252           0 : NTSTATUS dcerpc_winspool_AsyncDeleteMonitor_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncDeleteMonitor *r)
   12253             : {
   12254           0 :         NTSTATUS status;
   12255             : 
   12256           0 :         status = dcerpc_binding_handle_call(h,
   12257             :                         NULL, &ndr_table_iremotewinspool,
   12258             :                         NDR_WINSPOOL_ASYNCDELETEMONITOR, mem_ctx, r);
   12259             : 
   12260           0 :         return status;
   12261             : }
   12262             : 
   12263             : struct dcerpc_winspool_AsyncDeleteMonitor_state {
   12264             :         struct winspool_AsyncDeleteMonitor orig;
   12265             :         struct winspool_AsyncDeleteMonitor tmp;
   12266             :         TALLOC_CTX *out_mem_ctx;
   12267             : };
   12268             : 
   12269             : static void dcerpc_winspool_AsyncDeleteMonitor_done(struct tevent_req *subreq);
   12270             : 
   12271           0 : struct tevent_req *dcerpc_winspool_AsyncDeleteMonitor_send(TALLOC_CTX *mem_ctx,
   12272             :                                                            struct tevent_context *ev,
   12273             :                                                            struct dcerpc_binding_handle *h,
   12274             :                                                            const char *_Name /* [in] [charset(UTF16),unique] */,
   12275             :                                                            const char *_pEnvironment /* [in] [charset(UTF16),unique] */,
   12276             :                                                            const char *_pMonitorName /* [in] [charset(UTF16),ref] */)
   12277             : {
   12278           0 :         struct tevent_req *req;
   12279           0 :         struct dcerpc_winspool_AsyncDeleteMonitor_state *state;
   12280           0 :         struct tevent_req *subreq;
   12281             : 
   12282           0 :         req = tevent_req_create(mem_ctx, &state,
   12283             :                                 struct dcerpc_winspool_AsyncDeleteMonitor_state);
   12284           0 :         if (req == NULL) {
   12285           0 :                 return NULL;
   12286             :         }
   12287           0 :         state->out_mem_ctx = NULL;
   12288             : 
   12289             :         /* In parameters */
   12290           0 :         state->orig.in.Name = _Name;
   12291           0 :         state->orig.in.pEnvironment = _pEnvironment;
   12292           0 :         state->orig.in.pMonitorName = _pMonitorName;
   12293             : 
   12294             :         /* Out parameters */
   12295             : 
   12296             :         /* Result */
   12297           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   12298             : 
   12299             :         /* make a temporary copy, that we pass to the dispatch function */
   12300           0 :         state->tmp = state->orig;
   12301             : 
   12302           0 :         subreq = dcerpc_winspool_AsyncDeleteMonitor_r_send(state, ev, h, &state->tmp);
   12303           0 :         if (tevent_req_nomem(subreq, req)) {
   12304           0 :                 return tevent_req_post(req, ev);
   12305             :         }
   12306           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncDeleteMonitor_done, req);
   12307           0 :         return req;
   12308             : }
   12309             : 
   12310           0 : static void dcerpc_winspool_AsyncDeleteMonitor_done(struct tevent_req *subreq)
   12311             : {
   12312           0 :         struct tevent_req *req = tevent_req_callback_data(
   12313             :                 subreq, struct tevent_req);
   12314           0 :         struct dcerpc_winspool_AsyncDeleteMonitor_state *state = tevent_req_data(
   12315             :                 req, struct dcerpc_winspool_AsyncDeleteMonitor_state);
   12316           0 :         NTSTATUS status;
   12317           0 :         TALLOC_CTX *mem_ctx;
   12318             : 
   12319           0 :         if (state->out_mem_ctx) {
   12320           0 :                 mem_ctx = state->out_mem_ctx;
   12321             :         } else {
   12322           0 :                 mem_ctx = state;
   12323             :         }
   12324             : 
   12325           0 :         status = dcerpc_winspool_AsyncDeleteMonitor_r_recv(subreq, mem_ctx);
   12326           0 :         TALLOC_FREE(subreq);
   12327           0 :         if (tevent_req_nterror(req, status)) {
   12328           0 :                 return;
   12329             :         }
   12330             : 
   12331             :         /* Copy out parameters */
   12332             : 
   12333             :         /* Copy result */
   12334           0 :         state->orig.out.result = state->tmp.out.result;
   12335             : 
   12336             :         /* Reset temporary structure */
   12337           0 :         NDR_ZERO_STRUCT(state->tmp);
   12338             : 
   12339           0 :         tevent_req_done(req);
   12340             : }
   12341             : 
   12342           0 : NTSTATUS dcerpc_winspool_AsyncDeleteMonitor_recv(struct tevent_req *req,
   12343             :                                                  TALLOC_CTX *mem_ctx,
   12344             :                                                  WERROR *result)
   12345             : {
   12346           0 :         struct dcerpc_winspool_AsyncDeleteMonitor_state *state = tevent_req_data(
   12347             :                 req, struct dcerpc_winspool_AsyncDeleteMonitor_state);
   12348           0 :         NTSTATUS status;
   12349             : 
   12350           0 :         if (tevent_req_is_nterror(req, &status)) {
   12351           0 :                 tevent_req_received(req);
   12352           0 :                 return status;
   12353             :         }
   12354             : 
   12355             :         /* Steal possible out parameters to the callers context */
   12356           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12357             : 
   12358             :         /* Return result */
   12359           0 :         *result = state->orig.out.result;
   12360             : 
   12361           0 :         tevent_req_received(req);
   12362           0 :         return NT_STATUS_OK;
   12363             : }
   12364             : 
   12365           0 : NTSTATUS dcerpc_winspool_AsyncDeleteMonitor(struct dcerpc_binding_handle *h,
   12366             :                                             TALLOC_CTX *mem_ctx,
   12367             :                                             const char *_Name /* [in] [charset(UTF16),unique] */,
   12368             :                                             const char *_pEnvironment /* [in] [charset(UTF16),unique] */,
   12369             :                                             const char *_pMonitorName /* [in] [charset(UTF16),ref] */,
   12370             :                                             WERROR *result)
   12371             : {
   12372           0 :         struct winspool_AsyncDeleteMonitor r;
   12373           0 :         NTSTATUS status;
   12374             : 
   12375             :         /* In parameters */
   12376           0 :         r.in.Name = _Name;
   12377           0 :         r.in.pEnvironment = _pEnvironment;
   12378           0 :         r.in.pMonitorName = _pMonitorName;
   12379             : 
   12380             :         /* Out parameters */
   12381             : 
   12382             :         /* Result */
   12383           0 :         NDR_ZERO_STRUCT(r.out.result);
   12384             : 
   12385           0 :         status = dcerpc_winspool_AsyncDeleteMonitor_r(h, mem_ctx, &r);
   12386           0 :         if (!NT_STATUS_IS_OK(status)) {
   12387           0 :                 return status;
   12388             :         }
   12389             : 
   12390             :         /* Return variables */
   12391             : 
   12392             :         /* Return result */
   12393           0 :         *result = r.out.result;
   12394             : 
   12395           0 :         return NT_STATUS_OK;
   12396             : }
   12397             : 
   12398             : struct dcerpc_winspool_AsyncDeletePrintProcessor_r_state {
   12399             :         TALLOC_CTX *out_mem_ctx;
   12400             : };
   12401             : 
   12402             : static void dcerpc_winspool_AsyncDeletePrintProcessor_r_done(struct tevent_req *subreq);
   12403             : 
   12404           0 : struct tevent_req *dcerpc_winspool_AsyncDeletePrintProcessor_r_send(TALLOC_CTX *mem_ctx,
   12405             :         struct tevent_context *ev,
   12406             :         struct dcerpc_binding_handle *h,
   12407             :         struct winspool_AsyncDeletePrintProcessor *r)
   12408             : {
   12409           0 :         struct tevent_req *req;
   12410           0 :         struct dcerpc_winspool_AsyncDeletePrintProcessor_r_state *state;
   12411           0 :         struct tevent_req *subreq;
   12412             : 
   12413           0 :         req = tevent_req_create(mem_ctx, &state,
   12414             :                                 struct dcerpc_winspool_AsyncDeletePrintProcessor_r_state);
   12415           0 :         if (req == NULL) {
   12416           0 :                 return NULL;
   12417             :         }
   12418             : 
   12419           0 :         state->out_mem_ctx = NULL;
   12420             : 
   12421           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   12422             :                         NULL, &ndr_table_iremotewinspool,
   12423             :                         NDR_WINSPOOL_ASYNCDELETEPRINTPROCESSOR, state, r);
   12424           0 :         if (tevent_req_nomem(subreq, req)) {
   12425           0 :                 return tevent_req_post(req, ev);
   12426             :         }
   12427           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncDeletePrintProcessor_r_done, req);
   12428             : 
   12429           0 :         return req;
   12430             : }
   12431             : 
   12432           0 : static void dcerpc_winspool_AsyncDeletePrintProcessor_r_done(struct tevent_req *subreq)
   12433             : {
   12434           0 :         struct tevent_req *req =
   12435           0 :                 tevent_req_callback_data(subreq,
   12436             :                 struct tevent_req);
   12437           0 :         NTSTATUS status;
   12438             : 
   12439           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   12440           0 :         TALLOC_FREE(subreq);
   12441           0 :         if (tevent_req_nterror(req, status)) {
   12442           0 :                 return;
   12443             :         }
   12444             : 
   12445           0 :         tevent_req_done(req);
   12446             : }
   12447             : 
   12448           0 : NTSTATUS dcerpc_winspool_AsyncDeletePrintProcessor_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   12449             : {
   12450           0 :         struct dcerpc_winspool_AsyncDeletePrintProcessor_r_state *state =
   12451           0 :                 tevent_req_data(req,
   12452             :                 struct dcerpc_winspool_AsyncDeletePrintProcessor_r_state);
   12453           0 :         NTSTATUS status;
   12454             : 
   12455           0 :         if (tevent_req_is_nterror(req, &status)) {
   12456           0 :                 tevent_req_received(req);
   12457           0 :                 return status;
   12458             :         }
   12459             : 
   12460           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12461             : 
   12462           0 :         tevent_req_received(req);
   12463           0 :         return NT_STATUS_OK;
   12464             : }
   12465             : 
   12466           0 : NTSTATUS dcerpc_winspool_AsyncDeletePrintProcessor_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncDeletePrintProcessor *r)
   12467             : {
   12468           0 :         NTSTATUS status;
   12469             : 
   12470           0 :         status = dcerpc_binding_handle_call(h,
   12471             :                         NULL, &ndr_table_iremotewinspool,
   12472             :                         NDR_WINSPOOL_ASYNCDELETEPRINTPROCESSOR, mem_ctx, r);
   12473             : 
   12474           0 :         return status;
   12475             : }
   12476             : 
   12477             : struct dcerpc_winspool_AsyncDeletePrintProcessor_state {
   12478             :         struct winspool_AsyncDeletePrintProcessor orig;
   12479             :         struct winspool_AsyncDeletePrintProcessor tmp;
   12480             :         TALLOC_CTX *out_mem_ctx;
   12481             : };
   12482             : 
   12483             : static void dcerpc_winspool_AsyncDeletePrintProcessor_done(struct tevent_req *subreq);
   12484             : 
   12485           0 : struct tevent_req *dcerpc_winspool_AsyncDeletePrintProcessor_send(TALLOC_CTX *mem_ctx,
   12486             :                                                                   struct tevent_context *ev,
   12487             :                                                                   struct dcerpc_binding_handle *h,
   12488             :                                                                   const char *_Name /* [in] [charset(UTF16),unique] */,
   12489             :                                                                   const char *_pEnvironment /* [in] [charset(UTF16),unique] */,
   12490             :                                                                   const char *_pPrintProcessorName /* [in] [charset(UTF16),ref] */)
   12491             : {
   12492           0 :         struct tevent_req *req;
   12493           0 :         struct dcerpc_winspool_AsyncDeletePrintProcessor_state *state;
   12494           0 :         struct tevent_req *subreq;
   12495             : 
   12496           0 :         req = tevent_req_create(mem_ctx, &state,
   12497             :                                 struct dcerpc_winspool_AsyncDeletePrintProcessor_state);
   12498           0 :         if (req == NULL) {
   12499           0 :                 return NULL;
   12500             :         }
   12501           0 :         state->out_mem_ctx = NULL;
   12502             : 
   12503             :         /* In parameters */
   12504           0 :         state->orig.in.Name = _Name;
   12505           0 :         state->orig.in.pEnvironment = _pEnvironment;
   12506           0 :         state->orig.in.pPrintProcessorName = _pPrintProcessorName;
   12507             : 
   12508             :         /* Out parameters */
   12509             : 
   12510             :         /* Result */
   12511           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   12512             : 
   12513             :         /* make a temporary copy, that we pass to the dispatch function */
   12514           0 :         state->tmp = state->orig;
   12515             : 
   12516           0 :         subreq = dcerpc_winspool_AsyncDeletePrintProcessor_r_send(state, ev, h, &state->tmp);
   12517           0 :         if (tevent_req_nomem(subreq, req)) {
   12518           0 :                 return tevent_req_post(req, ev);
   12519             :         }
   12520           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncDeletePrintProcessor_done, req);
   12521           0 :         return req;
   12522             : }
   12523             : 
   12524           0 : static void dcerpc_winspool_AsyncDeletePrintProcessor_done(struct tevent_req *subreq)
   12525             : {
   12526           0 :         struct tevent_req *req = tevent_req_callback_data(
   12527             :                 subreq, struct tevent_req);
   12528           0 :         struct dcerpc_winspool_AsyncDeletePrintProcessor_state *state = tevent_req_data(
   12529             :                 req, struct dcerpc_winspool_AsyncDeletePrintProcessor_state);
   12530           0 :         NTSTATUS status;
   12531           0 :         TALLOC_CTX *mem_ctx;
   12532             : 
   12533           0 :         if (state->out_mem_ctx) {
   12534           0 :                 mem_ctx = state->out_mem_ctx;
   12535             :         } else {
   12536           0 :                 mem_ctx = state;
   12537             :         }
   12538             : 
   12539           0 :         status = dcerpc_winspool_AsyncDeletePrintProcessor_r_recv(subreq, mem_ctx);
   12540           0 :         TALLOC_FREE(subreq);
   12541           0 :         if (tevent_req_nterror(req, status)) {
   12542           0 :                 return;
   12543             :         }
   12544             : 
   12545             :         /* Copy out parameters */
   12546             : 
   12547             :         /* Copy result */
   12548           0 :         state->orig.out.result = state->tmp.out.result;
   12549             : 
   12550             :         /* Reset temporary structure */
   12551           0 :         NDR_ZERO_STRUCT(state->tmp);
   12552             : 
   12553           0 :         tevent_req_done(req);
   12554             : }
   12555             : 
   12556           0 : NTSTATUS dcerpc_winspool_AsyncDeletePrintProcessor_recv(struct tevent_req *req,
   12557             :                                                         TALLOC_CTX *mem_ctx,
   12558             :                                                         WERROR *result)
   12559             : {
   12560           0 :         struct dcerpc_winspool_AsyncDeletePrintProcessor_state *state = tevent_req_data(
   12561             :                 req, struct dcerpc_winspool_AsyncDeletePrintProcessor_state);
   12562           0 :         NTSTATUS status;
   12563             : 
   12564           0 :         if (tevent_req_is_nterror(req, &status)) {
   12565           0 :                 tevent_req_received(req);
   12566           0 :                 return status;
   12567             :         }
   12568             : 
   12569             :         /* Steal possible out parameters to the callers context */
   12570           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12571             : 
   12572             :         /* Return result */
   12573           0 :         *result = state->orig.out.result;
   12574             : 
   12575           0 :         tevent_req_received(req);
   12576           0 :         return NT_STATUS_OK;
   12577             : }
   12578             : 
   12579           0 : NTSTATUS dcerpc_winspool_AsyncDeletePrintProcessor(struct dcerpc_binding_handle *h,
   12580             :                                                    TALLOC_CTX *mem_ctx,
   12581             :                                                    const char *_Name /* [in] [charset(UTF16),unique] */,
   12582             :                                                    const char *_pEnvironment /* [in] [charset(UTF16),unique] */,
   12583             :                                                    const char *_pPrintProcessorName /* [in] [charset(UTF16),ref] */,
   12584             :                                                    WERROR *result)
   12585             : {
   12586           0 :         struct winspool_AsyncDeletePrintProcessor r;
   12587           0 :         NTSTATUS status;
   12588             : 
   12589             :         /* In parameters */
   12590           0 :         r.in.Name = _Name;
   12591           0 :         r.in.pEnvironment = _pEnvironment;
   12592           0 :         r.in.pPrintProcessorName = _pPrintProcessorName;
   12593             : 
   12594             :         /* Out parameters */
   12595             : 
   12596             :         /* Result */
   12597           0 :         NDR_ZERO_STRUCT(r.out.result);
   12598             : 
   12599           0 :         status = dcerpc_winspool_AsyncDeletePrintProcessor_r(h, mem_ctx, &r);
   12600           0 :         if (!NT_STATUS_IS_OK(status)) {
   12601           0 :                 return status;
   12602             :         }
   12603             : 
   12604             :         /* Return variables */
   12605             : 
   12606             :         /* Return result */
   12607           0 :         *result = r.out.result;
   12608             : 
   12609           0 :         return NT_STATUS_OK;
   12610             : }
   12611             : 
   12612             : struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_state {
   12613             :         TALLOC_CTX *out_mem_ctx;
   12614             : };
   12615             : 
   12616             : static void dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_done(struct tevent_req *subreq);
   12617             : 
   12618           0 : struct tevent_req *dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_send(TALLOC_CTX *mem_ctx,
   12619             :         struct tevent_context *ev,
   12620             :         struct dcerpc_binding_handle *h,
   12621             :         struct winspool_AsyncEnumPrintProcessorDatatypes *r)
   12622             : {
   12623           0 :         struct tevent_req *req;
   12624           0 :         struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_state *state;
   12625           0 :         struct tevent_req *subreq;
   12626             : 
   12627           0 :         req = tevent_req_create(mem_ctx, &state,
   12628             :                                 struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_state);
   12629           0 :         if (req == NULL) {
   12630           0 :                 return NULL;
   12631             :         }
   12632             : 
   12633           0 :         state->out_mem_ctx = talloc_new(state);
   12634           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   12635           0 :                 return tevent_req_post(req, ev);
   12636             :         }
   12637             : 
   12638           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   12639             :                         NULL, &ndr_table_iremotewinspool,
   12640           0 :                         NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORDATATYPES, state->out_mem_ctx, r);
   12641           0 :         if (tevent_req_nomem(subreq, req)) {
   12642           0 :                 return tevent_req_post(req, ev);
   12643             :         }
   12644           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_done, req);
   12645             : 
   12646           0 :         return req;
   12647             : }
   12648             : 
   12649           0 : static void dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_done(struct tevent_req *subreq)
   12650             : {
   12651           0 :         struct tevent_req *req =
   12652           0 :                 tevent_req_callback_data(subreq,
   12653             :                 struct tevent_req);
   12654           0 :         NTSTATUS status;
   12655             : 
   12656           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   12657           0 :         TALLOC_FREE(subreq);
   12658           0 :         if (tevent_req_nterror(req, status)) {
   12659           0 :                 return;
   12660             :         }
   12661             : 
   12662           0 :         tevent_req_done(req);
   12663             : }
   12664             : 
   12665           0 : NTSTATUS dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   12666             : {
   12667           0 :         struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_state *state =
   12668           0 :                 tevent_req_data(req,
   12669             :                 struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_state);
   12670           0 :         NTSTATUS status;
   12671             : 
   12672           0 :         if (tevent_req_is_nterror(req, &status)) {
   12673           0 :                 tevent_req_received(req);
   12674           0 :                 return status;
   12675             :         }
   12676             : 
   12677           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12678             : 
   12679           0 :         tevent_req_received(req);
   12680           0 :         return NT_STATUS_OK;
   12681             : }
   12682             : 
   12683           0 : NTSTATUS dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncEnumPrintProcessorDatatypes *r)
   12684             : {
   12685           0 :         NTSTATUS status;
   12686             : 
   12687           0 :         status = dcerpc_binding_handle_call(h,
   12688             :                         NULL, &ndr_table_iremotewinspool,
   12689             :                         NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORDATATYPES, mem_ctx, r);
   12690             : 
   12691           0 :         return status;
   12692             : }
   12693             : 
   12694             : struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_state {
   12695             :         struct winspool_AsyncEnumPrintProcessorDatatypes orig;
   12696             :         struct winspool_AsyncEnumPrintProcessorDatatypes tmp;
   12697             :         TALLOC_CTX *out_mem_ctx;
   12698             : };
   12699             : 
   12700             : static void dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_done(struct tevent_req *subreq);
   12701             : 
   12702           0 : struct tevent_req *dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_send(TALLOC_CTX *mem_ctx,
   12703             :                                                                          struct tevent_context *ev,
   12704             :                                                                          struct dcerpc_binding_handle *h,
   12705             :                                                                          const char *_pName /* [in] [charset(UTF16),unique] */,
   12706             :                                                                          const char *_pPrintProcessorName /* [in] [charset(UTF16),unique] */,
   12707             :                                                                          uint32_t _Level /* [in]  */,
   12708             :                                                                          uint8_t *_pDatatypes /* [in,out] [size_is(cbBuf),unique] */,
   12709             :                                                                          uint32_t _cbBuf /* [in]  */,
   12710             :                                                                          uint32_t *_pcbNeeded /* [out] [ref] */,
   12711             :                                                                          uint32_t *_pcReturned /* [out] [ref] */)
   12712             : {
   12713           0 :         struct tevent_req *req;
   12714           0 :         struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_state *state;
   12715           0 :         struct tevent_req *subreq;
   12716             : 
   12717           0 :         req = tevent_req_create(mem_ctx, &state,
   12718             :                                 struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_state);
   12719           0 :         if (req == NULL) {
   12720           0 :                 return NULL;
   12721             :         }
   12722           0 :         state->out_mem_ctx = NULL;
   12723             : 
   12724             :         /* In parameters */
   12725           0 :         state->orig.in.pName = _pName;
   12726           0 :         state->orig.in.pPrintProcessorName = _pPrintProcessorName;
   12727           0 :         state->orig.in.Level = _Level;
   12728           0 :         state->orig.in.pDatatypes = _pDatatypes;
   12729           0 :         state->orig.in.cbBuf = _cbBuf;
   12730             : 
   12731             :         /* Out parameters */
   12732           0 :         state->orig.out.pDatatypes = _pDatatypes;
   12733           0 :         state->orig.out.pcbNeeded = _pcbNeeded;
   12734           0 :         state->orig.out.pcReturned = _pcReturned;
   12735             : 
   12736             :         /* Result */
   12737           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   12738             : 
   12739           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   12740             :                              "dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_out_memory");
   12741           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   12742           0 :                 return tevent_req_post(req, ev);
   12743             :         }
   12744             : 
   12745             :         /* make a temporary copy, that we pass to the dispatch function */
   12746           0 :         state->tmp = state->orig;
   12747             : 
   12748           0 :         subreq = dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_send(state, ev, h, &state->tmp);
   12749           0 :         if (tevent_req_nomem(subreq, req)) {
   12750           0 :                 return tevent_req_post(req, ev);
   12751             :         }
   12752           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_done, req);
   12753           0 :         return req;
   12754             : }
   12755             : 
   12756           0 : static void dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_done(struct tevent_req *subreq)
   12757             : {
   12758           0 :         struct tevent_req *req = tevent_req_callback_data(
   12759             :                 subreq, struct tevent_req);
   12760           0 :         struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_state *state = tevent_req_data(
   12761             :                 req, struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_state);
   12762           0 :         NTSTATUS status;
   12763           0 :         TALLOC_CTX *mem_ctx;
   12764             : 
   12765           0 :         if (state->out_mem_ctx) {
   12766           0 :                 mem_ctx = state->out_mem_ctx;
   12767             :         } else {
   12768           0 :                 mem_ctx = state;
   12769             :         }
   12770             : 
   12771           0 :         status = dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r_recv(subreq, mem_ctx);
   12772           0 :         TALLOC_FREE(subreq);
   12773           0 :         if (tevent_req_nterror(req, status)) {
   12774           0 :                 return;
   12775             :         }
   12776             : 
   12777             :         /* Copy out parameters */
   12778           0 :         if (state->orig.out.pDatatypes && state->tmp.out.pDatatypes) {
   12779             :                 {
   12780           0 :                         size_t _copy_len_pDatatypes;
   12781           0 :                         _copy_len_pDatatypes = state->tmp.in.cbBuf;
   12782           0 :                         if (state->orig.out.pDatatypes != state->tmp.out.pDatatypes) {
   12783           0 :                                 memcpy(state->orig.out.pDatatypes, state->tmp.out.pDatatypes, _copy_len_pDatatypes * sizeof(*state->orig.out.pDatatypes));
   12784             :                         }
   12785             :                 }
   12786             :         }
   12787           0 :         *state->orig.out.pcbNeeded = *state->tmp.out.pcbNeeded;
   12788           0 :         *state->orig.out.pcReturned = *state->tmp.out.pcReturned;
   12789             : 
   12790             :         /* Copy result */
   12791           0 :         state->orig.out.result = state->tmp.out.result;
   12792             : 
   12793             :         /* Reset temporary structure */
   12794           0 :         NDR_ZERO_STRUCT(state->tmp);
   12795             : 
   12796           0 :         tevent_req_done(req);
   12797             : }
   12798             : 
   12799           0 : NTSTATUS dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_recv(struct tevent_req *req,
   12800             :                                                                TALLOC_CTX *mem_ctx,
   12801             :                                                                WERROR *result)
   12802             : {
   12803           0 :         struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_state *state = tevent_req_data(
   12804             :                 req, struct dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_state);
   12805           0 :         NTSTATUS status;
   12806             : 
   12807           0 :         if (tevent_req_is_nterror(req, &status)) {
   12808           0 :                 tevent_req_received(req);
   12809           0 :                 return status;
   12810             :         }
   12811             : 
   12812             :         /* Steal possible out parameters to the callers context */
   12813           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12814             : 
   12815             :         /* Return result */
   12816           0 :         *result = state->orig.out.result;
   12817             : 
   12818           0 :         tevent_req_received(req);
   12819           0 :         return NT_STATUS_OK;
   12820             : }
   12821             : 
   12822           0 : NTSTATUS dcerpc_winspool_AsyncEnumPrintProcessorDatatypes(struct dcerpc_binding_handle *h,
   12823             :                                                           TALLOC_CTX *mem_ctx,
   12824             :                                                           const char *_pName /* [in] [charset(UTF16),unique] */,
   12825             :                                                           const char *_pPrintProcessorName /* [in] [charset(UTF16),unique] */,
   12826             :                                                           uint32_t _Level /* [in]  */,
   12827             :                                                           uint8_t *_pDatatypes /* [in,out] [size_is(cbBuf),unique] */,
   12828             :                                                           uint32_t _cbBuf /* [in]  */,
   12829             :                                                           uint32_t *_pcbNeeded /* [out] [ref] */,
   12830             :                                                           uint32_t *_pcReturned /* [out] [ref] */,
   12831             :                                                           WERROR *result)
   12832             : {
   12833           0 :         struct winspool_AsyncEnumPrintProcessorDatatypes r;
   12834           0 :         NTSTATUS status;
   12835             : 
   12836             :         /* In parameters */
   12837           0 :         r.in.pName = _pName;
   12838           0 :         r.in.pPrintProcessorName = _pPrintProcessorName;
   12839           0 :         r.in.Level = _Level;
   12840           0 :         r.in.pDatatypes = _pDatatypes;
   12841           0 :         r.in.cbBuf = _cbBuf;
   12842             : 
   12843             :         /* Out parameters */
   12844           0 :         r.out.pDatatypes = _pDatatypes;
   12845           0 :         r.out.pcbNeeded = _pcbNeeded;
   12846           0 :         r.out.pcReturned = _pcReturned;
   12847             : 
   12848             :         /* Result */
   12849           0 :         NDR_ZERO_STRUCT(r.out.result);
   12850             : 
   12851           0 :         status = dcerpc_winspool_AsyncEnumPrintProcessorDatatypes_r(h, mem_ctx, &r);
   12852           0 :         if (!NT_STATUS_IS_OK(status)) {
   12853           0 :                 return status;
   12854             :         }
   12855             : 
   12856             :         /* Return variables */
   12857           0 :         if (_pDatatypes && r.out.pDatatypes) {
   12858             :                 {
   12859           0 :                         size_t _copy_len_pDatatypes;
   12860           0 :                         _copy_len_pDatatypes = r.in.cbBuf;
   12861           0 :                         if (_pDatatypes != r.out.pDatatypes) {
   12862           0 :                                 memcpy(_pDatatypes, r.out.pDatatypes, _copy_len_pDatatypes * sizeof(*_pDatatypes));
   12863             :                         }
   12864             :                 }
   12865             :         }
   12866           0 :         *_pcbNeeded = *r.out.pcbNeeded;
   12867           0 :         *_pcReturned = *r.out.pcReturned;
   12868             : 
   12869             :         /* Return result */
   12870           0 :         *result = r.out.result;
   12871             : 
   12872           0 :         return NT_STATUS_OK;
   12873             : }
   12874             : 
   12875             : struct dcerpc_winspool_AsyncAddPerMachineConnection_r_state {
   12876             :         TALLOC_CTX *out_mem_ctx;
   12877             : };
   12878             : 
   12879             : static void dcerpc_winspool_AsyncAddPerMachineConnection_r_done(struct tevent_req *subreq);
   12880             : 
   12881           0 : struct tevent_req *dcerpc_winspool_AsyncAddPerMachineConnection_r_send(TALLOC_CTX *mem_ctx,
   12882             :         struct tevent_context *ev,
   12883             :         struct dcerpc_binding_handle *h,
   12884             :         struct winspool_AsyncAddPerMachineConnection *r)
   12885             : {
   12886           0 :         struct tevent_req *req;
   12887           0 :         struct dcerpc_winspool_AsyncAddPerMachineConnection_r_state *state;
   12888           0 :         struct tevent_req *subreq;
   12889             : 
   12890           0 :         req = tevent_req_create(mem_ctx, &state,
   12891             :                                 struct dcerpc_winspool_AsyncAddPerMachineConnection_r_state);
   12892           0 :         if (req == NULL) {
   12893           0 :                 return NULL;
   12894             :         }
   12895             : 
   12896           0 :         state->out_mem_ctx = NULL;
   12897             : 
   12898           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   12899             :                         NULL, &ndr_table_iremotewinspool,
   12900             :                         NDR_WINSPOOL_ASYNCADDPERMACHINECONNECTION, state, r);
   12901           0 :         if (tevent_req_nomem(subreq, req)) {
   12902           0 :                 return tevent_req_post(req, ev);
   12903             :         }
   12904           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncAddPerMachineConnection_r_done, req);
   12905             : 
   12906           0 :         return req;
   12907             : }
   12908             : 
   12909           0 : static void dcerpc_winspool_AsyncAddPerMachineConnection_r_done(struct tevent_req *subreq)
   12910             : {
   12911           0 :         struct tevent_req *req =
   12912           0 :                 tevent_req_callback_data(subreq,
   12913             :                 struct tevent_req);
   12914           0 :         NTSTATUS status;
   12915             : 
   12916           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   12917           0 :         TALLOC_FREE(subreq);
   12918           0 :         if (tevent_req_nterror(req, status)) {
   12919           0 :                 return;
   12920             :         }
   12921             : 
   12922           0 :         tevent_req_done(req);
   12923             : }
   12924             : 
   12925           0 : NTSTATUS dcerpc_winspool_AsyncAddPerMachineConnection_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   12926             : {
   12927           0 :         struct dcerpc_winspool_AsyncAddPerMachineConnection_r_state *state =
   12928           0 :                 tevent_req_data(req,
   12929             :                 struct dcerpc_winspool_AsyncAddPerMachineConnection_r_state);
   12930           0 :         NTSTATUS status;
   12931             : 
   12932           0 :         if (tevent_req_is_nterror(req, &status)) {
   12933           0 :                 tevent_req_received(req);
   12934           0 :                 return status;
   12935             :         }
   12936             : 
   12937           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12938             : 
   12939           0 :         tevent_req_received(req);
   12940           0 :         return NT_STATUS_OK;
   12941             : }
   12942             : 
   12943           0 : NTSTATUS dcerpc_winspool_AsyncAddPerMachineConnection_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncAddPerMachineConnection *r)
   12944             : {
   12945           0 :         NTSTATUS status;
   12946             : 
   12947           0 :         status = dcerpc_binding_handle_call(h,
   12948             :                         NULL, &ndr_table_iremotewinspool,
   12949             :                         NDR_WINSPOOL_ASYNCADDPERMACHINECONNECTION, mem_ctx, r);
   12950             : 
   12951           0 :         return status;
   12952             : }
   12953             : 
   12954             : struct dcerpc_winspool_AsyncAddPerMachineConnection_state {
   12955             :         struct winspool_AsyncAddPerMachineConnection orig;
   12956             :         struct winspool_AsyncAddPerMachineConnection tmp;
   12957             :         TALLOC_CTX *out_mem_ctx;
   12958             : };
   12959             : 
   12960             : static void dcerpc_winspool_AsyncAddPerMachineConnection_done(struct tevent_req *subreq);
   12961             : 
   12962           0 : struct tevent_req *dcerpc_winspool_AsyncAddPerMachineConnection_send(TALLOC_CTX *mem_ctx,
   12963             :                                                                      struct tevent_context *ev,
   12964             :                                                                      struct dcerpc_binding_handle *h,
   12965             :                                                                      const char *_pServer /* [in] [charset(UTF16),unique] */,
   12966             :                                                                      const char *_pPrinterName /* [in] [charset(UTF16),ref] */,
   12967             :                                                                      const char *_pPrintServer /* [in] [charset(UTF16),ref] */,
   12968             :                                                                      const char *_pProvider /* [in] [charset(UTF16),ref] */)
   12969             : {
   12970           0 :         struct tevent_req *req;
   12971           0 :         struct dcerpc_winspool_AsyncAddPerMachineConnection_state *state;
   12972           0 :         struct tevent_req *subreq;
   12973             : 
   12974           0 :         req = tevent_req_create(mem_ctx, &state,
   12975             :                                 struct dcerpc_winspool_AsyncAddPerMachineConnection_state);
   12976           0 :         if (req == NULL) {
   12977           0 :                 return NULL;
   12978             :         }
   12979           0 :         state->out_mem_ctx = NULL;
   12980             : 
   12981             :         /* In parameters */
   12982           0 :         state->orig.in.pServer = _pServer;
   12983           0 :         state->orig.in.pPrinterName = _pPrinterName;
   12984           0 :         state->orig.in.pPrintServer = _pPrintServer;
   12985           0 :         state->orig.in.pProvider = _pProvider;
   12986             : 
   12987             :         /* Out parameters */
   12988             : 
   12989             :         /* Result */
   12990           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   12991             : 
   12992             :         /* make a temporary copy, that we pass to the dispatch function */
   12993           0 :         state->tmp = state->orig;
   12994             : 
   12995           0 :         subreq = dcerpc_winspool_AsyncAddPerMachineConnection_r_send(state, ev, h, &state->tmp);
   12996           0 :         if (tevent_req_nomem(subreq, req)) {
   12997           0 :                 return tevent_req_post(req, ev);
   12998             :         }
   12999           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncAddPerMachineConnection_done, req);
   13000           0 :         return req;
   13001             : }
   13002             : 
   13003           0 : static void dcerpc_winspool_AsyncAddPerMachineConnection_done(struct tevent_req *subreq)
   13004             : {
   13005           0 :         struct tevent_req *req = tevent_req_callback_data(
   13006             :                 subreq, struct tevent_req);
   13007           0 :         struct dcerpc_winspool_AsyncAddPerMachineConnection_state *state = tevent_req_data(
   13008             :                 req, struct dcerpc_winspool_AsyncAddPerMachineConnection_state);
   13009           0 :         NTSTATUS status;
   13010           0 :         TALLOC_CTX *mem_ctx;
   13011             : 
   13012           0 :         if (state->out_mem_ctx) {
   13013           0 :                 mem_ctx = state->out_mem_ctx;
   13014             :         } else {
   13015           0 :                 mem_ctx = state;
   13016             :         }
   13017             : 
   13018           0 :         status = dcerpc_winspool_AsyncAddPerMachineConnection_r_recv(subreq, mem_ctx);
   13019           0 :         TALLOC_FREE(subreq);
   13020           0 :         if (tevent_req_nterror(req, status)) {
   13021           0 :                 return;
   13022             :         }
   13023             : 
   13024             :         /* Copy out parameters */
   13025             : 
   13026             :         /* Copy result */
   13027           0 :         state->orig.out.result = state->tmp.out.result;
   13028             : 
   13029             :         /* Reset temporary structure */
   13030           0 :         NDR_ZERO_STRUCT(state->tmp);
   13031             : 
   13032           0 :         tevent_req_done(req);
   13033             : }
   13034             : 
   13035           0 : NTSTATUS dcerpc_winspool_AsyncAddPerMachineConnection_recv(struct tevent_req *req,
   13036             :                                                            TALLOC_CTX *mem_ctx,
   13037             :                                                            WERROR *result)
   13038             : {
   13039           0 :         struct dcerpc_winspool_AsyncAddPerMachineConnection_state *state = tevent_req_data(
   13040             :                 req, struct dcerpc_winspool_AsyncAddPerMachineConnection_state);
   13041           0 :         NTSTATUS status;
   13042             : 
   13043           0 :         if (tevent_req_is_nterror(req, &status)) {
   13044           0 :                 tevent_req_received(req);
   13045           0 :                 return status;
   13046             :         }
   13047             : 
   13048             :         /* Steal possible out parameters to the callers context */
   13049           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13050             : 
   13051             :         /* Return result */
   13052           0 :         *result = state->orig.out.result;
   13053             : 
   13054           0 :         tevent_req_received(req);
   13055           0 :         return NT_STATUS_OK;
   13056             : }
   13057             : 
   13058           0 : NTSTATUS dcerpc_winspool_AsyncAddPerMachineConnection(struct dcerpc_binding_handle *h,
   13059             :                                                       TALLOC_CTX *mem_ctx,
   13060             :                                                       const char *_pServer /* [in] [charset(UTF16),unique] */,
   13061             :                                                       const char *_pPrinterName /* [in] [charset(UTF16),ref] */,
   13062             :                                                       const char *_pPrintServer /* [in] [charset(UTF16),ref] */,
   13063             :                                                       const char *_pProvider /* [in] [charset(UTF16),ref] */,
   13064             :                                                       WERROR *result)
   13065             : {
   13066           0 :         struct winspool_AsyncAddPerMachineConnection r;
   13067           0 :         NTSTATUS status;
   13068             : 
   13069             :         /* In parameters */
   13070           0 :         r.in.pServer = _pServer;
   13071           0 :         r.in.pPrinterName = _pPrinterName;
   13072           0 :         r.in.pPrintServer = _pPrintServer;
   13073           0 :         r.in.pProvider = _pProvider;
   13074             : 
   13075             :         /* Out parameters */
   13076             : 
   13077             :         /* Result */
   13078           0 :         NDR_ZERO_STRUCT(r.out.result);
   13079             : 
   13080           0 :         status = dcerpc_winspool_AsyncAddPerMachineConnection_r(h, mem_ctx, &r);
   13081           0 :         if (!NT_STATUS_IS_OK(status)) {
   13082           0 :                 return status;
   13083             :         }
   13084             : 
   13085             :         /* Return variables */
   13086             : 
   13087             :         /* Return result */
   13088           0 :         *result = r.out.result;
   13089             : 
   13090           0 :         return NT_STATUS_OK;
   13091             : }
   13092             : 
   13093             : struct dcerpc_winspool_AsyncDeletePerMachineConnection_r_state {
   13094             :         TALLOC_CTX *out_mem_ctx;
   13095             : };
   13096             : 
   13097             : static void dcerpc_winspool_AsyncDeletePerMachineConnection_r_done(struct tevent_req *subreq);
   13098             : 
   13099           0 : struct tevent_req *dcerpc_winspool_AsyncDeletePerMachineConnection_r_send(TALLOC_CTX *mem_ctx,
   13100             :         struct tevent_context *ev,
   13101             :         struct dcerpc_binding_handle *h,
   13102             :         struct winspool_AsyncDeletePerMachineConnection *r)
   13103             : {
   13104           0 :         struct tevent_req *req;
   13105           0 :         struct dcerpc_winspool_AsyncDeletePerMachineConnection_r_state *state;
   13106           0 :         struct tevent_req *subreq;
   13107             : 
   13108           0 :         req = tevent_req_create(mem_ctx, &state,
   13109             :                                 struct dcerpc_winspool_AsyncDeletePerMachineConnection_r_state);
   13110           0 :         if (req == NULL) {
   13111           0 :                 return NULL;
   13112             :         }
   13113             : 
   13114           0 :         state->out_mem_ctx = NULL;
   13115             : 
   13116           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   13117             :                         NULL, &ndr_table_iremotewinspool,
   13118             :                         NDR_WINSPOOL_ASYNCDELETEPERMACHINECONNECTION, state, r);
   13119           0 :         if (tevent_req_nomem(subreq, req)) {
   13120           0 :                 return tevent_req_post(req, ev);
   13121             :         }
   13122           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncDeletePerMachineConnection_r_done, req);
   13123             : 
   13124           0 :         return req;
   13125             : }
   13126             : 
   13127           0 : static void dcerpc_winspool_AsyncDeletePerMachineConnection_r_done(struct tevent_req *subreq)
   13128             : {
   13129           0 :         struct tevent_req *req =
   13130           0 :                 tevent_req_callback_data(subreq,
   13131             :                 struct tevent_req);
   13132           0 :         NTSTATUS status;
   13133             : 
   13134           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   13135           0 :         TALLOC_FREE(subreq);
   13136           0 :         if (tevent_req_nterror(req, status)) {
   13137           0 :                 return;
   13138             :         }
   13139             : 
   13140           0 :         tevent_req_done(req);
   13141             : }
   13142             : 
   13143           0 : NTSTATUS dcerpc_winspool_AsyncDeletePerMachineConnection_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   13144             : {
   13145           0 :         struct dcerpc_winspool_AsyncDeletePerMachineConnection_r_state *state =
   13146           0 :                 tevent_req_data(req,
   13147             :                 struct dcerpc_winspool_AsyncDeletePerMachineConnection_r_state);
   13148           0 :         NTSTATUS status;
   13149             : 
   13150           0 :         if (tevent_req_is_nterror(req, &status)) {
   13151           0 :                 tevent_req_received(req);
   13152           0 :                 return status;
   13153             :         }
   13154             : 
   13155           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13156             : 
   13157           0 :         tevent_req_received(req);
   13158           0 :         return NT_STATUS_OK;
   13159             : }
   13160             : 
   13161           0 : NTSTATUS dcerpc_winspool_AsyncDeletePerMachineConnection_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncDeletePerMachineConnection *r)
   13162             : {
   13163           0 :         NTSTATUS status;
   13164             : 
   13165           0 :         status = dcerpc_binding_handle_call(h,
   13166             :                         NULL, &ndr_table_iremotewinspool,
   13167             :                         NDR_WINSPOOL_ASYNCDELETEPERMACHINECONNECTION, mem_ctx, r);
   13168             : 
   13169           0 :         return status;
   13170             : }
   13171             : 
   13172             : struct dcerpc_winspool_AsyncDeletePerMachineConnection_state {
   13173             :         struct winspool_AsyncDeletePerMachineConnection orig;
   13174             :         struct winspool_AsyncDeletePerMachineConnection tmp;
   13175             :         TALLOC_CTX *out_mem_ctx;
   13176             : };
   13177             : 
   13178             : static void dcerpc_winspool_AsyncDeletePerMachineConnection_done(struct tevent_req *subreq);
   13179             : 
   13180           0 : struct tevent_req *dcerpc_winspool_AsyncDeletePerMachineConnection_send(TALLOC_CTX *mem_ctx,
   13181             :                                                                         struct tevent_context *ev,
   13182             :                                                                         struct dcerpc_binding_handle *h,
   13183             :                                                                         const char *_pServer /* [in] [charset(UTF16),unique] */,
   13184             :                                                                         const char *_pPrinterName /* [in] [charset(UTF16),ref] */)
   13185             : {
   13186           0 :         struct tevent_req *req;
   13187           0 :         struct dcerpc_winspool_AsyncDeletePerMachineConnection_state *state;
   13188           0 :         struct tevent_req *subreq;
   13189             : 
   13190           0 :         req = tevent_req_create(mem_ctx, &state,
   13191             :                                 struct dcerpc_winspool_AsyncDeletePerMachineConnection_state);
   13192           0 :         if (req == NULL) {
   13193           0 :                 return NULL;
   13194             :         }
   13195           0 :         state->out_mem_ctx = NULL;
   13196             : 
   13197             :         /* In parameters */
   13198           0 :         state->orig.in.pServer = _pServer;
   13199           0 :         state->orig.in.pPrinterName = _pPrinterName;
   13200             : 
   13201             :         /* Out parameters */
   13202             : 
   13203             :         /* Result */
   13204           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   13205             : 
   13206             :         /* make a temporary copy, that we pass to the dispatch function */
   13207           0 :         state->tmp = state->orig;
   13208             : 
   13209           0 :         subreq = dcerpc_winspool_AsyncDeletePerMachineConnection_r_send(state, ev, h, &state->tmp);
   13210           0 :         if (tevent_req_nomem(subreq, req)) {
   13211           0 :                 return tevent_req_post(req, ev);
   13212             :         }
   13213           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncDeletePerMachineConnection_done, req);
   13214           0 :         return req;
   13215             : }
   13216             : 
   13217           0 : static void dcerpc_winspool_AsyncDeletePerMachineConnection_done(struct tevent_req *subreq)
   13218             : {
   13219           0 :         struct tevent_req *req = tevent_req_callback_data(
   13220             :                 subreq, struct tevent_req);
   13221           0 :         struct dcerpc_winspool_AsyncDeletePerMachineConnection_state *state = tevent_req_data(
   13222             :                 req, struct dcerpc_winspool_AsyncDeletePerMachineConnection_state);
   13223           0 :         NTSTATUS status;
   13224           0 :         TALLOC_CTX *mem_ctx;
   13225             : 
   13226           0 :         if (state->out_mem_ctx) {
   13227           0 :                 mem_ctx = state->out_mem_ctx;
   13228             :         } else {
   13229           0 :                 mem_ctx = state;
   13230             :         }
   13231             : 
   13232           0 :         status = dcerpc_winspool_AsyncDeletePerMachineConnection_r_recv(subreq, mem_ctx);
   13233           0 :         TALLOC_FREE(subreq);
   13234           0 :         if (tevent_req_nterror(req, status)) {
   13235           0 :                 return;
   13236             :         }
   13237             : 
   13238             :         /* Copy out parameters */
   13239             : 
   13240             :         /* Copy result */
   13241           0 :         state->orig.out.result = state->tmp.out.result;
   13242             : 
   13243             :         /* Reset temporary structure */
   13244           0 :         NDR_ZERO_STRUCT(state->tmp);
   13245             : 
   13246           0 :         tevent_req_done(req);
   13247             : }
   13248             : 
   13249           0 : NTSTATUS dcerpc_winspool_AsyncDeletePerMachineConnection_recv(struct tevent_req *req,
   13250             :                                                               TALLOC_CTX *mem_ctx,
   13251             :                                                               WERROR *result)
   13252             : {
   13253           0 :         struct dcerpc_winspool_AsyncDeletePerMachineConnection_state *state = tevent_req_data(
   13254             :                 req, struct dcerpc_winspool_AsyncDeletePerMachineConnection_state);
   13255           0 :         NTSTATUS status;
   13256             : 
   13257           0 :         if (tevent_req_is_nterror(req, &status)) {
   13258           0 :                 tevent_req_received(req);
   13259           0 :                 return status;
   13260             :         }
   13261             : 
   13262             :         /* Steal possible out parameters to the callers context */
   13263           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13264             : 
   13265             :         /* Return result */
   13266           0 :         *result = state->orig.out.result;
   13267             : 
   13268           0 :         tevent_req_received(req);
   13269           0 :         return NT_STATUS_OK;
   13270             : }
   13271             : 
   13272           0 : NTSTATUS dcerpc_winspool_AsyncDeletePerMachineConnection(struct dcerpc_binding_handle *h,
   13273             :                                                          TALLOC_CTX *mem_ctx,
   13274             :                                                          const char *_pServer /* [in] [charset(UTF16),unique] */,
   13275             :                                                          const char *_pPrinterName /* [in] [charset(UTF16),ref] */,
   13276             :                                                          WERROR *result)
   13277             : {
   13278           0 :         struct winspool_AsyncDeletePerMachineConnection r;
   13279           0 :         NTSTATUS status;
   13280             : 
   13281             :         /* In parameters */
   13282           0 :         r.in.pServer = _pServer;
   13283           0 :         r.in.pPrinterName = _pPrinterName;
   13284             : 
   13285             :         /* Out parameters */
   13286             : 
   13287             :         /* Result */
   13288           0 :         NDR_ZERO_STRUCT(r.out.result);
   13289             : 
   13290           0 :         status = dcerpc_winspool_AsyncDeletePerMachineConnection_r(h, mem_ctx, &r);
   13291           0 :         if (!NT_STATUS_IS_OK(status)) {
   13292           0 :                 return status;
   13293             :         }
   13294             : 
   13295             :         /* Return variables */
   13296             : 
   13297             :         /* Return result */
   13298           0 :         *result = r.out.result;
   13299             : 
   13300           0 :         return NT_STATUS_OK;
   13301             : }
   13302             : 
   13303             : struct dcerpc_winspool_AsyncEnumPerMachineConnections_r_state {
   13304             :         TALLOC_CTX *out_mem_ctx;
   13305             : };
   13306             : 
   13307             : static void dcerpc_winspool_AsyncEnumPerMachineConnections_r_done(struct tevent_req *subreq);
   13308             : 
   13309           0 : struct tevent_req *dcerpc_winspool_AsyncEnumPerMachineConnections_r_send(TALLOC_CTX *mem_ctx,
   13310             :         struct tevent_context *ev,
   13311             :         struct dcerpc_binding_handle *h,
   13312             :         struct winspool_AsyncEnumPerMachineConnections *r)
   13313             : {
   13314           0 :         struct tevent_req *req;
   13315           0 :         struct dcerpc_winspool_AsyncEnumPerMachineConnections_r_state *state;
   13316           0 :         struct tevent_req *subreq;
   13317             : 
   13318           0 :         req = tevent_req_create(mem_ctx, &state,
   13319             :                                 struct dcerpc_winspool_AsyncEnumPerMachineConnections_r_state);
   13320           0 :         if (req == NULL) {
   13321           0 :                 return NULL;
   13322             :         }
   13323             : 
   13324           0 :         state->out_mem_ctx = talloc_new(state);
   13325           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   13326           0 :                 return tevent_req_post(req, ev);
   13327             :         }
   13328             : 
   13329           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   13330             :                         NULL, &ndr_table_iremotewinspool,
   13331           0 :                         NDR_WINSPOOL_ASYNCENUMPERMACHINECONNECTIONS, state->out_mem_ctx, r);
   13332           0 :         if (tevent_req_nomem(subreq, req)) {
   13333           0 :                 return tevent_req_post(req, ev);
   13334             :         }
   13335           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumPerMachineConnections_r_done, req);
   13336             : 
   13337           0 :         return req;
   13338             : }
   13339             : 
   13340           0 : static void dcerpc_winspool_AsyncEnumPerMachineConnections_r_done(struct tevent_req *subreq)
   13341             : {
   13342           0 :         struct tevent_req *req =
   13343           0 :                 tevent_req_callback_data(subreq,
   13344             :                 struct tevent_req);
   13345           0 :         NTSTATUS status;
   13346             : 
   13347           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   13348           0 :         TALLOC_FREE(subreq);
   13349           0 :         if (tevent_req_nterror(req, status)) {
   13350           0 :                 return;
   13351             :         }
   13352             : 
   13353           0 :         tevent_req_done(req);
   13354             : }
   13355             : 
   13356           0 : NTSTATUS dcerpc_winspool_AsyncEnumPerMachineConnections_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   13357             : {
   13358           0 :         struct dcerpc_winspool_AsyncEnumPerMachineConnections_r_state *state =
   13359           0 :                 tevent_req_data(req,
   13360             :                 struct dcerpc_winspool_AsyncEnumPerMachineConnections_r_state);
   13361           0 :         NTSTATUS status;
   13362             : 
   13363           0 :         if (tevent_req_is_nterror(req, &status)) {
   13364           0 :                 tevent_req_received(req);
   13365           0 :                 return status;
   13366             :         }
   13367             : 
   13368           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13369             : 
   13370           0 :         tevent_req_received(req);
   13371           0 :         return NT_STATUS_OK;
   13372             : }
   13373             : 
   13374           0 : NTSTATUS dcerpc_winspool_AsyncEnumPerMachineConnections_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncEnumPerMachineConnections *r)
   13375             : {
   13376           0 :         NTSTATUS status;
   13377             : 
   13378           0 :         status = dcerpc_binding_handle_call(h,
   13379             :                         NULL, &ndr_table_iremotewinspool,
   13380             :                         NDR_WINSPOOL_ASYNCENUMPERMACHINECONNECTIONS, mem_ctx, r);
   13381             : 
   13382           0 :         return status;
   13383             : }
   13384             : 
   13385             : struct dcerpc_winspool_AsyncEnumPerMachineConnections_state {
   13386             :         struct winspool_AsyncEnumPerMachineConnections orig;
   13387             :         struct winspool_AsyncEnumPerMachineConnections tmp;
   13388             :         TALLOC_CTX *out_mem_ctx;
   13389             : };
   13390             : 
   13391             : static void dcerpc_winspool_AsyncEnumPerMachineConnections_done(struct tevent_req *subreq);
   13392             : 
   13393           0 : struct tevent_req *dcerpc_winspool_AsyncEnumPerMachineConnections_send(TALLOC_CTX *mem_ctx,
   13394             :                                                                        struct tevent_context *ev,
   13395             :                                                                        struct dcerpc_binding_handle *h,
   13396             :                                                                        const char *_pServer /* [in] [charset(UTF16),unique] */,
   13397             :                                                                        uint8_t *_pPrinterEnum /* [in,out] [size_is(cbBuf),unique] */,
   13398             :                                                                        uint32_t _cbBuf /* [in]  */,
   13399             :                                                                        uint32_t *_pcbNeeded /* [out] [ref] */,
   13400             :                                                                        uint32_t *_pcReturned /* [out] [ref] */)
   13401             : {
   13402           0 :         struct tevent_req *req;
   13403           0 :         struct dcerpc_winspool_AsyncEnumPerMachineConnections_state *state;
   13404           0 :         struct tevent_req *subreq;
   13405             : 
   13406           0 :         req = tevent_req_create(mem_ctx, &state,
   13407             :                                 struct dcerpc_winspool_AsyncEnumPerMachineConnections_state);
   13408           0 :         if (req == NULL) {
   13409           0 :                 return NULL;
   13410             :         }
   13411           0 :         state->out_mem_ctx = NULL;
   13412             : 
   13413             :         /* In parameters */
   13414           0 :         state->orig.in.pServer = _pServer;
   13415           0 :         state->orig.in.pPrinterEnum = _pPrinterEnum;
   13416           0 :         state->orig.in.cbBuf = _cbBuf;
   13417             : 
   13418             :         /* Out parameters */
   13419           0 :         state->orig.out.pPrinterEnum = _pPrinterEnum;
   13420           0 :         state->orig.out.pcbNeeded = _pcbNeeded;
   13421           0 :         state->orig.out.pcReturned = _pcReturned;
   13422             : 
   13423             :         /* Result */
   13424           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   13425             : 
   13426           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   13427             :                              "dcerpc_winspool_AsyncEnumPerMachineConnections_out_memory");
   13428           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   13429           0 :                 return tevent_req_post(req, ev);
   13430             :         }
   13431             : 
   13432             :         /* make a temporary copy, that we pass to the dispatch function */
   13433           0 :         state->tmp = state->orig;
   13434             : 
   13435           0 :         subreq = dcerpc_winspool_AsyncEnumPerMachineConnections_r_send(state, ev, h, &state->tmp);
   13436           0 :         if (tevent_req_nomem(subreq, req)) {
   13437           0 :                 return tevent_req_post(req, ev);
   13438             :         }
   13439           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumPerMachineConnections_done, req);
   13440           0 :         return req;
   13441             : }
   13442             : 
   13443           0 : static void dcerpc_winspool_AsyncEnumPerMachineConnections_done(struct tevent_req *subreq)
   13444             : {
   13445           0 :         struct tevent_req *req = tevent_req_callback_data(
   13446             :                 subreq, struct tevent_req);
   13447           0 :         struct dcerpc_winspool_AsyncEnumPerMachineConnections_state *state = tevent_req_data(
   13448             :                 req, struct dcerpc_winspool_AsyncEnumPerMachineConnections_state);
   13449           0 :         NTSTATUS status;
   13450           0 :         TALLOC_CTX *mem_ctx;
   13451             : 
   13452           0 :         if (state->out_mem_ctx) {
   13453           0 :                 mem_ctx = state->out_mem_ctx;
   13454             :         } else {
   13455           0 :                 mem_ctx = state;
   13456             :         }
   13457             : 
   13458           0 :         status = dcerpc_winspool_AsyncEnumPerMachineConnections_r_recv(subreq, mem_ctx);
   13459           0 :         TALLOC_FREE(subreq);
   13460           0 :         if (tevent_req_nterror(req, status)) {
   13461           0 :                 return;
   13462             :         }
   13463             : 
   13464             :         /* Copy out parameters */
   13465           0 :         if (state->orig.out.pPrinterEnum && state->tmp.out.pPrinterEnum) {
   13466             :                 {
   13467           0 :                         size_t _copy_len_pPrinterEnum;
   13468           0 :                         _copy_len_pPrinterEnum = state->tmp.in.cbBuf;
   13469           0 :                         if (state->orig.out.pPrinterEnum != state->tmp.out.pPrinterEnum) {
   13470           0 :                                 memcpy(state->orig.out.pPrinterEnum, state->tmp.out.pPrinterEnum, _copy_len_pPrinterEnum * sizeof(*state->orig.out.pPrinterEnum));
   13471             :                         }
   13472             :                 }
   13473             :         }
   13474           0 :         *state->orig.out.pcbNeeded = *state->tmp.out.pcbNeeded;
   13475           0 :         *state->orig.out.pcReturned = *state->tmp.out.pcReturned;
   13476             : 
   13477             :         /* Copy result */
   13478           0 :         state->orig.out.result = state->tmp.out.result;
   13479             : 
   13480             :         /* Reset temporary structure */
   13481           0 :         NDR_ZERO_STRUCT(state->tmp);
   13482             : 
   13483           0 :         tevent_req_done(req);
   13484             : }
   13485             : 
   13486           0 : NTSTATUS dcerpc_winspool_AsyncEnumPerMachineConnections_recv(struct tevent_req *req,
   13487             :                                                              TALLOC_CTX *mem_ctx,
   13488             :                                                              WERROR *result)
   13489             : {
   13490           0 :         struct dcerpc_winspool_AsyncEnumPerMachineConnections_state *state = tevent_req_data(
   13491             :                 req, struct dcerpc_winspool_AsyncEnumPerMachineConnections_state);
   13492           0 :         NTSTATUS status;
   13493             : 
   13494           0 :         if (tevent_req_is_nterror(req, &status)) {
   13495           0 :                 tevent_req_received(req);
   13496           0 :                 return status;
   13497             :         }
   13498             : 
   13499             :         /* Steal possible out parameters to the callers context */
   13500           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13501             : 
   13502             :         /* Return result */
   13503           0 :         *result = state->orig.out.result;
   13504             : 
   13505           0 :         tevent_req_received(req);
   13506           0 :         return NT_STATUS_OK;
   13507             : }
   13508             : 
   13509           0 : NTSTATUS dcerpc_winspool_AsyncEnumPerMachineConnections(struct dcerpc_binding_handle *h,
   13510             :                                                         TALLOC_CTX *mem_ctx,
   13511             :                                                         const char *_pServer /* [in] [charset(UTF16),unique] */,
   13512             :                                                         uint8_t *_pPrinterEnum /* [in,out] [size_is(cbBuf),unique] */,
   13513             :                                                         uint32_t _cbBuf /* [in]  */,
   13514             :                                                         uint32_t *_pcbNeeded /* [out] [ref] */,
   13515             :                                                         uint32_t *_pcReturned /* [out] [ref] */,
   13516             :                                                         WERROR *result)
   13517             : {
   13518           0 :         struct winspool_AsyncEnumPerMachineConnections r;
   13519           0 :         NTSTATUS status;
   13520             : 
   13521             :         /* In parameters */
   13522           0 :         r.in.pServer = _pServer;
   13523           0 :         r.in.pPrinterEnum = _pPrinterEnum;
   13524           0 :         r.in.cbBuf = _cbBuf;
   13525             : 
   13526             :         /* Out parameters */
   13527           0 :         r.out.pPrinterEnum = _pPrinterEnum;
   13528           0 :         r.out.pcbNeeded = _pcbNeeded;
   13529           0 :         r.out.pcReturned = _pcReturned;
   13530             : 
   13531             :         /* Result */
   13532           0 :         NDR_ZERO_STRUCT(r.out.result);
   13533             : 
   13534           0 :         status = dcerpc_winspool_AsyncEnumPerMachineConnections_r(h, mem_ctx, &r);
   13535           0 :         if (!NT_STATUS_IS_OK(status)) {
   13536           0 :                 return status;
   13537             :         }
   13538             : 
   13539             :         /* Return variables */
   13540           0 :         if (_pPrinterEnum && r.out.pPrinterEnum) {
   13541             :                 {
   13542           0 :                         size_t _copy_len_pPrinterEnum;
   13543           0 :                         _copy_len_pPrinterEnum = r.in.cbBuf;
   13544           0 :                         if (_pPrinterEnum != r.out.pPrinterEnum) {
   13545           0 :                                 memcpy(_pPrinterEnum, r.out.pPrinterEnum, _copy_len_pPrinterEnum * sizeof(*_pPrinterEnum));
   13546             :                         }
   13547             :                 }
   13548             :         }
   13549           0 :         *_pcbNeeded = *r.out.pcbNeeded;
   13550           0 :         *_pcReturned = *r.out.pcReturned;
   13551             : 
   13552             :         /* Return result */
   13553           0 :         *result = r.out.result;
   13554             : 
   13555           0 :         return NT_STATUS_OK;
   13556             : }
   13557             : 
   13558             : struct dcerpc_winspool_SyncRegisterForRemoteNotifications_r_state {
   13559             :         TALLOC_CTX *out_mem_ctx;
   13560             : };
   13561             : 
   13562             : static void dcerpc_winspool_SyncRegisterForRemoteNotifications_r_done(struct tevent_req *subreq);
   13563             : 
   13564           0 : struct tevent_req *dcerpc_winspool_SyncRegisterForRemoteNotifications_r_send(TALLOC_CTX *mem_ctx,
   13565             :         struct tevent_context *ev,
   13566             :         struct dcerpc_binding_handle *h,
   13567             :         struct winspool_SyncRegisterForRemoteNotifications *r)
   13568             : {
   13569           0 :         struct tevent_req *req;
   13570           0 :         struct dcerpc_winspool_SyncRegisterForRemoteNotifications_r_state *state;
   13571           0 :         struct tevent_req *subreq;
   13572             : 
   13573           0 :         req = tevent_req_create(mem_ctx, &state,
   13574             :                                 struct dcerpc_winspool_SyncRegisterForRemoteNotifications_r_state);
   13575           0 :         if (req == NULL) {
   13576           0 :                 return NULL;
   13577             :         }
   13578             : 
   13579           0 :         state->out_mem_ctx = talloc_new(state);
   13580           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   13581           0 :                 return tevent_req_post(req, ev);
   13582             :         }
   13583             : 
   13584           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   13585             :                         NULL, &ndr_table_iremotewinspool,
   13586           0 :                         NDR_WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS, state->out_mem_ctx, r);
   13587           0 :         if (tevent_req_nomem(subreq, req)) {
   13588           0 :                 return tevent_req_post(req, ev);
   13589             :         }
   13590           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_SyncRegisterForRemoteNotifications_r_done, req);
   13591             : 
   13592           0 :         return req;
   13593             : }
   13594             : 
   13595           0 : static void dcerpc_winspool_SyncRegisterForRemoteNotifications_r_done(struct tevent_req *subreq)
   13596             : {
   13597           0 :         struct tevent_req *req =
   13598           0 :                 tevent_req_callback_data(subreq,
   13599             :                 struct tevent_req);
   13600           0 :         NTSTATUS status;
   13601             : 
   13602           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   13603           0 :         TALLOC_FREE(subreq);
   13604           0 :         if (tevent_req_nterror(req, status)) {
   13605           0 :                 return;
   13606             :         }
   13607             : 
   13608           0 :         tevent_req_done(req);
   13609             : }
   13610             : 
   13611           0 : NTSTATUS dcerpc_winspool_SyncRegisterForRemoteNotifications_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   13612             : {
   13613           0 :         struct dcerpc_winspool_SyncRegisterForRemoteNotifications_r_state *state =
   13614           0 :                 tevent_req_data(req,
   13615             :                 struct dcerpc_winspool_SyncRegisterForRemoteNotifications_r_state);
   13616           0 :         NTSTATUS status;
   13617             : 
   13618           0 :         if (tevent_req_is_nterror(req, &status)) {
   13619           0 :                 tevent_req_received(req);
   13620           0 :                 return status;
   13621             :         }
   13622             : 
   13623           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13624             : 
   13625           0 :         tevent_req_received(req);
   13626           0 :         return NT_STATUS_OK;
   13627             : }
   13628             : 
   13629           0 : NTSTATUS dcerpc_winspool_SyncRegisterForRemoteNotifications_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_SyncRegisterForRemoteNotifications *r)
   13630             : {
   13631           0 :         NTSTATUS status;
   13632             : 
   13633           0 :         status = dcerpc_binding_handle_call(h,
   13634             :                         NULL, &ndr_table_iremotewinspool,
   13635             :                         NDR_WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS, mem_ctx, r);
   13636             : 
   13637           0 :         return status;
   13638             : }
   13639             : 
   13640             : struct dcerpc_winspool_SyncRegisterForRemoteNotifications_state {
   13641             :         struct winspool_SyncRegisterForRemoteNotifications orig;
   13642             :         struct winspool_SyncRegisterForRemoteNotifications tmp;
   13643             :         TALLOC_CTX *out_mem_ctx;
   13644             : };
   13645             : 
   13646             : static void dcerpc_winspool_SyncRegisterForRemoteNotifications_done(struct tevent_req *subreq);
   13647             : 
   13648           0 : struct tevent_req *dcerpc_winspool_SyncRegisterForRemoteNotifications_send(TALLOC_CTX *mem_ctx,
   13649             :                                                                            struct tevent_context *ev,
   13650             :                                                                            struct dcerpc_binding_handle *h,
   13651             :                                                                            struct policy_handle _hPrinter /* [in]  */,
   13652             :                                                                            struct winspool_PrintPropertiesCollection *_pNotifyFilter /* [in] [ref] */,
   13653             :                                                                            struct policy_handle *_phRpcHandle /* [out] [ref] */)
   13654             : {
   13655           0 :         struct tevent_req *req;
   13656           0 :         struct dcerpc_winspool_SyncRegisterForRemoteNotifications_state *state;
   13657           0 :         struct tevent_req *subreq;
   13658             : 
   13659           0 :         req = tevent_req_create(mem_ctx, &state,
   13660             :                                 struct dcerpc_winspool_SyncRegisterForRemoteNotifications_state);
   13661           0 :         if (req == NULL) {
   13662           0 :                 return NULL;
   13663             :         }
   13664           0 :         state->out_mem_ctx = NULL;
   13665             : 
   13666             :         /* In parameters */
   13667           0 :         state->orig.in.hPrinter = _hPrinter;
   13668           0 :         state->orig.in.pNotifyFilter = _pNotifyFilter;
   13669             : 
   13670             :         /* Out parameters */
   13671           0 :         state->orig.out.phRpcHandle = _phRpcHandle;
   13672             : 
   13673             :         /* Result */
   13674           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   13675             : 
   13676           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   13677             :                              "dcerpc_winspool_SyncRegisterForRemoteNotifications_out_memory");
   13678           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   13679           0 :                 return tevent_req_post(req, ev);
   13680             :         }
   13681             : 
   13682             :         /* make a temporary copy, that we pass to the dispatch function */
   13683           0 :         state->tmp = state->orig;
   13684             : 
   13685           0 :         subreq = dcerpc_winspool_SyncRegisterForRemoteNotifications_r_send(state, ev, h, &state->tmp);
   13686           0 :         if (tevent_req_nomem(subreq, req)) {
   13687           0 :                 return tevent_req_post(req, ev);
   13688             :         }
   13689           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_SyncRegisterForRemoteNotifications_done, req);
   13690           0 :         return req;
   13691             : }
   13692             : 
   13693           0 : static void dcerpc_winspool_SyncRegisterForRemoteNotifications_done(struct tevent_req *subreq)
   13694             : {
   13695           0 :         struct tevent_req *req = tevent_req_callback_data(
   13696             :                 subreq, struct tevent_req);
   13697           0 :         struct dcerpc_winspool_SyncRegisterForRemoteNotifications_state *state = tevent_req_data(
   13698             :                 req, struct dcerpc_winspool_SyncRegisterForRemoteNotifications_state);
   13699           0 :         NTSTATUS status;
   13700           0 :         TALLOC_CTX *mem_ctx;
   13701             : 
   13702           0 :         if (state->out_mem_ctx) {
   13703           0 :                 mem_ctx = state->out_mem_ctx;
   13704             :         } else {
   13705           0 :                 mem_ctx = state;
   13706             :         }
   13707             : 
   13708           0 :         status = dcerpc_winspool_SyncRegisterForRemoteNotifications_r_recv(subreq, mem_ctx);
   13709           0 :         TALLOC_FREE(subreq);
   13710           0 :         if (tevent_req_nterror(req, status)) {
   13711           0 :                 return;
   13712             :         }
   13713             : 
   13714             :         /* Copy out parameters */
   13715           0 :         *state->orig.out.phRpcHandle = *state->tmp.out.phRpcHandle;
   13716             : 
   13717             :         /* Copy result */
   13718           0 :         state->orig.out.result = state->tmp.out.result;
   13719             : 
   13720             :         /* Reset temporary structure */
   13721           0 :         NDR_ZERO_STRUCT(state->tmp);
   13722             : 
   13723           0 :         tevent_req_done(req);
   13724             : }
   13725             : 
   13726           0 : NTSTATUS dcerpc_winspool_SyncRegisterForRemoteNotifications_recv(struct tevent_req *req,
   13727             :                                                                  TALLOC_CTX *mem_ctx,
   13728             :                                                                  HRESULT *result)
   13729             : {
   13730           0 :         struct dcerpc_winspool_SyncRegisterForRemoteNotifications_state *state = tevent_req_data(
   13731             :                 req, struct dcerpc_winspool_SyncRegisterForRemoteNotifications_state);
   13732           0 :         NTSTATUS status;
   13733             : 
   13734           0 :         if (tevent_req_is_nterror(req, &status)) {
   13735           0 :                 tevent_req_received(req);
   13736           0 :                 return status;
   13737             :         }
   13738             : 
   13739             :         /* Steal possible out parameters to the callers context */
   13740           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13741             : 
   13742             :         /* Return result */
   13743           0 :         *result = state->orig.out.result;
   13744             : 
   13745           0 :         tevent_req_received(req);
   13746           0 :         return NT_STATUS_OK;
   13747             : }
   13748             : 
   13749           0 : NTSTATUS dcerpc_winspool_SyncRegisterForRemoteNotifications(struct dcerpc_binding_handle *h,
   13750             :                                                             TALLOC_CTX *mem_ctx,
   13751             :                                                             struct policy_handle _hPrinter /* [in]  */,
   13752             :                                                             struct winspool_PrintPropertiesCollection *_pNotifyFilter /* [in] [ref] */,
   13753             :                                                             struct policy_handle *_phRpcHandle /* [out] [ref] */,
   13754             :                                                             HRESULT *result)
   13755             : {
   13756           0 :         struct winspool_SyncRegisterForRemoteNotifications r;
   13757           0 :         NTSTATUS status;
   13758             : 
   13759             :         /* In parameters */
   13760           0 :         r.in.hPrinter = _hPrinter;
   13761           0 :         r.in.pNotifyFilter = _pNotifyFilter;
   13762             : 
   13763             :         /* Out parameters */
   13764           0 :         r.out.phRpcHandle = _phRpcHandle;
   13765             : 
   13766             :         /* Result */
   13767           0 :         NDR_ZERO_STRUCT(r.out.result);
   13768             : 
   13769           0 :         status = dcerpc_winspool_SyncRegisterForRemoteNotifications_r(h, mem_ctx, &r);
   13770           0 :         if (!NT_STATUS_IS_OK(status)) {
   13771           0 :                 return status;
   13772             :         }
   13773             : 
   13774             :         /* Return variables */
   13775           0 :         *_phRpcHandle = *r.out.phRpcHandle;
   13776             : 
   13777             :         /* Return result */
   13778           0 :         *result = r.out.result;
   13779             : 
   13780           0 :         return NT_STATUS_OK;
   13781             : }
   13782             : 
   13783             : struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_state {
   13784             :         TALLOC_CTX *out_mem_ctx;
   13785             : };
   13786             : 
   13787             : static void dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_done(struct tevent_req *subreq);
   13788             : 
   13789           0 : struct tevent_req *dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_send(TALLOC_CTX *mem_ctx,
   13790             :         struct tevent_context *ev,
   13791             :         struct dcerpc_binding_handle *h,
   13792             :         struct winspool_SyncUnRegisterForRemoteNotifications *r)
   13793             : {
   13794           0 :         struct tevent_req *req;
   13795           0 :         struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_state *state;
   13796           0 :         struct tevent_req *subreq;
   13797             : 
   13798           0 :         req = tevent_req_create(mem_ctx, &state,
   13799             :                                 struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_state);
   13800           0 :         if (req == NULL) {
   13801           0 :                 return NULL;
   13802             :         }
   13803             : 
   13804           0 :         state->out_mem_ctx = talloc_new(state);
   13805           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   13806           0 :                 return tevent_req_post(req, ev);
   13807             :         }
   13808             : 
   13809           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   13810             :                         NULL, &ndr_table_iremotewinspool,
   13811           0 :                         NDR_WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS, state->out_mem_ctx, r);
   13812           0 :         if (tevent_req_nomem(subreq, req)) {
   13813           0 :                 return tevent_req_post(req, ev);
   13814             :         }
   13815           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_done, req);
   13816             : 
   13817           0 :         return req;
   13818             : }
   13819             : 
   13820           0 : static void dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_done(struct tevent_req *subreq)
   13821             : {
   13822           0 :         struct tevent_req *req =
   13823           0 :                 tevent_req_callback_data(subreq,
   13824             :                 struct tevent_req);
   13825           0 :         NTSTATUS status;
   13826             : 
   13827           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   13828           0 :         TALLOC_FREE(subreq);
   13829           0 :         if (tevent_req_nterror(req, status)) {
   13830           0 :                 return;
   13831             :         }
   13832             : 
   13833           0 :         tevent_req_done(req);
   13834             : }
   13835             : 
   13836           0 : NTSTATUS dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   13837             : {
   13838           0 :         struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_state *state =
   13839           0 :                 tevent_req_data(req,
   13840             :                 struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_state);
   13841           0 :         NTSTATUS status;
   13842             : 
   13843           0 :         if (tevent_req_is_nterror(req, &status)) {
   13844           0 :                 tevent_req_received(req);
   13845           0 :                 return status;
   13846             :         }
   13847             : 
   13848           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13849             : 
   13850           0 :         tevent_req_received(req);
   13851           0 :         return NT_STATUS_OK;
   13852             : }
   13853             : 
   13854           0 : NTSTATUS dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_SyncUnRegisterForRemoteNotifications *r)
   13855             : {
   13856           0 :         NTSTATUS status;
   13857             : 
   13858           0 :         status = dcerpc_binding_handle_call(h,
   13859             :                         NULL, &ndr_table_iremotewinspool,
   13860             :                         NDR_WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS, mem_ctx, r);
   13861             : 
   13862           0 :         return status;
   13863             : }
   13864             : 
   13865             : struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_state {
   13866             :         struct winspool_SyncUnRegisterForRemoteNotifications orig;
   13867             :         struct winspool_SyncUnRegisterForRemoteNotifications tmp;
   13868             :         TALLOC_CTX *out_mem_ctx;
   13869             : };
   13870             : 
   13871             : static void dcerpc_winspool_SyncUnRegisterForRemoteNotifications_done(struct tevent_req *subreq);
   13872             : 
   13873           0 : struct tevent_req *dcerpc_winspool_SyncUnRegisterForRemoteNotifications_send(TALLOC_CTX *mem_ctx,
   13874             :                                                                              struct tevent_context *ev,
   13875             :                                                                              struct dcerpc_binding_handle *h,
   13876             :                                                                              struct policy_handle *_phRpcHandle /* [in,out] [ref] */)
   13877             : {
   13878           0 :         struct tevent_req *req;
   13879           0 :         struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_state *state;
   13880           0 :         struct tevent_req *subreq;
   13881             : 
   13882           0 :         req = tevent_req_create(mem_ctx, &state,
   13883             :                                 struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_state);
   13884           0 :         if (req == NULL) {
   13885           0 :                 return NULL;
   13886             :         }
   13887           0 :         state->out_mem_ctx = NULL;
   13888             : 
   13889             :         /* In parameters */
   13890           0 :         state->orig.in.phRpcHandle = _phRpcHandle;
   13891             : 
   13892             :         /* Out parameters */
   13893           0 :         state->orig.out.phRpcHandle = _phRpcHandle;
   13894             : 
   13895             :         /* Result */
   13896           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   13897             : 
   13898           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   13899             :                              "dcerpc_winspool_SyncUnRegisterForRemoteNotifications_out_memory");
   13900           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   13901           0 :                 return tevent_req_post(req, ev);
   13902             :         }
   13903             : 
   13904             :         /* make a temporary copy, that we pass to the dispatch function */
   13905           0 :         state->tmp = state->orig;
   13906             : 
   13907           0 :         subreq = dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_send(state, ev, h, &state->tmp);
   13908           0 :         if (tevent_req_nomem(subreq, req)) {
   13909           0 :                 return tevent_req_post(req, ev);
   13910             :         }
   13911           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_SyncUnRegisterForRemoteNotifications_done, req);
   13912           0 :         return req;
   13913             : }
   13914             : 
   13915           0 : static void dcerpc_winspool_SyncUnRegisterForRemoteNotifications_done(struct tevent_req *subreq)
   13916             : {
   13917           0 :         struct tevent_req *req = tevent_req_callback_data(
   13918             :                 subreq, struct tevent_req);
   13919           0 :         struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_state *state = tevent_req_data(
   13920             :                 req, struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_state);
   13921           0 :         NTSTATUS status;
   13922           0 :         TALLOC_CTX *mem_ctx;
   13923             : 
   13924           0 :         if (state->out_mem_ctx) {
   13925           0 :                 mem_ctx = state->out_mem_ctx;
   13926             :         } else {
   13927           0 :                 mem_ctx = state;
   13928             :         }
   13929             : 
   13930           0 :         status = dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r_recv(subreq, mem_ctx);
   13931           0 :         TALLOC_FREE(subreq);
   13932           0 :         if (tevent_req_nterror(req, status)) {
   13933           0 :                 return;
   13934             :         }
   13935             : 
   13936             :         /* Copy out parameters */
   13937           0 :         *state->orig.out.phRpcHandle = *state->tmp.out.phRpcHandle;
   13938             : 
   13939             :         /* Copy result */
   13940           0 :         state->orig.out.result = state->tmp.out.result;
   13941             : 
   13942             :         /* Reset temporary structure */
   13943           0 :         NDR_ZERO_STRUCT(state->tmp);
   13944             : 
   13945           0 :         tevent_req_done(req);
   13946             : }
   13947             : 
   13948           0 : NTSTATUS dcerpc_winspool_SyncUnRegisterForRemoteNotifications_recv(struct tevent_req *req,
   13949             :                                                                    TALLOC_CTX *mem_ctx,
   13950             :                                                                    HRESULT *result)
   13951             : {
   13952           0 :         struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_state *state = tevent_req_data(
   13953             :                 req, struct dcerpc_winspool_SyncUnRegisterForRemoteNotifications_state);
   13954           0 :         NTSTATUS status;
   13955             : 
   13956           0 :         if (tevent_req_is_nterror(req, &status)) {
   13957           0 :                 tevent_req_received(req);
   13958           0 :                 return status;
   13959             :         }
   13960             : 
   13961             :         /* Steal possible out parameters to the callers context */
   13962           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13963             : 
   13964             :         /* Return result */
   13965           0 :         *result = state->orig.out.result;
   13966             : 
   13967           0 :         tevent_req_received(req);
   13968           0 :         return NT_STATUS_OK;
   13969             : }
   13970             : 
   13971           0 : NTSTATUS dcerpc_winspool_SyncUnRegisterForRemoteNotifications(struct dcerpc_binding_handle *h,
   13972             :                                                               TALLOC_CTX *mem_ctx,
   13973             :                                                               struct policy_handle *_phRpcHandle /* [in,out] [ref] */,
   13974             :                                                               HRESULT *result)
   13975             : {
   13976           0 :         struct winspool_SyncUnRegisterForRemoteNotifications r;
   13977           0 :         NTSTATUS status;
   13978             : 
   13979             :         /* In parameters */
   13980           0 :         r.in.phRpcHandle = _phRpcHandle;
   13981             : 
   13982             :         /* Out parameters */
   13983           0 :         r.out.phRpcHandle = _phRpcHandle;
   13984             : 
   13985             :         /* Result */
   13986           0 :         NDR_ZERO_STRUCT(r.out.result);
   13987             : 
   13988           0 :         status = dcerpc_winspool_SyncUnRegisterForRemoteNotifications_r(h, mem_ctx, &r);
   13989           0 :         if (!NT_STATUS_IS_OK(status)) {
   13990           0 :                 return status;
   13991             :         }
   13992             : 
   13993             :         /* Return variables */
   13994           0 :         *_phRpcHandle = *r.out.phRpcHandle;
   13995             : 
   13996             :         /* Return result */
   13997           0 :         *result = r.out.result;
   13998             : 
   13999           0 :         return NT_STATUS_OK;
   14000             : }
   14001             : 
   14002             : struct dcerpc_winspool_SyncRefreshRemoteNotifications_r_state {
   14003             :         TALLOC_CTX *out_mem_ctx;
   14004             : };
   14005             : 
   14006             : static void dcerpc_winspool_SyncRefreshRemoteNotifications_r_done(struct tevent_req *subreq);
   14007             : 
   14008           0 : struct tevent_req *dcerpc_winspool_SyncRefreshRemoteNotifications_r_send(TALLOC_CTX *mem_ctx,
   14009             :         struct tevent_context *ev,
   14010             :         struct dcerpc_binding_handle *h,
   14011             :         struct winspool_SyncRefreshRemoteNotifications *r)
   14012             : {
   14013           0 :         struct tevent_req *req;
   14014           0 :         struct dcerpc_winspool_SyncRefreshRemoteNotifications_r_state *state;
   14015           0 :         struct tevent_req *subreq;
   14016             : 
   14017           0 :         req = tevent_req_create(mem_ctx, &state,
   14018             :                                 struct dcerpc_winspool_SyncRefreshRemoteNotifications_r_state);
   14019           0 :         if (req == NULL) {
   14020           0 :                 return NULL;
   14021             :         }
   14022             : 
   14023           0 :         state->out_mem_ctx = talloc_new(state);
   14024           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   14025           0 :                 return tevent_req_post(req, ev);
   14026             :         }
   14027             : 
   14028           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   14029             :                         NULL, &ndr_table_iremotewinspool,
   14030           0 :                         NDR_WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS, state->out_mem_ctx, r);
   14031           0 :         if (tevent_req_nomem(subreq, req)) {
   14032           0 :                 return tevent_req_post(req, ev);
   14033             :         }
   14034           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_SyncRefreshRemoteNotifications_r_done, req);
   14035             : 
   14036           0 :         return req;
   14037             : }
   14038             : 
   14039           0 : static void dcerpc_winspool_SyncRefreshRemoteNotifications_r_done(struct tevent_req *subreq)
   14040             : {
   14041           0 :         struct tevent_req *req =
   14042           0 :                 tevent_req_callback_data(subreq,
   14043             :                 struct tevent_req);
   14044           0 :         NTSTATUS status;
   14045             : 
   14046           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   14047           0 :         TALLOC_FREE(subreq);
   14048           0 :         if (tevent_req_nterror(req, status)) {
   14049           0 :                 return;
   14050             :         }
   14051             : 
   14052           0 :         tevent_req_done(req);
   14053             : }
   14054             : 
   14055           0 : NTSTATUS dcerpc_winspool_SyncRefreshRemoteNotifications_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   14056             : {
   14057           0 :         struct dcerpc_winspool_SyncRefreshRemoteNotifications_r_state *state =
   14058           0 :                 tevent_req_data(req,
   14059             :                 struct dcerpc_winspool_SyncRefreshRemoteNotifications_r_state);
   14060           0 :         NTSTATUS status;
   14061             : 
   14062           0 :         if (tevent_req_is_nterror(req, &status)) {
   14063           0 :                 tevent_req_received(req);
   14064           0 :                 return status;
   14065             :         }
   14066             : 
   14067           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14068             : 
   14069           0 :         tevent_req_received(req);
   14070           0 :         return NT_STATUS_OK;
   14071             : }
   14072             : 
   14073           0 : NTSTATUS dcerpc_winspool_SyncRefreshRemoteNotifications_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_SyncRefreshRemoteNotifications *r)
   14074             : {
   14075           0 :         NTSTATUS status;
   14076             : 
   14077           0 :         status = dcerpc_binding_handle_call(h,
   14078             :                         NULL, &ndr_table_iremotewinspool,
   14079             :                         NDR_WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS, mem_ctx, r);
   14080             : 
   14081           0 :         return status;
   14082             : }
   14083             : 
   14084             : struct dcerpc_winspool_SyncRefreshRemoteNotifications_state {
   14085             :         struct winspool_SyncRefreshRemoteNotifications orig;
   14086             :         struct winspool_SyncRefreshRemoteNotifications tmp;
   14087             :         TALLOC_CTX *out_mem_ctx;
   14088             : };
   14089             : 
   14090             : static void dcerpc_winspool_SyncRefreshRemoteNotifications_done(struct tevent_req *subreq);
   14091             : 
   14092           0 : struct tevent_req *dcerpc_winspool_SyncRefreshRemoteNotifications_send(TALLOC_CTX *mem_ctx,
   14093             :                                                                        struct tevent_context *ev,
   14094             :                                                                        struct dcerpc_binding_handle *h,
   14095             :                                                                        struct policy_handle _hRpcHandle /* [in]  */,
   14096             :                                                                        struct winspool_PrintPropertiesCollection *_pNotifyFilter /* [in] [ref] */,
   14097             :                                                                        struct winspool_PrintPropertiesCollection **_ppNotifyData /* [out] [ref] */)
   14098             : {
   14099           0 :         struct tevent_req *req;
   14100           0 :         struct dcerpc_winspool_SyncRefreshRemoteNotifications_state *state;
   14101           0 :         struct tevent_req *subreq;
   14102             : 
   14103           0 :         req = tevent_req_create(mem_ctx, &state,
   14104             :                                 struct dcerpc_winspool_SyncRefreshRemoteNotifications_state);
   14105           0 :         if (req == NULL) {
   14106           0 :                 return NULL;
   14107             :         }
   14108           0 :         state->out_mem_ctx = NULL;
   14109             : 
   14110             :         /* In parameters */
   14111           0 :         state->orig.in.hRpcHandle = _hRpcHandle;
   14112           0 :         state->orig.in.pNotifyFilter = _pNotifyFilter;
   14113             : 
   14114             :         /* Out parameters */
   14115           0 :         state->orig.out.ppNotifyData = _ppNotifyData;
   14116             : 
   14117             :         /* Result */
   14118           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   14119             : 
   14120           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   14121             :                              "dcerpc_winspool_SyncRefreshRemoteNotifications_out_memory");
   14122           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   14123           0 :                 return tevent_req_post(req, ev);
   14124             :         }
   14125             : 
   14126             :         /* make a temporary copy, that we pass to the dispatch function */
   14127           0 :         state->tmp = state->orig;
   14128             : 
   14129           0 :         subreq = dcerpc_winspool_SyncRefreshRemoteNotifications_r_send(state, ev, h, &state->tmp);
   14130           0 :         if (tevent_req_nomem(subreq, req)) {
   14131           0 :                 return tevent_req_post(req, ev);
   14132             :         }
   14133           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_SyncRefreshRemoteNotifications_done, req);
   14134           0 :         return req;
   14135             : }
   14136             : 
   14137           0 : static void dcerpc_winspool_SyncRefreshRemoteNotifications_done(struct tevent_req *subreq)
   14138             : {
   14139           0 :         struct tevent_req *req = tevent_req_callback_data(
   14140             :                 subreq, struct tevent_req);
   14141           0 :         struct dcerpc_winspool_SyncRefreshRemoteNotifications_state *state = tevent_req_data(
   14142             :                 req, struct dcerpc_winspool_SyncRefreshRemoteNotifications_state);
   14143           0 :         NTSTATUS status;
   14144           0 :         TALLOC_CTX *mem_ctx;
   14145             : 
   14146           0 :         if (state->out_mem_ctx) {
   14147           0 :                 mem_ctx = state->out_mem_ctx;
   14148             :         } else {
   14149           0 :                 mem_ctx = state;
   14150             :         }
   14151             : 
   14152           0 :         status = dcerpc_winspool_SyncRefreshRemoteNotifications_r_recv(subreq, mem_ctx);
   14153           0 :         TALLOC_FREE(subreq);
   14154           0 :         if (tevent_req_nterror(req, status)) {
   14155           0 :                 return;
   14156             :         }
   14157             : 
   14158             :         /* Copy out parameters */
   14159           0 :         *state->orig.out.ppNotifyData = *state->tmp.out.ppNotifyData;
   14160             : 
   14161             :         /* Copy result */
   14162           0 :         state->orig.out.result = state->tmp.out.result;
   14163             : 
   14164             :         /* Reset temporary structure */
   14165           0 :         NDR_ZERO_STRUCT(state->tmp);
   14166             : 
   14167           0 :         tevent_req_done(req);
   14168             : }
   14169             : 
   14170           0 : NTSTATUS dcerpc_winspool_SyncRefreshRemoteNotifications_recv(struct tevent_req *req,
   14171             :                                                              TALLOC_CTX *mem_ctx,
   14172             :                                                              HRESULT *result)
   14173             : {
   14174           0 :         struct dcerpc_winspool_SyncRefreshRemoteNotifications_state *state = tevent_req_data(
   14175             :                 req, struct dcerpc_winspool_SyncRefreshRemoteNotifications_state);
   14176           0 :         NTSTATUS status;
   14177             : 
   14178           0 :         if (tevent_req_is_nterror(req, &status)) {
   14179           0 :                 tevent_req_received(req);
   14180           0 :                 return status;
   14181             :         }
   14182             : 
   14183             :         /* Steal possible out parameters to the callers context */
   14184           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14185             : 
   14186             :         /* Return result */
   14187           0 :         *result = state->orig.out.result;
   14188             : 
   14189           0 :         tevent_req_received(req);
   14190           0 :         return NT_STATUS_OK;
   14191             : }
   14192             : 
   14193           0 : NTSTATUS dcerpc_winspool_SyncRefreshRemoteNotifications(struct dcerpc_binding_handle *h,
   14194             :                                                         TALLOC_CTX *mem_ctx,
   14195             :                                                         struct policy_handle _hRpcHandle /* [in]  */,
   14196             :                                                         struct winspool_PrintPropertiesCollection *_pNotifyFilter /* [in] [ref] */,
   14197             :                                                         struct winspool_PrintPropertiesCollection **_ppNotifyData /* [out] [ref] */,
   14198             :                                                         HRESULT *result)
   14199             : {
   14200           0 :         struct winspool_SyncRefreshRemoteNotifications r;
   14201           0 :         NTSTATUS status;
   14202             : 
   14203             :         /* In parameters */
   14204           0 :         r.in.hRpcHandle = _hRpcHandle;
   14205           0 :         r.in.pNotifyFilter = _pNotifyFilter;
   14206             : 
   14207             :         /* Out parameters */
   14208           0 :         r.out.ppNotifyData = _ppNotifyData;
   14209             : 
   14210             :         /* Result */
   14211           0 :         NDR_ZERO_STRUCT(r.out.result);
   14212             : 
   14213           0 :         status = dcerpc_winspool_SyncRefreshRemoteNotifications_r(h, mem_ctx, &r);
   14214           0 :         if (!NT_STATUS_IS_OK(status)) {
   14215           0 :                 return status;
   14216             :         }
   14217             : 
   14218             :         /* Return variables */
   14219           0 :         *_ppNotifyData = *r.out.ppNotifyData;
   14220             : 
   14221             :         /* Return result */
   14222           0 :         *result = r.out.result;
   14223             : 
   14224           0 :         return NT_STATUS_OK;
   14225             : }
   14226             : 
   14227             : struct dcerpc_winspool_AsyncGetRemoteNotifications_r_state {
   14228             :         TALLOC_CTX *out_mem_ctx;
   14229             : };
   14230             : 
   14231             : static void dcerpc_winspool_AsyncGetRemoteNotifications_r_done(struct tevent_req *subreq);
   14232             : 
   14233           0 : struct tevent_req *dcerpc_winspool_AsyncGetRemoteNotifications_r_send(TALLOC_CTX *mem_ctx,
   14234             :         struct tevent_context *ev,
   14235             :         struct dcerpc_binding_handle *h,
   14236             :         struct winspool_AsyncGetRemoteNotifications *r)
   14237             : {
   14238           0 :         struct tevent_req *req;
   14239           0 :         struct dcerpc_winspool_AsyncGetRemoteNotifications_r_state *state;
   14240           0 :         struct tevent_req *subreq;
   14241             : 
   14242           0 :         req = tevent_req_create(mem_ctx, &state,
   14243             :                                 struct dcerpc_winspool_AsyncGetRemoteNotifications_r_state);
   14244           0 :         if (req == NULL) {
   14245           0 :                 return NULL;
   14246             :         }
   14247             : 
   14248           0 :         state->out_mem_ctx = talloc_new(state);
   14249           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   14250           0 :                 return tevent_req_post(req, ev);
   14251             :         }
   14252             : 
   14253           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   14254             :                         NULL, &ndr_table_iremotewinspool,
   14255           0 :                         NDR_WINSPOOL_ASYNCGETREMOTENOTIFICATIONS, state->out_mem_ctx, r);
   14256           0 :         if (tevent_req_nomem(subreq, req)) {
   14257           0 :                 return tevent_req_post(req, ev);
   14258             :         }
   14259           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncGetRemoteNotifications_r_done, req);
   14260             : 
   14261           0 :         return req;
   14262             : }
   14263             : 
   14264           0 : static void dcerpc_winspool_AsyncGetRemoteNotifications_r_done(struct tevent_req *subreq)
   14265             : {
   14266           0 :         struct tevent_req *req =
   14267           0 :                 tevent_req_callback_data(subreq,
   14268             :                 struct tevent_req);
   14269           0 :         NTSTATUS status;
   14270             : 
   14271           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   14272           0 :         TALLOC_FREE(subreq);
   14273           0 :         if (tevent_req_nterror(req, status)) {
   14274           0 :                 return;
   14275             :         }
   14276             : 
   14277           0 :         tevent_req_done(req);
   14278             : }
   14279             : 
   14280           0 : NTSTATUS dcerpc_winspool_AsyncGetRemoteNotifications_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   14281             : {
   14282           0 :         struct dcerpc_winspool_AsyncGetRemoteNotifications_r_state *state =
   14283           0 :                 tevent_req_data(req,
   14284             :                 struct dcerpc_winspool_AsyncGetRemoteNotifications_r_state);
   14285           0 :         NTSTATUS status;
   14286             : 
   14287           0 :         if (tevent_req_is_nterror(req, &status)) {
   14288           0 :                 tevent_req_received(req);
   14289           0 :                 return status;
   14290             :         }
   14291             : 
   14292           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14293             : 
   14294           0 :         tevent_req_received(req);
   14295           0 :         return NT_STATUS_OK;
   14296             : }
   14297             : 
   14298           0 : NTSTATUS dcerpc_winspool_AsyncGetRemoteNotifications_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncGetRemoteNotifications *r)
   14299             : {
   14300           0 :         NTSTATUS status;
   14301             : 
   14302           0 :         status = dcerpc_binding_handle_call(h,
   14303             :                         NULL, &ndr_table_iremotewinspool,
   14304             :                         NDR_WINSPOOL_ASYNCGETREMOTENOTIFICATIONS, mem_ctx, r);
   14305             : 
   14306           0 :         return status;
   14307             : }
   14308             : 
   14309             : struct dcerpc_winspool_AsyncGetRemoteNotifications_state {
   14310             :         struct winspool_AsyncGetRemoteNotifications orig;
   14311             :         struct winspool_AsyncGetRemoteNotifications tmp;
   14312             :         TALLOC_CTX *out_mem_ctx;
   14313             : };
   14314             : 
   14315             : static void dcerpc_winspool_AsyncGetRemoteNotifications_done(struct tevent_req *subreq);
   14316             : 
   14317           0 : struct tevent_req *dcerpc_winspool_AsyncGetRemoteNotifications_send(TALLOC_CTX *mem_ctx,
   14318             :                                                                     struct tevent_context *ev,
   14319             :                                                                     struct dcerpc_binding_handle *h,
   14320             :                                                                     struct policy_handle _hRpcHandle /* [in]  */,
   14321             :                                                                     struct winspool_PrintPropertiesCollection **_ppNotifyData /* [out] [ref] */)
   14322             : {
   14323           0 :         struct tevent_req *req;
   14324           0 :         struct dcerpc_winspool_AsyncGetRemoteNotifications_state *state;
   14325           0 :         struct tevent_req *subreq;
   14326             : 
   14327           0 :         req = tevent_req_create(mem_ctx, &state,
   14328             :                                 struct dcerpc_winspool_AsyncGetRemoteNotifications_state);
   14329           0 :         if (req == NULL) {
   14330           0 :                 return NULL;
   14331             :         }
   14332           0 :         state->out_mem_ctx = NULL;
   14333             : 
   14334             :         /* In parameters */
   14335           0 :         state->orig.in.hRpcHandle = _hRpcHandle;
   14336             : 
   14337             :         /* Out parameters */
   14338           0 :         state->orig.out.ppNotifyData = _ppNotifyData;
   14339             : 
   14340             :         /* Result */
   14341           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   14342             : 
   14343           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   14344             :                              "dcerpc_winspool_AsyncGetRemoteNotifications_out_memory");
   14345           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   14346           0 :                 return tevent_req_post(req, ev);
   14347             :         }
   14348             : 
   14349             :         /* make a temporary copy, that we pass to the dispatch function */
   14350           0 :         state->tmp = state->orig;
   14351             : 
   14352           0 :         subreq = dcerpc_winspool_AsyncGetRemoteNotifications_r_send(state, ev, h, &state->tmp);
   14353           0 :         if (tevent_req_nomem(subreq, req)) {
   14354           0 :                 return tevent_req_post(req, ev);
   14355             :         }
   14356           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncGetRemoteNotifications_done, req);
   14357           0 :         return req;
   14358             : }
   14359             : 
   14360           0 : static void dcerpc_winspool_AsyncGetRemoteNotifications_done(struct tevent_req *subreq)
   14361             : {
   14362           0 :         struct tevent_req *req = tevent_req_callback_data(
   14363             :                 subreq, struct tevent_req);
   14364           0 :         struct dcerpc_winspool_AsyncGetRemoteNotifications_state *state = tevent_req_data(
   14365             :                 req, struct dcerpc_winspool_AsyncGetRemoteNotifications_state);
   14366           0 :         NTSTATUS status;
   14367           0 :         TALLOC_CTX *mem_ctx;
   14368             : 
   14369           0 :         if (state->out_mem_ctx) {
   14370           0 :                 mem_ctx = state->out_mem_ctx;
   14371             :         } else {
   14372           0 :                 mem_ctx = state;
   14373             :         }
   14374             : 
   14375           0 :         status = dcerpc_winspool_AsyncGetRemoteNotifications_r_recv(subreq, mem_ctx);
   14376           0 :         TALLOC_FREE(subreq);
   14377           0 :         if (tevent_req_nterror(req, status)) {
   14378           0 :                 return;
   14379             :         }
   14380             : 
   14381             :         /* Copy out parameters */
   14382           0 :         *state->orig.out.ppNotifyData = *state->tmp.out.ppNotifyData;
   14383             : 
   14384             :         /* Copy result */
   14385           0 :         state->orig.out.result = state->tmp.out.result;
   14386             : 
   14387             :         /* Reset temporary structure */
   14388           0 :         NDR_ZERO_STRUCT(state->tmp);
   14389             : 
   14390           0 :         tevent_req_done(req);
   14391             : }
   14392             : 
   14393           0 : NTSTATUS dcerpc_winspool_AsyncGetRemoteNotifications_recv(struct tevent_req *req,
   14394             :                                                           TALLOC_CTX *mem_ctx,
   14395             :                                                           HRESULT *result)
   14396             : {
   14397           0 :         struct dcerpc_winspool_AsyncGetRemoteNotifications_state *state = tevent_req_data(
   14398             :                 req, struct dcerpc_winspool_AsyncGetRemoteNotifications_state);
   14399           0 :         NTSTATUS status;
   14400             : 
   14401           0 :         if (tevent_req_is_nterror(req, &status)) {
   14402           0 :                 tevent_req_received(req);
   14403           0 :                 return status;
   14404             :         }
   14405             : 
   14406             :         /* Steal possible out parameters to the callers context */
   14407           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14408             : 
   14409             :         /* Return result */
   14410           0 :         *result = state->orig.out.result;
   14411             : 
   14412           0 :         tevent_req_received(req);
   14413           0 :         return NT_STATUS_OK;
   14414             : }
   14415             : 
   14416           0 : NTSTATUS dcerpc_winspool_AsyncGetRemoteNotifications(struct dcerpc_binding_handle *h,
   14417             :                                                      TALLOC_CTX *mem_ctx,
   14418             :                                                      struct policy_handle _hRpcHandle /* [in]  */,
   14419             :                                                      struct winspool_PrintPropertiesCollection **_ppNotifyData /* [out] [ref] */,
   14420             :                                                      HRESULT *result)
   14421             : {
   14422           0 :         struct winspool_AsyncGetRemoteNotifications r;
   14423           0 :         NTSTATUS status;
   14424             : 
   14425             :         /* In parameters */
   14426           0 :         r.in.hRpcHandle = _hRpcHandle;
   14427             : 
   14428             :         /* Out parameters */
   14429           0 :         r.out.ppNotifyData = _ppNotifyData;
   14430             : 
   14431             :         /* Result */
   14432           0 :         NDR_ZERO_STRUCT(r.out.result);
   14433             : 
   14434           0 :         status = dcerpc_winspool_AsyncGetRemoteNotifications_r(h, mem_ctx, &r);
   14435           0 :         if (!NT_STATUS_IS_OK(status)) {
   14436           0 :                 return status;
   14437             :         }
   14438             : 
   14439             :         /* Return variables */
   14440           0 :         *_ppNotifyData = *r.out.ppNotifyData;
   14441             : 
   14442             :         /* Return result */
   14443           0 :         *result = r.out.result;
   14444             : 
   14445           0 :         return NT_STATUS_OK;
   14446             : }
   14447             : 
   14448             : struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_state {
   14449             :         TALLOC_CTX *out_mem_ctx;
   14450             : };
   14451             : 
   14452             : static void dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_done(struct tevent_req *subreq);
   14453             : 
   14454           0 : struct tevent_req *dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_send(TALLOC_CTX *mem_ctx,
   14455             :         struct tevent_context *ev,
   14456             :         struct dcerpc_binding_handle *h,
   14457             :         struct winspool_AsyncInstallPrinterDriverFromPackage *r)
   14458             : {
   14459           0 :         struct tevent_req *req;
   14460           0 :         struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_state *state;
   14461           0 :         struct tevent_req *subreq;
   14462             : 
   14463           0 :         req = tevent_req_create(mem_ctx, &state,
   14464             :                                 struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_state);
   14465           0 :         if (req == NULL) {
   14466           0 :                 return NULL;
   14467             :         }
   14468             : 
   14469           0 :         state->out_mem_ctx = NULL;
   14470             : 
   14471           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   14472             :                         NULL, &ndr_table_iremotewinspool,
   14473             :                         NDR_WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE, state, r);
   14474           0 :         if (tevent_req_nomem(subreq, req)) {
   14475           0 :                 return tevent_req_post(req, ev);
   14476             :         }
   14477           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_done, req);
   14478             : 
   14479           0 :         return req;
   14480             : }
   14481             : 
   14482           0 : static void dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_done(struct tevent_req *subreq)
   14483             : {
   14484           0 :         struct tevent_req *req =
   14485           0 :                 tevent_req_callback_data(subreq,
   14486             :                 struct tevent_req);
   14487           0 :         NTSTATUS status;
   14488             : 
   14489           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   14490           0 :         TALLOC_FREE(subreq);
   14491           0 :         if (tevent_req_nterror(req, status)) {
   14492           0 :                 return;
   14493             :         }
   14494             : 
   14495           0 :         tevent_req_done(req);
   14496             : }
   14497             : 
   14498           0 : NTSTATUS dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   14499             : {
   14500           0 :         struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_state *state =
   14501           0 :                 tevent_req_data(req,
   14502             :                 struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_state);
   14503           0 :         NTSTATUS status;
   14504             : 
   14505           0 :         if (tevent_req_is_nterror(req, &status)) {
   14506           0 :                 tevent_req_received(req);
   14507           0 :                 return status;
   14508             :         }
   14509             : 
   14510           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14511             : 
   14512           0 :         tevent_req_received(req);
   14513           0 :         return NT_STATUS_OK;
   14514             : }
   14515             : 
   14516           0 : NTSTATUS dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncInstallPrinterDriverFromPackage *r)
   14517             : {
   14518           0 :         NTSTATUS status;
   14519             : 
   14520           0 :         status = dcerpc_binding_handle_call(h,
   14521             :                         NULL, &ndr_table_iremotewinspool,
   14522             :                         NDR_WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE, mem_ctx, r);
   14523             : 
   14524           0 :         return status;
   14525             : }
   14526             : 
   14527             : struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_state {
   14528             :         struct winspool_AsyncInstallPrinterDriverFromPackage orig;
   14529             :         struct winspool_AsyncInstallPrinterDriverFromPackage tmp;
   14530             :         TALLOC_CTX *out_mem_ctx;
   14531             : };
   14532             : 
   14533             : static void dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_done(struct tevent_req *subreq);
   14534             : 
   14535           0 : struct tevent_req *dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_send(TALLOC_CTX *mem_ctx,
   14536             :                                                                              struct tevent_context *ev,
   14537             :                                                                              struct dcerpc_binding_handle *h,
   14538             :                                                                              const char *_pszServer /* [in] [charset(UTF16),unique] */,
   14539             :                                                                              const char *_pszInfPath /* [in] [charset(UTF16),unique] */,
   14540             :                                                                              const char *_pszDriverName /* [in] [charset(UTF16),ref] */,
   14541             :                                                                              const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   14542             :                                                                              uint32_t _dwFlags /* [in]  */)
   14543             : {
   14544           0 :         struct tevent_req *req;
   14545           0 :         struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_state *state;
   14546           0 :         struct tevent_req *subreq;
   14547             : 
   14548           0 :         req = tevent_req_create(mem_ctx, &state,
   14549             :                                 struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_state);
   14550           0 :         if (req == NULL) {
   14551           0 :                 return NULL;
   14552             :         }
   14553           0 :         state->out_mem_ctx = NULL;
   14554             : 
   14555             :         /* In parameters */
   14556           0 :         state->orig.in.pszServer = _pszServer;
   14557           0 :         state->orig.in.pszInfPath = _pszInfPath;
   14558           0 :         state->orig.in.pszDriverName = _pszDriverName;
   14559           0 :         state->orig.in.pszEnvironment = _pszEnvironment;
   14560           0 :         state->orig.in.dwFlags = _dwFlags;
   14561             : 
   14562             :         /* Out parameters */
   14563             : 
   14564             :         /* Result */
   14565           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   14566             : 
   14567             :         /* make a temporary copy, that we pass to the dispatch function */
   14568           0 :         state->tmp = state->orig;
   14569             : 
   14570           0 :         subreq = dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_send(state, ev, h, &state->tmp);
   14571           0 :         if (tevent_req_nomem(subreq, req)) {
   14572           0 :                 return tevent_req_post(req, ev);
   14573             :         }
   14574           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_done, req);
   14575           0 :         return req;
   14576             : }
   14577             : 
   14578           0 : static void dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_done(struct tevent_req *subreq)
   14579             : {
   14580           0 :         struct tevent_req *req = tevent_req_callback_data(
   14581             :                 subreq, struct tevent_req);
   14582           0 :         struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_state *state = tevent_req_data(
   14583             :                 req, struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_state);
   14584           0 :         NTSTATUS status;
   14585           0 :         TALLOC_CTX *mem_ctx;
   14586             : 
   14587           0 :         if (state->out_mem_ctx) {
   14588           0 :                 mem_ctx = state->out_mem_ctx;
   14589             :         } else {
   14590           0 :                 mem_ctx = state;
   14591             :         }
   14592             : 
   14593           0 :         status = dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r_recv(subreq, mem_ctx);
   14594           0 :         TALLOC_FREE(subreq);
   14595           0 :         if (tevent_req_nterror(req, status)) {
   14596           0 :                 return;
   14597             :         }
   14598             : 
   14599             :         /* Copy out parameters */
   14600             : 
   14601             :         /* Copy result */
   14602           0 :         state->orig.out.result = state->tmp.out.result;
   14603             : 
   14604             :         /* Reset temporary structure */
   14605           0 :         NDR_ZERO_STRUCT(state->tmp);
   14606             : 
   14607           0 :         tevent_req_done(req);
   14608             : }
   14609             : 
   14610           0 : NTSTATUS dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_recv(struct tevent_req *req,
   14611             :                                                                    TALLOC_CTX *mem_ctx,
   14612             :                                                                    HRESULT *result)
   14613             : {
   14614           0 :         struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_state *state = tevent_req_data(
   14615             :                 req, struct dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_state);
   14616           0 :         NTSTATUS status;
   14617             : 
   14618           0 :         if (tevent_req_is_nterror(req, &status)) {
   14619           0 :                 tevent_req_received(req);
   14620           0 :                 return status;
   14621             :         }
   14622             : 
   14623             :         /* Steal possible out parameters to the callers context */
   14624           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14625             : 
   14626             :         /* Return result */
   14627           0 :         *result = state->orig.out.result;
   14628             : 
   14629           0 :         tevent_req_received(req);
   14630           0 :         return NT_STATUS_OK;
   14631             : }
   14632             : 
   14633           0 : NTSTATUS dcerpc_winspool_AsyncInstallPrinterDriverFromPackage(struct dcerpc_binding_handle *h,
   14634             :                                                               TALLOC_CTX *mem_ctx,
   14635             :                                                               const char *_pszServer /* [in] [charset(UTF16),unique] */,
   14636             :                                                               const char *_pszInfPath /* [in] [charset(UTF16),unique] */,
   14637             :                                                               const char *_pszDriverName /* [in] [charset(UTF16),ref] */,
   14638             :                                                               const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   14639             :                                                               uint32_t _dwFlags /* [in]  */,
   14640             :                                                               HRESULT *result)
   14641             : {
   14642           0 :         struct winspool_AsyncInstallPrinterDriverFromPackage r;
   14643           0 :         NTSTATUS status;
   14644             : 
   14645             :         /* In parameters */
   14646           0 :         r.in.pszServer = _pszServer;
   14647           0 :         r.in.pszInfPath = _pszInfPath;
   14648           0 :         r.in.pszDriverName = _pszDriverName;
   14649           0 :         r.in.pszEnvironment = _pszEnvironment;
   14650           0 :         r.in.dwFlags = _dwFlags;
   14651             : 
   14652             :         /* Out parameters */
   14653             : 
   14654             :         /* Result */
   14655           0 :         NDR_ZERO_STRUCT(r.out.result);
   14656             : 
   14657           0 :         status = dcerpc_winspool_AsyncInstallPrinterDriverFromPackage_r(h, mem_ctx, &r);
   14658           0 :         if (!NT_STATUS_IS_OK(status)) {
   14659           0 :                 return status;
   14660             :         }
   14661             : 
   14662             :         /* Return variables */
   14663             : 
   14664             :         /* Return result */
   14665           0 :         *result = r.out.result;
   14666             : 
   14667           0 :         return NT_STATUS_OK;
   14668             : }
   14669             : 
   14670             : struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_state {
   14671             :         TALLOC_CTX *out_mem_ctx;
   14672             : };
   14673             : 
   14674             : static void dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_done(struct tevent_req *subreq);
   14675             : 
   14676           0 : struct tevent_req *dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_send(TALLOC_CTX *mem_ctx,
   14677             :         struct tevent_context *ev,
   14678             :         struct dcerpc_binding_handle *h,
   14679             :         struct winspool_AsyncUploadPrinterDriverPackage *r)
   14680             : {
   14681           0 :         struct tevent_req *req;
   14682           0 :         struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_state *state;
   14683           0 :         struct tevent_req *subreq;
   14684             : 
   14685           0 :         req = tevent_req_create(mem_ctx, &state,
   14686             :                                 struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_state);
   14687           0 :         if (req == NULL) {
   14688           0 :                 return NULL;
   14689             :         }
   14690             : 
   14691           0 :         state->out_mem_ctx = talloc_new(state);
   14692           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   14693           0 :                 return tevent_req_post(req, ev);
   14694             :         }
   14695             : 
   14696           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   14697             :                         NULL, &ndr_table_iremotewinspool,
   14698           0 :                         NDR_WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE, state->out_mem_ctx, r);
   14699           0 :         if (tevent_req_nomem(subreq, req)) {
   14700           0 :                 return tevent_req_post(req, ev);
   14701             :         }
   14702           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_done, req);
   14703             : 
   14704           0 :         return req;
   14705             : }
   14706             : 
   14707           0 : static void dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_done(struct tevent_req *subreq)
   14708             : {
   14709           0 :         struct tevent_req *req =
   14710           0 :                 tevent_req_callback_data(subreq,
   14711             :                 struct tevent_req);
   14712           0 :         NTSTATUS status;
   14713             : 
   14714           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   14715           0 :         TALLOC_FREE(subreq);
   14716           0 :         if (tevent_req_nterror(req, status)) {
   14717           0 :                 return;
   14718             :         }
   14719             : 
   14720           0 :         tevent_req_done(req);
   14721             : }
   14722             : 
   14723           0 : NTSTATUS dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   14724             : {
   14725           0 :         struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_state *state =
   14726           0 :                 tevent_req_data(req,
   14727             :                 struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_state);
   14728           0 :         NTSTATUS status;
   14729             : 
   14730           0 :         if (tevent_req_is_nterror(req, &status)) {
   14731           0 :                 tevent_req_received(req);
   14732           0 :                 return status;
   14733             :         }
   14734             : 
   14735           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14736             : 
   14737           0 :         tevent_req_received(req);
   14738           0 :         return NT_STATUS_OK;
   14739             : }
   14740             : 
   14741           0 : NTSTATUS dcerpc_winspool_AsyncUploadPrinterDriverPackage_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncUploadPrinterDriverPackage *r)
   14742             : {
   14743           0 :         NTSTATUS status;
   14744             : 
   14745           0 :         status = dcerpc_binding_handle_call(h,
   14746             :                         NULL, &ndr_table_iremotewinspool,
   14747             :                         NDR_WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE, mem_ctx, r);
   14748             : 
   14749           0 :         return status;
   14750             : }
   14751             : 
   14752             : struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_state {
   14753             :         struct winspool_AsyncUploadPrinterDriverPackage orig;
   14754             :         struct winspool_AsyncUploadPrinterDriverPackage tmp;
   14755             :         TALLOC_CTX *out_mem_ctx;
   14756             : };
   14757             : 
   14758             : static void dcerpc_winspool_AsyncUploadPrinterDriverPackage_done(struct tevent_req *subreq);
   14759             : 
   14760           0 : struct tevent_req *dcerpc_winspool_AsyncUploadPrinterDriverPackage_send(TALLOC_CTX *mem_ctx,
   14761             :                                                                         struct tevent_context *ev,
   14762             :                                                                         struct dcerpc_binding_handle *h,
   14763             :                                                                         const char *_pszServer /* [in] [charset(UTF16),unique] */,
   14764             :                                                                         const char *_pszInfPath /* [in] [charset(UTF16),ref] */,
   14765             :                                                                         const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   14766             :                                                                         uint32_t _dwFlags /* [in]  */,
   14767             :                                                                         const char *_pszDestInfPath /* [in,out] [charset(UTF16),size_is(*pcchDestInfPath),unique] */,
   14768             :                                                                         uint32_t *_pcchDestInfPath /* [in,out] [ref] */)
   14769             : {
   14770           0 :         struct tevent_req *req;
   14771           0 :         struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_state *state;
   14772           0 :         struct tevent_req *subreq;
   14773             : 
   14774           0 :         req = tevent_req_create(mem_ctx, &state,
   14775             :                                 struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_state);
   14776           0 :         if (req == NULL) {
   14777           0 :                 return NULL;
   14778             :         }
   14779           0 :         state->out_mem_ctx = NULL;
   14780             : 
   14781             :         /* In parameters */
   14782           0 :         state->orig.in.pszServer = _pszServer;
   14783           0 :         state->orig.in.pszInfPath = _pszInfPath;
   14784           0 :         state->orig.in.pszEnvironment = _pszEnvironment;
   14785           0 :         state->orig.in.dwFlags = _dwFlags;
   14786           0 :         state->orig.in.pszDestInfPath = _pszDestInfPath;
   14787           0 :         state->orig.in.pcchDestInfPath = _pcchDestInfPath;
   14788             : 
   14789             :         /* Out parameters */
   14790           0 :         state->orig.out.pszDestInfPath = _pszDestInfPath;
   14791           0 :         state->orig.out.pcchDestInfPath = _pcchDestInfPath;
   14792             : 
   14793             :         /* Result */
   14794           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   14795             : 
   14796           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   14797             :                              "dcerpc_winspool_AsyncUploadPrinterDriverPackage_out_memory");
   14798           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   14799           0 :                 return tevent_req_post(req, ev);
   14800             :         }
   14801             : 
   14802             :         /* make a temporary copy, that we pass to the dispatch function */
   14803           0 :         state->tmp = state->orig;
   14804             : 
   14805           0 :         subreq = dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_send(state, ev, h, &state->tmp);
   14806           0 :         if (tevent_req_nomem(subreq, req)) {
   14807           0 :                 return tevent_req_post(req, ev);
   14808             :         }
   14809           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncUploadPrinterDriverPackage_done, req);
   14810           0 :         return req;
   14811             : }
   14812             : 
   14813           0 : static void dcerpc_winspool_AsyncUploadPrinterDriverPackage_done(struct tevent_req *subreq)
   14814             : {
   14815           0 :         struct tevent_req *req = tevent_req_callback_data(
   14816             :                 subreq, struct tevent_req);
   14817           0 :         struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_state *state = tevent_req_data(
   14818             :                 req, struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_state);
   14819           0 :         NTSTATUS status;
   14820           0 :         TALLOC_CTX *mem_ctx;
   14821             : 
   14822           0 :         if (state->out_mem_ctx) {
   14823           0 :                 mem_ctx = state->out_mem_ctx;
   14824             :         } else {
   14825           0 :                 mem_ctx = state;
   14826             :         }
   14827             : 
   14828           0 :         status = dcerpc_winspool_AsyncUploadPrinterDriverPackage_r_recv(subreq, mem_ctx);
   14829           0 :         TALLOC_FREE(subreq);
   14830           0 :         if (tevent_req_nterror(req, status)) {
   14831           0 :                 return;
   14832             :         }
   14833             : 
   14834             :         /* Copy out parameters */
   14835           0 :         if (state->orig.out.pszDestInfPath && state->tmp.out.pszDestInfPath) {
   14836             :                 {
   14837           0 :                         size_t _copy_len_pszDestInfPath;
   14838           0 :                         if ((*state->tmp.out.pcchDestInfPath) > (*state->tmp.in.pcchDestInfPath)) {
   14839           0 :                                 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
   14840           0 :                                 return;
   14841             :                         }
   14842           0 :                         _copy_len_pszDestInfPath = ndr_charset_length(state->tmp.out.pszDestInfPath, CH_UNIX);
   14843           0 :                         if (_copy_len_pszDestInfPath > ndr_charset_length(state->tmp.in.pszDestInfPath, CH_UNIX)) {
   14844           0 :                                 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
   14845           0 :                                 return;
   14846             :                         }
   14847           0 :                         if (state->orig.out.pszDestInfPath != state->tmp.out.pszDestInfPath) {
   14848           0 :                                 memcpy(discard_const_p(uint8_t *, state->orig.out.pszDestInfPath), state->tmp.out.pszDestInfPath, _copy_len_pszDestInfPath * sizeof(*state->orig.out.pszDestInfPath));
   14849             :                         }
   14850             :                 }
   14851             :         }
   14852           0 :         *state->orig.out.pcchDestInfPath = *state->tmp.out.pcchDestInfPath;
   14853             : 
   14854             :         /* Copy result */
   14855           0 :         state->orig.out.result = state->tmp.out.result;
   14856             : 
   14857             :         /* Reset temporary structure */
   14858           0 :         NDR_ZERO_STRUCT(state->tmp);
   14859             : 
   14860           0 :         tevent_req_done(req);
   14861             : }
   14862             : 
   14863           0 : NTSTATUS dcerpc_winspool_AsyncUploadPrinterDriverPackage_recv(struct tevent_req *req,
   14864             :                                                               TALLOC_CTX *mem_ctx,
   14865             :                                                               HRESULT *result)
   14866             : {
   14867           0 :         struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_state *state = tevent_req_data(
   14868             :                 req, struct dcerpc_winspool_AsyncUploadPrinterDriverPackage_state);
   14869           0 :         NTSTATUS status;
   14870             : 
   14871           0 :         if (tevent_req_is_nterror(req, &status)) {
   14872           0 :                 tevent_req_received(req);
   14873           0 :                 return status;
   14874             :         }
   14875             : 
   14876             :         /* Steal possible out parameters to the callers context */
   14877           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14878             : 
   14879             :         /* Return result */
   14880           0 :         *result = state->orig.out.result;
   14881             : 
   14882           0 :         tevent_req_received(req);
   14883           0 :         return NT_STATUS_OK;
   14884             : }
   14885             : 
   14886           0 : NTSTATUS dcerpc_winspool_AsyncUploadPrinterDriverPackage(struct dcerpc_binding_handle *h,
   14887             :                                                          TALLOC_CTX *mem_ctx,
   14888             :                                                          const char *_pszServer /* [in] [charset(UTF16),unique] */,
   14889             :                                                          const char *_pszInfPath /* [in] [charset(UTF16),ref] */,
   14890             :                                                          const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   14891             :                                                          uint32_t _dwFlags /* [in]  */,
   14892             :                                                          const char *_pszDestInfPath /* [in,out] [charset(UTF16),size_is(*pcchDestInfPath),unique] */,
   14893             :                                                          uint32_t *_pcchDestInfPath /* [in,out] [ref] */,
   14894             :                                                          HRESULT *result)
   14895             : {
   14896           0 :         struct winspool_AsyncUploadPrinterDriverPackage r;
   14897           0 :         NTSTATUS status;
   14898             : 
   14899             :         /* In parameters */
   14900           0 :         r.in.pszServer = _pszServer;
   14901           0 :         r.in.pszInfPath = _pszInfPath;
   14902           0 :         r.in.pszEnvironment = _pszEnvironment;
   14903           0 :         r.in.dwFlags = _dwFlags;
   14904           0 :         r.in.pszDestInfPath = _pszDestInfPath;
   14905           0 :         r.in.pcchDestInfPath = _pcchDestInfPath;
   14906             : 
   14907             :         /* Out parameters */
   14908           0 :         r.out.pszDestInfPath = _pszDestInfPath;
   14909           0 :         r.out.pcchDestInfPath = _pcchDestInfPath;
   14910             : 
   14911             :         /* Result */
   14912           0 :         NDR_ZERO_STRUCT(r.out.result);
   14913             : 
   14914           0 :         status = dcerpc_winspool_AsyncUploadPrinterDriverPackage_r(h, mem_ctx, &r);
   14915           0 :         if (!NT_STATUS_IS_OK(status)) {
   14916           0 :                 return status;
   14917             :         }
   14918             : 
   14919             :         /* Return variables */
   14920           0 :         if (_pszDestInfPath && r.out.pszDestInfPath) {
   14921             :                 {
   14922           0 :                         size_t _copy_len_pszDestInfPath;
   14923           0 :                         if ((*r.out.pcchDestInfPath) > (*r.in.pcchDestInfPath)) {
   14924           0 :                                 return NT_STATUS_INVALID_NETWORK_RESPONSE;
   14925             :                         }
   14926           0 :                         _copy_len_pszDestInfPath = ndr_charset_length(r.out.pszDestInfPath, CH_UNIX);
   14927           0 :                         if (_copy_len_pszDestInfPath > ndr_charset_length(r.in.pszDestInfPath, CH_UNIX)) {
   14928           0 :                                 return NT_STATUS_INVALID_NETWORK_RESPONSE;
   14929             :                         }
   14930           0 :                         if (_pszDestInfPath != r.out.pszDestInfPath) {
   14931           0 :                                 memcpy(discard_const_p(uint8_t *, _pszDestInfPath), r.out.pszDestInfPath, _copy_len_pszDestInfPath * sizeof(*_pszDestInfPath));
   14932             :                         }
   14933             :                 }
   14934             :         }
   14935           0 :         *_pcchDestInfPath = *r.out.pcchDestInfPath;
   14936             : 
   14937             :         /* Return result */
   14938           0 :         *result = r.out.result;
   14939             : 
   14940           0 :         return NT_STATUS_OK;
   14941             : }
   14942             : 
   14943             : struct dcerpc_winspool_AsyncGetCorePrinterDrivers_r_state {
   14944             :         TALLOC_CTX *out_mem_ctx;
   14945             : };
   14946             : 
   14947             : static void dcerpc_winspool_AsyncGetCorePrinterDrivers_r_done(struct tevent_req *subreq);
   14948             : 
   14949           0 : struct tevent_req *dcerpc_winspool_AsyncGetCorePrinterDrivers_r_send(TALLOC_CTX *mem_ctx,
   14950             :         struct tevent_context *ev,
   14951             :         struct dcerpc_binding_handle *h,
   14952             :         struct winspool_AsyncGetCorePrinterDrivers *r)
   14953             : {
   14954           0 :         struct tevent_req *req;
   14955           0 :         struct dcerpc_winspool_AsyncGetCorePrinterDrivers_r_state *state;
   14956           0 :         struct tevent_req *subreq;
   14957             : 
   14958           0 :         req = tevent_req_create(mem_ctx, &state,
   14959             :                                 struct dcerpc_winspool_AsyncGetCorePrinterDrivers_r_state);
   14960           0 :         if (req == NULL) {
   14961           0 :                 return NULL;
   14962             :         }
   14963             : 
   14964           0 :         state->out_mem_ctx = talloc_new(state);
   14965           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   14966           0 :                 return tevent_req_post(req, ev);
   14967             :         }
   14968             : 
   14969           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   14970             :                         NULL, &ndr_table_iremotewinspool,
   14971           0 :                         NDR_WINSPOOL_ASYNCGETCOREPRINTERDRIVERS, state->out_mem_ctx, r);
   14972           0 :         if (tevent_req_nomem(subreq, req)) {
   14973           0 :                 return tevent_req_post(req, ev);
   14974             :         }
   14975           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncGetCorePrinterDrivers_r_done, req);
   14976             : 
   14977           0 :         return req;
   14978             : }
   14979             : 
   14980           0 : static void dcerpc_winspool_AsyncGetCorePrinterDrivers_r_done(struct tevent_req *subreq)
   14981             : {
   14982           0 :         struct tevent_req *req =
   14983           0 :                 tevent_req_callback_data(subreq,
   14984             :                 struct tevent_req);
   14985           0 :         NTSTATUS status;
   14986             : 
   14987           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   14988           0 :         TALLOC_FREE(subreq);
   14989           0 :         if (tevent_req_nterror(req, status)) {
   14990           0 :                 return;
   14991             :         }
   14992             : 
   14993           0 :         tevent_req_done(req);
   14994             : }
   14995             : 
   14996           0 : NTSTATUS dcerpc_winspool_AsyncGetCorePrinterDrivers_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   14997             : {
   14998           0 :         struct dcerpc_winspool_AsyncGetCorePrinterDrivers_r_state *state =
   14999           0 :                 tevent_req_data(req,
   15000             :                 struct dcerpc_winspool_AsyncGetCorePrinterDrivers_r_state);
   15001           0 :         NTSTATUS status;
   15002             : 
   15003           0 :         if (tevent_req_is_nterror(req, &status)) {
   15004           0 :                 tevent_req_received(req);
   15005           0 :                 return status;
   15006             :         }
   15007             : 
   15008           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15009             : 
   15010           0 :         tevent_req_received(req);
   15011           0 :         return NT_STATUS_OK;
   15012             : }
   15013             : 
   15014           0 : NTSTATUS dcerpc_winspool_AsyncGetCorePrinterDrivers_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncGetCorePrinterDrivers *r)
   15015             : {
   15016           0 :         NTSTATUS status;
   15017             : 
   15018           0 :         status = dcerpc_binding_handle_call(h,
   15019             :                         NULL, &ndr_table_iremotewinspool,
   15020             :                         NDR_WINSPOOL_ASYNCGETCOREPRINTERDRIVERS, mem_ctx, r);
   15021             : 
   15022           0 :         return status;
   15023             : }
   15024             : 
   15025             : struct dcerpc_winspool_AsyncGetCorePrinterDrivers_state {
   15026             :         struct winspool_AsyncGetCorePrinterDrivers orig;
   15027             :         struct winspool_AsyncGetCorePrinterDrivers tmp;
   15028             :         TALLOC_CTX *out_mem_ctx;
   15029             : };
   15030             : 
   15031             : static void dcerpc_winspool_AsyncGetCorePrinterDrivers_done(struct tevent_req *subreq);
   15032             : 
   15033           0 : struct tevent_req *dcerpc_winspool_AsyncGetCorePrinterDrivers_send(TALLOC_CTX *mem_ctx,
   15034             :                                                                    struct tevent_context *ev,
   15035             :                                                                    struct dcerpc_binding_handle *h,
   15036             :                                                                    const char *_pszServer /* [in] [charset(UTF16),unique] */,
   15037             :                                                                    const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   15038             :                                                                    uint32_t _cchCoreDrivers /* [in]  */,
   15039             :                                                                    uint16_t *_pszzCoreDriverDependencies /* [in] [ref,size_is(cchCoreDrivers)] */,
   15040             :                                                                    uint32_t _cCorePrinterDrivers /* [in]  */,
   15041             :                                                                    struct spoolss_CorePrinterDriver *_pCorePrinterDrivers /* [out] [ref,size_is(cCorePrinterDrivers)] */)
   15042             : {
   15043           0 :         struct tevent_req *req;
   15044           0 :         struct dcerpc_winspool_AsyncGetCorePrinterDrivers_state *state;
   15045           0 :         struct tevent_req *subreq;
   15046             : 
   15047           0 :         req = tevent_req_create(mem_ctx, &state,
   15048             :                                 struct dcerpc_winspool_AsyncGetCorePrinterDrivers_state);
   15049           0 :         if (req == NULL) {
   15050           0 :                 return NULL;
   15051             :         }
   15052           0 :         state->out_mem_ctx = NULL;
   15053             : 
   15054             :         /* In parameters */
   15055           0 :         state->orig.in.pszServer = _pszServer;
   15056           0 :         state->orig.in.pszEnvironment = _pszEnvironment;
   15057           0 :         state->orig.in.cchCoreDrivers = _cchCoreDrivers;
   15058           0 :         state->orig.in.pszzCoreDriverDependencies = _pszzCoreDriverDependencies;
   15059           0 :         state->orig.in.cCorePrinterDrivers = _cCorePrinterDrivers;
   15060             : 
   15061             :         /* Out parameters */
   15062           0 :         state->orig.out.pCorePrinterDrivers = _pCorePrinterDrivers;
   15063             : 
   15064             :         /* Result */
   15065           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   15066             : 
   15067           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   15068             :                              "dcerpc_winspool_AsyncGetCorePrinterDrivers_out_memory");
   15069           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   15070           0 :                 return tevent_req_post(req, ev);
   15071             :         }
   15072             : 
   15073             :         /* make a temporary copy, that we pass to the dispatch function */
   15074           0 :         state->tmp = state->orig;
   15075             : 
   15076           0 :         subreq = dcerpc_winspool_AsyncGetCorePrinterDrivers_r_send(state, ev, h, &state->tmp);
   15077           0 :         if (tevent_req_nomem(subreq, req)) {
   15078           0 :                 return tevent_req_post(req, ev);
   15079             :         }
   15080           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncGetCorePrinterDrivers_done, req);
   15081           0 :         return req;
   15082             : }
   15083             : 
   15084           0 : static void dcerpc_winspool_AsyncGetCorePrinterDrivers_done(struct tevent_req *subreq)
   15085             : {
   15086           0 :         struct tevent_req *req = tevent_req_callback_data(
   15087             :                 subreq, struct tevent_req);
   15088           0 :         struct dcerpc_winspool_AsyncGetCorePrinterDrivers_state *state = tevent_req_data(
   15089             :                 req, struct dcerpc_winspool_AsyncGetCorePrinterDrivers_state);
   15090           0 :         NTSTATUS status;
   15091           0 :         TALLOC_CTX *mem_ctx;
   15092             : 
   15093           0 :         if (state->out_mem_ctx) {
   15094           0 :                 mem_ctx = state->out_mem_ctx;
   15095             :         } else {
   15096           0 :                 mem_ctx = state;
   15097             :         }
   15098             : 
   15099           0 :         status = dcerpc_winspool_AsyncGetCorePrinterDrivers_r_recv(subreq, mem_ctx);
   15100           0 :         TALLOC_FREE(subreq);
   15101           0 :         if (tevent_req_nterror(req, status)) {
   15102           0 :                 return;
   15103             :         }
   15104             : 
   15105             :         /* Copy out parameters */
   15106             :         {
   15107           0 :                 size_t _copy_len_pCorePrinterDrivers;
   15108           0 :                 _copy_len_pCorePrinterDrivers = state->tmp.in.cCorePrinterDrivers;
   15109           0 :                 if (state->orig.out.pCorePrinterDrivers != state->tmp.out.pCorePrinterDrivers) {
   15110           0 :                         memcpy(state->orig.out.pCorePrinterDrivers, state->tmp.out.pCorePrinterDrivers, _copy_len_pCorePrinterDrivers * sizeof(*state->orig.out.pCorePrinterDrivers));
   15111             :                 }
   15112             :         }
   15113             : 
   15114             :         /* Copy result */
   15115           0 :         state->orig.out.result = state->tmp.out.result;
   15116             : 
   15117             :         /* Reset temporary structure */
   15118           0 :         NDR_ZERO_STRUCT(state->tmp);
   15119             : 
   15120           0 :         tevent_req_done(req);
   15121             : }
   15122             : 
   15123           0 : NTSTATUS dcerpc_winspool_AsyncGetCorePrinterDrivers_recv(struct tevent_req *req,
   15124             :                                                          TALLOC_CTX *mem_ctx,
   15125             :                                                          HRESULT *result)
   15126             : {
   15127           0 :         struct dcerpc_winspool_AsyncGetCorePrinterDrivers_state *state = tevent_req_data(
   15128             :                 req, struct dcerpc_winspool_AsyncGetCorePrinterDrivers_state);
   15129           0 :         NTSTATUS status;
   15130             : 
   15131           0 :         if (tevent_req_is_nterror(req, &status)) {
   15132           0 :                 tevent_req_received(req);
   15133           0 :                 return status;
   15134             :         }
   15135             : 
   15136             :         /* Steal possible out parameters to the callers context */
   15137           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15138             : 
   15139             :         /* Return result */
   15140           0 :         *result = state->orig.out.result;
   15141             : 
   15142           0 :         tevent_req_received(req);
   15143           0 :         return NT_STATUS_OK;
   15144             : }
   15145             : 
   15146           0 : NTSTATUS dcerpc_winspool_AsyncGetCorePrinterDrivers(struct dcerpc_binding_handle *h,
   15147             :                                                     TALLOC_CTX *mem_ctx,
   15148             :                                                     const char *_pszServer /* [in] [charset(UTF16),unique] */,
   15149             :                                                     const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   15150             :                                                     uint32_t _cchCoreDrivers /* [in]  */,
   15151             :                                                     uint16_t *_pszzCoreDriverDependencies /* [in] [ref,size_is(cchCoreDrivers)] */,
   15152             :                                                     uint32_t _cCorePrinterDrivers /* [in]  */,
   15153             :                                                     struct spoolss_CorePrinterDriver *_pCorePrinterDrivers /* [out] [ref,size_is(cCorePrinterDrivers)] */,
   15154             :                                                     HRESULT *result)
   15155             : {
   15156           0 :         struct winspool_AsyncGetCorePrinterDrivers r;
   15157           0 :         NTSTATUS status;
   15158             : 
   15159             :         /* In parameters */
   15160           0 :         r.in.pszServer = _pszServer;
   15161           0 :         r.in.pszEnvironment = _pszEnvironment;
   15162           0 :         r.in.cchCoreDrivers = _cchCoreDrivers;
   15163           0 :         r.in.pszzCoreDriverDependencies = _pszzCoreDriverDependencies;
   15164           0 :         r.in.cCorePrinterDrivers = _cCorePrinterDrivers;
   15165             : 
   15166             :         /* Out parameters */
   15167           0 :         r.out.pCorePrinterDrivers = _pCorePrinterDrivers;
   15168             : 
   15169             :         /* Result */
   15170           0 :         NDR_ZERO_STRUCT(r.out.result);
   15171             : 
   15172           0 :         status = dcerpc_winspool_AsyncGetCorePrinterDrivers_r(h, mem_ctx, &r);
   15173           0 :         if (!NT_STATUS_IS_OK(status)) {
   15174           0 :                 return status;
   15175             :         }
   15176             : 
   15177             :         /* Return variables */
   15178             :         {
   15179           0 :                 size_t _copy_len_pCorePrinterDrivers;
   15180           0 :                 _copy_len_pCorePrinterDrivers = r.in.cCorePrinterDrivers;
   15181           0 :                 if (_pCorePrinterDrivers != r.out.pCorePrinterDrivers) {
   15182           0 :                         memcpy(_pCorePrinterDrivers, r.out.pCorePrinterDrivers, _copy_len_pCorePrinterDrivers * sizeof(*_pCorePrinterDrivers));
   15183             :                 }
   15184             :         }
   15185             : 
   15186             :         /* Return result */
   15187           0 :         *result = r.out.result;
   15188             : 
   15189           0 :         return NT_STATUS_OK;
   15190             : }
   15191             : 
   15192             : struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_state {
   15193             :         TALLOC_CTX *out_mem_ctx;
   15194             : };
   15195             : 
   15196             : static void dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_done(struct tevent_req *subreq);
   15197             : 
   15198           0 : struct tevent_req *dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_send(TALLOC_CTX *mem_ctx,
   15199             :         struct tevent_context *ev,
   15200             :         struct dcerpc_binding_handle *h,
   15201             :         struct winspool_AsyncCorePrinterDriverInstalled *r)
   15202             : {
   15203           0 :         struct tevent_req *req;
   15204           0 :         struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_state *state;
   15205           0 :         struct tevent_req *subreq;
   15206             : 
   15207           0 :         req = tevent_req_create(mem_ctx, &state,
   15208             :                                 struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_state);
   15209           0 :         if (req == NULL) {
   15210           0 :                 return NULL;
   15211             :         }
   15212             : 
   15213           0 :         state->out_mem_ctx = talloc_new(state);
   15214           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   15215           0 :                 return tevent_req_post(req, ev);
   15216             :         }
   15217             : 
   15218           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   15219             :                         NULL, &ndr_table_iremotewinspool,
   15220           0 :                         NDR_WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED, state->out_mem_ctx, r);
   15221           0 :         if (tevent_req_nomem(subreq, req)) {
   15222           0 :                 return tevent_req_post(req, ev);
   15223             :         }
   15224           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_done, req);
   15225             : 
   15226           0 :         return req;
   15227             : }
   15228             : 
   15229           0 : static void dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_done(struct tevent_req *subreq)
   15230             : {
   15231           0 :         struct tevent_req *req =
   15232           0 :                 tevent_req_callback_data(subreq,
   15233             :                 struct tevent_req);
   15234           0 :         NTSTATUS status;
   15235             : 
   15236           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   15237           0 :         TALLOC_FREE(subreq);
   15238           0 :         if (tevent_req_nterror(req, status)) {
   15239           0 :                 return;
   15240             :         }
   15241             : 
   15242           0 :         tevent_req_done(req);
   15243             : }
   15244             : 
   15245           0 : NTSTATUS dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   15246             : {
   15247           0 :         struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_state *state =
   15248           0 :                 tevent_req_data(req,
   15249             :                 struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_state);
   15250           0 :         NTSTATUS status;
   15251             : 
   15252           0 :         if (tevent_req_is_nterror(req, &status)) {
   15253           0 :                 tevent_req_received(req);
   15254           0 :                 return status;
   15255             :         }
   15256             : 
   15257           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15258             : 
   15259           0 :         tevent_req_received(req);
   15260           0 :         return NT_STATUS_OK;
   15261             : }
   15262             : 
   15263           0 : NTSTATUS dcerpc_winspool_AsyncCorePrinterDriverInstalled_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncCorePrinterDriverInstalled *r)
   15264             : {
   15265           0 :         NTSTATUS status;
   15266             : 
   15267           0 :         status = dcerpc_binding_handle_call(h,
   15268             :                         NULL, &ndr_table_iremotewinspool,
   15269             :                         NDR_WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED, mem_ctx, r);
   15270             : 
   15271           0 :         return status;
   15272             : }
   15273             : 
   15274             : struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_state {
   15275             :         struct winspool_AsyncCorePrinterDriverInstalled orig;
   15276             :         struct winspool_AsyncCorePrinterDriverInstalled tmp;
   15277             :         TALLOC_CTX *out_mem_ctx;
   15278             : };
   15279             : 
   15280             : static void dcerpc_winspool_AsyncCorePrinterDriverInstalled_done(struct tevent_req *subreq);
   15281             : 
   15282           0 : struct tevent_req *dcerpc_winspool_AsyncCorePrinterDriverInstalled_send(TALLOC_CTX *mem_ctx,
   15283             :                                                                         struct tevent_context *ev,
   15284             :                                                                         struct dcerpc_binding_handle *h,
   15285             :                                                                         const char *_pszServer /* [in] [charset(UTF16),unique] */,
   15286             :                                                                         const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   15287             :                                                                         struct GUID _CoreDriverGUID /* [in]  */,
   15288             :                                                                         NTTIME _ftDriverDate /* [in]  */,
   15289             :                                                                         uint64_t _dwlDriverVersion /* [in]  */,
   15290             :                                                                         int32_t *_pbDriverInstalled /* [out] [ref] */)
   15291             : {
   15292           0 :         struct tevent_req *req;
   15293           0 :         struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_state *state;
   15294           0 :         struct tevent_req *subreq;
   15295             : 
   15296           0 :         req = tevent_req_create(mem_ctx, &state,
   15297             :                                 struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_state);
   15298           0 :         if (req == NULL) {
   15299           0 :                 return NULL;
   15300             :         }
   15301           0 :         state->out_mem_ctx = NULL;
   15302             : 
   15303             :         /* In parameters */
   15304           0 :         state->orig.in.pszServer = _pszServer;
   15305           0 :         state->orig.in.pszEnvironment = _pszEnvironment;
   15306           0 :         state->orig.in.CoreDriverGUID = _CoreDriverGUID;
   15307           0 :         state->orig.in.ftDriverDate = _ftDriverDate;
   15308           0 :         state->orig.in.dwlDriverVersion = _dwlDriverVersion;
   15309             : 
   15310             :         /* Out parameters */
   15311           0 :         state->orig.out.pbDriverInstalled = _pbDriverInstalled;
   15312             : 
   15313             :         /* Result */
   15314           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   15315             : 
   15316           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   15317             :                              "dcerpc_winspool_AsyncCorePrinterDriverInstalled_out_memory");
   15318           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   15319           0 :                 return tevent_req_post(req, ev);
   15320             :         }
   15321             : 
   15322             :         /* make a temporary copy, that we pass to the dispatch function */
   15323           0 :         state->tmp = state->orig;
   15324             : 
   15325           0 :         subreq = dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_send(state, ev, h, &state->tmp);
   15326           0 :         if (tevent_req_nomem(subreq, req)) {
   15327           0 :                 return tevent_req_post(req, ev);
   15328             :         }
   15329           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncCorePrinterDriverInstalled_done, req);
   15330           0 :         return req;
   15331             : }
   15332             : 
   15333           0 : static void dcerpc_winspool_AsyncCorePrinterDriverInstalled_done(struct tevent_req *subreq)
   15334             : {
   15335           0 :         struct tevent_req *req = tevent_req_callback_data(
   15336             :                 subreq, struct tevent_req);
   15337           0 :         struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_state *state = tevent_req_data(
   15338             :                 req, struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_state);
   15339           0 :         NTSTATUS status;
   15340           0 :         TALLOC_CTX *mem_ctx;
   15341             : 
   15342           0 :         if (state->out_mem_ctx) {
   15343           0 :                 mem_ctx = state->out_mem_ctx;
   15344             :         } else {
   15345           0 :                 mem_ctx = state;
   15346             :         }
   15347             : 
   15348           0 :         status = dcerpc_winspool_AsyncCorePrinterDriverInstalled_r_recv(subreq, mem_ctx);
   15349           0 :         TALLOC_FREE(subreq);
   15350           0 :         if (tevent_req_nterror(req, status)) {
   15351           0 :                 return;
   15352             :         }
   15353             : 
   15354             :         /* Copy out parameters */
   15355           0 :         *state->orig.out.pbDriverInstalled = *state->tmp.out.pbDriverInstalled;
   15356             : 
   15357             :         /* Copy result */
   15358           0 :         state->orig.out.result = state->tmp.out.result;
   15359             : 
   15360             :         /* Reset temporary structure */
   15361           0 :         NDR_ZERO_STRUCT(state->tmp);
   15362             : 
   15363           0 :         tevent_req_done(req);
   15364             : }
   15365             : 
   15366           0 : NTSTATUS dcerpc_winspool_AsyncCorePrinterDriverInstalled_recv(struct tevent_req *req,
   15367             :                                                               TALLOC_CTX *mem_ctx,
   15368             :                                                               HRESULT *result)
   15369             : {
   15370           0 :         struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_state *state = tevent_req_data(
   15371             :                 req, struct dcerpc_winspool_AsyncCorePrinterDriverInstalled_state);
   15372           0 :         NTSTATUS status;
   15373             : 
   15374           0 :         if (tevent_req_is_nterror(req, &status)) {
   15375           0 :                 tevent_req_received(req);
   15376           0 :                 return status;
   15377             :         }
   15378             : 
   15379             :         /* Steal possible out parameters to the callers context */
   15380           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15381             : 
   15382             :         /* Return result */
   15383           0 :         *result = state->orig.out.result;
   15384             : 
   15385           0 :         tevent_req_received(req);
   15386           0 :         return NT_STATUS_OK;
   15387             : }
   15388             : 
   15389           0 : NTSTATUS dcerpc_winspool_AsyncCorePrinterDriverInstalled(struct dcerpc_binding_handle *h,
   15390             :                                                          TALLOC_CTX *mem_ctx,
   15391             :                                                          const char *_pszServer /* [in] [charset(UTF16),unique] */,
   15392             :                                                          const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   15393             :                                                          struct GUID _CoreDriverGUID /* [in]  */,
   15394             :                                                          NTTIME _ftDriverDate /* [in]  */,
   15395             :                                                          uint64_t _dwlDriverVersion /* [in]  */,
   15396             :                                                          int32_t *_pbDriverInstalled /* [out] [ref] */,
   15397             :                                                          HRESULT *result)
   15398             : {
   15399           0 :         struct winspool_AsyncCorePrinterDriverInstalled r;
   15400           0 :         NTSTATUS status;
   15401             : 
   15402             :         /* In parameters */
   15403           0 :         r.in.pszServer = _pszServer;
   15404           0 :         r.in.pszEnvironment = _pszEnvironment;
   15405           0 :         r.in.CoreDriverGUID = _CoreDriverGUID;
   15406           0 :         r.in.ftDriverDate = _ftDriverDate;
   15407           0 :         r.in.dwlDriverVersion = _dwlDriverVersion;
   15408             : 
   15409             :         /* Out parameters */
   15410           0 :         r.out.pbDriverInstalled = _pbDriverInstalled;
   15411             : 
   15412             :         /* Result */
   15413           0 :         NDR_ZERO_STRUCT(r.out.result);
   15414             : 
   15415           0 :         status = dcerpc_winspool_AsyncCorePrinterDriverInstalled_r(h, mem_ctx, &r);
   15416           0 :         if (!NT_STATUS_IS_OK(status)) {
   15417           0 :                 return status;
   15418             :         }
   15419             : 
   15420             :         /* Return variables */
   15421           0 :         *_pbDriverInstalled = *r.out.pbDriverInstalled;
   15422             : 
   15423             :         /* Return result */
   15424           0 :         *result = r.out.result;
   15425             : 
   15426           0 :         return NT_STATUS_OK;
   15427             : }
   15428             : 
   15429             : struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_state {
   15430             :         TALLOC_CTX *out_mem_ctx;
   15431             : };
   15432             : 
   15433             : static void dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_done(struct tevent_req *subreq);
   15434             : 
   15435           0 : struct tevent_req *dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_send(TALLOC_CTX *mem_ctx,
   15436             :         struct tevent_context *ev,
   15437             :         struct dcerpc_binding_handle *h,
   15438             :         struct winspool_AsyncGetPrinterDriverPackagePath *r)
   15439             : {
   15440           0 :         struct tevent_req *req;
   15441           0 :         struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_state *state;
   15442           0 :         struct tevent_req *subreq;
   15443             : 
   15444           0 :         req = tevent_req_create(mem_ctx, &state,
   15445             :                                 struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_state);
   15446           0 :         if (req == NULL) {
   15447           0 :                 return NULL;
   15448             :         }
   15449             : 
   15450           0 :         state->out_mem_ctx = talloc_new(state);
   15451           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   15452           0 :                 return tevent_req_post(req, ev);
   15453             :         }
   15454             : 
   15455           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   15456             :                         NULL, &ndr_table_iremotewinspool,
   15457           0 :                         NDR_WINSPOOL_ASYNCGETPRINTERDRIVERPACKAGEPATH, state->out_mem_ctx, r);
   15458           0 :         if (tevent_req_nomem(subreq, req)) {
   15459           0 :                 return tevent_req_post(req, ev);
   15460             :         }
   15461           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_done, req);
   15462             : 
   15463           0 :         return req;
   15464             : }
   15465             : 
   15466           0 : static void dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_done(struct tevent_req *subreq)
   15467             : {
   15468           0 :         struct tevent_req *req =
   15469           0 :                 tevent_req_callback_data(subreq,
   15470             :                 struct tevent_req);
   15471           0 :         NTSTATUS status;
   15472             : 
   15473           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   15474           0 :         TALLOC_FREE(subreq);
   15475           0 :         if (tevent_req_nterror(req, status)) {
   15476           0 :                 return;
   15477             :         }
   15478             : 
   15479           0 :         tevent_req_done(req);
   15480             : }
   15481             : 
   15482           0 : NTSTATUS dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   15483             : {
   15484           0 :         struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_state *state =
   15485           0 :                 tevent_req_data(req,
   15486             :                 struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_state);
   15487           0 :         NTSTATUS status;
   15488             : 
   15489           0 :         if (tevent_req_is_nterror(req, &status)) {
   15490           0 :                 tevent_req_received(req);
   15491           0 :                 return status;
   15492             :         }
   15493             : 
   15494           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15495             : 
   15496           0 :         tevent_req_received(req);
   15497           0 :         return NT_STATUS_OK;
   15498             : }
   15499             : 
   15500           0 : NTSTATUS dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncGetPrinterDriverPackagePath *r)
   15501             : {
   15502           0 :         NTSTATUS status;
   15503             : 
   15504           0 :         status = dcerpc_binding_handle_call(h,
   15505             :                         NULL, &ndr_table_iremotewinspool,
   15506             :                         NDR_WINSPOOL_ASYNCGETPRINTERDRIVERPACKAGEPATH, mem_ctx, r);
   15507             : 
   15508           0 :         return status;
   15509             : }
   15510             : 
   15511             : struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_state {
   15512             :         struct winspool_AsyncGetPrinterDriverPackagePath orig;
   15513             :         struct winspool_AsyncGetPrinterDriverPackagePath tmp;
   15514             :         TALLOC_CTX *out_mem_ctx;
   15515             : };
   15516             : 
   15517             : static void dcerpc_winspool_AsyncGetPrinterDriverPackagePath_done(struct tevent_req *subreq);
   15518             : 
   15519           0 : struct tevent_req *dcerpc_winspool_AsyncGetPrinterDriverPackagePath_send(TALLOC_CTX *mem_ctx,
   15520             :                                                                          struct tevent_context *ev,
   15521             :                                                                          struct dcerpc_binding_handle *h,
   15522             :                                                                          const char *_pszServer /* [in] [charset(UTF16),unique] */,
   15523             :                                                                          const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   15524             :                                                                          const char *_pszLanguage /* [in] [charset(UTF16),unique] */,
   15525             :                                                                          const char *_pszPackageID /* [in] [charset(UTF16),ref] */,
   15526             :                                                                          uint16_t *_pszDriverPackageCab /* [in,out] [size_is(cchDriverPackageCab),unique] */,
   15527             :                                                                          uint32_t _cchDriverPackageCab /* [in]  */,
   15528             :                                                                          uint32_t *_pcchRequiredSize /* [out] [ref] */)
   15529             : {
   15530           0 :         struct tevent_req *req;
   15531           0 :         struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_state *state;
   15532           0 :         struct tevent_req *subreq;
   15533             : 
   15534           0 :         req = tevent_req_create(mem_ctx, &state,
   15535             :                                 struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_state);
   15536           0 :         if (req == NULL) {
   15537           0 :                 return NULL;
   15538             :         }
   15539           0 :         state->out_mem_ctx = NULL;
   15540             : 
   15541             :         /* In parameters */
   15542           0 :         state->orig.in.pszServer = _pszServer;
   15543           0 :         state->orig.in.pszEnvironment = _pszEnvironment;
   15544           0 :         state->orig.in.pszLanguage = _pszLanguage;
   15545           0 :         state->orig.in.pszPackageID = _pszPackageID;
   15546           0 :         state->orig.in.pszDriverPackageCab = _pszDriverPackageCab;
   15547           0 :         state->orig.in.cchDriverPackageCab = _cchDriverPackageCab;
   15548             : 
   15549             :         /* Out parameters */
   15550           0 :         state->orig.out.pszDriverPackageCab = _pszDriverPackageCab;
   15551           0 :         state->orig.out.pcchRequiredSize = _pcchRequiredSize;
   15552             : 
   15553             :         /* Result */
   15554           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   15555             : 
   15556           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   15557             :                              "dcerpc_winspool_AsyncGetPrinterDriverPackagePath_out_memory");
   15558           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   15559           0 :                 return tevent_req_post(req, ev);
   15560             :         }
   15561             : 
   15562             :         /* make a temporary copy, that we pass to the dispatch function */
   15563           0 :         state->tmp = state->orig;
   15564             : 
   15565           0 :         subreq = dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_send(state, ev, h, &state->tmp);
   15566           0 :         if (tevent_req_nomem(subreq, req)) {
   15567           0 :                 return tevent_req_post(req, ev);
   15568             :         }
   15569           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncGetPrinterDriverPackagePath_done, req);
   15570           0 :         return req;
   15571             : }
   15572             : 
   15573           0 : static void dcerpc_winspool_AsyncGetPrinterDriverPackagePath_done(struct tevent_req *subreq)
   15574             : {
   15575           0 :         struct tevent_req *req = tevent_req_callback_data(
   15576             :                 subreq, struct tevent_req);
   15577           0 :         struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_state *state = tevent_req_data(
   15578             :                 req, struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_state);
   15579           0 :         NTSTATUS status;
   15580           0 :         TALLOC_CTX *mem_ctx;
   15581             : 
   15582           0 :         if (state->out_mem_ctx) {
   15583           0 :                 mem_ctx = state->out_mem_ctx;
   15584             :         } else {
   15585           0 :                 mem_ctx = state;
   15586             :         }
   15587             : 
   15588           0 :         status = dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r_recv(subreq, mem_ctx);
   15589           0 :         TALLOC_FREE(subreq);
   15590           0 :         if (tevent_req_nterror(req, status)) {
   15591           0 :                 return;
   15592             :         }
   15593             : 
   15594             :         /* Copy out parameters */
   15595           0 :         if (state->orig.out.pszDriverPackageCab && state->tmp.out.pszDriverPackageCab) {
   15596             :                 {
   15597           0 :                         size_t _copy_len_pszDriverPackageCab;
   15598           0 :                         _copy_len_pszDriverPackageCab = state->tmp.in.cchDriverPackageCab;
   15599           0 :                         if (state->orig.out.pszDriverPackageCab != state->tmp.out.pszDriverPackageCab) {
   15600           0 :                                 memcpy(state->orig.out.pszDriverPackageCab, state->tmp.out.pszDriverPackageCab, _copy_len_pszDriverPackageCab * sizeof(*state->orig.out.pszDriverPackageCab));
   15601             :                         }
   15602             :                 }
   15603             :         }
   15604           0 :         *state->orig.out.pcchRequiredSize = *state->tmp.out.pcchRequiredSize;
   15605             : 
   15606             :         /* Copy result */
   15607           0 :         state->orig.out.result = state->tmp.out.result;
   15608             : 
   15609             :         /* Reset temporary structure */
   15610           0 :         NDR_ZERO_STRUCT(state->tmp);
   15611             : 
   15612           0 :         tevent_req_done(req);
   15613             : }
   15614             : 
   15615           0 : NTSTATUS dcerpc_winspool_AsyncGetPrinterDriverPackagePath_recv(struct tevent_req *req,
   15616             :                                                                TALLOC_CTX *mem_ctx,
   15617             :                                                                HRESULT *result)
   15618             : {
   15619           0 :         struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_state *state = tevent_req_data(
   15620             :                 req, struct dcerpc_winspool_AsyncGetPrinterDriverPackagePath_state);
   15621           0 :         NTSTATUS status;
   15622             : 
   15623           0 :         if (tevent_req_is_nterror(req, &status)) {
   15624           0 :                 tevent_req_received(req);
   15625           0 :                 return status;
   15626             :         }
   15627             : 
   15628             :         /* Steal possible out parameters to the callers context */
   15629           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15630             : 
   15631             :         /* Return result */
   15632           0 :         *result = state->orig.out.result;
   15633             : 
   15634           0 :         tevent_req_received(req);
   15635           0 :         return NT_STATUS_OK;
   15636             : }
   15637             : 
   15638           0 : NTSTATUS dcerpc_winspool_AsyncGetPrinterDriverPackagePath(struct dcerpc_binding_handle *h,
   15639             :                                                           TALLOC_CTX *mem_ctx,
   15640             :                                                           const char *_pszServer /* [in] [charset(UTF16),unique] */,
   15641             :                                                           const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   15642             :                                                           const char *_pszLanguage /* [in] [charset(UTF16),unique] */,
   15643             :                                                           const char *_pszPackageID /* [in] [charset(UTF16),ref] */,
   15644             :                                                           uint16_t *_pszDriverPackageCab /* [in,out] [size_is(cchDriverPackageCab),unique] */,
   15645             :                                                           uint32_t _cchDriverPackageCab /* [in]  */,
   15646             :                                                           uint32_t *_pcchRequiredSize /* [out] [ref] */,
   15647             :                                                           HRESULT *result)
   15648             : {
   15649           0 :         struct winspool_AsyncGetPrinterDriverPackagePath r;
   15650           0 :         NTSTATUS status;
   15651             : 
   15652             :         /* In parameters */
   15653           0 :         r.in.pszServer = _pszServer;
   15654           0 :         r.in.pszEnvironment = _pszEnvironment;
   15655           0 :         r.in.pszLanguage = _pszLanguage;
   15656           0 :         r.in.pszPackageID = _pszPackageID;
   15657           0 :         r.in.pszDriverPackageCab = _pszDriverPackageCab;
   15658           0 :         r.in.cchDriverPackageCab = _cchDriverPackageCab;
   15659             : 
   15660             :         /* Out parameters */
   15661           0 :         r.out.pszDriverPackageCab = _pszDriverPackageCab;
   15662           0 :         r.out.pcchRequiredSize = _pcchRequiredSize;
   15663             : 
   15664             :         /* Result */
   15665           0 :         NDR_ZERO_STRUCT(r.out.result);
   15666             : 
   15667           0 :         status = dcerpc_winspool_AsyncGetPrinterDriverPackagePath_r(h, mem_ctx, &r);
   15668           0 :         if (!NT_STATUS_IS_OK(status)) {
   15669           0 :                 return status;
   15670             :         }
   15671             : 
   15672             :         /* Return variables */
   15673           0 :         if (_pszDriverPackageCab && r.out.pszDriverPackageCab) {
   15674             :                 {
   15675           0 :                         size_t _copy_len_pszDriverPackageCab;
   15676           0 :                         _copy_len_pszDriverPackageCab = r.in.cchDriverPackageCab;
   15677           0 :                         if (_pszDriverPackageCab != r.out.pszDriverPackageCab) {
   15678           0 :                                 memcpy(_pszDriverPackageCab, r.out.pszDriverPackageCab, _copy_len_pszDriverPackageCab * sizeof(*_pszDriverPackageCab));
   15679             :                         }
   15680             :                 }
   15681             :         }
   15682           0 :         *_pcchRequiredSize = *r.out.pcchRequiredSize;
   15683             : 
   15684             :         /* Return result */
   15685           0 :         *result = r.out.result;
   15686             : 
   15687           0 :         return NT_STATUS_OK;
   15688             : }
   15689             : 
   15690             : struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_state {
   15691             :         TALLOC_CTX *out_mem_ctx;
   15692             : };
   15693             : 
   15694             : static void dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_done(struct tevent_req *subreq);
   15695             : 
   15696           0 : struct tevent_req *dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_send(TALLOC_CTX *mem_ctx,
   15697             :         struct tevent_context *ev,
   15698             :         struct dcerpc_binding_handle *h,
   15699             :         struct winspool_AsyncDeletePrinterDriverPackage *r)
   15700             : {
   15701           0 :         struct tevent_req *req;
   15702           0 :         struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_state *state;
   15703           0 :         struct tevent_req *subreq;
   15704             : 
   15705           0 :         req = tevent_req_create(mem_ctx, &state,
   15706             :                                 struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_state);
   15707           0 :         if (req == NULL) {
   15708           0 :                 return NULL;
   15709             :         }
   15710             : 
   15711           0 :         state->out_mem_ctx = NULL;
   15712             : 
   15713           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   15714             :                         NULL, &ndr_table_iremotewinspool,
   15715             :                         NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE, state, r);
   15716           0 :         if (tevent_req_nomem(subreq, req)) {
   15717           0 :                 return tevent_req_post(req, ev);
   15718             :         }
   15719           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_done, req);
   15720             : 
   15721           0 :         return req;
   15722             : }
   15723             : 
   15724           0 : static void dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_done(struct tevent_req *subreq)
   15725             : {
   15726           0 :         struct tevent_req *req =
   15727           0 :                 tevent_req_callback_data(subreq,
   15728             :                 struct tevent_req);
   15729           0 :         NTSTATUS status;
   15730             : 
   15731           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   15732           0 :         TALLOC_FREE(subreq);
   15733           0 :         if (tevent_req_nterror(req, status)) {
   15734           0 :                 return;
   15735             :         }
   15736             : 
   15737           0 :         tevent_req_done(req);
   15738             : }
   15739             : 
   15740           0 : NTSTATUS dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   15741             : {
   15742           0 :         struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_state *state =
   15743           0 :                 tevent_req_data(req,
   15744             :                 struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_state);
   15745           0 :         NTSTATUS status;
   15746             : 
   15747           0 :         if (tevent_req_is_nterror(req, &status)) {
   15748           0 :                 tevent_req_received(req);
   15749           0 :                 return status;
   15750             :         }
   15751             : 
   15752           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15753             : 
   15754           0 :         tevent_req_received(req);
   15755           0 :         return NT_STATUS_OK;
   15756             : }
   15757             : 
   15758           0 : NTSTATUS dcerpc_winspool_AsyncDeletePrinterDriverPackage_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncDeletePrinterDriverPackage *r)
   15759             : {
   15760           0 :         NTSTATUS status;
   15761             : 
   15762           0 :         status = dcerpc_binding_handle_call(h,
   15763             :                         NULL, &ndr_table_iremotewinspool,
   15764             :                         NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE, mem_ctx, r);
   15765             : 
   15766           0 :         return status;
   15767             : }
   15768             : 
   15769             : struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_state {
   15770             :         struct winspool_AsyncDeletePrinterDriverPackage orig;
   15771             :         struct winspool_AsyncDeletePrinterDriverPackage tmp;
   15772             :         TALLOC_CTX *out_mem_ctx;
   15773             : };
   15774             : 
   15775             : static void dcerpc_winspool_AsyncDeletePrinterDriverPackage_done(struct tevent_req *subreq);
   15776             : 
   15777           0 : struct tevent_req *dcerpc_winspool_AsyncDeletePrinterDriverPackage_send(TALLOC_CTX *mem_ctx,
   15778             :                                                                         struct tevent_context *ev,
   15779             :                                                                         struct dcerpc_binding_handle *h,
   15780             :                                                                         const char *_pszServer /* [in] [charset(UTF16),unique] */,
   15781             :                                                                         const char *_pszInfPath /* [in] [charset(UTF16),ref] */,
   15782             :                                                                         const char *_pszEnvironment /* [in] [charset(UTF16),ref] */)
   15783             : {
   15784           0 :         struct tevent_req *req;
   15785           0 :         struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_state *state;
   15786           0 :         struct tevent_req *subreq;
   15787             : 
   15788           0 :         req = tevent_req_create(mem_ctx, &state,
   15789             :                                 struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_state);
   15790           0 :         if (req == NULL) {
   15791           0 :                 return NULL;
   15792             :         }
   15793           0 :         state->out_mem_ctx = NULL;
   15794             : 
   15795             :         /* In parameters */
   15796           0 :         state->orig.in.pszServer = _pszServer;
   15797           0 :         state->orig.in.pszInfPath = _pszInfPath;
   15798           0 :         state->orig.in.pszEnvironment = _pszEnvironment;
   15799             : 
   15800             :         /* Out parameters */
   15801             : 
   15802             :         /* Result */
   15803           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   15804             : 
   15805             :         /* make a temporary copy, that we pass to the dispatch function */
   15806           0 :         state->tmp = state->orig;
   15807             : 
   15808           0 :         subreq = dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_send(state, ev, h, &state->tmp);
   15809           0 :         if (tevent_req_nomem(subreq, req)) {
   15810           0 :                 return tevent_req_post(req, ev);
   15811             :         }
   15812           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncDeletePrinterDriverPackage_done, req);
   15813           0 :         return req;
   15814             : }
   15815             : 
   15816           0 : static void dcerpc_winspool_AsyncDeletePrinterDriverPackage_done(struct tevent_req *subreq)
   15817             : {
   15818           0 :         struct tevent_req *req = tevent_req_callback_data(
   15819             :                 subreq, struct tevent_req);
   15820           0 :         struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_state *state = tevent_req_data(
   15821             :                 req, struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_state);
   15822           0 :         NTSTATUS status;
   15823           0 :         TALLOC_CTX *mem_ctx;
   15824             : 
   15825           0 :         if (state->out_mem_ctx) {
   15826           0 :                 mem_ctx = state->out_mem_ctx;
   15827             :         } else {
   15828           0 :                 mem_ctx = state;
   15829             :         }
   15830             : 
   15831           0 :         status = dcerpc_winspool_AsyncDeletePrinterDriverPackage_r_recv(subreq, mem_ctx);
   15832           0 :         TALLOC_FREE(subreq);
   15833           0 :         if (tevent_req_nterror(req, status)) {
   15834           0 :                 return;
   15835             :         }
   15836             : 
   15837             :         /* Copy out parameters */
   15838             : 
   15839             :         /* Copy result */
   15840           0 :         state->orig.out.result = state->tmp.out.result;
   15841             : 
   15842             :         /* Reset temporary structure */
   15843           0 :         NDR_ZERO_STRUCT(state->tmp);
   15844             : 
   15845           0 :         tevent_req_done(req);
   15846             : }
   15847             : 
   15848           0 : NTSTATUS dcerpc_winspool_AsyncDeletePrinterDriverPackage_recv(struct tevent_req *req,
   15849             :                                                               TALLOC_CTX *mem_ctx,
   15850             :                                                               HRESULT *result)
   15851             : {
   15852           0 :         struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_state *state = tevent_req_data(
   15853             :                 req, struct dcerpc_winspool_AsyncDeletePrinterDriverPackage_state);
   15854           0 :         NTSTATUS status;
   15855             : 
   15856           0 :         if (tevent_req_is_nterror(req, &status)) {
   15857           0 :                 tevent_req_received(req);
   15858           0 :                 return status;
   15859             :         }
   15860             : 
   15861             :         /* Steal possible out parameters to the callers context */
   15862           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15863             : 
   15864             :         /* Return result */
   15865           0 :         *result = state->orig.out.result;
   15866             : 
   15867           0 :         tevent_req_received(req);
   15868           0 :         return NT_STATUS_OK;
   15869             : }
   15870             : 
   15871           0 : NTSTATUS dcerpc_winspool_AsyncDeletePrinterDriverPackage(struct dcerpc_binding_handle *h,
   15872             :                                                          TALLOC_CTX *mem_ctx,
   15873             :                                                          const char *_pszServer /* [in] [charset(UTF16),unique] */,
   15874             :                                                          const char *_pszInfPath /* [in] [charset(UTF16),ref] */,
   15875             :                                                          const char *_pszEnvironment /* [in] [charset(UTF16),ref] */,
   15876             :                                                          HRESULT *result)
   15877             : {
   15878           0 :         struct winspool_AsyncDeletePrinterDriverPackage r;
   15879           0 :         NTSTATUS status;
   15880             : 
   15881             :         /* In parameters */
   15882           0 :         r.in.pszServer = _pszServer;
   15883           0 :         r.in.pszInfPath = _pszInfPath;
   15884           0 :         r.in.pszEnvironment = _pszEnvironment;
   15885             : 
   15886             :         /* Out parameters */
   15887             : 
   15888             :         /* Result */
   15889           0 :         NDR_ZERO_STRUCT(r.out.result);
   15890             : 
   15891           0 :         status = dcerpc_winspool_AsyncDeletePrinterDriverPackage_r(h, mem_ctx, &r);
   15892           0 :         if (!NT_STATUS_IS_OK(status)) {
   15893           0 :                 return status;
   15894             :         }
   15895             : 
   15896             :         /* Return variables */
   15897             : 
   15898             :         /* Return result */
   15899           0 :         *result = r.out.result;
   15900             : 
   15901           0 :         return NT_STATUS_OK;
   15902             : }
   15903             : 
   15904             : struct dcerpc_winspool_AsyncReadPrinter_r_state {
   15905             :         TALLOC_CTX *out_mem_ctx;
   15906             : };
   15907             : 
   15908             : static void dcerpc_winspool_AsyncReadPrinter_r_done(struct tevent_req *subreq);
   15909             : 
   15910           0 : struct tevent_req *dcerpc_winspool_AsyncReadPrinter_r_send(TALLOC_CTX *mem_ctx,
   15911             :         struct tevent_context *ev,
   15912             :         struct dcerpc_binding_handle *h,
   15913             :         struct winspool_AsyncReadPrinter *r)
   15914             : {
   15915           0 :         struct tevent_req *req;
   15916           0 :         struct dcerpc_winspool_AsyncReadPrinter_r_state *state;
   15917           0 :         struct tevent_req *subreq;
   15918             : 
   15919           0 :         req = tevent_req_create(mem_ctx, &state,
   15920             :                                 struct dcerpc_winspool_AsyncReadPrinter_r_state);
   15921           0 :         if (req == NULL) {
   15922           0 :                 return NULL;
   15923             :         }
   15924             : 
   15925           0 :         state->out_mem_ctx = talloc_new(state);
   15926           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   15927           0 :                 return tevent_req_post(req, ev);
   15928             :         }
   15929             : 
   15930           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   15931             :                         NULL, &ndr_table_iremotewinspool,
   15932           0 :                         NDR_WINSPOOL_ASYNCREADPRINTER, state->out_mem_ctx, r);
   15933           0 :         if (tevent_req_nomem(subreq, req)) {
   15934           0 :                 return tevent_req_post(req, ev);
   15935             :         }
   15936           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncReadPrinter_r_done, req);
   15937             : 
   15938           0 :         return req;
   15939             : }
   15940             : 
   15941           0 : static void dcerpc_winspool_AsyncReadPrinter_r_done(struct tevent_req *subreq)
   15942             : {
   15943           0 :         struct tevent_req *req =
   15944           0 :                 tevent_req_callback_data(subreq,
   15945             :                 struct tevent_req);
   15946           0 :         NTSTATUS status;
   15947             : 
   15948           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   15949           0 :         TALLOC_FREE(subreq);
   15950           0 :         if (tevent_req_nterror(req, status)) {
   15951           0 :                 return;
   15952             :         }
   15953             : 
   15954           0 :         tevent_req_done(req);
   15955             : }
   15956             : 
   15957           0 : NTSTATUS dcerpc_winspool_AsyncReadPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   15958             : {
   15959           0 :         struct dcerpc_winspool_AsyncReadPrinter_r_state *state =
   15960           0 :                 tevent_req_data(req,
   15961             :                 struct dcerpc_winspool_AsyncReadPrinter_r_state);
   15962           0 :         NTSTATUS status;
   15963             : 
   15964           0 :         if (tevent_req_is_nterror(req, &status)) {
   15965           0 :                 tevent_req_received(req);
   15966           0 :                 return status;
   15967             :         }
   15968             : 
   15969           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15970             : 
   15971           0 :         tevent_req_received(req);
   15972           0 :         return NT_STATUS_OK;
   15973             : }
   15974             : 
   15975           0 : NTSTATUS dcerpc_winspool_AsyncReadPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncReadPrinter *r)
   15976             : {
   15977           0 :         NTSTATUS status;
   15978             : 
   15979           0 :         status = dcerpc_binding_handle_call(h,
   15980             :                         NULL, &ndr_table_iremotewinspool,
   15981             :                         NDR_WINSPOOL_ASYNCREADPRINTER, mem_ctx, r);
   15982             : 
   15983           0 :         return status;
   15984             : }
   15985             : 
   15986             : struct dcerpc_winspool_AsyncReadPrinter_state {
   15987             :         struct winspool_AsyncReadPrinter orig;
   15988             :         struct winspool_AsyncReadPrinter tmp;
   15989             :         TALLOC_CTX *out_mem_ctx;
   15990             : };
   15991             : 
   15992             : static void dcerpc_winspool_AsyncReadPrinter_done(struct tevent_req *subreq);
   15993             : 
   15994           0 : struct tevent_req *dcerpc_winspool_AsyncReadPrinter_send(TALLOC_CTX *mem_ctx,
   15995             :                                                          struct tevent_context *ev,
   15996             :                                                          struct dcerpc_binding_handle *h,
   15997             :                                                          struct policy_handle _hPrinter /* [in]  */,
   15998             :                                                          uint8_t *_pBuf /* [out] [ref,size_is(cbBuf)] */,
   15999             :                                                          uint32_t _cbBuf /* [in]  */,
   16000             :                                                          uint32_t *_pcNoBytesRead /* [out] [ref] */)
   16001             : {
   16002           0 :         struct tevent_req *req;
   16003           0 :         struct dcerpc_winspool_AsyncReadPrinter_state *state;
   16004           0 :         struct tevent_req *subreq;
   16005             : 
   16006           0 :         req = tevent_req_create(mem_ctx, &state,
   16007             :                                 struct dcerpc_winspool_AsyncReadPrinter_state);
   16008           0 :         if (req == NULL) {
   16009           0 :                 return NULL;
   16010             :         }
   16011           0 :         state->out_mem_ctx = NULL;
   16012             : 
   16013             :         /* In parameters */
   16014           0 :         state->orig.in.hPrinter = _hPrinter;
   16015           0 :         state->orig.in.cbBuf = _cbBuf;
   16016             : 
   16017             :         /* Out parameters */
   16018           0 :         state->orig.out.pBuf = _pBuf;
   16019           0 :         state->orig.out.pcNoBytesRead = _pcNoBytesRead;
   16020             : 
   16021             :         /* Result */
   16022           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   16023             : 
   16024           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   16025             :                              "dcerpc_winspool_AsyncReadPrinter_out_memory");
   16026           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16027           0 :                 return tevent_req_post(req, ev);
   16028             :         }
   16029             : 
   16030             :         /* make a temporary copy, that we pass to the dispatch function */
   16031           0 :         state->tmp = state->orig;
   16032             : 
   16033           0 :         subreq = dcerpc_winspool_AsyncReadPrinter_r_send(state, ev, h, &state->tmp);
   16034           0 :         if (tevent_req_nomem(subreq, req)) {
   16035           0 :                 return tevent_req_post(req, ev);
   16036             :         }
   16037           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncReadPrinter_done, req);
   16038           0 :         return req;
   16039             : }
   16040             : 
   16041           0 : static void dcerpc_winspool_AsyncReadPrinter_done(struct tevent_req *subreq)
   16042             : {
   16043           0 :         struct tevent_req *req = tevent_req_callback_data(
   16044             :                 subreq, struct tevent_req);
   16045           0 :         struct dcerpc_winspool_AsyncReadPrinter_state *state = tevent_req_data(
   16046             :                 req, struct dcerpc_winspool_AsyncReadPrinter_state);
   16047           0 :         NTSTATUS status;
   16048           0 :         TALLOC_CTX *mem_ctx;
   16049             : 
   16050           0 :         if (state->out_mem_ctx) {
   16051           0 :                 mem_ctx = state->out_mem_ctx;
   16052             :         } else {
   16053           0 :                 mem_ctx = state;
   16054             :         }
   16055             : 
   16056           0 :         status = dcerpc_winspool_AsyncReadPrinter_r_recv(subreq, mem_ctx);
   16057           0 :         TALLOC_FREE(subreq);
   16058           0 :         if (tevent_req_nterror(req, status)) {
   16059           0 :                 return;
   16060             :         }
   16061             : 
   16062             :         /* Copy out parameters */
   16063             :         {
   16064           0 :                 size_t _copy_len_pBuf;
   16065           0 :                 _copy_len_pBuf = state->tmp.in.cbBuf;
   16066           0 :                 if (state->orig.out.pBuf != state->tmp.out.pBuf) {
   16067           0 :                         memcpy(state->orig.out.pBuf, state->tmp.out.pBuf, _copy_len_pBuf * sizeof(*state->orig.out.pBuf));
   16068             :                 }
   16069             :         }
   16070           0 :         *state->orig.out.pcNoBytesRead = *state->tmp.out.pcNoBytesRead;
   16071             : 
   16072             :         /* Copy result */
   16073           0 :         state->orig.out.result = state->tmp.out.result;
   16074             : 
   16075             :         /* Reset temporary structure */
   16076           0 :         NDR_ZERO_STRUCT(state->tmp);
   16077             : 
   16078           0 :         tevent_req_done(req);
   16079             : }
   16080             : 
   16081           0 : NTSTATUS dcerpc_winspool_AsyncReadPrinter_recv(struct tevent_req *req,
   16082             :                                                TALLOC_CTX *mem_ctx,
   16083             :                                                WERROR *result)
   16084             : {
   16085           0 :         struct dcerpc_winspool_AsyncReadPrinter_state *state = tevent_req_data(
   16086             :                 req, struct dcerpc_winspool_AsyncReadPrinter_state);
   16087           0 :         NTSTATUS status;
   16088             : 
   16089           0 :         if (tevent_req_is_nterror(req, &status)) {
   16090           0 :                 tevent_req_received(req);
   16091           0 :                 return status;
   16092             :         }
   16093             : 
   16094             :         /* Steal possible out parameters to the callers context */
   16095           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16096             : 
   16097             :         /* Return result */
   16098           0 :         *result = state->orig.out.result;
   16099             : 
   16100           0 :         tevent_req_received(req);
   16101           0 :         return NT_STATUS_OK;
   16102             : }
   16103             : 
   16104           0 : NTSTATUS dcerpc_winspool_AsyncReadPrinter(struct dcerpc_binding_handle *h,
   16105             :                                           TALLOC_CTX *mem_ctx,
   16106             :                                           struct policy_handle _hPrinter /* [in]  */,
   16107             :                                           uint8_t *_pBuf /* [out] [ref,size_is(cbBuf)] */,
   16108             :                                           uint32_t _cbBuf /* [in]  */,
   16109             :                                           uint32_t *_pcNoBytesRead /* [out] [ref] */,
   16110             :                                           WERROR *result)
   16111             : {
   16112           0 :         struct winspool_AsyncReadPrinter r;
   16113           0 :         NTSTATUS status;
   16114             : 
   16115             :         /* In parameters */
   16116           0 :         r.in.hPrinter = _hPrinter;
   16117           0 :         r.in.cbBuf = _cbBuf;
   16118             : 
   16119             :         /* Out parameters */
   16120           0 :         r.out.pBuf = _pBuf;
   16121           0 :         r.out.pcNoBytesRead = _pcNoBytesRead;
   16122             : 
   16123             :         /* Result */
   16124           0 :         NDR_ZERO_STRUCT(r.out.result);
   16125             : 
   16126           0 :         status = dcerpc_winspool_AsyncReadPrinter_r(h, mem_ctx, &r);
   16127           0 :         if (!NT_STATUS_IS_OK(status)) {
   16128           0 :                 return status;
   16129             :         }
   16130             : 
   16131             :         /* Return variables */
   16132             :         {
   16133           0 :                 size_t _copy_len_pBuf;
   16134           0 :                 _copy_len_pBuf = r.in.cbBuf;
   16135           0 :                 if (_pBuf != r.out.pBuf) {
   16136           0 :                         memcpy(_pBuf, r.out.pBuf, _copy_len_pBuf * sizeof(*_pBuf));
   16137             :                 }
   16138             :         }
   16139           0 :         *_pcNoBytesRead = *r.out.pcNoBytesRead;
   16140             : 
   16141             :         /* Return result */
   16142           0 :         *result = r.out.result;
   16143             : 
   16144           0 :         return NT_STATUS_OK;
   16145             : }
   16146             : 
   16147             : struct dcerpc_winspool_AsyncResetPrinter_r_state {
   16148             :         TALLOC_CTX *out_mem_ctx;
   16149             : };
   16150             : 
   16151             : static void dcerpc_winspool_AsyncResetPrinter_r_done(struct tevent_req *subreq);
   16152             : 
   16153           0 : struct tevent_req *dcerpc_winspool_AsyncResetPrinter_r_send(TALLOC_CTX *mem_ctx,
   16154             :         struct tevent_context *ev,
   16155             :         struct dcerpc_binding_handle *h,
   16156             :         struct winspool_AsyncResetPrinter *r)
   16157             : {
   16158           0 :         struct tevent_req *req;
   16159           0 :         struct dcerpc_winspool_AsyncResetPrinter_r_state *state;
   16160           0 :         struct tevent_req *subreq;
   16161             : 
   16162           0 :         req = tevent_req_create(mem_ctx, &state,
   16163             :                                 struct dcerpc_winspool_AsyncResetPrinter_r_state);
   16164           0 :         if (req == NULL) {
   16165           0 :                 return NULL;
   16166             :         }
   16167             : 
   16168           0 :         state->out_mem_ctx = NULL;
   16169             : 
   16170           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   16171             :                         NULL, &ndr_table_iremotewinspool,
   16172             :                         NDR_WINSPOOL_ASYNCRESETPRINTER, state, r);
   16173           0 :         if (tevent_req_nomem(subreq, req)) {
   16174           0 :                 return tevent_req_post(req, ev);
   16175             :         }
   16176           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncResetPrinter_r_done, req);
   16177             : 
   16178           0 :         return req;
   16179             : }
   16180             : 
   16181           0 : static void dcerpc_winspool_AsyncResetPrinter_r_done(struct tevent_req *subreq)
   16182             : {
   16183           0 :         struct tevent_req *req =
   16184           0 :                 tevent_req_callback_data(subreq,
   16185             :                 struct tevent_req);
   16186           0 :         NTSTATUS status;
   16187             : 
   16188           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   16189           0 :         TALLOC_FREE(subreq);
   16190           0 :         if (tevent_req_nterror(req, status)) {
   16191           0 :                 return;
   16192             :         }
   16193             : 
   16194           0 :         tevent_req_done(req);
   16195             : }
   16196             : 
   16197           0 : NTSTATUS dcerpc_winspool_AsyncResetPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   16198             : {
   16199           0 :         struct dcerpc_winspool_AsyncResetPrinter_r_state *state =
   16200           0 :                 tevent_req_data(req,
   16201             :                 struct dcerpc_winspool_AsyncResetPrinter_r_state);
   16202           0 :         NTSTATUS status;
   16203             : 
   16204           0 :         if (tevent_req_is_nterror(req, &status)) {
   16205           0 :                 tevent_req_received(req);
   16206           0 :                 return status;
   16207             :         }
   16208             : 
   16209           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16210             : 
   16211           0 :         tevent_req_received(req);
   16212           0 :         return NT_STATUS_OK;
   16213             : }
   16214             : 
   16215           0 : NTSTATUS dcerpc_winspool_AsyncResetPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncResetPrinter *r)
   16216             : {
   16217           0 :         NTSTATUS status;
   16218             : 
   16219           0 :         status = dcerpc_binding_handle_call(h,
   16220             :                         NULL, &ndr_table_iremotewinspool,
   16221             :                         NDR_WINSPOOL_ASYNCRESETPRINTER, mem_ctx, r);
   16222             : 
   16223           0 :         return status;
   16224             : }
   16225             : 
   16226             : struct dcerpc_winspool_AsyncResetPrinter_state {
   16227             :         struct winspool_AsyncResetPrinter orig;
   16228             :         struct winspool_AsyncResetPrinter tmp;
   16229             :         TALLOC_CTX *out_mem_ctx;
   16230             : };
   16231             : 
   16232             : static void dcerpc_winspool_AsyncResetPrinter_done(struct tevent_req *subreq);
   16233             : 
   16234           0 : struct tevent_req *dcerpc_winspool_AsyncResetPrinter_send(TALLOC_CTX *mem_ctx,
   16235             :                                                           struct tevent_context *ev,
   16236             :                                                           struct dcerpc_binding_handle *h,
   16237             :                                                           struct policy_handle _hPrinter /* [in]  */,
   16238             :                                                           const char *_pDatatype /* [in] [charset(UTF16),unique] */,
   16239             :                                                           struct spoolss_DevmodeContainer *_pDevModeContainer /* [in] [ref] */)
   16240             : {
   16241           0 :         struct tevent_req *req;
   16242           0 :         struct dcerpc_winspool_AsyncResetPrinter_state *state;
   16243           0 :         struct tevent_req *subreq;
   16244             : 
   16245           0 :         req = tevent_req_create(mem_ctx, &state,
   16246             :                                 struct dcerpc_winspool_AsyncResetPrinter_state);
   16247           0 :         if (req == NULL) {
   16248           0 :                 return NULL;
   16249             :         }
   16250           0 :         state->out_mem_ctx = NULL;
   16251             : 
   16252             :         /* In parameters */
   16253           0 :         state->orig.in.hPrinter = _hPrinter;
   16254           0 :         state->orig.in.pDatatype = _pDatatype;
   16255           0 :         state->orig.in.pDevModeContainer = _pDevModeContainer;
   16256             : 
   16257             :         /* Out parameters */
   16258             : 
   16259             :         /* Result */
   16260           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   16261             : 
   16262             :         /* make a temporary copy, that we pass to the dispatch function */
   16263           0 :         state->tmp = state->orig;
   16264             : 
   16265           0 :         subreq = dcerpc_winspool_AsyncResetPrinter_r_send(state, ev, h, &state->tmp);
   16266           0 :         if (tevent_req_nomem(subreq, req)) {
   16267           0 :                 return tevent_req_post(req, ev);
   16268             :         }
   16269           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncResetPrinter_done, req);
   16270           0 :         return req;
   16271             : }
   16272             : 
   16273           0 : static void dcerpc_winspool_AsyncResetPrinter_done(struct tevent_req *subreq)
   16274             : {
   16275           0 :         struct tevent_req *req = tevent_req_callback_data(
   16276             :                 subreq, struct tevent_req);
   16277           0 :         struct dcerpc_winspool_AsyncResetPrinter_state *state = tevent_req_data(
   16278             :                 req, struct dcerpc_winspool_AsyncResetPrinter_state);
   16279           0 :         NTSTATUS status;
   16280           0 :         TALLOC_CTX *mem_ctx;
   16281             : 
   16282           0 :         if (state->out_mem_ctx) {
   16283           0 :                 mem_ctx = state->out_mem_ctx;
   16284             :         } else {
   16285           0 :                 mem_ctx = state;
   16286             :         }
   16287             : 
   16288           0 :         status = dcerpc_winspool_AsyncResetPrinter_r_recv(subreq, mem_ctx);
   16289           0 :         TALLOC_FREE(subreq);
   16290           0 :         if (tevent_req_nterror(req, status)) {
   16291           0 :                 return;
   16292             :         }
   16293             : 
   16294             :         /* Copy out parameters */
   16295             : 
   16296             :         /* Copy result */
   16297           0 :         state->orig.out.result = state->tmp.out.result;
   16298             : 
   16299             :         /* Reset temporary structure */
   16300           0 :         NDR_ZERO_STRUCT(state->tmp);
   16301             : 
   16302           0 :         tevent_req_done(req);
   16303             : }
   16304             : 
   16305           0 : NTSTATUS dcerpc_winspool_AsyncResetPrinter_recv(struct tevent_req *req,
   16306             :                                                 TALLOC_CTX *mem_ctx,
   16307             :                                                 WERROR *result)
   16308             : {
   16309           0 :         struct dcerpc_winspool_AsyncResetPrinter_state *state = tevent_req_data(
   16310             :                 req, struct dcerpc_winspool_AsyncResetPrinter_state);
   16311           0 :         NTSTATUS status;
   16312             : 
   16313           0 :         if (tevent_req_is_nterror(req, &status)) {
   16314           0 :                 tevent_req_received(req);
   16315           0 :                 return status;
   16316             :         }
   16317             : 
   16318             :         /* Steal possible out parameters to the callers context */
   16319           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16320             : 
   16321             :         /* Return result */
   16322           0 :         *result = state->orig.out.result;
   16323             : 
   16324           0 :         tevent_req_received(req);
   16325           0 :         return NT_STATUS_OK;
   16326             : }
   16327             : 
   16328           0 : NTSTATUS dcerpc_winspool_AsyncResetPrinter(struct dcerpc_binding_handle *h,
   16329             :                                            TALLOC_CTX *mem_ctx,
   16330             :                                            struct policy_handle _hPrinter /* [in]  */,
   16331             :                                            const char *_pDatatype /* [in] [charset(UTF16),unique] */,
   16332             :                                            struct spoolss_DevmodeContainer *_pDevModeContainer /* [in] [ref] */,
   16333             :                                            WERROR *result)
   16334             : {
   16335           0 :         struct winspool_AsyncResetPrinter r;
   16336           0 :         NTSTATUS status;
   16337             : 
   16338             :         /* In parameters */
   16339           0 :         r.in.hPrinter = _hPrinter;
   16340           0 :         r.in.pDatatype = _pDatatype;
   16341           0 :         r.in.pDevModeContainer = _pDevModeContainer;
   16342             : 
   16343             :         /* Out parameters */
   16344             : 
   16345             :         /* Result */
   16346           0 :         NDR_ZERO_STRUCT(r.out.result);
   16347             : 
   16348           0 :         status = dcerpc_winspool_AsyncResetPrinter_r(h, mem_ctx, &r);
   16349           0 :         if (!NT_STATUS_IS_OK(status)) {
   16350           0 :                 return status;
   16351             :         }
   16352             : 
   16353             :         /* Return variables */
   16354             : 
   16355             :         /* Return result */
   16356           0 :         *result = r.out.result;
   16357             : 
   16358           0 :         return NT_STATUS_OK;
   16359             : }
   16360             : 
   16361             : struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_state {
   16362             :         TALLOC_CTX *out_mem_ctx;
   16363             : };
   16364             : 
   16365             : static void dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_done(struct tevent_req *subreq);
   16366             : 
   16367           0 : struct tevent_req *dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_send(TALLOC_CTX *mem_ctx,
   16368             :         struct tevent_context *ev,
   16369             :         struct dcerpc_binding_handle *h,
   16370             :         struct winspool_AsyncGetJobNamedPropertyValue *r)
   16371             : {
   16372           0 :         struct tevent_req *req;
   16373           0 :         struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_state *state;
   16374           0 :         struct tevent_req *subreq;
   16375             : 
   16376           0 :         req = tevent_req_create(mem_ctx, &state,
   16377             :                                 struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_state);
   16378           0 :         if (req == NULL) {
   16379           0 :                 return NULL;
   16380             :         }
   16381             : 
   16382           0 :         state->out_mem_ctx = talloc_new(state);
   16383           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16384           0 :                 return tevent_req_post(req, ev);
   16385             :         }
   16386             : 
   16387           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   16388             :                         NULL, &ndr_table_iremotewinspool,
   16389           0 :                         NDR_WINSPOOL_ASYNCGETJOBNAMEDPROPERTYVALUE, state->out_mem_ctx, r);
   16390           0 :         if (tevent_req_nomem(subreq, req)) {
   16391           0 :                 return tevent_req_post(req, ev);
   16392             :         }
   16393           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_done, req);
   16394             : 
   16395           0 :         return req;
   16396             : }
   16397             : 
   16398           0 : static void dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_done(struct tevent_req *subreq)
   16399             : {
   16400           0 :         struct tevent_req *req =
   16401           0 :                 tevent_req_callback_data(subreq,
   16402             :                 struct tevent_req);
   16403           0 :         NTSTATUS status;
   16404             : 
   16405           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   16406           0 :         TALLOC_FREE(subreq);
   16407           0 :         if (tevent_req_nterror(req, status)) {
   16408           0 :                 return;
   16409             :         }
   16410             : 
   16411           0 :         tevent_req_done(req);
   16412             : }
   16413             : 
   16414           0 : NTSTATUS dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   16415             : {
   16416           0 :         struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_state *state =
   16417           0 :                 tevent_req_data(req,
   16418             :                 struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_state);
   16419           0 :         NTSTATUS status;
   16420             : 
   16421           0 :         if (tevent_req_is_nterror(req, &status)) {
   16422           0 :                 tevent_req_received(req);
   16423           0 :                 return status;
   16424             :         }
   16425             : 
   16426           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16427             : 
   16428           0 :         tevent_req_received(req);
   16429           0 :         return NT_STATUS_OK;
   16430             : }
   16431             : 
   16432           0 : NTSTATUS dcerpc_winspool_AsyncGetJobNamedPropertyValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncGetJobNamedPropertyValue *r)
   16433             : {
   16434           0 :         NTSTATUS status;
   16435             : 
   16436           0 :         status = dcerpc_binding_handle_call(h,
   16437             :                         NULL, &ndr_table_iremotewinspool,
   16438             :                         NDR_WINSPOOL_ASYNCGETJOBNAMEDPROPERTYVALUE, mem_ctx, r);
   16439             : 
   16440           0 :         return status;
   16441             : }
   16442             : 
   16443             : struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_state {
   16444             :         struct winspool_AsyncGetJobNamedPropertyValue orig;
   16445             :         struct winspool_AsyncGetJobNamedPropertyValue tmp;
   16446             :         TALLOC_CTX *out_mem_ctx;
   16447             : };
   16448             : 
   16449             : static void dcerpc_winspool_AsyncGetJobNamedPropertyValue_done(struct tevent_req *subreq);
   16450             : 
   16451           0 : struct tevent_req *dcerpc_winspool_AsyncGetJobNamedPropertyValue_send(TALLOC_CTX *mem_ctx,
   16452             :                                                                       struct tevent_context *ev,
   16453             :                                                                       struct dcerpc_binding_handle *h,
   16454             :                                                                       struct policy_handle _hPrinter /* [in]  */,
   16455             :                                                                       uint32_t _JobId /* [in]  */,
   16456             :                                                                       const char *_pszName /* [in] [charset(UTF16),ref] */,
   16457             :                                                                       struct spoolss_PrintPropertyValue *_pValue /* [out] [ref] */)
   16458             : {
   16459           0 :         struct tevent_req *req;
   16460           0 :         struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_state *state;
   16461           0 :         struct tevent_req *subreq;
   16462             : 
   16463           0 :         req = tevent_req_create(mem_ctx, &state,
   16464             :                                 struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_state);
   16465           0 :         if (req == NULL) {
   16466           0 :                 return NULL;
   16467             :         }
   16468           0 :         state->out_mem_ctx = NULL;
   16469             : 
   16470             :         /* In parameters */
   16471           0 :         state->orig.in.hPrinter = _hPrinter;
   16472           0 :         state->orig.in.JobId = _JobId;
   16473           0 :         state->orig.in.pszName = _pszName;
   16474             : 
   16475             :         /* Out parameters */
   16476           0 :         state->orig.out.pValue = _pValue;
   16477             : 
   16478             :         /* Result */
   16479           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   16480             : 
   16481           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   16482             :                              "dcerpc_winspool_AsyncGetJobNamedPropertyValue_out_memory");
   16483           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16484           0 :                 return tevent_req_post(req, ev);
   16485             :         }
   16486             : 
   16487             :         /* make a temporary copy, that we pass to the dispatch function */
   16488           0 :         state->tmp = state->orig;
   16489             : 
   16490           0 :         subreq = dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_send(state, ev, h, &state->tmp);
   16491           0 :         if (tevent_req_nomem(subreq, req)) {
   16492           0 :                 return tevent_req_post(req, ev);
   16493             :         }
   16494           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncGetJobNamedPropertyValue_done, req);
   16495           0 :         return req;
   16496             : }
   16497             : 
   16498           0 : static void dcerpc_winspool_AsyncGetJobNamedPropertyValue_done(struct tevent_req *subreq)
   16499             : {
   16500           0 :         struct tevent_req *req = tevent_req_callback_data(
   16501             :                 subreq, struct tevent_req);
   16502           0 :         struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_state *state = tevent_req_data(
   16503             :                 req, struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_state);
   16504           0 :         NTSTATUS status;
   16505           0 :         TALLOC_CTX *mem_ctx;
   16506             : 
   16507           0 :         if (state->out_mem_ctx) {
   16508           0 :                 mem_ctx = state->out_mem_ctx;
   16509             :         } else {
   16510           0 :                 mem_ctx = state;
   16511             :         }
   16512             : 
   16513           0 :         status = dcerpc_winspool_AsyncGetJobNamedPropertyValue_r_recv(subreq, mem_ctx);
   16514           0 :         TALLOC_FREE(subreq);
   16515           0 :         if (tevent_req_nterror(req, status)) {
   16516           0 :                 return;
   16517             :         }
   16518             : 
   16519             :         /* Copy out parameters */
   16520           0 :         *state->orig.out.pValue = *state->tmp.out.pValue;
   16521             : 
   16522             :         /* Copy result */
   16523           0 :         state->orig.out.result = state->tmp.out.result;
   16524             : 
   16525             :         /* Reset temporary structure */
   16526           0 :         NDR_ZERO_STRUCT(state->tmp);
   16527             : 
   16528           0 :         tevent_req_done(req);
   16529             : }
   16530             : 
   16531           0 : NTSTATUS dcerpc_winspool_AsyncGetJobNamedPropertyValue_recv(struct tevent_req *req,
   16532             :                                                             TALLOC_CTX *mem_ctx,
   16533             :                                                             WERROR *result)
   16534             : {
   16535           0 :         struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_state *state = tevent_req_data(
   16536             :                 req, struct dcerpc_winspool_AsyncGetJobNamedPropertyValue_state);
   16537           0 :         NTSTATUS status;
   16538             : 
   16539           0 :         if (tevent_req_is_nterror(req, &status)) {
   16540           0 :                 tevent_req_received(req);
   16541           0 :                 return status;
   16542             :         }
   16543             : 
   16544             :         /* Steal possible out parameters to the callers context */
   16545           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16546             : 
   16547             :         /* Return result */
   16548           0 :         *result = state->orig.out.result;
   16549             : 
   16550           0 :         tevent_req_received(req);
   16551           0 :         return NT_STATUS_OK;
   16552             : }
   16553             : 
   16554           0 : NTSTATUS dcerpc_winspool_AsyncGetJobNamedPropertyValue(struct dcerpc_binding_handle *h,
   16555             :                                                        TALLOC_CTX *mem_ctx,
   16556             :                                                        struct policy_handle _hPrinter /* [in]  */,
   16557             :                                                        uint32_t _JobId /* [in]  */,
   16558             :                                                        const char *_pszName /* [in] [charset(UTF16),ref] */,
   16559             :                                                        struct spoolss_PrintPropertyValue *_pValue /* [out] [ref] */,
   16560             :                                                        WERROR *result)
   16561             : {
   16562           0 :         struct winspool_AsyncGetJobNamedPropertyValue r;
   16563           0 :         NTSTATUS status;
   16564             : 
   16565             :         /* In parameters */
   16566           0 :         r.in.hPrinter = _hPrinter;
   16567           0 :         r.in.JobId = _JobId;
   16568           0 :         r.in.pszName = _pszName;
   16569             : 
   16570             :         /* Out parameters */
   16571           0 :         r.out.pValue = _pValue;
   16572             : 
   16573             :         /* Result */
   16574           0 :         NDR_ZERO_STRUCT(r.out.result);
   16575             : 
   16576           0 :         status = dcerpc_winspool_AsyncGetJobNamedPropertyValue_r(h, mem_ctx, &r);
   16577           0 :         if (!NT_STATUS_IS_OK(status)) {
   16578           0 :                 return status;
   16579             :         }
   16580             : 
   16581             :         /* Return variables */
   16582           0 :         *_pValue = *r.out.pValue;
   16583             : 
   16584             :         /* Return result */
   16585           0 :         *result = r.out.result;
   16586             : 
   16587           0 :         return NT_STATUS_OK;
   16588             : }
   16589             : 
   16590             : struct dcerpc_winspool_AsyncSetJobNamedProperty_r_state {
   16591             :         TALLOC_CTX *out_mem_ctx;
   16592             : };
   16593             : 
   16594             : static void dcerpc_winspool_AsyncSetJobNamedProperty_r_done(struct tevent_req *subreq);
   16595             : 
   16596           0 : struct tevent_req *dcerpc_winspool_AsyncSetJobNamedProperty_r_send(TALLOC_CTX *mem_ctx,
   16597             :         struct tevent_context *ev,
   16598             :         struct dcerpc_binding_handle *h,
   16599             :         struct winspool_AsyncSetJobNamedProperty *r)
   16600             : {
   16601           0 :         struct tevent_req *req;
   16602           0 :         struct dcerpc_winspool_AsyncSetJobNamedProperty_r_state *state;
   16603           0 :         struct tevent_req *subreq;
   16604             : 
   16605           0 :         req = tevent_req_create(mem_ctx, &state,
   16606             :                                 struct dcerpc_winspool_AsyncSetJobNamedProperty_r_state);
   16607           0 :         if (req == NULL) {
   16608           0 :                 return NULL;
   16609             :         }
   16610             : 
   16611           0 :         state->out_mem_ctx = NULL;
   16612             : 
   16613           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   16614             :                         NULL, &ndr_table_iremotewinspool,
   16615             :                         NDR_WINSPOOL_ASYNCSETJOBNAMEDPROPERTY, state, r);
   16616           0 :         if (tevent_req_nomem(subreq, req)) {
   16617           0 :                 return tevent_req_post(req, ev);
   16618             :         }
   16619           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncSetJobNamedProperty_r_done, req);
   16620             : 
   16621           0 :         return req;
   16622             : }
   16623             : 
   16624           0 : static void dcerpc_winspool_AsyncSetJobNamedProperty_r_done(struct tevent_req *subreq)
   16625             : {
   16626           0 :         struct tevent_req *req =
   16627           0 :                 tevent_req_callback_data(subreq,
   16628             :                 struct tevent_req);
   16629           0 :         NTSTATUS status;
   16630             : 
   16631           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   16632           0 :         TALLOC_FREE(subreq);
   16633           0 :         if (tevent_req_nterror(req, status)) {
   16634           0 :                 return;
   16635             :         }
   16636             : 
   16637           0 :         tevent_req_done(req);
   16638             : }
   16639             : 
   16640           0 : NTSTATUS dcerpc_winspool_AsyncSetJobNamedProperty_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   16641             : {
   16642           0 :         struct dcerpc_winspool_AsyncSetJobNamedProperty_r_state *state =
   16643           0 :                 tevent_req_data(req,
   16644             :                 struct dcerpc_winspool_AsyncSetJobNamedProperty_r_state);
   16645           0 :         NTSTATUS status;
   16646             : 
   16647           0 :         if (tevent_req_is_nterror(req, &status)) {
   16648           0 :                 tevent_req_received(req);
   16649           0 :                 return status;
   16650             :         }
   16651             : 
   16652           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16653             : 
   16654           0 :         tevent_req_received(req);
   16655           0 :         return NT_STATUS_OK;
   16656             : }
   16657             : 
   16658           0 : NTSTATUS dcerpc_winspool_AsyncSetJobNamedProperty_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncSetJobNamedProperty *r)
   16659             : {
   16660           0 :         NTSTATUS status;
   16661             : 
   16662           0 :         status = dcerpc_binding_handle_call(h,
   16663             :                         NULL, &ndr_table_iremotewinspool,
   16664             :                         NDR_WINSPOOL_ASYNCSETJOBNAMEDPROPERTY, mem_ctx, r);
   16665             : 
   16666           0 :         return status;
   16667             : }
   16668             : 
   16669             : struct dcerpc_winspool_AsyncSetJobNamedProperty_state {
   16670             :         struct winspool_AsyncSetJobNamedProperty orig;
   16671             :         struct winspool_AsyncSetJobNamedProperty tmp;
   16672             :         TALLOC_CTX *out_mem_ctx;
   16673             : };
   16674             : 
   16675             : static void dcerpc_winspool_AsyncSetJobNamedProperty_done(struct tevent_req *subreq);
   16676             : 
   16677           0 : struct tevent_req *dcerpc_winspool_AsyncSetJobNamedProperty_send(TALLOC_CTX *mem_ctx,
   16678             :                                                                  struct tevent_context *ev,
   16679             :                                                                  struct dcerpc_binding_handle *h,
   16680             :                                                                  struct policy_handle _hPrinter /* [in]  */,
   16681             :                                                                  uint32_t _JobId /* [in]  */,
   16682             :                                                                  struct spoolss_PrintNamedProperty *_pProperty /* [in] [ref] */)
   16683             : {
   16684           0 :         struct tevent_req *req;
   16685           0 :         struct dcerpc_winspool_AsyncSetJobNamedProperty_state *state;
   16686           0 :         struct tevent_req *subreq;
   16687             : 
   16688           0 :         req = tevent_req_create(mem_ctx, &state,
   16689             :                                 struct dcerpc_winspool_AsyncSetJobNamedProperty_state);
   16690           0 :         if (req == NULL) {
   16691           0 :                 return NULL;
   16692             :         }
   16693           0 :         state->out_mem_ctx = NULL;
   16694             : 
   16695             :         /* In parameters */
   16696           0 :         state->orig.in.hPrinter = _hPrinter;
   16697           0 :         state->orig.in.JobId = _JobId;
   16698           0 :         state->orig.in.pProperty = _pProperty;
   16699             : 
   16700             :         /* Out parameters */
   16701             : 
   16702             :         /* Result */
   16703           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   16704             : 
   16705             :         /* make a temporary copy, that we pass to the dispatch function */
   16706           0 :         state->tmp = state->orig;
   16707             : 
   16708           0 :         subreq = dcerpc_winspool_AsyncSetJobNamedProperty_r_send(state, ev, h, &state->tmp);
   16709           0 :         if (tevent_req_nomem(subreq, req)) {
   16710           0 :                 return tevent_req_post(req, ev);
   16711             :         }
   16712           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncSetJobNamedProperty_done, req);
   16713           0 :         return req;
   16714             : }
   16715             : 
   16716           0 : static void dcerpc_winspool_AsyncSetJobNamedProperty_done(struct tevent_req *subreq)
   16717             : {
   16718           0 :         struct tevent_req *req = tevent_req_callback_data(
   16719             :                 subreq, struct tevent_req);
   16720           0 :         struct dcerpc_winspool_AsyncSetJobNamedProperty_state *state = tevent_req_data(
   16721             :                 req, struct dcerpc_winspool_AsyncSetJobNamedProperty_state);
   16722           0 :         NTSTATUS status;
   16723           0 :         TALLOC_CTX *mem_ctx;
   16724             : 
   16725           0 :         if (state->out_mem_ctx) {
   16726           0 :                 mem_ctx = state->out_mem_ctx;
   16727             :         } else {
   16728           0 :                 mem_ctx = state;
   16729             :         }
   16730             : 
   16731           0 :         status = dcerpc_winspool_AsyncSetJobNamedProperty_r_recv(subreq, mem_ctx);
   16732           0 :         TALLOC_FREE(subreq);
   16733           0 :         if (tevent_req_nterror(req, status)) {
   16734           0 :                 return;
   16735             :         }
   16736             : 
   16737             :         /* Copy out parameters */
   16738             : 
   16739             :         /* Copy result */
   16740           0 :         state->orig.out.result = state->tmp.out.result;
   16741             : 
   16742             :         /* Reset temporary structure */
   16743           0 :         NDR_ZERO_STRUCT(state->tmp);
   16744             : 
   16745           0 :         tevent_req_done(req);
   16746             : }
   16747             : 
   16748           0 : NTSTATUS dcerpc_winspool_AsyncSetJobNamedProperty_recv(struct tevent_req *req,
   16749             :                                                        TALLOC_CTX *mem_ctx,
   16750             :                                                        WERROR *result)
   16751             : {
   16752           0 :         struct dcerpc_winspool_AsyncSetJobNamedProperty_state *state = tevent_req_data(
   16753             :                 req, struct dcerpc_winspool_AsyncSetJobNamedProperty_state);
   16754           0 :         NTSTATUS status;
   16755             : 
   16756           0 :         if (tevent_req_is_nterror(req, &status)) {
   16757           0 :                 tevent_req_received(req);
   16758           0 :                 return status;
   16759             :         }
   16760             : 
   16761             :         /* Steal possible out parameters to the callers context */
   16762           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16763             : 
   16764             :         /* Return result */
   16765           0 :         *result = state->orig.out.result;
   16766             : 
   16767           0 :         tevent_req_received(req);
   16768           0 :         return NT_STATUS_OK;
   16769             : }
   16770             : 
   16771           0 : NTSTATUS dcerpc_winspool_AsyncSetJobNamedProperty(struct dcerpc_binding_handle *h,
   16772             :                                                   TALLOC_CTX *mem_ctx,
   16773             :                                                   struct policy_handle _hPrinter /* [in]  */,
   16774             :                                                   uint32_t _JobId /* [in]  */,
   16775             :                                                   struct spoolss_PrintNamedProperty *_pProperty /* [in] [ref] */,
   16776             :                                                   WERROR *result)
   16777             : {
   16778           0 :         struct winspool_AsyncSetJobNamedProperty r;
   16779           0 :         NTSTATUS status;
   16780             : 
   16781             :         /* In parameters */
   16782           0 :         r.in.hPrinter = _hPrinter;
   16783           0 :         r.in.JobId = _JobId;
   16784           0 :         r.in.pProperty = _pProperty;
   16785             : 
   16786             :         /* Out parameters */
   16787             : 
   16788             :         /* Result */
   16789           0 :         NDR_ZERO_STRUCT(r.out.result);
   16790             : 
   16791           0 :         status = dcerpc_winspool_AsyncSetJobNamedProperty_r(h, mem_ctx, &r);
   16792           0 :         if (!NT_STATUS_IS_OK(status)) {
   16793           0 :                 return status;
   16794             :         }
   16795             : 
   16796             :         /* Return variables */
   16797             : 
   16798             :         /* Return result */
   16799           0 :         *result = r.out.result;
   16800             : 
   16801           0 :         return NT_STATUS_OK;
   16802             : }
   16803             : 
   16804             : struct dcerpc_winspool_AsyncDeleteJobNamedProperty_r_state {
   16805             :         TALLOC_CTX *out_mem_ctx;
   16806             : };
   16807             : 
   16808             : static void dcerpc_winspool_AsyncDeleteJobNamedProperty_r_done(struct tevent_req *subreq);
   16809             : 
   16810           0 : struct tevent_req *dcerpc_winspool_AsyncDeleteJobNamedProperty_r_send(TALLOC_CTX *mem_ctx,
   16811             :         struct tevent_context *ev,
   16812             :         struct dcerpc_binding_handle *h,
   16813             :         struct winspool_AsyncDeleteJobNamedProperty *r)
   16814             : {
   16815           0 :         struct tevent_req *req;
   16816           0 :         struct dcerpc_winspool_AsyncDeleteJobNamedProperty_r_state *state;
   16817           0 :         struct tevent_req *subreq;
   16818             : 
   16819           0 :         req = tevent_req_create(mem_ctx, &state,
   16820             :                                 struct dcerpc_winspool_AsyncDeleteJobNamedProperty_r_state);
   16821           0 :         if (req == NULL) {
   16822           0 :                 return NULL;
   16823             :         }
   16824             : 
   16825           0 :         state->out_mem_ctx = NULL;
   16826             : 
   16827           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   16828             :                         NULL, &ndr_table_iremotewinspool,
   16829             :                         NDR_WINSPOOL_ASYNCDELETEJOBNAMEDPROPERTY, state, r);
   16830           0 :         if (tevent_req_nomem(subreq, req)) {
   16831           0 :                 return tevent_req_post(req, ev);
   16832             :         }
   16833           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncDeleteJobNamedProperty_r_done, req);
   16834             : 
   16835           0 :         return req;
   16836             : }
   16837             : 
   16838           0 : static void dcerpc_winspool_AsyncDeleteJobNamedProperty_r_done(struct tevent_req *subreq)
   16839             : {
   16840           0 :         struct tevent_req *req =
   16841           0 :                 tevent_req_callback_data(subreq,
   16842             :                 struct tevent_req);
   16843           0 :         NTSTATUS status;
   16844             : 
   16845           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   16846           0 :         TALLOC_FREE(subreq);
   16847           0 :         if (tevent_req_nterror(req, status)) {
   16848           0 :                 return;
   16849             :         }
   16850             : 
   16851           0 :         tevent_req_done(req);
   16852             : }
   16853             : 
   16854           0 : NTSTATUS dcerpc_winspool_AsyncDeleteJobNamedProperty_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   16855             : {
   16856           0 :         struct dcerpc_winspool_AsyncDeleteJobNamedProperty_r_state *state =
   16857           0 :                 tevent_req_data(req,
   16858             :                 struct dcerpc_winspool_AsyncDeleteJobNamedProperty_r_state);
   16859           0 :         NTSTATUS status;
   16860             : 
   16861           0 :         if (tevent_req_is_nterror(req, &status)) {
   16862           0 :                 tevent_req_received(req);
   16863           0 :                 return status;
   16864             :         }
   16865             : 
   16866           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16867             : 
   16868           0 :         tevent_req_received(req);
   16869           0 :         return NT_STATUS_OK;
   16870             : }
   16871             : 
   16872           0 : NTSTATUS dcerpc_winspool_AsyncDeleteJobNamedProperty_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncDeleteJobNamedProperty *r)
   16873             : {
   16874           0 :         NTSTATUS status;
   16875             : 
   16876           0 :         status = dcerpc_binding_handle_call(h,
   16877             :                         NULL, &ndr_table_iremotewinspool,
   16878             :                         NDR_WINSPOOL_ASYNCDELETEJOBNAMEDPROPERTY, mem_ctx, r);
   16879             : 
   16880           0 :         return status;
   16881             : }
   16882             : 
   16883             : struct dcerpc_winspool_AsyncDeleteJobNamedProperty_state {
   16884             :         struct winspool_AsyncDeleteJobNamedProperty orig;
   16885             :         struct winspool_AsyncDeleteJobNamedProperty tmp;
   16886             :         TALLOC_CTX *out_mem_ctx;
   16887             : };
   16888             : 
   16889             : static void dcerpc_winspool_AsyncDeleteJobNamedProperty_done(struct tevent_req *subreq);
   16890             : 
   16891           0 : struct tevent_req *dcerpc_winspool_AsyncDeleteJobNamedProperty_send(TALLOC_CTX *mem_ctx,
   16892             :                                                                     struct tevent_context *ev,
   16893             :                                                                     struct dcerpc_binding_handle *h,
   16894             :                                                                     struct policy_handle _hPrinter /* [in]  */,
   16895             :                                                                     uint32_t _JobId /* [in]  */,
   16896             :                                                                     const char *_pszName /* [in] [charset(UTF16),ref] */)
   16897             : {
   16898           0 :         struct tevent_req *req;
   16899           0 :         struct dcerpc_winspool_AsyncDeleteJobNamedProperty_state *state;
   16900           0 :         struct tevent_req *subreq;
   16901             : 
   16902           0 :         req = tevent_req_create(mem_ctx, &state,
   16903             :                                 struct dcerpc_winspool_AsyncDeleteJobNamedProperty_state);
   16904           0 :         if (req == NULL) {
   16905           0 :                 return NULL;
   16906             :         }
   16907           0 :         state->out_mem_ctx = NULL;
   16908             : 
   16909             :         /* In parameters */
   16910           0 :         state->orig.in.hPrinter = _hPrinter;
   16911           0 :         state->orig.in.JobId = _JobId;
   16912           0 :         state->orig.in.pszName = _pszName;
   16913             : 
   16914             :         /* Out parameters */
   16915             : 
   16916             :         /* Result */
   16917           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   16918             : 
   16919             :         /* make a temporary copy, that we pass to the dispatch function */
   16920           0 :         state->tmp = state->orig;
   16921             : 
   16922           0 :         subreq = dcerpc_winspool_AsyncDeleteJobNamedProperty_r_send(state, ev, h, &state->tmp);
   16923           0 :         if (tevent_req_nomem(subreq, req)) {
   16924           0 :                 return tevent_req_post(req, ev);
   16925             :         }
   16926           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncDeleteJobNamedProperty_done, req);
   16927           0 :         return req;
   16928             : }
   16929             : 
   16930           0 : static void dcerpc_winspool_AsyncDeleteJobNamedProperty_done(struct tevent_req *subreq)
   16931             : {
   16932           0 :         struct tevent_req *req = tevent_req_callback_data(
   16933             :                 subreq, struct tevent_req);
   16934           0 :         struct dcerpc_winspool_AsyncDeleteJobNamedProperty_state *state = tevent_req_data(
   16935             :                 req, struct dcerpc_winspool_AsyncDeleteJobNamedProperty_state);
   16936           0 :         NTSTATUS status;
   16937           0 :         TALLOC_CTX *mem_ctx;
   16938             : 
   16939           0 :         if (state->out_mem_ctx) {
   16940           0 :                 mem_ctx = state->out_mem_ctx;
   16941             :         } else {
   16942           0 :                 mem_ctx = state;
   16943             :         }
   16944             : 
   16945           0 :         status = dcerpc_winspool_AsyncDeleteJobNamedProperty_r_recv(subreq, mem_ctx);
   16946           0 :         TALLOC_FREE(subreq);
   16947           0 :         if (tevent_req_nterror(req, status)) {
   16948           0 :                 return;
   16949             :         }
   16950             : 
   16951             :         /* Copy out parameters */
   16952             : 
   16953             :         /* Copy result */
   16954           0 :         state->orig.out.result = state->tmp.out.result;
   16955             : 
   16956             :         /* Reset temporary structure */
   16957           0 :         NDR_ZERO_STRUCT(state->tmp);
   16958             : 
   16959           0 :         tevent_req_done(req);
   16960             : }
   16961             : 
   16962           0 : NTSTATUS dcerpc_winspool_AsyncDeleteJobNamedProperty_recv(struct tevent_req *req,
   16963             :                                                           TALLOC_CTX *mem_ctx,
   16964             :                                                           WERROR *result)
   16965             : {
   16966           0 :         struct dcerpc_winspool_AsyncDeleteJobNamedProperty_state *state = tevent_req_data(
   16967             :                 req, struct dcerpc_winspool_AsyncDeleteJobNamedProperty_state);
   16968           0 :         NTSTATUS status;
   16969             : 
   16970           0 :         if (tevent_req_is_nterror(req, &status)) {
   16971           0 :                 tevent_req_received(req);
   16972           0 :                 return status;
   16973             :         }
   16974             : 
   16975             :         /* Steal possible out parameters to the callers context */
   16976           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16977             : 
   16978             :         /* Return result */
   16979           0 :         *result = state->orig.out.result;
   16980             : 
   16981           0 :         tevent_req_received(req);
   16982           0 :         return NT_STATUS_OK;
   16983             : }
   16984             : 
   16985           0 : NTSTATUS dcerpc_winspool_AsyncDeleteJobNamedProperty(struct dcerpc_binding_handle *h,
   16986             :                                                      TALLOC_CTX *mem_ctx,
   16987             :                                                      struct policy_handle _hPrinter /* [in]  */,
   16988             :                                                      uint32_t _JobId /* [in]  */,
   16989             :                                                      const char *_pszName /* [in] [charset(UTF16),ref] */,
   16990             :                                                      WERROR *result)
   16991             : {
   16992           0 :         struct winspool_AsyncDeleteJobNamedProperty r;
   16993           0 :         NTSTATUS status;
   16994             : 
   16995             :         /* In parameters */
   16996           0 :         r.in.hPrinter = _hPrinter;
   16997           0 :         r.in.JobId = _JobId;
   16998           0 :         r.in.pszName = _pszName;
   16999             : 
   17000             :         /* Out parameters */
   17001             : 
   17002             :         /* Result */
   17003           0 :         NDR_ZERO_STRUCT(r.out.result);
   17004             : 
   17005           0 :         status = dcerpc_winspool_AsyncDeleteJobNamedProperty_r(h, mem_ctx, &r);
   17006           0 :         if (!NT_STATUS_IS_OK(status)) {
   17007           0 :                 return status;
   17008             :         }
   17009             : 
   17010             :         /* Return variables */
   17011             : 
   17012             :         /* Return result */
   17013           0 :         *result = r.out.result;
   17014             : 
   17015           0 :         return NT_STATUS_OK;
   17016             : }
   17017             : 
   17018             : struct dcerpc_winspool_AsyncEnumJobNamedProperties_r_state {
   17019             :         TALLOC_CTX *out_mem_ctx;
   17020             : };
   17021             : 
   17022             : static void dcerpc_winspool_AsyncEnumJobNamedProperties_r_done(struct tevent_req *subreq);
   17023             : 
   17024           0 : struct tevent_req *dcerpc_winspool_AsyncEnumJobNamedProperties_r_send(TALLOC_CTX *mem_ctx,
   17025             :         struct tevent_context *ev,
   17026             :         struct dcerpc_binding_handle *h,
   17027             :         struct winspool_AsyncEnumJobNamedProperties *r)
   17028             : {
   17029           0 :         struct tevent_req *req;
   17030           0 :         struct dcerpc_winspool_AsyncEnumJobNamedProperties_r_state *state;
   17031           0 :         struct tevent_req *subreq;
   17032             : 
   17033           0 :         req = tevent_req_create(mem_ctx, &state,
   17034             :                                 struct dcerpc_winspool_AsyncEnumJobNamedProperties_r_state);
   17035           0 :         if (req == NULL) {
   17036           0 :                 return NULL;
   17037             :         }
   17038             : 
   17039           0 :         state->out_mem_ctx = talloc_new(state);
   17040           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   17041           0 :                 return tevent_req_post(req, ev);
   17042             :         }
   17043             : 
   17044           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   17045             :                         NULL, &ndr_table_iremotewinspool,
   17046           0 :                         NDR_WINSPOOL_ASYNCENUMJOBNAMEDPROPERTIES, state->out_mem_ctx, r);
   17047           0 :         if (tevent_req_nomem(subreq, req)) {
   17048           0 :                 return tevent_req_post(req, ev);
   17049             :         }
   17050           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumJobNamedProperties_r_done, req);
   17051             : 
   17052           0 :         return req;
   17053             : }
   17054             : 
   17055           0 : static void dcerpc_winspool_AsyncEnumJobNamedProperties_r_done(struct tevent_req *subreq)
   17056             : {
   17057           0 :         struct tevent_req *req =
   17058           0 :                 tevent_req_callback_data(subreq,
   17059             :                 struct tevent_req);
   17060           0 :         NTSTATUS status;
   17061             : 
   17062           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   17063           0 :         TALLOC_FREE(subreq);
   17064           0 :         if (tevent_req_nterror(req, status)) {
   17065           0 :                 return;
   17066             :         }
   17067             : 
   17068           0 :         tevent_req_done(req);
   17069             : }
   17070             : 
   17071           0 : NTSTATUS dcerpc_winspool_AsyncEnumJobNamedProperties_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   17072             : {
   17073           0 :         struct dcerpc_winspool_AsyncEnumJobNamedProperties_r_state *state =
   17074           0 :                 tevent_req_data(req,
   17075             :                 struct dcerpc_winspool_AsyncEnumJobNamedProperties_r_state);
   17076           0 :         NTSTATUS status;
   17077             : 
   17078           0 :         if (tevent_req_is_nterror(req, &status)) {
   17079           0 :                 tevent_req_received(req);
   17080           0 :                 return status;
   17081             :         }
   17082             : 
   17083           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17084             : 
   17085           0 :         tevent_req_received(req);
   17086           0 :         return NT_STATUS_OK;
   17087             : }
   17088             : 
   17089           0 : NTSTATUS dcerpc_winspool_AsyncEnumJobNamedProperties_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncEnumJobNamedProperties *r)
   17090             : {
   17091           0 :         NTSTATUS status;
   17092             : 
   17093           0 :         status = dcerpc_binding_handle_call(h,
   17094             :                         NULL, &ndr_table_iremotewinspool,
   17095             :                         NDR_WINSPOOL_ASYNCENUMJOBNAMEDPROPERTIES, mem_ctx, r);
   17096             : 
   17097           0 :         return status;
   17098             : }
   17099             : 
   17100             : struct dcerpc_winspool_AsyncEnumJobNamedProperties_state {
   17101             :         struct winspool_AsyncEnumJobNamedProperties orig;
   17102             :         struct winspool_AsyncEnumJobNamedProperties tmp;
   17103             :         TALLOC_CTX *out_mem_ctx;
   17104             : };
   17105             : 
   17106             : static void dcerpc_winspool_AsyncEnumJobNamedProperties_done(struct tevent_req *subreq);
   17107             : 
   17108           0 : struct tevent_req *dcerpc_winspool_AsyncEnumJobNamedProperties_send(TALLOC_CTX *mem_ctx,
   17109             :                                                                     struct tevent_context *ev,
   17110             :                                                                     struct dcerpc_binding_handle *h,
   17111             :                                                                     struct policy_handle _hPrinter /* [in]  */,
   17112             :                                                                     uint32_t _JobId /* [in]  */,
   17113             :                                                                     uint32_t *_pcProperties /* [out] [ref] */,
   17114             :                                                                     struct spoolss_PrintNamedProperty **_ppProperties /* [out] [ref,size_is(,*pcProperties)] */)
   17115             : {
   17116           0 :         struct tevent_req *req;
   17117           0 :         struct dcerpc_winspool_AsyncEnumJobNamedProperties_state *state;
   17118           0 :         struct tevent_req *subreq;
   17119             : 
   17120           0 :         req = tevent_req_create(mem_ctx, &state,
   17121             :                                 struct dcerpc_winspool_AsyncEnumJobNamedProperties_state);
   17122           0 :         if (req == NULL) {
   17123           0 :                 return NULL;
   17124             :         }
   17125           0 :         state->out_mem_ctx = NULL;
   17126             : 
   17127             :         /* In parameters */
   17128           0 :         state->orig.in.hPrinter = _hPrinter;
   17129           0 :         state->orig.in.JobId = _JobId;
   17130             : 
   17131             :         /* Out parameters */
   17132           0 :         state->orig.out.pcProperties = _pcProperties;
   17133           0 :         state->orig.out.ppProperties = _ppProperties;
   17134             : 
   17135             :         /* Result */
   17136           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   17137             : 
   17138           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   17139             :                              "dcerpc_winspool_AsyncEnumJobNamedProperties_out_memory");
   17140           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   17141           0 :                 return tevent_req_post(req, ev);
   17142             :         }
   17143             : 
   17144             :         /* make a temporary copy, that we pass to the dispatch function */
   17145           0 :         state->tmp = state->orig;
   17146             : 
   17147           0 :         subreq = dcerpc_winspool_AsyncEnumJobNamedProperties_r_send(state, ev, h, &state->tmp);
   17148           0 :         if (tevent_req_nomem(subreq, req)) {
   17149           0 :                 return tevent_req_post(req, ev);
   17150             :         }
   17151           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncEnumJobNamedProperties_done, req);
   17152           0 :         return req;
   17153             : }
   17154             : 
   17155           0 : static void dcerpc_winspool_AsyncEnumJobNamedProperties_done(struct tevent_req *subreq)
   17156             : {
   17157           0 :         struct tevent_req *req = tevent_req_callback_data(
   17158             :                 subreq, struct tevent_req);
   17159           0 :         struct dcerpc_winspool_AsyncEnumJobNamedProperties_state *state = tevent_req_data(
   17160             :                 req, struct dcerpc_winspool_AsyncEnumJobNamedProperties_state);
   17161           0 :         NTSTATUS status;
   17162           0 :         TALLOC_CTX *mem_ctx;
   17163             : 
   17164           0 :         if (state->out_mem_ctx) {
   17165           0 :                 mem_ctx = state->out_mem_ctx;
   17166             :         } else {
   17167           0 :                 mem_ctx = state;
   17168             :         }
   17169             : 
   17170           0 :         status = dcerpc_winspool_AsyncEnumJobNamedProperties_r_recv(subreq, mem_ctx);
   17171           0 :         TALLOC_FREE(subreq);
   17172           0 :         if (tevent_req_nterror(req, status)) {
   17173           0 :                 return;
   17174             :         }
   17175             : 
   17176             :         /* Copy out parameters */
   17177           0 :         *state->orig.out.pcProperties = *state->tmp.out.pcProperties;
   17178           0 :         *state->orig.out.ppProperties = *state->tmp.out.ppProperties;
   17179             : 
   17180             :         /* Copy result */
   17181           0 :         state->orig.out.result = state->tmp.out.result;
   17182             : 
   17183             :         /* Reset temporary structure */
   17184           0 :         NDR_ZERO_STRUCT(state->tmp);
   17185             : 
   17186           0 :         tevent_req_done(req);
   17187             : }
   17188             : 
   17189           0 : NTSTATUS dcerpc_winspool_AsyncEnumJobNamedProperties_recv(struct tevent_req *req,
   17190             :                                                           TALLOC_CTX *mem_ctx,
   17191             :                                                           WERROR *result)
   17192             : {
   17193           0 :         struct dcerpc_winspool_AsyncEnumJobNamedProperties_state *state = tevent_req_data(
   17194             :                 req, struct dcerpc_winspool_AsyncEnumJobNamedProperties_state);
   17195           0 :         NTSTATUS status;
   17196             : 
   17197           0 :         if (tevent_req_is_nterror(req, &status)) {
   17198           0 :                 tevent_req_received(req);
   17199           0 :                 return status;
   17200             :         }
   17201             : 
   17202             :         /* Steal possible out parameters to the callers context */
   17203           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17204             : 
   17205             :         /* Return result */
   17206           0 :         *result = state->orig.out.result;
   17207             : 
   17208           0 :         tevent_req_received(req);
   17209           0 :         return NT_STATUS_OK;
   17210             : }
   17211             : 
   17212           0 : NTSTATUS dcerpc_winspool_AsyncEnumJobNamedProperties(struct dcerpc_binding_handle *h,
   17213             :                                                      TALLOC_CTX *mem_ctx,
   17214             :                                                      struct policy_handle _hPrinter /* [in]  */,
   17215             :                                                      uint32_t _JobId /* [in]  */,
   17216             :                                                      uint32_t *_pcProperties /* [out] [ref] */,
   17217             :                                                      struct spoolss_PrintNamedProperty **_ppProperties /* [out] [ref,size_is(,*pcProperties)] */,
   17218             :                                                      WERROR *result)
   17219             : {
   17220           0 :         struct winspool_AsyncEnumJobNamedProperties r;
   17221           0 :         NTSTATUS status;
   17222             : 
   17223             :         /* In parameters */
   17224           0 :         r.in.hPrinter = _hPrinter;
   17225           0 :         r.in.JobId = _JobId;
   17226             : 
   17227             :         /* Out parameters */
   17228           0 :         r.out.pcProperties = _pcProperties;
   17229           0 :         r.out.ppProperties = _ppProperties;
   17230             : 
   17231             :         /* Result */
   17232           0 :         NDR_ZERO_STRUCT(r.out.result);
   17233             : 
   17234           0 :         status = dcerpc_winspool_AsyncEnumJobNamedProperties_r(h, mem_ctx, &r);
   17235           0 :         if (!NT_STATUS_IS_OK(status)) {
   17236           0 :                 return status;
   17237             :         }
   17238             : 
   17239             :         /* Return variables */
   17240           0 :         *_pcProperties = *r.out.pcProperties;
   17241           0 :         *_ppProperties = *r.out.ppProperties;
   17242             : 
   17243             :         /* Return result */
   17244           0 :         *result = r.out.result;
   17245             : 
   17246           0 :         return NT_STATUS_OK;
   17247             : }
   17248             : 
   17249             : struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_state {
   17250             :         TALLOC_CTX *out_mem_ctx;
   17251             : };
   17252             : 
   17253             : static void dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_done(struct tevent_req *subreq);
   17254             : 
   17255           0 : struct tevent_req *dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_send(TALLOC_CTX *mem_ctx,
   17256             :         struct tevent_context *ev,
   17257             :         struct dcerpc_binding_handle *h,
   17258             :         struct winspool_AsyncLogJobInfoForBranchOffice *r)
   17259             : {
   17260           0 :         struct tevent_req *req;
   17261           0 :         struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_state *state;
   17262           0 :         struct tevent_req *subreq;
   17263             : 
   17264           0 :         req = tevent_req_create(mem_ctx, &state,
   17265             :                                 struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_state);
   17266           0 :         if (req == NULL) {
   17267           0 :                 return NULL;
   17268             :         }
   17269             : 
   17270           0 :         state->out_mem_ctx = NULL;
   17271             : 
   17272           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   17273             :                         NULL, &ndr_table_iremotewinspool,
   17274             :                         NDR_WINSPOOL_ASYNCLOGJOBINFOFORBRANCHOFFICE, state, r);
   17275           0 :         if (tevent_req_nomem(subreq, req)) {
   17276           0 :                 return tevent_req_post(req, ev);
   17277             :         }
   17278           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_done, req);
   17279             : 
   17280           0 :         return req;
   17281             : }
   17282             : 
   17283           0 : static void dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_done(struct tevent_req *subreq)
   17284             : {
   17285           0 :         struct tevent_req *req =
   17286           0 :                 tevent_req_callback_data(subreq,
   17287             :                 struct tevent_req);
   17288           0 :         NTSTATUS status;
   17289             : 
   17290           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   17291           0 :         TALLOC_FREE(subreq);
   17292           0 :         if (tevent_req_nterror(req, status)) {
   17293           0 :                 return;
   17294             :         }
   17295             : 
   17296           0 :         tevent_req_done(req);
   17297             : }
   17298             : 
   17299           0 : NTSTATUS dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   17300             : {
   17301           0 :         struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_state *state =
   17302           0 :                 tevent_req_data(req,
   17303             :                 struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_state);
   17304           0 :         NTSTATUS status;
   17305             : 
   17306           0 :         if (tevent_req_is_nterror(req, &status)) {
   17307           0 :                 tevent_req_received(req);
   17308           0 :                 return status;
   17309             :         }
   17310             : 
   17311           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17312             : 
   17313           0 :         tevent_req_received(req);
   17314           0 :         return NT_STATUS_OK;
   17315             : }
   17316             : 
   17317           0 : NTSTATUS dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winspool_AsyncLogJobInfoForBranchOffice *r)
   17318             : {
   17319           0 :         NTSTATUS status;
   17320             : 
   17321           0 :         status = dcerpc_binding_handle_call(h,
   17322             :                         NULL, &ndr_table_iremotewinspool,
   17323             :                         NDR_WINSPOOL_ASYNCLOGJOBINFOFORBRANCHOFFICE, mem_ctx, r);
   17324             : 
   17325           0 :         return status;
   17326             : }
   17327             : 
   17328             : struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_state {
   17329             :         struct winspool_AsyncLogJobInfoForBranchOffice orig;
   17330             :         struct winspool_AsyncLogJobInfoForBranchOffice tmp;
   17331             :         TALLOC_CTX *out_mem_ctx;
   17332             : };
   17333             : 
   17334             : static void dcerpc_winspool_AsyncLogJobInfoForBranchOffice_done(struct tevent_req *subreq);
   17335             : 
   17336           0 : struct tevent_req *dcerpc_winspool_AsyncLogJobInfoForBranchOffice_send(TALLOC_CTX *mem_ctx,
   17337             :                                                                        struct tevent_context *ev,
   17338             :                                                                        struct dcerpc_binding_handle *h,
   17339             :                                                                        struct policy_handle _hPrinter /* [in]  */,
   17340             :                                                                        struct spoolss_BranchOfficeJobDataContainer *_pBranchOfficeJobDataContainer /* [in] [ref] */)
   17341             : {
   17342           0 :         struct tevent_req *req;
   17343           0 :         struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_state *state;
   17344           0 :         struct tevent_req *subreq;
   17345             : 
   17346           0 :         req = tevent_req_create(mem_ctx, &state,
   17347             :                                 struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_state);
   17348           0 :         if (req == NULL) {
   17349           0 :                 return NULL;
   17350             :         }
   17351           0 :         state->out_mem_ctx = NULL;
   17352             : 
   17353             :         /* In parameters */
   17354           0 :         state->orig.in.hPrinter = _hPrinter;
   17355           0 :         state->orig.in.pBranchOfficeJobDataContainer = _pBranchOfficeJobDataContainer;
   17356             : 
   17357             :         /* Out parameters */
   17358             : 
   17359             :         /* Result */
   17360           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   17361             : 
   17362             :         /* make a temporary copy, that we pass to the dispatch function */
   17363           0 :         state->tmp = state->orig;
   17364             : 
   17365           0 :         subreq = dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_send(state, ev, h, &state->tmp);
   17366           0 :         if (tevent_req_nomem(subreq, req)) {
   17367           0 :                 return tevent_req_post(req, ev);
   17368             :         }
   17369           0 :         tevent_req_set_callback(subreq, dcerpc_winspool_AsyncLogJobInfoForBranchOffice_done, req);
   17370           0 :         return req;
   17371             : }
   17372             : 
   17373           0 : static void dcerpc_winspool_AsyncLogJobInfoForBranchOffice_done(struct tevent_req *subreq)
   17374             : {
   17375           0 :         struct tevent_req *req = tevent_req_callback_data(
   17376             :                 subreq, struct tevent_req);
   17377           0 :         struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_state *state = tevent_req_data(
   17378             :                 req, struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_state);
   17379           0 :         NTSTATUS status;
   17380           0 :         TALLOC_CTX *mem_ctx;
   17381             : 
   17382           0 :         if (state->out_mem_ctx) {
   17383           0 :                 mem_ctx = state->out_mem_ctx;
   17384             :         } else {
   17385           0 :                 mem_ctx = state;
   17386             :         }
   17387             : 
   17388           0 :         status = dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r_recv(subreq, mem_ctx);
   17389           0 :         TALLOC_FREE(subreq);
   17390           0 :         if (tevent_req_nterror(req, status)) {
   17391           0 :                 return;
   17392             :         }
   17393             : 
   17394             :         /* Copy out parameters */
   17395             : 
   17396             :         /* Copy result */
   17397           0 :         state->orig.out.result = state->tmp.out.result;
   17398             : 
   17399             :         /* Reset temporary structure */
   17400           0 :         NDR_ZERO_STRUCT(state->tmp);
   17401             : 
   17402           0 :         tevent_req_done(req);
   17403             : }
   17404             : 
   17405           0 : NTSTATUS dcerpc_winspool_AsyncLogJobInfoForBranchOffice_recv(struct tevent_req *req,
   17406             :                                                              TALLOC_CTX *mem_ctx,
   17407             :                                                              WERROR *result)
   17408             : {
   17409           0 :         struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_state *state = tevent_req_data(
   17410             :                 req, struct dcerpc_winspool_AsyncLogJobInfoForBranchOffice_state);
   17411           0 :         NTSTATUS status;
   17412             : 
   17413           0 :         if (tevent_req_is_nterror(req, &status)) {
   17414           0 :                 tevent_req_received(req);
   17415           0 :                 return status;
   17416             :         }
   17417             : 
   17418             :         /* Steal possible out parameters to the callers context */
   17419           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17420             : 
   17421             :         /* Return result */
   17422           0 :         *result = state->orig.out.result;
   17423             : 
   17424           0 :         tevent_req_received(req);
   17425           0 :         return NT_STATUS_OK;
   17426             : }
   17427             : 
   17428           0 : NTSTATUS dcerpc_winspool_AsyncLogJobInfoForBranchOffice(struct dcerpc_binding_handle *h,
   17429             :                                                         TALLOC_CTX *mem_ctx,
   17430             :                                                         struct policy_handle _hPrinter /* [in]  */,
   17431             :                                                         struct spoolss_BranchOfficeJobDataContainer *_pBranchOfficeJobDataContainer /* [in] [ref] */,
   17432             :                                                         WERROR *result)
   17433             : {
   17434           0 :         struct winspool_AsyncLogJobInfoForBranchOffice r;
   17435           0 :         NTSTATUS status;
   17436             : 
   17437             :         /* In parameters */
   17438           0 :         r.in.hPrinter = _hPrinter;
   17439           0 :         r.in.pBranchOfficeJobDataContainer = _pBranchOfficeJobDataContainer;
   17440             : 
   17441             :         /* Out parameters */
   17442             : 
   17443             :         /* Result */
   17444           0 :         NDR_ZERO_STRUCT(r.out.result);
   17445             : 
   17446           0 :         status = dcerpc_winspool_AsyncLogJobInfoForBranchOffice_r(h, mem_ctx, &r);
   17447           0 :         if (!NT_STATUS_IS_OK(status)) {
   17448           0 :                 return status;
   17449             :         }
   17450             : 
   17451             :         /* Return variables */
   17452             : 
   17453             :         /* Return result */
   17454           0 :         *result = r.out.result;
   17455             : 
   17456           0 :         return NT_STATUS_OK;
   17457             : }
   17458             : 

Generated by: LCOV version 1.14