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