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 master 2f515e9b Lines: 237 7874 3.0 %
Date: 2024-04-21 15:09:00 Functions: 58 624 9.3 %

          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           0 :         struct tevent_req *req;
      23           0 :         struct dcerpc_spoolss_EnumPrinters_r_state *state;
      24           0 :         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           0 :         NTSTATUS status;
      54             : 
      55           0 :         status = dcerpc_binding_handle_call_recv(subreq);
      56           0 :         TALLOC_FREE(subreq);
      57           0 :         if (tevent_req_nterror(req, status)) {
      58           0 :                 return;
      59             :         }
      60             : 
      61           0 :         tevent_req_done(req);
      62             : }
      63             : 
      64           0 : NTSTATUS dcerpc_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           0 :         NTSTATUS status;
      70             : 
      71           0 :         if (tevent_req_is_nterror(req, &status)) {
      72           0 :                 tevent_req_received(req);
      73           0 :                 return status;
      74             :         }
      75             : 
      76           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
      77             : 
      78           0 :         tevent_req_received(req);
      79           0 :         return NT_STATUS_OK;
      80             : }
      81             : 
      82         180 : NTSTATUS dcerpc_spoolss_EnumPrinters_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrinters *r)
      83             : {
      84           0 :         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           0 :         struct tevent_req *req;
     114           0 :         struct dcerpc_spoolss_EnumPrinters_state *state;
     115           0 :         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           0 :         NTSTATUS status;
     163           0 :         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           0 :         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           0 :         struct spoolss_EnumPrinters r;
     227           0 :         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           0 :         struct tevent_req *req;
     272           0 :         struct dcerpc_spoolss_OpenPrinter_r_state *state;
     273           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
     360           0 :         struct dcerpc_spoolss_OpenPrinter_state *state;
     361           0 :         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           0 :         NTSTATUS status;
     406           0 :         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           0 :         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           0 :         struct spoolss_OpenPrinter r;
     465           0 :         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           0 :         struct tevent_req *req;
     505           0 :         struct dcerpc_spoolss_SetJob_r_state *state;
     506           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
     589           0 :         struct dcerpc_spoolss_SetJob_state *state;
     590           0 :         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           0 :         NTSTATUS status;
     628           0 :         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           0 :         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           0 :         struct spoolss_SetJob r;
     685           0 :         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           0 :         struct tevent_req *req;
     723           0 :         struct dcerpc_spoolss_GetJob_r_state *state;
     724           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
     813           0 :         struct dcerpc_spoolss_GetJob_state *state;
     814           0 :         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           0 :         NTSTATUS status;
     861           0 :         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           0 :         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           0 :         struct spoolss_GetJob r;
     925           0 :         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           0 :         struct tevent_req *req;
     970           0 :         struct dcerpc_spoolss_EnumJobs_r_state *state;
     971           0 :         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           0 :         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           0 :         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          98 : NTSTATUS dcerpc_spoolss_EnumJobs_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumJobs *r)
    1030             : {
    1031           0 :         NTSTATUS status;
    1032             : 
    1033          98 :         status = dcerpc_binding_handle_call(h,
    1034             :                         NULL, &ndr_table_spoolss,
    1035             :                         NDR_SPOOLSS_ENUMJOBS, mem_ctx, r);
    1036             : 
    1037          98 :         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           0 :         struct tevent_req *req;
    1062           0 :         struct dcerpc_spoolss_EnumJobs_state *state;
    1063           0 :         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           0 :         NTSTATUS status;
    1112           0 :         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           0 :         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          10 : 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           0 :         struct spoolss_EnumJobs r;
    1177           0 :         NTSTATUS status;
    1178             : 
    1179             :         /* In parameters */
    1180          10 :         r.in.handle = _handle;
    1181          10 :         r.in.firstjob = _firstjob;
    1182          10 :         r.in.numjobs = _numjobs;
    1183          10 :         r.in.level = _level;
    1184          10 :         r.in.buffer = _buffer;
    1185          10 :         r.in.offered = _offered;
    1186             : 
    1187             :         /* Out parameters */
    1188          10 :         r.out.count = _count;
    1189          10 :         r.out.info = _info;
    1190          10 :         r.out.needed = _needed;
    1191             : 
    1192             :         /* Result */
    1193          10 :         NDR_ZERO_STRUCT(r.out.result);
    1194             : 
    1195          10 :         status = dcerpc_spoolss_EnumJobs_r(h, mem_ctx, &r);
    1196          10 :         if (!NT_STATUS_IS_OK(status)) {
    1197           0 :                 return status;
    1198             :         }
    1199             : 
    1200             :         /* Return variables */
    1201          10 :         *_count = *r.out.count;
    1202          10 :         *_info = *r.out.info;
    1203          10 :         *_needed = *r.out.needed;
    1204             : 
    1205             :         /* Return result */
    1206          10 :         *result = r.out.result;
    1207             : 
    1208          10 :         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           0 :         struct tevent_req *req;
    1223           0 :         struct dcerpc_spoolss_AddPrinter_r_state *state;
    1224           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    1311           0 :         struct dcerpc_spoolss_AddPrinter_state *state;
    1312           0 :         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           0 :         NTSTATUS status;
    1357           0 :         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           0 :         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           0 :         struct spoolss_AddPrinter r;
    1416           0 :         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           0 :         struct tevent_req *req;
    1456           0 :         struct dcerpc_spoolss_DeletePrinter_r_state *state;
    1457           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    1537           0 :         struct dcerpc_spoolss_DeletePrinter_state *state;
    1538           0 :         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           0 :         NTSTATUS status;
    1573           0 :         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           0 :         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           0 :         struct spoolss_DeletePrinter r;
    1627           0 :         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           0 :         struct tevent_req *req;
    1662           0 :         struct dcerpc_spoolss_SetPrinter_r_state *state;
    1663           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    1747           0 :         struct dcerpc_spoolss_SetPrinter_state *state;
    1748           0 :         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           0 :         NTSTATUS status;
    1787           0 :         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           0 :         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           0 :         struct spoolss_SetPrinter r;
    1845           0 :         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           0 :         struct tevent_req *req;
    1884           0 :         struct dcerpc_spoolss_GetPrinter_r_state *state;
    1885           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    1973           0 :         struct dcerpc_spoolss_GetPrinter_state *state;
    1974           0 :         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           0 :         NTSTATUS status;
    2020           0 :         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           0 :         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           0 :         struct spoolss_GetPrinter r;
    2083           0 :         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           0 :         struct tevent_req *req;
    2127           0 :         struct dcerpc_spoolss_AddPrinterDriver_r_state *state;
    2128           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    2209           0 :         struct dcerpc_spoolss_AddPrinterDriver_state *state;
    2210           0 :         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           0 :         NTSTATUS status;
    2246           0 :         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           0 :         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           0 :         struct spoolss_AddPrinterDriver r;
    2301           0 :         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           0 :         struct tevent_req *req;
    2337           0 :         struct dcerpc_spoolss_EnumPrinterDrivers_r_state *state;
    2338           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    2428           0 :         struct dcerpc_spoolss_EnumPrinterDrivers_state *state;
    2429           0 :         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           0 :         NTSTATUS status;
    2477           0 :         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           0 :         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           0 :         struct spoolss_EnumPrinterDrivers r;
    2541           0 :         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           0 :         struct tevent_req *req;
    2586           0 :         struct dcerpc_spoolss_GetPrinterDriver_r_state *state;
    2587           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    2676           0 :         struct dcerpc_spoolss_GetPrinterDriver_state *state;
    2677           0 :         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           0 :         NTSTATUS status;
    2724           0 :         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           0 :         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           0 :         struct spoolss_GetPrinterDriver r;
    2788           0 :         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           0 :         struct tevent_req *req;
    2833           0 :         struct dcerpc_spoolss_GetPrinterDriverDirectory_r_state *state;
    2834           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    2923           0 :         struct dcerpc_spoolss_GetPrinterDriverDirectory_state *state;
    2924           0 :         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           0 :         NTSTATUS status;
    2971           0 :         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           0 :         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           0 :         struct spoolss_GetPrinterDriverDirectory r;
    3035           0 :         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           0 :         struct tevent_req *req;
    3080           0 :         struct dcerpc_spoolss_DeletePrinterDriver_r_state *state;
    3081           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    3163           0 :         struct dcerpc_spoolss_DeletePrinterDriver_state *state;
    3164           0 :         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           0 :         NTSTATUS status;
    3201           0 :         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           0 :         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           0 :         struct spoolss_DeletePrinterDriver r;
    3257           0 :         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           0 :         struct tevent_req *req;
    3294           0 :         struct dcerpc_spoolss_AddPrintProcessor_r_state *state;
    3295           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    3378           0 :         struct dcerpc_spoolss_AddPrintProcessor_state *state;
    3379           0 :         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           0 :         NTSTATUS status;
    3417           0 :         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           0 :         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           0 :         struct spoolss_AddPrintProcessor r;
    3474           0 :         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           0 :         struct tevent_req *req;
    3512           0 :         struct dcerpc_spoolss_EnumPrintProcessors_r_state *state;
    3513           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    3603           0 :         struct dcerpc_spoolss_EnumPrintProcessors_state *state;
    3604           0 :         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           0 :         NTSTATUS status;
    3652           0 :         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           0 :         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           0 :         struct spoolss_EnumPrintProcessors r;
    3716           0 :         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           0 :         struct tevent_req *req;
    3761           0 :         struct dcerpc_spoolss_GetPrintProcessorDirectory_r_state *state;
    3762           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    3851           0 :         struct dcerpc_spoolss_GetPrintProcessorDirectory_state *state;
    3852           0 :         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           0 :         NTSTATUS status;
    3899           0 :         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           0 :         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           0 :         struct spoolss_GetPrintProcessorDirectory r;
    3963           0 :         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           0 :         struct tevent_req *req;
    4008           0 :         struct dcerpc_spoolss_StartDocPrinter_r_state *state;
    4009           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    4094           0 :         struct dcerpc_spoolss_StartDocPrinter_state *state;
    4095           0 :         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           0 :         NTSTATUS status;
    4138           0 :         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           0 :         NTSTATUS status;
    4171             : 
    4172           0 :         if (tevent_req_is_nterror(req, &status)) {
    4173           0 :                 tevent_req_received(req);
    4174           0 :                 return status;
    4175             :         }
    4176             : 
    4177             :         /* Steal possible out parameters to the callers context */
    4178           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
    4179             : 
    4180             :         /* Return result */
    4181           0 :         *result = state->orig.out.result;
    4182             : 
    4183           0 :         tevent_req_received(req);
    4184           0 :         return NT_STATUS_OK;
    4185             : }
    4186             : 
    4187          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           0 :         struct spoolss_StartDocPrinter r;
    4195           0 :         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           0 :         struct tevent_req *req;
    4233           0 :         struct dcerpc_spoolss_StartPagePrinter_r_state *state;
    4234           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    4314           0 :         struct dcerpc_spoolss_StartPagePrinter_state *state;
    4315           0 :         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           0 :         NTSTATUS status;
    4350           0 :         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           0 :         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           0 :         struct spoolss_StartPagePrinter r;
    4404           0 :         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           0 :         struct tevent_req *req;
    4439           0 :         struct dcerpc_spoolss_WritePrinter_r_state *state;
    4440           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    4526           0 :         struct dcerpc_spoolss_WritePrinter_state *state;
    4527           0 :         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           0 :         NTSTATUS status;
    4571           0 :         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           0 :         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           0 :         struct spoolss_WritePrinter r;
    4629           0 :         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           0 :         struct tevent_req *req;
    4668           0 :         struct dcerpc_spoolss_EndPagePrinter_r_state *state;
    4669           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    4749           0 :         struct dcerpc_spoolss_EndPagePrinter_state *state;
    4750           0 :         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           0 :         NTSTATUS status;
    4785           0 :         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           0 :         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           0 :         struct spoolss_EndPagePrinter r;
    4839           0 :         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           0 :         struct tevent_req *req;
    4874           0 :         struct dcerpc_spoolss_AbortPrinter_r_state *state;
    4875           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    4955           0 :         struct dcerpc_spoolss_AbortPrinter_state *state;
    4956           0 :         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           0 :         NTSTATUS status;
    4991           0 :         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           0 :         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           0 :         struct spoolss_AbortPrinter r;
    5045           0 :         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           0 :         struct tevent_req *req;
    5080           0 :         struct dcerpc_spoolss_ReadPrinter_r_state *state;
    5081           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    5167           0 :         struct dcerpc_spoolss_ReadPrinter_state *state;
    5168           0 :         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           0 :         NTSTATUS status;
    5212           0 :         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           0 :                 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           0 :         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           0 :         struct spoolss_ReadPrinter r;
    5277           0 :         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           0 :                 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           0 :         struct tevent_req *req;
    5323           0 :         struct dcerpc_spoolss_EndDocPrinter_r_state *state;
    5324           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    5404           0 :         struct dcerpc_spoolss_EndDocPrinter_state *state;
    5405           0 :         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           0 :         NTSTATUS status;
    5440           0 :         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           0 :         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           0 :         struct spoolss_EndDocPrinter r;
    5494           0 :         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           0 :         struct tevent_req *req;
    5529           0 :         struct dcerpc_spoolss_AddJob_r_state *state;
    5530           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    5617           0 :         struct dcerpc_spoolss_AddJob_state *state;
    5618           0 :         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           0 :         NTSTATUS status;
    5664           0 :         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           0 :                         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           0 :         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           0 :         struct spoolss_AddJob r;
    5732           0 :         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           0 :                         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           0 :         struct tevent_req *req;
    5782           0 :         struct dcerpc_spoolss_ScheduleJob_r_state *state;
    5783           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    5864           0 :         struct dcerpc_spoolss_ScheduleJob_state *state;
    5865           0 :         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           0 :         NTSTATUS status;
    5901           0 :         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           0 :         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           0 :         struct spoolss_ScheduleJob r;
    5956           0 :         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           0 :         struct tevent_req *req;
    5992           0 :         struct dcerpc_spoolss_GetPrinterData_r_state *state;
    5993           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    6081           0 :         struct dcerpc_spoolss_GetPrinterData_state *state;
    6082           0 :         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           0 :         NTSTATUS status;
    6128           0 :         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           0 :                 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           0 :         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           0 :         struct spoolss_GetPrinterData r;
    6196           0 :         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           0 :                 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           0 :         struct tevent_req *req;
    6245           0 :         struct dcerpc_spoolss_SetPrinterData_r_state *state;
    6246           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    6330           0 :         struct dcerpc_spoolss_SetPrinterData_state *state;
    6331           0 :         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           0 :         NTSTATUS status;
    6370           0 :         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           0 :         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           0 :         struct spoolss_SetPrinterData r;
    6428           0 :         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           0 :         struct tevent_req *req;
    6467           0 :         struct dcerpc_spoolss_ClosePrinter_r_state *state;
    6468           0 :         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           0 :         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           0 :         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         620 : NTSTATUS dcerpc_spoolss_ClosePrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_ClosePrinter *r)
    6527             : {
    6528           0 :         NTSTATUS status;
    6529             : 
    6530         620 :         status = dcerpc_binding_handle_call(h,
    6531             :                         NULL, &ndr_table_spoolss,
    6532             :                         NDR_SPOOLSS_CLOSEPRINTER, mem_ctx, r);
    6533             : 
    6534         620 :         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           0 :         struct tevent_req *req;
    6551           0 :         struct dcerpc_spoolss_ClosePrinter_state *state;
    6552           0 :         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           0 :         NTSTATUS status;
    6594           0 :         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           0 :         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          34 : 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           0 :         struct spoolss_ClosePrinter r;
    6649           0 :         NTSTATUS status;
    6650             : 
    6651             :         /* In parameters */
    6652          34 :         r.in.handle = _handle;
    6653             : 
    6654             :         /* Out parameters */
    6655          34 :         r.out.handle = _handle;
    6656             : 
    6657             :         /* Result */
    6658          34 :         NDR_ZERO_STRUCT(r.out.result);
    6659             : 
    6660          34 :         status = dcerpc_spoolss_ClosePrinter_r(h, mem_ctx, &r);
    6661          34 :         if (!NT_STATUS_IS_OK(status)) {
    6662           0 :                 return status;
    6663             :         }
    6664             : 
    6665             :         /* Return variables */
    6666          34 :         *_handle = *r.out.handle;
    6667             : 
    6668             :         /* Return result */
    6669          34 :         *result = r.out.result;
    6670             : 
    6671          34 :         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           0 :         struct tevent_req *req;
    6686           0 :         struct dcerpc_spoolss_AddForm_r_state *state;
    6687           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    6768           0 :         struct dcerpc_spoolss_AddForm_state *state;
    6769           0 :         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           0 :         NTSTATUS status;
    6805           0 :         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           0 :         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           0 :         struct spoolss_AddForm r;
    6860           0 :         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           0 :         struct tevent_req *req;
    6896           0 :         struct dcerpc_spoolss_DeleteForm_r_state *state;
    6897           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    6978           0 :         struct dcerpc_spoolss_DeleteForm_state *state;
    6979           0 :         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           0 :         NTSTATUS status;
    7015           0 :         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           0 :         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           0 :         struct spoolss_DeleteForm r;
    7070           0 :         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           0 :         struct tevent_req *req;
    7106           0 :         struct dcerpc_spoolss_GetForm_r_state *state;
    7107           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    7196           0 :         struct dcerpc_spoolss_GetForm_state *state;
    7197           0 :         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           0 :         NTSTATUS status;
    7244           0 :         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           0 :         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           0 :         struct spoolss_GetForm r;
    7308           0 :         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           0 :         struct tevent_req *req;
    7353           0 :         struct dcerpc_spoolss_SetForm_r_state *state;
    7354           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    7436           0 :         struct dcerpc_spoolss_SetForm_state *state;
    7437           0 :         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           0 :         NTSTATUS status;
    7474           0 :         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           0 :         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           0 :         struct spoolss_SetForm r;
    7530           0 :         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           0 :         struct tevent_req *req;
    7567           0 :         struct dcerpc_spoolss_EnumForms_r_state *state;
    7568           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    7657           0 :         struct dcerpc_spoolss_EnumForms_state *state;
    7658           0 :         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           0 :         NTSTATUS status;
    7705           0 :         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           0 :         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           0 :         struct spoolss_EnumForms r;
    7768           0 :         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           0 :         struct tevent_req *req;
    7812           0 :         struct dcerpc_spoolss_EnumPorts_r_state *state;
    7813           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    7902           0 :         struct dcerpc_spoolss_EnumPorts_state *state;
    7903           0 :         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           0 :         NTSTATUS status;
    7950           0 :         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           0 :         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           0 :         struct spoolss_EnumPorts r;
    8013           0 :         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           0 :         struct tevent_req *req;
    8057           0 :         struct dcerpc_spoolss_EnumMonitors_r_state *state;
    8058           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    8147           0 :         struct dcerpc_spoolss_EnumMonitors_state *state;
    8148           0 :         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           0 :         NTSTATUS status;
    8195           0 :         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           0 :         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           0 :         struct spoolss_EnumMonitors r;
    8258           0 :         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           0 :         struct tevent_req *req;
    8302           0 :         struct dcerpc_spoolss_AddPort_r_state *state;
    8303           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    8385           0 :         struct dcerpc_spoolss_AddPort_state *state;
    8386           0 :         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           0 :         NTSTATUS status;
    8423           0 :         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           0 :         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           0 :         struct spoolss_AddPort r;
    8479           0 :         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           0 :         struct tevent_req *req;
    8516           0 :         struct dcerpc_spoolss_DeletePort_r_state *state;
    8517           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    8599           0 :         struct dcerpc_spoolss_DeletePort_state *state;
    8600           0 :         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           0 :         NTSTATUS status;
    8637           0 :         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           0 :         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           0 :         struct spoolss_DeletePort r;
    8693           0 :         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           0 :         struct tevent_req *req;
    8730           0 :         struct dcerpc_spoolss_CreatePrinterIC_r_state *state;
    8731           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    8816           0 :         struct dcerpc_spoolss_CreatePrinterIC_state *state;
    8817           0 :         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           0 :         NTSTATUS status;
    8860           0 :         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           0 :         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           0 :         struct spoolss_CreatePrinterIC r;
    8917           0 :         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           0 :         struct tevent_req *req;
    8955           0 :         struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_state *state;
    8956           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    9044           0 :         struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_state *state;
    9045           0 :         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           0 :         NTSTATUS status;
    9091           0 :         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           0 :                 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           0 :         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           0 :         struct spoolss_PlayGDIScriptOnPrinterIC r;
    9157           0 :         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           0 :                 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           0 :         struct tevent_req *req;
    9204           0 :         struct dcerpc_spoolss_DeletePrinterIC_r_state *state;
    9205           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    9288           0 :         struct dcerpc_spoolss_DeletePrinterIC_state *state;
    9289           0 :         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           0 :         NTSTATUS status;
    9331           0 :         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           0 :         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           0 :         struct spoolss_DeletePrinterIC r;
    9386           0 :         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           0 :         struct tevent_req *req;
    9423           0 :         struct dcerpc_spoolss_DeletePrintProcessor_r_state *state;
    9424           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    9506           0 :         struct dcerpc_spoolss_DeletePrintProcessor_state *state;
    9507           0 :         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           0 :         NTSTATUS status;
    9544           0 :         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           0 :         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           0 :         struct spoolss_DeletePrintProcessor r;
    9600           0 :         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           0 :         struct tevent_req *req;
    9637           0 :         struct dcerpc_spoolss_EnumPrintProcessorDataTypes_r_state *state;
    9638           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    9728           0 :         struct dcerpc_spoolss_EnumPrintProcessorDataTypes_state *state;
    9729           0 :         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           0 :         NTSTATUS status;
    9777           0 :         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           0 :         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           0 :         struct spoolss_EnumPrintProcessorDataTypes r;
    9841           0 :         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           0 :         struct tevent_req *req;
    9886           0 :         struct dcerpc_spoolss_ResetPrinter_r_state *state;
    9887           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
    9969           0 :         struct dcerpc_spoolss_ResetPrinter_state *state;
    9970           0 :         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           0 :         NTSTATUS status;
   10007           0 :         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           0 :         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           0 :         struct spoolss_ResetPrinter r;
   10063           0 :         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           0 :         struct tevent_req *req;
   10100           0 :         struct dcerpc_spoolss_GetPrinterDriver2_r_state *state;
   10101           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
   10194           0 :         struct dcerpc_spoolss_GetPrinterDriver2_state *state;
   10195           0 :         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           0 :         NTSTATUS status;
   10246           0 :         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           0 :         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           0 :         struct spoolss_GetPrinterDriver2 r;
   10316           0 :         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           0 :         struct tevent_req *req;
   10367           0 :         struct dcerpc_spoolss_FindClosePrinterNotify_r_state *state;
   10368           0 :         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           0 :         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           0 :         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           0 :         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           0 :         struct tevent_req *req;
   10448           0 :         struct dcerpc_spoolss_FindClosePrinterNotify_state *state;
   10449           0 :         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           0 :         NTSTATUS status;
   10484           0 :         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           0 :         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           0 :         struct spoolss_FindClosePrinterNotify r;
   10538           0 :         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           0 :         struct tevent_req *req;
   10573           0 :         struct dcerpc_spoolss_ReplyOpenPrinter_r_state *state;
   10574           0 :         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           0 :         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           0 :         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           0 :         return NT_STATUS_OK;
   10630             : }
   10631             : 
   10632           2 : NTSTATUS dcerpc_spoolss_ReplyOpenPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_ReplyOpenPrinter *r)
   10633             : {
   10634           0 :         NTSTATUS status;
   10635             : 
   10636           2 :         status = dcerpc_binding_handle_call(h,
   10637             :                         NULL, &ndr_table_spoolss,
   10638             :                         NDR_SPOOLSS_REPLYOPENPRINTER, mem_ctx, r);
   10639             : 
   10640           2 :         return status;
   10641             : }
   10642             : 
   10643             : struct dcerpc_spoolss_ReplyOpenPrinter_state {
   10644             :         struct spoolss_ReplyOpenPrinter orig;
   10645             :         struct spoolss_ReplyOpenPrinter tmp;
   10646             :         TALLOC_CTX *out_mem_ctx;
   10647             : };
   10648             : 
   10649             : static void dcerpc_spoolss_ReplyOpenPrinter_done(struct tevent_req *subreq);
   10650             : 
   10651           0 : struct tevent_req *dcerpc_spoolss_ReplyOpenPrinter_send(TALLOC_CTX *mem_ctx,
   10652             :                                                         struct tevent_context *ev,
   10653             :                                                         struct dcerpc_binding_handle *h,
   10654             :                                                         const char *_server_name /* [in] [charset(UTF16)] */,
   10655             :                                                         uint32_t _printer_local /* [in]  */,
   10656             :                                                         enum winreg_Type _type /* [in]  */,
   10657             :                                                         uint32_t _bufsize /* [in] [range(0,512)] */,
   10658             :                                                         uint8_t *_buffer /* [in] [size_is(bufsize),unique] */,
   10659             :                                                         struct policy_handle *_handle /* [out] [ref] */)
   10660             : {
   10661           0 :         struct tevent_req *req;
   10662           0 :         struct dcerpc_spoolss_ReplyOpenPrinter_state *state;
   10663           0 :         struct tevent_req *subreq;
   10664             : 
   10665           0 :         req = tevent_req_create(mem_ctx, &state,
   10666             :                                 struct dcerpc_spoolss_ReplyOpenPrinter_state);
   10667           0 :         if (req == NULL) {
   10668           0 :                 return NULL;
   10669             :         }
   10670           0 :         state->out_mem_ctx = NULL;
   10671             : 
   10672             :         /* In parameters */
   10673           0 :         state->orig.in.server_name = _server_name;
   10674           0 :         state->orig.in.printer_local = _printer_local;
   10675           0 :         state->orig.in.type = _type;
   10676           0 :         state->orig.in.bufsize = _bufsize;
   10677           0 :         state->orig.in.buffer = _buffer;
   10678             : 
   10679             :         /* Out parameters */
   10680           0 :         state->orig.out.handle = _handle;
   10681             : 
   10682             :         /* Result */
   10683           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   10684             : 
   10685           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   10686             :                              "dcerpc_spoolss_ReplyOpenPrinter_out_memory");
   10687           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   10688           0 :                 return tevent_req_post(req, ev);
   10689             :         }
   10690             : 
   10691             :         /* make a temporary copy, that we pass to the dispatch function */
   10692           0 :         state->tmp = state->orig;
   10693             : 
   10694           0 :         subreq = dcerpc_spoolss_ReplyOpenPrinter_r_send(state, ev, h, &state->tmp);
   10695           0 :         if (tevent_req_nomem(subreq, req)) {
   10696           0 :                 return tevent_req_post(req, ev);
   10697             :         }
   10698           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_ReplyOpenPrinter_done, req);
   10699           0 :         return req;
   10700             : }
   10701             : 
   10702           0 : static void dcerpc_spoolss_ReplyOpenPrinter_done(struct tevent_req *subreq)
   10703             : {
   10704           0 :         struct tevent_req *req = tevent_req_callback_data(
   10705             :                 subreq, struct tevent_req);
   10706           0 :         struct dcerpc_spoolss_ReplyOpenPrinter_state *state = tevent_req_data(
   10707             :                 req, struct dcerpc_spoolss_ReplyOpenPrinter_state);
   10708           0 :         NTSTATUS status;
   10709           0 :         TALLOC_CTX *mem_ctx;
   10710             : 
   10711           0 :         if (state->out_mem_ctx) {
   10712           0 :                 mem_ctx = state->out_mem_ctx;
   10713             :         } else {
   10714           0 :                 mem_ctx = state;
   10715             :         }
   10716             : 
   10717           0 :         status = dcerpc_spoolss_ReplyOpenPrinter_r_recv(subreq, mem_ctx);
   10718           0 :         TALLOC_FREE(subreq);
   10719           0 :         if (tevent_req_nterror(req, status)) {
   10720           0 :                 return;
   10721             :         }
   10722             : 
   10723             :         /* Copy out parameters */
   10724           0 :         *state->orig.out.handle = *state->tmp.out.handle;
   10725             : 
   10726             :         /* Copy result */
   10727           0 :         state->orig.out.result = state->tmp.out.result;
   10728             : 
   10729             :         /* Reset temporary structure */
   10730           0 :         NDR_ZERO_STRUCT(state->tmp);
   10731             : 
   10732           0 :         tevent_req_done(req);
   10733             : }
   10734             : 
   10735           0 : NTSTATUS dcerpc_spoolss_ReplyOpenPrinter_recv(struct tevent_req *req,
   10736             :                                               TALLOC_CTX *mem_ctx,
   10737             :                                               WERROR *result)
   10738             : {
   10739           0 :         struct dcerpc_spoolss_ReplyOpenPrinter_state *state = tevent_req_data(
   10740             :                 req, struct dcerpc_spoolss_ReplyOpenPrinter_state);
   10741           0 :         NTSTATUS status;
   10742             : 
   10743           0 :         if (tevent_req_is_nterror(req, &status)) {
   10744           0 :                 tevent_req_received(req);
   10745           0 :                 return status;
   10746             :         }
   10747             : 
   10748             :         /* Steal possible out parameters to the callers context */
   10749           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10750             : 
   10751             :         /* Return result */
   10752           0 :         *result = state->orig.out.result;
   10753             : 
   10754           0 :         tevent_req_received(req);
   10755           0 :         return NT_STATUS_OK;
   10756             : }
   10757             : 
   10758           2 : NTSTATUS dcerpc_spoolss_ReplyOpenPrinter(struct dcerpc_binding_handle *h,
   10759             :                                          TALLOC_CTX *mem_ctx,
   10760             :                                          const char *_server_name /* [in] [charset(UTF16)] */,
   10761             :                                          uint32_t _printer_local /* [in]  */,
   10762             :                                          enum winreg_Type _type /* [in]  */,
   10763             :                                          uint32_t _bufsize /* [in] [range(0,512)] */,
   10764             :                                          uint8_t *_buffer /* [in] [size_is(bufsize),unique] */,
   10765             :                                          struct policy_handle *_handle /* [out] [ref] */,
   10766             :                                          WERROR *result)
   10767             : {
   10768           0 :         struct spoolss_ReplyOpenPrinter r;
   10769           0 :         NTSTATUS status;
   10770             : 
   10771             :         /* In parameters */
   10772           2 :         r.in.server_name = _server_name;
   10773           2 :         r.in.printer_local = _printer_local;
   10774           2 :         r.in.type = _type;
   10775           2 :         r.in.bufsize = _bufsize;
   10776           2 :         r.in.buffer = _buffer;
   10777             : 
   10778             :         /* Out parameters */
   10779           2 :         r.out.handle = _handle;
   10780             : 
   10781             :         /* Result */
   10782           2 :         NDR_ZERO_STRUCT(r.out.result);
   10783             : 
   10784           2 :         status = dcerpc_spoolss_ReplyOpenPrinter_r(h, mem_ctx, &r);
   10785           2 :         if (!NT_STATUS_IS_OK(status)) {
   10786           0 :                 return status;
   10787             :         }
   10788             : 
   10789             :         /* Return variables */
   10790           2 :         *_handle = *r.out.handle;
   10791             : 
   10792             :         /* Return result */
   10793           2 :         *result = r.out.result;
   10794             : 
   10795           2 :         return NT_STATUS_OK;
   10796             : }
   10797             : 
   10798             : struct dcerpc_spoolss_RouterReplyPrinter_r_state {
   10799             :         TALLOC_CTX *out_mem_ctx;
   10800             : };
   10801             : 
   10802             : static void dcerpc_spoolss_RouterReplyPrinter_r_done(struct tevent_req *subreq);
   10803             : 
   10804           0 : struct tevent_req *dcerpc_spoolss_RouterReplyPrinter_r_send(TALLOC_CTX *mem_ctx,
   10805             :         struct tevent_context *ev,
   10806             :         struct dcerpc_binding_handle *h,
   10807             :         struct spoolss_RouterReplyPrinter *r)
   10808             : {
   10809           0 :         struct tevent_req *req;
   10810           0 :         struct dcerpc_spoolss_RouterReplyPrinter_r_state *state;
   10811           0 :         struct tevent_req *subreq;
   10812             : 
   10813           0 :         req = tevent_req_create(mem_ctx, &state,
   10814             :                                 struct dcerpc_spoolss_RouterReplyPrinter_r_state);
   10815           0 :         if (req == NULL) {
   10816           0 :                 return NULL;
   10817             :         }
   10818             : 
   10819           0 :         state->out_mem_ctx = NULL;
   10820             : 
   10821           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   10822             :                         NULL, &ndr_table_spoolss,
   10823             :                         NDR_SPOOLSS_ROUTERREPLYPRINTER, state, r);
   10824           0 :         if (tevent_req_nomem(subreq, req)) {
   10825           0 :                 return tevent_req_post(req, ev);
   10826             :         }
   10827           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_RouterReplyPrinter_r_done, req);
   10828             : 
   10829           0 :         return req;
   10830             : }
   10831             : 
   10832           0 : static void dcerpc_spoolss_RouterReplyPrinter_r_done(struct tevent_req *subreq)
   10833             : {
   10834           0 :         struct tevent_req *req =
   10835           0 :                 tevent_req_callback_data(subreq,
   10836             :                 struct tevent_req);
   10837           0 :         NTSTATUS status;
   10838             : 
   10839           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   10840           0 :         TALLOC_FREE(subreq);
   10841           0 :         if (tevent_req_nterror(req, status)) {
   10842           0 :                 return;
   10843             :         }
   10844             : 
   10845           0 :         tevent_req_done(req);
   10846             : }
   10847             : 
   10848           0 : NTSTATUS dcerpc_spoolss_RouterReplyPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   10849             : {
   10850           0 :         struct dcerpc_spoolss_RouterReplyPrinter_r_state *state =
   10851           0 :                 tevent_req_data(req,
   10852             :                 struct dcerpc_spoolss_RouterReplyPrinter_r_state);
   10853           0 :         NTSTATUS status;
   10854             : 
   10855           0 :         if (tevent_req_is_nterror(req, &status)) {
   10856           0 :                 tevent_req_received(req);
   10857           0 :                 return status;
   10858             :         }
   10859             : 
   10860           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10861             : 
   10862           0 :         tevent_req_received(req);
   10863           0 :         return NT_STATUS_OK;
   10864             : }
   10865             : 
   10866           0 : NTSTATUS dcerpc_spoolss_RouterReplyPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RouterReplyPrinter *r)
   10867             : {
   10868           0 :         NTSTATUS status;
   10869             : 
   10870           0 :         status = dcerpc_binding_handle_call(h,
   10871             :                         NULL, &ndr_table_spoolss,
   10872             :                         NDR_SPOOLSS_ROUTERREPLYPRINTER, mem_ctx, r);
   10873             : 
   10874           0 :         return status;
   10875             : }
   10876             : 
   10877             : struct dcerpc_spoolss_RouterReplyPrinter_state {
   10878             :         struct spoolss_RouterReplyPrinter orig;
   10879             :         struct spoolss_RouterReplyPrinter tmp;
   10880             :         TALLOC_CTX *out_mem_ctx;
   10881             : };
   10882             : 
   10883             : static void dcerpc_spoolss_RouterReplyPrinter_done(struct tevent_req *subreq);
   10884             : 
   10885           0 : struct tevent_req *dcerpc_spoolss_RouterReplyPrinter_send(TALLOC_CTX *mem_ctx,
   10886             :                                                           struct tevent_context *ev,
   10887             :                                                           struct dcerpc_binding_handle *h,
   10888             :                                                           struct policy_handle *_handle /* [in] [ref] */,
   10889             :                                                           uint32_t _flags /* [in]  */,
   10890             :                                                           uint32_t _bufsize /* [in] [range(0,512)] */,
   10891             :                                                           uint8_t *_buffer /* [in] [size_is(bufsize),unique] */)
   10892             : {
   10893           0 :         struct tevent_req *req;
   10894           0 :         struct dcerpc_spoolss_RouterReplyPrinter_state *state;
   10895           0 :         struct tevent_req *subreq;
   10896             : 
   10897           0 :         req = tevent_req_create(mem_ctx, &state,
   10898             :                                 struct dcerpc_spoolss_RouterReplyPrinter_state);
   10899           0 :         if (req == NULL) {
   10900           0 :                 return NULL;
   10901             :         }
   10902           0 :         state->out_mem_ctx = NULL;
   10903             : 
   10904             :         /* In parameters */
   10905           0 :         state->orig.in.handle = _handle;
   10906           0 :         state->orig.in.flags = _flags;
   10907           0 :         state->orig.in.bufsize = _bufsize;
   10908           0 :         state->orig.in.buffer = _buffer;
   10909             : 
   10910             :         /* Out parameters */
   10911             : 
   10912             :         /* Result */
   10913           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   10914             : 
   10915             :         /* make a temporary copy, that we pass to the dispatch function */
   10916           0 :         state->tmp = state->orig;
   10917             : 
   10918           0 :         subreq = dcerpc_spoolss_RouterReplyPrinter_r_send(state, ev, h, &state->tmp);
   10919           0 :         if (tevent_req_nomem(subreq, req)) {
   10920           0 :                 return tevent_req_post(req, ev);
   10921             :         }
   10922           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_RouterReplyPrinter_done, req);
   10923           0 :         return req;
   10924             : }
   10925             : 
   10926           0 : static void dcerpc_spoolss_RouterReplyPrinter_done(struct tevent_req *subreq)
   10927             : {
   10928           0 :         struct tevent_req *req = tevent_req_callback_data(
   10929             :                 subreq, struct tevent_req);
   10930           0 :         struct dcerpc_spoolss_RouterReplyPrinter_state *state = tevent_req_data(
   10931             :                 req, struct dcerpc_spoolss_RouterReplyPrinter_state);
   10932           0 :         NTSTATUS status;
   10933           0 :         TALLOC_CTX *mem_ctx;
   10934             : 
   10935           0 :         if (state->out_mem_ctx) {
   10936           0 :                 mem_ctx = state->out_mem_ctx;
   10937             :         } else {
   10938           0 :                 mem_ctx = state;
   10939             :         }
   10940             : 
   10941           0 :         status = dcerpc_spoolss_RouterReplyPrinter_r_recv(subreq, mem_ctx);
   10942           0 :         TALLOC_FREE(subreq);
   10943           0 :         if (tevent_req_nterror(req, status)) {
   10944           0 :                 return;
   10945             :         }
   10946             : 
   10947             :         /* Copy out parameters */
   10948             : 
   10949             :         /* Copy result */
   10950           0 :         state->orig.out.result = state->tmp.out.result;
   10951             : 
   10952             :         /* Reset temporary structure */
   10953           0 :         NDR_ZERO_STRUCT(state->tmp);
   10954             : 
   10955           0 :         tevent_req_done(req);
   10956             : }
   10957             : 
   10958           0 : NTSTATUS dcerpc_spoolss_RouterReplyPrinter_recv(struct tevent_req *req,
   10959             :                                                 TALLOC_CTX *mem_ctx,
   10960             :                                                 WERROR *result)
   10961             : {
   10962           0 :         struct dcerpc_spoolss_RouterReplyPrinter_state *state = tevent_req_data(
   10963             :                 req, struct dcerpc_spoolss_RouterReplyPrinter_state);
   10964           0 :         NTSTATUS status;
   10965             : 
   10966           0 :         if (tevent_req_is_nterror(req, &status)) {
   10967           0 :                 tevent_req_received(req);
   10968           0 :                 return status;
   10969             :         }
   10970             : 
   10971             :         /* Steal possible out parameters to the callers context */
   10972           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   10973             : 
   10974             :         /* Return result */
   10975           0 :         *result = state->orig.out.result;
   10976             : 
   10977           0 :         tevent_req_received(req);
   10978           0 :         return NT_STATUS_OK;
   10979             : }
   10980             : 
   10981           0 : NTSTATUS dcerpc_spoolss_RouterReplyPrinter(struct dcerpc_binding_handle *h,
   10982             :                                            TALLOC_CTX *mem_ctx,
   10983             :                                            struct policy_handle *_handle /* [in] [ref] */,
   10984             :                                            uint32_t _flags /* [in]  */,
   10985             :                                            uint32_t _bufsize /* [in] [range(0,512)] */,
   10986             :                                            uint8_t *_buffer /* [in] [size_is(bufsize),unique] */,
   10987             :                                            WERROR *result)
   10988             : {
   10989           0 :         struct spoolss_RouterReplyPrinter r;
   10990           0 :         NTSTATUS status;
   10991             : 
   10992             :         /* In parameters */
   10993           0 :         r.in.handle = _handle;
   10994           0 :         r.in.flags = _flags;
   10995           0 :         r.in.bufsize = _bufsize;
   10996           0 :         r.in.buffer = _buffer;
   10997             : 
   10998             :         /* Out parameters */
   10999             : 
   11000             :         /* Result */
   11001           0 :         NDR_ZERO_STRUCT(r.out.result);
   11002             : 
   11003           0 :         status = dcerpc_spoolss_RouterReplyPrinter_r(h, mem_ctx, &r);
   11004           0 :         if (!NT_STATUS_IS_OK(status)) {
   11005           0 :                 return status;
   11006             :         }
   11007             : 
   11008             :         /* Return variables */
   11009             : 
   11010             :         /* Return result */
   11011           0 :         *result = r.out.result;
   11012             : 
   11013           0 :         return NT_STATUS_OK;
   11014             : }
   11015             : 
   11016             : struct dcerpc_spoolss_ReplyClosePrinter_r_state {
   11017             :         TALLOC_CTX *out_mem_ctx;
   11018             : };
   11019             : 
   11020             : static void dcerpc_spoolss_ReplyClosePrinter_r_done(struct tevent_req *subreq);
   11021             : 
   11022           0 : struct tevent_req *dcerpc_spoolss_ReplyClosePrinter_r_send(TALLOC_CTX *mem_ctx,
   11023             :         struct tevent_context *ev,
   11024             :         struct dcerpc_binding_handle *h,
   11025             :         struct spoolss_ReplyClosePrinter *r)
   11026             : {
   11027           0 :         struct tevent_req *req;
   11028           0 :         struct dcerpc_spoolss_ReplyClosePrinter_r_state *state;
   11029           0 :         struct tevent_req *subreq;
   11030             : 
   11031           0 :         req = tevent_req_create(mem_ctx, &state,
   11032             :                                 struct dcerpc_spoolss_ReplyClosePrinter_r_state);
   11033           0 :         if (req == NULL) {
   11034           0 :                 return NULL;
   11035             :         }
   11036             : 
   11037           0 :         state->out_mem_ctx = talloc_new(state);
   11038           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   11039           0 :                 return tevent_req_post(req, ev);
   11040             :         }
   11041             : 
   11042           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   11043             :                         NULL, &ndr_table_spoolss,
   11044           0 :                         NDR_SPOOLSS_REPLYCLOSEPRINTER, state->out_mem_ctx, r);
   11045           0 :         if (tevent_req_nomem(subreq, req)) {
   11046           0 :                 return tevent_req_post(req, ev);
   11047             :         }
   11048           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_ReplyClosePrinter_r_done, req);
   11049             : 
   11050           0 :         return req;
   11051             : }
   11052             : 
   11053           0 : static void dcerpc_spoolss_ReplyClosePrinter_r_done(struct tevent_req *subreq)
   11054             : {
   11055           0 :         struct tevent_req *req =
   11056           0 :                 tevent_req_callback_data(subreq,
   11057             :                 struct tevent_req);
   11058           0 :         NTSTATUS status;
   11059             : 
   11060           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   11061           0 :         TALLOC_FREE(subreq);
   11062           0 :         if (tevent_req_nterror(req, status)) {
   11063           0 :                 return;
   11064             :         }
   11065             : 
   11066           0 :         tevent_req_done(req);
   11067             : }
   11068             : 
   11069           0 : NTSTATUS dcerpc_spoolss_ReplyClosePrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   11070             : {
   11071           0 :         struct dcerpc_spoolss_ReplyClosePrinter_r_state *state =
   11072           0 :                 tevent_req_data(req,
   11073             :                 struct dcerpc_spoolss_ReplyClosePrinter_r_state);
   11074           0 :         NTSTATUS status;
   11075             : 
   11076           0 :         if (tevent_req_is_nterror(req, &status)) {
   11077           0 :                 tevent_req_received(req);
   11078           0 :                 return status;
   11079             :         }
   11080             : 
   11081           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11082             : 
   11083           0 :         tevent_req_received(req);
   11084           0 :         return NT_STATUS_OK;
   11085             : }
   11086             : 
   11087           2 : NTSTATUS dcerpc_spoolss_ReplyClosePrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_ReplyClosePrinter *r)
   11088             : {
   11089           0 :         NTSTATUS status;
   11090             : 
   11091           2 :         status = dcerpc_binding_handle_call(h,
   11092             :                         NULL, &ndr_table_spoolss,
   11093             :                         NDR_SPOOLSS_REPLYCLOSEPRINTER, mem_ctx, r);
   11094             : 
   11095           2 :         return status;
   11096             : }
   11097             : 
   11098             : struct dcerpc_spoolss_ReplyClosePrinter_state {
   11099             :         struct spoolss_ReplyClosePrinter orig;
   11100             :         struct spoolss_ReplyClosePrinter tmp;
   11101             :         TALLOC_CTX *out_mem_ctx;
   11102             : };
   11103             : 
   11104             : static void dcerpc_spoolss_ReplyClosePrinter_done(struct tevent_req *subreq);
   11105             : 
   11106           0 : struct tevent_req *dcerpc_spoolss_ReplyClosePrinter_send(TALLOC_CTX *mem_ctx,
   11107             :                                                          struct tevent_context *ev,
   11108             :                                                          struct dcerpc_binding_handle *h,
   11109             :                                                          struct policy_handle *_handle /* [in,out] [ref] */)
   11110             : {
   11111           0 :         struct tevent_req *req;
   11112           0 :         struct dcerpc_spoolss_ReplyClosePrinter_state *state;
   11113           0 :         struct tevent_req *subreq;
   11114             : 
   11115           0 :         req = tevent_req_create(mem_ctx, &state,
   11116             :                                 struct dcerpc_spoolss_ReplyClosePrinter_state);
   11117           0 :         if (req == NULL) {
   11118           0 :                 return NULL;
   11119             :         }
   11120           0 :         state->out_mem_ctx = NULL;
   11121             : 
   11122             :         /* In parameters */
   11123           0 :         state->orig.in.handle = _handle;
   11124             : 
   11125             :         /* Out parameters */
   11126           0 :         state->orig.out.handle = _handle;
   11127             : 
   11128             :         /* Result */
   11129           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   11130             : 
   11131           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   11132             :                              "dcerpc_spoolss_ReplyClosePrinter_out_memory");
   11133           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   11134           0 :                 return tevent_req_post(req, ev);
   11135             :         }
   11136             : 
   11137             :         /* make a temporary copy, that we pass to the dispatch function */
   11138           0 :         state->tmp = state->orig;
   11139             : 
   11140           0 :         subreq = dcerpc_spoolss_ReplyClosePrinter_r_send(state, ev, h, &state->tmp);
   11141           0 :         if (tevent_req_nomem(subreq, req)) {
   11142           0 :                 return tevent_req_post(req, ev);
   11143             :         }
   11144           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_ReplyClosePrinter_done, req);
   11145           0 :         return req;
   11146             : }
   11147             : 
   11148           0 : static void dcerpc_spoolss_ReplyClosePrinter_done(struct tevent_req *subreq)
   11149             : {
   11150           0 :         struct tevent_req *req = tevent_req_callback_data(
   11151             :                 subreq, struct tevent_req);
   11152           0 :         struct dcerpc_spoolss_ReplyClosePrinter_state *state = tevent_req_data(
   11153             :                 req, struct dcerpc_spoolss_ReplyClosePrinter_state);
   11154           0 :         NTSTATUS status;
   11155           0 :         TALLOC_CTX *mem_ctx;
   11156             : 
   11157           0 :         if (state->out_mem_ctx) {
   11158           0 :                 mem_ctx = state->out_mem_ctx;
   11159             :         } else {
   11160           0 :                 mem_ctx = state;
   11161             :         }
   11162             : 
   11163           0 :         status = dcerpc_spoolss_ReplyClosePrinter_r_recv(subreq, mem_ctx);
   11164           0 :         TALLOC_FREE(subreq);
   11165           0 :         if (tevent_req_nterror(req, status)) {
   11166           0 :                 return;
   11167             :         }
   11168             : 
   11169             :         /* Copy out parameters */
   11170           0 :         *state->orig.out.handle = *state->tmp.out.handle;
   11171             : 
   11172             :         /* Copy result */
   11173           0 :         state->orig.out.result = state->tmp.out.result;
   11174             : 
   11175             :         /* Reset temporary structure */
   11176           0 :         NDR_ZERO_STRUCT(state->tmp);
   11177             : 
   11178           0 :         tevent_req_done(req);
   11179             : }
   11180             : 
   11181           0 : NTSTATUS dcerpc_spoolss_ReplyClosePrinter_recv(struct tevent_req *req,
   11182             :                                                TALLOC_CTX *mem_ctx,
   11183             :                                                WERROR *result)
   11184             : {
   11185           0 :         struct dcerpc_spoolss_ReplyClosePrinter_state *state = tevent_req_data(
   11186             :                 req, struct dcerpc_spoolss_ReplyClosePrinter_state);
   11187           0 :         NTSTATUS status;
   11188             : 
   11189           0 :         if (tevent_req_is_nterror(req, &status)) {
   11190           0 :                 tevent_req_received(req);
   11191           0 :                 return status;
   11192             :         }
   11193             : 
   11194             :         /* Steal possible out parameters to the callers context */
   11195           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11196             : 
   11197             :         /* Return result */
   11198           0 :         *result = state->orig.out.result;
   11199             : 
   11200           0 :         tevent_req_received(req);
   11201           0 :         return NT_STATUS_OK;
   11202             : }
   11203             : 
   11204           2 : NTSTATUS dcerpc_spoolss_ReplyClosePrinter(struct dcerpc_binding_handle *h,
   11205             :                                           TALLOC_CTX *mem_ctx,
   11206             :                                           struct policy_handle *_handle /* [in,out] [ref] */,
   11207             :                                           WERROR *result)
   11208             : {
   11209           0 :         struct spoolss_ReplyClosePrinter r;
   11210           0 :         NTSTATUS status;
   11211             : 
   11212             :         /* In parameters */
   11213           2 :         r.in.handle = _handle;
   11214             : 
   11215             :         /* Out parameters */
   11216           2 :         r.out.handle = _handle;
   11217             : 
   11218             :         /* Result */
   11219           2 :         NDR_ZERO_STRUCT(r.out.result);
   11220             : 
   11221           2 :         status = dcerpc_spoolss_ReplyClosePrinter_r(h, mem_ctx, &r);
   11222           2 :         if (!NT_STATUS_IS_OK(status)) {
   11223           0 :                 return status;
   11224             :         }
   11225             : 
   11226             :         /* Return variables */
   11227           2 :         *_handle = *r.out.handle;
   11228             : 
   11229             :         /* Return result */
   11230           2 :         *result = r.out.result;
   11231             : 
   11232           2 :         return NT_STATUS_OK;
   11233             : }
   11234             : 
   11235             : struct dcerpc_spoolss_AddPortEx_r_state {
   11236             :         TALLOC_CTX *out_mem_ctx;
   11237             : };
   11238             : 
   11239             : static void dcerpc_spoolss_AddPortEx_r_done(struct tevent_req *subreq);
   11240             : 
   11241           0 : struct tevent_req *dcerpc_spoolss_AddPortEx_r_send(TALLOC_CTX *mem_ctx,
   11242             :         struct tevent_context *ev,
   11243             :         struct dcerpc_binding_handle *h,
   11244             :         struct spoolss_AddPortEx *r)
   11245             : {
   11246           0 :         struct tevent_req *req;
   11247           0 :         struct dcerpc_spoolss_AddPortEx_r_state *state;
   11248           0 :         struct tevent_req *subreq;
   11249             : 
   11250           0 :         req = tevent_req_create(mem_ctx, &state,
   11251             :                                 struct dcerpc_spoolss_AddPortEx_r_state);
   11252           0 :         if (req == NULL) {
   11253           0 :                 return NULL;
   11254             :         }
   11255             : 
   11256           0 :         state->out_mem_ctx = NULL;
   11257             : 
   11258           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   11259             :                         NULL, &ndr_table_spoolss,
   11260             :                         NDR_SPOOLSS_ADDPORTEX, state, r);
   11261           0 :         if (tevent_req_nomem(subreq, req)) {
   11262           0 :                 return tevent_req_post(req, ev);
   11263             :         }
   11264           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_AddPortEx_r_done, req);
   11265             : 
   11266           0 :         return req;
   11267             : }
   11268             : 
   11269           0 : static void dcerpc_spoolss_AddPortEx_r_done(struct tevent_req *subreq)
   11270             : {
   11271           0 :         struct tevent_req *req =
   11272           0 :                 tevent_req_callback_data(subreq,
   11273             :                 struct tevent_req);
   11274           0 :         NTSTATUS status;
   11275             : 
   11276           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   11277           0 :         TALLOC_FREE(subreq);
   11278           0 :         if (tevent_req_nterror(req, status)) {
   11279           0 :                 return;
   11280             :         }
   11281             : 
   11282           0 :         tevent_req_done(req);
   11283             : }
   11284             : 
   11285           0 : NTSTATUS dcerpc_spoolss_AddPortEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   11286             : {
   11287           0 :         struct dcerpc_spoolss_AddPortEx_r_state *state =
   11288           0 :                 tevent_req_data(req,
   11289             :                 struct dcerpc_spoolss_AddPortEx_r_state);
   11290           0 :         NTSTATUS status;
   11291             : 
   11292           0 :         if (tevent_req_is_nterror(req, &status)) {
   11293           0 :                 tevent_req_received(req);
   11294           0 :                 return status;
   11295             :         }
   11296             : 
   11297           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11298             : 
   11299           0 :         tevent_req_received(req);
   11300           0 :         return NT_STATUS_OK;
   11301             : }
   11302             : 
   11303           0 : NTSTATUS dcerpc_spoolss_AddPortEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPortEx *r)
   11304             : {
   11305           0 :         NTSTATUS status;
   11306             : 
   11307           0 :         status = dcerpc_binding_handle_call(h,
   11308             :                         NULL, &ndr_table_spoolss,
   11309             :                         NDR_SPOOLSS_ADDPORTEX, mem_ctx, r);
   11310             : 
   11311           0 :         return status;
   11312             : }
   11313             : 
   11314             : struct dcerpc_spoolss_AddPortEx_state {
   11315             :         struct spoolss_AddPortEx orig;
   11316             :         struct spoolss_AddPortEx tmp;
   11317             :         TALLOC_CTX *out_mem_ctx;
   11318             : };
   11319             : 
   11320             : static void dcerpc_spoolss_AddPortEx_done(struct tevent_req *subreq);
   11321             : 
   11322           0 : struct tevent_req *dcerpc_spoolss_AddPortEx_send(TALLOC_CTX *mem_ctx,
   11323             :                                                  struct tevent_context *ev,
   11324             :                                                  struct dcerpc_binding_handle *h,
   11325             :                                                  const char *_servername /* [in] [charset(UTF16),unique] */,
   11326             :                                                  struct spoolss_SetPortInfoContainer *_port_ctr /* [in] [ref] */,
   11327             :                                                  struct spoolss_PortVarContainer *_port_var_ctr /* [in] [ref] */,
   11328             :                                                  const char *_monitor_name /* [in] [charset(UTF16),unique] */)
   11329             : {
   11330           0 :         struct tevent_req *req;
   11331           0 :         struct dcerpc_spoolss_AddPortEx_state *state;
   11332           0 :         struct tevent_req *subreq;
   11333             : 
   11334           0 :         req = tevent_req_create(mem_ctx, &state,
   11335             :                                 struct dcerpc_spoolss_AddPortEx_state);
   11336           0 :         if (req == NULL) {
   11337           0 :                 return NULL;
   11338             :         }
   11339           0 :         state->out_mem_ctx = NULL;
   11340             : 
   11341             :         /* In parameters */
   11342           0 :         state->orig.in.servername = _servername;
   11343           0 :         state->orig.in.port_ctr = _port_ctr;
   11344           0 :         state->orig.in.port_var_ctr = _port_var_ctr;
   11345           0 :         state->orig.in.monitor_name = _monitor_name;
   11346             : 
   11347             :         /* Out parameters */
   11348             : 
   11349             :         /* Result */
   11350           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   11351             : 
   11352             :         /* make a temporary copy, that we pass to the dispatch function */
   11353           0 :         state->tmp = state->orig;
   11354             : 
   11355           0 :         subreq = dcerpc_spoolss_AddPortEx_r_send(state, ev, h, &state->tmp);
   11356           0 :         if (tevent_req_nomem(subreq, req)) {
   11357           0 :                 return tevent_req_post(req, ev);
   11358             :         }
   11359           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_AddPortEx_done, req);
   11360           0 :         return req;
   11361             : }
   11362             : 
   11363           0 : static void dcerpc_spoolss_AddPortEx_done(struct tevent_req *subreq)
   11364             : {
   11365           0 :         struct tevent_req *req = tevent_req_callback_data(
   11366             :                 subreq, struct tevent_req);
   11367           0 :         struct dcerpc_spoolss_AddPortEx_state *state = tevent_req_data(
   11368             :                 req, struct dcerpc_spoolss_AddPortEx_state);
   11369           0 :         NTSTATUS status;
   11370           0 :         TALLOC_CTX *mem_ctx;
   11371             : 
   11372           0 :         if (state->out_mem_ctx) {
   11373           0 :                 mem_ctx = state->out_mem_ctx;
   11374             :         } else {
   11375           0 :                 mem_ctx = state;
   11376             :         }
   11377             : 
   11378           0 :         status = dcerpc_spoolss_AddPortEx_r_recv(subreq, mem_ctx);
   11379           0 :         TALLOC_FREE(subreq);
   11380           0 :         if (tevent_req_nterror(req, status)) {
   11381           0 :                 return;
   11382             :         }
   11383             : 
   11384             :         /* Copy out parameters */
   11385             : 
   11386             :         /* Copy result */
   11387           0 :         state->orig.out.result = state->tmp.out.result;
   11388             : 
   11389             :         /* Reset temporary structure */
   11390           0 :         NDR_ZERO_STRUCT(state->tmp);
   11391             : 
   11392           0 :         tevent_req_done(req);
   11393             : }
   11394             : 
   11395           0 : NTSTATUS dcerpc_spoolss_AddPortEx_recv(struct tevent_req *req,
   11396             :                                        TALLOC_CTX *mem_ctx,
   11397             :                                        WERROR *result)
   11398             : {
   11399           0 :         struct dcerpc_spoolss_AddPortEx_state *state = tevent_req_data(
   11400             :                 req, struct dcerpc_spoolss_AddPortEx_state);
   11401           0 :         NTSTATUS status;
   11402             : 
   11403           0 :         if (tevent_req_is_nterror(req, &status)) {
   11404           0 :                 tevent_req_received(req);
   11405           0 :                 return status;
   11406             :         }
   11407             : 
   11408             :         /* Steal possible out parameters to the callers context */
   11409           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11410             : 
   11411             :         /* Return result */
   11412           0 :         *result = state->orig.out.result;
   11413             : 
   11414           0 :         tevent_req_received(req);
   11415           0 :         return NT_STATUS_OK;
   11416             : }
   11417             : 
   11418           0 : NTSTATUS dcerpc_spoolss_AddPortEx(struct dcerpc_binding_handle *h,
   11419             :                                   TALLOC_CTX *mem_ctx,
   11420             :                                   const char *_servername /* [in] [charset(UTF16),unique] */,
   11421             :                                   struct spoolss_SetPortInfoContainer *_port_ctr /* [in] [ref] */,
   11422             :                                   struct spoolss_PortVarContainer *_port_var_ctr /* [in] [ref] */,
   11423             :                                   const char *_monitor_name /* [in] [charset(UTF16),unique] */,
   11424             :                                   WERROR *result)
   11425             : {
   11426           0 :         struct spoolss_AddPortEx r;
   11427           0 :         NTSTATUS status;
   11428             : 
   11429             :         /* In parameters */
   11430           0 :         r.in.servername = _servername;
   11431           0 :         r.in.port_ctr = _port_ctr;
   11432           0 :         r.in.port_var_ctr = _port_var_ctr;
   11433           0 :         r.in.monitor_name = _monitor_name;
   11434             : 
   11435             :         /* Out parameters */
   11436             : 
   11437             :         /* Result */
   11438           0 :         NDR_ZERO_STRUCT(r.out.result);
   11439             : 
   11440           0 :         status = dcerpc_spoolss_AddPortEx_r(h, mem_ctx, &r);
   11441           0 :         if (!NT_STATUS_IS_OK(status)) {
   11442           0 :                 return status;
   11443             :         }
   11444             : 
   11445             :         /* Return variables */
   11446             : 
   11447             :         /* Return result */
   11448           0 :         *result = r.out.result;
   11449             : 
   11450           0 :         return NT_STATUS_OK;
   11451             : }
   11452             : 
   11453             : struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_state {
   11454             :         TALLOC_CTX *out_mem_ctx;
   11455             : };
   11456             : 
   11457             : static void dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_done(struct tevent_req *subreq);
   11458             : 
   11459           0 : struct tevent_req *dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_send(TALLOC_CTX *mem_ctx,
   11460             :         struct tevent_context *ev,
   11461             :         struct dcerpc_binding_handle *h,
   11462             :         struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r)
   11463             : {
   11464           0 :         struct tevent_req *req;
   11465           0 :         struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_state *state;
   11466           0 :         struct tevent_req *subreq;
   11467             : 
   11468           0 :         req = tevent_req_create(mem_ctx, &state,
   11469             :                                 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_state);
   11470           0 :         if (req == NULL) {
   11471           0 :                 return NULL;
   11472             :         }
   11473             : 
   11474           0 :         state->out_mem_ctx = NULL;
   11475             : 
   11476           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   11477             :                         NULL, &ndr_table_spoolss,
   11478             :                         NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX, state, r);
   11479           0 :         if (tevent_req_nomem(subreq, req)) {
   11480           0 :                 return tevent_req_post(req, ev);
   11481             :         }
   11482           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_done, req);
   11483             : 
   11484           0 :         return req;
   11485             : }
   11486             : 
   11487           0 : static void dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_done(struct tevent_req *subreq)
   11488             : {
   11489           0 :         struct tevent_req *req =
   11490           0 :                 tevent_req_callback_data(subreq,
   11491             :                 struct tevent_req);
   11492           0 :         NTSTATUS status;
   11493             : 
   11494           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   11495           0 :         TALLOC_FREE(subreq);
   11496           0 :         if (tevent_req_nterror(req, status)) {
   11497           0 :                 return;
   11498             :         }
   11499             : 
   11500           0 :         tevent_req_done(req);
   11501             : }
   11502             : 
   11503           0 : NTSTATUS dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   11504             : {
   11505           0 :         struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_state *state =
   11506           0 :                 tevent_req_data(req,
   11507             :                 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_state);
   11508           0 :         NTSTATUS status;
   11509             : 
   11510           0 :         if (tevent_req_is_nterror(req, &status)) {
   11511           0 :                 tevent_req_received(req);
   11512           0 :                 return status;
   11513             :         }
   11514             : 
   11515           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11516             : 
   11517           0 :         tevent_req_received(req);
   11518           0 :         return NT_STATUS_OK;
   11519             : }
   11520             : 
   11521           2 : NTSTATUS dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r)
   11522             : {
   11523           0 :         NTSTATUS status;
   11524             : 
   11525           2 :         status = dcerpc_binding_handle_call(h,
   11526             :                         NULL, &ndr_table_spoolss,
   11527             :                         NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX, mem_ctx, r);
   11528             : 
   11529           2 :         return status;
   11530             : }
   11531             : 
   11532             : struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state {
   11533             :         struct spoolss_RemoteFindFirstPrinterChangeNotifyEx orig;
   11534             :         struct spoolss_RemoteFindFirstPrinterChangeNotifyEx tmp;
   11535             :         TALLOC_CTX *out_mem_ctx;
   11536             : };
   11537             : 
   11538             : static void dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done(struct tevent_req *subreq);
   11539             : 
   11540           0 : struct tevent_req *dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_send(TALLOC_CTX *mem_ctx,
   11541             :                                                                             struct tevent_context *ev,
   11542             :                                                                             struct dcerpc_binding_handle *h,
   11543             :                                                                             struct policy_handle *_handle /* [in] [ref] */,
   11544             :                                                                             uint32_t _flags /* [in]  */,
   11545             :                                                                             uint32_t _options /* [in]  */,
   11546             :                                                                             const char *_local_machine /* [in] [charset(UTF16),unique] */,
   11547             :                                                                             uint32_t _printer_local /* [in]  */,
   11548             :                                                                             struct spoolss_NotifyOption *_notify_options /* [in] [unique] */)
   11549             : {
   11550           0 :         struct tevent_req *req;
   11551           0 :         struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state;
   11552           0 :         struct tevent_req *subreq;
   11553             : 
   11554           0 :         req = tevent_req_create(mem_ctx, &state,
   11555             :                                 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
   11556           0 :         if (req == NULL) {
   11557           0 :                 return NULL;
   11558             :         }
   11559           0 :         state->out_mem_ctx = NULL;
   11560             : 
   11561             :         /* In parameters */
   11562           0 :         state->orig.in.handle = _handle;
   11563           0 :         state->orig.in.flags = _flags;
   11564           0 :         state->orig.in.options = _options;
   11565           0 :         state->orig.in.local_machine = _local_machine;
   11566           0 :         state->orig.in.printer_local = _printer_local;
   11567           0 :         state->orig.in.notify_options = _notify_options;
   11568             : 
   11569             :         /* Out parameters */
   11570             : 
   11571             :         /* Result */
   11572           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   11573             : 
   11574             :         /* make a temporary copy, that we pass to the dispatch function */
   11575           0 :         state->tmp = state->orig;
   11576             : 
   11577           0 :         subreq = dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_send(state, ev, h, &state->tmp);
   11578           0 :         if (tevent_req_nomem(subreq, req)) {
   11579           0 :                 return tevent_req_post(req, ev);
   11580             :         }
   11581           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done, req);
   11582           0 :         return req;
   11583             : }
   11584             : 
   11585           0 : static void dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done(struct tevent_req *subreq)
   11586             : {
   11587           0 :         struct tevent_req *req = tevent_req_callback_data(
   11588             :                 subreq, struct tevent_req);
   11589           0 :         struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state = tevent_req_data(
   11590             :                 req, struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
   11591           0 :         NTSTATUS status;
   11592           0 :         TALLOC_CTX *mem_ctx;
   11593             : 
   11594           0 :         if (state->out_mem_ctx) {
   11595           0 :                 mem_ctx = state->out_mem_ctx;
   11596             :         } else {
   11597           0 :                 mem_ctx = state;
   11598             :         }
   11599             : 
   11600           0 :         status = dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_recv(subreq, mem_ctx);
   11601           0 :         TALLOC_FREE(subreq);
   11602           0 :         if (tevent_req_nterror(req, status)) {
   11603           0 :                 return;
   11604             :         }
   11605             : 
   11606             :         /* Copy out parameters */
   11607             : 
   11608             :         /* Copy result */
   11609           0 :         state->orig.out.result = state->tmp.out.result;
   11610             : 
   11611             :         /* Reset temporary structure */
   11612           0 :         NDR_ZERO_STRUCT(state->tmp);
   11613             : 
   11614           0 :         tevent_req_done(req);
   11615             : }
   11616             : 
   11617           0 : NTSTATUS dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_recv(struct tevent_req *req,
   11618             :                                                                   TALLOC_CTX *mem_ctx,
   11619             :                                                                   WERROR *result)
   11620             : {
   11621           0 :         struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state = tevent_req_data(
   11622             :                 req, struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
   11623           0 :         NTSTATUS status;
   11624             : 
   11625           0 :         if (tevent_req_is_nterror(req, &status)) {
   11626           0 :                 tevent_req_received(req);
   11627           0 :                 return status;
   11628             :         }
   11629             : 
   11630             :         /* Steal possible out parameters to the callers context */
   11631           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11632             : 
   11633             :         /* Return result */
   11634           0 :         *result = state->orig.out.result;
   11635             : 
   11636           0 :         tevent_req_received(req);
   11637           0 :         return NT_STATUS_OK;
   11638             : }
   11639             : 
   11640           0 : NTSTATUS dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct dcerpc_binding_handle *h,
   11641             :                                                              TALLOC_CTX *mem_ctx,
   11642             :                                                              struct policy_handle *_handle /* [in] [ref] */,
   11643             :                                                              uint32_t _flags /* [in]  */,
   11644             :                                                              uint32_t _options /* [in]  */,
   11645             :                                                              const char *_local_machine /* [in] [charset(UTF16),unique] */,
   11646             :                                                              uint32_t _printer_local /* [in]  */,
   11647             :                                                              struct spoolss_NotifyOption *_notify_options /* [in] [unique] */,
   11648             :                                                              WERROR *result)
   11649             : {
   11650           0 :         struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
   11651           0 :         NTSTATUS status;
   11652             : 
   11653             :         /* In parameters */
   11654           0 :         r.in.handle = _handle;
   11655           0 :         r.in.flags = _flags;
   11656           0 :         r.in.options = _options;
   11657           0 :         r.in.local_machine = _local_machine;
   11658           0 :         r.in.printer_local = _printer_local;
   11659           0 :         r.in.notify_options = _notify_options;
   11660             : 
   11661             :         /* Out parameters */
   11662             : 
   11663             :         /* Result */
   11664           0 :         NDR_ZERO_STRUCT(r.out.result);
   11665             : 
   11666           0 :         status = dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r(h, mem_ctx, &r);
   11667           0 :         if (!NT_STATUS_IS_OK(status)) {
   11668           0 :                 return status;
   11669             :         }
   11670             : 
   11671             :         /* Return variables */
   11672             : 
   11673             :         /* Return result */
   11674           0 :         *result = r.out.result;
   11675             : 
   11676           0 :         return NT_STATUS_OK;
   11677             : }
   11678             : 
   11679             : struct dcerpc_spoolss_RouterReplyPrinterEx_r_state {
   11680             :         TALLOC_CTX *out_mem_ctx;
   11681             : };
   11682             : 
   11683             : static void dcerpc_spoolss_RouterReplyPrinterEx_r_done(struct tevent_req *subreq);
   11684             : 
   11685           0 : struct tevent_req *dcerpc_spoolss_RouterReplyPrinterEx_r_send(TALLOC_CTX *mem_ctx,
   11686             :         struct tevent_context *ev,
   11687             :         struct dcerpc_binding_handle *h,
   11688             :         struct spoolss_RouterReplyPrinterEx *r)
   11689             : {
   11690           0 :         struct tevent_req *req;
   11691           0 :         struct dcerpc_spoolss_RouterReplyPrinterEx_r_state *state;
   11692           0 :         struct tevent_req *subreq;
   11693             : 
   11694           0 :         req = tevent_req_create(mem_ctx, &state,
   11695             :                                 struct dcerpc_spoolss_RouterReplyPrinterEx_r_state);
   11696           0 :         if (req == NULL) {
   11697           0 :                 return NULL;
   11698             :         }
   11699             : 
   11700           0 :         state->out_mem_ctx = talloc_new(state);
   11701           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   11702           0 :                 return tevent_req_post(req, ev);
   11703             :         }
   11704             : 
   11705           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   11706             :                         NULL, &ndr_table_spoolss,
   11707           0 :                         NDR_SPOOLSS_ROUTERREPLYPRINTEREX, state->out_mem_ctx, r);
   11708           0 :         if (tevent_req_nomem(subreq, req)) {
   11709           0 :                 return tevent_req_post(req, ev);
   11710             :         }
   11711           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_RouterReplyPrinterEx_r_done, req);
   11712             : 
   11713           0 :         return req;
   11714             : }
   11715             : 
   11716           0 : static void dcerpc_spoolss_RouterReplyPrinterEx_r_done(struct tevent_req *subreq)
   11717             : {
   11718           0 :         struct tevent_req *req =
   11719           0 :                 tevent_req_callback_data(subreq,
   11720             :                 struct tevent_req);
   11721           0 :         NTSTATUS status;
   11722             : 
   11723           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   11724           0 :         TALLOC_FREE(subreq);
   11725           0 :         if (tevent_req_nterror(req, status)) {
   11726           0 :                 return;
   11727             :         }
   11728             : 
   11729           0 :         tevent_req_done(req);
   11730             : }
   11731             : 
   11732           0 : NTSTATUS dcerpc_spoolss_RouterReplyPrinterEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   11733             : {
   11734           0 :         struct dcerpc_spoolss_RouterReplyPrinterEx_r_state *state =
   11735           0 :                 tevent_req_data(req,
   11736             :                 struct dcerpc_spoolss_RouterReplyPrinterEx_r_state);
   11737           0 :         NTSTATUS status;
   11738             : 
   11739           0 :         if (tevent_req_is_nterror(req, &status)) {
   11740           0 :                 tevent_req_received(req);
   11741           0 :                 return status;
   11742             :         }
   11743             : 
   11744           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11745             : 
   11746           0 :         tevent_req_received(req);
   11747           0 :         return NT_STATUS_OK;
   11748             : }
   11749             : 
   11750           0 : NTSTATUS dcerpc_spoolss_RouterReplyPrinterEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RouterReplyPrinterEx *r)
   11751             : {
   11752           0 :         NTSTATUS status;
   11753             : 
   11754           0 :         status = dcerpc_binding_handle_call(h,
   11755             :                         NULL, &ndr_table_spoolss,
   11756             :                         NDR_SPOOLSS_ROUTERREPLYPRINTEREX, mem_ctx, r);
   11757             : 
   11758           0 :         return status;
   11759             : }
   11760             : 
   11761             : struct dcerpc_spoolss_RouterReplyPrinterEx_state {
   11762             :         struct spoolss_RouterReplyPrinterEx orig;
   11763             :         struct spoolss_RouterReplyPrinterEx tmp;
   11764             :         TALLOC_CTX *out_mem_ctx;
   11765             : };
   11766             : 
   11767             : static void dcerpc_spoolss_RouterReplyPrinterEx_done(struct tevent_req *subreq);
   11768             : 
   11769           0 : struct tevent_req *dcerpc_spoolss_RouterReplyPrinterEx_send(TALLOC_CTX *mem_ctx,
   11770             :                                                             struct tevent_context *ev,
   11771             :                                                             struct dcerpc_binding_handle *h,
   11772             :                                                             struct policy_handle *_handle /* [in] [ref] */,
   11773             :                                                             uint32_t _color /* [in]  */,
   11774             :                                                             uint32_t _flags /* [in]  */,
   11775             :                                                             uint32_t *_reply_result /* [out] [ref] */,
   11776             :                                                             uint32_t _reply_type /* [in]  */,
   11777             :                                                             union spoolss_ReplyPrinterInfo _info /* [in] [switch_is(reply_type)] */)
   11778             : {
   11779           0 :         struct tevent_req *req;
   11780           0 :         struct dcerpc_spoolss_RouterReplyPrinterEx_state *state;
   11781           0 :         struct tevent_req *subreq;
   11782             : 
   11783           0 :         req = tevent_req_create(mem_ctx, &state,
   11784             :                                 struct dcerpc_spoolss_RouterReplyPrinterEx_state);
   11785           0 :         if (req == NULL) {
   11786           0 :                 return NULL;
   11787             :         }
   11788           0 :         state->out_mem_ctx = NULL;
   11789             : 
   11790             :         /* In parameters */
   11791           0 :         state->orig.in.handle = _handle;
   11792           0 :         state->orig.in.color = _color;
   11793           0 :         state->orig.in.flags = _flags;
   11794           0 :         state->orig.in.reply_type = _reply_type;
   11795           0 :         state->orig.in.info = _info;
   11796             : 
   11797             :         /* Out parameters */
   11798           0 :         state->orig.out.reply_result = _reply_result;
   11799             : 
   11800             :         /* Result */
   11801           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   11802             : 
   11803           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   11804             :                              "dcerpc_spoolss_RouterReplyPrinterEx_out_memory");
   11805           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   11806           0 :                 return tevent_req_post(req, ev);
   11807             :         }
   11808             : 
   11809             :         /* make a temporary copy, that we pass to the dispatch function */
   11810           0 :         state->tmp = state->orig;
   11811             : 
   11812           0 :         subreq = dcerpc_spoolss_RouterReplyPrinterEx_r_send(state, ev, h, &state->tmp);
   11813           0 :         if (tevent_req_nomem(subreq, req)) {
   11814           0 :                 return tevent_req_post(req, ev);
   11815             :         }
   11816           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_RouterReplyPrinterEx_done, req);
   11817           0 :         return req;
   11818             : }
   11819             : 
   11820           0 : static void dcerpc_spoolss_RouterReplyPrinterEx_done(struct tevent_req *subreq)
   11821             : {
   11822           0 :         struct tevent_req *req = tevent_req_callback_data(
   11823             :                 subreq, struct tevent_req);
   11824           0 :         struct dcerpc_spoolss_RouterReplyPrinterEx_state *state = tevent_req_data(
   11825             :                 req, struct dcerpc_spoolss_RouterReplyPrinterEx_state);
   11826           0 :         NTSTATUS status;
   11827           0 :         TALLOC_CTX *mem_ctx;
   11828             : 
   11829           0 :         if (state->out_mem_ctx) {
   11830           0 :                 mem_ctx = state->out_mem_ctx;
   11831             :         } else {
   11832           0 :                 mem_ctx = state;
   11833             :         }
   11834             : 
   11835           0 :         status = dcerpc_spoolss_RouterReplyPrinterEx_r_recv(subreq, mem_ctx);
   11836           0 :         TALLOC_FREE(subreq);
   11837           0 :         if (tevent_req_nterror(req, status)) {
   11838           0 :                 return;
   11839             :         }
   11840             : 
   11841             :         /* Copy out parameters */
   11842           0 :         *state->orig.out.reply_result = *state->tmp.out.reply_result;
   11843             : 
   11844             :         /* Copy result */
   11845           0 :         state->orig.out.result = state->tmp.out.result;
   11846             : 
   11847             :         /* Reset temporary structure */
   11848           0 :         NDR_ZERO_STRUCT(state->tmp);
   11849             : 
   11850           0 :         tevent_req_done(req);
   11851             : }
   11852             : 
   11853           0 : NTSTATUS dcerpc_spoolss_RouterReplyPrinterEx_recv(struct tevent_req *req,
   11854             :                                                   TALLOC_CTX *mem_ctx,
   11855             :                                                   WERROR *result)
   11856             : {
   11857           0 :         struct dcerpc_spoolss_RouterReplyPrinterEx_state *state = tevent_req_data(
   11858             :                 req, struct dcerpc_spoolss_RouterReplyPrinterEx_state);
   11859           0 :         NTSTATUS status;
   11860             : 
   11861           0 :         if (tevent_req_is_nterror(req, &status)) {
   11862           0 :                 tevent_req_received(req);
   11863           0 :                 return status;
   11864             :         }
   11865             : 
   11866             :         /* Steal possible out parameters to the callers context */
   11867           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11868             : 
   11869             :         /* Return result */
   11870           0 :         *result = state->orig.out.result;
   11871             : 
   11872           0 :         tevent_req_received(req);
   11873           0 :         return NT_STATUS_OK;
   11874             : }
   11875             : 
   11876           0 : NTSTATUS dcerpc_spoolss_RouterReplyPrinterEx(struct dcerpc_binding_handle *h,
   11877             :                                              TALLOC_CTX *mem_ctx,
   11878             :                                              struct policy_handle *_handle /* [in] [ref] */,
   11879             :                                              uint32_t _color /* [in]  */,
   11880             :                                              uint32_t _flags /* [in]  */,
   11881             :                                              uint32_t *_reply_result /* [out] [ref] */,
   11882             :                                              uint32_t _reply_type /* [in]  */,
   11883             :                                              union spoolss_ReplyPrinterInfo _info /* [in] [switch_is(reply_type)] */,
   11884             :                                              WERROR *result)
   11885             : {
   11886           0 :         struct spoolss_RouterReplyPrinterEx r;
   11887           0 :         NTSTATUS status;
   11888             : 
   11889             :         /* In parameters */
   11890           0 :         r.in.handle = _handle;
   11891           0 :         r.in.color = _color;
   11892           0 :         r.in.flags = _flags;
   11893           0 :         r.in.reply_type = _reply_type;
   11894           0 :         r.in.info = _info;
   11895             : 
   11896             :         /* Out parameters */
   11897           0 :         r.out.reply_result = _reply_result;
   11898             : 
   11899             :         /* Result */
   11900           0 :         NDR_ZERO_STRUCT(r.out.result);
   11901             : 
   11902           0 :         status = dcerpc_spoolss_RouterReplyPrinterEx_r(h, mem_ctx, &r);
   11903           0 :         if (!NT_STATUS_IS_OK(status)) {
   11904           0 :                 return status;
   11905             :         }
   11906             : 
   11907             :         /* Return variables */
   11908           0 :         *_reply_result = *r.out.reply_result;
   11909             : 
   11910             :         /* Return result */
   11911           0 :         *result = r.out.result;
   11912             : 
   11913           0 :         return NT_STATUS_OK;
   11914             : }
   11915             : 
   11916             : struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_state {
   11917             :         TALLOC_CTX *out_mem_ctx;
   11918             : };
   11919             : 
   11920             : static void dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_done(struct tevent_req *subreq);
   11921             : 
   11922           0 : struct tevent_req *dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_send(TALLOC_CTX *mem_ctx,
   11923             :         struct tevent_context *ev,
   11924             :         struct dcerpc_binding_handle *h,
   11925             :         struct spoolss_RouterRefreshPrinterChangeNotify *r)
   11926             : {
   11927           0 :         struct tevent_req *req;
   11928           0 :         struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_state *state;
   11929           0 :         struct tevent_req *subreq;
   11930             : 
   11931           0 :         req = tevent_req_create(mem_ctx, &state,
   11932             :                                 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_state);
   11933           0 :         if (req == NULL) {
   11934           0 :                 return NULL;
   11935             :         }
   11936             : 
   11937           0 :         state->out_mem_ctx = talloc_new(state);
   11938           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   11939           0 :                 return tevent_req_post(req, ev);
   11940             :         }
   11941             : 
   11942           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   11943             :                         NULL, &ndr_table_spoolss,
   11944           0 :                         NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY, state->out_mem_ctx, r);
   11945           0 :         if (tevent_req_nomem(subreq, req)) {
   11946           0 :                 return tevent_req_post(req, ev);
   11947             :         }
   11948           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_done, req);
   11949             : 
   11950           0 :         return req;
   11951             : }
   11952             : 
   11953           0 : static void dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_done(struct tevent_req *subreq)
   11954             : {
   11955           0 :         struct tevent_req *req =
   11956           0 :                 tevent_req_callback_data(subreq,
   11957             :                 struct tevent_req);
   11958           0 :         NTSTATUS status;
   11959             : 
   11960           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   11961           0 :         TALLOC_FREE(subreq);
   11962           0 :         if (tevent_req_nterror(req, status)) {
   11963           0 :                 return;
   11964             :         }
   11965             : 
   11966           0 :         tevent_req_done(req);
   11967             : }
   11968             : 
   11969           0 : NTSTATUS dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   11970             : {
   11971           0 :         struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_state *state =
   11972           0 :                 tevent_req_data(req,
   11973             :                 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_state);
   11974           0 :         NTSTATUS status;
   11975             : 
   11976           0 :         if (tevent_req_is_nterror(req, &status)) {
   11977           0 :                 tevent_req_received(req);
   11978           0 :                 return status;
   11979             :         }
   11980             : 
   11981           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   11982             : 
   11983           0 :         tevent_req_received(req);
   11984           0 :         return NT_STATUS_OK;
   11985             : }
   11986             : 
   11987           4 : NTSTATUS dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RouterRefreshPrinterChangeNotify *r)
   11988             : {
   11989           0 :         NTSTATUS status;
   11990             : 
   11991           4 :         status = dcerpc_binding_handle_call(h,
   11992             :                         NULL, &ndr_table_spoolss,
   11993             :                         NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY, mem_ctx, r);
   11994             : 
   11995           4 :         return status;
   11996             : }
   11997             : 
   11998             : struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state {
   11999             :         struct spoolss_RouterRefreshPrinterChangeNotify orig;
   12000             :         struct spoolss_RouterRefreshPrinterChangeNotify tmp;
   12001             :         TALLOC_CTX *out_mem_ctx;
   12002             : };
   12003             : 
   12004             : static void dcerpc_spoolss_RouterRefreshPrinterChangeNotify_done(struct tevent_req *subreq);
   12005             : 
   12006           0 : struct tevent_req *dcerpc_spoolss_RouterRefreshPrinterChangeNotify_send(TALLOC_CTX *mem_ctx,
   12007             :                                                                         struct tevent_context *ev,
   12008             :                                                                         struct dcerpc_binding_handle *h,
   12009             :                                                                         struct policy_handle *_handle /* [in] [ref] */,
   12010             :                                                                         uint32_t _change_low /* [in]  */,
   12011             :                                                                         struct spoolss_NotifyOption *_options /* [in] [unique] */,
   12012             :                                                                         struct spoolss_NotifyInfo **_info /* [out] [ref] */)
   12013             : {
   12014           0 :         struct tevent_req *req;
   12015           0 :         struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state *state;
   12016           0 :         struct tevent_req *subreq;
   12017             : 
   12018           0 :         req = tevent_req_create(mem_ctx, &state,
   12019             :                                 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state);
   12020           0 :         if (req == NULL) {
   12021           0 :                 return NULL;
   12022             :         }
   12023           0 :         state->out_mem_ctx = NULL;
   12024             : 
   12025             :         /* In parameters */
   12026           0 :         state->orig.in.handle = _handle;
   12027           0 :         state->orig.in.change_low = _change_low;
   12028           0 :         state->orig.in.options = _options;
   12029             : 
   12030             :         /* Out parameters */
   12031           0 :         state->orig.out.info = _info;
   12032             : 
   12033             :         /* Result */
   12034           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   12035             : 
   12036           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   12037             :                              "dcerpc_spoolss_RouterRefreshPrinterChangeNotify_out_memory");
   12038           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   12039           0 :                 return tevent_req_post(req, ev);
   12040             :         }
   12041             : 
   12042             :         /* make a temporary copy, that we pass to the dispatch function */
   12043           0 :         state->tmp = state->orig;
   12044             : 
   12045           0 :         subreq = dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_send(state, ev, h, &state->tmp);
   12046           0 :         if (tevent_req_nomem(subreq, req)) {
   12047           0 :                 return tevent_req_post(req, ev);
   12048             :         }
   12049           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_RouterRefreshPrinterChangeNotify_done, req);
   12050           0 :         return req;
   12051             : }
   12052             : 
   12053           0 : static void dcerpc_spoolss_RouterRefreshPrinterChangeNotify_done(struct tevent_req *subreq)
   12054             : {
   12055           0 :         struct tevent_req *req = tevent_req_callback_data(
   12056             :                 subreq, struct tevent_req);
   12057           0 :         struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state *state = tevent_req_data(
   12058             :                 req, struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state);
   12059           0 :         NTSTATUS status;
   12060           0 :         TALLOC_CTX *mem_ctx;
   12061             : 
   12062           0 :         if (state->out_mem_ctx) {
   12063           0 :                 mem_ctx = state->out_mem_ctx;
   12064             :         } else {
   12065           0 :                 mem_ctx = state;
   12066             :         }
   12067             : 
   12068           0 :         status = dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_recv(subreq, mem_ctx);
   12069           0 :         TALLOC_FREE(subreq);
   12070           0 :         if (tevent_req_nterror(req, status)) {
   12071           0 :                 return;
   12072             :         }
   12073             : 
   12074             :         /* Copy out parameters */
   12075           0 :         *state->orig.out.info = *state->tmp.out.info;
   12076             : 
   12077             :         /* Copy result */
   12078           0 :         state->orig.out.result = state->tmp.out.result;
   12079             : 
   12080             :         /* Reset temporary structure */
   12081           0 :         NDR_ZERO_STRUCT(state->tmp);
   12082             : 
   12083           0 :         tevent_req_done(req);
   12084             : }
   12085             : 
   12086           0 : NTSTATUS dcerpc_spoolss_RouterRefreshPrinterChangeNotify_recv(struct tevent_req *req,
   12087             :                                                               TALLOC_CTX *mem_ctx,
   12088             :                                                               WERROR *result)
   12089             : {
   12090           0 :         struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state *state = tevent_req_data(
   12091             :                 req, struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state);
   12092           0 :         NTSTATUS status;
   12093             : 
   12094           0 :         if (tevent_req_is_nterror(req, &status)) {
   12095           0 :                 tevent_req_received(req);
   12096           0 :                 return status;
   12097             :         }
   12098             : 
   12099             :         /* Steal possible out parameters to the callers context */
   12100           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12101             : 
   12102             :         /* Return result */
   12103           0 :         *result = state->orig.out.result;
   12104             : 
   12105           0 :         tevent_req_received(req);
   12106           0 :         return NT_STATUS_OK;
   12107             : }
   12108             : 
   12109           0 : NTSTATUS dcerpc_spoolss_RouterRefreshPrinterChangeNotify(struct dcerpc_binding_handle *h,
   12110             :                                                          TALLOC_CTX *mem_ctx,
   12111             :                                                          struct policy_handle *_handle /* [in] [ref] */,
   12112             :                                                          uint32_t _change_low /* [in]  */,
   12113             :                                                          struct spoolss_NotifyOption *_options /* [in] [unique] */,
   12114             :                                                          struct spoolss_NotifyInfo **_info /* [out] [ref] */,
   12115             :                                                          WERROR *result)
   12116             : {
   12117           0 :         struct spoolss_RouterRefreshPrinterChangeNotify r;
   12118           0 :         NTSTATUS status;
   12119             : 
   12120             :         /* In parameters */
   12121           0 :         r.in.handle = _handle;
   12122           0 :         r.in.change_low = _change_low;
   12123           0 :         r.in.options = _options;
   12124             : 
   12125             :         /* Out parameters */
   12126           0 :         r.out.info = _info;
   12127             : 
   12128             :         /* Result */
   12129           0 :         NDR_ZERO_STRUCT(r.out.result);
   12130             : 
   12131           0 :         status = dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r(h, mem_ctx, &r);
   12132           0 :         if (!NT_STATUS_IS_OK(status)) {
   12133           0 :                 return status;
   12134             :         }
   12135             : 
   12136             :         /* Return variables */
   12137           0 :         *_info = *r.out.info;
   12138             : 
   12139             :         /* Return result */
   12140           0 :         *result = r.out.result;
   12141             : 
   12142           0 :         return NT_STATUS_OK;
   12143             : }
   12144             : 
   12145             : struct dcerpc_spoolss_OpenPrinterEx_r_state {
   12146             :         TALLOC_CTX *out_mem_ctx;
   12147             : };
   12148             : 
   12149             : static void dcerpc_spoolss_OpenPrinterEx_r_done(struct tevent_req *subreq);
   12150             : 
   12151           0 : struct tevent_req *dcerpc_spoolss_OpenPrinterEx_r_send(TALLOC_CTX *mem_ctx,
   12152             :         struct tevent_context *ev,
   12153             :         struct dcerpc_binding_handle *h,
   12154             :         struct spoolss_OpenPrinterEx *r)
   12155             : {
   12156           0 :         struct tevent_req *req;
   12157           0 :         struct dcerpc_spoolss_OpenPrinterEx_r_state *state;
   12158           0 :         struct tevent_req *subreq;
   12159             : 
   12160           0 :         req = tevent_req_create(mem_ctx, &state,
   12161             :                                 struct dcerpc_spoolss_OpenPrinterEx_r_state);
   12162           0 :         if (req == NULL) {
   12163           0 :                 return NULL;
   12164             :         }
   12165             : 
   12166           0 :         state->out_mem_ctx = talloc_new(state);
   12167           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   12168           0 :                 return tevent_req_post(req, ev);
   12169             :         }
   12170             : 
   12171           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   12172             :                         NULL, &ndr_table_spoolss,
   12173           0 :                         NDR_SPOOLSS_OPENPRINTEREX, state->out_mem_ctx, r);
   12174           0 :         if (tevent_req_nomem(subreq, req)) {
   12175           0 :                 return tevent_req_post(req, ev);
   12176             :         }
   12177           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_OpenPrinterEx_r_done, req);
   12178             : 
   12179           0 :         return req;
   12180             : }
   12181             : 
   12182           0 : static void dcerpc_spoolss_OpenPrinterEx_r_done(struct tevent_req *subreq)
   12183             : {
   12184           0 :         struct tevent_req *req =
   12185           0 :                 tevent_req_callback_data(subreq,
   12186             :                 struct tevent_req);
   12187           0 :         NTSTATUS status;
   12188             : 
   12189           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   12190           0 :         TALLOC_FREE(subreq);
   12191           0 :         if (tevent_req_nterror(req, status)) {
   12192           0 :                 return;
   12193             :         }
   12194             : 
   12195           0 :         tevent_req_done(req);
   12196             : }
   12197             : 
   12198           0 : NTSTATUS dcerpc_spoolss_OpenPrinterEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   12199             : {
   12200           0 :         struct dcerpc_spoolss_OpenPrinterEx_r_state *state =
   12201           0 :                 tevent_req_data(req,
   12202             :                 struct dcerpc_spoolss_OpenPrinterEx_r_state);
   12203           0 :         NTSTATUS status;
   12204             : 
   12205           0 :         if (tevent_req_is_nterror(req, &status)) {
   12206           0 :                 tevent_req_received(req);
   12207           0 :                 return status;
   12208             :         }
   12209             : 
   12210           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12211             : 
   12212           0 :         tevent_req_received(req);
   12213           0 :         return NT_STATUS_OK;
   12214             : }
   12215             : 
   12216         794 : NTSTATUS dcerpc_spoolss_OpenPrinterEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_OpenPrinterEx *r)
   12217             : {
   12218           0 :         NTSTATUS status;
   12219             : 
   12220         794 :         status = dcerpc_binding_handle_call(h,
   12221             :                         NULL, &ndr_table_spoolss,
   12222             :                         NDR_SPOOLSS_OPENPRINTEREX, mem_ctx, r);
   12223             : 
   12224         794 :         return status;
   12225             : }
   12226             : 
   12227             : struct dcerpc_spoolss_OpenPrinterEx_state {
   12228             :         struct spoolss_OpenPrinterEx orig;
   12229             :         struct spoolss_OpenPrinterEx tmp;
   12230             :         TALLOC_CTX *out_mem_ctx;
   12231             : };
   12232             : 
   12233             : static void dcerpc_spoolss_OpenPrinterEx_done(struct tevent_req *subreq);
   12234             : 
   12235           0 : struct tevent_req *dcerpc_spoolss_OpenPrinterEx_send(TALLOC_CTX *mem_ctx,
   12236             :                                                      struct tevent_context *ev,
   12237             :                                                      struct dcerpc_binding_handle *h,
   12238             :                                                      const char *_printername /* [in] [charset(UTF16),unique] */,
   12239             :                                                      const char *_datatype /* [in] [charset(UTF16),unique] */,
   12240             :                                                      struct spoolss_DevmodeContainer _devmode_ctr /* [in]  */,
   12241             :                                                      uint32_t _access_mask /* [in]  */,
   12242             :                                                      struct spoolss_UserLevelCtr _userlevel_ctr /* [in]  */,
   12243             :                                                      struct policy_handle *_handle /* [out] [ref] */)
   12244             : {
   12245           0 :         struct tevent_req *req;
   12246           0 :         struct dcerpc_spoolss_OpenPrinterEx_state *state;
   12247           0 :         struct tevent_req *subreq;
   12248             : 
   12249           0 :         req = tevent_req_create(mem_ctx, &state,
   12250             :                                 struct dcerpc_spoolss_OpenPrinterEx_state);
   12251           0 :         if (req == NULL) {
   12252           0 :                 return NULL;
   12253             :         }
   12254           0 :         state->out_mem_ctx = NULL;
   12255             : 
   12256             :         /* In parameters */
   12257           0 :         state->orig.in.printername = _printername;
   12258           0 :         state->orig.in.datatype = _datatype;
   12259           0 :         state->orig.in.devmode_ctr = _devmode_ctr;
   12260           0 :         state->orig.in.access_mask = _access_mask;
   12261           0 :         state->orig.in.userlevel_ctr = _userlevel_ctr;
   12262             : 
   12263             :         /* Out parameters */
   12264           0 :         state->orig.out.handle = _handle;
   12265             : 
   12266             :         /* Result */
   12267           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   12268             : 
   12269           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   12270             :                              "dcerpc_spoolss_OpenPrinterEx_out_memory");
   12271           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   12272           0 :                 return tevent_req_post(req, ev);
   12273             :         }
   12274             : 
   12275             :         /* make a temporary copy, that we pass to the dispatch function */
   12276           0 :         state->tmp = state->orig;
   12277             : 
   12278           0 :         subreq = dcerpc_spoolss_OpenPrinterEx_r_send(state, ev, h, &state->tmp);
   12279           0 :         if (tevent_req_nomem(subreq, req)) {
   12280           0 :                 return tevent_req_post(req, ev);
   12281             :         }
   12282           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_OpenPrinterEx_done, req);
   12283           0 :         return req;
   12284             : }
   12285             : 
   12286           0 : static void dcerpc_spoolss_OpenPrinterEx_done(struct tevent_req *subreq)
   12287             : {
   12288           0 :         struct tevent_req *req = tevent_req_callback_data(
   12289             :                 subreq, struct tevent_req);
   12290           0 :         struct dcerpc_spoolss_OpenPrinterEx_state *state = tevent_req_data(
   12291             :                 req, struct dcerpc_spoolss_OpenPrinterEx_state);
   12292           0 :         NTSTATUS status;
   12293           0 :         TALLOC_CTX *mem_ctx;
   12294             : 
   12295           0 :         if (state->out_mem_ctx) {
   12296           0 :                 mem_ctx = state->out_mem_ctx;
   12297             :         } else {
   12298           0 :                 mem_ctx = state;
   12299             :         }
   12300             : 
   12301           0 :         status = dcerpc_spoolss_OpenPrinterEx_r_recv(subreq, mem_ctx);
   12302           0 :         TALLOC_FREE(subreq);
   12303           0 :         if (tevent_req_nterror(req, status)) {
   12304           0 :                 return;
   12305             :         }
   12306             : 
   12307             :         /* Copy out parameters */
   12308           0 :         *state->orig.out.handle = *state->tmp.out.handle;
   12309             : 
   12310             :         /* Copy result */
   12311           0 :         state->orig.out.result = state->tmp.out.result;
   12312             : 
   12313             :         /* Reset temporary structure */
   12314           0 :         NDR_ZERO_STRUCT(state->tmp);
   12315             : 
   12316           0 :         tevent_req_done(req);
   12317             : }
   12318             : 
   12319           0 : NTSTATUS dcerpc_spoolss_OpenPrinterEx_recv(struct tevent_req *req,
   12320             :                                            TALLOC_CTX *mem_ctx,
   12321             :                                            WERROR *result)
   12322             : {
   12323           0 :         struct dcerpc_spoolss_OpenPrinterEx_state *state = tevent_req_data(
   12324             :                 req, struct dcerpc_spoolss_OpenPrinterEx_state);
   12325           0 :         NTSTATUS status;
   12326             : 
   12327           0 :         if (tevent_req_is_nterror(req, &status)) {
   12328           0 :                 tevent_req_received(req);
   12329           0 :                 return status;
   12330             :         }
   12331             : 
   12332             :         /* Steal possible out parameters to the callers context */
   12333           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12334             : 
   12335             :         /* Return result */
   12336           0 :         *result = state->orig.out.result;
   12337             : 
   12338           0 :         tevent_req_received(req);
   12339           0 :         return NT_STATUS_OK;
   12340             : }
   12341             : 
   12342           6 : NTSTATUS dcerpc_spoolss_OpenPrinterEx(struct dcerpc_binding_handle *h,
   12343             :                                       TALLOC_CTX *mem_ctx,
   12344             :                                       const char *_printername /* [in] [charset(UTF16),unique] */,
   12345             :                                       const char *_datatype /* [in] [charset(UTF16),unique] */,
   12346             :                                       struct spoolss_DevmodeContainer _devmode_ctr /* [in]  */,
   12347             :                                       uint32_t _access_mask /* [in]  */,
   12348             :                                       struct spoolss_UserLevelCtr _userlevel_ctr /* [in]  */,
   12349             :                                       struct policy_handle *_handle /* [out] [ref] */,
   12350             :                                       WERROR *result)
   12351             : {
   12352           0 :         struct spoolss_OpenPrinterEx r;
   12353           0 :         NTSTATUS status;
   12354             : 
   12355             :         /* In parameters */
   12356           6 :         r.in.printername = _printername;
   12357           6 :         r.in.datatype = _datatype;
   12358           6 :         r.in.devmode_ctr = _devmode_ctr;
   12359           6 :         r.in.access_mask = _access_mask;
   12360           6 :         r.in.userlevel_ctr = _userlevel_ctr;
   12361             : 
   12362             :         /* Out parameters */
   12363           6 :         r.out.handle = _handle;
   12364             : 
   12365             :         /* Result */
   12366           6 :         NDR_ZERO_STRUCT(r.out.result);
   12367             : 
   12368           6 :         status = dcerpc_spoolss_OpenPrinterEx_r(h, mem_ctx, &r);
   12369           6 :         if (!NT_STATUS_IS_OK(status)) {
   12370           0 :                 return status;
   12371             :         }
   12372             : 
   12373             :         /* Return variables */
   12374           6 :         *_handle = *r.out.handle;
   12375             : 
   12376             :         /* Return result */
   12377           6 :         *result = r.out.result;
   12378             : 
   12379           6 :         return NT_STATUS_OK;
   12380             : }
   12381             : 
   12382             : struct dcerpc_spoolss_AddPrinterEx_r_state {
   12383             :         TALLOC_CTX *out_mem_ctx;
   12384             : };
   12385             : 
   12386             : static void dcerpc_spoolss_AddPrinterEx_r_done(struct tevent_req *subreq);
   12387             : 
   12388           0 : struct tevent_req *dcerpc_spoolss_AddPrinterEx_r_send(TALLOC_CTX *mem_ctx,
   12389             :         struct tevent_context *ev,
   12390             :         struct dcerpc_binding_handle *h,
   12391             :         struct spoolss_AddPrinterEx *r)
   12392             : {
   12393           0 :         struct tevent_req *req;
   12394           0 :         struct dcerpc_spoolss_AddPrinterEx_r_state *state;
   12395           0 :         struct tevent_req *subreq;
   12396             : 
   12397           0 :         req = tevent_req_create(mem_ctx, &state,
   12398             :                                 struct dcerpc_spoolss_AddPrinterEx_r_state);
   12399           0 :         if (req == NULL) {
   12400           0 :                 return NULL;
   12401             :         }
   12402             : 
   12403           0 :         state->out_mem_ctx = talloc_new(state);
   12404           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   12405           0 :                 return tevent_req_post(req, ev);
   12406             :         }
   12407             : 
   12408           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   12409             :                         NULL, &ndr_table_spoolss,
   12410           0 :                         NDR_SPOOLSS_ADDPRINTEREX, state->out_mem_ctx, r);
   12411           0 :         if (tevent_req_nomem(subreq, req)) {
   12412           0 :                 return tevent_req_post(req, ev);
   12413             :         }
   12414           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinterEx_r_done, req);
   12415             : 
   12416           0 :         return req;
   12417             : }
   12418             : 
   12419           0 : static void dcerpc_spoolss_AddPrinterEx_r_done(struct tevent_req *subreq)
   12420             : {
   12421           0 :         struct tevent_req *req =
   12422           0 :                 tevent_req_callback_data(subreq,
   12423             :                 struct tevent_req);
   12424           0 :         NTSTATUS status;
   12425             : 
   12426           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   12427           0 :         TALLOC_FREE(subreq);
   12428           0 :         if (tevent_req_nterror(req, status)) {
   12429           0 :                 return;
   12430             :         }
   12431             : 
   12432           0 :         tevent_req_done(req);
   12433             : }
   12434             : 
   12435           0 : NTSTATUS dcerpc_spoolss_AddPrinterEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   12436             : {
   12437           0 :         struct dcerpc_spoolss_AddPrinterEx_r_state *state =
   12438           0 :                 tevent_req_data(req,
   12439             :                 struct dcerpc_spoolss_AddPrinterEx_r_state);
   12440           0 :         NTSTATUS status;
   12441             : 
   12442           0 :         if (tevent_req_is_nterror(req, &status)) {
   12443           0 :                 tevent_req_received(req);
   12444           0 :                 return status;
   12445             :         }
   12446             : 
   12447           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12448             : 
   12449           0 :         tevent_req_received(req);
   12450           0 :         return NT_STATUS_OK;
   12451             : }
   12452             : 
   12453          24 : NTSTATUS dcerpc_spoolss_AddPrinterEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPrinterEx *r)
   12454             : {
   12455           0 :         NTSTATUS status;
   12456             : 
   12457          24 :         status = dcerpc_binding_handle_call(h,
   12458             :                         NULL, &ndr_table_spoolss,
   12459             :                         NDR_SPOOLSS_ADDPRINTEREX, mem_ctx, r);
   12460             : 
   12461          24 :         return status;
   12462             : }
   12463             : 
   12464             : struct dcerpc_spoolss_AddPrinterEx_state {
   12465             :         struct spoolss_AddPrinterEx orig;
   12466             :         struct spoolss_AddPrinterEx tmp;
   12467             :         TALLOC_CTX *out_mem_ctx;
   12468             : };
   12469             : 
   12470             : static void dcerpc_spoolss_AddPrinterEx_done(struct tevent_req *subreq);
   12471             : 
   12472           0 : struct tevent_req *dcerpc_spoolss_AddPrinterEx_send(TALLOC_CTX *mem_ctx,
   12473             :                                                     struct tevent_context *ev,
   12474             :                                                     struct dcerpc_binding_handle *h,
   12475             :                                                     const char *_server /* [in] [charset(UTF16),unique] */,
   12476             :                                                     struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
   12477             :                                                     struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
   12478             :                                                     struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
   12479             :                                                     struct spoolss_UserLevelCtr *_userlevel_ctr /* [in] [ref] */,
   12480             :                                                     struct policy_handle *_handle /* [out] [ref] */)
   12481             : {
   12482           0 :         struct tevent_req *req;
   12483           0 :         struct dcerpc_spoolss_AddPrinterEx_state *state;
   12484           0 :         struct tevent_req *subreq;
   12485             : 
   12486           0 :         req = tevent_req_create(mem_ctx, &state,
   12487             :                                 struct dcerpc_spoolss_AddPrinterEx_state);
   12488           0 :         if (req == NULL) {
   12489           0 :                 return NULL;
   12490             :         }
   12491           0 :         state->out_mem_ctx = NULL;
   12492             : 
   12493             :         /* In parameters */
   12494           0 :         state->orig.in.server = _server;
   12495           0 :         state->orig.in.info_ctr = _info_ctr;
   12496           0 :         state->orig.in.devmode_ctr = _devmode_ctr;
   12497           0 :         state->orig.in.secdesc_ctr = _secdesc_ctr;
   12498           0 :         state->orig.in.userlevel_ctr = _userlevel_ctr;
   12499             : 
   12500             :         /* Out parameters */
   12501           0 :         state->orig.out.handle = _handle;
   12502             : 
   12503             :         /* Result */
   12504           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   12505             : 
   12506           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   12507             :                              "dcerpc_spoolss_AddPrinterEx_out_memory");
   12508           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   12509           0 :                 return tevent_req_post(req, ev);
   12510             :         }
   12511             : 
   12512             :         /* make a temporary copy, that we pass to the dispatch function */
   12513           0 :         state->tmp = state->orig;
   12514             : 
   12515           0 :         subreq = dcerpc_spoolss_AddPrinterEx_r_send(state, ev, h, &state->tmp);
   12516           0 :         if (tevent_req_nomem(subreq, req)) {
   12517           0 :                 return tevent_req_post(req, ev);
   12518             :         }
   12519           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinterEx_done, req);
   12520           0 :         return req;
   12521             : }
   12522             : 
   12523           0 : static void dcerpc_spoolss_AddPrinterEx_done(struct tevent_req *subreq)
   12524             : {
   12525           0 :         struct tevent_req *req = tevent_req_callback_data(
   12526             :                 subreq, struct tevent_req);
   12527           0 :         struct dcerpc_spoolss_AddPrinterEx_state *state = tevent_req_data(
   12528             :                 req, struct dcerpc_spoolss_AddPrinterEx_state);
   12529           0 :         NTSTATUS status;
   12530           0 :         TALLOC_CTX *mem_ctx;
   12531             : 
   12532           0 :         if (state->out_mem_ctx) {
   12533           0 :                 mem_ctx = state->out_mem_ctx;
   12534             :         } else {
   12535           0 :                 mem_ctx = state;
   12536             :         }
   12537             : 
   12538           0 :         status = dcerpc_spoolss_AddPrinterEx_r_recv(subreq, mem_ctx);
   12539           0 :         TALLOC_FREE(subreq);
   12540           0 :         if (tevent_req_nterror(req, status)) {
   12541           0 :                 return;
   12542             :         }
   12543             : 
   12544             :         /* Copy out parameters */
   12545           0 :         *state->orig.out.handle = *state->tmp.out.handle;
   12546             : 
   12547             :         /* Copy result */
   12548           0 :         state->orig.out.result = state->tmp.out.result;
   12549             : 
   12550             :         /* Reset temporary structure */
   12551           0 :         NDR_ZERO_STRUCT(state->tmp);
   12552             : 
   12553           0 :         tevent_req_done(req);
   12554             : }
   12555             : 
   12556           0 : NTSTATUS dcerpc_spoolss_AddPrinterEx_recv(struct tevent_req *req,
   12557             :                                           TALLOC_CTX *mem_ctx,
   12558             :                                           WERROR *result)
   12559             : {
   12560           0 :         struct dcerpc_spoolss_AddPrinterEx_state *state = tevent_req_data(
   12561             :                 req, struct dcerpc_spoolss_AddPrinterEx_state);
   12562           0 :         NTSTATUS status;
   12563             : 
   12564           0 :         if (tevent_req_is_nterror(req, &status)) {
   12565           0 :                 tevent_req_received(req);
   12566           0 :                 return status;
   12567             :         }
   12568             : 
   12569             :         /* Steal possible out parameters to the callers context */
   12570           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12571             : 
   12572             :         /* Return result */
   12573           0 :         *result = state->orig.out.result;
   12574             : 
   12575           0 :         tevent_req_received(req);
   12576           0 :         return NT_STATUS_OK;
   12577             : }
   12578             : 
   12579           0 : NTSTATUS dcerpc_spoolss_AddPrinterEx(struct dcerpc_binding_handle *h,
   12580             :                                      TALLOC_CTX *mem_ctx,
   12581             :                                      const char *_server /* [in] [charset(UTF16),unique] */,
   12582             :                                      struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
   12583             :                                      struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
   12584             :                                      struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
   12585             :                                      struct spoolss_UserLevelCtr *_userlevel_ctr /* [in] [ref] */,
   12586             :                                      struct policy_handle *_handle /* [out] [ref] */,
   12587             :                                      WERROR *result)
   12588             : {
   12589           0 :         struct spoolss_AddPrinterEx r;
   12590           0 :         NTSTATUS status;
   12591             : 
   12592             :         /* In parameters */
   12593           0 :         r.in.server = _server;
   12594           0 :         r.in.info_ctr = _info_ctr;
   12595           0 :         r.in.devmode_ctr = _devmode_ctr;
   12596           0 :         r.in.secdesc_ctr = _secdesc_ctr;
   12597           0 :         r.in.userlevel_ctr = _userlevel_ctr;
   12598             : 
   12599             :         /* Out parameters */
   12600           0 :         r.out.handle = _handle;
   12601             : 
   12602             :         /* Result */
   12603           0 :         NDR_ZERO_STRUCT(r.out.result);
   12604             : 
   12605           0 :         status = dcerpc_spoolss_AddPrinterEx_r(h, mem_ctx, &r);
   12606           0 :         if (!NT_STATUS_IS_OK(status)) {
   12607           0 :                 return status;
   12608             :         }
   12609             : 
   12610             :         /* Return variables */
   12611           0 :         *_handle = *r.out.handle;
   12612             : 
   12613             :         /* Return result */
   12614           0 :         *result = r.out.result;
   12615             : 
   12616           0 :         return NT_STATUS_OK;
   12617             : }
   12618             : 
   12619             : struct dcerpc_spoolss_SetPort_r_state {
   12620             :         TALLOC_CTX *out_mem_ctx;
   12621             : };
   12622             : 
   12623             : static void dcerpc_spoolss_SetPort_r_done(struct tevent_req *subreq);
   12624             : 
   12625           0 : struct tevent_req *dcerpc_spoolss_SetPort_r_send(TALLOC_CTX *mem_ctx,
   12626             :         struct tevent_context *ev,
   12627             :         struct dcerpc_binding_handle *h,
   12628             :         struct spoolss_SetPort *r)
   12629             : {
   12630           0 :         struct tevent_req *req;
   12631           0 :         struct dcerpc_spoolss_SetPort_r_state *state;
   12632           0 :         struct tevent_req *subreq;
   12633             : 
   12634           0 :         req = tevent_req_create(mem_ctx, &state,
   12635             :                                 struct dcerpc_spoolss_SetPort_r_state);
   12636           0 :         if (req == NULL) {
   12637           0 :                 return NULL;
   12638             :         }
   12639             : 
   12640           0 :         state->out_mem_ctx = NULL;
   12641             : 
   12642           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   12643             :                         NULL, &ndr_table_spoolss,
   12644             :                         NDR_SPOOLSS_SETPORT, state, r);
   12645           0 :         if (tevent_req_nomem(subreq, req)) {
   12646           0 :                 return tevent_req_post(req, ev);
   12647             :         }
   12648           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_SetPort_r_done, req);
   12649             : 
   12650           0 :         return req;
   12651             : }
   12652             : 
   12653           0 : static void dcerpc_spoolss_SetPort_r_done(struct tevent_req *subreq)
   12654             : {
   12655           0 :         struct tevent_req *req =
   12656           0 :                 tevent_req_callback_data(subreq,
   12657             :                 struct tevent_req);
   12658           0 :         NTSTATUS status;
   12659             : 
   12660           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   12661           0 :         TALLOC_FREE(subreq);
   12662           0 :         if (tevent_req_nterror(req, status)) {
   12663           0 :                 return;
   12664             :         }
   12665             : 
   12666           0 :         tevent_req_done(req);
   12667             : }
   12668             : 
   12669           0 : NTSTATUS dcerpc_spoolss_SetPort_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   12670             : {
   12671           0 :         struct dcerpc_spoolss_SetPort_r_state *state =
   12672           0 :                 tevent_req_data(req,
   12673             :                 struct dcerpc_spoolss_SetPort_r_state);
   12674           0 :         NTSTATUS status;
   12675             : 
   12676           0 :         if (tevent_req_is_nterror(req, &status)) {
   12677           0 :                 tevent_req_received(req);
   12678           0 :                 return status;
   12679             :         }
   12680             : 
   12681           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12682             : 
   12683           0 :         tevent_req_received(req);
   12684           0 :         return NT_STATUS_OK;
   12685             : }
   12686             : 
   12687           0 : NTSTATUS dcerpc_spoolss_SetPort_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_SetPort *r)
   12688             : {
   12689           0 :         NTSTATUS status;
   12690             : 
   12691           0 :         status = dcerpc_binding_handle_call(h,
   12692             :                         NULL, &ndr_table_spoolss,
   12693             :                         NDR_SPOOLSS_SETPORT, mem_ctx, r);
   12694             : 
   12695           0 :         return status;
   12696             : }
   12697             : 
   12698             : struct dcerpc_spoolss_SetPort_state {
   12699             :         struct spoolss_SetPort orig;
   12700             :         struct spoolss_SetPort tmp;
   12701             :         TALLOC_CTX *out_mem_ctx;
   12702             : };
   12703             : 
   12704             : static void dcerpc_spoolss_SetPort_done(struct tevent_req *subreq);
   12705             : 
   12706           0 : struct tevent_req *dcerpc_spoolss_SetPort_send(TALLOC_CTX *mem_ctx,
   12707             :                                                struct tevent_context *ev,
   12708             :                                                struct dcerpc_binding_handle *h,
   12709             :                                                const char *_servername /* [in] [charset(UTF16),unique] */,
   12710             :                                                const char *_port_name /* [in] [charset(UTF16),unique] */,
   12711             :                                                struct spoolss_SetPortInfoContainer *_port_ctr /* [in] [ref] */)
   12712             : {
   12713           0 :         struct tevent_req *req;
   12714           0 :         struct dcerpc_spoolss_SetPort_state *state;
   12715           0 :         struct tevent_req *subreq;
   12716             : 
   12717           0 :         req = tevent_req_create(mem_ctx, &state,
   12718             :                                 struct dcerpc_spoolss_SetPort_state);
   12719           0 :         if (req == NULL) {
   12720           0 :                 return NULL;
   12721             :         }
   12722           0 :         state->out_mem_ctx = NULL;
   12723             : 
   12724             :         /* In parameters */
   12725           0 :         state->orig.in.servername = _servername;
   12726           0 :         state->orig.in.port_name = _port_name;
   12727           0 :         state->orig.in.port_ctr = _port_ctr;
   12728             : 
   12729             :         /* Out parameters */
   12730             : 
   12731             :         /* Result */
   12732           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   12733             : 
   12734             :         /* make a temporary copy, that we pass to the dispatch function */
   12735           0 :         state->tmp = state->orig;
   12736             : 
   12737           0 :         subreq = dcerpc_spoolss_SetPort_r_send(state, ev, h, &state->tmp);
   12738           0 :         if (tevent_req_nomem(subreq, req)) {
   12739           0 :                 return tevent_req_post(req, ev);
   12740             :         }
   12741           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_SetPort_done, req);
   12742           0 :         return req;
   12743             : }
   12744             : 
   12745           0 : static void dcerpc_spoolss_SetPort_done(struct tevent_req *subreq)
   12746             : {
   12747           0 :         struct tevent_req *req = tevent_req_callback_data(
   12748             :                 subreq, struct tevent_req);
   12749           0 :         struct dcerpc_spoolss_SetPort_state *state = tevent_req_data(
   12750             :                 req, struct dcerpc_spoolss_SetPort_state);
   12751           0 :         NTSTATUS status;
   12752           0 :         TALLOC_CTX *mem_ctx;
   12753             : 
   12754           0 :         if (state->out_mem_ctx) {
   12755           0 :                 mem_ctx = state->out_mem_ctx;
   12756             :         } else {
   12757           0 :                 mem_ctx = state;
   12758             :         }
   12759             : 
   12760           0 :         status = dcerpc_spoolss_SetPort_r_recv(subreq, mem_ctx);
   12761           0 :         TALLOC_FREE(subreq);
   12762           0 :         if (tevent_req_nterror(req, status)) {
   12763           0 :                 return;
   12764             :         }
   12765             : 
   12766             :         /* Copy out parameters */
   12767             : 
   12768             :         /* Copy result */
   12769           0 :         state->orig.out.result = state->tmp.out.result;
   12770             : 
   12771             :         /* Reset temporary structure */
   12772           0 :         NDR_ZERO_STRUCT(state->tmp);
   12773             : 
   12774           0 :         tevent_req_done(req);
   12775             : }
   12776             : 
   12777           0 : NTSTATUS dcerpc_spoolss_SetPort_recv(struct tevent_req *req,
   12778             :                                      TALLOC_CTX *mem_ctx,
   12779             :                                      WERROR *result)
   12780             : {
   12781           0 :         struct dcerpc_spoolss_SetPort_state *state = tevent_req_data(
   12782             :                 req, struct dcerpc_spoolss_SetPort_state);
   12783           0 :         NTSTATUS status;
   12784             : 
   12785           0 :         if (tevent_req_is_nterror(req, &status)) {
   12786           0 :                 tevent_req_received(req);
   12787           0 :                 return status;
   12788             :         }
   12789             : 
   12790             :         /* Steal possible out parameters to the callers context */
   12791           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12792             : 
   12793             :         /* Return result */
   12794           0 :         *result = state->orig.out.result;
   12795             : 
   12796           0 :         tevent_req_received(req);
   12797           0 :         return NT_STATUS_OK;
   12798             : }
   12799             : 
   12800           0 : NTSTATUS dcerpc_spoolss_SetPort(struct dcerpc_binding_handle *h,
   12801             :                                 TALLOC_CTX *mem_ctx,
   12802             :                                 const char *_servername /* [in] [charset(UTF16),unique] */,
   12803             :                                 const char *_port_name /* [in] [charset(UTF16),unique] */,
   12804             :                                 struct spoolss_SetPortInfoContainer *_port_ctr /* [in] [ref] */,
   12805             :                                 WERROR *result)
   12806             : {
   12807           0 :         struct spoolss_SetPort r;
   12808           0 :         NTSTATUS status;
   12809             : 
   12810             :         /* In parameters */
   12811           0 :         r.in.servername = _servername;
   12812           0 :         r.in.port_name = _port_name;
   12813           0 :         r.in.port_ctr = _port_ctr;
   12814             : 
   12815             :         /* Out parameters */
   12816             : 
   12817             :         /* Result */
   12818           0 :         NDR_ZERO_STRUCT(r.out.result);
   12819             : 
   12820           0 :         status = dcerpc_spoolss_SetPort_r(h, mem_ctx, &r);
   12821           0 :         if (!NT_STATUS_IS_OK(status)) {
   12822           0 :                 return status;
   12823             :         }
   12824             : 
   12825             :         /* Return variables */
   12826             : 
   12827             :         /* Return result */
   12828           0 :         *result = r.out.result;
   12829             : 
   12830           0 :         return NT_STATUS_OK;
   12831             : }
   12832             : 
   12833             : struct dcerpc_spoolss_EnumPrinterData_r_state {
   12834             :         TALLOC_CTX *out_mem_ctx;
   12835             : };
   12836             : 
   12837             : static void dcerpc_spoolss_EnumPrinterData_r_done(struct tevent_req *subreq);
   12838             : 
   12839           0 : struct tevent_req *dcerpc_spoolss_EnumPrinterData_r_send(TALLOC_CTX *mem_ctx,
   12840             :         struct tevent_context *ev,
   12841             :         struct dcerpc_binding_handle *h,
   12842             :         struct spoolss_EnumPrinterData *r)
   12843             : {
   12844           0 :         struct tevent_req *req;
   12845           0 :         struct dcerpc_spoolss_EnumPrinterData_r_state *state;
   12846           0 :         struct tevent_req *subreq;
   12847             : 
   12848           0 :         req = tevent_req_create(mem_ctx, &state,
   12849             :                                 struct dcerpc_spoolss_EnumPrinterData_r_state);
   12850           0 :         if (req == NULL) {
   12851           0 :                 return NULL;
   12852             :         }
   12853             : 
   12854           0 :         state->out_mem_ctx = talloc_new(state);
   12855           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   12856           0 :                 return tevent_req_post(req, ev);
   12857             :         }
   12858             : 
   12859           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   12860             :                         NULL, &ndr_table_spoolss,
   12861           0 :                         NDR_SPOOLSS_ENUMPRINTERDATA, state->out_mem_ctx, r);
   12862           0 :         if (tevent_req_nomem(subreq, req)) {
   12863           0 :                 return tevent_req_post(req, ev);
   12864             :         }
   12865           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterData_r_done, req);
   12866             : 
   12867           0 :         return req;
   12868             : }
   12869             : 
   12870           0 : static void dcerpc_spoolss_EnumPrinterData_r_done(struct tevent_req *subreq)
   12871             : {
   12872           0 :         struct tevent_req *req =
   12873           0 :                 tevent_req_callback_data(subreq,
   12874             :                 struct tevent_req);
   12875           0 :         NTSTATUS status;
   12876             : 
   12877           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   12878           0 :         TALLOC_FREE(subreq);
   12879           0 :         if (tevent_req_nterror(req, status)) {
   12880           0 :                 return;
   12881             :         }
   12882             : 
   12883           0 :         tevent_req_done(req);
   12884             : }
   12885             : 
   12886           0 : NTSTATUS dcerpc_spoolss_EnumPrinterData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   12887             : {
   12888           0 :         struct dcerpc_spoolss_EnumPrinterData_r_state *state =
   12889           0 :                 tevent_req_data(req,
   12890             :                 struct dcerpc_spoolss_EnumPrinterData_r_state);
   12891           0 :         NTSTATUS status;
   12892             : 
   12893           0 :         if (tevent_req_is_nterror(req, &status)) {
   12894           0 :                 tevent_req_received(req);
   12895           0 :                 return status;
   12896             :         }
   12897             : 
   12898           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   12899             : 
   12900           0 :         tevent_req_received(req);
   12901           0 :         return NT_STATUS_OK;
   12902             : }
   12903             : 
   12904         152 : NTSTATUS dcerpc_spoolss_EnumPrinterData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrinterData *r)
   12905             : {
   12906           0 :         NTSTATUS status;
   12907             : 
   12908         152 :         status = dcerpc_binding_handle_call(h,
   12909             :                         NULL, &ndr_table_spoolss,
   12910             :                         NDR_SPOOLSS_ENUMPRINTERDATA, mem_ctx, r);
   12911             : 
   12912         152 :         return status;
   12913             : }
   12914             : 
   12915             : struct dcerpc_spoolss_EnumPrinterData_state {
   12916             :         struct spoolss_EnumPrinterData orig;
   12917             :         struct spoolss_EnumPrinterData tmp;
   12918             :         TALLOC_CTX *out_mem_ctx;
   12919             : };
   12920             : 
   12921             : static void dcerpc_spoolss_EnumPrinterData_done(struct tevent_req *subreq);
   12922             : 
   12923           0 : struct tevent_req *dcerpc_spoolss_EnumPrinterData_send(TALLOC_CTX *mem_ctx,
   12924             :                                                        struct tevent_context *ev,
   12925             :                                                        struct dcerpc_binding_handle *h,
   12926             :                                                        struct policy_handle *_handle /* [in] [ref] */,
   12927             :                                                        uint32_t _enum_index /* [in]  */,
   12928             :                                                        const char *_value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
   12929             :                                                        uint32_t _value_offered /* [in]  */,
   12930             :                                                        uint32_t *_value_needed /* [out] [ref] */,
   12931             :                                                        enum winreg_Type *_type /* [out] [ref] */,
   12932             :                                                        uint8_t *_data /* [out] [flag(LIBNDR_PRINT_ARRAY_HEX),ref,size_is(data_offered)] */,
   12933             :                                                        uint32_t _data_offered /* [in]  */,
   12934             :                                                        uint32_t *_data_needed /* [out] [ref] */)
   12935             : {
   12936           0 :         struct tevent_req *req;
   12937           0 :         struct dcerpc_spoolss_EnumPrinterData_state *state;
   12938           0 :         struct tevent_req *subreq;
   12939             : 
   12940           0 :         req = tevent_req_create(mem_ctx, &state,
   12941             :                                 struct dcerpc_spoolss_EnumPrinterData_state);
   12942           0 :         if (req == NULL) {
   12943           0 :                 return NULL;
   12944             :         }
   12945           0 :         state->out_mem_ctx = NULL;
   12946             : 
   12947             :         /* In parameters */
   12948           0 :         state->orig.in.handle = _handle;
   12949           0 :         state->orig.in.enum_index = _enum_index;
   12950           0 :         state->orig.in.value_offered = _value_offered;
   12951           0 :         state->orig.in.data_offered = _data_offered;
   12952             : 
   12953             :         /* Out parameters */
   12954           0 :         state->orig.out.value_name = _value_name;
   12955           0 :         state->orig.out.value_needed = _value_needed;
   12956           0 :         state->orig.out.type = _type;
   12957           0 :         state->orig.out.data = _data;
   12958           0 :         state->orig.out.data_needed = _data_needed;
   12959             : 
   12960             :         /* Result */
   12961           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   12962             : 
   12963           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   12964             :                              "dcerpc_spoolss_EnumPrinterData_out_memory");
   12965           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   12966           0 :                 return tevent_req_post(req, ev);
   12967             :         }
   12968             : 
   12969             :         /* make a temporary copy, that we pass to the dispatch function */
   12970           0 :         state->tmp = state->orig;
   12971             : 
   12972           0 :         subreq = dcerpc_spoolss_EnumPrinterData_r_send(state, ev, h, &state->tmp);
   12973           0 :         if (tevent_req_nomem(subreq, req)) {
   12974           0 :                 return tevent_req_post(req, ev);
   12975             :         }
   12976           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterData_done, req);
   12977           0 :         return req;
   12978             : }
   12979             : 
   12980           0 : static void dcerpc_spoolss_EnumPrinterData_done(struct tevent_req *subreq)
   12981             : {
   12982           0 :         struct tevent_req *req = tevent_req_callback_data(
   12983             :                 subreq, struct tevent_req);
   12984           0 :         struct dcerpc_spoolss_EnumPrinterData_state *state = tevent_req_data(
   12985             :                 req, struct dcerpc_spoolss_EnumPrinterData_state);
   12986           0 :         NTSTATUS status;
   12987           0 :         TALLOC_CTX *mem_ctx;
   12988             : 
   12989           0 :         if (state->out_mem_ctx) {
   12990           0 :                 mem_ctx = state->out_mem_ctx;
   12991             :         } else {
   12992           0 :                 mem_ctx = state;
   12993             :         }
   12994             : 
   12995           0 :         status = dcerpc_spoolss_EnumPrinterData_r_recv(subreq, mem_ctx);
   12996           0 :         TALLOC_FREE(subreq);
   12997           0 :         if (tevent_req_nterror(req, status)) {
   12998           0 :                 return;
   12999             :         }
   13000             : 
   13001             :         /* Copy out parameters */
   13002             :         {
   13003           0 :                 size_t _copy_len_value_name;
   13004           0 :                 _copy_len_value_name = ndr_charset_length(state->tmp.out.value_name, CH_UNIX);
   13005           0 :                 if (_copy_len_value_name > state->tmp.in.value_offered / 2) {
   13006           0 :                         tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
   13007           0 :                         return;
   13008             :                 }
   13009           0 :                 if (state->orig.out.value_name != state->tmp.out.value_name) {
   13010           0 :                         memcpy(discard_const_p(uint8_t *, state->orig.out.value_name), state->tmp.out.value_name, _copy_len_value_name * sizeof(*state->orig.out.value_name));
   13011             :                 }
   13012             :         }
   13013           0 :         *state->orig.out.value_needed = *state->tmp.out.value_needed;
   13014           0 :         *state->orig.out.type = *state->tmp.out.type;
   13015             :         {
   13016           0 :                 size_t _copy_len_data;
   13017           0 :                 _copy_len_data = state->tmp.in.data_offered;
   13018           0 :                 if (state->orig.out.data != state->tmp.out.data) {
   13019           0 :                         memcpy(state->orig.out.data, state->tmp.out.data, _copy_len_data * sizeof(*state->orig.out.data));
   13020             :                 }
   13021             :         }
   13022           0 :         *state->orig.out.data_needed = *state->tmp.out.data_needed;
   13023             : 
   13024             :         /* Copy result */
   13025           0 :         state->orig.out.result = state->tmp.out.result;
   13026             : 
   13027             :         /* Reset temporary structure */
   13028           0 :         NDR_ZERO_STRUCT(state->tmp);
   13029             : 
   13030           0 :         tevent_req_done(req);
   13031             : }
   13032             : 
   13033           0 : NTSTATUS dcerpc_spoolss_EnumPrinterData_recv(struct tevent_req *req,
   13034             :                                              TALLOC_CTX *mem_ctx,
   13035             :                                              WERROR *result)
   13036             : {
   13037           0 :         struct dcerpc_spoolss_EnumPrinterData_state *state = tevent_req_data(
   13038             :                 req, struct dcerpc_spoolss_EnumPrinterData_state);
   13039           0 :         NTSTATUS status;
   13040             : 
   13041           0 :         if (tevent_req_is_nterror(req, &status)) {
   13042           0 :                 tevent_req_received(req);
   13043           0 :                 return status;
   13044             :         }
   13045             : 
   13046             :         /* Steal possible out parameters to the callers context */
   13047           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13048             : 
   13049             :         /* Return result */
   13050           0 :         *result = state->orig.out.result;
   13051             : 
   13052           0 :         tevent_req_received(req);
   13053           0 :         return NT_STATUS_OK;
   13054             : }
   13055             : 
   13056           0 : NTSTATUS dcerpc_spoolss_EnumPrinterData(struct dcerpc_binding_handle *h,
   13057             :                                         TALLOC_CTX *mem_ctx,
   13058             :                                         struct policy_handle *_handle /* [in] [ref] */,
   13059             :                                         uint32_t _enum_index /* [in]  */,
   13060             :                                         const char *_value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
   13061             :                                         uint32_t _value_offered /* [in]  */,
   13062             :                                         uint32_t *_value_needed /* [out] [ref] */,
   13063             :                                         enum winreg_Type *_type /* [out] [ref] */,
   13064             :                                         uint8_t *_data /* [out] [flag(LIBNDR_PRINT_ARRAY_HEX),ref,size_is(data_offered)] */,
   13065             :                                         uint32_t _data_offered /* [in]  */,
   13066             :                                         uint32_t *_data_needed /* [out] [ref] */,
   13067             :                                         WERROR *result)
   13068             : {
   13069           0 :         struct spoolss_EnumPrinterData r;
   13070           0 :         NTSTATUS status;
   13071             : 
   13072             :         /* In parameters */
   13073           0 :         r.in.handle = _handle;
   13074           0 :         r.in.enum_index = _enum_index;
   13075           0 :         r.in.value_offered = _value_offered;
   13076           0 :         r.in.data_offered = _data_offered;
   13077             : 
   13078             :         /* Out parameters */
   13079           0 :         r.out.value_name = _value_name;
   13080           0 :         r.out.value_needed = _value_needed;
   13081           0 :         r.out.type = _type;
   13082           0 :         r.out.data = _data;
   13083           0 :         r.out.data_needed = _data_needed;
   13084             : 
   13085             :         /* Result */
   13086           0 :         NDR_ZERO_STRUCT(r.out.result);
   13087             : 
   13088           0 :         status = dcerpc_spoolss_EnumPrinterData_r(h, mem_ctx, &r);
   13089           0 :         if (!NT_STATUS_IS_OK(status)) {
   13090           0 :                 return status;
   13091             :         }
   13092             : 
   13093             :         /* Return variables */
   13094             :         {
   13095           0 :                 size_t _copy_len_value_name;
   13096           0 :                 _copy_len_value_name = ndr_charset_length(r.out.value_name, CH_UNIX);
   13097           0 :                 if (_copy_len_value_name > r.in.value_offered / 2) {
   13098           0 :                         return NT_STATUS_INVALID_NETWORK_RESPONSE;
   13099             :                 }
   13100           0 :                 if (_value_name != r.out.value_name) {
   13101           0 :                         memcpy(discard_const_p(uint8_t *, _value_name), r.out.value_name, _copy_len_value_name * sizeof(*_value_name));
   13102             :                 }
   13103             :         }
   13104           0 :         *_value_needed = *r.out.value_needed;
   13105           0 :         *_type = *r.out.type;
   13106             :         {
   13107           0 :                 size_t _copy_len_data;
   13108           0 :                 _copy_len_data = r.in.data_offered;
   13109           0 :                 if (_data != r.out.data) {
   13110           0 :                         memcpy(_data, r.out.data, _copy_len_data * sizeof(*_data));
   13111             :                 }
   13112             :         }
   13113           0 :         *_data_needed = *r.out.data_needed;
   13114             : 
   13115             :         /* Return result */
   13116           0 :         *result = r.out.result;
   13117             : 
   13118           0 :         return NT_STATUS_OK;
   13119             : }
   13120             : 
   13121             : struct dcerpc_spoolss_DeletePrinterData_r_state {
   13122             :         TALLOC_CTX *out_mem_ctx;
   13123             : };
   13124             : 
   13125             : static void dcerpc_spoolss_DeletePrinterData_r_done(struct tevent_req *subreq);
   13126             : 
   13127           0 : struct tevent_req *dcerpc_spoolss_DeletePrinterData_r_send(TALLOC_CTX *mem_ctx,
   13128             :         struct tevent_context *ev,
   13129             :         struct dcerpc_binding_handle *h,
   13130             :         struct spoolss_DeletePrinterData *r)
   13131             : {
   13132           0 :         struct tevent_req *req;
   13133           0 :         struct dcerpc_spoolss_DeletePrinterData_r_state *state;
   13134           0 :         struct tevent_req *subreq;
   13135             : 
   13136           0 :         req = tevent_req_create(mem_ctx, &state,
   13137             :                                 struct dcerpc_spoolss_DeletePrinterData_r_state);
   13138           0 :         if (req == NULL) {
   13139           0 :                 return NULL;
   13140             :         }
   13141             : 
   13142           0 :         state->out_mem_ctx = NULL;
   13143             : 
   13144           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   13145             :                         NULL, &ndr_table_spoolss,
   13146             :                         NDR_SPOOLSS_DELETEPRINTERDATA, state, r);
   13147           0 :         if (tevent_req_nomem(subreq, req)) {
   13148           0 :                 return tevent_req_post(req, ev);
   13149             :         }
   13150           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterData_r_done, req);
   13151             : 
   13152           0 :         return req;
   13153             : }
   13154             : 
   13155           0 : static void dcerpc_spoolss_DeletePrinterData_r_done(struct tevent_req *subreq)
   13156             : {
   13157           0 :         struct tevent_req *req =
   13158           0 :                 tevent_req_callback_data(subreq,
   13159             :                 struct tevent_req);
   13160           0 :         NTSTATUS status;
   13161             : 
   13162           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   13163           0 :         TALLOC_FREE(subreq);
   13164           0 :         if (tevent_req_nterror(req, status)) {
   13165           0 :                 return;
   13166             :         }
   13167             : 
   13168           0 :         tevent_req_done(req);
   13169             : }
   13170             : 
   13171           0 : NTSTATUS dcerpc_spoolss_DeletePrinterData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   13172             : {
   13173           0 :         struct dcerpc_spoolss_DeletePrinterData_r_state *state =
   13174           0 :                 tevent_req_data(req,
   13175             :                 struct dcerpc_spoolss_DeletePrinterData_r_state);
   13176           0 :         NTSTATUS status;
   13177             : 
   13178           0 :         if (tevent_req_is_nterror(req, &status)) {
   13179           0 :                 tevent_req_received(req);
   13180           0 :                 return status;
   13181             :         }
   13182             : 
   13183           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13184             : 
   13185           0 :         tevent_req_received(req);
   13186           0 :         return NT_STATUS_OK;
   13187             : }
   13188             : 
   13189         168 : NTSTATUS dcerpc_spoolss_DeletePrinterData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinterData *r)
   13190             : {
   13191           0 :         NTSTATUS status;
   13192             : 
   13193         168 :         status = dcerpc_binding_handle_call(h,
   13194             :                         NULL, &ndr_table_spoolss,
   13195             :                         NDR_SPOOLSS_DELETEPRINTERDATA, mem_ctx, r);
   13196             : 
   13197         168 :         return status;
   13198             : }
   13199             : 
   13200             : struct dcerpc_spoolss_DeletePrinterData_state {
   13201             :         struct spoolss_DeletePrinterData orig;
   13202             :         struct spoolss_DeletePrinterData tmp;
   13203             :         TALLOC_CTX *out_mem_ctx;
   13204             : };
   13205             : 
   13206             : static void dcerpc_spoolss_DeletePrinterData_done(struct tevent_req *subreq);
   13207             : 
   13208           0 : struct tevent_req *dcerpc_spoolss_DeletePrinterData_send(TALLOC_CTX *mem_ctx,
   13209             :                                                          struct tevent_context *ev,
   13210             :                                                          struct dcerpc_binding_handle *h,
   13211             :                                                          struct policy_handle *_handle /* [in] [ref] */,
   13212             :                                                          const char *_value_name /* [in] [charset(UTF16)] */)
   13213             : {
   13214           0 :         struct tevent_req *req;
   13215           0 :         struct dcerpc_spoolss_DeletePrinterData_state *state;
   13216           0 :         struct tevent_req *subreq;
   13217             : 
   13218           0 :         req = tevent_req_create(mem_ctx, &state,
   13219             :                                 struct dcerpc_spoolss_DeletePrinterData_state);
   13220           0 :         if (req == NULL) {
   13221           0 :                 return NULL;
   13222             :         }
   13223           0 :         state->out_mem_ctx = NULL;
   13224             : 
   13225             :         /* In parameters */
   13226           0 :         state->orig.in.handle = _handle;
   13227           0 :         state->orig.in.value_name = _value_name;
   13228             : 
   13229             :         /* Out parameters */
   13230             : 
   13231             :         /* Result */
   13232           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   13233             : 
   13234             :         /* make a temporary copy, that we pass to the dispatch function */
   13235           0 :         state->tmp = state->orig;
   13236             : 
   13237           0 :         subreq = dcerpc_spoolss_DeletePrinterData_r_send(state, ev, h, &state->tmp);
   13238           0 :         if (tevent_req_nomem(subreq, req)) {
   13239           0 :                 return tevent_req_post(req, ev);
   13240             :         }
   13241           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterData_done, req);
   13242           0 :         return req;
   13243             : }
   13244             : 
   13245           0 : static void dcerpc_spoolss_DeletePrinterData_done(struct tevent_req *subreq)
   13246             : {
   13247           0 :         struct tevent_req *req = tevent_req_callback_data(
   13248             :                 subreq, struct tevent_req);
   13249           0 :         struct dcerpc_spoolss_DeletePrinterData_state *state = tevent_req_data(
   13250             :                 req, struct dcerpc_spoolss_DeletePrinterData_state);
   13251           0 :         NTSTATUS status;
   13252           0 :         TALLOC_CTX *mem_ctx;
   13253             : 
   13254           0 :         if (state->out_mem_ctx) {
   13255           0 :                 mem_ctx = state->out_mem_ctx;
   13256             :         } else {
   13257           0 :                 mem_ctx = state;
   13258             :         }
   13259             : 
   13260           0 :         status = dcerpc_spoolss_DeletePrinterData_r_recv(subreq, mem_ctx);
   13261           0 :         TALLOC_FREE(subreq);
   13262           0 :         if (tevent_req_nterror(req, status)) {
   13263           0 :                 return;
   13264             :         }
   13265             : 
   13266             :         /* Copy out parameters */
   13267             : 
   13268             :         /* Copy result */
   13269           0 :         state->orig.out.result = state->tmp.out.result;
   13270             : 
   13271             :         /* Reset temporary structure */
   13272           0 :         NDR_ZERO_STRUCT(state->tmp);
   13273             : 
   13274           0 :         tevent_req_done(req);
   13275             : }
   13276             : 
   13277           0 : NTSTATUS dcerpc_spoolss_DeletePrinterData_recv(struct tevent_req *req,
   13278             :                                                TALLOC_CTX *mem_ctx,
   13279             :                                                WERROR *result)
   13280             : {
   13281           0 :         struct dcerpc_spoolss_DeletePrinterData_state *state = tevent_req_data(
   13282             :                 req, struct dcerpc_spoolss_DeletePrinterData_state);
   13283           0 :         NTSTATUS status;
   13284             : 
   13285           0 :         if (tevent_req_is_nterror(req, &status)) {
   13286           0 :                 tevent_req_received(req);
   13287           0 :                 return status;
   13288             :         }
   13289             : 
   13290             :         /* Steal possible out parameters to the callers context */
   13291           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13292             : 
   13293             :         /* Return result */
   13294           0 :         *result = state->orig.out.result;
   13295             : 
   13296           0 :         tevent_req_received(req);
   13297           0 :         return NT_STATUS_OK;
   13298             : }
   13299             : 
   13300           0 : NTSTATUS dcerpc_spoolss_DeletePrinterData(struct dcerpc_binding_handle *h,
   13301             :                                           TALLOC_CTX *mem_ctx,
   13302             :                                           struct policy_handle *_handle /* [in] [ref] */,
   13303             :                                           const char *_value_name /* [in] [charset(UTF16)] */,
   13304             :                                           WERROR *result)
   13305             : {
   13306           0 :         struct spoolss_DeletePrinterData r;
   13307           0 :         NTSTATUS status;
   13308             : 
   13309             :         /* In parameters */
   13310           0 :         r.in.handle = _handle;
   13311           0 :         r.in.value_name = _value_name;
   13312             : 
   13313             :         /* Out parameters */
   13314             : 
   13315             :         /* Result */
   13316           0 :         NDR_ZERO_STRUCT(r.out.result);
   13317             : 
   13318           0 :         status = dcerpc_spoolss_DeletePrinterData_r(h, mem_ctx, &r);
   13319           0 :         if (!NT_STATUS_IS_OK(status)) {
   13320           0 :                 return status;
   13321             :         }
   13322             : 
   13323             :         /* Return variables */
   13324             : 
   13325             :         /* Return result */
   13326           0 :         *result = r.out.result;
   13327             : 
   13328           0 :         return NT_STATUS_OK;
   13329             : }
   13330             : 
   13331             : struct dcerpc_spoolss_SetPrinterDataEx_r_state {
   13332             :         TALLOC_CTX *out_mem_ctx;
   13333             : };
   13334             : 
   13335             : static void dcerpc_spoolss_SetPrinterDataEx_r_done(struct tevent_req *subreq);
   13336             : 
   13337           0 : struct tevent_req *dcerpc_spoolss_SetPrinterDataEx_r_send(TALLOC_CTX *mem_ctx,
   13338             :         struct tevent_context *ev,
   13339             :         struct dcerpc_binding_handle *h,
   13340             :         struct spoolss_SetPrinterDataEx *r)
   13341             : {
   13342           0 :         struct tevent_req *req;
   13343           0 :         struct dcerpc_spoolss_SetPrinterDataEx_r_state *state;
   13344           0 :         struct tevent_req *subreq;
   13345             : 
   13346           0 :         req = tevent_req_create(mem_ctx, &state,
   13347             :                                 struct dcerpc_spoolss_SetPrinterDataEx_r_state);
   13348           0 :         if (req == NULL) {
   13349           0 :                 return NULL;
   13350             :         }
   13351             : 
   13352           0 :         state->out_mem_ctx = NULL;
   13353             : 
   13354           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   13355             :                         NULL, &ndr_table_spoolss,
   13356             :                         NDR_SPOOLSS_SETPRINTERDATAEX, state, r);
   13357           0 :         if (tevent_req_nomem(subreq, req)) {
   13358           0 :                 return tevent_req_post(req, ev);
   13359             :         }
   13360           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_SetPrinterDataEx_r_done, req);
   13361             : 
   13362           0 :         return req;
   13363             : }
   13364             : 
   13365           0 : static void dcerpc_spoolss_SetPrinterDataEx_r_done(struct tevent_req *subreq)
   13366             : {
   13367           0 :         struct tevent_req *req =
   13368           0 :                 tevent_req_callback_data(subreq,
   13369             :                 struct tevent_req);
   13370           0 :         NTSTATUS status;
   13371             : 
   13372           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   13373           0 :         TALLOC_FREE(subreq);
   13374           0 :         if (tevent_req_nterror(req, status)) {
   13375           0 :                 return;
   13376             :         }
   13377             : 
   13378           0 :         tevent_req_done(req);
   13379             : }
   13380             : 
   13381           0 : NTSTATUS dcerpc_spoolss_SetPrinterDataEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   13382             : {
   13383           0 :         struct dcerpc_spoolss_SetPrinterDataEx_r_state *state =
   13384           0 :                 tevent_req_data(req,
   13385             :                 struct dcerpc_spoolss_SetPrinterDataEx_r_state);
   13386           0 :         NTSTATUS status;
   13387             : 
   13388           0 :         if (tevent_req_is_nterror(req, &status)) {
   13389           0 :                 tevent_req_received(req);
   13390           0 :                 return status;
   13391             :         }
   13392             : 
   13393           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13394             : 
   13395           0 :         tevent_req_received(req);
   13396           0 :         return NT_STATUS_OK;
   13397             : }
   13398             : 
   13399        1200 : NTSTATUS dcerpc_spoolss_SetPrinterDataEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_SetPrinterDataEx *r)
   13400             : {
   13401           0 :         NTSTATUS status;
   13402             : 
   13403        1200 :         status = dcerpc_binding_handle_call(h,
   13404             :                         NULL, &ndr_table_spoolss,
   13405             :                         NDR_SPOOLSS_SETPRINTERDATAEX, mem_ctx, r);
   13406             : 
   13407        1200 :         return status;
   13408             : }
   13409             : 
   13410             : struct dcerpc_spoolss_SetPrinterDataEx_state {
   13411             :         struct spoolss_SetPrinterDataEx orig;
   13412             :         struct spoolss_SetPrinterDataEx tmp;
   13413             :         TALLOC_CTX *out_mem_ctx;
   13414             : };
   13415             : 
   13416             : static void dcerpc_spoolss_SetPrinterDataEx_done(struct tevent_req *subreq);
   13417             : 
   13418           0 : struct tevent_req *dcerpc_spoolss_SetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
   13419             :                                                         struct tevent_context *ev,
   13420             :                                                         struct dcerpc_binding_handle *h,
   13421             :                                                         struct policy_handle *_handle /* [in] [ref] */,
   13422             :                                                         const char *_key_name /* [in] [charset(UTF16)] */,
   13423             :                                                         const char *_value_name /* [in] [charset(UTF16)] */,
   13424             :                                                         enum winreg_Type _type /* [in]  */,
   13425             :                                                         uint8_t *_data /* [in] [ref,size_is(offered)] */,
   13426             :                                                         uint32_t _offered /* [in]  */)
   13427             : {
   13428           0 :         struct tevent_req *req;
   13429           0 :         struct dcerpc_spoolss_SetPrinterDataEx_state *state;
   13430           0 :         struct tevent_req *subreq;
   13431             : 
   13432           0 :         req = tevent_req_create(mem_ctx, &state,
   13433             :                                 struct dcerpc_spoolss_SetPrinterDataEx_state);
   13434           0 :         if (req == NULL) {
   13435           0 :                 return NULL;
   13436             :         }
   13437           0 :         state->out_mem_ctx = NULL;
   13438             : 
   13439             :         /* In parameters */
   13440           0 :         state->orig.in.handle = _handle;
   13441           0 :         state->orig.in.key_name = _key_name;
   13442           0 :         state->orig.in.value_name = _value_name;
   13443           0 :         state->orig.in.type = _type;
   13444           0 :         state->orig.in.data = _data;
   13445           0 :         state->orig.in.offered = _offered;
   13446             : 
   13447             :         /* Out parameters */
   13448             : 
   13449             :         /* Result */
   13450           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   13451             : 
   13452             :         /* make a temporary copy, that we pass to the dispatch function */
   13453           0 :         state->tmp = state->orig;
   13454             : 
   13455           0 :         subreq = dcerpc_spoolss_SetPrinterDataEx_r_send(state, ev, h, &state->tmp);
   13456           0 :         if (tevent_req_nomem(subreq, req)) {
   13457           0 :                 return tevent_req_post(req, ev);
   13458             :         }
   13459           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_SetPrinterDataEx_done, req);
   13460           0 :         return req;
   13461             : }
   13462             : 
   13463           0 : static void dcerpc_spoolss_SetPrinterDataEx_done(struct tevent_req *subreq)
   13464             : {
   13465           0 :         struct tevent_req *req = tevent_req_callback_data(
   13466             :                 subreq, struct tevent_req);
   13467           0 :         struct dcerpc_spoolss_SetPrinterDataEx_state *state = tevent_req_data(
   13468             :                 req, struct dcerpc_spoolss_SetPrinterDataEx_state);
   13469           0 :         NTSTATUS status;
   13470           0 :         TALLOC_CTX *mem_ctx;
   13471             : 
   13472           0 :         if (state->out_mem_ctx) {
   13473           0 :                 mem_ctx = state->out_mem_ctx;
   13474             :         } else {
   13475           0 :                 mem_ctx = state;
   13476             :         }
   13477             : 
   13478           0 :         status = dcerpc_spoolss_SetPrinterDataEx_r_recv(subreq, mem_ctx);
   13479           0 :         TALLOC_FREE(subreq);
   13480           0 :         if (tevent_req_nterror(req, status)) {
   13481           0 :                 return;
   13482             :         }
   13483             : 
   13484             :         /* Copy out parameters */
   13485             : 
   13486             :         /* Copy result */
   13487           0 :         state->orig.out.result = state->tmp.out.result;
   13488             : 
   13489             :         /* Reset temporary structure */
   13490           0 :         NDR_ZERO_STRUCT(state->tmp);
   13491             : 
   13492           0 :         tevent_req_done(req);
   13493             : }
   13494             : 
   13495           0 : NTSTATUS dcerpc_spoolss_SetPrinterDataEx_recv(struct tevent_req *req,
   13496             :                                               TALLOC_CTX *mem_ctx,
   13497             :                                               WERROR *result)
   13498             : {
   13499           0 :         struct dcerpc_spoolss_SetPrinterDataEx_state *state = tevent_req_data(
   13500             :                 req, struct dcerpc_spoolss_SetPrinterDataEx_state);
   13501           0 :         NTSTATUS status;
   13502             : 
   13503           0 :         if (tevent_req_is_nterror(req, &status)) {
   13504           0 :                 tevent_req_received(req);
   13505           0 :                 return status;
   13506             :         }
   13507             : 
   13508             :         /* Steal possible out parameters to the callers context */
   13509           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13510             : 
   13511             :         /* Return result */
   13512           0 :         *result = state->orig.out.result;
   13513             : 
   13514           0 :         tevent_req_received(req);
   13515           0 :         return NT_STATUS_OK;
   13516             : }
   13517             : 
   13518           0 : NTSTATUS dcerpc_spoolss_SetPrinterDataEx(struct dcerpc_binding_handle *h,
   13519             :                                          TALLOC_CTX *mem_ctx,
   13520             :                                          struct policy_handle *_handle /* [in] [ref] */,
   13521             :                                          const char *_key_name /* [in] [charset(UTF16)] */,
   13522             :                                          const char *_value_name /* [in] [charset(UTF16)] */,
   13523             :                                          enum winreg_Type _type /* [in]  */,
   13524             :                                          uint8_t *_data /* [in] [ref,size_is(offered)] */,
   13525             :                                          uint32_t _offered /* [in]  */,
   13526             :                                          WERROR *result)
   13527             : {
   13528           0 :         struct spoolss_SetPrinterDataEx r;
   13529           0 :         NTSTATUS status;
   13530             : 
   13531             :         /* In parameters */
   13532           0 :         r.in.handle = _handle;
   13533           0 :         r.in.key_name = _key_name;
   13534           0 :         r.in.value_name = _value_name;
   13535           0 :         r.in.type = _type;
   13536           0 :         r.in.data = _data;
   13537           0 :         r.in.offered = _offered;
   13538             : 
   13539             :         /* Out parameters */
   13540             : 
   13541             :         /* Result */
   13542           0 :         NDR_ZERO_STRUCT(r.out.result);
   13543             : 
   13544           0 :         status = dcerpc_spoolss_SetPrinterDataEx_r(h, mem_ctx, &r);
   13545           0 :         if (!NT_STATUS_IS_OK(status)) {
   13546           0 :                 return status;
   13547             :         }
   13548             : 
   13549             :         /* Return variables */
   13550             : 
   13551             :         /* Return result */
   13552           0 :         *result = r.out.result;
   13553             : 
   13554           0 :         return NT_STATUS_OK;
   13555             : }
   13556             : 
   13557             : struct dcerpc_spoolss_GetPrinterDataEx_r_state {
   13558             :         TALLOC_CTX *out_mem_ctx;
   13559             : };
   13560             : 
   13561             : static void dcerpc_spoolss_GetPrinterDataEx_r_done(struct tevent_req *subreq);
   13562             : 
   13563           0 : struct tevent_req *dcerpc_spoolss_GetPrinterDataEx_r_send(TALLOC_CTX *mem_ctx,
   13564             :         struct tevent_context *ev,
   13565             :         struct dcerpc_binding_handle *h,
   13566             :         struct spoolss_GetPrinterDataEx *r)
   13567             : {
   13568           0 :         struct tevent_req *req;
   13569           0 :         struct dcerpc_spoolss_GetPrinterDataEx_r_state *state;
   13570           0 :         struct tevent_req *subreq;
   13571             : 
   13572           0 :         req = tevent_req_create(mem_ctx, &state,
   13573             :                                 struct dcerpc_spoolss_GetPrinterDataEx_r_state);
   13574           0 :         if (req == NULL) {
   13575           0 :                 return NULL;
   13576             :         }
   13577             : 
   13578           0 :         state->out_mem_ctx = talloc_new(state);
   13579           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   13580           0 :                 return tevent_req_post(req, ev);
   13581             :         }
   13582             : 
   13583           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   13584             :                         NULL, &ndr_table_spoolss,
   13585           0 :                         NDR_SPOOLSS_GETPRINTERDATAEX, state->out_mem_ctx, r);
   13586           0 :         if (tevent_req_nomem(subreq, req)) {
   13587           0 :                 return tevent_req_post(req, ev);
   13588             :         }
   13589           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDataEx_r_done, req);
   13590             : 
   13591           0 :         return req;
   13592             : }
   13593             : 
   13594           0 : static void dcerpc_spoolss_GetPrinterDataEx_r_done(struct tevent_req *subreq)
   13595             : {
   13596           0 :         struct tevent_req *req =
   13597           0 :                 tevent_req_callback_data(subreq,
   13598             :                 struct tevent_req);
   13599           0 :         NTSTATUS status;
   13600             : 
   13601           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   13602           0 :         TALLOC_FREE(subreq);
   13603           0 :         if (tevent_req_nterror(req, status)) {
   13604           0 :                 return;
   13605             :         }
   13606             : 
   13607           0 :         tevent_req_done(req);
   13608             : }
   13609             : 
   13610           0 : NTSTATUS dcerpc_spoolss_GetPrinterDataEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   13611             : {
   13612           0 :         struct dcerpc_spoolss_GetPrinterDataEx_r_state *state =
   13613           0 :                 tevent_req_data(req,
   13614             :                 struct dcerpc_spoolss_GetPrinterDataEx_r_state);
   13615           0 :         NTSTATUS status;
   13616             : 
   13617           0 :         if (tevent_req_is_nterror(req, &status)) {
   13618           0 :                 tevent_req_received(req);
   13619           0 :                 return status;
   13620             :         }
   13621             : 
   13622           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13623             : 
   13624           0 :         tevent_req_received(req);
   13625           0 :         return NT_STATUS_OK;
   13626             : }
   13627             : 
   13628        2700 : NTSTATUS dcerpc_spoolss_GetPrinterDataEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetPrinterDataEx *r)
   13629             : {
   13630           0 :         NTSTATUS status;
   13631             : 
   13632        2700 :         status = dcerpc_binding_handle_call(h,
   13633             :                         NULL, &ndr_table_spoolss,
   13634             :                         NDR_SPOOLSS_GETPRINTERDATAEX, mem_ctx, r);
   13635             : 
   13636        2700 :         return status;
   13637             : }
   13638             : 
   13639             : struct dcerpc_spoolss_GetPrinterDataEx_state {
   13640             :         struct spoolss_GetPrinterDataEx orig;
   13641             :         struct spoolss_GetPrinterDataEx tmp;
   13642             :         TALLOC_CTX *out_mem_ctx;
   13643             : };
   13644             : 
   13645             : static void dcerpc_spoolss_GetPrinterDataEx_done(struct tevent_req *subreq);
   13646             : 
   13647           0 : struct tevent_req *dcerpc_spoolss_GetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
   13648             :                                                         struct tevent_context *ev,
   13649             :                                                         struct dcerpc_binding_handle *h,
   13650             :                                                         struct policy_handle *_handle /* [in] [ref] */,
   13651             :                                                         const char *_key_name /* [in] [charset(UTF16)] */,
   13652             :                                                         const char *_value_name /* [in] [charset(UTF16)] */,
   13653             :                                                         enum winreg_Type *_type /* [out] [ref] */,
   13654             :                                                         uint8_t *_data /* [out] [ref,size_is(offered)] */,
   13655             :                                                         uint32_t _offered /* [in]  */,
   13656             :                                                         uint32_t *_needed /* [out] [ref] */)
   13657             : {
   13658           0 :         struct tevent_req *req;
   13659           0 :         struct dcerpc_spoolss_GetPrinterDataEx_state *state;
   13660           0 :         struct tevent_req *subreq;
   13661             : 
   13662           0 :         req = tevent_req_create(mem_ctx, &state,
   13663             :                                 struct dcerpc_spoolss_GetPrinterDataEx_state);
   13664           0 :         if (req == NULL) {
   13665           0 :                 return NULL;
   13666             :         }
   13667           0 :         state->out_mem_ctx = NULL;
   13668             : 
   13669             :         /* In parameters */
   13670           0 :         state->orig.in.handle = _handle;
   13671           0 :         state->orig.in.key_name = _key_name;
   13672           0 :         state->orig.in.value_name = _value_name;
   13673           0 :         state->orig.in.offered = _offered;
   13674             : 
   13675             :         /* Out parameters */
   13676           0 :         state->orig.out.type = _type;
   13677           0 :         state->orig.out.data = _data;
   13678           0 :         state->orig.out.needed = _needed;
   13679             : 
   13680             :         /* Result */
   13681           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   13682             : 
   13683           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   13684             :                              "dcerpc_spoolss_GetPrinterDataEx_out_memory");
   13685           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   13686           0 :                 return tevent_req_post(req, ev);
   13687             :         }
   13688             : 
   13689             :         /* make a temporary copy, that we pass to the dispatch function */
   13690           0 :         state->tmp = state->orig;
   13691             : 
   13692           0 :         subreq = dcerpc_spoolss_GetPrinterDataEx_r_send(state, ev, h, &state->tmp);
   13693           0 :         if (tevent_req_nomem(subreq, req)) {
   13694           0 :                 return tevent_req_post(req, ev);
   13695             :         }
   13696           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDataEx_done, req);
   13697           0 :         return req;
   13698             : }
   13699             : 
   13700           0 : static void dcerpc_spoolss_GetPrinterDataEx_done(struct tevent_req *subreq)
   13701             : {
   13702           0 :         struct tevent_req *req = tevent_req_callback_data(
   13703             :                 subreq, struct tevent_req);
   13704           0 :         struct dcerpc_spoolss_GetPrinterDataEx_state *state = tevent_req_data(
   13705             :                 req, struct dcerpc_spoolss_GetPrinterDataEx_state);
   13706           0 :         NTSTATUS status;
   13707           0 :         TALLOC_CTX *mem_ctx;
   13708             : 
   13709           0 :         if (state->out_mem_ctx) {
   13710           0 :                 mem_ctx = state->out_mem_ctx;
   13711             :         } else {
   13712           0 :                 mem_ctx = state;
   13713             :         }
   13714             : 
   13715           0 :         status = dcerpc_spoolss_GetPrinterDataEx_r_recv(subreq, mem_ctx);
   13716           0 :         TALLOC_FREE(subreq);
   13717           0 :         if (tevent_req_nterror(req, status)) {
   13718           0 :                 return;
   13719             :         }
   13720             : 
   13721             :         /* Copy out parameters */
   13722           0 :         *state->orig.out.type = *state->tmp.out.type;
   13723             :         {
   13724           0 :                 size_t _copy_len_data;
   13725           0 :                 _copy_len_data = state->tmp.in.offered;
   13726           0 :                 if (state->orig.out.data != state->tmp.out.data) {
   13727           0 :                         memcpy(state->orig.out.data, state->tmp.out.data, _copy_len_data * sizeof(*state->orig.out.data));
   13728             :                 }
   13729             :         }
   13730           0 :         *state->orig.out.needed = *state->tmp.out.needed;
   13731             : 
   13732             :         /* Copy result */
   13733           0 :         state->orig.out.result = state->tmp.out.result;
   13734             : 
   13735             :         /* Reset temporary structure */
   13736           0 :         NDR_ZERO_STRUCT(state->tmp);
   13737             : 
   13738           0 :         tevent_req_done(req);
   13739             : }
   13740             : 
   13741           0 : NTSTATUS dcerpc_spoolss_GetPrinterDataEx_recv(struct tevent_req *req,
   13742             :                                               TALLOC_CTX *mem_ctx,
   13743             :                                               WERROR *result)
   13744             : {
   13745           0 :         struct dcerpc_spoolss_GetPrinterDataEx_state *state = tevent_req_data(
   13746             :                 req, struct dcerpc_spoolss_GetPrinterDataEx_state);
   13747           0 :         NTSTATUS status;
   13748             : 
   13749           0 :         if (tevent_req_is_nterror(req, &status)) {
   13750           0 :                 tevent_req_received(req);
   13751           0 :                 return status;
   13752             :         }
   13753             : 
   13754             :         /* Steal possible out parameters to the callers context */
   13755           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13756             : 
   13757             :         /* Return result */
   13758           0 :         *result = state->orig.out.result;
   13759             : 
   13760           0 :         tevent_req_received(req);
   13761           0 :         return NT_STATUS_OK;
   13762             : }
   13763             : 
   13764           0 : NTSTATUS dcerpc_spoolss_GetPrinterDataEx(struct dcerpc_binding_handle *h,
   13765             :                                          TALLOC_CTX *mem_ctx,
   13766             :                                          struct policy_handle *_handle /* [in] [ref] */,
   13767             :                                          const char *_key_name /* [in] [charset(UTF16)] */,
   13768             :                                          const char *_value_name /* [in] [charset(UTF16)] */,
   13769             :                                          enum winreg_Type *_type /* [out] [ref] */,
   13770             :                                          uint8_t *_data /* [out] [ref,size_is(offered)] */,
   13771             :                                          uint32_t _offered /* [in]  */,
   13772             :                                          uint32_t *_needed /* [out] [ref] */,
   13773             :                                          WERROR *result)
   13774             : {
   13775           0 :         struct spoolss_GetPrinterDataEx r;
   13776           0 :         NTSTATUS status;
   13777             : 
   13778             :         /* In parameters */
   13779           0 :         r.in.handle = _handle;
   13780           0 :         r.in.key_name = _key_name;
   13781           0 :         r.in.value_name = _value_name;
   13782           0 :         r.in.offered = _offered;
   13783             : 
   13784             :         /* Out parameters */
   13785           0 :         r.out.type = _type;
   13786           0 :         r.out.data = _data;
   13787           0 :         r.out.needed = _needed;
   13788             : 
   13789             :         /* Result */
   13790           0 :         NDR_ZERO_STRUCT(r.out.result);
   13791             : 
   13792           0 :         status = dcerpc_spoolss_GetPrinterDataEx_r(h, mem_ctx, &r);
   13793           0 :         if (!NT_STATUS_IS_OK(status)) {
   13794           0 :                 return status;
   13795             :         }
   13796             : 
   13797             :         /* Return variables */
   13798           0 :         *_type = *r.out.type;
   13799             :         {
   13800           0 :                 size_t _copy_len_data;
   13801           0 :                 _copy_len_data = r.in.offered;
   13802           0 :                 if (_data != r.out.data) {
   13803           0 :                         memcpy(_data, r.out.data, _copy_len_data * sizeof(*_data));
   13804             :                 }
   13805             :         }
   13806           0 :         *_needed = *r.out.needed;
   13807             : 
   13808             :         /* Return result */
   13809           0 :         *result = r.out.result;
   13810             : 
   13811           0 :         return NT_STATUS_OK;
   13812             : }
   13813             : 
   13814             : struct dcerpc_spoolss_EnumPrinterDataEx_r_state {
   13815             :         TALLOC_CTX *out_mem_ctx;
   13816             : };
   13817             : 
   13818             : static void dcerpc_spoolss_EnumPrinterDataEx_r_done(struct tevent_req *subreq);
   13819             : 
   13820           0 : struct tevent_req *dcerpc_spoolss_EnumPrinterDataEx_r_send(TALLOC_CTX *mem_ctx,
   13821             :         struct tevent_context *ev,
   13822             :         struct dcerpc_binding_handle *h,
   13823             :         struct spoolss_EnumPrinterDataEx *r)
   13824             : {
   13825           0 :         struct tevent_req *req;
   13826           0 :         struct dcerpc_spoolss_EnumPrinterDataEx_r_state *state;
   13827           0 :         struct tevent_req *subreq;
   13828             : 
   13829           0 :         req = tevent_req_create(mem_ctx, &state,
   13830             :                                 struct dcerpc_spoolss_EnumPrinterDataEx_r_state);
   13831           0 :         if (req == NULL) {
   13832           0 :                 return NULL;
   13833             :         }
   13834             : 
   13835           0 :         state->out_mem_ctx = talloc_new(state);
   13836           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   13837           0 :                 return tevent_req_post(req, ev);
   13838             :         }
   13839             : 
   13840           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   13841             :                         NULL, &ndr_table_spoolss,
   13842           0 :                         NDR_SPOOLSS_ENUMPRINTERDATAEX, state->out_mem_ctx, r);
   13843           0 :         if (tevent_req_nomem(subreq, req)) {
   13844           0 :                 return tevent_req_post(req, ev);
   13845             :         }
   13846           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterDataEx_r_done, req);
   13847             : 
   13848           0 :         return req;
   13849             : }
   13850             : 
   13851           0 : static void dcerpc_spoolss_EnumPrinterDataEx_r_done(struct tevent_req *subreq)
   13852             : {
   13853           0 :         struct tevent_req *req =
   13854           0 :                 tevent_req_callback_data(subreq,
   13855             :                 struct tevent_req);
   13856           0 :         NTSTATUS status;
   13857             : 
   13858           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   13859           0 :         TALLOC_FREE(subreq);
   13860           0 :         if (tevent_req_nterror(req, status)) {
   13861           0 :                 return;
   13862             :         }
   13863             : 
   13864           0 :         tevent_req_done(req);
   13865             : }
   13866             : 
   13867           0 : NTSTATUS dcerpc_spoolss_EnumPrinterDataEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   13868             : {
   13869           0 :         struct dcerpc_spoolss_EnumPrinterDataEx_r_state *state =
   13870           0 :                 tevent_req_data(req,
   13871             :                 struct dcerpc_spoolss_EnumPrinterDataEx_r_state);
   13872           0 :         NTSTATUS status;
   13873             : 
   13874           0 :         if (tevent_req_is_nterror(req, &status)) {
   13875           0 :                 tevent_req_received(req);
   13876           0 :                 return status;
   13877             :         }
   13878             : 
   13879           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   13880             : 
   13881           0 :         tevent_req_received(req);
   13882           0 :         return NT_STATUS_OK;
   13883             : }
   13884             : 
   13885        2596 : NTSTATUS dcerpc_spoolss_EnumPrinterDataEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrinterDataEx *r)
   13886             : {
   13887           0 :         NTSTATUS status;
   13888             : 
   13889        2596 :         status = dcerpc_binding_handle_call(h,
   13890             :                         NULL, &ndr_table_spoolss,
   13891             :                         NDR_SPOOLSS_ENUMPRINTERDATAEX, mem_ctx, r);
   13892             : 
   13893        2596 :         return status;
   13894             : }
   13895             : 
   13896             : struct dcerpc_spoolss_EnumPrinterDataEx_state {
   13897             :         struct spoolss_EnumPrinterDataEx orig;
   13898             :         struct spoolss_EnumPrinterDataEx tmp;
   13899             :         TALLOC_CTX *out_mem_ctx;
   13900             : };
   13901             : 
   13902             : static void dcerpc_spoolss_EnumPrinterDataEx_done(struct tevent_req *subreq);
   13903             : 
   13904           0 : struct tevent_req *dcerpc_spoolss_EnumPrinterDataEx_send(TALLOC_CTX *mem_ctx,
   13905             :                                                          struct tevent_context *ev,
   13906             :                                                          struct dcerpc_binding_handle *h,
   13907             :                                                          struct policy_handle *_handle /* [in] [ref] */,
   13908             :                                                          const char *_key_name /* [in] [charset(UTF16)] */,
   13909             :                                                          uint32_t _offered /* [in]  */,
   13910             :                                                          uint32_t *_count /* [out] [ref] */,
   13911             :                                                          struct spoolss_PrinterEnumValues **_info /* [out] [ref,size_is(,*count)] */,
   13912             :                                                          uint32_t *_needed /* [out] [ref] */)
   13913             : {
   13914           0 :         struct tevent_req *req;
   13915           0 :         struct dcerpc_spoolss_EnumPrinterDataEx_state *state;
   13916           0 :         struct tevent_req *subreq;
   13917             : 
   13918           0 :         req = tevent_req_create(mem_ctx, &state,
   13919             :                                 struct dcerpc_spoolss_EnumPrinterDataEx_state);
   13920           0 :         if (req == NULL) {
   13921           0 :                 return NULL;
   13922             :         }
   13923           0 :         state->out_mem_ctx = NULL;
   13924             : 
   13925             :         /* In parameters */
   13926           0 :         state->orig.in.handle = _handle;
   13927           0 :         state->orig.in.key_name = _key_name;
   13928           0 :         state->orig.in.offered = _offered;
   13929             : 
   13930             :         /* Out parameters */
   13931           0 :         state->orig.out.count = _count;
   13932           0 :         state->orig.out.info = _info;
   13933           0 :         state->orig.out.needed = _needed;
   13934             : 
   13935             :         /* Result */
   13936           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   13937             : 
   13938           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   13939             :                              "dcerpc_spoolss_EnumPrinterDataEx_out_memory");
   13940           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   13941           0 :                 return tevent_req_post(req, ev);
   13942             :         }
   13943             : 
   13944             :         /* make a temporary copy, that we pass to the dispatch function */
   13945           0 :         state->tmp = state->orig;
   13946             : 
   13947           0 :         subreq = dcerpc_spoolss_EnumPrinterDataEx_r_send(state, ev, h, &state->tmp);
   13948           0 :         if (tevent_req_nomem(subreq, req)) {
   13949           0 :                 return tevent_req_post(req, ev);
   13950             :         }
   13951           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterDataEx_done, req);
   13952           0 :         return req;
   13953             : }
   13954             : 
   13955           0 : static void dcerpc_spoolss_EnumPrinterDataEx_done(struct tevent_req *subreq)
   13956             : {
   13957           0 :         struct tevent_req *req = tevent_req_callback_data(
   13958             :                 subreq, struct tevent_req);
   13959           0 :         struct dcerpc_spoolss_EnumPrinterDataEx_state *state = tevent_req_data(
   13960             :                 req, struct dcerpc_spoolss_EnumPrinterDataEx_state);
   13961           0 :         NTSTATUS status;
   13962           0 :         TALLOC_CTX *mem_ctx;
   13963             : 
   13964           0 :         if (state->out_mem_ctx) {
   13965           0 :                 mem_ctx = state->out_mem_ctx;
   13966             :         } else {
   13967           0 :                 mem_ctx = state;
   13968             :         }
   13969             : 
   13970           0 :         status = dcerpc_spoolss_EnumPrinterDataEx_r_recv(subreq, mem_ctx);
   13971           0 :         TALLOC_FREE(subreq);
   13972           0 :         if (tevent_req_nterror(req, status)) {
   13973           0 :                 return;
   13974             :         }
   13975             : 
   13976             :         /* Copy out parameters */
   13977           0 :         *state->orig.out.count = *state->tmp.out.count;
   13978           0 :         *state->orig.out.info = *state->tmp.out.info;
   13979           0 :         *state->orig.out.needed = *state->tmp.out.needed;
   13980             : 
   13981             :         /* Copy result */
   13982           0 :         state->orig.out.result = state->tmp.out.result;
   13983             : 
   13984             :         /* Reset temporary structure */
   13985           0 :         NDR_ZERO_STRUCT(state->tmp);
   13986             : 
   13987           0 :         tevent_req_done(req);
   13988             : }
   13989             : 
   13990           0 : NTSTATUS dcerpc_spoolss_EnumPrinterDataEx_recv(struct tevent_req *req,
   13991             :                                                TALLOC_CTX *mem_ctx,
   13992             :                                                WERROR *result)
   13993             : {
   13994           0 :         struct dcerpc_spoolss_EnumPrinterDataEx_state *state = tevent_req_data(
   13995             :                 req, struct dcerpc_spoolss_EnumPrinterDataEx_state);
   13996           0 :         NTSTATUS status;
   13997             : 
   13998           0 :         if (tevent_req_is_nterror(req, &status)) {
   13999           0 :                 tevent_req_received(req);
   14000           0 :                 return status;
   14001             :         }
   14002             : 
   14003             :         /* Steal possible out parameters to the callers context */
   14004           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14005             : 
   14006             :         /* Return result */
   14007           0 :         *result = state->orig.out.result;
   14008             : 
   14009           0 :         tevent_req_received(req);
   14010           0 :         return NT_STATUS_OK;
   14011             : }
   14012             : 
   14013           0 : NTSTATUS dcerpc_spoolss_EnumPrinterDataEx(struct dcerpc_binding_handle *h,
   14014             :                                           TALLOC_CTX *mem_ctx,
   14015             :                                           struct policy_handle *_handle /* [in] [ref] */,
   14016             :                                           const char *_key_name /* [in] [charset(UTF16)] */,
   14017             :                                           uint32_t _offered /* [in]  */,
   14018             :                                           uint32_t *_count /* [out] [ref] */,
   14019             :                                           struct spoolss_PrinterEnumValues **_info /* [out] [ref,size_is(,*count)] */,
   14020             :                                           uint32_t *_needed /* [out] [ref] */,
   14021             :                                           WERROR *result)
   14022             : {
   14023           0 :         struct spoolss_EnumPrinterDataEx r;
   14024           0 :         NTSTATUS status;
   14025             : 
   14026             :         /* In parameters */
   14027           0 :         r.in.handle = _handle;
   14028           0 :         r.in.key_name = _key_name;
   14029           0 :         r.in.offered = _offered;
   14030             : 
   14031             :         /* Out parameters */
   14032           0 :         r.out.count = _count;
   14033           0 :         r.out.info = _info;
   14034           0 :         r.out.needed = _needed;
   14035             : 
   14036             :         /* Result */
   14037           0 :         NDR_ZERO_STRUCT(r.out.result);
   14038             : 
   14039           0 :         status = dcerpc_spoolss_EnumPrinterDataEx_r(h, mem_ctx, &r);
   14040           0 :         if (!NT_STATUS_IS_OK(status)) {
   14041           0 :                 return status;
   14042             :         }
   14043             : 
   14044             :         /* Return variables */
   14045           0 :         *_count = *r.out.count;
   14046           0 :         *_info = *r.out.info;
   14047           0 :         *_needed = *r.out.needed;
   14048             : 
   14049             :         /* Return result */
   14050           0 :         *result = r.out.result;
   14051             : 
   14052           0 :         return NT_STATUS_OK;
   14053             : }
   14054             : 
   14055             : struct dcerpc_spoolss_EnumPrinterKey_r_state {
   14056             :         TALLOC_CTX *out_mem_ctx;
   14057             : };
   14058             : 
   14059             : static void dcerpc_spoolss_EnumPrinterKey_r_done(struct tevent_req *subreq);
   14060             : 
   14061           0 : struct tevent_req *dcerpc_spoolss_EnumPrinterKey_r_send(TALLOC_CTX *mem_ctx,
   14062             :         struct tevent_context *ev,
   14063             :         struct dcerpc_binding_handle *h,
   14064             :         struct spoolss_EnumPrinterKey *r)
   14065             : {
   14066           0 :         struct tevent_req *req;
   14067           0 :         struct dcerpc_spoolss_EnumPrinterKey_r_state *state;
   14068           0 :         struct tevent_req *subreq;
   14069             : 
   14070           0 :         req = tevent_req_create(mem_ctx, &state,
   14071             :                                 struct dcerpc_spoolss_EnumPrinterKey_r_state);
   14072           0 :         if (req == NULL) {
   14073           0 :                 return NULL;
   14074             :         }
   14075             : 
   14076           0 :         state->out_mem_ctx = talloc_new(state);
   14077           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   14078           0 :                 return tevent_req_post(req, ev);
   14079             :         }
   14080             : 
   14081           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   14082             :                         NULL, &ndr_table_spoolss,
   14083           0 :                         NDR_SPOOLSS_ENUMPRINTERKEY, state->out_mem_ctx, r);
   14084           0 :         if (tevent_req_nomem(subreq, req)) {
   14085           0 :                 return tevent_req_post(req, ev);
   14086             :         }
   14087           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterKey_r_done, req);
   14088             : 
   14089           0 :         return req;
   14090             : }
   14091             : 
   14092           0 : static void dcerpc_spoolss_EnumPrinterKey_r_done(struct tevent_req *subreq)
   14093             : {
   14094           0 :         struct tevent_req *req =
   14095           0 :                 tevent_req_callback_data(subreq,
   14096             :                 struct tevent_req);
   14097           0 :         NTSTATUS status;
   14098             : 
   14099           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   14100           0 :         TALLOC_FREE(subreq);
   14101           0 :         if (tevent_req_nterror(req, status)) {
   14102           0 :                 return;
   14103             :         }
   14104             : 
   14105           0 :         tevent_req_done(req);
   14106             : }
   14107             : 
   14108           0 : NTSTATUS dcerpc_spoolss_EnumPrinterKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   14109             : {
   14110           0 :         struct dcerpc_spoolss_EnumPrinterKey_r_state *state =
   14111           0 :                 tevent_req_data(req,
   14112             :                 struct dcerpc_spoolss_EnumPrinterKey_r_state);
   14113           0 :         NTSTATUS status;
   14114             : 
   14115           0 :         if (tevent_req_is_nterror(req, &status)) {
   14116           0 :                 tevent_req_received(req);
   14117           0 :                 return status;
   14118             :         }
   14119             : 
   14120           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14121             : 
   14122           0 :         tevent_req_received(req);
   14123           0 :         return NT_STATUS_OK;
   14124             : }
   14125             : 
   14126        3384 : NTSTATUS dcerpc_spoolss_EnumPrinterKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrinterKey *r)
   14127             : {
   14128           0 :         NTSTATUS status;
   14129             : 
   14130        3384 :         status = dcerpc_binding_handle_call(h,
   14131             :                         NULL, &ndr_table_spoolss,
   14132             :                         NDR_SPOOLSS_ENUMPRINTERKEY, mem_ctx, r);
   14133             : 
   14134        3384 :         return status;
   14135             : }
   14136             : 
   14137             : struct dcerpc_spoolss_EnumPrinterKey_state {
   14138             :         struct spoolss_EnumPrinterKey orig;
   14139             :         struct spoolss_EnumPrinterKey tmp;
   14140             :         TALLOC_CTX *out_mem_ctx;
   14141             : };
   14142             : 
   14143             : static void dcerpc_spoolss_EnumPrinterKey_done(struct tevent_req *subreq);
   14144             : 
   14145           0 : struct tevent_req *dcerpc_spoolss_EnumPrinterKey_send(TALLOC_CTX *mem_ctx,
   14146             :                                                       struct tevent_context *ev,
   14147             :                                                       struct dcerpc_binding_handle *h,
   14148             :                                                       struct policy_handle *_handle /* [in] [ref] */,
   14149             :                                                       const char *_key_name /* [in] [charset(UTF16)] */,
   14150             :                                                       uint32_t *__ndr_size /* [out] [ref] */,
   14151             :                                                       union spoolss_KeyNames *_key_buffer /* [out] [ref,subcontext(0),subcontext_size(*_ndr_size*2),switch_is(*_ndr_size)] */,
   14152             :                                                       uint32_t _offered /* [in]  */,
   14153             :                                                       uint32_t *_needed /* [out] [ref] */)
   14154             : {
   14155           0 :         struct tevent_req *req;
   14156           0 :         struct dcerpc_spoolss_EnumPrinterKey_state *state;
   14157           0 :         struct tevent_req *subreq;
   14158             : 
   14159           0 :         req = tevent_req_create(mem_ctx, &state,
   14160             :                                 struct dcerpc_spoolss_EnumPrinterKey_state);
   14161           0 :         if (req == NULL) {
   14162           0 :                 return NULL;
   14163             :         }
   14164           0 :         state->out_mem_ctx = NULL;
   14165             : 
   14166             :         /* In parameters */
   14167           0 :         state->orig.in.handle = _handle;
   14168           0 :         state->orig.in.key_name = _key_name;
   14169           0 :         state->orig.in.offered = _offered;
   14170             : 
   14171             :         /* Out parameters */
   14172           0 :         state->orig.out._ndr_size = __ndr_size;
   14173           0 :         state->orig.out.key_buffer = _key_buffer;
   14174           0 :         state->orig.out.needed = _needed;
   14175             : 
   14176             :         /* Result */
   14177           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   14178             : 
   14179           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   14180             :                              "dcerpc_spoolss_EnumPrinterKey_out_memory");
   14181           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   14182           0 :                 return tevent_req_post(req, ev);
   14183             :         }
   14184             : 
   14185             :         /* make a temporary copy, that we pass to the dispatch function */
   14186           0 :         state->tmp = state->orig;
   14187             : 
   14188           0 :         subreq = dcerpc_spoolss_EnumPrinterKey_r_send(state, ev, h, &state->tmp);
   14189           0 :         if (tevent_req_nomem(subreq, req)) {
   14190           0 :                 return tevent_req_post(req, ev);
   14191             :         }
   14192           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterKey_done, req);
   14193           0 :         return req;
   14194             : }
   14195             : 
   14196           0 : static void dcerpc_spoolss_EnumPrinterKey_done(struct tevent_req *subreq)
   14197             : {
   14198           0 :         struct tevent_req *req = tevent_req_callback_data(
   14199             :                 subreq, struct tevent_req);
   14200           0 :         struct dcerpc_spoolss_EnumPrinterKey_state *state = tevent_req_data(
   14201             :                 req, struct dcerpc_spoolss_EnumPrinterKey_state);
   14202           0 :         NTSTATUS status;
   14203           0 :         TALLOC_CTX *mem_ctx;
   14204             : 
   14205           0 :         if (state->out_mem_ctx) {
   14206           0 :                 mem_ctx = state->out_mem_ctx;
   14207             :         } else {
   14208           0 :                 mem_ctx = state;
   14209             :         }
   14210             : 
   14211           0 :         status = dcerpc_spoolss_EnumPrinterKey_r_recv(subreq, mem_ctx);
   14212           0 :         TALLOC_FREE(subreq);
   14213           0 :         if (tevent_req_nterror(req, status)) {
   14214           0 :                 return;
   14215             :         }
   14216             : 
   14217             :         /* Copy out parameters */
   14218           0 :         *state->orig.out._ndr_size = *state->tmp.out._ndr_size;
   14219           0 :         *state->orig.out.key_buffer = *state->tmp.out.key_buffer;
   14220           0 :         *state->orig.out.needed = *state->tmp.out.needed;
   14221             : 
   14222             :         /* Copy result */
   14223           0 :         state->orig.out.result = state->tmp.out.result;
   14224             : 
   14225             :         /* Reset temporary structure */
   14226           0 :         NDR_ZERO_STRUCT(state->tmp);
   14227             : 
   14228           0 :         tevent_req_done(req);
   14229             : }
   14230             : 
   14231           0 : NTSTATUS dcerpc_spoolss_EnumPrinterKey_recv(struct tevent_req *req,
   14232             :                                             TALLOC_CTX *mem_ctx,
   14233             :                                             WERROR *result)
   14234             : {
   14235           0 :         struct dcerpc_spoolss_EnumPrinterKey_state *state = tevent_req_data(
   14236             :                 req, struct dcerpc_spoolss_EnumPrinterKey_state);
   14237           0 :         NTSTATUS status;
   14238             : 
   14239           0 :         if (tevent_req_is_nterror(req, &status)) {
   14240           0 :                 tevent_req_received(req);
   14241           0 :                 return status;
   14242             :         }
   14243             : 
   14244             :         /* Steal possible out parameters to the callers context */
   14245           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14246             : 
   14247             :         /* Return result */
   14248           0 :         *result = state->orig.out.result;
   14249             : 
   14250           0 :         tevent_req_received(req);
   14251           0 :         return NT_STATUS_OK;
   14252             : }
   14253             : 
   14254           0 : NTSTATUS dcerpc_spoolss_EnumPrinterKey(struct dcerpc_binding_handle *h,
   14255             :                                        TALLOC_CTX *mem_ctx,
   14256             :                                        struct policy_handle *_handle /* [in] [ref] */,
   14257             :                                        const char *_key_name /* [in] [charset(UTF16)] */,
   14258             :                                        uint32_t *__ndr_size /* [out] [ref] */,
   14259             :                                        union spoolss_KeyNames *_key_buffer /* [out] [ref,subcontext(0),subcontext_size(*_ndr_size*2),switch_is(*_ndr_size)] */,
   14260             :                                        uint32_t _offered /* [in]  */,
   14261             :                                        uint32_t *_needed /* [out] [ref] */,
   14262             :                                        WERROR *result)
   14263             : {
   14264           0 :         struct spoolss_EnumPrinterKey r;
   14265           0 :         NTSTATUS status;
   14266             : 
   14267             :         /* In parameters */
   14268           0 :         r.in.handle = _handle;
   14269           0 :         r.in.key_name = _key_name;
   14270           0 :         r.in.offered = _offered;
   14271             : 
   14272             :         /* Out parameters */
   14273           0 :         r.out._ndr_size = __ndr_size;
   14274           0 :         r.out.key_buffer = _key_buffer;
   14275           0 :         r.out.needed = _needed;
   14276             : 
   14277             :         /* Result */
   14278           0 :         NDR_ZERO_STRUCT(r.out.result);
   14279             : 
   14280           0 :         status = dcerpc_spoolss_EnumPrinterKey_r(h, mem_ctx, &r);
   14281           0 :         if (!NT_STATUS_IS_OK(status)) {
   14282           0 :                 return status;
   14283             :         }
   14284             : 
   14285             :         /* Return variables */
   14286           0 :         *__ndr_size = *r.out._ndr_size;
   14287           0 :         *_key_buffer = *r.out.key_buffer;
   14288           0 :         *_needed = *r.out.needed;
   14289             : 
   14290             :         /* Return result */
   14291           0 :         *result = r.out.result;
   14292             : 
   14293           0 :         return NT_STATUS_OK;
   14294             : }
   14295             : 
   14296             : struct dcerpc_spoolss_DeletePrinterDataEx_r_state {
   14297             :         TALLOC_CTX *out_mem_ctx;
   14298             : };
   14299             : 
   14300             : static void dcerpc_spoolss_DeletePrinterDataEx_r_done(struct tevent_req *subreq);
   14301             : 
   14302           0 : struct tevent_req *dcerpc_spoolss_DeletePrinterDataEx_r_send(TALLOC_CTX *mem_ctx,
   14303             :         struct tevent_context *ev,
   14304             :         struct dcerpc_binding_handle *h,
   14305             :         struct spoolss_DeletePrinterDataEx *r)
   14306             : {
   14307           0 :         struct tevent_req *req;
   14308           0 :         struct dcerpc_spoolss_DeletePrinterDataEx_r_state *state;
   14309           0 :         struct tevent_req *subreq;
   14310             : 
   14311           0 :         req = tevent_req_create(mem_ctx, &state,
   14312             :                                 struct dcerpc_spoolss_DeletePrinterDataEx_r_state);
   14313           0 :         if (req == NULL) {
   14314           0 :                 return NULL;
   14315             :         }
   14316             : 
   14317           0 :         state->out_mem_ctx = NULL;
   14318             : 
   14319           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   14320             :                         NULL, &ndr_table_spoolss,
   14321             :                         NDR_SPOOLSS_DELETEPRINTERDATAEX, state, r);
   14322           0 :         if (tevent_req_nomem(subreq, req)) {
   14323           0 :                 return tevent_req_post(req, ev);
   14324             :         }
   14325           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterDataEx_r_done, req);
   14326             : 
   14327           0 :         return req;
   14328             : }
   14329             : 
   14330           0 : static void dcerpc_spoolss_DeletePrinterDataEx_r_done(struct tevent_req *subreq)
   14331             : {
   14332           0 :         struct tevent_req *req =
   14333           0 :                 tevent_req_callback_data(subreq,
   14334             :                 struct tevent_req);
   14335           0 :         NTSTATUS status;
   14336             : 
   14337           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   14338           0 :         TALLOC_FREE(subreq);
   14339           0 :         if (tevent_req_nterror(req, status)) {
   14340           0 :                 return;
   14341             :         }
   14342             : 
   14343           0 :         tevent_req_done(req);
   14344             : }
   14345             : 
   14346           0 : NTSTATUS dcerpc_spoolss_DeletePrinterDataEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   14347             : {
   14348           0 :         struct dcerpc_spoolss_DeletePrinterDataEx_r_state *state =
   14349           0 :                 tevent_req_data(req,
   14350             :                 struct dcerpc_spoolss_DeletePrinterDataEx_r_state);
   14351           0 :         NTSTATUS status;
   14352             : 
   14353           0 :         if (tevent_req_is_nterror(req, &status)) {
   14354           0 :                 tevent_req_received(req);
   14355           0 :                 return status;
   14356             :         }
   14357             : 
   14358           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14359             : 
   14360           0 :         tevent_req_received(req);
   14361           0 :         return NT_STATUS_OK;
   14362             : }
   14363             : 
   14364        1200 : NTSTATUS dcerpc_spoolss_DeletePrinterDataEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinterDataEx *r)
   14365             : {
   14366           0 :         NTSTATUS status;
   14367             : 
   14368        1200 :         status = dcerpc_binding_handle_call(h,
   14369             :                         NULL, &ndr_table_spoolss,
   14370             :                         NDR_SPOOLSS_DELETEPRINTERDATAEX, mem_ctx, r);
   14371             : 
   14372        1200 :         return status;
   14373             : }
   14374             : 
   14375             : struct dcerpc_spoolss_DeletePrinterDataEx_state {
   14376             :         struct spoolss_DeletePrinterDataEx orig;
   14377             :         struct spoolss_DeletePrinterDataEx tmp;
   14378             :         TALLOC_CTX *out_mem_ctx;
   14379             : };
   14380             : 
   14381             : static void dcerpc_spoolss_DeletePrinterDataEx_done(struct tevent_req *subreq);
   14382             : 
   14383           0 : struct tevent_req *dcerpc_spoolss_DeletePrinterDataEx_send(TALLOC_CTX *mem_ctx,
   14384             :                                                            struct tevent_context *ev,
   14385             :                                                            struct dcerpc_binding_handle *h,
   14386             :                                                            struct policy_handle *_handle /* [in] [ref] */,
   14387             :                                                            const char *_key_name /* [in] [charset(UTF16)] */,
   14388             :                                                            const char *_value_name /* [in] [charset(UTF16)] */)
   14389             : {
   14390           0 :         struct tevent_req *req;
   14391           0 :         struct dcerpc_spoolss_DeletePrinterDataEx_state *state;
   14392           0 :         struct tevent_req *subreq;
   14393             : 
   14394           0 :         req = tevent_req_create(mem_ctx, &state,
   14395             :                                 struct dcerpc_spoolss_DeletePrinterDataEx_state);
   14396           0 :         if (req == NULL) {
   14397           0 :                 return NULL;
   14398             :         }
   14399           0 :         state->out_mem_ctx = NULL;
   14400             : 
   14401             :         /* In parameters */
   14402           0 :         state->orig.in.handle = _handle;
   14403           0 :         state->orig.in.key_name = _key_name;
   14404           0 :         state->orig.in.value_name = _value_name;
   14405             : 
   14406             :         /* Out parameters */
   14407             : 
   14408             :         /* Result */
   14409           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   14410             : 
   14411             :         /* make a temporary copy, that we pass to the dispatch function */
   14412           0 :         state->tmp = state->orig;
   14413             : 
   14414           0 :         subreq = dcerpc_spoolss_DeletePrinterDataEx_r_send(state, ev, h, &state->tmp);
   14415           0 :         if (tevent_req_nomem(subreq, req)) {
   14416           0 :                 return tevent_req_post(req, ev);
   14417             :         }
   14418           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterDataEx_done, req);
   14419           0 :         return req;
   14420             : }
   14421             : 
   14422           0 : static void dcerpc_spoolss_DeletePrinterDataEx_done(struct tevent_req *subreq)
   14423             : {
   14424           0 :         struct tevent_req *req = tevent_req_callback_data(
   14425             :                 subreq, struct tevent_req);
   14426           0 :         struct dcerpc_spoolss_DeletePrinterDataEx_state *state = tevent_req_data(
   14427             :                 req, struct dcerpc_spoolss_DeletePrinterDataEx_state);
   14428           0 :         NTSTATUS status;
   14429           0 :         TALLOC_CTX *mem_ctx;
   14430             : 
   14431           0 :         if (state->out_mem_ctx) {
   14432           0 :                 mem_ctx = state->out_mem_ctx;
   14433             :         } else {
   14434           0 :                 mem_ctx = state;
   14435             :         }
   14436             : 
   14437           0 :         status = dcerpc_spoolss_DeletePrinterDataEx_r_recv(subreq, mem_ctx);
   14438           0 :         TALLOC_FREE(subreq);
   14439           0 :         if (tevent_req_nterror(req, status)) {
   14440           0 :                 return;
   14441             :         }
   14442             : 
   14443             :         /* Copy out parameters */
   14444             : 
   14445             :         /* Copy result */
   14446           0 :         state->orig.out.result = state->tmp.out.result;
   14447             : 
   14448             :         /* Reset temporary structure */
   14449           0 :         NDR_ZERO_STRUCT(state->tmp);
   14450             : 
   14451           0 :         tevent_req_done(req);
   14452             : }
   14453             : 
   14454           0 : NTSTATUS dcerpc_spoolss_DeletePrinterDataEx_recv(struct tevent_req *req,
   14455             :                                                  TALLOC_CTX *mem_ctx,
   14456             :                                                  WERROR *result)
   14457             : {
   14458           0 :         struct dcerpc_spoolss_DeletePrinterDataEx_state *state = tevent_req_data(
   14459             :                 req, struct dcerpc_spoolss_DeletePrinterDataEx_state);
   14460           0 :         NTSTATUS status;
   14461             : 
   14462           0 :         if (tevent_req_is_nterror(req, &status)) {
   14463           0 :                 tevent_req_received(req);
   14464           0 :                 return status;
   14465             :         }
   14466             : 
   14467             :         /* Steal possible out parameters to the callers context */
   14468           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14469             : 
   14470             :         /* Return result */
   14471           0 :         *result = state->orig.out.result;
   14472             : 
   14473           0 :         tevent_req_received(req);
   14474           0 :         return NT_STATUS_OK;
   14475             : }
   14476             : 
   14477           0 : NTSTATUS dcerpc_spoolss_DeletePrinterDataEx(struct dcerpc_binding_handle *h,
   14478             :                                             TALLOC_CTX *mem_ctx,
   14479             :                                             struct policy_handle *_handle /* [in] [ref] */,
   14480             :                                             const char *_key_name /* [in] [charset(UTF16)] */,
   14481             :                                             const char *_value_name /* [in] [charset(UTF16)] */,
   14482             :                                             WERROR *result)
   14483             : {
   14484           0 :         struct spoolss_DeletePrinterDataEx r;
   14485           0 :         NTSTATUS status;
   14486             : 
   14487             :         /* In parameters */
   14488           0 :         r.in.handle = _handle;
   14489           0 :         r.in.key_name = _key_name;
   14490           0 :         r.in.value_name = _value_name;
   14491             : 
   14492             :         /* Out parameters */
   14493             : 
   14494             :         /* Result */
   14495           0 :         NDR_ZERO_STRUCT(r.out.result);
   14496             : 
   14497           0 :         status = dcerpc_spoolss_DeletePrinterDataEx_r(h, mem_ctx, &r);
   14498           0 :         if (!NT_STATUS_IS_OK(status)) {
   14499           0 :                 return status;
   14500             :         }
   14501             : 
   14502             :         /* Return variables */
   14503             : 
   14504             :         /* Return result */
   14505           0 :         *result = r.out.result;
   14506             : 
   14507           0 :         return NT_STATUS_OK;
   14508             : }
   14509             : 
   14510             : struct dcerpc_spoolss_DeletePrinterKey_r_state {
   14511             :         TALLOC_CTX *out_mem_ctx;
   14512             : };
   14513             : 
   14514             : static void dcerpc_spoolss_DeletePrinterKey_r_done(struct tevent_req *subreq);
   14515             : 
   14516           0 : struct tevent_req *dcerpc_spoolss_DeletePrinterKey_r_send(TALLOC_CTX *mem_ctx,
   14517             :         struct tevent_context *ev,
   14518             :         struct dcerpc_binding_handle *h,
   14519             :         struct spoolss_DeletePrinterKey *r)
   14520             : {
   14521           0 :         struct tevent_req *req;
   14522           0 :         struct dcerpc_spoolss_DeletePrinterKey_r_state *state;
   14523           0 :         struct tevent_req *subreq;
   14524             : 
   14525           0 :         req = tevent_req_create(mem_ctx, &state,
   14526             :                                 struct dcerpc_spoolss_DeletePrinterKey_r_state);
   14527           0 :         if (req == NULL) {
   14528           0 :                 return NULL;
   14529             :         }
   14530             : 
   14531           0 :         state->out_mem_ctx = NULL;
   14532             : 
   14533           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   14534             :                         NULL, &ndr_table_spoolss,
   14535             :                         NDR_SPOOLSS_DELETEPRINTERKEY, state, r);
   14536           0 :         if (tevent_req_nomem(subreq, req)) {
   14537           0 :                 return tevent_req_post(req, ev);
   14538             :         }
   14539           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterKey_r_done, req);
   14540             : 
   14541           0 :         return req;
   14542             : }
   14543             : 
   14544           0 : static void dcerpc_spoolss_DeletePrinterKey_r_done(struct tevent_req *subreq)
   14545             : {
   14546           0 :         struct tevent_req *req =
   14547           0 :                 tevent_req_callback_data(subreq,
   14548             :                 struct tevent_req);
   14549           0 :         NTSTATUS status;
   14550             : 
   14551           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   14552           0 :         TALLOC_FREE(subreq);
   14553           0 :         if (tevent_req_nterror(req, status)) {
   14554           0 :                 return;
   14555             :         }
   14556             : 
   14557           0 :         tevent_req_done(req);
   14558             : }
   14559             : 
   14560           0 : NTSTATUS dcerpc_spoolss_DeletePrinterKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   14561             : {
   14562           0 :         struct dcerpc_spoolss_DeletePrinterKey_r_state *state =
   14563           0 :                 tevent_req_data(req,
   14564             :                 struct dcerpc_spoolss_DeletePrinterKey_r_state);
   14565           0 :         NTSTATUS status;
   14566             : 
   14567           0 :         if (tevent_req_is_nterror(req, &status)) {
   14568           0 :                 tevent_req_received(req);
   14569           0 :                 return status;
   14570             :         }
   14571             : 
   14572           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14573             : 
   14574           0 :         tevent_req_received(req);
   14575           0 :         return NT_STATUS_OK;
   14576             : }
   14577             : 
   14578         216 : NTSTATUS dcerpc_spoolss_DeletePrinterKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinterKey *r)
   14579             : {
   14580           0 :         NTSTATUS status;
   14581             : 
   14582         216 :         status = dcerpc_binding_handle_call(h,
   14583             :                         NULL, &ndr_table_spoolss,
   14584             :                         NDR_SPOOLSS_DELETEPRINTERKEY, mem_ctx, r);
   14585             : 
   14586         216 :         return status;
   14587             : }
   14588             : 
   14589             : struct dcerpc_spoolss_DeletePrinterKey_state {
   14590             :         struct spoolss_DeletePrinterKey orig;
   14591             :         struct spoolss_DeletePrinterKey tmp;
   14592             :         TALLOC_CTX *out_mem_ctx;
   14593             : };
   14594             : 
   14595             : static void dcerpc_spoolss_DeletePrinterKey_done(struct tevent_req *subreq);
   14596             : 
   14597           0 : struct tevent_req *dcerpc_spoolss_DeletePrinterKey_send(TALLOC_CTX *mem_ctx,
   14598             :                                                         struct tevent_context *ev,
   14599             :                                                         struct dcerpc_binding_handle *h,
   14600             :                                                         struct policy_handle *_handle /* [in] [ref] */,
   14601             :                                                         const char *_key_name /* [in] [charset(UTF16)] */)
   14602             : {
   14603           0 :         struct tevent_req *req;
   14604           0 :         struct dcerpc_spoolss_DeletePrinterKey_state *state;
   14605           0 :         struct tevent_req *subreq;
   14606             : 
   14607           0 :         req = tevent_req_create(mem_ctx, &state,
   14608             :                                 struct dcerpc_spoolss_DeletePrinterKey_state);
   14609           0 :         if (req == NULL) {
   14610           0 :                 return NULL;
   14611             :         }
   14612           0 :         state->out_mem_ctx = NULL;
   14613             : 
   14614             :         /* In parameters */
   14615           0 :         state->orig.in.handle = _handle;
   14616           0 :         state->orig.in.key_name = _key_name;
   14617             : 
   14618             :         /* Out parameters */
   14619             : 
   14620             :         /* Result */
   14621           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   14622             : 
   14623             :         /* make a temporary copy, that we pass to the dispatch function */
   14624           0 :         state->tmp = state->orig;
   14625             : 
   14626           0 :         subreq = dcerpc_spoolss_DeletePrinterKey_r_send(state, ev, h, &state->tmp);
   14627           0 :         if (tevent_req_nomem(subreq, req)) {
   14628           0 :                 return tevent_req_post(req, ev);
   14629             :         }
   14630           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterKey_done, req);
   14631           0 :         return req;
   14632             : }
   14633             : 
   14634           0 : static void dcerpc_spoolss_DeletePrinterKey_done(struct tevent_req *subreq)
   14635             : {
   14636           0 :         struct tevent_req *req = tevent_req_callback_data(
   14637             :                 subreq, struct tevent_req);
   14638           0 :         struct dcerpc_spoolss_DeletePrinterKey_state *state = tevent_req_data(
   14639             :                 req, struct dcerpc_spoolss_DeletePrinterKey_state);
   14640           0 :         NTSTATUS status;
   14641           0 :         TALLOC_CTX *mem_ctx;
   14642             : 
   14643           0 :         if (state->out_mem_ctx) {
   14644           0 :                 mem_ctx = state->out_mem_ctx;
   14645             :         } else {
   14646           0 :                 mem_ctx = state;
   14647             :         }
   14648             : 
   14649           0 :         status = dcerpc_spoolss_DeletePrinterKey_r_recv(subreq, mem_ctx);
   14650           0 :         TALLOC_FREE(subreq);
   14651           0 :         if (tevent_req_nterror(req, status)) {
   14652           0 :                 return;
   14653             :         }
   14654             : 
   14655             :         /* Copy out parameters */
   14656             : 
   14657             :         /* Copy result */
   14658           0 :         state->orig.out.result = state->tmp.out.result;
   14659             : 
   14660             :         /* Reset temporary structure */
   14661           0 :         NDR_ZERO_STRUCT(state->tmp);
   14662             : 
   14663           0 :         tevent_req_done(req);
   14664             : }
   14665             : 
   14666           0 : NTSTATUS dcerpc_spoolss_DeletePrinterKey_recv(struct tevent_req *req,
   14667             :                                               TALLOC_CTX *mem_ctx,
   14668             :                                               WERROR *result)
   14669             : {
   14670           0 :         struct dcerpc_spoolss_DeletePrinterKey_state *state = tevent_req_data(
   14671             :                 req, struct dcerpc_spoolss_DeletePrinterKey_state);
   14672           0 :         NTSTATUS status;
   14673             : 
   14674           0 :         if (tevent_req_is_nterror(req, &status)) {
   14675           0 :                 tevent_req_received(req);
   14676           0 :                 return status;
   14677             :         }
   14678             : 
   14679             :         /* Steal possible out parameters to the callers context */
   14680           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14681             : 
   14682             :         /* Return result */
   14683           0 :         *result = state->orig.out.result;
   14684             : 
   14685           0 :         tevent_req_received(req);
   14686           0 :         return NT_STATUS_OK;
   14687             : }
   14688             : 
   14689           0 : NTSTATUS dcerpc_spoolss_DeletePrinterKey(struct dcerpc_binding_handle *h,
   14690             :                                          TALLOC_CTX *mem_ctx,
   14691             :                                          struct policy_handle *_handle /* [in] [ref] */,
   14692             :                                          const char *_key_name /* [in] [charset(UTF16)] */,
   14693             :                                          WERROR *result)
   14694             : {
   14695           0 :         struct spoolss_DeletePrinterKey r;
   14696           0 :         NTSTATUS status;
   14697             : 
   14698             :         /* In parameters */
   14699           0 :         r.in.handle = _handle;
   14700           0 :         r.in.key_name = _key_name;
   14701             : 
   14702             :         /* Out parameters */
   14703             : 
   14704             :         /* Result */
   14705           0 :         NDR_ZERO_STRUCT(r.out.result);
   14706             : 
   14707           0 :         status = dcerpc_spoolss_DeletePrinterKey_r(h, mem_ctx, &r);
   14708           0 :         if (!NT_STATUS_IS_OK(status)) {
   14709           0 :                 return status;
   14710             :         }
   14711             : 
   14712             :         /* Return variables */
   14713             : 
   14714             :         /* Return result */
   14715           0 :         *result = r.out.result;
   14716             : 
   14717           0 :         return NT_STATUS_OK;
   14718             : }
   14719             : 
   14720             : struct dcerpc_spoolss_DeletePrinterDriverEx_r_state {
   14721             :         TALLOC_CTX *out_mem_ctx;
   14722             : };
   14723             : 
   14724             : static void dcerpc_spoolss_DeletePrinterDriverEx_r_done(struct tevent_req *subreq);
   14725             : 
   14726           0 : struct tevent_req *dcerpc_spoolss_DeletePrinterDriverEx_r_send(TALLOC_CTX *mem_ctx,
   14727             :         struct tevent_context *ev,
   14728             :         struct dcerpc_binding_handle *h,
   14729             :         struct spoolss_DeletePrinterDriverEx *r)
   14730             : {
   14731           0 :         struct tevent_req *req;
   14732           0 :         struct dcerpc_spoolss_DeletePrinterDriverEx_r_state *state;
   14733           0 :         struct tevent_req *subreq;
   14734             : 
   14735           0 :         req = tevent_req_create(mem_ctx, &state,
   14736             :                                 struct dcerpc_spoolss_DeletePrinterDriverEx_r_state);
   14737           0 :         if (req == NULL) {
   14738           0 :                 return NULL;
   14739             :         }
   14740             : 
   14741           0 :         state->out_mem_ctx = NULL;
   14742             : 
   14743           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   14744             :                         NULL, &ndr_table_spoolss,
   14745             :                         NDR_SPOOLSS_DELETEPRINTERDRIVEREX, state, r);
   14746           0 :         if (tevent_req_nomem(subreq, req)) {
   14747           0 :                 return tevent_req_post(req, ev);
   14748             :         }
   14749           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterDriverEx_r_done, req);
   14750             : 
   14751           0 :         return req;
   14752             : }
   14753             : 
   14754           0 : static void dcerpc_spoolss_DeletePrinterDriverEx_r_done(struct tevent_req *subreq)
   14755             : {
   14756           0 :         struct tevent_req *req =
   14757           0 :                 tevent_req_callback_data(subreq,
   14758             :                 struct tevent_req);
   14759           0 :         NTSTATUS status;
   14760             : 
   14761           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   14762           0 :         TALLOC_FREE(subreq);
   14763           0 :         if (tevent_req_nterror(req, status)) {
   14764           0 :                 return;
   14765             :         }
   14766             : 
   14767           0 :         tevent_req_done(req);
   14768             : }
   14769             : 
   14770           0 : NTSTATUS dcerpc_spoolss_DeletePrinterDriverEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   14771             : {
   14772           0 :         struct dcerpc_spoolss_DeletePrinterDriverEx_r_state *state =
   14773           0 :                 tevent_req_data(req,
   14774             :                 struct dcerpc_spoolss_DeletePrinterDriverEx_r_state);
   14775           0 :         NTSTATUS status;
   14776             : 
   14777           0 :         if (tevent_req_is_nterror(req, &status)) {
   14778           0 :                 tevent_req_received(req);
   14779           0 :                 return status;
   14780             :         }
   14781             : 
   14782           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14783             : 
   14784           0 :         tevent_req_received(req);
   14785           0 :         return NT_STATUS_OK;
   14786             : }
   14787             : 
   14788           0 : NTSTATUS dcerpc_spoolss_DeletePrinterDriverEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinterDriverEx *r)
   14789             : {
   14790           0 :         NTSTATUS status;
   14791             : 
   14792           0 :         status = dcerpc_binding_handle_call(h,
   14793             :                         NULL, &ndr_table_spoolss,
   14794             :                         NDR_SPOOLSS_DELETEPRINTERDRIVEREX, mem_ctx, r);
   14795             : 
   14796           0 :         return status;
   14797             : }
   14798             : 
   14799             : struct dcerpc_spoolss_DeletePrinterDriverEx_state {
   14800             :         struct spoolss_DeletePrinterDriverEx orig;
   14801             :         struct spoolss_DeletePrinterDriverEx tmp;
   14802             :         TALLOC_CTX *out_mem_ctx;
   14803             : };
   14804             : 
   14805             : static void dcerpc_spoolss_DeletePrinterDriverEx_done(struct tevent_req *subreq);
   14806             : 
   14807           0 : struct tevent_req *dcerpc_spoolss_DeletePrinterDriverEx_send(TALLOC_CTX *mem_ctx,
   14808             :                                                              struct tevent_context *ev,
   14809             :                                                              struct dcerpc_binding_handle *h,
   14810             :                                                              const char *_server /* [in] [charset(UTF16),unique] */,
   14811             :                                                              const char *_architecture /* [in] [charset(UTF16)] */,
   14812             :                                                              const char *_driver /* [in] [charset(UTF16)] */,
   14813             :                                                              uint32_t _delete_flags /* [in]  */,
   14814             :                                                              uint32_t _version /* [in]  */)
   14815             : {
   14816           0 :         struct tevent_req *req;
   14817           0 :         struct dcerpc_spoolss_DeletePrinterDriverEx_state *state;
   14818           0 :         struct tevent_req *subreq;
   14819             : 
   14820           0 :         req = tevent_req_create(mem_ctx, &state,
   14821             :                                 struct dcerpc_spoolss_DeletePrinterDriverEx_state);
   14822           0 :         if (req == NULL) {
   14823           0 :                 return NULL;
   14824             :         }
   14825           0 :         state->out_mem_ctx = NULL;
   14826             : 
   14827             :         /* In parameters */
   14828           0 :         state->orig.in.server = _server;
   14829           0 :         state->orig.in.architecture = _architecture;
   14830           0 :         state->orig.in.driver = _driver;
   14831           0 :         state->orig.in.delete_flags = _delete_flags;
   14832           0 :         state->orig.in.version = _version;
   14833             : 
   14834             :         /* Out parameters */
   14835             : 
   14836             :         /* Result */
   14837           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   14838             : 
   14839             :         /* make a temporary copy, that we pass to the dispatch function */
   14840           0 :         state->tmp = state->orig;
   14841             : 
   14842           0 :         subreq = dcerpc_spoolss_DeletePrinterDriverEx_r_send(state, ev, h, &state->tmp);
   14843           0 :         if (tevent_req_nomem(subreq, req)) {
   14844           0 :                 return tevent_req_post(req, ev);
   14845             :         }
   14846           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterDriverEx_done, req);
   14847           0 :         return req;
   14848             : }
   14849             : 
   14850           0 : static void dcerpc_spoolss_DeletePrinterDriverEx_done(struct tevent_req *subreq)
   14851             : {
   14852           0 :         struct tevent_req *req = tevent_req_callback_data(
   14853             :                 subreq, struct tevent_req);
   14854           0 :         struct dcerpc_spoolss_DeletePrinterDriverEx_state *state = tevent_req_data(
   14855             :                 req, struct dcerpc_spoolss_DeletePrinterDriverEx_state);
   14856           0 :         NTSTATUS status;
   14857           0 :         TALLOC_CTX *mem_ctx;
   14858             : 
   14859           0 :         if (state->out_mem_ctx) {
   14860           0 :                 mem_ctx = state->out_mem_ctx;
   14861             :         } else {
   14862           0 :                 mem_ctx = state;
   14863             :         }
   14864             : 
   14865           0 :         status = dcerpc_spoolss_DeletePrinterDriverEx_r_recv(subreq, mem_ctx);
   14866           0 :         TALLOC_FREE(subreq);
   14867           0 :         if (tevent_req_nterror(req, status)) {
   14868           0 :                 return;
   14869             :         }
   14870             : 
   14871             :         /* Copy out parameters */
   14872             : 
   14873             :         /* Copy result */
   14874           0 :         state->orig.out.result = state->tmp.out.result;
   14875             : 
   14876             :         /* Reset temporary structure */
   14877           0 :         NDR_ZERO_STRUCT(state->tmp);
   14878             : 
   14879           0 :         tevent_req_done(req);
   14880             : }
   14881             : 
   14882           0 : NTSTATUS dcerpc_spoolss_DeletePrinterDriverEx_recv(struct tevent_req *req,
   14883             :                                                    TALLOC_CTX *mem_ctx,
   14884             :                                                    WERROR *result)
   14885             : {
   14886           0 :         struct dcerpc_spoolss_DeletePrinterDriverEx_state *state = tevent_req_data(
   14887             :                 req, struct dcerpc_spoolss_DeletePrinterDriverEx_state);
   14888           0 :         NTSTATUS status;
   14889             : 
   14890           0 :         if (tevent_req_is_nterror(req, &status)) {
   14891           0 :                 tevent_req_received(req);
   14892           0 :                 return status;
   14893             :         }
   14894             : 
   14895             :         /* Steal possible out parameters to the callers context */
   14896           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   14897             : 
   14898             :         /* Return result */
   14899           0 :         *result = state->orig.out.result;
   14900             : 
   14901           0 :         tevent_req_received(req);
   14902           0 :         return NT_STATUS_OK;
   14903             : }
   14904             : 
   14905           0 : NTSTATUS dcerpc_spoolss_DeletePrinterDriverEx(struct dcerpc_binding_handle *h,
   14906             :                                               TALLOC_CTX *mem_ctx,
   14907             :                                               const char *_server /* [in] [charset(UTF16),unique] */,
   14908             :                                               const char *_architecture /* [in] [charset(UTF16)] */,
   14909             :                                               const char *_driver /* [in] [charset(UTF16)] */,
   14910             :                                               uint32_t _delete_flags /* [in]  */,
   14911             :                                               uint32_t _version /* [in]  */,
   14912             :                                               WERROR *result)
   14913             : {
   14914           0 :         struct spoolss_DeletePrinterDriverEx r;
   14915           0 :         NTSTATUS status;
   14916             : 
   14917             :         /* In parameters */
   14918           0 :         r.in.server = _server;
   14919           0 :         r.in.architecture = _architecture;
   14920           0 :         r.in.driver = _driver;
   14921           0 :         r.in.delete_flags = _delete_flags;
   14922           0 :         r.in.version = _version;
   14923             : 
   14924             :         /* Out parameters */
   14925             : 
   14926             :         /* Result */
   14927           0 :         NDR_ZERO_STRUCT(r.out.result);
   14928             : 
   14929           0 :         status = dcerpc_spoolss_DeletePrinterDriverEx_r(h, mem_ctx, &r);
   14930           0 :         if (!NT_STATUS_IS_OK(status)) {
   14931           0 :                 return status;
   14932             :         }
   14933             : 
   14934             :         /* Return variables */
   14935             : 
   14936             :         /* Return result */
   14937           0 :         *result = r.out.result;
   14938             : 
   14939           0 :         return NT_STATUS_OK;
   14940             : }
   14941             : 
   14942             : struct dcerpc_spoolss_AddPerMachineConnection_r_state {
   14943             :         TALLOC_CTX *out_mem_ctx;
   14944             : };
   14945             : 
   14946             : static void dcerpc_spoolss_AddPerMachineConnection_r_done(struct tevent_req *subreq);
   14947             : 
   14948           0 : struct tevent_req *dcerpc_spoolss_AddPerMachineConnection_r_send(TALLOC_CTX *mem_ctx,
   14949             :         struct tevent_context *ev,
   14950             :         struct dcerpc_binding_handle *h,
   14951             :         struct spoolss_AddPerMachineConnection *r)
   14952             : {
   14953           0 :         struct tevent_req *req;
   14954           0 :         struct dcerpc_spoolss_AddPerMachineConnection_r_state *state;
   14955           0 :         struct tevent_req *subreq;
   14956             : 
   14957           0 :         req = tevent_req_create(mem_ctx, &state,
   14958             :                                 struct dcerpc_spoolss_AddPerMachineConnection_r_state);
   14959           0 :         if (req == NULL) {
   14960           0 :                 return NULL;
   14961             :         }
   14962             : 
   14963           0 :         state->out_mem_ctx = NULL;
   14964             : 
   14965           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   14966             :                         NULL, &ndr_table_spoolss,
   14967             :                         NDR_SPOOLSS_ADDPERMACHINECONNECTION, state, r);
   14968           0 :         if (tevent_req_nomem(subreq, req)) {
   14969           0 :                 return tevent_req_post(req, ev);
   14970             :         }
   14971           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_AddPerMachineConnection_r_done, req);
   14972             : 
   14973           0 :         return req;
   14974             : }
   14975             : 
   14976           0 : static void dcerpc_spoolss_AddPerMachineConnection_r_done(struct tevent_req *subreq)
   14977             : {
   14978           0 :         struct tevent_req *req =
   14979           0 :                 tevent_req_callback_data(subreq,
   14980             :                 struct tevent_req);
   14981           0 :         NTSTATUS status;
   14982             : 
   14983           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   14984           0 :         TALLOC_FREE(subreq);
   14985           0 :         if (tevent_req_nterror(req, status)) {
   14986           0 :                 return;
   14987             :         }
   14988             : 
   14989           0 :         tevent_req_done(req);
   14990             : }
   14991             : 
   14992           0 : NTSTATUS dcerpc_spoolss_AddPerMachineConnection_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   14993             : {
   14994           0 :         struct dcerpc_spoolss_AddPerMachineConnection_r_state *state =
   14995           0 :                 tevent_req_data(req,
   14996             :                 struct dcerpc_spoolss_AddPerMachineConnection_r_state);
   14997           0 :         NTSTATUS status;
   14998             : 
   14999           0 :         if (tevent_req_is_nterror(req, &status)) {
   15000           0 :                 tevent_req_received(req);
   15001           0 :                 return status;
   15002             :         }
   15003             : 
   15004           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15005             : 
   15006           0 :         tevent_req_received(req);
   15007           0 :         return NT_STATUS_OK;
   15008             : }
   15009             : 
   15010           4 : NTSTATUS dcerpc_spoolss_AddPerMachineConnection_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPerMachineConnection *r)
   15011             : {
   15012           0 :         NTSTATUS status;
   15013             : 
   15014           4 :         status = dcerpc_binding_handle_call(h,
   15015             :                         NULL, &ndr_table_spoolss,
   15016             :                         NDR_SPOOLSS_ADDPERMACHINECONNECTION, mem_ctx, r);
   15017             : 
   15018           4 :         return status;
   15019             : }
   15020             : 
   15021             : struct dcerpc_spoolss_AddPerMachineConnection_state {
   15022             :         struct spoolss_AddPerMachineConnection orig;
   15023             :         struct spoolss_AddPerMachineConnection tmp;
   15024             :         TALLOC_CTX *out_mem_ctx;
   15025             : };
   15026             : 
   15027             : static void dcerpc_spoolss_AddPerMachineConnection_done(struct tevent_req *subreq);
   15028             : 
   15029           0 : struct tevent_req *dcerpc_spoolss_AddPerMachineConnection_send(TALLOC_CTX *mem_ctx,
   15030             :                                                                struct tevent_context *ev,
   15031             :                                                                struct dcerpc_binding_handle *h,
   15032             :                                                                const char *_server /* [in] [charset(UTF16),unique] */,
   15033             :                                                                const char *_printername /* [in] [charset(UTF16),ref] */,
   15034             :                                                                const char *_printserver /* [in] [charset(UTF16),ref] */,
   15035             :                                                                const char *_provider /* [in] [charset(UTF16),ref] */)
   15036             : {
   15037           0 :         struct tevent_req *req;
   15038           0 :         struct dcerpc_spoolss_AddPerMachineConnection_state *state;
   15039           0 :         struct tevent_req *subreq;
   15040             : 
   15041           0 :         req = tevent_req_create(mem_ctx, &state,
   15042             :                                 struct dcerpc_spoolss_AddPerMachineConnection_state);
   15043           0 :         if (req == NULL) {
   15044           0 :                 return NULL;
   15045             :         }
   15046           0 :         state->out_mem_ctx = NULL;
   15047             : 
   15048             :         /* In parameters */
   15049           0 :         state->orig.in.server = _server;
   15050           0 :         state->orig.in.printername = _printername;
   15051           0 :         state->orig.in.printserver = _printserver;
   15052           0 :         state->orig.in.provider = _provider;
   15053             : 
   15054             :         /* Out parameters */
   15055             : 
   15056             :         /* Result */
   15057           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   15058             : 
   15059             :         /* make a temporary copy, that we pass to the dispatch function */
   15060           0 :         state->tmp = state->orig;
   15061             : 
   15062           0 :         subreq = dcerpc_spoolss_AddPerMachineConnection_r_send(state, ev, h, &state->tmp);
   15063           0 :         if (tevent_req_nomem(subreq, req)) {
   15064           0 :                 return tevent_req_post(req, ev);
   15065             :         }
   15066           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_AddPerMachineConnection_done, req);
   15067           0 :         return req;
   15068             : }
   15069             : 
   15070           0 : static void dcerpc_spoolss_AddPerMachineConnection_done(struct tevent_req *subreq)
   15071             : {
   15072           0 :         struct tevent_req *req = tevent_req_callback_data(
   15073             :                 subreq, struct tevent_req);
   15074           0 :         struct dcerpc_spoolss_AddPerMachineConnection_state *state = tevent_req_data(
   15075             :                 req, struct dcerpc_spoolss_AddPerMachineConnection_state);
   15076           0 :         NTSTATUS status;
   15077           0 :         TALLOC_CTX *mem_ctx;
   15078             : 
   15079           0 :         if (state->out_mem_ctx) {
   15080           0 :                 mem_ctx = state->out_mem_ctx;
   15081             :         } else {
   15082           0 :                 mem_ctx = state;
   15083             :         }
   15084             : 
   15085           0 :         status = dcerpc_spoolss_AddPerMachineConnection_r_recv(subreq, mem_ctx);
   15086           0 :         TALLOC_FREE(subreq);
   15087           0 :         if (tevent_req_nterror(req, status)) {
   15088           0 :                 return;
   15089             :         }
   15090             : 
   15091             :         /* Copy out parameters */
   15092             : 
   15093             :         /* Copy result */
   15094           0 :         state->orig.out.result = state->tmp.out.result;
   15095             : 
   15096             :         /* Reset temporary structure */
   15097           0 :         NDR_ZERO_STRUCT(state->tmp);
   15098             : 
   15099           0 :         tevent_req_done(req);
   15100             : }
   15101             : 
   15102           0 : NTSTATUS dcerpc_spoolss_AddPerMachineConnection_recv(struct tevent_req *req,
   15103             :                                                      TALLOC_CTX *mem_ctx,
   15104             :                                                      WERROR *result)
   15105             : {
   15106           0 :         struct dcerpc_spoolss_AddPerMachineConnection_state *state = tevent_req_data(
   15107             :                 req, struct dcerpc_spoolss_AddPerMachineConnection_state);
   15108           0 :         NTSTATUS status;
   15109             : 
   15110           0 :         if (tevent_req_is_nterror(req, &status)) {
   15111           0 :                 tevent_req_received(req);
   15112           0 :                 return status;
   15113             :         }
   15114             : 
   15115             :         /* Steal possible out parameters to the callers context */
   15116           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15117             : 
   15118             :         /* Return result */
   15119           0 :         *result = state->orig.out.result;
   15120             : 
   15121           0 :         tevent_req_received(req);
   15122           0 :         return NT_STATUS_OK;
   15123             : }
   15124             : 
   15125           0 : NTSTATUS dcerpc_spoolss_AddPerMachineConnection(struct dcerpc_binding_handle *h,
   15126             :                                                 TALLOC_CTX *mem_ctx,
   15127             :                                                 const char *_server /* [in] [charset(UTF16),unique] */,
   15128             :                                                 const char *_printername /* [in] [charset(UTF16),ref] */,
   15129             :                                                 const char *_printserver /* [in] [charset(UTF16),ref] */,
   15130             :                                                 const char *_provider /* [in] [charset(UTF16),ref] */,
   15131             :                                                 WERROR *result)
   15132             : {
   15133           0 :         struct spoolss_AddPerMachineConnection r;
   15134           0 :         NTSTATUS status;
   15135             : 
   15136             :         /* In parameters */
   15137           0 :         r.in.server = _server;
   15138           0 :         r.in.printername = _printername;
   15139           0 :         r.in.printserver = _printserver;
   15140           0 :         r.in.provider = _provider;
   15141             : 
   15142             :         /* Out parameters */
   15143             : 
   15144             :         /* Result */
   15145           0 :         NDR_ZERO_STRUCT(r.out.result);
   15146             : 
   15147           0 :         status = dcerpc_spoolss_AddPerMachineConnection_r(h, mem_ctx, &r);
   15148           0 :         if (!NT_STATUS_IS_OK(status)) {
   15149           0 :                 return status;
   15150             :         }
   15151             : 
   15152             :         /* Return variables */
   15153             : 
   15154             :         /* Return result */
   15155           0 :         *result = r.out.result;
   15156             : 
   15157           0 :         return NT_STATUS_OK;
   15158             : }
   15159             : 
   15160             : struct dcerpc_spoolss_DeletePerMachineConnection_r_state {
   15161             :         TALLOC_CTX *out_mem_ctx;
   15162             : };
   15163             : 
   15164             : static void dcerpc_spoolss_DeletePerMachineConnection_r_done(struct tevent_req *subreq);
   15165             : 
   15166           0 : struct tevent_req *dcerpc_spoolss_DeletePerMachineConnection_r_send(TALLOC_CTX *mem_ctx,
   15167             :         struct tevent_context *ev,
   15168             :         struct dcerpc_binding_handle *h,
   15169             :         struct spoolss_DeletePerMachineConnection *r)
   15170             : {
   15171           0 :         struct tevent_req *req;
   15172           0 :         struct dcerpc_spoolss_DeletePerMachineConnection_r_state *state;
   15173           0 :         struct tevent_req *subreq;
   15174             : 
   15175           0 :         req = tevent_req_create(mem_ctx, &state,
   15176             :                                 struct dcerpc_spoolss_DeletePerMachineConnection_r_state);
   15177           0 :         if (req == NULL) {
   15178           0 :                 return NULL;
   15179             :         }
   15180             : 
   15181           0 :         state->out_mem_ctx = NULL;
   15182             : 
   15183           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   15184             :                         NULL, &ndr_table_spoolss,
   15185             :                         NDR_SPOOLSS_DELETEPERMACHINECONNECTION, state, r);
   15186           0 :         if (tevent_req_nomem(subreq, req)) {
   15187           0 :                 return tevent_req_post(req, ev);
   15188             :         }
   15189           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePerMachineConnection_r_done, req);
   15190             : 
   15191           0 :         return req;
   15192             : }
   15193             : 
   15194           0 : static void dcerpc_spoolss_DeletePerMachineConnection_r_done(struct tevent_req *subreq)
   15195             : {
   15196           0 :         struct tevent_req *req =
   15197           0 :                 tevent_req_callback_data(subreq,
   15198             :                 struct tevent_req);
   15199           0 :         NTSTATUS status;
   15200             : 
   15201           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   15202           0 :         TALLOC_FREE(subreq);
   15203           0 :         if (tevent_req_nterror(req, status)) {
   15204           0 :                 return;
   15205             :         }
   15206             : 
   15207           0 :         tevent_req_done(req);
   15208             : }
   15209             : 
   15210           0 : NTSTATUS dcerpc_spoolss_DeletePerMachineConnection_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   15211             : {
   15212           0 :         struct dcerpc_spoolss_DeletePerMachineConnection_r_state *state =
   15213           0 :                 tevent_req_data(req,
   15214             :                 struct dcerpc_spoolss_DeletePerMachineConnection_r_state);
   15215           0 :         NTSTATUS status;
   15216             : 
   15217           0 :         if (tevent_req_is_nterror(req, &status)) {
   15218           0 :                 tevent_req_received(req);
   15219           0 :                 return status;
   15220             :         }
   15221             : 
   15222           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15223             : 
   15224           0 :         tevent_req_received(req);
   15225           0 :         return NT_STATUS_OK;
   15226             : }
   15227             : 
   15228           0 : NTSTATUS dcerpc_spoolss_DeletePerMachineConnection_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePerMachineConnection *r)
   15229             : {
   15230           0 :         NTSTATUS status;
   15231             : 
   15232           0 :         status = dcerpc_binding_handle_call(h,
   15233             :                         NULL, &ndr_table_spoolss,
   15234             :                         NDR_SPOOLSS_DELETEPERMACHINECONNECTION, mem_ctx, r);
   15235             : 
   15236           0 :         return status;
   15237             : }
   15238             : 
   15239             : struct dcerpc_spoolss_DeletePerMachineConnection_state {
   15240             :         struct spoolss_DeletePerMachineConnection orig;
   15241             :         struct spoolss_DeletePerMachineConnection tmp;
   15242             :         TALLOC_CTX *out_mem_ctx;
   15243             : };
   15244             : 
   15245             : static void dcerpc_spoolss_DeletePerMachineConnection_done(struct tevent_req *subreq);
   15246             : 
   15247           0 : struct tevent_req *dcerpc_spoolss_DeletePerMachineConnection_send(TALLOC_CTX *mem_ctx,
   15248             :                                                                   struct tevent_context *ev,
   15249             :                                                                   struct dcerpc_binding_handle *h,
   15250             :                                                                   const char *_server /* [in] [charset(UTF16),unique] */,
   15251             :                                                                   const char *_printername /* [in] [charset(UTF16),ref] */)
   15252             : {
   15253           0 :         struct tevent_req *req;
   15254           0 :         struct dcerpc_spoolss_DeletePerMachineConnection_state *state;
   15255           0 :         struct tevent_req *subreq;
   15256             : 
   15257           0 :         req = tevent_req_create(mem_ctx, &state,
   15258             :                                 struct dcerpc_spoolss_DeletePerMachineConnection_state);
   15259           0 :         if (req == NULL) {
   15260           0 :                 return NULL;
   15261             :         }
   15262           0 :         state->out_mem_ctx = NULL;
   15263             : 
   15264             :         /* In parameters */
   15265           0 :         state->orig.in.server = _server;
   15266           0 :         state->orig.in.printername = _printername;
   15267             : 
   15268             :         /* Out parameters */
   15269             : 
   15270             :         /* Result */
   15271           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   15272             : 
   15273             :         /* make a temporary copy, that we pass to the dispatch function */
   15274           0 :         state->tmp = state->orig;
   15275             : 
   15276           0 :         subreq = dcerpc_spoolss_DeletePerMachineConnection_r_send(state, ev, h, &state->tmp);
   15277           0 :         if (tevent_req_nomem(subreq, req)) {
   15278           0 :                 return tevent_req_post(req, ev);
   15279             :         }
   15280           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePerMachineConnection_done, req);
   15281           0 :         return req;
   15282             : }
   15283             : 
   15284           0 : static void dcerpc_spoolss_DeletePerMachineConnection_done(struct tevent_req *subreq)
   15285             : {
   15286           0 :         struct tevent_req *req = tevent_req_callback_data(
   15287             :                 subreq, struct tevent_req);
   15288           0 :         struct dcerpc_spoolss_DeletePerMachineConnection_state *state = tevent_req_data(
   15289             :                 req, struct dcerpc_spoolss_DeletePerMachineConnection_state);
   15290           0 :         NTSTATUS status;
   15291           0 :         TALLOC_CTX *mem_ctx;
   15292             : 
   15293           0 :         if (state->out_mem_ctx) {
   15294           0 :                 mem_ctx = state->out_mem_ctx;
   15295             :         } else {
   15296           0 :                 mem_ctx = state;
   15297             :         }
   15298             : 
   15299           0 :         status = dcerpc_spoolss_DeletePerMachineConnection_r_recv(subreq, mem_ctx);
   15300           0 :         TALLOC_FREE(subreq);
   15301           0 :         if (tevent_req_nterror(req, status)) {
   15302           0 :                 return;
   15303             :         }
   15304             : 
   15305             :         /* Copy out parameters */
   15306             : 
   15307             :         /* Copy result */
   15308           0 :         state->orig.out.result = state->tmp.out.result;
   15309             : 
   15310             :         /* Reset temporary structure */
   15311           0 :         NDR_ZERO_STRUCT(state->tmp);
   15312             : 
   15313           0 :         tevent_req_done(req);
   15314             : }
   15315             : 
   15316           0 : NTSTATUS dcerpc_spoolss_DeletePerMachineConnection_recv(struct tevent_req *req,
   15317             :                                                         TALLOC_CTX *mem_ctx,
   15318             :                                                         WERROR *result)
   15319             : {
   15320           0 :         struct dcerpc_spoolss_DeletePerMachineConnection_state *state = tevent_req_data(
   15321             :                 req, struct dcerpc_spoolss_DeletePerMachineConnection_state);
   15322           0 :         NTSTATUS status;
   15323             : 
   15324           0 :         if (tevent_req_is_nterror(req, &status)) {
   15325           0 :                 tevent_req_received(req);
   15326           0 :                 return status;
   15327             :         }
   15328             : 
   15329             :         /* Steal possible out parameters to the callers context */
   15330           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15331             : 
   15332             :         /* Return result */
   15333           0 :         *result = state->orig.out.result;
   15334             : 
   15335           0 :         tevent_req_received(req);
   15336           0 :         return NT_STATUS_OK;
   15337             : }
   15338             : 
   15339           0 : NTSTATUS dcerpc_spoolss_DeletePerMachineConnection(struct dcerpc_binding_handle *h,
   15340             :                                                    TALLOC_CTX *mem_ctx,
   15341             :                                                    const char *_server /* [in] [charset(UTF16),unique] */,
   15342             :                                                    const char *_printername /* [in] [charset(UTF16),ref] */,
   15343             :                                                    WERROR *result)
   15344             : {
   15345           0 :         struct spoolss_DeletePerMachineConnection r;
   15346           0 :         NTSTATUS status;
   15347             : 
   15348             :         /* In parameters */
   15349           0 :         r.in.server = _server;
   15350           0 :         r.in.printername = _printername;
   15351             : 
   15352             :         /* Out parameters */
   15353             : 
   15354             :         /* Result */
   15355           0 :         NDR_ZERO_STRUCT(r.out.result);
   15356             : 
   15357           0 :         status = dcerpc_spoolss_DeletePerMachineConnection_r(h, mem_ctx, &r);
   15358           0 :         if (!NT_STATUS_IS_OK(status)) {
   15359           0 :                 return status;
   15360             :         }
   15361             : 
   15362             :         /* Return variables */
   15363             : 
   15364             :         /* Return result */
   15365           0 :         *result = r.out.result;
   15366             : 
   15367           0 :         return NT_STATUS_OK;
   15368             : }
   15369             : 
   15370             : struct dcerpc_spoolss_EnumPerMachineConnections_r_state {
   15371             :         TALLOC_CTX *out_mem_ctx;
   15372             : };
   15373             : 
   15374             : static void dcerpc_spoolss_EnumPerMachineConnections_r_done(struct tevent_req *subreq);
   15375             : 
   15376           0 : struct tevent_req *dcerpc_spoolss_EnumPerMachineConnections_r_send(TALLOC_CTX *mem_ctx,
   15377             :         struct tevent_context *ev,
   15378             :         struct dcerpc_binding_handle *h,
   15379             :         struct spoolss_EnumPerMachineConnections *r)
   15380             : {
   15381           0 :         struct tevent_req *req;
   15382           0 :         struct dcerpc_spoolss_EnumPerMachineConnections_r_state *state;
   15383           0 :         struct tevent_req *subreq;
   15384             : 
   15385           0 :         req = tevent_req_create(mem_ctx, &state,
   15386             :                                 struct dcerpc_spoolss_EnumPerMachineConnections_r_state);
   15387           0 :         if (req == NULL) {
   15388           0 :                 return NULL;
   15389             :         }
   15390             : 
   15391           0 :         state->out_mem_ctx = talloc_new(state);
   15392           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   15393           0 :                 return tevent_req_post(req, ev);
   15394             :         }
   15395             : 
   15396           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   15397             :                         NULL, &ndr_table_spoolss,
   15398           0 :                         NDR_SPOOLSS_ENUMPERMACHINECONNECTIONS, state->out_mem_ctx, r);
   15399           0 :         if (tevent_req_nomem(subreq, req)) {
   15400           0 :                 return tevent_req_post(req, ev);
   15401             :         }
   15402           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPerMachineConnections_r_done, req);
   15403             : 
   15404           0 :         return req;
   15405             : }
   15406             : 
   15407           0 : static void dcerpc_spoolss_EnumPerMachineConnections_r_done(struct tevent_req *subreq)
   15408             : {
   15409           0 :         struct tevent_req *req =
   15410           0 :                 tevent_req_callback_data(subreq,
   15411             :                 struct tevent_req);
   15412           0 :         NTSTATUS status;
   15413             : 
   15414           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   15415           0 :         TALLOC_FREE(subreq);
   15416           0 :         if (tevent_req_nterror(req, status)) {
   15417           0 :                 return;
   15418             :         }
   15419             : 
   15420           0 :         tevent_req_done(req);
   15421             : }
   15422             : 
   15423           0 : NTSTATUS dcerpc_spoolss_EnumPerMachineConnections_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   15424             : {
   15425           0 :         struct dcerpc_spoolss_EnumPerMachineConnections_r_state *state =
   15426           0 :                 tevent_req_data(req,
   15427             :                 struct dcerpc_spoolss_EnumPerMachineConnections_r_state);
   15428           0 :         NTSTATUS status;
   15429             : 
   15430           0 :         if (tevent_req_is_nterror(req, &status)) {
   15431           0 :                 tevent_req_received(req);
   15432           0 :                 return status;
   15433             :         }
   15434             : 
   15435           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15436             : 
   15437           0 :         tevent_req_received(req);
   15438           0 :         return NT_STATUS_OK;
   15439             : }
   15440             : 
   15441           0 : NTSTATUS dcerpc_spoolss_EnumPerMachineConnections_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPerMachineConnections *r)
   15442             : {
   15443           0 :         NTSTATUS status;
   15444             : 
   15445           0 :         status = dcerpc_binding_handle_call(h,
   15446             :                         NULL, &ndr_table_spoolss,
   15447             :                         NDR_SPOOLSS_ENUMPERMACHINECONNECTIONS, mem_ctx, r);
   15448             : 
   15449           0 :         return status;
   15450             : }
   15451             : 
   15452             : struct dcerpc_spoolss_EnumPerMachineConnections_state {
   15453             :         struct spoolss_EnumPerMachineConnections orig;
   15454             :         struct spoolss_EnumPerMachineConnections tmp;
   15455             :         TALLOC_CTX *out_mem_ctx;
   15456             : };
   15457             : 
   15458             : static void dcerpc_spoolss_EnumPerMachineConnections_done(struct tevent_req *subreq);
   15459             : 
   15460           0 : struct tevent_req *dcerpc_spoolss_EnumPerMachineConnections_send(TALLOC_CTX *mem_ctx,
   15461             :                                                                  struct tevent_context *ev,
   15462             :                                                                  struct dcerpc_binding_handle *h,
   15463             :                                                                  const char *_server /* [in] [charset(UTF16),unique] */,
   15464             :                                                                  DATA_BLOB *_buffer /* [in] [unique] */,
   15465             :                                                                  uint32_t _offered /* [in]  */,
   15466             :                                                                  uint32_t *_count /* [out] [ref] */,
   15467             :                                                                  struct spoolss_PrinterInfo4 **_info /* [out] [ref,size_is(,*count)] */,
   15468             :                                                                  uint32_t *_needed /* [out] [ref] */)
   15469             : {
   15470           0 :         struct tevent_req *req;
   15471           0 :         struct dcerpc_spoolss_EnumPerMachineConnections_state *state;
   15472           0 :         struct tevent_req *subreq;
   15473             : 
   15474           0 :         req = tevent_req_create(mem_ctx, &state,
   15475             :                                 struct dcerpc_spoolss_EnumPerMachineConnections_state);
   15476           0 :         if (req == NULL) {
   15477           0 :                 return NULL;
   15478             :         }
   15479           0 :         state->out_mem_ctx = NULL;
   15480             : 
   15481             :         /* In parameters */
   15482           0 :         state->orig.in.server = _server;
   15483           0 :         state->orig.in.buffer = _buffer;
   15484           0 :         state->orig.in.offered = _offered;
   15485             : 
   15486             :         /* Out parameters */
   15487           0 :         state->orig.out.count = _count;
   15488           0 :         state->orig.out.info = _info;
   15489           0 :         state->orig.out.needed = _needed;
   15490             : 
   15491             :         /* Result */
   15492           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   15493             : 
   15494           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   15495             :                              "dcerpc_spoolss_EnumPerMachineConnections_out_memory");
   15496           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   15497           0 :                 return tevent_req_post(req, ev);
   15498             :         }
   15499             : 
   15500             :         /* make a temporary copy, that we pass to the dispatch function */
   15501           0 :         state->tmp = state->orig;
   15502             : 
   15503           0 :         subreq = dcerpc_spoolss_EnumPerMachineConnections_r_send(state, ev, h, &state->tmp);
   15504           0 :         if (tevent_req_nomem(subreq, req)) {
   15505           0 :                 return tevent_req_post(req, ev);
   15506             :         }
   15507           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPerMachineConnections_done, req);
   15508           0 :         return req;
   15509             : }
   15510             : 
   15511           0 : static void dcerpc_spoolss_EnumPerMachineConnections_done(struct tevent_req *subreq)
   15512             : {
   15513           0 :         struct tevent_req *req = tevent_req_callback_data(
   15514             :                 subreq, struct tevent_req);
   15515           0 :         struct dcerpc_spoolss_EnumPerMachineConnections_state *state = tevent_req_data(
   15516             :                 req, struct dcerpc_spoolss_EnumPerMachineConnections_state);
   15517           0 :         NTSTATUS status;
   15518           0 :         TALLOC_CTX *mem_ctx;
   15519             : 
   15520           0 :         if (state->out_mem_ctx) {
   15521           0 :                 mem_ctx = state->out_mem_ctx;
   15522             :         } else {
   15523           0 :                 mem_ctx = state;
   15524             :         }
   15525             : 
   15526           0 :         status = dcerpc_spoolss_EnumPerMachineConnections_r_recv(subreq, mem_ctx);
   15527           0 :         TALLOC_FREE(subreq);
   15528           0 :         if (tevent_req_nterror(req, status)) {
   15529           0 :                 return;
   15530             :         }
   15531             : 
   15532             :         /* Copy out parameters */
   15533           0 :         *state->orig.out.count = *state->tmp.out.count;
   15534           0 :         *state->orig.out.info = *state->tmp.out.info;
   15535           0 :         *state->orig.out.needed = *state->tmp.out.needed;
   15536             : 
   15537             :         /* Copy result */
   15538           0 :         state->orig.out.result = state->tmp.out.result;
   15539             : 
   15540             :         /* Reset temporary structure */
   15541           0 :         NDR_ZERO_STRUCT(state->tmp);
   15542             : 
   15543           0 :         tevent_req_done(req);
   15544             : }
   15545             : 
   15546           0 : NTSTATUS dcerpc_spoolss_EnumPerMachineConnections_recv(struct tevent_req *req,
   15547             :                                                        TALLOC_CTX *mem_ctx,
   15548             :                                                        WERROR *result)
   15549             : {
   15550           0 :         struct dcerpc_spoolss_EnumPerMachineConnections_state *state = tevent_req_data(
   15551             :                 req, struct dcerpc_spoolss_EnumPerMachineConnections_state);
   15552           0 :         NTSTATUS status;
   15553             : 
   15554           0 :         if (tevent_req_is_nterror(req, &status)) {
   15555           0 :                 tevent_req_received(req);
   15556           0 :                 return status;
   15557             :         }
   15558             : 
   15559             :         /* Steal possible out parameters to the callers context */
   15560           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15561             : 
   15562             :         /* Return result */
   15563           0 :         *result = state->orig.out.result;
   15564             : 
   15565           0 :         tevent_req_received(req);
   15566           0 :         return NT_STATUS_OK;
   15567             : }
   15568             : 
   15569           0 : NTSTATUS dcerpc_spoolss_EnumPerMachineConnections(struct dcerpc_binding_handle *h,
   15570             :                                                   TALLOC_CTX *mem_ctx,
   15571             :                                                   const char *_server /* [in] [charset(UTF16),unique] */,
   15572             :                                                   DATA_BLOB *_buffer /* [in] [unique] */,
   15573             :                                                   uint32_t _offered /* [in]  */,
   15574             :                                                   uint32_t *_count /* [out] [ref] */,
   15575             :                                                   struct spoolss_PrinterInfo4 **_info /* [out] [ref,size_is(,*count)] */,
   15576             :                                                   uint32_t *_needed /* [out] [ref] */,
   15577             :                                                   WERROR *result)
   15578             : {
   15579           0 :         struct spoolss_EnumPerMachineConnections r;
   15580           0 :         NTSTATUS status;
   15581             : 
   15582             :         /* In parameters */
   15583           0 :         r.in.server = _server;
   15584           0 :         r.in.buffer = _buffer;
   15585           0 :         r.in.offered = _offered;
   15586             : 
   15587             :         /* Out parameters */
   15588           0 :         r.out.count = _count;
   15589           0 :         r.out.info = _info;
   15590           0 :         r.out.needed = _needed;
   15591             : 
   15592             :         /* Result */
   15593           0 :         NDR_ZERO_STRUCT(r.out.result);
   15594             : 
   15595           0 :         status = dcerpc_spoolss_EnumPerMachineConnections_r(h, mem_ctx, &r);
   15596           0 :         if (!NT_STATUS_IS_OK(status)) {
   15597           0 :                 return status;
   15598             :         }
   15599             : 
   15600             :         /* Return variables */
   15601           0 :         *_count = *r.out.count;
   15602           0 :         *_info = *r.out.info;
   15603           0 :         *_needed = *r.out.needed;
   15604             : 
   15605             :         /* Return result */
   15606           0 :         *result = r.out.result;
   15607             : 
   15608           0 :         return NT_STATUS_OK;
   15609             : }
   15610             : 
   15611             : struct dcerpc_spoolss_XcvData_r_state {
   15612             :         TALLOC_CTX *out_mem_ctx;
   15613             : };
   15614             : 
   15615             : static void dcerpc_spoolss_XcvData_r_done(struct tevent_req *subreq);
   15616             : 
   15617           0 : struct tevent_req *dcerpc_spoolss_XcvData_r_send(TALLOC_CTX *mem_ctx,
   15618             :         struct tevent_context *ev,
   15619             :         struct dcerpc_binding_handle *h,
   15620             :         struct spoolss_XcvData *r)
   15621             : {
   15622           0 :         struct tevent_req *req;
   15623           0 :         struct dcerpc_spoolss_XcvData_r_state *state;
   15624           0 :         struct tevent_req *subreq;
   15625             : 
   15626           0 :         req = tevent_req_create(mem_ctx, &state,
   15627             :                                 struct dcerpc_spoolss_XcvData_r_state);
   15628           0 :         if (req == NULL) {
   15629           0 :                 return NULL;
   15630             :         }
   15631             : 
   15632           0 :         state->out_mem_ctx = talloc_new(state);
   15633           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   15634           0 :                 return tevent_req_post(req, ev);
   15635             :         }
   15636             : 
   15637           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   15638             :                         NULL, &ndr_table_spoolss,
   15639           0 :                         NDR_SPOOLSS_XCVDATA, state->out_mem_ctx, r);
   15640           0 :         if (tevent_req_nomem(subreq, req)) {
   15641           0 :                 return tevent_req_post(req, ev);
   15642             :         }
   15643           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_XcvData_r_done, req);
   15644             : 
   15645           0 :         return req;
   15646             : }
   15647             : 
   15648           0 : static void dcerpc_spoolss_XcvData_r_done(struct tevent_req *subreq)
   15649             : {
   15650           0 :         struct tevent_req *req =
   15651           0 :                 tevent_req_callback_data(subreq,
   15652             :                 struct tevent_req);
   15653           0 :         NTSTATUS status;
   15654             : 
   15655           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   15656           0 :         TALLOC_FREE(subreq);
   15657           0 :         if (tevent_req_nterror(req, status)) {
   15658           0 :                 return;
   15659             :         }
   15660             : 
   15661           0 :         tevent_req_done(req);
   15662             : }
   15663             : 
   15664           0 : NTSTATUS dcerpc_spoolss_XcvData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   15665             : {
   15666           0 :         struct dcerpc_spoolss_XcvData_r_state *state =
   15667           0 :                 tevent_req_data(req,
   15668             :                 struct dcerpc_spoolss_XcvData_r_state);
   15669           0 :         NTSTATUS status;
   15670             : 
   15671           0 :         if (tevent_req_is_nterror(req, &status)) {
   15672           0 :                 tevent_req_received(req);
   15673           0 :                 return status;
   15674             :         }
   15675             : 
   15676           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15677             : 
   15678           0 :         tevent_req_received(req);
   15679           0 :         return NT_STATUS_OK;
   15680             : }
   15681             : 
   15682           0 : NTSTATUS dcerpc_spoolss_XcvData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_XcvData *r)
   15683             : {
   15684           0 :         NTSTATUS status;
   15685             : 
   15686           0 :         status = dcerpc_binding_handle_call(h,
   15687             :                         NULL, &ndr_table_spoolss,
   15688             :                         NDR_SPOOLSS_XCVDATA, mem_ctx, r);
   15689             : 
   15690           0 :         return status;
   15691             : }
   15692             : 
   15693             : struct dcerpc_spoolss_XcvData_state {
   15694             :         struct spoolss_XcvData orig;
   15695             :         struct spoolss_XcvData tmp;
   15696             :         TALLOC_CTX *out_mem_ctx;
   15697             : };
   15698             : 
   15699             : static void dcerpc_spoolss_XcvData_done(struct tevent_req *subreq);
   15700             : 
   15701           0 : struct tevent_req *dcerpc_spoolss_XcvData_send(TALLOC_CTX *mem_ctx,
   15702             :                                                struct tevent_context *ev,
   15703             :                                                struct dcerpc_binding_handle *h,
   15704             :                                                struct policy_handle *_handle /* [in] [ref] */,
   15705             :                                                const char *_function_name /* [in] [charset(UTF16)] */,
   15706             :                                                DATA_BLOB _in_data /* [in]  */,
   15707             :                                                uint32_t __in_data_length /* [in] [value(r->in.in_data.length)] */,
   15708             :                                                uint8_t *_out_data /* [out] [ref,size_is(out_data_size)] */,
   15709             :                                                uint32_t _out_data_size /* [in]  */,
   15710             :                                                uint32_t *_needed /* [out] [ref] */,
   15711             :                                                uint32_t *_status_code /* [in,out] [ref] */)
   15712             : {
   15713           0 :         struct tevent_req *req;
   15714           0 :         struct dcerpc_spoolss_XcvData_state *state;
   15715           0 :         struct tevent_req *subreq;
   15716             : 
   15717           0 :         req = tevent_req_create(mem_ctx, &state,
   15718             :                                 struct dcerpc_spoolss_XcvData_state);
   15719           0 :         if (req == NULL) {
   15720           0 :                 return NULL;
   15721             :         }
   15722           0 :         state->out_mem_ctx = NULL;
   15723             : 
   15724             :         /* In parameters */
   15725           0 :         state->orig.in.handle = _handle;
   15726           0 :         state->orig.in.function_name = _function_name;
   15727           0 :         state->orig.in.in_data = _in_data;
   15728           0 :         state->orig.in._in_data_length = __in_data_length;
   15729           0 :         state->orig.in.out_data_size = _out_data_size;
   15730           0 :         state->orig.in.status_code = _status_code;
   15731             : 
   15732             :         /* Out parameters */
   15733           0 :         state->orig.out.out_data = _out_data;
   15734           0 :         state->orig.out.needed = _needed;
   15735           0 :         state->orig.out.status_code = _status_code;
   15736             : 
   15737             :         /* Result */
   15738           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   15739             : 
   15740           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   15741             :                              "dcerpc_spoolss_XcvData_out_memory");
   15742           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   15743           0 :                 return tevent_req_post(req, ev);
   15744             :         }
   15745             : 
   15746             :         /* make a temporary copy, that we pass to the dispatch function */
   15747           0 :         state->tmp = state->orig;
   15748             : 
   15749           0 :         subreq = dcerpc_spoolss_XcvData_r_send(state, ev, h, &state->tmp);
   15750           0 :         if (tevent_req_nomem(subreq, req)) {
   15751           0 :                 return tevent_req_post(req, ev);
   15752             :         }
   15753           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_XcvData_done, req);
   15754           0 :         return req;
   15755             : }
   15756             : 
   15757           0 : static void dcerpc_spoolss_XcvData_done(struct tevent_req *subreq)
   15758             : {
   15759           0 :         struct tevent_req *req = tevent_req_callback_data(
   15760             :                 subreq, struct tevent_req);
   15761           0 :         struct dcerpc_spoolss_XcvData_state *state = tevent_req_data(
   15762             :                 req, struct dcerpc_spoolss_XcvData_state);
   15763           0 :         NTSTATUS status;
   15764           0 :         TALLOC_CTX *mem_ctx;
   15765             : 
   15766           0 :         if (state->out_mem_ctx) {
   15767           0 :                 mem_ctx = state->out_mem_ctx;
   15768             :         } else {
   15769           0 :                 mem_ctx = state;
   15770             :         }
   15771             : 
   15772           0 :         status = dcerpc_spoolss_XcvData_r_recv(subreq, mem_ctx);
   15773           0 :         TALLOC_FREE(subreq);
   15774           0 :         if (tevent_req_nterror(req, status)) {
   15775           0 :                 return;
   15776             :         }
   15777             : 
   15778             :         /* Copy out parameters */
   15779             :         {
   15780           0 :                 size_t _copy_len_out_data;
   15781           0 :                 _copy_len_out_data = state->tmp.in.out_data_size;
   15782           0 :                 if (state->orig.out.out_data != state->tmp.out.out_data) {
   15783           0 :                         memcpy(state->orig.out.out_data, state->tmp.out.out_data, _copy_len_out_data * sizeof(*state->orig.out.out_data));
   15784             :                 }
   15785             :         }
   15786           0 :         *state->orig.out.needed = *state->tmp.out.needed;
   15787           0 :         *state->orig.out.status_code = *state->tmp.out.status_code;
   15788             : 
   15789             :         /* Copy result */
   15790           0 :         state->orig.out.result = state->tmp.out.result;
   15791             : 
   15792             :         /* Reset temporary structure */
   15793           0 :         NDR_ZERO_STRUCT(state->tmp);
   15794             : 
   15795           0 :         tevent_req_done(req);
   15796             : }
   15797             : 
   15798           0 : NTSTATUS dcerpc_spoolss_XcvData_recv(struct tevent_req *req,
   15799             :                                      TALLOC_CTX *mem_ctx,
   15800             :                                      WERROR *result)
   15801             : {
   15802           0 :         struct dcerpc_spoolss_XcvData_state *state = tevent_req_data(
   15803             :                 req, struct dcerpc_spoolss_XcvData_state);
   15804           0 :         NTSTATUS status;
   15805             : 
   15806           0 :         if (tevent_req_is_nterror(req, &status)) {
   15807           0 :                 tevent_req_received(req);
   15808           0 :                 return status;
   15809             :         }
   15810             : 
   15811             :         /* Steal possible out parameters to the callers context */
   15812           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15813             : 
   15814             :         /* Return result */
   15815           0 :         *result = state->orig.out.result;
   15816             : 
   15817           0 :         tevent_req_received(req);
   15818           0 :         return NT_STATUS_OK;
   15819             : }
   15820             : 
   15821           0 : NTSTATUS dcerpc_spoolss_XcvData(struct dcerpc_binding_handle *h,
   15822             :                                 TALLOC_CTX *mem_ctx,
   15823             :                                 struct policy_handle *_handle /* [in] [ref] */,
   15824             :                                 const char *_function_name /* [in] [charset(UTF16)] */,
   15825             :                                 DATA_BLOB _in_data /* [in]  */,
   15826             :                                 uint32_t __in_data_length /* [in] [value(r->in.in_data.length)] */,
   15827             :                                 uint8_t *_out_data /* [out] [ref,size_is(out_data_size)] */,
   15828             :                                 uint32_t _out_data_size /* [in]  */,
   15829             :                                 uint32_t *_needed /* [out] [ref] */,
   15830             :                                 uint32_t *_status_code /* [in,out] [ref] */,
   15831             :                                 WERROR *result)
   15832             : {
   15833           0 :         struct spoolss_XcvData r;
   15834           0 :         NTSTATUS status;
   15835             : 
   15836             :         /* In parameters */
   15837           0 :         r.in.handle = _handle;
   15838           0 :         r.in.function_name = _function_name;
   15839           0 :         r.in.in_data = _in_data;
   15840           0 :         r.in._in_data_length = __in_data_length;
   15841           0 :         r.in.out_data_size = _out_data_size;
   15842           0 :         r.in.status_code = _status_code;
   15843             : 
   15844             :         /* Out parameters */
   15845           0 :         r.out.out_data = _out_data;
   15846           0 :         r.out.needed = _needed;
   15847           0 :         r.out.status_code = _status_code;
   15848             : 
   15849             :         /* Result */
   15850           0 :         NDR_ZERO_STRUCT(r.out.result);
   15851             : 
   15852           0 :         status = dcerpc_spoolss_XcvData_r(h, mem_ctx, &r);
   15853           0 :         if (!NT_STATUS_IS_OK(status)) {
   15854           0 :                 return status;
   15855             :         }
   15856             : 
   15857             :         /* Return variables */
   15858             :         {
   15859           0 :                 size_t _copy_len_out_data;
   15860           0 :                 _copy_len_out_data = r.in.out_data_size;
   15861           0 :                 if (_out_data != r.out.out_data) {
   15862           0 :                         memcpy(_out_data, r.out.out_data, _copy_len_out_data * sizeof(*_out_data));
   15863             :                 }
   15864             :         }
   15865           0 :         *_needed = *r.out.needed;
   15866           0 :         *_status_code = *r.out.status_code;
   15867             : 
   15868             :         /* Return result */
   15869           0 :         *result = r.out.result;
   15870             : 
   15871           0 :         return NT_STATUS_OK;
   15872             : }
   15873             : 
   15874             : struct dcerpc_spoolss_AddPrinterDriverEx_r_state {
   15875             :         TALLOC_CTX *out_mem_ctx;
   15876             : };
   15877             : 
   15878             : static void dcerpc_spoolss_AddPrinterDriverEx_r_done(struct tevent_req *subreq);
   15879             : 
   15880           0 : struct tevent_req *dcerpc_spoolss_AddPrinterDriverEx_r_send(TALLOC_CTX *mem_ctx,
   15881             :         struct tevent_context *ev,
   15882             :         struct dcerpc_binding_handle *h,
   15883             :         struct spoolss_AddPrinterDriverEx *r)
   15884             : {
   15885           0 :         struct tevent_req *req;
   15886           0 :         struct dcerpc_spoolss_AddPrinterDriverEx_r_state *state;
   15887           0 :         struct tevent_req *subreq;
   15888             : 
   15889           0 :         req = tevent_req_create(mem_ctx, &state,
   15890             :                                 struct dcerpc_spoolss_AddPrinterDriverEx_r_state);
   15891           0 :         if (req == NULL) {
   15892           0 :                 return NULL;
   15893             :         }
   15894             : 
   15895           0 :         state->out_mem_ctx = NULL;
   15896             : 
   15897           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   15898             :                         NULL, &ndr_table_spoolss,
   15899             :                         NDR_SPOOLSS_ADDPRINTERDRIVEREX, state, r);
   15900           0 :         if (tevent_req_nomem(subreq, req)) {
   15901           0 :                 return tevent_req_post(req, ev);
   15902             :         }
   15903           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinterDriverEx_r_done, req);
   15904             : 
   15905           0 :         return req;
   15906             : }
   15907             : 
   15908           0 : static void dcerpc_spoolss_AddPrinterDriverEx_r_done(struct tevent_req *subreq)
   15909             : {
   15910           0 :         struct tevent_req *req =
   15911           0 :                 tevent_req_callback_data(subreq,
   15912             :                 struct tevent_req);
   15913           0 :         NTSTATUS status;
   15914             : 
   15915           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   15916           0 :         TALLOC_FREE(subreq);
   15917           0 :         if (tevent_req_nterror(req, status)) {
   15918           0 :                 return;
   15919             :         }
   15920             : 
   15921           0 :         tevent_req_done(req);
   15922             : }
   15923             : 
   15924           0 : NTSTATUS dcerpc_spoolss_AddPrinterDriverEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   15925             : {
   15926           0 :         struct dcerpc_spoolss_AddPrinterDriverEx_r_state *state =
   15927           0 :                 tevent_req_data(req,
   15928             :                 struct dcerpc_spoolss_AddPrinterDriverEx_r_state);
   15929           0 :         NTSTATUS status;
   15930             : 
   15931           0 :         if (tevent_req_is_nterror(req, &status)) {
   15932           0 :                 tevent_req_received(req);
   15933           0 :                 return status;
   15934             :         }
   15935             : 
   15936           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   15937             : 
   15938           0 :         tevent_req_received(req);
   15939           0 :         return NT_STATUS_OK;
   15940             : }
   15941             : 
   15942           0 : NTSTATUS dcerpc_spoolss_AddPrinterDriverEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPrinterDriverEx *r)
   15943             : {
   15944           0 :         NTSTATUS status;
   15945             : 
   15946           0 :         status = dcerpc_binding_handle_call(h,
   15947             :                         NULL, &ndr_table_spoolss,
   15948             :                         NDR_SPOOLSS_ADDPRINTERDRIVEREX, mem_ctx, r);
   15949             : 
   15950           0 :         return status;
   15951             : }
   15952             : 
   15953             : struct dcerpc_spoolss_AddPrinterDriverEx_state {
   15954             :         struct spoolss_AddPrinterDriverEx orig;
   15955             :         struct spoolss_AddPrinterDriverEx tmp;
   15956             :         TALLOC_CTX *out_mem_ctx;
   15957             : };
   15958             : 
   15959             : static void dcerpc_spoolss_AddPrinterDriverEx_done(struct tevent_req *subreq);
   15960             : 
   15961           0 : struct tevent_req *dcerpc_spoolss_AddPrinterDriverEx_send(TALLOC_CTX *mem_ctx,
   15962             :                                                           struct tevent_context *ev,
   15963             :                                                           struct dcerpc_binding_handle *h,
   15964             :                                                           const char *_servername /* [in] [charset(UTF16),unique] */,
   15965             :                                                           struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */,
   15966             :                                                           uint32_t _flags /* [in]  */)
   15967             : {
   15968           0 :         struct tevent_req *req;
   15969           0 :         struct dcerpc_spoolss_AddPrinterDriverEx_state *state;
   15970           0 :         struct tevent_req *subreq;
   15971             : 
   15972           0 :         req = tevent_req_create(mem_ctx, &state,
   15973             :                                 struct dcerpc_spoolss_AddPrinterDriverEx_state);
   15974           0 :         if (req == NULL) {
   15975           0 :                 return NULL;
   15976             :         }
   15977           0 :         state->out_mem_ctx = NULL;
   15978             : 
   15979             :         /* In parameters */
   15980           0 :         state->orig.in.servername = _servername;
   15981           0 :         state->orig.in.info_ctr = _info_ctr;
   15982           0 :         state->orig.in.flags = _flags;
   15983             : 
   15984             :         /* Out parameters */
   15985             : 
   15986             :         /* Result */
   15987           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   15988             : 
   15989             :         /* make a temporary copy, that we pass to the dispatch function */
   15990           0 :         state->tmp = state->orig;
   15991             : 
   15992           0 :         subreq = dcerpc_spoolss_AddPrinterDriverEx_r_send(state, ev, h, &state->tmp);
   15993           0 :         if (tevent_req_nomem(subreq, req)) {
   15994           0 :                 return tevent_req_post(req, ev);
   15995             :         }
   15996           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinterDriverEx_done, req);
   15997           0 :         return req;
   15998             : }
   15999             : 
   16000           0 : static void dcerpc_spoolss_AddPrinterDriverEx_done(struct tevent_req *subreq)
   16001             : {
   16002           0 :         struct tevent_req *req = tevent_req_callback_data(
   16003             :                 subreq, struct tevent_req);
   16004           0 :         struct dcerpc_spoolss_AddPrinterDriverEx_state *state = tevent_req_data(
   16005             :                 req, struct dcerpc_spoolss_AddPrinterDriverEx_state);
   16006           0 :         NTSTATUS status;
   16007           0 :         TALLOC_CTX *mem_ctx;
   16008             : 
   16009           0 :         if (state->out_mem_ctx) {
   16010           0 :                 mem_ctx = state->out_mem_ctx;
   16011             :         } else {
   16012           0 :                 mem_ctx = state;
   16013             :         }
   16014             : 
   16015           0 :         status = dcerpc_spoolss_AddPrinterDriverEx_r_recv(subreq, mem_ctx);
   16016           0 :         TALLOC_FREE(subreq);
   16017           0 :         if (tevent_req_nterror(req, status)) {
   16018           0 :                 return;
   16019             :         }
   16020             : 
   16021             :         /* Copy out parameters */
   16022             : 
   16023             :         /* Copy result */
   16024           0 :         state->orig.out.result = state->tmp.out.result;
   16025             : 
   16026             :         /* Reset temporary structure */
   16027           0 :         NDR_ZERO_STRUCT(state->tmp);
   16028             : 
   16029           0 :         tevent_req_done(req);
   16030             : }
   16031             : 
   16032           0 : NTSTATUS dcerpc_spoolss_AddPrinterDriverEx_recv(struct tevent_req *req,
   16033             :                                                 TALLOC_CTX *mem_ctx,
   16034             :                                                 WERROR *result)
   16035             : {
   16036           0 :         struct dcerpc_spoolss_AddPrinterDriverEx_state *state = tevent_req_data(
   16037             :                 req, struct dcerpc_spoolss_AddPrinterDriverEx_state);
   16038           0 :         NTSTATUS status;
   16039             : 
   16040           0 :         if (tevent_req_is_nterror(req, &status)) {
   16041           0 :                 tevent_req_received(req);
   16042           0 :                 return status;
   16043             :         }
   16044             : 
   16045             :         /* Steal possible out parameters to the callers context */
   16046           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16047             : 
   16048             :         /* Return result */
   16049           0 :         *result = state->orig.out.result;
   16050             : 
   16051           0 :         tevent_req_received(req);
   16052           0 :         return NT_STATUS_OK;
   16053             : }
   16054             : 
   16055           0 : NTSTATUS dcerpc_spoolss_AddPrinterDriverEx(struct dcerpc_binding_handle *h,
   16056             :                                            TALLOC_CTX *mem_ctx,
   16057             :                                            const char *_servername /* [in] [charset(UTF16),unique] */,
   16058             :                                            struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */,
   16059             :                                            uint32_t _flags /* [in]  */,
   16060             :                                            WERROR *result)
   16061             : {
   16062           0 :         struct spoolss_AddPrinterDriverEx r;
   16063           0 :         NTSTATUS status;
   16064             : 
   16065             :         /* In parameters */
   16066           0 :         r.in.servername = _servername;
   16067           0 :         r.in.info_ctr = _info_ctr;
   16068           0 :         r.in.flags = _flags;
   16069             : 
   16070             :         /* Out parameters */
   16071             : 
   16072             :         /* Result */
   16073           0 :         NDR_ZERO_STRUCT(r.out.result);
   16074             : 
   16075           0 :         status = dcerpc_spoolss_AddPrinterDriverEx_r(h, mem_ctx, &r);
   16076           0 :         if (!NT_STATUS_IS_OK(status)) {
   16077           0 :                 return status;
   16078             :         }
   16079             : 
   16080             :         /* Return variables */
   16081             : 
   16082             :         /* Return result */
   16083           0 :         *result = r.out.result;
   16084             : 
   16085           0 :         return NT_STATUS_OK;
   16086             : }
   16087             : 
   16088             : struct dcerpc_spoolss_SendRecvBidiData_r_state {
   16089             :         TALLOC_CTX *out_mem_ctx;
   16090             : };
   16091             : 
   16092             : static void dcerpc_spoolss_SendRecvBidiData_r_done(struct tevent_req *subreq);
   16093             : 
   16094           0 : struct tevent_req *dcerpc_spoolss_SendRecvBidiData_r_send(TALLOC_CTX *mem_ctx,
   16095             :         struct tevent_context *ev,
   16096             :         struct dcerpc_binding_handle *h,
   16097             :         struct spoolss_SendRecvBidiData *r)
   16098             : {
   16099           0 :         struct tevent_req *req;
   16100           0 :         struct dcerpc_spoolss_SendRecvBidiData_r_state *state;
   16101           0 :         struct tevent_req *subreq;
   16102             : 
   16103           0 :         req = tevent_req_create(mem_ctx, &state,
   16104             :                                 struct dcerpc_spoolss_SendRecvBidiData_r_state);
   16105           0 :         if (req == NULL) {
   16106           0 :                 return NULL;
   16107             :         }
   16108             : 
   16109           0 :         state->out_mem_ctx = talloc_new(state);
   16110           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16111           0 :                 return tevent_req_post(req, ev);
   16112             :         }
   16113             : 
   16114           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   16115             :                         NULL, &ndr_table_spoolss,
   16116           0 :                         NDR_SPOOLSS_SENDRECVBIDIDATA, state->out_mem_ctx, r);
   16117           0 :         if (tevent_req_nomem(subreq, req)) {
   16118           0 :                 return tevent_req_post(req, ev);
   16119             :         }
   16120           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_SendRecvBidiData_r_done, req);
   16121             : 
   16122           0 :         return req;
   16123             : }
   16124             : 
   16125           0 : static void dcerpc_spoolss_SendRecvBidiData_r_done(struct tevent_req *subreq)
   16126             : {
   16127           0 :         struct tevent_req *req =
   16128           0 :                 tevent_req_callback_data(subreq,
   16129             :                 struct tevent_req);
   16130           0 :         NTSTATUS status;
   16131             : 
   16132           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   16133           0 :         TALLOC_FREE(subreq);
   16134           0 :         if (tevent_req_nterror(req, status)) {
   16135           0 :                 return;
   16136             :         }
   16137             : 
   16138           0 :         tevent_req_done(req);
   16139             : }
   16140             : 
   16141           0 : NTSTATUS dcerpc_spoolss_SendRecvBidiData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   16142             : {
   16143           0 :         struct dcerpc_spoolss_SendRecvBidiData_r_state *state =
   16144           0 :                 tevent_req_data(req,
   16145             :                 struct dcerpc_spoolss_SendRecvBidiData_r_state);
   16146           0 :         NTSTATUS status;
   16147             : 
   16148           0 :         if (tevent_req_is_nterror(req, &status)) {
   16149           0 :                 tevent_req_received(req);
   16150           0 :                 return status;
   16151             :         }
   16152             : 
   16153           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16154             : 
   16155           0 :         tevent_req_received(req);
   16156           0 :         return NT_STATUS_OK;
   16157             : }
   16158             : 
   16159           0 : NTSTATUS dcerpc_spoolss_SendRecvBidiData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_SendRecvBidiData *r)
   16160             : {
   16161           0 :         NTSTATUS status;
   16162             : 
   16163           0 :         status = dcerpc_binding_handle_call(h,
   16164             :                         NULL, &ndr_table_spoolss,
   16165             :                         NDR_SPOOLSS_SENDRECVBIDIDATA, mem_ctx, r);
   16166             : 
   16167           0 :         return status;
   16168             : }
   16169             : 
   16170             : struct dcerpc_spoolss_SendRecvBidiData_state {
   16171             :         struct spoolss_SendRecvBidiData orig;
   16172             :         struct spoolss_SendRecvBidiData tmp;
   16173             :         TALLOC_CTX *out_mem_ctx;
   16174             : };
   16175             : 
   16176             : static void dcerpc_spoolss_SendRecvBidiData_done(struct tevent_req *subreq);
   16177             : 
   16178           0 : struct tevent_req *dcerpc_spoolss_SendRecvBidiData_send(TALLOC_CTX *mem_ctx,
   16179             :                                                         struct tevent_context *ev,
   16180             :                                                         struct dcerpc_binding_handle *h,
   16181             :                                                         struct policy_handle _hPrinter /* [in]  */,
   16182             :                                                         const char *_pAction /* [in] [charset(UTF16),unique] */,
   16183             :                                                         struct RPC_BIDI_REQUEST_CONTAINER *_pReqData /* [in] [ref] */,
   16184             :                                                         struct RPC_BIDI_RESPONSE_CONTAINER **_ppRespData /* [out] [ref] */)
   16185             : {
   16186           0 :         struct tevent_req *req;
   16187           0 :         struct dcerpc_spoolss_SendRecvBidiData_state *state;
   16188           0 :         struct tevent_req *subreq;
   16189             : 
   16190           0 :         req = tevent_req_create(mem_ctx, &state,
   16191             :                                 struct dcerpc_spoolss_SendRecvBidiData_state);
   16192           0 :         if (req == NULL) {
   16193           0 :                 return NULL;
   16194             :         }
   16195           0 :         state->out_mem_ctx = NULL;
   16196             : 
   16197             :         /* In parameters */
   16198           0 :         state->orig.in.hPrinter = _hPrinter;
   16199           0 :         state->orig.in.pAction = _pAction;
   16200           0 :         state->orig.in.pReqData = _pReqData;
   16201             : 
   16202             :         /* Out parameters */
   16203           0 :         state->orig.out.ppRespData = _ppRespData;
   16204             : 
   16205             :         /* Result */
   16206           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   16207             : 
   16208           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   16209             :                              "dcerpc_spoolss_SendRecvBidiData_out_memory");
   16210           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16211           0 :                 return tevent_req_post(req, ev);
   16212             :         }
   16213             : 
   16214             :         /* make a temporary copy, that we pass to the dispatch function */
   16215           0 :         state->tmp = state->orig;
   16216             : 
   16217           0 :         subreq = dcerpc_spoolss_SendRecvBidiData_r_send(state, ev, h, &state->tmp);
   16218           0 :         if (tevent_req_nomem(subreq, req)) {
   16219           0 :                 return tevent_req_post(req, ev);
   16220             :         }
   16221           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_SendRecvBidiData_done, req);
   16222           0 :         return req;
   16223             : }
   16224             : 
   16225           0 : static void dcerpc_spoolss_SendRecvBidiData_done(struct tevent_req *subreq)
   16226             : {
   16227           0 :         struct tevent_req *req = tevent_req_callback_data(
   16228             :                 subreq, struct tevent_req);
   16229           0 :         struct dcerpc_spoolss_SendRecvBidiData_state *state = tevent_req_data(
   16230             :                 req, struct dcerpc_spoolss_SendRecvBidiData_state);
   16231           0 :         NTSTATUS status;
   16232           0 :         TALLOC_CTX *mem_ctx;
   16233             : 
   16234           0 :         if (state->out_mem_ctx) {
   16235           0 :                 mem_ctx = state->out_mem_ctx;
   16236             :         } else {
   16237           0 :                 mem_ctx = state;
   16238             :         }
   16239             : 
   16240           0 :         status = dcerpc_spoolss_SendRecvBidiData_r_recv(subreq, mem_ctx);
   16241           0 :         TALLOC_FREE(subreq);
   16242           0 :         if (tevent_req_nterror(req, status)) {
   16243           0 :                 return;
   16244             :         }
   16245             : 
   16246             :         /* Copy out parameters */
   16247           0 :         *state->orig.out.ppRespData = *state->tmp.out.ppRespData;
   16248             : 
   16249             :         /* Copy result */
   16250           0 :         state->orig.out.result = state->tmp.out.result;
   16251             : 
   16252             :         /* Reset temporary structure */
   16253           0 :         NDR_ZERO_STRUCT(state->tmp);
   16254             : 
   16255           0 :         tevent_req_done(req);
   16256             : }
   16257             : 
   16258           0 : NTSTATUS dcerpc_spoolss_SendRecvBidiData_recv(struct tevent_req *req,
   16259             :                                               TALLOC_CTX *mem_ctx,
   16260             :                                               WERROR *result)
   16261             : {
   16262           0 :         struct dcerpc_spoolss_SendRecvBidiData_state *state = tevent_req_data(
   16263             :                 req, struct dcerpc_spoolss_SendRecvBidiData_state);
   16264           0 :         NTSTATUS status;
   16265             : 
   16266           0 :         if (tevent_req_is_nterror(req, &status)) {
   16267           0 :                 tevent_req_received(req);
   16268           0 :                 return status;
   16269             :         }
   16270             : 
   16271             :         /* Steal possible out parameters to the callers context */
   16272           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16273             : 
   16274             :         /* Return result */
   16275           0 :         *result = state->orig.out.result;
   16276             : 
   16277           0 :         tevent_req_received(req);
   16278           0 :         return NT_STATUS_OK;
   16279             : }
   16280             : 
   16281           0 : NTSTATUS dcerpc_spoolss_SendRecvBidiData(struct dcerpc_binding_handle *h,
   16282             :                                          TALLOC_CTX *mem_ctx,
   16283             :                                          struct policy_handle _hPrinter /* [in]  */,
   16284             :                                          const char *_pAction /* [in] [charset(UTF16),unique] */,
   16285             :                                          struct RPC_BIDI_REQUEST_CONTAINER *_pReqData /* [in] [ref] */,
   16286             :                                          struct RPC_BIDI_RESPONSE_CONTAINER **_ppRespData /* [out] [ref] */,
   16287             :                                          WERROR *result)
   16288             : {
   16289           0 :         struct spoolss_SendRecvBidiData r;
   16290           0 :         NTSTATUS status;
   16291             : 
   16292             :         /* In parameters */
   16293           0 :         r.in.hPrinter = _hPrinter;
   16294           0 :         r.in.pAction = _pAction;
   16295           0 :         r.in.pReqData = _pReqData;
   16296             : 
   16297             :         /* Out parameters */
   16298           0 :         r.out.ppRespData = _ppRespData;
   16299             : 
   16300             :         /* Result */
   16301           0 :         NDR_ZERO_STRUCT(r.out.result);
   16302             : 
   16303           0 :         status = dcerpc_spoolss_SendRecvBidiData_r(h, mem_ctx, &r);
   16304           0 :         if (!NT_STATUS_IS_OK(status)) {
   16305           0 :                 return status;
   16306             :         }
   16307             : 
   16308             :         /* Return variables */
   16309           0 :         *_ppRespData = *r.out.ppRespData;
   16310             : 
   16311             :         /* Return result */
   16312           0 :         *result = r.out.result;
   16313             : 
   16314           0 :         return NT_STATUS_OK;
   16315             : }
   16316             : 
   16317             : struct dcerpc_spoolss_GetCorePrinterDrivers_r_state {
   16318             :         TALLOC_CTX *out_mem_ctx;
   16319             : };
   16320             : 
   16321             : static void dcerpc_spoolss_GetCorePrinterDrivers_r_done(struct tevent_req *subreq);
   16322             : 
   16323           0 : struct tevent_req *dcerpc_spoolss_GetCorePrinterDrivers_r_send(TALLOC_CTX *mem_ctx,
   16324             :         struct tevent_context *ev,
   16325             :         struct dcerpc_binding_handle *h,
   16326             :         struct spoolss_GetCorePrinterDrivers *r)
   16327             : {
   16328           0 :         struct tevent_req *req;
   16329           0 :         struct dcerpc_spoolss_GetCorePrinterDrivers_r_state *state;
   16330           0 :         struct tevent_req *subreq;
   16331             : 
   16332           0 :         req = tevent_req_create(mem_ctx, &state,
   16333             :                                 struct dcerpc_spoolss_GetCorePrinterDrivers_r_state);
   16334           0 :         if (req == NULL) {
   16335           0 :                 return NULL;
   16336             :         }
   16337             : 
   16338           0 :         state->out_mem_ctx = talloc_new(state);
   16339           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16340           0 :                 return tevent_req_post(req, ev);
   16341             :         }
   16342             : 
   16343           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   16344             :                         NULL, &ndr_table_spoolss,
   16345           0 :                         NDR_SPOOLSS_GETCOREPRINTERDRIVERS, state->out_mem_ctx, r);
   16346           0 :         if (tevent_req_nomem(subreq, req)) {
   16347           0 :                 return tevent_req_post(req, ev);
   16348             :         }
   16349           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_GetCorePrinterDrivers_r_done, req);
   16350             : 
   16351           0 :         return req;
   16352             : }
   16353             : 
   16354           0 : static void dcerpc_spoolss_GetCorePrinterDrivers_r_done(struct tevent_req *subreq)
   16355             : {
   16356           0 :         struct tevent_req *req =
   16357           0 :                 tevent_req_callback_data(subreq,
   16358             :                 struct tevent_req);
   16359           0 :         NTSTATUS status;
   16360             : 
   16361           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   16362           0 :         TALLOC_FREE(subreq);
   16363           0 :         if (tevent_req_nterror(req, status)) {
   16364           0 :                 return;
   16365             :         }
   16366             : 
   16367           0 :         tevent_req_done(req);
   16368             : }
   16369             : 
   16370           0 : NTSTATUS dcerpc_spoolss_GetCorePrinterDrivers_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   16371             : {
   16372           0 :         struct dcerpc_spoolss_GetCorePrinterDrivers_r_state *state =
   16373           0 :                 tevent_req_data(req,
   16374             :                 struct dcerpc_spoolss_GetCorePrinterDrivers_r_state);
   16375           0 :         NTSTATUS status;
   16376             : 
   16377           0 :         if (tevent_req_is_nterror(req, &status)) {
   16378           0 :                 tevent_req_received(req);
   16379           0 :                 return status;
   16380             :         }
   16381             : 
   16382           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16383             : 
   16384           0 :         tevent_req_received(req);
   16385           0 :         return NT_STATUS_OK;
   16386             : }
   16387             : 
   16388           8 : NTSTATUS dcerpc_spoolss_GetCorePrinterDrivers_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetCorePrinterDrivers *r)
   16389             : {
   16390           0 :         NTSTATUS status;
   16391             : 
   16392           8 :         status = dcerpc_binding_handle_call(h,
   16393             :                         NULL, &ndr_table_spoolss,
   16394             :                         NDR_SPOOLSS_GETCOREPRINTERDRIVERS, mem_ctx, r);
   16395             : 
   16396           8 :         return status;
   16397             : }
   16398             : 
   16399             : struct dcerpc_spoolss_GetCorePrinterDrivers_state {
   16400             :         struct spoolss_GetCorePrinterDrivers orig;
   16401             :         struct spoolss_GetCorePrinterDrivers tmp;
   16402             :         TALLOC_CTX *out_mem_ctx;
   16403             : };
   16404             : 
   16405             : static void dcerpc_spoolss_GetCorePrinterDrivers_done(struct tevent_req *subreq);
   16406             : 
   16407           0 : struct tevent_req *dcerpc_spoolss_GetCorePrinterDrivers_send(TALLOC_CTX *mem_ctx,
   16408             :                                                              struct tevent_context *ev,
   16409             :                                                              struct dcerpc_binding_handle *h,
   16410             :                                                              const char *_servername /* [in] [charset(UTF16),unique] */,
   16411             :                                                              const char *_architecture /* [in] [charset(UTF16),ref] */,
   16412             :                                                              uint32_t _core_driver_size /* [in]  */,
   16413             :                                                              uint16_t *_core_driver_dependencies /* [in] [ref,size_is(core_driver_size)] */,
   16414             :                                                              uint32_t _core_printer_driver_count /* [in]  */,
   16415             :                                                              struct spoolss_CorePrinterDriver *_core_printer_drivers /* [out] [ref,size_is(core_printer_driver_count)] */)
   16416             : {
   16417           0 :         struct tevent_req *req;
   16418           0 :         struct dcerpc_spoolss_GetCorePrinterDrivers_state *state;
   16419           0 :         struct tevent_req *subreq;
   16420             : 
   16421           0 :         req = tevent_req_create(mem_ctx, &state,
   16422             :                                 struct dcerpc_spoolss_GetCorePrinterDrivers_state);
   16423           0 :         if (req == NULL) {
   16424           0 :                 return NULL;
   16425             :         }
   16426           0 :         state->out_mem_ctx = NULL;
   16427             : 
   16428             :         /* In parameters */
   16429           0 :         state->orig.in.servername = _servername;
   16430           0 :         state->orig.in.architecture = _architecture;
   16431           0 :         state->orig.in.core_driver_size = _core_driver_size;
   16432           0 :         state->orig.in.core_driver_dependencies = _core_driver_dependencies;
   16433           0 :         state->orig.in.core_printer_driver_count = _core_printer_driver_count;
   16434             : 
   16435             :         /* Out parameters */
   16436           0 :         state->orig.out.core_printer_drivers = _core_printer_drivers;
   16437             : 
   16438             :         /* Result */
   16439           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   16440             : 
   16441           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   16442             :                              "dcerpc_spoolss_GetCorePrinterDrivers_out_memory");
   16443           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16444           0 :                 return tevent_req_post(req, ev);
   16445             :         }
   16446             : 
   16447             :         /* make a temporary copy, that we pass to the dispatch function */
   16448           0 :         state->tmp = state->orig;
   16449             : 
   16450           0 :         subreq = dcerpc_spoolss_GetCorePrinterDrivers_r_send(state, ev, h, &state->tmp);
   16451           0 :         if (tevent_req_nomem(subreq, req)) {
   16452           0 :                 return tevent_req_post(req, ev);
   16453             :         }
   16454           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_GetCorePrinterDrivers_done, req);
   16455           0 :         return req;
   16456             : }
   16457             : 
   16458           0 : static void dcerpc_spoolss_GetCorePrinterDrivers_done(struct tevent_req *subreq)
   16459             : {
   16460           0 :         struct tevent_req *req = tevent_req_callback_data(
   16461             :                 subreq, struct tevent_req);
   16462           0 :         struct dcerpc_spoolss_GetCorePrinterDrivers_state *state = tevent_req_data(
   16463             :                 req, struct dcerpc_spoolss_GetCorePrinterDrivers_state);
   16464           0 :         NTSTATUS status;
   16465           0 :         TALLOC_CTX *mem_ctx;
   16466             : 
   16467           0 :         if (state->out_mem_ctx) {
   16468           0 :                 mem_ctx = state->out_mem_ctx;
   16469             :         } else {
   16470           0 :                 mem_ctx = state;
   16471             :         }
   16472             : 
   16473           0 :         status = dcerpc_spoolss_GetCorePrinterDrivers_r_recv(subreq, mem_ctx);
   16474           0 :         TALLOC_FREE(subreq);
   16475           0 :         if (tevent_req_nterror(req, status)) {
   16476           0 :                 return;
   16477             :         }
   16478             : 
   16479             :         /* Copy out parameters */
   16480             :         {
   16481           0 :                 size_t _copy_len_core_printer_drivers;
   16482           0 :                 _copy_len_core_printer_drivers = state->tmp.in.core_printer_driver_count;
   16483           0 :                 if (state->orig.out.core_printer_drivers != state->tmp.out.core_printer_drivers) {
   16484           0 :                         memcpy(state->orig.out.core_printer_drivers, state->tmp.out.core_printer_drivers, _copy_len_core_printer_drivers * sizeof(*state->orig.out.core_printer_drivers));
   16485             :                 }
   16486             :         }
   16487             : 
   16488             :         /* Copy result */
   16489           0 :         state->orig.out.result = state->tmp.out.result;
   16490             : 
   16491             :         /* Reset temporary structure */
   16492           0 :         NDR_ZERO_STRUCT(state->tmp);
   16493             : 
   16494           0 :         tevent_req_done(req);
   16495             : }
   16496             : 
   16497           0 : NTSTATUS dcerpc_spoolss_GetCorePrinterDrivers_recv(struct tevent_req *req,
   16498             :                                                    TALLOC_CTX *mem_ctx,
   16499             :                                                    HRESULT *result)
   16500             : {
   16501           0 :         struct dcerpc_spoolss_GetCorePrinterDrivers_state *state = tevent_req_data(
   16502             :                 req, struct dcerpc_spoolss_GetCorePrinterDrivers_state);
   16503           0 :         NTSTATUS status;
   16504             : 
   16505           0 :         if (tevent_req_is_nterror(req, &status)) {
   16506           0 :                 tevent_req_received(req);
   16507           0 :                 return status;
   16508             :         }
   16509             : 
   16510             :         /* Steal possible out parameters to the callers context */
   16511           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16512             : 
   16513             :         /* Return result */
   16514           0 :         *result = state->orig.out.result;
   16515             : 
   16516           0 :         tevent_req_received(req);
   16517           0 :         return NT_STATUS_OK;
   16518             : }
   16519             : 
   16520           0 : NTSTATUS dcerpc_spoolss_GetCorePrinterDrivers(struct dcerpc_binding_handle *h,
   16521             :                                               TALLOC_CTX *mem_ctx,
   16522             :                                               const char *_servername /* [in] [charset(UTF16),unique] */,
   16523             :                                               const char *_architecture /* [in] [charset(UTF16),ref] */,
   16524             :                                               uint32_t _core_driver_size /* [in]  */,
   16525             :                                               uint16_t *_core_driver_dependencies /* [in] [ref,size_is(core_driver_size)] */,
   16526             :                                               uint32_t _core_printer_driver_count /* [in]  */,
   16527             :                                               struct spoolss_CorePrinterDriver *_core_printer_drivers /* [out] [ref,size_is(core_printer_driver_count)] */,
   16528             :                                               HRESULT *result)
   16529             : {
   16530           0 :         struct spoolss_GetCorePrinterDrivers r;
   16531           0 :         NTSTATUS status;
   16532             : 
   16533             :         /* In parameters */
   16534           0 :         r.in.servername = _servername;
   16535           0 :         r.in.architecture = _architecture;
   16536           0 :         r.in.core_driver_size = _core_driver_size;
   16537           0 :         r.in.core_driver_dependencies = _core_driver_dependencies;
   16538           0 :         r.in.core_printer_driver_count = _core_printer_driver_count;
   16539             : 
   16540             :         /* Out parameters */
   16541           0 :         r.out.core_printer_drivers = _core_printer_drivers;
   16542             : 
   16543             :         /* Result */
   16544           0 :         NDR_ZERO_STRUCT(r.out.result);
   16545             : 
   16546           0 :         status = dcerpc_spoolss_GetCorePrinterDrivers_r(h, mem_ctx, &r);
   16547           0 :         if (!NT_STATUS_IS_OK(status)) {
   16548           0 :                 return status;
   16549             :         }
   16550             : 
   16551             :         /* Return variables */
   16552             :         {
   16553           0 :                 size_t _copy_len_core_printer_drivers;
   16554           0 :                 _copy_len_core_printer_drivers = r.in.core_printer_driver_count;
   16555           0 :                 if (_core_printer_drivers != r.out.core_printer_drivers) {
   16556           0 :                         memcpy(_core_printer_drivers, r.out.core_printer_drivers, _copy_len_core_printer_drivers * sizeof(*_core_printer_drivers));
   16557             :                 }
   16558             :         }
   16559             : 
   16560             :         /* Return result */
   16561           0 :         *result = r.out.result;
   16562             : 
   16563           0 :         return NT_STATUS_OK;
   16564             : }
   16565             : 
   16566             : struct dcerpc_spoolss_GetPrinterDriverPackagePath_r_state {
   16567             :         TALLOC_CTX *out_mem_ctx;
   16568             : };
   16569             : 
   16570             : static void dcerpc_spoolss_GetPrinterDriverPackagePath_r_done(struct tevent_req *subreq);
   16571             : 
   16572           0 : struct tevent_req *dcerpc_spoolss_GetPrinterDriverPackagePath_r_send(TALLOC_CTX *mem_ctx,
   16573             :         struct tevent_context *ev,
   16574             :         struct dcerpc_binding_handle *h,
   16575             :         struct spoolss_GetPrinterDriverPackagePath *r)
   16576             : {
   16577           0 :         struct tevent_req *req;
   16578           0 :         struct dcerpc_spoolss_GetPrinterDriverPackagePath_r_state *state;
   16579           0 :         struct tevent_req *subreq;
   16580             : 
   16581           0 :         req = tevent_req_create(mem_ctx, &state,
   16582             :                                 struct dcerpc_spoolss_GetPrinterDriverPackagePath_r_state);
   16583           0 :         if (req == NULL) {
   16584           0 :                 return NULL;
   16585             :         }
   16586             : 
   16587           0 :         state->out_mem_ctx = talloc_new(state);
   16588           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16589           0 :                 return tevent_req_post(req, ev);
   16590             :         }
   16591             : 
   16592           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   16593             :                         NULL, &ndr_table_spoolss,
   16594           0 :                         NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH, state->out_mem_ctx, r);
   16595           0 :         if (tevent_req_nomem(subreq, req)) {
   16596           0 :                 return tevent_req_post(req, ev);
   16597             :         }
   16598           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDriverPackagePath_r_done, req);
   16599             : 
   16600           0 :         return req;
   16601             : }
   16602             : 
   16603           0 : static void dcerpc_spoolss_GetPrinterDriverPackagePath_r_done(struct tevent_req *subreq)
   16604             : {
   16605           0 :         struct tevent_req *req =
   16606           0 :                 tevent_req_callback_data(subreq,
   16607             :                 struct tevent_req);
   16608           0 :         NTSTATUS status;
   16609             : 
   16610           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   16611           0 :         TALLOC_FREE(subreq);
   16612           0 :         if (tevent_req_nterror(req, status)) {
   16613           0 :                 return;
   16614             :         }
   16615             : 
   16616           0 :         tevent_req_done(req);
   16617             : }
   16618             : 
   16619           0 : NTSTATUS dcerpc_spoolss_GetPrinterDriverPackagePath_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   16620             : {
   16621           0 :         struct dcerpc_spoolss_GetPrinterDriverPackagePath_r_state *state =
   16622           0 :                 tevent_req_data(req,
   16623             :                 struct dcerpc_spoolss_GetPrinterDriverPackagePath_r_state);
   16624           0 :         NTSTATUS status;
   16625             : 
   16626           0 :         if (tevent_req_is_nterror(req, &status)) {
   16627           0 :                 tevent_req_received(req);
   16628           0 :                 return status;
   16629             :         }
   16630             : 
   16631           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16632             : 
   16633           0 :         tevent_req_received(req);
   16634           0 :         return NT_STATUS_OK;
   16635             : }
   16636             : 
   16637           4 : NTSTATUS dcerpc_spoolss_GetPrinterDriverPackagePath_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetPrinterDriverPackagePath *r)
   16638             : {
   16639           0 :         NTSTATUS status;
   16640             : 
   16641           4 :         status = dcerpc_binding_handle_call(h,
   16642             :                         NULL, &ndr_table_spoolss,
   16643             :                         NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH, mem_ctx, r);
   16644             : 
   16645           4 :         return status;
   16646             : }
   16647             : 
   16648             : struct dcerpc_spoolss_GetPrinterDriverPackagePath_state {
   16649             :         struct spoolss_GetPrinterDriverPackagePath orig;
   16650             :         struct spoolss_GetPrinterDriverPackagePath tmp;
   16651             :         TALLOC_CTX *out_mem_ctx;
   16652             : };
   16653             : 
   16654             : static void dcerpc_spoolss_GetPrinterDriverPackagePath_done(struct tevent_req *subreq);
   16655             : 
   16656           0 : struct tevent_req *dcerpc_spoolss_GetPrinterDriverPackagePath_send(TALLOC_CTX *mem_ctx,
   16657             :                                                                    struct tevent_context *ev,
   16658             :                                                                    struct dcerpc_binding_handle *h,
   16659             :                                                                    const char *_servername /* [in] [charset(UTF16),unique] */,
   16660             :                                                                    const char *_architecture /* [in] [charset(UTF16),ref] */,
   16661             :                                                                    const char *_language /* [in] [charset(UTF16),unique] */,
   16662             :                                                                    const char *_package_id /* [in] [charset(UTF16),ref] */,
   16663             :                                                                    const char *_driver_package_cab /* [in,out] [charset(UTF16),size_is(driver_package_cab_size),unique] */,
   16664             :                                                                    uint32_t _driver_package_cab_size /* [in]  */,
   16665             :                                                                    uint32_t *_required /* [out] [ref] */)
   16666             : {
   16667           0 :         struct tevent_req *req;
   16668           0 :         struct dcerpc_spoolss_GetPrinterDriverPackagePath_state *state;
   16669           0 :         struct tevent_req *subreq;
   16670             : 
   16671           0 :         req = tevent_req_create(mem_ctx, &state,
   16672             :                                 struct dcerpc_spoolss_GetPrinterDriverPackagePath_state);
   16673           0 :         if (req == NULL) {
   16674           0 :                 return NULL;
   16675             :         }
   16676           0 :         state->out_mem_ctx = NULL;
   16677             : 
   16678             :         /* In parameters */
   16679           0 :         state->orig.in.servername = _servername;
   16680           0 :         state->orig.in.architecture = _architecture;
   16681           0 :         state->orig.in.language = _language;
   16682           0 :         state->orig.in.package_id = _package_id;
   16683           0 :         state->orig.in.driver_package_cab = _driver_package_cab;
   16684           0 :         state->orig.in.driver_package_cab_size = _driver_package_cab_size;
   16685             : 
   16686             :         /* Out parameters */
   16687           0 :         state->orig.out.driver_package_cab = _driver_package_cab;
   16688           0 :         state->orig.out.required = _required;
   16689             : 
   16690             :         /* Result */
   16691           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   16692             : 
   16693           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   16694             :                              "dcerpc_spoolss_GetPrinterDriverPackagePath_out_memory");
   16695           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16696           0 :                 return tevent_req_post(req, ev);
   16697             :         }
   16698             : 
   16699             :         /* make a temporary copy, that we pass to the dispatch function */
   16700           0 :         state->tmp = state->orig;
   16701             : 
   16702           0 :         subreq = dcerpc_spoolss_GetPrinterDriverPackagePath_r_send(state, ev, h, &state->tmp);
   16703           0 :         if (tevent_req_nomem(subreq, req)) {
   16704           0 :                 return tevent_req_post(req, ev);
   16705             :         }
   16706           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDriverPackagePath_done, req);
   16707           0 :         return req;
   16708             : }
   16709             : 
   16710           0 : static void dcerpc_spoolss_GetPrinterDriverPackagePath_done(struct tevent_req *subreq)
   16711             : {
   16712           0 :         struct tevent_req *req = tevent_req_callback_data(
   16713             :                 subreq, struct tevent_req);
   16714           0 :         struct dcerpc_spoolss_GetPrinterDriverPackagePath_state *state = tevent_req_data(
   16715             :                 req, struct dcerpc_spoolss_GetPrinterDriverPackagePath_state);
   16716           0 :         NTSTATUS status;
   16717           0 :         TALLOC_CTX *mem_ctx;
   16718             : 
   16719           0 :         if (state->out_mem_ctx) {
   16720           0 :                 mem_ctx = state->out_mem_ctx;
   16721             :         } else {
   16722           0 :                 mem_ctx = state;
   16723             :         }
   16724             : 
   16725           0 :         status = dcerpc_spoolss_GetPrinterDriverPackagePath_r_recv(subreq, mem_ctx);
   16726           0 :         TALLOC_FREE(subreq);
   16727           0 :         if (tevent_req_nterror(req, status)) {
   16728           0 :                 return;
   16729             :         }
   16730             : 
   16731             :         /* Copy out parameters */
   16732           0 :         if (state->orig.out.driver_package_cab && state->tmp.out.driver_package_cab) {
   16733             :                 {
   16734           0 :                         size_t _copy_len_driver_package_cab;
   16735           0 :                         _copy_len_driver_package_cab = ndr_charset_length(state->tmp.out.driver_package_cab, CH_UNIX);
   16736           0 :                         if (_copy_len_driver_package_cab > ndr_charset_length(state->tmp.in.driver_package_cab, CH_UNIX)) {
   16737           0 :                                 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
   16738           0 :                                 return;
   16739             :                         }
   16740           0 :                         if (state->orig.out.driver_package_cab != state->tmp.out.driver_package_cab) {
   16741           0 :                                 memcpy(discard_const_p(uint8_t *, state->orig.out.driver_package_cab), state->tmp.out.driver_package_cab, _copy_len_driver_package_cab * sizeof(*state->orig.out.driver_package_cab));
   16742             :                         }
   16743             :                 }
   16744             :         }
   16745           0 :         *state->orig.out.required = *state->tmp.out.required;
   16746             : 
   16747             :         /* Copy result */
   16748           0 :         state->orig.out.result = state->tmp.out.result;
   16749             : 
   16750             :         /* Reset temporary structure */
   16751           0 :         NDR_ZERO_STRUCT(state->tmp);
   16752             : 
   16753           0 :         tevent_req_done(req);
   16754             : }
   16755             : 
   16756           0 : NTSTATUS dcerpc_spoolss_GetPrinterDriverPackagePath_recv(struct tevent_req *req,
   16757             :                                                          TALLOC_CTX *mem_ctx,
   16758             :                                                          HRESULT *result)
   16759             : {
   16760           0 :         struct dcerpc_spoolss_GetPrinterDriverPackagePath_state *state = tevent_req_data(
   16761             :                 req, struct dcerpc_spoolss_GetPrinterDriverPackagePath_state);
   16762           0 :         NTSTATUS status;
   16763             : 
   16764           0 :         if (tevent_req_is_nterror(req, &status)) {
   16765           0 :                 tevent_req_received(req);
   16766           0 :                 return status;
   16767             :         }
   16768             : 
   16769             :         /* Steal possible out parameters to the callers context */
   16770           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16771             : 
   16772             :         /* Return result */
   16773           0 :         *result = state->orig.out.result;
   16774             : 
   16775           0 :         tevent_req_received(req);
   16776           0 :         return NT_STATUS_OK;
   16777             : }
   16778             : 
   16779           0 : NTSTATUS dcerpc_spoolss_GetPrinterDriverPackagePath(struct dcerpc_binding_handle *h,
   16780             :                                                     TALLOC_CTX *mem_ctx,
   16781             :                                                     const char *_servername /* [in] [charset(UTF16),unique] */,
   16782             :                                                     const char *_architecture /* [in] [charset(UTF16),ref] */,
   16783             :                                                     const char *_language /* [in] [charset(UTF16),unique] */,
   16784             :                                                     const char *_package_id /* [in] [charset(UTF16),ref] */,
   16785             :                                                     const char *_driver_package_cab /* [in,out] [charset(UTF16),size_is(driver_package_cab_size),unique] */,
   16786             :                                                     uint32_t _driver_package_cab_size /* [in]  */,
   16787             :                                                     uint32_t *_required /* [out] [ref] */,
   16788             :                                                     HRESULT *result)
   16789             : {
   16790           0 :         struct spoolss_GetPrinterDriverPackagePath r;
   16791           0 :         NTSTATUS status;
   16792             : 
   16793             :         /* In parameters */
   16794           0 :         r.in.servername = _servername;
   16795           0 :         r.in.architecture = _architecture;
   16796           0 :         r.in.language = _language;
   16797           0 :         r.in.package_id = _package_id;
   16798           0 :         r.in.driver_package_cab = _driver_package_cab;
   16799           0 :         r.in.driver_package_cab_size = _driver_package_cab_size;
   16800             : 
   16801             :         /* Out parameters */
   16802           0 :         r.out.driver_package_cab = _driver_package_cab;
   16803           0 :         r.out.required = _required;
   16804             : 
   16805             :         /* Result */
   16806           0 :         NDR_ZERO_STRUCT(r.out.result);
   16807             : 
   16808           0 :         status = dcerpc_spoolss_GetPrinterDriverPackagePath_r(h, mem_ctx, &r);
   16809           0 :         if (!NT_STATUS_IS_OK(status)) {
   16810           0 :                 return status;
   16811             :         }
   16812             : 
   16813             :         /* Return variables */
   16814           0 :         if (_driver_package_cab && r.out.driver_package_cab) {
   16815             :                 {
   16816           0 :                         size_t _copy_len_driver_package_cab;
   16817           0 :                         _copy_len_driver_package_cab = ndr_charset_length(r.out.driver_package_cab, CH_UNIX);
   16818           0 :                         if (_copy_len_driver_package_cab > ndr_charset_length(r.in.driver_package_cab, CH_UNIX)) {
   16819           0 :                                 return NT_STATUS_INVALID_NETWORK_RESPONSE;
   16820             :                         }
   16821           0 :                         if (_driver_package_cab != r.out.driver_package_cab) {
   16822           0 :                                 memcpy(discard_const_p(uint8_t *, _driver_package_cab), r.out.driver_package_cab, _copy_len_driver_package_cab * sizeof(*_driver_package_cab));
   16823             :                         }
   16824             :                 }
   16825             :         }
   16826           0 :         *_required = *r.out.required;
   16827             : 
   16828             :         /* Return result */
   16829           0 :         *result = r.out.result;
   16830             : 
   16831           0 :         return NT_STATUS_OK;
   16832             : }
   16833             : 
   16834             : struct dcerpc_spoolss_GetJobNamedPropertyValue_r_state {
   16835             :         TALLOC_CTX *out_mem_ctx;
   16836             : };
   16837             : 
   16838             : static void dcerpc_spoolss_GetJobNamedPropertyValue_r_done(struct tevent_req *subreq);
   16839             : 
   16840           0 : struct tevent_req *dcerpc_spoolss_GetJobNamedPropertyValue_r_send(TALLOC_CTX *mem_ctx,
   16841             :         struct tevent_context *ev,
   16842             :         struct dcerpc_binding_handle *h,
   16843             :         struct spoolss_GetJobNamedPropertyValue *r)
   16844             : {
   16845           0 :         struct tevent_req *req;
   16846           0 :         struct dcerpc_spoolss_GetJobNamedPropertyValue_r_state *state;
   16847           0 :         struct tevent_req *subreq;
   16848             : 
   16849           0 :         req = tevent_req_create(mem_ctx, &state,
   16850             :                                 struct dcerpc_spoolss_GetJobNamedPropertyValue_r_state);
   16851           0 :         if (req == NULL) {
   16852           0 :                 return NULL;
   16853             :         }
   16854             : 
   16855           0 :         state->out_mem_ctx = talloc_new(state);
   16856           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16857           0 :                 return tevent_req_post(req, ev);
   16858             :         }
   16859             : 
   16860           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   16861             :                         NULL, &ndr_table_spoolss,
   16862           0 :                         NDR_SPOOLSS_GETJOBNAMEDPROPERTYVALUE, state->out_mem_ctx, r);
   16863           0 :         if (tevent_req_nomem(subreq, req)) {
   16864           0 :                 return tevent_req_post(req, ev);
   16865             :         }
   16866           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_GetJobNamedPropertyValue_r_done, req);
   16867             : 
   16868           0 :         return req;
   16869             : }
   16870             : 
   16871           0 : static void dcerpc_spoolss_GetJobNamedPropertyValue_r_done(struct tevent_req *subreq)
   16872             : {
   16873           0 :         struct tevent_req *req =
   16874           0 :                 tevent_req_callback_data(subreq,
   16875             :                 struct tevent_req);
   16876           0 :         NTSTATUS status;
   16877             : 
   16878           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   16879           0 :         TALLOC_FREE(subreq);
   16880           0 :         if (tevent_req_nterror(req, status)) {
   16881           0 :                 return;
   16882             :         }
   16883             : 
   16884           0 :         tevent_req_done(req);
   16885             : }
   16886             : 
   16887           0 : NTSTATUS dcerpc_spoolss_GetJobNamedPropertyValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   16888             : {
   16889           0 :         struct dcerpc_spoolss_GetJobNamedPropertyValue_r_state *state =
   16890           0 :                 tevent_req_data(req,
   16891             :                 struct dcerpc_spoolss_GetJobNamedPropertyValue_r_state);
   16892           0 :         NTSTATUS status;
   16893             : 
   16894           0 :         if (tevent_req_is_nterror(req, &status)) {
   16895           0 :                 tevent_req_received(req);
   16896           0 :                 return status;
   16897             :         }
   16898             : 
   16899           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   16900             : 
   16901           0 :         tevent_req_received(req);
   16902           0 :         return NT_STATUS_OK;
   16903             : }
   16904             : 
   16905           0 : NTSTATUS dcerpc_spoolss_GetJobNamedPropertyValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetJobNamedPropertyValue *r)
   16906             : {
   16907           0 :         NTSTATUS status;
   16908             : 
   16909           0 :         status = dcerpc_binding_handle_call(h,
   16910             :                         NULL, &ndr_table_spoolss,
   16911             :                         NDR_SPOOLSS_GETJOBNAMEDPROPERTYVALUE, mem_ctx, r);
   16912             : 
   16913           0 :         return status;
   16914             : }
   16915             : 
   16916             : struct dcerpc_spoolss_GetJobNamedPropertyValue_state {
   16917             :         struct spoolss_GetJobNamedPropertyValue orig;
   16918             :         struct spoolss_GetJobNamedPropertyValue tmp;
   16919             :         TALLOC_CTX *out_mem_ctx;
   16920             : };
   16921             : 
   16922             : static void dcerpc_spoolss_GetJobNamedPropertyValue_done(struct tevent_req *subreq);
   16923             : 
   16924           0 : struct tevent_req *dcerpc_spoolss_GetJobNamedPropertyValue_send(TALLOC_CTX *mem_ctx,
   16925             :                                                                 struct tevent_context *ev,
   16926             :                                                                 struct dcerpc_binding_handle *h,
   16927             :                                                                 struct policy_handle *_hPrinter /* [in] [ref] */,
   16928             :                                                                 uint32_t _JobId /* [in]  */,
   16929             :                                                                 const char *_pszName /* [in] [charset(UTF16),ref] */,
   16930             :                                                                 struct spoolss_PrintPropertyValue *_pValue /* [out] [ref] */)
   16931             : {
   16932           0 :         struct tevent_req *req;
   16933           0 :         struct dcerpc_spoolss_GetJobNamedPropertyValue_state *state;
   16934           0 :         struct tevent_req *subreq;
   16935             : 
   16936           0 :         req = tevent_req_create(mem_ctx, &state,
   16937             :                                 struct dcerpc_spoolss_GetJobNamedPropertyValue_state);
   16938           0 :         if (req == NULL) {
   16939           0 :                 return NULL;
   16940             :         }
   16941           0 :         state->out_mem_ctx = NULL;
   16942             : 
   16943             :         /* In parameters */
   16944           0 :         state->orig.in.hPrinter = _hPrinter;
   16945           0 :         state->orig.in.JobId = _JobId;
   16946           0 :         state->orig.in.pszName = _pszName;
   16947             : 
   16948             :         /* Out parameters */
   16949           0 :         state->orig.out.pValue = _pValue;
   16950             : 
   16951             :         /* Result */
   16952           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   16953             : 
   16954           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   16955             :                              "dcerpc_spoolss_GetJobNamedPropertyValue_out_memory");
   16956           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   16957           0 :                 return tevent_req_post(req, ev);
   16958             :         }
   16959             : 
   16960             :         /* make a temporary copy, that we pass to the dispatch function */
   16961           0 :         state->tmp = state->orig;
   16962             : 
   16963           0 :         subreq = dcerpc_spoolss_GetJobNamedPropertyValue_r_send(state, ev, h, &state->tmp);
   16964           0 :         if (tevent_req_nomem(subreq, req)) {
   16965           0 :                 return tevent_req_post(req, ev);
   16966             :         }
   16967           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_GetJobNamedPropertyValue_done, req);
   16968           0 :         return req;
   16969             : }
   16970             : 
   16971           0 : static void dcerpc_spoolss_GetJobNamedPropertyValue_done(struct tevent_req *subreq)
   16972             : {
   16973           0 :         struct tevent_req *req = tevent_req_callback_data(
   16974             :                 subreq, struct tevent_req);
   16975           0 :         struct dcerpc_spoolss_GetJobNamedPropertyValue_state *state = tevent_req_data(
   16976             :                 req, struct dcerpc_spoolss_GetJobNamedPropertyValue_state);
   16977           0 :         NTSTATUS status;
   16978           0 :         TALLOC_CTX *mem_ctx;
   16979             : 
   16980           0 :         if (state->out_mem_ctx) {
   16981           0 :                 mem_ctx = state->out_mem_ctx;
   16982             :         } else {
   16983           0 :                 mem_ctx = state;
   16984             :         }
   16985             : 
   16986           0 :         status = dcerpc_spoolss_GetJobNamedPropertyValue_r_recv(subreq, mem_ctx);
   16987           0 :         TALLOC_FREE(subreq);
   16988           0 :         if (tevent_req_nterror(req, status)) {
   16989           0 :                 return;
   16990             :         }
   16991             : 
   16992             :         /* Copy out parameters */
   16993           0 :         *state->orig.out.pValue = *state->tmp.out.pValue;
   16994             : 
   16995             :         /* Copy result */
   16996           0 :         state->orig.out.result = state->tmp.out.result;
   16997             : 
   16998             :         /* Reset temporary structure */
   16999           0 :         NDR_ZERO_STRUCT(state->tmp);
   17000             : 
   17001           0 :         tevent_req_done(req);
   17002             : }
   17003             : 
   17004           0 : NTSTATUS dcerpc_spoolss_GetJobNamedPropertyValue_recv(struct tevent_req *req,
   17005             :                                                       TALLOC_CTX *mem_ctx,
   17006             :                                                       WERROR *result)
   17007             : {
   17008           0 :         struct dcerpc_spoolss_GetJobNamedPropertyValue_state *state = tevent_req_data(
   17009             :                 req, struct dcerpc_spoolss_GetJobNamedPropertyValue_state);
   17010           0 :         NTSTATUS status;
   17011             : 
   17012           0 :         if (tevent_req_is_nterror(req, &status)) {
   17013           0 :                 tevent_req_received(req);
   17014           0 :                 return status;
   17015             :         }
   17016             : 
   17017             :         /* Steal possible out parameters to the callers context */
   17018           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17019             : 
   17020             :         /* Return result */
   17021           0 :         *result = state->orig.out.result;
   17022             : 
   17023           0 :         tevent_req_received(req);
   17024           0 :         return NT_STATUS_OK;
   17025             : }
   17026             : 
   17027           0 : NTSTATUS dcerpc_spoolss_GetJobNamedPropertyValue(struct dcerpc_binding_handle *h,
   17028             :                                                  TALLOC_CTX *mem_ctx,
   17029             :                                                  struct policy_handle *_hPrinter /* [in] [ref] */,
   17030             :                                                  uint32_t _JobId /* [in]  */,
   17031             :                                                  const char *_pszName /* [in] [charset(UTF16),ref] */,
   17032             :                                                  struct spoolss_PrintPropertyValue *_pValue /* [out] [ref] */,
   17033             :                                                  WERROR *result)
   17034             : {
   17035           0 :         struct spoolss_GetJobNamedPropertyValue r;
   17036           0 :         NTSTATUS status;
   17037             : 
   17038             :         /* In parameters */
   17039           0 :         r.in.hPrinter = _hPrinter;
   17040           0 :         r.in.JobId = _JobId;
   17041           0 :         r.in.pszName = _pszName;
   17042             : 
   17043             :         /* Out parameters */
   17044           0 :         r.out.pValue = _pValue;
   17045             : 
   17046             :         /* Result */
   17047           0 :         NDR_ZERO_STRUCT(r.out.result);
   17048             : 
   17049           0 :         status = dcerpc_spoolss_GetJobNamedPropertyValue_r(h, mem_ctx, &r);
   17050           0 :         if (!NT_STATUS_IS_OK(status)) {
   17051           0 :                 return status;
   17052             :         }
   17053             : 
   17054             :         /* Return variables */
   17055           0 :         *_pValue = *r.out.pValue;
   17056             : 
   17057             :         /* Return result */
   17058           0 :         *result = r.out.result;
   17059             : 
   17060           0 :         return NT_STATUS_OK;
   17061             : }
   17062             : 
   17063             : struct dcerpc_spoolss_SetJobNamedProperty_r_state {
   17064             :         TALLOC_CTX *out_mem_ctx;
   17065             : };
   17066             : 
   17067             : static void dcerpc_spoolss_SetJobNamedProperty_r_done(struct tevent_req *subreq);
   17068             : 
   17069           0 : struct tevent_req *dcerpc_spoolss_SetJobNamedProperty_r_send(TALLOC_CTX *mem_ctx,
   17070             :         struct tevent_context *ev,
   17071             :         struct dcerpc_binding_handle *h,
   17072             :         struct spoolss_SetJobNamedProperty *r)
   17073             : {
   17074           0 :         struct tevent_req *req;
   17075           0 :         struct dcerpc_spoolss_SetJobNamedProperty_r_state *state;
   17076           0 :         struct tevent_req *subreq;
   17077             : 
   17078           0 :         req = tevent_req_create(mem_ctx, &state,
   17079             :                                 struct dcerpc_spoolss_SetJobNamedProperty_r_state);
   17080           0 :         if (req == NULL) {
   17081           0 :                 return NULL;
   17082             :         }
   17083             : 
   17084           0 :         state->out_mem_ctx = NULL;
   17085             : 
   17086           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   17087             :                         NULL, &ndr_table_spoolss,
   17088             :                         NDR_SPOOLSS_SETJOBNAMEDPROPERTY, state, r);
   17089           0 :         if (tevent_req_nomem(subreq, req)) {
   17090           0 :                 return tevent_req_post(req, ev);
   17091             :         }
   17092           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_SetJobNamedProperty_r_done, req);
   17093             : 
   17094           0 :         return req;
   17095             : }
   17096             : 
   17097           0 : static void dcerpc_spoolss_SetJobNamedProperty_r_done(struct tevent_req *subreq)
   17098             : {
   17099           0 :         struct tevent_req *req =
   17100           0 :                 tevent_req_callback_data(subreq,
   17101             :                 struct tevent_req);
   17102           0 :         NTSTATUS status;
   17103             : 
   17104           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   17105           0 :         TALLOC_FREE(subreq);
   17106           0 :         if (tevent_req_nterror(req, status)) {
   17107           0 :                 return;
   17108             :         }
   17109             : 
   17110           0 :         tevent_req_done(req);
   17111             : }
   17112             : 
   17113           0 : NTSTATUS dcerpc_spoolss_SetJobNamedProperty_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   17114             : {
   17115           0 :         struct dcerpc_spoolss_SetJobNamedProperty_r_state *state =
   17116           0 :                 tevent_req_data(req,
   17117             :                 struct dcerpc_spoolss_SetJobNamedProperty_r_state);
   17118           0 :         NTSTATUS status;
   17119             : 
   17120           0 :         if (tevent_req_is_nterror(req, &status)) {
   17121           0 :                 tevent_req_received(req);
   17122           0 :                 return status;
   17123             :         }
   17124             : 
   17125           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17126             : 
   17127           0 :         tevent_req_received(req);
   17128           0 :         return NT_STATUS_OK;
   17129             : }
   17130             : 
   17131           0 : NTSTATUS dcerpc_spoolss_SetJobNamedProperty_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_SetJobNamedProperty *r)
   17132             : {
   17133           0 :         NTSTATUS status;
   17134             : 
   17135           0 :         status = dcerpc_binding_handle_call(h,
   17136             :                         NULL, &ndr_table_spoolss,
   17137             :                         NDR_SPOOLSS_SETJOBNAMEDPROPERTY, mem_ctx, r);
   17138             : 
   17139           0 :         return status;
   17140             : }
   17141             : 
   17142             : struct dcerpc_spoolss_SetJobNamedProperty_state {
   17143             :         struct spoolss_SetJobNamedProperty orig;
   17144             :         struct spoolss_SetJobNamedProperty tmp;
   17145             :         TALLOC_CTX *out_mem_ctx;
   17146             : };
   17147             : 
   17148             : static void dcerpc_spoolss_SetJobNamedProperty_done(struct tevent_req *subreq);
   17149             : 
   17150           0 : struct tevent_req *dcerpc_spoolss_SetJobNamedProperty_send(TALLOC_CTX *mem_ctx,
   17151             :                                                            struct tevent_context *ev,
   17152             :                                                            struct dcerpc_binding_handle *h,
   17153             :                                                            struct policy_handle *_hPrinter /* [in] [ref] */,
   17154             :                                                            uint32_t _JobId /* [in]  */,
   17155             :                                                            struct spoolss_PrintNamedProperty *_pProperty /* [in] [ref] */)
   17156             : {
   17157           0 :         struct tevent_req *req;
   17158           0 :         struct dcerpc_spoolss_SetJobNamedProperty_state *state;
   17159           0 :         struct tevent_req *subreq;
   17160             : 
   17161           0 :         req = tevent_req_create(mem_ctx, &state,
   17162             :                                 struct dcerpc_spoolss_SetJobNamedProperty_state);
   17163           0 :         if (req == NULL) {
   17164           0 :                 return NULL;
   17165             :         }
   17166           0 :         state->out_mem_ctx = NULL;
   17167             : 
   17168             :         /* In parameters */
   17169           0 :         state->orig.in.hPrinter = _hPrinter;
   17170           0 :         state->orig.in.JobId = _JobId;
   17171           0 :         state->orig.in.pProperty = _pProperty;
   17172             : 
   17173             :         /* Out parameters */
   17174             : 
   17175             :         /* Result */
   17176           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   17177             : 
   17178             :         /* make a temporary copy, that we pass to the dispatch function */
   17179           0 :         state->tmp = state->orig;
   17180             : 
   17181           0 :         subreq = dcerpc_spoolss_SetJobNamedProperty_r_send(state, ev, h, &state->tmp);
   17182           0 :         if (tevent_req_nomem(subreq, req)) {
   17183           0 :                 return tevent_req_post(req, ev);
   17184             :         }
   17185           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_SetJobNamedProperty_done, req);
   17186           0 :         return req;
   17187             : }
   17188             : 
   17189           0 : static void dcerpc_spoolss_SetJobNamedProperty_done(struct tevent_req *subreq)
   17190             : {
   17191           0 :         struct tevent_req *req = tevent_req_callback_data(
   17192             :                 subreq, struct tevent_req);
   17193           0 :         struct dcerpc_spoolss_SetJobNamedProperty_state *state = tevent_req_data(
   17194             :                 req, struct dcerpc_spoolss_SetJobNamedProperty_state);
   17195           0 :         NTSTATUS status;
   17196           0 :         TALLOC_CTX *mem_ctx;
   17197             : 
   17198           0 :         if (state->out_mem_ctx) {
   17199           0 :                 mem_ctx = state->out_mem_ctx;
   17200             :         } else {
   17201           0 :                 mem_ctx = state;
   17202             :         }
   17203             : 
   17204           0 :         status = dcerpc_spoolss_SetJobNamedProperty_r_recv(subreq, mem_ctx);
   17205           0 :         TALLOC_FREE(subreq);
   17206           0 :         if (tevent_req_nterror(req, status)) {
   17207           0 :                 return;
   17208             :         }
   17209             : 
   17210             :         /* Copy out parameters */
   17211             : 
   17212             :         /* Copy result */
   17213           0 :         state->orig.out.result = state->tmp.out.result;
   17214             : 
   17215             :         /* Reset temporary structure */
   17216           0 :         NDR_ZERO_STRUCT(state->tmp);
   17217             : 
   17218           0 :         tevent_req_done(req);
   17219             : }
   17220             : 
   17221           0 : NTSTATUS dcerpc_spoolss_SetJobNamedProperty_recv(struct tevent_req *req,
   17222             :                                                  TALLOC_CTX *mem_ctx,
   17223             :                                                  WERROR *result)
   17224             : {
   17225           0 :         struct dcerpc_spoolss_SetJobNamedProperty_state *state = tevent_req_data(
   17226             :                 req, struct dcerpc_spoolss_SetJobNamedProperty_state);
   17227           0 :         NTSTATUS status;
   17228             : 
   17229           0 :         if (tevent_req_is_nterror(req, &status)) {
   17230           0 :                 tevent_req_received(req);
   17231           0 :                 return status;
   17232             :         }
   17233             : 
   17234             :         /* Steal possible out parameters to the callers context */
   17235           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17236             : 
   17237             :         /* Return result */
   17238           0 :         *result = state->orig.out.result;
   17239             : 
   17240           0 :         tevent_req_received(req);
   17241           0 :         return NT_STATUS_OK;
   17242             : }
   17243             : 
   17244           0 : NTSTATUS dcerpc_spoolss_SetJobNamedProperty(struct dcerpc_binding_handle *h,
   17245             :                                             TALLOC_CTX *mem_ctx,
   17246             :                                             struct policy_handle *_hPrinter /* [in] [ref] */,
   17247             :                                             uint32_t _JobId /* [in]  */,
   17248             :                                             struct spoolss_PrintNamedProperty *_pProperty /* [in] [ref] */,
   17249             :                                             WERROR *result)
   17250             : {
   17251           0 :         struct spoolss_SetJobNamedProperty r;
   17252           0 :         NTSTATUS status;
   17253             : 
   17254             :         /* In parameters */
   17255           0 :         r.in.hPrinter = _hPrinter;
   17256           0 :         r.in.JobId = _JobId;
   17257           0 :         r.in.pProperty = _pProperty;
   17258             : 
   17259             :         /* Out parameters */
   17260             : 
   17261             :         /* Result */
   17262           0 :         NDR_ZERO_STRUCT(r.out.result);
   17263             : 
   17264           0 :         status = dcerpc_spoolss_SetJobNamedProperty_r(h, mem_ctx, &r);
   17265           0 :         if (!NT_STATUS_IS_OK(status)) {
   17266           0 :                 return status;
   17267             :         }
   17268             : 
   17269             :         /* Return variables */
   17270             : 
   17271             :         /* Return result */
   17272           0 :         *result = r.out.result;
   17273             : 
   17274           0 :         return NT_STATUS_OK;
   17275             : }
   17276             : 
   17277             : struct dcerpc_spoolss_DeleteJobNamedProperty_r_state {
   17278             :         TALLOC_CTX *out_mem_ctx;
   17279             : };
   17280             : 
   17281             : static void dcerpc_spoolss_DeleteJobNamedProperty_r_done(struct tevent_req *subreq);
   17282             : 
   17283           0 : struct tevent_req *dcerpc_spoolss_DeleteJobNamedProperty_r_send(TALLOC_CTX *mem_ctx,
   17284             :         struct tevent_context *ev,
   17285             :         struct dcerpc_binding_handle *h,
   17286             :         struct spoolss_DeleteJobNamedProperty *r)
   17287             : {
   17288           0 :         struct tevent_req *req;
   17289           0 :         struct dcerpc_spoolss_DeleteJobNamedProperty_r_state *state;
   17290           0 :         struct tevent_req *subreq;
   17291             : 
   17292           0 :         req = tevent_req_create(mem_ctx, &state,
   17293             :                                 struct dcerpc_spoolss_DeleteJobNamedProperty_r_state);
   17294           0 :         if (req == NULL) {
   17295           0 :                 return NULL;
   17296             :         }
   17297             : 
   17298           0 :         state->out_mem_ctx = NULL;
   17299             : 
   17300           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   17301             :                         NULL, &ndr_table_spoolss,
   17302             :                         NDR_SPOOLSS_DELETEJOBNAMEDPROPERTY, state, r);
   17303           0 :         if (tevent_req_nomem(subreq, req)) {
   17304           0 :                 return tevent_req_post(req, ev);
   17305             :         }
   17306           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeleteJobNamedProperty_r_done, req);
   17307             : 
   17308           0 :         return req;
   17309             : }
   17310             : 
   17311           0 : static void dcerpc_spoolss_DeleteJobNamedProperty_r_done(struct tevent_req *subreq)
   17312             : {
   17313           0 :         struct tevent_req *req =
   17314           0 :                 tevent_req_callback_data(subreq,
   17315             :                 struct tevent_req);
   17316           0 :         NTSTATUS status;
   17317             : 
   17318           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   17319           0 :         TALLOC_FREE(subreq);
   17320           0 :         if (tevent_req_nterror(req, status)) {
   17321           0 :                 return;
   17322             :         }
   17323             : 
   17324           0 :         tevent_req_done(req);
   17325             : }
   17326             : 
   17327           0 : NTSTATUS dcerpc_spoolss_DeleteJobNamedProperty_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   17328             : {
   17329           0 :         struct dcerpc_spoolss_DeleteJobNamedProperty_r_state *state =
   17330           0 :                 tevent_req_data(req,
   17331             :                 struct dcerpc_spoolss_DeleteJobNamedProperty_r_state);
   17332           0 :         NTSTATUS status;
   17333             : 
   17334           0 :         if (tevent_req_is_nterror(req, &status)) {
   17335           0 :                 tevent_req_received(req);
   17336           0 :                 return status;
   17337             :         }
   17338             : 
   17339           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17340             : 
   17341           0 :         tevent_req_received(req);
   17342           0 :         return NT_STATUS_OK;
   17343             : }
   17344             : 
   17345           0 : NTSTATUS dcerpc_spoolss_DeleteJobNamedProperty_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeleteJobNamedProperty *r)
   17346             : {
   17347           0 :         NTSTATUS status;
   17348             : 
   17349           0 :         status = dcerpc_binding_handle_call(h,
   17350             :                         NULL, &ndr_table_spoolss,
   17351             :                         NDR_SPOOLSS_DELETEJOBNAMEDPROPERTY, mem_ctx, r);
   17352             : 
   17353           0 :         return status;
   17354             : }
   17355             : 
   17356             : struct dcerpc_spoolss_DeleteJobNamedProperty_state {
   17357             :         struct spoolss_DeleteJobNamedProperty orig;
   17358             :         struct spoolss_DeleteJobNamedProperty tmp;
   17359             :         TALLOC_CTX *out_mem_ctx;
   17360             : };
   17361             : 
   17362             : static void dcerpc_spoolss_DeleteJobNamedProperty_done(struct tevent_req *subreq);
   17363             : 
   17364           0 : struct tevent_req *dcerpc_spoolss_DeleteJobNamedProperty_send(TALLOC_CTX *mem_ctx,
   17365             :                                                               struct tevent_context *ev,
   17366             :                                                               struct dcerpc_binding_handle *h,
   17367             :                                                               struct policy_handle *_hPrinter /* [in] [ref] */,
   17368             :                                                               uint32_t _JobId /* [in]  */,
   17369             :                                                               const char *_pszName /* [in] [charset(UTF16),ref] */)
   17370             : {
   17371           0 :         struct tevent_req *req;
   17372           0 :         struct dcerpc_spoolss_DeleteJobNamedProperty_state *state;
   17373           0 :         struct tevent_req *subreq;
   17374             : 
   17375           0 :         req = tevent_req_create(mem_ctx, &state,
   17376             :                                 struct dcerpc_spoolss_DeleteJobNamedProperty_state);
   17377           0 :         if (req == NULL) {
   17378           0 :                 return NULL;
   17379             :         }
   17380           0 :         state->out_mem_ctx = NULL;
   17381             : 
   17382             :         /* In parameters */
   17383           0 :         state->orig.in.hPrinter = _hPrinter;
   17384           0 :         state->orig.in.JobId = _JobId;
   17385           0 :         state->orig.in.pszName = _pszName;
   17386             : 
   17387             :         /* Out parameters */
   17388             : 
   17389             :         /* Result */
   17390           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   17391             : 
   17392             :         /* make a temporary copy, that we pass to the dispatch function */
   17393           0 :         state->tmp = state->orig;
   17394             : 
   17395           0 :         subreq = dcerpc_spoolss_DeleteJobNamedProperty_r_send(state, ev, h, &state->tmp);
   17396           0 :         if (tevent_req_nomem(subreq, req)) {
   17397           0 :                 return tevent_req_post(req, ev);
   17398             :         }
   17399           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_DeleteJobNamedProperty_done, req);
   17400           0 :         return req;
   17401             : }
   17402             : 
   17403           0 : static void dcerpc_spoolss_DeleteJobNamedProperty_done(struct tevent_req *subreq)
   17404             : {
   17405           0 :         struct tevent_req *req = tevent_req_callback_data(
   17406             :                 subreq, struct tevent_req);
   17407           0 :         struct dcerpc_spoolss_DeleteJobNamedProperty_state *state = tevent_req_data(
   17408             :                 req, struct dcerpc_spoolss_DeleteJobNamedProperty_state);
   17409           0 :         NTSTATUS status;
   17410           0 :         TALLOC_CTX *mem_ctx;
   17411             : 
   17412           0 :         if (state->out_mem_ctx) {
   17413           0 :                 mem_ctx = state->out_mem_ctx;
   17414             :         } else {
   17415           0 :                 mem_ctx = state;
   17416             :         }
   17417             : 
   17418           0 :         status = dcerpc_spoolss_DeleteJobNamedProperty_r_recv(subreq, mem_ctx);
   17419           0 :         TALLOC_FREE(subreq);
   17420           0 :         if (tevent_req_nterror(req, status)) {
   17421           0 :                 return;
   17422             :         }
   17423             : 
   17424             :         /* Copy out parameters */
   17425             : 
   17426             :         /* Copy result */
   17427           0 :         state->orig.out.result = state->tmp.out.result;
   17428             : 
   17429             :         /* Reset temporary structure */
   17430           0 :         NDR_ZERO_STRUCT(state->tmp);
   17431             : 
   17432           0 :         tevent_req_done(req);
   17433             : }
   17434             : 
   17435           0 : NTSTATUS dcerpc_spoolss_DeleteJobNamedProperty_recv(struct tevent_req *req,
   17436             :                                                     TALLOC_CTX *mem_ctx,
   17437             :                                                     WERROR *result)
   17438             : {
   17439           0 :         struct dcerpc_spoolss_DeleteJobNamedProperty_state *state = tevent_req_data(
   17440             :                 req, struct dcerpc_spoolss_DeleteJobNamedProperty_state);
   17441           0 :         NTSTATUS status;
   17442             : 
   17443           0 :         if (tevent_req_is_nterror(req, &status)) {
   17444           0 :                 tevent_req_received(req);
   17445           0 :                 return status;
   17446             :         }
   17447             : 
   17448             :         /* Steal possible out parameters to the callers context */
   17449           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17450             : 
   17451             :         /* Return result */
   17452           0 :         *result = state->orig.out.result;
   17453             : 
   17454           0 :         tevent_req_received(req);
   17455           0 :         return NT_STATUS_OK;
   17456             : }
   17457             : 
   17458           0 : NTSTATUS dcerpc_spoolss_DeleteJobNamedProperty(struct dcerpc_binding_handle *h,
   17459             :                                                TALLOC_CTX *mem_ctx,
   17460             :                                                struct policy_handle *_hPrinter /* [in] [ref] */,
   17461             :                                                uint32_t _JobId /* [in]  */,
   17462             :                                                const char *_pszName /* [in] [charset(UTF16),ref] */,
   17463             :                                                WERROR *result)
   17464             : {
   17465           0 :         struct spoolss_DeleteJobNamedProperty r;
   17466           0 :         NTSTATUS status;
   17467             : 
   17468             :         /* In parameters */
   17469           0 :         r.in.hPrinter = _hPrinter;
   17470           0 :         r.in.JobId = _JobId;
   17471           0 :         r.in.pszName = _pszName;
   17472             : 
   17473             :         /* Out parameters */
   17474             : 
   17475             :         /* Result */
   17476           0 :         NDR_ZERO_STRUCT(r.out.result);
   17477             : 
   17478           0 :         status = dcerpc_spoolss_DeleteJobNamedProperty_r(h, mem_ctx, &r);
   17479           0 :         if (!NT_STATUS_IS_OK(status)) {
   17480           0 :                 return status;
   17481             :         }
   17482             : 
   17483             :         /* Return variables */
   17484             : 
   17485             :         /* Return result */
   17486           0 :         *result = r.out.result;
   17487             : 
   17488           0 :         return NT_STATUS_OK;
   17489             : }
   17490             : 
   17491             : struct dcerpc_spoolss_EnumJobNamedProperties_r_state {
   17492             :         TALLOC_CTX *out_mem_ctx;
   17493             : };
   17494             : 
   17495             : static void dcerpc_spoolss_EnumJobNamedProperties_r_done(struct tevent_req *subreq);
   17496             : 
   17497           0 : struct tevent_req *dcerpc_spoolss_EnumJobNamedProperties_r_send(TALLOC_CTX *mem_ctx,
   17498             :         struct tevent_context *ev,
   17499             :         struct dcerpc_binding_handle *h,
   17500             :         struct spoolss_EnumJobNamedProperties *r)
   17501             : {
   17502           0 :         struct tevent_req *req;
   17503           0 :         struct dcerpc_spoolss_EnumJobNamedProperties_r_state *state;
   17504           0 :         struct tevent_req *subreq;
   17505             : 
   17506           0 :         req = tevent_req_create(mem_ctx, &state,
   17507             :                                 struct dcerpc_spoolss_EnumJobNamedProperties_r_state);
   17508           0 :         if (req == NULL) {
   17509           0 :                 return NULL;
   17510             :         }
   17511             : 
   17512           0 :         state->out_mem_ctx = talloc_new(state);
   17513           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   17514           0 :                 return tevent_req_post(req, ev);
   17515             :         }
   17516             : 
   17517           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   17518             :                         NULL, &ndr_table_spoolss,
   17519           0 :                         NDR_SPOOLSS_ENUMJOBNAMEDPROPERTIES, state->out_mem_ctx, r);
   17520           0 :         if (tevent_req_nomem(subreq, req)) {
   17521           0 :                 return tevent_req_post(req, ev);
   17522             :         }
   17523           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_EnumJobNamedProperties_r_done, req);
   17524             : 
   17525           0 :         return req;
   17526             : }
   17527             : 
   17528           0 : static void dcerpc_spoolss_EnumJobNamedProperties_r_done(struct tevent_req *subreq)
   17529             : {
   17530           0 :         struct tevent_req *req =
   17531           0 :                 tevent_req_callback_data(subreq,
   17532             :                 struct tevent_req);
   17533           0 :         NTSTATUS status;
   17534             : 
   17535           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   17536           0 :         TALLOC_FREE(subreq);
   17537           0 :         if (tevent_req_nterror(req, status)) {
   17538           0 :                 return;
   17539             :         }
   17540             : 
   17541           0 :         tevent_req_done(req);
   17542             : }
   17543             : 
   17544           0 : NTSTATUS dcerpc_spoolss_EnumJobNamedProperties_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   17545             : {
   17546           0 :         struct dcerpc_spoolss_EnumJobNamedProperties_r_state *state =
   17547           0 :                 tevent_req_data(req,
   17548             :                 struct dcerpc_spoolss_EnumJobNamedProperties_r_state);
   17549           0 :         NTSTATUS status;
   17550             : 
   17551           0 :         if (tevent_req_is_nterror(req, &status)) {
   17552           0 :                 tevent_req_received(req);
   17553           0 :                 return status;
   17554             :         }
   17555             : 
   17556           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17557             : 
   17558           0 :         tevent_req_received(req);
   17559           0 :         return NT_STATUS_OK;
   17560             : }
   17561             : 
   17562           0 : NTSTATUS dcerpc_spoolss_EnumJobNamedProperties_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumJobNamedProperties *r)
   17563             : {
   17564           0 :         NTSTATUS status;
   17565             : 
   17566           0 :         status = dcerpc_binding_handle_call(h,
   17567             :                         NULL, &ndr_table_spoolss,
   17568             :                         NDR_SPOOLSS_ENUMJOBNAMEDPROPERTIES, mem_ctx, r);
   17569             : 
   17570           0 :         return status;
   17571             : }
   17572             : 
   17573             : struct dcerpc_spoolss_EnumJobNamedProperties_state {
   17574             :         struct spoolss_EnumJobNamedProperties orig;
   17575             :         struct spoolss_EnumJobNamedProperties tmp;
   17576             :         TALLOC_CTX *out_mem_ctx;
   17577             : };
   17578             : 
   17579             : static void dcerpc_spoolss_EnumJobNamedProperties_done(struct tevent_req *subreq);
   17580             : 
   17581           0 : struct tevent_req *dcerpc_spoolss_EnumJobNamedProperties_send(TALLOC_CTX *mem_ctx,
   17582             :                                                               struct tevent_context *ev,
   17583             :                                                               struct dcerpc_binding_handle *h,
   17584             :                                                               struct policy_handle *_hPrinter /* [in] [ref] */,
   17585             :                                                               uint32_t _JobId /* [in]  */,
   17586             :                                                               uint32_t *_pcProperties /* [out] [ref] */,
   17587             :                                                               struct spoolss_PrintNamedProperty **_ppProperties /* [out] [ref,size_is(,*pcProperties)] */)
   17588             : {
   17589           0 :         struct tevent_req *req;
   17590           0 :         struct dcerpc_spoolss_EnumJobNamedProperties_state *state;
   17591           0 :         struct tevent_req *subreq;
   17592             : 
   17593           0 :         req = tevent_req_create(mem_ctx, &state,
   17594             :                                 struct dcerpc_spoolss_EnumJobNamedProperties_state);
   17595           0 :         if (req == NULL) {
   17596           0 :                 return NULL;
   17597             :         }
   17598           0 :         state->out_mem_ctx = NULL;
   17599             : 
   17600             :         /* In parameters */
   17601           0 :         state->orig.in.hPrinter = _hPrinter;
   17602           0 :         state->orig.in.JobId = _JobId;
   17603             : 
   17604             :         /* Out parameters */
   17605           0 :         state->orig.out.pcProperties = _pcProperties;
   17606           0 :         state->orig.out.ppProperties = _ppProperties;
   17607             : 
   17608             :         /* Result */
   17609           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   17610             : 
   17611           0 :         state->out_mem_ctx = talloc_named_const(state, 0,
   17612             :                              "dcerpc_spoolss_EnumJobNamedProperties_out_memory");
   17613           0 :         if (tevent_req_nomem(state->out_mem_ctx, req)) {
   17614           0 :                 return tevent_req_post(req, ev);
   17615             :         }
   17616             : 
   17617             :         /* make a temporary copy, that we pass to the dispatch function */
   17618           0 :         state->tmp = state->orig;
   17619             : 
   17620           0 :         subreq = dcerpc_spoolss_EnumJobNamedProperties_r_send(state, ev, h, &state->tmp);
   17621           0 :         if (tevent_req_nomem(subreq, req)) {
   17622           0 :                 return tevent_req_post(req, ev);
   17623             :         }
   17624           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_EnumJobNamedProperties_done, req);
   17625           0 :         return req;
   17626             : }
   17627             : 
   17628           0 : static void dcerpc_spoolss_EnumJobNamedProperties_done(struct tevent_req *subreq)
   17629             : {
   17630           0 :         struct tevent_req *req = tevent_req_callback_data(
   17631             :                 subreq, struct tevent_req);
   17632           0 :         struct dcerpc_spoolss_EnumJobNamedProperties_state *state = tevent_req_data(
   17633             :                 req, struct dcerpc_spoolss_EnumJobNamedProperties_state);
   17634           0 :         NTSTATUS status;
   17635           0 :         TALLOC_CTX *mem_ctx;
   17636             : 
   17637           0 :         if (state->out_mem_ctx) {
   17638           0 :                 mem_ctx = state->out_mem_ctx;
   17639             :         } else {
   17640           0 :                 mem_ctx = state;
   17641             :         }
   17642             : 
   17643           0 :         status = dcerpc_spoolss_EnumJobNamedProperties_r_recv(subreq, mem_ctx);
   17644           0 :         TALLOC_FREE(subreq);
   17645           0 :         if (tevent_req_nterror(req, status)) {
   17646           0 :                 return;
   17647             :         }
   17648             : 
   17649             :         /* Copy out parameters */
   17650           0 :         *state->orig.out.pcProperties = *state->tmp.out.pcProperties;
   17651           0 :         *state->orig.out.ppProperties = *state->tmp.out.ppProperties;
   17652             : 
   17653             :         /* Copy result */
   17654           0 :         state->orig.out.result = state->tmp.out.result;
   17655             : 
   17656             :         /* Reset temporary structure */
   17657           0 :         NDR_ZERO_STRUCT(state->tmp);
   17658             : 
   17659           0 :         tevent_req_done(req);
   17660             : }
   17661             : 
   17662           0 : NTSTATUS dcerpc_spoolss_EnumJobNamedProperties_recv(struct tevent_req *req,
   17663             :                                                     TALLOC_CTX *mem_ctx,
   17664             :                                                     WERROR *result)
   17665             : {
   17666           0 :         struct dcerpc_spoolss_EnumJobNamedProperties_state *state = tevent_req_data(
   17667             :                 req, struct dcerpc_spoolss_EnumJobNamedProperties_state);
   17668           0 :         NTSTATUS status;
   17669             : 
   17670           0 :         if (tevent_req_is_nterror(req, &status)) {
   17671           0 :                 tevent_req_received(req);
   17672           0 :                 return status;
   17673             :         }
   17674             : 
   17675             :         /* Steal possible out parameters to the callers context */
   17676           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17677             : 
   17678             :         /* Return result */
   17679           0 :         *result = state->orig.out.result;
   17680             : 
   17681           0 :         tevent_req_received(req);
   17682           0 :         return NT_STATUS_OK;
   17683             : }
   17684             : 
   17685           0 : NTSTATUS dcerpc_spoolss_EnumJobNamedProperties(struct dcerpc_binding_handle *h,
   17686             :                                                TALLOC_CTX *mem_ctx,
   17687             :                                                struct policy_handle *_hPrinter /* [in] [ref] */,
   17688             :                                                uint32_t _JobId /* [in]  */,
   17689             :                                                uint32_t *_pcProperties /* [out] [ref] */,
   17690             :                                                struct spoolss_PrintNamedProperty **_ppProperties /* [out] [ref,size_is(,*pcProperties)] */,
   17691             :                                                WERROR *result)
   17692             : {
   17693           0 :         struct spoolss_EnumJobNamedProperties r;
   17694           0 :         NTSTATUS status;
   17695             : 
   17696             :         /* In parameters */
   17697           0 :         r.in.hPrinter = _hPrinter;
   17698           0 :         r.in.JobId = _JobId;
   17699             : 
   17700             :         /* Out parameters */
   17701           0 :         r.out.pcProperties = _pcProperties;
   17702           0 :         r.out.ppProperties = _ppProperties;
   17703             : 
   17704             :         /* Result */
   17705           0 :         NDR_ZERO_STRUCT(r.out.result);
   17706             : 
   17707           0 :         status = dcerpc_spoolss_EnumJobNamedProperties_r(h, mem_ctx, &r);
   17708           0 :         if (!NT_STATUS_IS_OK(status)) {
   17709           0 :                 return status;
   17710             :         }
   17711             : 
   17712             :         /* Return variables */
   17713           0 :         *_pcProperties = *r.out.pcProperties;
   17714           0 :         *_ppProperties = *r.out.ppProperties;
   17715             : 
   17716             :         /* Return result */
   17717           0 :         *result = r.out.result;
   17718             : 
   17719           0 :         return NT_STATUS_OK;
   17720             : }
   17721             : 
   17722             : struct dcerpc_spoolss_LogJobInfoForBranchOffice_r_state {
   17723             :         TALLOC_CTX *out_mem_ctx;
   17724             : };
   17725             : 
   17726             : static void dcerpc_spoolss_LogJobInfoForBranchOffice_r_done(struct tevent_req *subreq);
   17727             : 
   17728           0 : struct tevent_req *dcerpc_spoolss_LogJobInfoForBranchOffice_r_send(TALLOC_CTX *mem_ctx,
   17729             :         struct tevent_context *ev,
   17730             :         struct dcerpc_binding_handle *h,
   17731             :         struct spoolss_LogJobInfoForBranchOffice *r)
   17732             : {
   17733           0 :         struct tevent_req *req;
   17734           0 :         struct dcerpc_spoolss_LogJobInfoForBranchOffice_r_state *state;
   17735           0 :         struct tevent_req *subreq;
   17736             : 
   17737           0 :         req = tevent_req_create(mem_ctx, &state,
   17738             :                                 struct dcerpc_spoolss_LogJobInfoForBranchOffice_r_state);
   17739           0 :         if (req == NULL) {
   17740           0 :                 return NULL;
   17741             :         }
   17742             : 
   17743           0 :         state->out_mem_ctx = NULL;
   17744             : 
   17745           0 :         subreq = dcerpc_binding_handle_call_send(state, ev, h,
   17746             :                         NULL, &ndr_table_spoolss,
   17747             :                         NDR_SPOOLSS_LOGJOBINFOFORBRANCHOFFICE, state, r);
   17748           0 :         if (tevent_req_nomem(subreq, req)) {
   17749           0 :                 return tevent_req_post(req, ev);
   17750             :         }
   17751           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_LogJobInfoForBranchOffice_r_done, req);
   17752             : 
   17753           0 :         return req;
   17754             : }
   17755             : 
   17756           0 : static void dcerpc_spoolss_LogJobInfoForBranchOffice_r_done(struct tevent_req *subreq)
   17757             : {
   17758           0 :         struct tevent_req *req =
   17759           0 :                 tevent_req_callback_data(subreq,
   17760             :                 struct tevent_req);
   17761           0 :         NTSTATUS status;
   17762             : 
   17763           0 :         status = dcerpc_binding_handle_call_recv(subreq);
   17764           0 :         TALLOC_FREE(subreq);
   17765           0 :         if (tevent_req_nterror(req, status)) {
   17766           0 :                 return;
   17767             :         }
   17768             : 
   17769           0 :         tevent_req_done(req);
   17770             : }
   17771             : 
   17772           0 : NTSTATUS dcerpc_spoolss_LogJobInfoForBranchOffice_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
   17773             : {
   17774           0 :         struct dcerpc_spoolss_LogJobInfoForBranchOffice_r_state *state =
   17775           0 :                 tevent_req_data(req,
   17776             :                 struct dcerpc_spoolss_LogJobInfoForBranchOffice_r_state);
   17777           0 :         NTSTATUS status;
   17778             : 
   17779           0 :         if (tevent_req_is_nterror(req, &status)) {
   17780           0 :                 tevent_req_received(req);
   17781           0 :                 return status;
   17782             :         }
   17783             : 
   17784           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17785             : 
   17786           0 :         tevent_req_received(req);
   17787           0 :         return NT_STATUS_OK;
   17788             : }
   17789             : 
   17790           8 : NTSTATUS dcerpc_spoolss_LogJobInfoForBranchOffice_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_LogJobInfoForBranchOffice *r)
   17791             : {
   17792           0 :         NTSTATUS status;
   17793             : 
   17794           8 :         status = dcerpc_binding_handle_call(h,
   17795             :                         NULL, &ndr_table_spoolss,
   17796             :                         NDR_SPOOLSS_LOGJOBINFOFORBRANCHOFFICE, mem_ctx, r);
   17797             : 
   17798           8 :         return status;
   17799             : }
   17800             : 
   17801             : struct dcerpc_spoolss_LogJobInfoForBranchOffice_state {
   17802             :         struct spoolss_LogJobInfoForBranchOffice orig;
   17803             :         struct spoolss_LogJobInfoForBranchOffice tmp;
   17804             :         TALLOC_CTX *out_mem_ctx;
   17805             : };
   17806             : 
   17807             : static void dcerpc_spoolss_LogJobInfoForBranchOffice_done(struct tevent_req *subreq);
   17808             : 
   17809           0 : struct tevent_req *dcerpc_spoolss_LogJobInfoForBranchOffice_send(TALLOC_CTX *mem_ctx,
   17810             :                                                                  struct tevent_context *ev,
   17811             :                                                                  struct dcerpc_binding_handle *h,
   17812             :                                                                  struct policy_handle *_hPrinter /* [in] [ref] */,
   17813             :                                                                  struct spoolss_BranchOfficeJobDataContainer *_pBranchOfficeJobDataContainer /* [in] [ref] */)
   17814             : {
   17815           0 :         struct tevent_req *req;
   17816           0 :         struct dcerpc_spoolss_LogJobInfoForBranchOffice_state *state;
   17817           0 :         struct tevent_req *subreq;
   17818             : 
   17819           0 :         req = tevent_req_create(mem_ctx, &state,
   17820             :                                 struct dcerpc_spoolss_LogJobInfoForBranchOffice_state);
   17821           0 :         if (req == NULL) {
   17822           0 :                 return NULL;
   17823             :         }
   17824           0 :         state->out_mem_ctx = NULL;
   17825             : 
   17826             :         /* In parameters */
   17827           0 :         state->orig.in.hPrinter = _hPrinter;
   17828           0 :         state->orig.in.pBranchOfficeJobDataContainer = _pBranchOfficeJobDataContainer;
   17829             : 
   17830             :         /* Out parameters */
   17831             : 
   17832             :         /* Result */
   17833           0 :         NDR_ZERO_STRUCT(state->orig.out.result);
   17834             : 
   17835             :         /* make a temporary copy, that we pass to the dispatch function */
   17836           0 :         state->tmp = state->orig;
   17837             : 
   17838           0 :         subreq = dcerpc_spoolss_LogJobInfoForBranchOffice_r_send(state, ev, h, &state->tmp);
   17839           0 :         if (tevent_req_nomem(subreq, req)) {
   17840           0 :                 return tevent_req_post(req, ev);
   17841             :         }
   17842           0 :         tevent_req_set_callback(subreq, dcerpc_spoolss_LogJobInfoForBranchOffice_done, req);
   17843           0 :         return req;
   17844             : }
   17845             : 
   17846           0 : static void dcerpc_spoolss_LogJobInfoForBranchOffice_done(struct tevent_req *subreq)
   17847             : {
   17848           0 :         struct tevent_req *req = tevent_req_callback_data(
   17849             :                 subreq, struct tevent_req);
   17850           0 :         struct dcerpc_spoolss_LogJobInfoForBranchOffice_state *state = tevent_req_data(
   17851             :                 req, struct dcerpc_spoolss_LogJobInfoForBranchOffice_state);
   17852           0 :         NTSTATUS status;
   17853           0 :         TALLOC_CTX *mem_ctx;
   17854             : 
   17855           0 :         if (state->out_mem_ctx) {
   17856           0 :                 mem_ctx = state->out_mem_ctx;
   17857             :         } else {
   17858           0 :                 mem_ctx = state;
   17859             :         }
   17860             : 
   17861           0 :         status = dcerpc_spoolss_LogJobInfoForBranchOffice_r_recv(subreq, mem_ctx);
   17862           0 :         TALLOC_FREE(subreq);
   17863           0 :         if (tevent_req_nterror(req, status)) {
   17864           0 :                 return;
   17865             :         }
   17866             : 
   17867             :         /* Copy out parameters */
   17868             : 
   17869             :         /* Copy result */
   17870           0 :         state->orig.out.result = state->tmp.out.result;
   17871             : 
   17872             :         /* Reset temporary structure */
   17873           0 :         NDR_ZERO_STRUCT(state->tmp);
   17874             : 
   17875           0 :         tevent_req_done(req);
   17876             : }
   17877             : 
   17878           0 : NTSTATUS dcerpc_spoolss_LogJobInfoForBranchOffice_recv(struct tevent_req *req,
   17879             :                                                        TALLOC_CTX *mem_ctx,
   17880             :                                                        WERROR *result)
   17881             : {
   17882           0 :         struct dcerpc_spoolss_LogJobInfoForBranchOffice_state *state = tevent_req_data(
   17883             :                 req, struct dcerpc_spoolss_LogJobInfoForBranchOffice_state);
   17884           0 :         NTSTATUS status;
   17885             : 
   17886           0 :         if (tevent_req_is_nterror(req, &status)) {
   17887           0 :                 tevent_req_received(req);
   17888           0 :                 return status;
   17889             :         }
   17890             : 
   17891             :         /* Steal possible out parameters to the callers context */
   17892           0 :         talloc_steal(mem_ctx, state->out_mem_ctx);
   17893             : 
   17894             :         /* Return result */
   17895           0 :         *result = state->orig.out.result;
   17896             : 
   17897           0 :         tevent_req_received(req);
   17898           0 :         return NT_STATUS_OK;
   17899             : }
   17900             : 
   17901           0 : NTSTATUS dcerpc_spoolss_LogJobInfoForBranchOffice(struct dcerpc_binding_handle *h,
   17902             :                                                   TALLOC_CTX *mem_ctx,
   17903             :                                                   struct policy_handle *_hPrinter /* [in] [ref] */,
   17904             :                                                   struct spoolss_BranchOfficeJobDataContainer *_pBranchOfficeJobDataContainer /* [in] [ref] */,
   17905             :                                                   WERROR *result)
   17906             : {
   17907           0 :         struct spoolss_LogJobInfoForBranchOffice r;
   17908           0 :         NTSTATUS status;
   17909             : 
   17910             :         /* In parameters */
   17911           0 :         r.in.hPrinter = _hPrinter;
   17912           0 :         r.in.pBranchOfficeJobDataContainer = _pBranchOfficeJobDataContainer;
   17913             : 
   17914             :         /* Out parameters */
   17915             : 
   17916             :         /* Result */
   17917           0 :         NDR_ZERO_STRUCT(r.out.result);
   17918             : 
   17919           0 :         status = dcerpc_spoolss_LogJobInfoForBranchOffice_r(h, mem_ctx, &r);
   17920           0 :         if (!NT_STATUS_IS_OK(status)) {
   17921           0 :                 return status;
   17922             :         }
   17923             : 
   17924             :         /* Return variables */
   17925             : 
   17926             :         /* Return result */
   17927           0 :         *result = r.out.result;
   17928             : 
   17929           0 :         return NT_STATUS_OK;
   17930             : }
   17931             : 

Generated by: LCOV version 1.14