idl: recompile our IDL
[Samba/aatanasov.git] / librpc / gen_ndr / cli_spoolss.c
blob710af774a4ac2e8fb91a1f240a218908900619bc
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_spoolss.h"
9 struct rpccli_spoolss_EnumPrinters_state {
10 struct spoolss_EnumPrinters orig;
11 struct spoolss_EnumPrinters tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_spoolss_EnumPrinters_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_spoolss_EnumPrinters_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 uint32_t _flags /* [in] */,
22 const char *_server /* [in] [unique,charset(UTF16)] */,
23 uint32_t _level /* [in] */,
24 DATA_BLOB *_buffer /* [in] [unique] */,
25 uint32_t _offered /* [in] */,
26 uint32_t *_count /* [out] [ref] */,
27 union spoolss_PrinterInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
28 uint32_t *_needed /* [out] [ref] */)
30 struct tevent_req *req;
31 struct rpccli_spoolss_EnumPrinters_state *state;
32 struct tevent_req *subreq;
34 req = tevent_req_create(mem_ctx, &state,
35 struct rpccli_spoolss_EnumPrinters_state);
36 if (req == NULL) {
37 return NULL;
39 state->out_mem_ctx = NULL;
40 state->dispatch_recv = cli->dispatch_recv;
42 /* In parameters */
43 state->orig.in.flags = _flags;
44 state->orig.in.server = _server;
45 state->orig.in.level = _level;
46 state->orig.in.buffer = _buffer;
47 state->orig.in.offered = _offered;
49 /* Out parameters */
50 state->orig.out.count = _count;
51 state->orig.out.info = _info;
52 state->orig.out.needed = _needed;
54 /* Result */
55 ZERO_STRUCT(state->orig.out.result);
57 if (DEBUGLEVEL >= 10) {
58 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinters, &state->orig);
61 state->out_mem_ctx = talloc_named_const(state, 0,
62 "rpccli_spoolss_EnumPrinters_out_memory");
63 if (tevent_req_nomem(state->out_mem_ctx, req)) {
64 return tevent_req_post(req, ev);
67 /* make a temporary copy, that we pass to the dispatch function */
68 state->tmp = state->orig;
70 subreq = cli->dispatch_send(state, ev, cli,
71 &ndr_table_spoolss,
72 NDR_SPOOLSS_ENUMPRINTERS,
73 &state->tmp);
74 if (tevent_req_nomem(subreq, req)) {
75 return tevent_req_post(req, ev);
77 tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrinters_done, req);
78 return req;
81 static void rpccli_spoolss_EnumPrinters_done(struct tevent_req *subreq)
83 struct tevent_req *req = tevent_req_callback_data(
84 subreq, struct tevent_req);
85 struct rpccli_spoolss_EnumPrinters_state *state = tevent_req_data(
86 req, struct rpccli_spoolss_EnumPrinters_state);
87 NTSTATUS status;
88 TALLOC_CTX *mem_ctx;
90 if (state->out_mem_ctx) {
91 mem_ctx = state->out_mem_ctx;
92 } else {
93 mem_ctx = state;
96 status = state->dispatch_recv(subreq, mem_ctx);
97 TALLOC_FREE(subreq);
98 if (!NT_STATUS_IS_OK(status)) {
99 tevent_req_nterror(req, status);
100 return;
103 /* Copy out parameters */
104 *state->orig.out.count = *state->tmp.out.count;
105 *state->orig.out.info = *state->tmp.out.info;
106 *state->orig.out.needed = *state->tmp.out.needed;
108 /* Copy result */
109 state->orig.out.result = state->tmp.out.result;
111 /* Reset temporary structure */
112 ZERO_STRUCT(state->tmp);
114 if (DEBUGLEVEL >= 10) {
115 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinters, &state->orig);
118 tevent_req_done(req);
121 NTSTATUS rpccli_spoolss_EnumPrinters_recv(struct tevent_req *req,
122 TALLOC_CTX *mem_ctx,
123 WERROR *result)
125 struct rpccli_spoolss_EnumPrinters_state *state = tevent_req_data(
126 req, struct rpccli_spoolss_EnumPrinters_state);
127 NTSTATUS status;
129 if (tevent_req_is_nterror(req, &status)) {
130 tevent_req_received(req);
131 return status;
134 /* Steal possbile out parameters to the callers context */
135 talloc_steal(mem_ctx, state->out_mem_ctx);
137 /* Return result */
138 *result = state->orig.out.result;
140 tevent_req_received(req);
141 return NT_STATUS_OK;
144 NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
145 TALLOC_CTX *mem_ctx,
146 uint32_t flags /* [in] */,
147 const char *server /* [in] [unique,charset(UTF16)] */,
148 uint32_t level /* [in] */,
149 DATA_BLOB *buffer /* [in] [unique] */,
150 uint32_t offered /* [in] */,
151 uint32_t *count /* [out] [ref] */,
152 union spoolss_PrinterInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
153 uint32_t *needed /* [out] [ref] */,
154 WERROR *werror)
156 struct spoolss_EnumPrinters r;
157 NTSTATUS status;
159 /* In parameters */
160 r.in.flags = flags;
161 r.in.server = server;
162 r.in.level = level;
163 r.in.buffer = buffer;
164 r.in.offered = offered;
166 if (DEBUGLEVEL >= 10) {
167 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinters, &r);
170 status = cli->dispatch(cli,
171 mem_ctx,
172 &ndr_table_spoolss,
173 NDR_SPOOLSS_ENUMPRINTERS,
174 &r);
176 if (!NT_STATUS_IS_OK(status)) {
177 return status;
180 if (DEBUGLEVEL >= 10) {
181 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinters, &r);
184 if (NT_STATUS_IS_ERR(status)) {
185 return status;
188 /* Return variables */
189 *count = *r.out.count;
190 *info = *r.out.info;
191 *needed = *r.out.needed;
193 /* Return result */
194 if (werror) {
195 *werror = r.out.result;
198 return werror_to_ntstatus(r.out.result);
201 struct rpccli_spoolss_OpenPrinter_state {
202 struct spoolss_OpenPrinter orig;
203 struct spoolss_OpenPrinter tmp;
204 TALLOC_CTX *out_mem_ctx;
205 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
208 static void rpccli_spoolss_OpenPrinter_done(struct tevent_req *subreq);
210 struct tevent_req *rpccli_spoolss_OpenPrinter_send(TALLOC_CTX *mem_ctx,
211 struct tevent_context *ev,
212 struct rpc_pipe_client *cli,
213 const char *_printername /* [in] [unique,charset(UTF16)] */,
214 const char *_datatype /* [in] [unique,charset(UTF16)] */,
215 struct spoolss_DevmodeContainer _devmode_ctr /* [in] */,
216 uint32_t _access_mask /* [in] */,
217 struct policy_handle *_handle /* [out] [ref] */)
219 struct tevent_req *req;
220 struct rpccli_spoolss_OpenPrinter_state *state;
221 struct tevent_req *subreq;
223 req = tevent_req_create(mem_ctx, &state,
224 struct rpccli_spoolss_OpenPrinter_state);
225 if (req == NULL) {
226 return NULL;
228 state->out_mem_ctx = NULL;
229 state->dispatch_recv = cli->dispatch_recv;
231 /* In parameters */
232 state->orig.in.printername = _printername;
233 state->orig.in.datatype = _datatype;
234 state->orig.in.devmode_ctr = _devmode_ctr;
235 state->orig.in.access_mask = _access_mask;
237 /* Out parameters */
238 state->orig.out.handle = _handle;
240 /* Result */
241 ZERO_STRUCT(state->orig.out.result);
243 if (DEBUGLEVEL >= 10) {
244 NDR_PRINT_IN_DEBUG(spoolss_OpenPrinter, &state->orig);
247 state->out_mem_ctx = talloc_named_const(state, 0,
248 "rpccli_spoolss_OpenPrinter_out_memory");
249 if (tevent_req_nomem(state->out_mem_ctx, req)) {
250 return tevent_req_post(req, ev);
253 /* make a temporary copy, that we pass to the dispatch function */
254 state->tmp = state->orig;
256 subreq = cli->dispatch_send(state, ev, cli,
257 &ndr_table_spoolss,
258 NDR_SPOOLSS_OPENPRINTER,
259 &state->tmp);
260 if (tevent_req_nomem(subreq, req)) {
261 return tevent_req_post(req, ev);
263 tevent_req_set_callback(subreq, rpccli_spoolss_OpenPrinter_done, req);
264 return req;
267 static void rpccli_spoolss_OpenPrinter_done(struct tevent_req *subreq)
269 struct tevent_req *req = tevent_req_callback_data(
270 subreq, struct tevent_req);
271 struct rpccli_spoolss_OpenPrinter_state *state = tevent_req_data(
272 req, struct rpccli_spoolss_OpenPrinter_state);
273 NTSTATUS status;
274 TALLOC_CTX *mem_ctx;
276 if (state->out_mem_ctx) {
277 mem_ctx = state->out_mem_ctx;
278 } else {
279 mem_ctx = state;
282 status = state->dispatch_recv(subreq, mem_ctx);
283 TALLOC_FREE(subreq);
284 if (!NT_STATUS_IS_OK(status)) {
285 tevent_req_nterror(req, status);
286 return;
289 /* Copy out parameters */
290 *state->orig.out.handle = *state->tmp.out.handle;
292 /* Copy result */
293 state->orig.out.result = state->tmp.out.result;
295 /* Reset temporary structure */
296 ZERO_STRUCT(state->tmp);
298 if (DEBUGLEVEL >= 10) {
299 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinter, &state->orig);
302 tevent_req_done(req);
305 NTSTATUS rpccli_spoolss_OpenPrinter_recv(struct tevent_req *req,
306 TALLOC_CTX *mem_ctx,
307 WERROR *result)
309 struct rpccli_spoolss_OpenPrinter_state *state = tevent_req_data(
310 req, struct rpccli_spoolss_OpenPrinter_state);
311 NTSTATUS status;
313 if (tevent_req_is_nterror(req, &status)) {
314 tevent_req_received(req);
315 return status;
318 /* Steal possbile out parameters to the callers context */
319 talloc_steal(mem_ctx, state->out_mem_ctx);
321 /* Return result */
322 *result = state->orig.out.result;
324 tevent_req_received(req);
325 return NT_STATUS_OK;
328 NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli,
329 TALLOC_CTX *mem_ctx,
330 const char *printername /* [in] [unique,charset(UTF16)] */,
331 const char *datatype /* [in] [unique,charset(UTF16)] */,
332 struct spoolss_DevmodeContainer devmode_ctr /* [in] */,
333 uint32_t access_mask /* [in] */,
334 struct policy_handle *handle /* [out] [ref] */,
335 WERROR *werror)
337 struct spoolss_OpenPrinter r;
338 NTSTATUS status;
340 /* In parameters */
341 r.in.printername = printername;
342 r.in.datatype = datatype;
343 r.in.devmode_ctr = devmode_ctr;
344 r.in.access_mask = access_mask;
346 if (DEBUGLEVEL >= 10) {
347 NDR_PRINT_IN_DEBUG(spoolss_OpenPrinter, &r);
350 status = cli->dispatch(cli,
351 mem_ctx,
352 &ndr_table_spoolss,
353 NDR_SPOOLSS_OPENPRINTER,
354 &r);
356 if (!NT_STATUS_IS_OK(status)) {
357 return status;
360 if (DEBUGLEVEL >= 10) {
361 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinter, &r);
364 if (NT_STATUS_IS_ERR(status)) {
365 return status;
368 /* Return variables */
369 *handle = *r.out.handle;
371 /* Return result */
372 if (werror) {
373 *werror = r.out.result;
376 return werror_to_ntstatus(r.out.result);
379 struct rpccli_spoolss_SetJob_state {
380 struct spoolss_SetJob orig;
381 struct spoolss_SetJob tmp;
382 TALLOC_CTX *out_mem_ctx;
383 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
386 static void rpccli_spoolss_SetJob_done(struct tevent_req *subreq);
388 struct tevent_req *rpccli_spoolss_SetJob_send(TALLOC_CTX *mem_ctx,
389 struct tevent_context *ev,
390 struct rpc_pipe_client *cli,
391 struct policy_handle *_handle /* [in] [ref] */,
392 uint32_t _job_id /* [in] */,
393 struct spoolss_JobInfoContainer *_ctr /* [in] [unique] */,
394 enum spoolss_JobControl _command /* [in] */)
396 struct tevent_req *req;
397 struct rpccli_spoolss_SetJob_state *state;
398 struct tevent_req *subreq;
400 req = tevent_req_create(mem_ctx, &state,
401 struct rpccli_spoolss_SetJob_state);
402 if (req == NULL) {
403 return NULL;
405 state->out_mem_ctx = NULL;
406 state->dispatch_recv = cli->dispatch_recv;
408 /* In parameters */
409 state->orig.in.handle = _handle;
410 state->orig.in.job_id = _job_id;
411 state->orig.in.ctr = _ctr;
412 state->orig.in.command = _command;
414 /* Out parameters */
416 /* Result */
417 ZERO_STRUCT(state->orig.out.result);
419 if (DEBUGLEVEL >= 10) {
420 NDR_PRINT_IN_DEBUG(spoolss_SetJob, &state->orig);
423 /* make a temporary copy, that we pass to the dispatch function */
424 state->tmp = state->orig;
426 subreq = cli->dispatch_send(state, ev, cli,
427 &ndr_table_spoolss,
428 NDR_SPOOLSS_SETJOB,
429 &state->tmp);
430 if (tevent_req_nomem(subreq, req)) {
431 return tevent_req_post(req, ev);
433 tevent_req_set_callback(subreq, rpccli_spoolss_SetJob_done, req);
434 return req;
437 static void rpccli_spoolss_SetJob_done(struct tevent_req *subreq)
439 struct tevent_req *req = tevent_req_callback_data(
440 subreq, struct tevent_req);
441 struct rpccli_spoolss_SetJob_state *state = tevent_req_data(
442 req, struct rpccli_spoolss_SetJob_state);
443 NTSTATUS status;
444 TALLOC_CTX *mem_ctx;
446 if (state->out_mem_ctx) {
447 mem_ctx = state->out_mem_ctx;
448 } else {
449 mem_ctx = state;
452 status = state->dispatch_recv(subreq, mem_ctx);
453 TALLOC_FREE(subreq);
454 if (!NT_STATUS_IS_OK(status)) {
455 tevent_req_nterror(req, status);
456 return;
459 /* Copy out parameters */
461 /* Copy result */
462 state->orig.out.result = state->tmp.out.result;
464 /* Reset temporary structure */
465 ZERO_STRUCT(state->tmp);
467 if (DEBUGLEVEL >= 10) {
468 NDR_PRINT_OUT_DEBUG(spoolss_SetJob, &state->orig);
471 tevent_req_done(req);
474 NTSTATUS rpccli_spoolss_SetJob_recv(struct tevent_req *req,
475 TALLOC_CTX *mem_ctx,
476 WERROR *result)
478 struct rpccli_spoolss_SetJob_state *state = tevent_req_data(
479 req, struct rpccli_spoolss_SetJob_state);
480 NTSTATUS status;
482 if (tevent_req_is_nterror(req, &status)) {
483 tevent_req_received(req);
484 return status;
487 /* Steal possbile out parameters to the callers context */
488 talloc_steal(mem_ctx, state->out_mem_ctx);
490 /* Return result */
491 *result = state->orig.out.result;
493 tevent_req_received(req);
494 return NT_STATUS_OK;
497 NTSTATUS rpccli_spoolss_SetJob(struct rpc_pipe_client *cli,
498 TALLOC_CTX *mem_ctx,
499 struct policy_handle *handle /* [in] [ref] */,
500 uint32_t job_id /* [in] */,
501 struct spoolss_JobInfoContainer *ctr /* [in] [unique] */,
502 enum spoolss_JobControl command /* [in] */,
503 WERROR *werror)
505 struct spoolss_SetJob r;
506 NTSTATUS status;
508 /* In parameters */
509 r.in.handle = handle;
510 r.in.job_id = job_id;
511 r.in.ctr = ctr;
512 r.in.command = command;
514 if (DEBUGLEVEL >= 10) {
515 NDR_PRINT_IN_DEBUG(spoolss_SetJob, &r);
518 status = cli->dispatch(cli,
519 mem_ctx,
520 &ndr_table_spoolss,
521 NDR_SPOOLSS_SETJOB,
522 &r);
524 if (!NT_STATUS_IS_OK(status)) {
525 return status;
528 if (DEBUGLEVEL >= 10) {
529 NDR_PRINT_OUT_DEBUG(spoolss_SetJob, &r);
532 if (NT_STATUS_IS_ERR(status)) {
533 return status;
536 /* Return variables */
538 /* Return result */
539 if (werror) {
540 *werror = r.out.result;
543 return werror_to_ntstatus(r.out.result);
546 struct rpccli_spoolss_GetJob_state {
547 struct spoolss_GetJob orig;
548 struct spoolss_GetJob tmp;
549 TALLOC_CTX *out_mem_ctx;
550 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
553 static void rpccli_spoolss_GetJob_done(struct tevent_req *subreq);
555 struct tevent_req *rpccli_spoolss_GetJob_send(TALLOC_CTX *mem_ctx,
556 struct tevent_context *ev,
557 struct rpc_pipe_client *cli,
558 struct policy_handle *_handle /* [in] [ref] */,
559 uint32_t _job_id /* [in] */,
560 uint32_t _level /* [in] */,
561 DATA_BLOB *_buffer /* [in] [unique] */,
562 uint32_t _offered /* [in] */,
563 union spoolss_JobInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
564 uint32_t *_needed /* [out] [ref] */)
566 struct tevent_req *req;
567 struct rpccli_spoolss_GetJob_state *state;
568 struct tevent_req *subreq;
570 req = tevent_req_create(mem_ctx, &state,
571 struct rpccli_spoolss_GetJob_state);
572 if (req == NULL) {
573 return NULL;
575 state->out_mem_ctx = NULL;
576 state->dispatch_recv = cli->dispatch_recv;
578 /* In parameters */
579 state->orig.in.handle = _handle;
580 state->orig.in.job_id = _job_id;
581 state->orig.in.level = _level;
582 state->orig.in.buffer = _buffer;
583 state->orig.in.offered = _offered;
585 /* Out parameters */
586 state->orig.out.info = _info;
587 state->orig.out.needed = _needed;
589 /* Result */
590 ZERO_STRUCT(state->orig.out.result);
592 if (DEBUGLEVEL >= 10) {
593 NDR_PRINT_IN_DEBUG(spoolss_GetJob, &state->orig);
596 state->out_mem_ctx = talloc_named_const(state, 0,
597 "rpccli_spoolss_GetJob_out_memory");
598 if (tevent_req_nomem(state->out_mem_ctx, req)) {
599 return tevent_req_post(req, ev);
602 /* make a temporary copy, that we pass to the dispatch function */
603 state->tmp = state->orig;
605 subreq = cli->dispatch_send(state, ev, cli,
606 &ndr_table_spoolss,
607 NDR_SPOOLSS_GETJOB,
608 &state->tmp);
609 if (tevent_req_nomem(subreq, req)) {
610 return tevent_req_post(req, ev);
612 tevent_req_set_callback(subreq, rpccli_spoolss_GetJob_done, req);
613 return req;
616 static void rpccli_spoolss_GetJob_done(struct tevent_req *subreq)
618 struct tevent_req *req = tevent_req_callback_data(
619 subreq, struct tevent_req);
620 struct rpccli_spoolss_GetJob_state *state = tevent_req_data(
621 req, struct rpccli_spoolss_GetJob_state);
622 NTSTATUS status;
623 TALLOC_CTX *mem_ctx;
625 if (state->out_mem_ctx) {
626 mem_ctx = state->out_mem_ctx;
627 } else {
628 mem_ctx = state;
631 status = state->dispatch_recv(subreq, mem_ctx);
632 TALLOC_FREE(subreq);
633 if (!NT_STATUS_IS_OK(status)) {
634 tevent_req_nterror(req, status);
635 return;
638 /* Copy out parameters */
639 if (state->orig.out.info && state->tmp.out.info) {
640 *state->orig.out.info = *state->tmp.out.info;
642 *state->orig.out.needed = *state->tmp.out.needed;
644 /* Copy result */
645 state->orig.out.result = state->tmp.out.result;
647 /* Reset temporary structure */
648 ZERO_STRUCT(state->tmp);
650 if (DEBUGLEVEL >= 10) {
651 NDR_PRINT_OUT_DEBUG(spoolss_GetJob, &state->orig);
654 tevent_req_done(req);
657 NTSTATUS rpccli_spoolss_GetJob_recv(struct tevent_req *req,
658 TALLOC_CTX *mem_ctx,
659 WERROR *result)
661 struct rpccli_spoolss_GetJob_state *state = tevent_req_data(
662 req, struct rpccli_spoolss_GetJob_state);
663 NTSTATUS status;
665 if (tevent_req_is_nterror(req, &status)) {
666 tevent_req_received(req);
667 return status;
670 /* Steal possbile out parameters to the callers context */
671 talloc_steal(mem_ctx, state->out_mem_ctx);
673 /* Return result */
674 *result = state->orig.out.result;
676 tevent_req_received(req);
677 return NT_STATUS_OK;
680 NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
681 TALLOC_CTX *mem_ctx,
682 struct policy_handle *handle /* [in] [ref] */,
683 uint32_t job_id /* [in] */,
684 uint32_t level /* [in] */,
685 DATA_BLOB *buffer /* [in] [unique] */,
686 uint32_t offered /* [in] */,
687 union spoolss_JobInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
688 uint32_t *needed /* [out] [ref] */,
689 WERROR *werror)
691 struct spoolss_GetJob r;
692 NTSTATUS status;
694 /* In parameters */
695 r.in.handle = handle;
696 r.in.job_id = job_id;
697 r.in.level = level;
698 r.in.buffer = buffer;
699 r.in.offered = offered;
701 if (DEBUGLEVEL >= 10) {
702 NDR_PRINT_IN_DEBUG(spoolss_GetJob, &r);
705 status = cli->dispatch(cli,
706 mem_ctx,
707 &ndr_table_spoolss,
708 NDR_SPOOLSS_GETJOB,
709 &r);
711 if (!NT_STATUS_IS_OK(status)) {
712 return status;
715 if (DEBUGLEVEL >= 10) {
716 NDR_PRINT_OUT_DEBUG(spoolss_GetJob, &r);
719 if (NT_STATUS_IS_ERR(status)) {
720 return status;
723 /* Return variables */
724 if (info && r.out.info) {
725 *info = *r.out.info;
727 *needed = *r.out.needed;
729 /* Return result */
730 if (werror) {
731 *werror = r.out.result;
734 return werror_to_ntstatus(r.out.result);
737 struct rpccli_spoolss_EnumJobs_state {
738 struct spoolss_EnumJobs orig;
739 struct spoolss_EnumJobs tmp;
740 TALLOC_CTX *out_mem_ctx;
741 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
744 static void rpccli_spoolss_EnumJobs_done(struct tevent_req *subreq);
746 struct tevent_req *rpccli_spoolss_EnumJobs_send(TALLOC_CTX *mem_ctx,
747 struct tevent_context *ev,
748 struct rpc_pipe_client *cli,
749 struct policy_handle *_handle /* [in] [ref] */,
750 uint32_t _firstjob /* [in] */,
751 uint32_t _numjobs /* [in] */,
752 uint32_t _level /* [in] */,
753 DATA_BLOB *_buffer /* [in] [unique] */,
754 uint32_t _offered /* [in] */,
755 uint32_t *_count /* [out] [ref] */,
756 union spoolss_JobInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
757 uint32_t *_needed /* [out] [ref] */)
759 struct tevent_req *req;
760 struct rpccli_spoolss_EnumJobs_state *state;
761 struct tevent_req *subreq;
763 req = tevent_req_create(mem_ctx, &state,
764 struct rpccli_spoolss_EnumJobs_state);
765 if (req == NULL) {
766 return NULL;
768 state->out_mem_ctx = NULL;
769 state->dispatch_recv = cli->dispatch_recv;
771 /* In parameters */
772 state->orig.in.handle = _handle;
773 state->orig.in.firstjob = _firstjob;
774 state->orig.in.numjobs = _numjobs;
775 state->orig.in.level = _level;
776 state->orig.in.buffer = _buffer;
777 state->orig.in.offered = _offered;
779 /* Out parameters */
780 state->orig.out.count = _count;
781 state->orig.out.info = _info;
782 state->orig.out.needed = _needed;
784 /* Result */
785 ZERO_STRUCT(state->orig.out.result);
787 if (DEBUGLEVEL >= 10) {
788 NDR_PRINT_IN_DEBUG(spoolss_EnumJobs, &state->orig);
791 state->out_mem_ctx = talloc_named_const(state, 0,
792 "rpccli_spoolss_EnumJobs_out_memory");
793 if (tevent_req_nomem(state->out_mem_ctx, req)) {
794 return tevent_req_post(req, ev);
797 /* make a temporary copy, that we pass to the dispatch function */
798 state->tmp = state->orig;
800 subreq = cli->dispatch_send(state, ev, cli,
801 &ndr_table_spoolss,
802 NDR_SPOOLSS_ENUMJOBS,
803 &state->tmp);
804 if (tevent_req_nomem(subreq, req)) {
805 return tevent_req_post(req, ev);
807 tevent_req_set_callback(subreq, rpccli_spoolss_EnumJobs_done, req);
808 return req;
811 static void rpccli_spoolss_EnumJobs_done(struct tevent_req *subreq)
813 struct tevent_req *req = tevent_req_callback_data(
814 subreq, struct tevent_req);
815 struct rpccli_spoolss_EnumJobs_state *state = tevent_req_data(
816 req, struct rpccli_spoolss_EnumJobs_state);
817 NTSTATUS status;
818 TALLOC_CTX *mem_ctx;
820 if (state->out_mem_ctx) {
821 mem_ctx = state->out_mem_ctx;
822 } else {
823 mem_ctx = state;
826 status = state->dispatch_recv(subreq, mem_ctx);
827 TALLOC_FREE(subreq);
828 if (!NT_STATUS_IS_OK(status)) {
829 tevent_req_nterror(req, status);
830 return;
833 /* Copy out parameters */
834 *state->orig.out.count = *state->tmp.out.count;
835 *state->orig.out.info = *state->tmp.out.info;
836 *state->orig.out.needed = *state->tmp.out.needed;
838 /* Copy result */
839 state->orig.out.result = state->tmp.out.result;
841 /* Reset temporary structure */
842 ZERO_STRUCT(state->tmp);
844 if (DEBUGLEVEL >= 10) {
845 NDR_PRINT_OUT_DEBUG(spoolss_EnumJobs, &state->orig);
848 tevent_req_done(req);
851 NTSTATUS rpccli_spoolss_EnumJobs_recv(struct tevent_req *req,
852 TALLOC_CTX *mem_ctx,
853 WERROR *result)
855 struct rpccli_spoolss_EnumJobs_state *state = tevent_req_data(
856 req, struct rpccli_spoolss_EnumJobs_state);
857 NTSTATUS status;
859 if (tevent_req_is_nterror(req, &status)) {
860 tevent_req_received(req);
861 return status;
864 /* Steal possbile out parameters to the callers context */
865 talloc_steal(mem_ctx, state->out_mem_ctx);
867 /* Return result */
868 *result = state->orig.out.result;
870 tevent_req_received(req);
871 return NT_STATUS_OK;
874 NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
875 TALLOC_CTX *mem_ctx,
876 struct policy_handle *handle /* [in] [ref] */,
877 uint32_t firstjob /* [in] */,
878 uint32_t numjobs /* [in] */,
879 uint32_t level /* [in] */,
880 DATA_BLOB *buffer /* [in] [unique] */,
881 uint32_t offered /* [in] */,
882 uint32_t *count /* [out] [ref] */,
883 union spoolss_JobInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
884 uint32_t *needed /* [out] [ref] */,
885 WERROR *werror)
887 struct spoolss_EnumJobs r;
888 NTSTATUS status;
890 /* In parameters */
891 r.in.handle = handle;
892 r.in.firstjob = firstjob;
893 r.in.numjobs = numjobs;
894 r.in.level = level;
895 r.in.buffer = buffer;
896 r.in.offered = offered;
898 if (DEBUGLEVEL >= 10) {
899 NDR_PRINT_IN_DEBUG(spoolss_EnumJobs, &r);
902 status = cli->dispatch(cli,
903 mem_ctx,
904 &ndr_table_spoolss,
905 NDR_SPOOLSS_ENUMJOBS,
906 &r);
908 if (!NT_STATUS_IS_OK(status)) {
909 return status;
912 if (DEBUGLEVEL >= 10) {
913 NDR_PRINT_OUT_DEBUG(spoolss_EnumJobs, &r);
916 if (NT_STATUS_IS_ERR(status)) {
917 return status;
920 /* Return variables */
921 *count = *r.out.count;
922 *info = *r.out.info;
923 *needed = *r.out.needed;
925 /* Return result */
926 if (werror) {
927 *werror = r.out.result;
930 return werror_to_ntstatus(r.out.result);
933 struct rpccli_spoolss_AddPrinter_state {
934 struct spoolss_AddPrinter orig;
935 struct spoolss_AddPrinter tmp;
936 TALLOC_CTX *out_mem_ctx;
937 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
940 static void rpccli_spoolss_AddPrinter_done(struct tevent_req *subreq);
942 struct tevent_req *rpccli_spoolss_AddPrinter_send(TALLOC_CTX *mem_ctx,
943 struct tevent_context *ev,
944 struct rpc_pipe_client *cli,
945 const char *_server /* [in] [unique,charset(UTF16)] */,
946 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
947 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
948 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
949 struct policy_handle *_handle /* [out] [ref] */)
951 struct tevent_req *req;
952 struct rpccli_spoolss_AddPrinter_state *state;
953 struct tevent_req *subreq;
955 req = tevent_req_create(mem_ctx, &state,
956 struct rpccli_spoolss_AddPrinter_state);
957 if (req == NULL) {
958 return NULL;
960 state->out_mem_ctx = NULL;
961 state->dispatch_recv = cli->dispatch_recv;
963 /* In parameters */
964 state->orig.in.server = _server;
965 state->orig.in.info_ctr = _info_ctr;
966 state->orig.in.devmode_ctr = _devmode_ctr;
967 state->orig.in.secdesc_ctr = _secdesc_ctr;
969 /* Out parameters */
970 state->orig.out.handle = _handle;
972 /* Result */
973 ZERO_STRUCT(state->orig.out.result);
975 if (DEBUGLEVEL >= 10) {
976 NDR_PRINT_IN_DEBUG(spoolss_AddPrinter, &state->orig);
979 state->out_mem_ctx = talloc_named_const(state, 0,
980 "rpccli_spoolss_AddPrinter_out_memory");
981 if (tevent_req_nomem(state->out_mem_ctx, req)) {
982 return tevent_req_post(req, ev);
985 /* make a temporary copy, that we pass to the dispatch function */
986 state->tmp = state->orig;
988 subreq = cli->dispatch_send(state, ev, cli,
989 &ndr_table_spoolss,
990 NDR_SPOOLSS_ADDPRINTER,
991 &state->tmp);
992 if (tevent_req_nomem(subreq, req)) {
993 return tevent_req_post(req, ev);
995 tevent_req_set_callback(subreq, rpccli_spoolss_AddPrinter_done, req);
996 return req;
999 static void rpccli_spoolss_AddPrinter_done(struct tevent_req *subreq)
1001 struct tevent_req *req = tevent_req_callback_data(
1002 subreq, struct tevent_req);
1003 struct rpccli_spoolss_AddPrinter_state *state = tevent_req_data(
1004 req, struct rpccli_spoolss_AddPrinter_state);
1005 NTSTATUS status;
1006 TALLOC_CTX *mem_ctx;
1008 if (state->out_mem_ctx) {
1009 mem_ctx = state->out_mem_ctx;
1010 } else {
1011 mem_ctx = state;
1014 status = state->dispatch_recv(subreq, mem_ctx);
1015 TALLOC_FREE(subreq);
1016 if (!NT_STATUS_IS_OK(status)) {
1017 tevent_req_nterror(req, status);
1018 return;
1021 /* Copy out parameters */
1022 *state->orig.out.handle = *state->tmp.out.handle;
1024 /* Copy result */
1025 state->orig.out.result = state->tmp.out.result;
1027 /* Reset temporary structure */
1028 ZERO_STRUCT(state->tmp);
1030 if (DEBUGLEVEL >= 10) {
1031 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinter, &state->orig);
1034 tevent_req_done(req);
1037 NTSTATUS rpccli_spoolss_AddPrinter_recv(struct tevent_req *req,
1038 TALLOC_CTX *mem_ctx,
1039 WERROR *result)
1041 struct rpccli_spoolss_AddPrinter_state *state = tevent_req_data(
1042 req, struct rpccli_spoolss_AddPrinter_state);
1043 NTSTATUS status;
1045 if (tevent_req_is_nterror(req, &status)) {
1046 tevent_req_received(req);
1047 return status;
1050 /* Steal possbile out parameters to the callers context */
1051 talloc_steal(mem_ctx, state->out_mem_ctx);
1053 /* Return result */
1054 *result = state->orig.out.result;
1056 tevent_req_received(req);
1057 return NT_STATUS_OK;
1060 NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli,
1061 TALLOC_CTX *mem_ctx,
1062 const char *server /* [in] [unique,charset(UTF16)] */,
1063 struct spoolss_SetPrinterInfoCtr *info_ctr /* [in] [ref] */,
1064 struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
1065 struct sec_desc_buf *secdesc_ctr /* [in] [ref] */,
1066 struct policy_handle *handle /* [out] [ref] */,
1067 WERROR *werror)
1069 struct spoolss_AddPrinter r;
1070 NTSTATUS status;
1072 /* In parameters */
1073 r.in.server = server;
1074 r.in.info_ctr = info_ctr;
1075 r.in.devmode_ctr = devmode_ctr;
1076 r.in.secdesc_ctr = secdesc_ctr;
1078 if (DEBUGLEVEL >= 10) {
1079 NDR_PRINT_IN_DEBUG(spoolss_AddPrinter, &r);
1082 status = cli->dispatch(cli,
1083 mem_ctx,
1084 &ndr_table_spoolss,
1085 NDR_SPOOLSS_ADDPRINTER,
1086 &r);
1088 if (!NT_STATUS_IS_OK(status)) {
1089 return status;
1092 if (DEBUGLEVEL >= 10) {
1093 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinter, &r);
1096 if (NT_STATUS_IS_ERR(status)) {
1097 return status;
1100 /* Return variables */
1101 *handle = *r.out.handle;
1103 /* Return result */
1104 if (werror) {
1105 *werror = r.out.result;
1108 return werror_to_ntstatus(r.out.result);
1111 struct rpccli_spoolss_DeletePrinter_state {
1112 struct spoolss_DeletePrinter orig;
1113 struct spoolss_DeletePrinter tmp;
1114 TALLOC_CTX *out_mem_ctx;
1115 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1118 static void rpccli_spoolss_DeletePrinter_done(struct tevent_req *subreq);
1120 struct tevent_req *rpccli_spoolss_DeletePrinter_send(TALLOC_CTX *mem_ctx,
1121 struct tevent_context *ev,
1122 struct rpc_pipe_client *cli,
1123 struct policy_handle *_handle /* [in] [ref] */)
1125 struct tevent_req *req;
1126 struct rpccli_spoolss_DeletePrinter_state *state;
1127 struct tevent_req *subreq;
1129 req = tevent_req_create(mem_ctx, &state,
1130 struct rpccli_spoolss_DeletePrinter_state);
1131 if (req == NULL) {
1132 return NULL;
1134 state->out_mem_ctx = NULL;
1135 state->dispatch_recv = cli->dispatch_recv;
1137 /* In parameters */
1138 state->orig.in.handle = _handle;
1140 /* Out parameters */
1142 /* Result */
1143 ZERO_STRUCT(state->orig.out.result);
1145 if (DEBUGLEVEL >= 10) {
1146 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinter, &state->orig);
1149 /* make a temporary copy, that we pass to the dispatch function */
1150 state->tmp = state->orig;
1152 subreq = cli->dispatch_send(state, ev, cli,
1153 &ndr_table_spoolss,
1154 NDR_SPOOLSS_DELETEPRINTER,
1155 &state->tmp);
1156 if (tevent_req_nomem(subreq, req)) {
1157 return tevent_req_post(req, ev);
1159 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinter_done, req);
1160 return req;
1163 static void rpccli_spoolss_DeletePrinter_done(struct tevent_req *subreq)
1165 struct tevent_req *req = tevent_req_callback_data(
1166 subreq, struct tevent_req);
1167 struct rpccli_spoolss_DeletePrinter_state *state = tevent_req_data(
1168 req, struct rpccli_spoolss_DeletePrinter_state);
1169 NTSTATUS status;
1170 TALLOC_CTX *mem_ctx;
1172 if (state->out_mem_ctx) {
1173 mem_ctx = state->out_mem_ctx;
1174 } else {
1175 mem_ctx = state;
1178 status = state->dispatch_recv(subreq, mem_ctx);
1179 TALLOC_FREE(subreq);
1180 if (!NT_STATUS_IS_OK(status)) {
1181 tevent_req_nterror(req, status);
1182 return;
1185 /* Copy out parameters */
1187 /* Copy result */
1188 state->orig.out.result = state->tmp.out.result;
1190 /* Reset temporary structure */
1191 ZERO_STRUCT(state->tmp);
1193 if (DEBUGLEVEL >= 10) {
1194 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinter, &state->orig);
1197 tevent_req_done(req);
1200 NTSTATUS rpccli_spoolss_DeletePrinter_recv(struct tevent_req *req,
1201 TALLOC_CTX *mem_ctx,
1202 WERROR *result)
1204 struct rpccli_spoolss_DeletePrinter_state *state = tevent_req_data(
1205 req, struct rpccli_spoolss_DeletePrinter_state);
1206 NTSTATUS status;
1208 if (tevent_req_is_nterror(req, &status)) {
1209 tevent_req_received(req);
1210 return status;
1213 /* Steal possbile out parameters to the callers context */
1214 talloc_steal(mem_ctx, state->out_mem_ctx);
1216 /* Return result */
1217 *result = state->orig.out.result;
1219 tevent_req_received(req);
1220 return NT_STATUS_OK;
1223 NTSTATUS rpccli_spoolss_DeletePrinter(struct rpc_pipe_client *cli,
1224 TALLOC_CTX *mem_ctx,
1225 struct policy_handle *handle /* [in] [ref] */,
1226 WERROR *werror)
1228 struct spoolss_DeletePrinter r;
1229 NTSTATUS status;
1231 /* In parameters */
1232 r.in.handle = handle;
1234 if (DEBUGLEVEL >= 10) {
1235 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinter, &r);
1238 status = cli->dispatch(cli,
1239 mem_ctx,
1240 &ndr_table_spoolss,
1241 NDR_SPOOLSS_DELETEPRINTER,
1242 &r);
1244 if (!NT_STATUS_IS_OK(status)) {
1245 return status;
1248 if (DEBUGLEVEL >= 10) {
1249 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinter, &r);
1252 if (NT_STATUS_IS_ERR(status)) {
1253 return status;
1256 /* Return variables */
1258 /* Return result */
1259 if (werror) {
1260 *werror = r.out.result;
1263 return werror_to_ntstatus(r.out.result);
1266 struct rpccli_spoolss_SetPrinter_state {
1267 struct spoolss_SetPrinter orig;
1268 struct spoolss_SetPrinter tmp;
1269 TALLOC_CTX *out_mem_ctx;
1270 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1273 static void rpccli_spoolss_SetPrinter_done(struct tevent_req *subreq);
1275 struct tevent_req *rpccli_spoolss_SetPrinter_send(TALLOC_CTX *mem_ctx,
1276 struct tevent_context *ev,
1277 struct rpc_pipe_client *cli,
1278 struct policy_handle *_handle /* [in] [ref] */,
1279 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
1280 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
1281 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
1282 enum spoolss_PrinterControl _command /* [in] */)
1284 struct tevent_req *req;
1285 struct rpccli_spoolss_SetPrinter_state *state;
1286 struct tevent_req *subreq;
1288 req = tevent_req_create(mem_ctx, &state,
1289 struct rpccli_spoolss_SetPrinter_state);
1290 if (req == NULL) {
1291 return NULL;
1293 state->out_mem_ctx = NULL;
1294 state->dispatch_recv = cli->dispatch_recv;
1296 /* In parameters */
1297 state->orig.in.handle = _handle;
1298 state->orig.in.info_ctr = _info_ctr;
1299 state->orig.in.devmode_ctr = _devmode_ctr;
1300 state->orig.in.secdesc_ctr = _secdesc_ctr;
1301 state->orig.in.command = _command;
1303 /* Out parameters */
1305 /* Result */
1306 ZERO_STRUCT(state->orig.out.result);
1308 if (DEBUGLEVEL >= 10) {
1309 NDR_PRINT_IN_DEBUG(spoolss_SetPrinter, &state->orig);
1312 /* make a temporary copy, that we pass to the dispatch function */
1313 state->tmp = state->orig;
1315 subreq = cli->dispatch_send(state, ev, cli,
1316 &ndr_table_spoolss,
1317 NDR_SPOOLSS_SETPRINTER,
1318 &state->tmp);
1319 if (tevent_req_nomem(subreq, req)) {
1320 return tevent_req_post(req, ev);
1322 tevent_req_set_callback(subreq, rpccli_spoolss_SetPrinter_done, req);
1323 return req;
1326 static void rpccli_spoolss_SetPrinter_done(struct tevent_req *subreq)
1328 struct tevent_req *req = tevent_req_callback_data(
1329 subreq, struct tevent_req);
1330 struct rpccli_spoolss_SetPrinter_state *state = tevent_req_data(
1331 req, struct rpccli_spoolss_SetPrinter_state);
1332 NTSTATUS status;
1333 TALLOC_CTX *mem_ctx;
1335 if (state->out_mem_ctx) {
1336 mem_ctx = state->out_mem_ctx;
1337 } else {
1338 mem_ctx = state;
1341 status = state->dispatch_recv(subreq, mem_ctx);
1342 TALLOC_FREE(subreq);
1343 if (!NT_STATUS_IS_OK(status)) {
1344 tevent_req_nterror(req, status);
1345 return;
1348 /* Copy out parameters */
1350 /* Copy result */
1351 state->orig.out.result = state->tmp.out.result;
1353 /* Reset temporary structure */
1354 ZERO_STRUCT(state->tmp);
1356 if (DEBUGLEVEL >= 10) {
1357 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinter, &state->orig);
1360 tevent_req_done(req);
1363 NTSTATUS rpccli_spoolss_SetPrinter_recv(struct tevent_req *req,
1364 TALLOC_CTX *mem_ctx,
1365 WERROR *result)
1367 struct rpccli_spoolss_SetPrinter_state *state = tevent_req_data(
1368 req, struct rpccli_spoolss_SetPrinter_state);
1369 NTSTATUS status;
1371 if (tevent_req_is_nterror(req, &status)) {
1372 tevent_req_received(req);
1373 return status;
1376 /* Steal possbile out parameters to the callers context */
1377 talloc_steal(mem_ctx, state->out_mem_ctx);
1379 /* Return result */
1380 *result = state->orig.out.result;
1382 tevent_req_received(req);
1383 return NT_STATUS_OK;
1386 NTSTATUS rpccli_spoolss_SetPrinter(struct rpc_pipe_client *cli,
1387 TALLOC_CTX *mem_ctx,
1388 struct policy_handle *handle /* [in] [ref] */,
1389 struct spoolss_SetPrinterInfoCtr *info_ctr /* [in] [ref] */,
1390 struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
1391 struct sec_desc_buf *secdesc_ctr /* [in] [ref] */,
1392 enum spoolss_PrinterControl command /* [in] */,
1393 WERROR *werror)
1395 struct spoolss_SetPrinter r;
1396 NTSTATUS status;
1398 /* In parameters */
1399 r.in.handle = handle;
1400 r.in.info_ctr = info_ctr;
1401 r.in.devmode_ctr = devmode_ctr;
1402 r.in.secdesc_ctr = secdesc_ctr;
1403 r.in.command = command;
1405 if (DEBUGLEVEL >= 10) {
1406 NDR_PRINT_IN_DEBUG(spoolss_SetPrinter, &r);
1409 status = cli->dispatch(cli,
1410 mem_ctx,
1411 &ndr_table_spoolss,
1412 NDR_SPOOLSS_SETPRINTER,
1413 &r);
1415 if (!NT_STATUS_IS_OK(status)) {
1416 return status;
1419 if (DEBUGLEVEL >= 10) {
1420 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinter, &r);
1423 if (NT_STATUS_IS_ERR(status)) {
1424 return status;
1427 /* Return variables */
1429 /* Return result */
1430 if (werror) {
1431 *werror = r.out.result;
1434 return werror_to_ntstatus(r.out.result);
1437 struct rpccli_spoolss_GetPrinter_state {
1438 struct spoolss_GetPrinter orig;
1439 struct spoolss_GetPrinter tmp;
1440 TALLOC_CTX *out_mem_ctx;
1441 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1444 static void rpccli_spoolss_GetPrinter_done(struct tevent_req *subreq);
1446 struct tevent_req *rpccli_spoolss_GetPrinter_send(TALLOC_CTX *mem_ctx,
1447 struct tevent_context *ev,
1448 struct rpc_pipe_client *cli,
1449 struct policy_handle *_handle /* [in] [ref] */,
1450 uint32_t _level /* [in] */,
1451 DATA_BLOB *_buffer /* [in] [unique] */,
1452 uint32_t _offered /* [in] */,
1453 union spoolss_PrinterInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1454 uint32_t *_needed /* [out] [ref] */)
1456 struct tevent_req *req;
1457 struct rpccli_spoolss_GetPrinter_state *state;
1458 struct tevent_req *subreq;
1460 req = tevent_req_create(mem_ctx, &state,
1461 struct rpccli_spoolss_GetPrinter_state);
1462 if (req == NULL) {
1463 return NULL;
1465 state->out_mem_ctx = NULL;
1466 state->dispatch_recv = cli->dispatch_recv;
1468 /* In parameters */
1469 state->orig.in.handle = _handle;
1470 state->orig.in.level = _level;
1471 state->orig.in.buffer = _buffer;
1472 state->orig.in.offered = _offered;
1474 /* Out parameters */
1475 state->orig.out.info = _info;
1476 state->orig.out.needed = _needed;
1478 /* Result */
1479 ZERO_STRUCT(state->orig.out.result);
1481 if (DEBUGLEVEL >= 10) {
1482 NDR_PRINT_IN_DEBUG(spoolss_GetPrinter, &state->orig);
1485 state->out_mem_ctx = talloc_named_const(state, 0,
1486 "rpccli_spoolss_GetPrinter_out_memory");
1487 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1488 return tevent_req_post(req, ev);
1491 /* make a temporary copy, that we pass to the dispatch function */
1492 state->tmp = state->orig;
1494 subreq = cli->dispatch_send(state, ev, cli,
1495 &ndr_table_spoolss,
1496 NDR_SPOOLSS_GETPRINTER,
1497 &state->tmp);
1498 if (tevent_req_nomem(subreq, req)) {
1499 return tevent_req_post(req, ev);
1501 tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinter_done, req);
1502 return req;
1505 static void rpccli_spoolss_GetPrinter_done(struct tevent_req *subreq)
1507 struct tevent_req *req = tevent_req_callback_data(
1508 subreq, struct tevent_req);
1509 struct rpccli_spoolss_GetPrinter_state *state = tevent_req_data(
1510 req, struct rpccli_spoolss_GetPrinter_state);
1511 NTSTATUS status;
1512 TALLOC_CTX *mem_ctx;
1514 if (state->out_mem_ctx) {
1515 mem_ctx = state->out_mem_ctx;
1516 } else {
1517 mem_ctx = state;
1520 status = state->dispatch_recv(subreq, mem_ctx);
1521 TALLOC_FREE(subreq);
1522 if (!NT_STATUS_IS_OK(status)) {
1523 tevent_req_nterror(req, status);
1524 return;
1527 /* Copy out parameters */
1528 if (state->orig.out.info && state->tmp.out.info) {
1529 *state->orig.out.info = *state->tmp.out.info;
1531 *state->orig.out.needed = *state->tmp.out.needed;
1533 /* Copy result */
1534 state->orig.out.result = state->tmp.out.result;
1536 /* Reset temporary structure */
1537 ZERO_STRUCT(state->tmp);
1539 if (DEBUGLEVEL >= 10) {
1540 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinter, &state->orig);
1543 tevent_req_done(req);
1546 NTSTATUS rpccli_spoolss_GetPrinter_recv(struct tevent_req *req,
1547 TALLOC_CTX *mem_ctx,
1548 WERROR *result)
1550 struct rpccli_spoolss_GetPrinter_state *state = tevent_req_data(
1551 req, struct rpccli_spoolss_GetPrinter_state);
1552 NTSTATUS status;
1554 if (tevent_req_is_nterror(req, &status)) {
1555 tevent_req_received(req);
1556 return status;
1559 /* Steal possbile out parameters to the callers context */
1560 talloc_steal(mem_ctx, state->out_mem_ctx);
1562 /* Return result */
1563 *result = state->orig.out.result;
1565 tevent_req_received(req);
1566 return NT_STATUS_OK;
1569 NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli,
1570 TALLOC_CTX *mem_ctx,
1571 struct policy_handle *handle /* [in] [ref] */,
1572 uint32_t level /* [in] */,
1573 DATA_BLOB *buffer /* [in] [unique] */,
1574 uint32_t offered /* [in] */,
1575 union spoolss_PrinterInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1576 uint32_t *needed /* [out] [ref] */,
1577 WERROR *werror)
1579 struct spoolss_GetPrinter r;
1580 NTSTATUS status;
1582 /* In parameters */
1583 r.in.handle = handle;
1584 r.in.level = level;
1585 r.in.buffer = buffer;
1586 r.in.offered = offered;
1588 if (DEBUGLEVEL >= 10) {
1589 NDR_PRINT_IN_DEBUG(spoolss_GetPrinter, &r);
1592 status = cli->dispatch(cli,
1593 mem_ctx,
1594 &ndr_table_spoolss,
1595 NDR_SPOOLSS_GETPRINTER,
1596 &r);
1598 if (!NT_STATUS_IS_OK(status)) {
1599 return status;
1602 if (DEBUGLEVEL >= 10) {
1603 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinter, &r);
1606 if (NT_STATUS_IS_ERR(status)) {
1607 return status;
1610 /* Return variables */
1611 if (info && r.out.info) {
1612 *info = *r.out.info;
1614 *needed = *r.out.needed;
1616 /* Return result */
1617 if (werror) {
1618 *werror = r.out.result;
1621 return werror_to_ntstatus(r.out.result);
1624 struct rpccli_spoolss_AddPrinterDriver_state {
1625 struct spoolss_AddPrinterDriver orig;
1626 struct spoolss_AddPrinterDriver tmp;
1627 TALLOC_CTX *out_mem_ctx;
1628 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1631 static void rpccli_spoolss_AddPrinterDriver_done(struct tevent_req *subreq);
1633 struct tevent_req *rpccli_spoolss_AddPrinterDriver_send(TALLOC_CTX *mem_ctx,
1634 struct tevent_context *ev,
1635 struct rpc_pipe_client *cli,
1636 const char *_servername /* [in] [unique,charset(UTF16)] */,
1637 struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */)
1639 struct tevent_req *req;
1640 struct rpccli_spoolss_AddPrinterDriver_state *state;
1641 struct tevent_req *subreq;
1643 req = tevent_req_create(mem_ctx, &state,
1644 struct rpccli_spoolss_AddPrinterDriver_state);
1645 if (req == NULL) {
1646 return NULL;
1648 state->out_mem_ctx = NULL;
1649 state->dispatch_recv = cli->dispatch_recv;
1651 /* In parameters */
1652 state->orig.in.servername = _servername;
1653 state->orig.in.info_ctr = _info_ctr;
1655 /* Out parameters */
1657 /* Result */
1658 ZERO_STRUCT(state->orig.out.result);
1660 if (DEBUGLEVEL >= 10) {
1661 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriver, &state->orig);
1664 /* make a temporary copy, that we pass to the dispatch function */
1665 state->tmp = state->orig;
1667 subreq = cli->dispatch_send(state, ev, cli,
1668 &ndr_table_spoolss,
1669 NDR_SPOOLSS_ADDPRINTERDRIVER,
1670 &state->tmp);
1671 if (tevent_req_nomem(subreq, req)) {
1672 return tevent_req_post(req, ev);
1674 tevent_req_set_callback(subreq, rpccli_spoolss_AddPrinterDriver_done, req);
1675 return req;
1678 static void rpccli_spoolss_AddPrinterDriver_done(struct tevent_req *subreq)
1680 struct tevent_req *req = tevent_req_callback_data(
1681 subreq, struct tevent_req);
1682 struct rpccli_spoolss_AddPrinterDriver_state *state = tevent_req_data(
1683 req, struct rpccli_spoolss_AddPrinterDriver_state);
1684 NTSTATUS status;
1685 TALLOC_CTX *mem_ctx;
1687 if (state->out_mem_ctx) {
1688 mem_ctx = state->out_mem_ctx;
1689 } else {
1690 mem_ctx = state;
1693 status = state->dispatch_recv(subreq, mem_ctx);
1694 TALLOC_FREE(subreq);
1695 if (!NT_STATUS_IS_OK(status)) {
1696 tevent_req_nterror(req, status);
1697 return;
1700 /* Copy out parameters */
1702 /* Copy result */
1703 state->orig.out.result = state->tmp.out.result;
1705 /* Reset temporary structure */
1706 ZERO_STRUCT(state->tmp);
1708 if (DEBUGLEVEL >= 10) {
1709 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriver, &state->orig);
1712 tevent_req_done(req);
1715 NTSTATUS rpccli_spoolss_AddPrinterDriver_recv(struct tevent_req *req,
1716 TALLOC_CTX *mem_ctx,
1717 WERROR *result)
1719 struct rpccli_spoolss_AddPrinterDriver_state *state = tevent_req_data(
1720 req, struct rpccli_spoolss_AddPrinterDriver_state);
1721 NTSTATUS status;
1723 if (tevent_req_is_nterror(req, &status)) {
1724 tevent_req_received(req);
1725 return status;
1728 /* Steal possbile out parameters to the callers context */
1729 talloc_steal(mem_ctx, state->out_mem_ctx);
1731 /* Return result */
1732 *result = state->orig.out.result;
1734 tevent_req_received(req);
1735 return NT_STATUS_OK;
1738 NTSTATUS rpccli_spoolss_AddPrinterDriver(struct rpc_pipe_client *cli,
1739 TALLOC_CTX *mem_ctx,
1740 const char *servername /* [in] [unique,charset(UTF16)] */,
1741 struct spoolss_AddDriverInfoCtr *info_ctr /* [in] [ref] */,
1742 WERROR *werror)
1744 struct spoolss_AddPrinterDriver r;
1745 NTSTATUS status;
1747 /* In parameters */
1748 r.in.servername = servername;
1749 r.in.info_ctr = info_ctr;
1751 if (DEBUGLEVEL >= 10) {
1752 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriver, &r);
1755 status = cli->dispatch(cli,
1756 mem_ctx,
1757 &ndr_table_spoolss,
1758 NDR_SPOOLSS_ADDPRINTERDRIVER,
1759 &r);
1761 if (!NT_STATUS_IS_OK(status)) {
1762 return status;
1765 if (DEBUGLEVEL >= 10) {
1766 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriver, &r);
1769 if (NT_STATUS_IS_ERR(status)) {
1770 return status;
1773 /* Return variables */
1775 /* Return result */
1776 if (werror) {
1777 *werror = r.out.result;
1780 return werror_to_ntstatus(r.out.result);
1783 struct rpccli_spoolss_EnumPrinterDrivers_state {
1784 struct spoolss_EnumPrinterDrivers orig;
1785 struct spoolss_EnumPrinterDrivers tmp;
1786 TALLOC_CTX *out_mem_ctx;
1787 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1790 static void rpccli_spoolss_EnumPrinterDrivers_done(struct tevent_req *subreq);
1792 struct tevent_req *rpccli_spoolss_EnumPrinterDrivers_send(TALLOC_CTX *mem_ctx,
1793 struct tevent_context *ev,
1794 struct rpc_pipe_client *cli,
1795 const char *_server /* [in] [unique,charset(UTF16)] */,
1796 const char *_environment /* [in] [unique,charset(UTF16)] */,
1797 uint32_t _level /* [in] */,
1798 DATA_BLOB *_buffer /* [in] [unique] */,
1799 uint32_t _offered /* [in] */,
1800 uint32_t *_count /* [out] [ref] */,
1801 union spoolss_DriverInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
1802 uint32_t *_needed /* [out] [ref] */)
1804 struct tevent_req *req;
1805 struct rpccli_spoolss_EnumPrinterDrivers_state *state;
1806 struct tevent_req *subreq;
1808 req = tevent_req_create(mem_ctx, &state,
1809 struct rpccli_spoolss_EnumPrinterDrivers_state);
1810 if (req == NULL) {
1811 return NULL;
1813 state->out_mem_ctx = NULL;
1814 state->dispatch_recv = cli->dispatch_recv;
1816 /* In parameters */
1817 state->orig.in.server = _server;
1818 state->orig.in.environment = _environment;
1819 state->orig.in.level = _level;
1820 state->orig.in.buffer = _buffer;
1821 state->orig.in.offered = _offered;
1823 /* Out parameters */
1824 state->orig.out.count = _count;
1825 state->orig.out.info = _info;
1826 state->orig.out.needed = _needed;
1828 /* Result */
1829 ZERO_STRUCT(state->orig.out.result);
1831 if (DEBUGLEVEL >= 10) {
1832 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDrivers, &state->orig);
1835 state->out_mem_ctx = talloc_named_const(state, 0,
1836 "rpccli_spoolss_EnumPrinterDrivers_out_memory");
1837 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1838 return tevent_req_post(req, ev);
1841 /* make a temporary copy, that we pass to the dispatch function */
1842 state->tmp = state->orig;
1844 subreq = cli->dispatch_send(state, ev, cli,
1845 &ndr_table_spoolss,
1846 NDR_SPOOLSS_ENUMPRINTERDRIVERS,
1847 &state->tmp);
1848 if (tevent_req_nomem(subreq, req)) {
1849 return tevent_req_post(req, ev);
1851 tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrinterDrivers_done, req);
1852 return req;
1855 static void rpccli_spoolss_EnumPrinterDrivers_done(struct tevent_req *subreq)
1857 struct tevent_req *req = tevent_req_callback_data(
1858 subreq, struct tevent_req);
1859 struct rpccli_spoolss_EnumPrinterDrivers_state *state = tevent_req_data(
1860 req, struct rpccli_spoolss_EnumPrinterDrivers_state);
1861 NTSTATUS status;
1862 TALLOC_CTX *mem_ctx;
1864 if (state->out_mem_ctx) {
1865 mem_ctx = state->out_mem_ctx;
1866 } else {
1867 mem_ctx = state;
1870 status = state->dispatch_recv(subreq, mem_ctx);
1871 TALLOC_FREE(subreq);
1872 if (!NT_STATUS_IS_OK(status)) {
1873 tevent_req_nterror(req, status);
1874 return;
1877 /* Copy out parameters */
1878 *state->orig.out.count = *state->tmp.out.count;
1879 *state->orig.out.info = *state->tmp.out.info;
1880 *state->orig.out.needed = *state->tmp.out.needed;
1882 /* Copy result */
1883 state->orig.out.result = state->tmp.out.result;
1885 /* Reset temporary structure */
1886 ZERO_STRUCT(state->tmp);
1888 if (DEBUGLEVEL >= 10) {
1889 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDrivers, &state->orig);
1892 tevent_req_done(req);
1895 NTSTATUS rpccli_spoolss_EnumPrinterDrivers_recv(struct tevent_req *req,
1896 TALLOC_CTX *mem_ctx,
1897 WERROR *result)
1899 struct rpccli_spoolss_EnumPrinterDrivers_state *state = tevent_req_data(
1900 req, struct rpccli_spoolss_EnumPrinterDrivers_state);
1901 NTSTATUS status;
1903 if (tevent_req_is_nterror(req, &status)) {
1904 tevent_req_received(req);
1905 return status;
1908 /* Steal possbile out parameters to the callers context */
1909 talloc_steal(mem_ctx, state->out_mem_ctx);
1911 /* Return result */
1912 *result = state->orig.out.result;
1914 tevent_req_received(req);
1915 return NT_STATUS_OK;
1918 NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
1919 TALLOC_CTX *mem_ctx,
1920 const char *server /* [in] [unique,charset(UTF16)] */,
1921 const char *environment /* [in] [unique,charset(UTF16)] */,
1922 uint32_t level /* [in] */,
1923 DATA_BLOB *buffer /* [in] [unique] */,
1924 uint32_t offered /* [in] */,
1925 uint32_t *count /* [out] [ref] */,
1926 union spoolss_DriverInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
1927 uint32_t *needed /* [out] [ref] */,
1928 WERROR *werror)
1930 struct spoolss_EnumPrinterDrivers r;
1931 NTSTATUS status;
1933 /* In parameters */
1934 r.in.server = server;
1935 r.in.environment = environment;
1936 r.in.level = level;
1937 r.in.buffer = buffer;
1938 r.in.offered = offered;
1940 if (DEBUGLEVEL >= 10) {
1941 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDrivers, &r);
1944 status = cli->dispatch(cli,
1945 mem_ctx,
1946 &ndr_table_spoolss,
1947 NDR_SPOOLSS_ENUMPRINTERDRIVERS,
1948 &r);
1950 if (!NT_STATUS_IS_OK(status)) {
1951 return status;
1954 if (DEBUGLEVEL >= 10) {
1955 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDrivers, &r);
1958 if (NT_STATUS_IS_ERR(status)) {
1959 return status;
1962 /* Return variables */
1963 *count = *r.out.count;
1964 *info = *r.out.info;
1965 *needed = *r.out.needed;
1967 /* Return result */
1968 if (werror) {
1969 *werror = r.out.result;
1972 return werror_to_ntstatus(r.out.result);
1975 struct rpccli_spoolss_GetPrinterDriver_state {
1976 struct spoolss_GetPrinterDriver orig;
1977 struct spoolss_GetPrinterDriver tmp;
1978 TALLOC_CTX *out_mem_ctx;
1979 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1982 static void rpccli_spoolss_GetPrinterDriver_done(struct tevent_req *subreq);
1984 struct tevent_req *rpccli_spoolss_GetPrinterDriver_send(TALLOC_CTX *mem_ctx,
1985 struct tevent_context *ev,
1986 struct rpc_pipe_client *cli,
1987 struct policy_handle *_handle /* [in] [ref] */,
1988 const char *_architecture /* [in] [unique,charset(UTF16)] */,
1989 uint32_t _level /* [in] */,
1990 DATA_BLOB *_buffer /* [in] [unique] */,
1991 uint32_t _offered /* [in] */,
1992 union spoolss_DriverInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1993 uint32_t *_needed /* [out] [ref] */)
1995 struct tevent_req *req;
1996 struct rpccli_spoolss_GetPrinterDriver_state *state;
1997 struct tevent_req *subreq;
1999 req = tevent_req_create(mem_ctx, &state,
2000 struct rpccli_spoolss_GetPrinterDriver_state);
2001 if (req == NULL) {
2002 return NULL;
2004 state->out_mem_ctx = NULL;
2005 state->dispatch_recv = cli->dispatch_recv;
2007 /* In parameters */
2008 state->orig.in.handle = _handle;
2009 state->orig.in.architecture = _architecture;
2010 state->orig.in.level = _level;
2011 state->orig.in.buffer = _buffer;
2012 state->orig.in.offered = _offered;
2014 /* Out parameters */
2015 state->orig.out.info = _info;
2016 state->orig.out.needed = _needed;
2018 /* Result */
2019 ZERO_STRUCT(state->orig.out.result);
2021 if (DEBUGLEVEL >= 10) {
2022 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver, &state->orig);
2025 state->out_mem_ctx = talloc_named_const(state, 0,
2026 "rpccli_spoolss_GetPrinterDriver_out_memory");
2027 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2028 return tevent_req_post(req, ev);
2031 /* make a temporary copy, that we pass to the dispatch function */
2032 state->tmp = state->orig;
2034 subreq = cli->dispatch_send(state, ev, cli,
2035 &ndr_table_spoolss,
2036 NDR_SPOOLSS_GETPRINTERDRIVER,
2037 &state->tmp);
2038 if (tevent_req_nomem(subreq, req)) {
2039 return tevent_req_post(req, ev);
2041 tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterDriver_done, req);
2042 return req;
2045 static void rpccli_spoolss_GetPrinterDriver_done(struct tevent_req *subreq)
2047 struct tevent_req *req = tevent_req_callback_data(
2048 subreq, struct tevent_req);
2049 struct rpccli_spoolss_GetPrinterDriver_state *state = tevent_req_data(
2050 req, struct rpccli_spoolss_GetPrinterDriver_state);
2051 NTSTATUS status;
2052 TALLOC_CTX *mem_ctx;
2054 if (state->out_mem_ctx) {
2055 mem_ctx = state->out_mem_ctx;
2056 } else {
2057 mem_ctx = state;
2060 status = state->dispatch_recv(subreq, mem_ctx);
2061 TALLOC_FREE(subreq);
2062 if (!NT_STATUS_IS_OK(status)) {
2063 tevent_req_nterror(req, status);
2064 return;
2067 /* Copy out parameters */
2068 if (state->orig.out.info && state->tmp.out.info) {
2069 *state->orig.out.info = *state->tmp.out.info;
2071 *state->orig.out.needed = *state->tmp.out.needed;
2073 /* Copy result */
2074 state->orig.out.result = state->tmp.out.result;
2076 /* Reset temporary structure */
2077 ZERO_STRUCT(state->tmp);
2079 if (DEBUGLEVEL >= 10) {
2080 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver, &state->orig);
2083 tevent_req_done(req);
2086 NTSTATUS rpccli_spoolss_GetPrinterDriver_recv(struct tevent_req *req,
2087 TALLOC_CTX *mem_ctx,
2088 WERROR *result)
2090 struct rpccli_spoolss_GetPrinterDriver_state *state = tevent_req_data(
2091 req, struct rpccli_spoolss_GetPrinterDriver_state);
2092 NTSTATUS status;
2094 if (tevent_req_is_nterror(req, &status)) {
2095 tevent_req_received(req);
2096 return status;
2099 /* Steal possbile out parameters to the callers context */
2100 talloc_steal(mem_ctx, state->out_mem_ctx);
2102 /* Return result */
2103 *result = state->orig.out.result;
2105 tevent_req_received(req);
2106 return NT_STATUS_OK;
2109 NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli,
2110 TALLOC_CTX *mem_ctx,
2111 struct policy_handle *handle /* [in] [ref] */,
2112 const char *architecture /* [in] [unique,charset(UTF16)] */,
2113 uint32_t level /* [in] */,
2114 DATA_BLOB *buffer /* [in] [unique] */,
2115 uint32_t offered /* [in] */,
2116 union spoolss_DriverInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2117 uint32_t *needed /* [out] [ref] */,
2118 WERROR *werror)
2120 struct spoolss_GetPrinterDriver r;
2121 NTSTATUS status;
2123 /* In parameters */
2124 r.in.handle = handle;
2125 r.in.architecture = architecture;
2126 r.in.level = level;
2127 r.in.buffer = buffer;
2128 r.in.offered = offered;
2130 if (DEBUGLEVEL >= 10) {
2131 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver, &r);
2134 status = cli->dispatch(cli,
2135 mem_ctx,
2136 &ndr_table_spoolss,
2137 NDR_SPOOLSS_GETPRINTERDRIVER,
2138 &r);
2140 if (!NT_STATUS_IS_OK(status)) {
2141 return status;
2144 if (DEBUGLEVEL >= 10) {
2145 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver, &r);
2148 if (NT_STATUS_IS_ERR(status)) {
2149 return status;
2152 /* Return variables */
2153 if (info && r.out.info) {
2154 *info = *r.out.info;
2156 *needed = *r.out.needed;
2158 /* Return result */
2159 if (werror) {
2160 *werror = r.out.result;
2163 return werror_to_ntstatus(r.out.result);
2166 struct rpccli_spoolss_GetPrinterDriverDirectory_state {
2167 struct spoolss_GetPrinterDriverDirectory orig;
2168 struct spoolss_GetPrinterDriverDirectory tmp;
2169 TALLOC_CTX *out_mem_ctx;
2170 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2173 static void rpccli_spoolss_GetPrinterDriverDirectory_done(struct tevent_req *subreq);
2175 struct tevent_req *rpccli_spoolss_GetPrinterDriverDirectory_send(TALLOC_CTX *mem_ctx,
2176 struct tevent_context *ev,
2177 struct rpc_pipe_client *cli,
2178 const char *_server /* [in] [unique,charset(UTF16)] */,
2179 const char *_environment /* [in] [unique,charset(UTF16)] */,
2180 uint32_t _level /* [in] */,
2181 DATA_BLOB *_buffer /* [in] [unique] */,
2182 uint32_t _offered /* [in] */,
2183 union spoolss_DriverDirectoryInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2184 uint32_t *_needed /* [out] [ref] */)
2186 struct tevent_req *req;
2187 struct rpccli_spoolss_GetPrinterDriverDirectory_state *state;
2188 struct tevent_req *subreq;
2190 req = tevent_req_create(mem_ctx, &state,
2191 struct rpccli_spoolss_GetPrinterDriverDirectory_state);
2192 if (req == NULL) {
2193 return NULL;
2195 state->out_mem_ctx = NULL;
2196 state->dispatch_recv = cli->dispatch_recv;
2198 /* In parameters */
2199 state->orig.in.server = _server;
2200 state->orig.in.environment = _environment;
2201 state->orig.in.level = _level;
2202 state->orig.in.buffer = _buffer;
2203 state->orig.in.offered = _offered;
2205 /* Out parameters */
2206 state->orig.out.info = _info;
2207 state->orig.out.needed = _needed;
2209 /* Result */
2210 ZERO_STRUCT(state->orig.out.result);
2212 if (DEBUGLEVEL >= 10) {
2213 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriverDirectory, &state->orig);
2216 state->out_mem_ctx = talloc_named_const(state, 0,
2217 "rpccli_spoolss_GetPrinterDriverDirectory_out_memory");
2218 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2219 return tevent_req_post(req, ev);
2222 /* make a temporary copy, that we pass to the dispatch function */
2223 state->tmp = state->orig;
2225 subreq = cli->dispatch_send(state, ev, cli,
2226 &ndr_table_spoolss,
2227 NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY,
2228 &state->tmp);
2229 if (tevent_req_nomem(subreq, req)) {
2230 return tevent_req_post(req, ev);
2232 tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterDriverDirectory_done, req);
2233 return req;
2236 static void rpccli_spoolss_GetPrinterDriverDirectory_done(struct tevent_req *subreq)
2238 struct tevent_req *req = tevent_req_callback_data(
2239 subreq, struct tevent_req);
2240 struct rpccli_spoolss_GetPrinterDriverDirectory_state *state = tevent_req_data(
2241 req, struct rpccli_spoolss_GetPrinterDriverDirectory_state);
2242 NTSTATUS status;
2243 TALLOC_CTX *mem_ctx;
2245 if (state->out_mem_ctx) {
2246 mem_ctx = state->out_mem_ctx;
2247 } else {
2248 mem_ctx = state;
2251 status = state->dispatch_recv(subreq, mem_ctx);
2252 TALLOC_FREE(subreq);
2253 if (!NT_STATUS_IS_OK(status)) {
2254 tevent_req_nterror(req, status);
2255 return;
2258 /* Copy out parameters */
2259 if (state->orig.out.info && state->tmp.out.info) {
2260 *state->orig.out.info = *state->tmp.out.info;
2262 *state->orig.out.needed = *state->tmp.out.needed;
2264 /* Copy result */
2265 state->orig.out.result = state->tmp.out.result;
2267 /* Reset temporary structure */
2268 ZERO_STRUCT(state->tmp);
2270 if (DEBUGLEVEL >= 10) {
2271 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverDirectory, &state->orig);
2274 tevent_req_done(req);
2277 NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory_recv(struct tevent_req *req,
2278 TALLOC_CTX *mem_ctx,
2279 WERROR *result)
2281 struct rpccli_spoolss_GetPrinterDriverDirectory_state *state = tevent_req_data(
2282 req, struct rpccli_spoolss_GetPrinterDriverDirectory_state);
2283 NTSTATUS status;
2285 if (tevent_req_is_nterror(req, &status)) {
2286 tevent_req_received(req);
2287 return status;
2290 /* Steal possbile out parameters to the callers context */
2291 talloc_steal(mem_ctx, state->out_mem_ctx);
2293 /* Return result */
2294 *result = state->orig.out.result;
2296 tevent_req_received(req);
2297 return NT_STATUS_OK;
2300 NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
2301 TALLOC_CTX *mem_ctx,
2302 const char *server /* [in] [unique,charset(UTF16)] */,
2303 const char *environment /* [in] [unique,charset(UTF16)] */,
2304 uint32_t level /* [in] */,
2305 DATA_BLOB *buffer /* [in] [unique] */,
2306 uint32_t offered /* [in] */,
2307 union spoolss_DriverDirectoryInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2308 uint32_t *needed /* [out] [ref] */,
2309 WERROR *werror)
2311 struct spoolss_GetPrinterDriverDirectory r;
2312 NTSTATUS status;
2314 /* In parameters */
2315 r.in.server = server;
2316 r.in.environment = environment;
2317 r.in.level = level;
2318 r.in.buffer = buffer;
2319 r.in.offered = offered;
2321 if (DEBUGLEVEL >= 10) {
2322 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriverDirectory, &r);
2325 status = cli->dispatch(cli,
2326 mem_ctx,
2327 &ndr_table_spoolss,
2328 NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY,
2329 &r);
2331 if (!NT_STATUS_IS_OK(status)) {
2332 return status;
2335 if (DEBUGLEVEL >= 10) {
2336 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverDirectory, &r);
2339 if (NT_STATUS_IS_ERR(status)) {
2340 return status;
2343 /* Return variables */
2344 if (info && r.out.info) {
2345 *info = *r.out.info;
2347 *needed = *r.out.needed;
2349 /* Return result */
2350 if (werror) {
2351 *werror = r.out.result;
2354 return werror_to_ntstatus(r.out.result);
2357 struct rpccli_spoolss_DeletePrinterDriver_state {
2358 struct spoolss_DeletePrinterDriver orig;
2359 struct spoolss_DeletePrinterDriver tmp;
2360 TALLOC_CTX *out_mem_ctx;
2361 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2364 static void rpccli_spoolss_DeletePrinterDriver_done(struct tevent_req *subreq);
2366 struct tevent_req *rpccli_spoolss_DeletePrinterDriver_send(TALLOC_CTX *mem_ctx,
2367 struct tevent_context *ev,
2368 struct rpc_pipe_client *cli,
2369 const char *_server /* [in] [unique,charset(UTF16)] */,
2370 const char *_architecture /* [in] [charset(UTF16)] */,
2371 const char *_driver /* [in] [charset(UTF16)] */)
2373 struct tevent_req *req;
2374 struct rpccli_spoolss_DeletePrinterDriver_state *state;
2375 struct tevent_req *subreq;
2377 req = tevent_req_create(mem_ctx, &state,
2378 struct rpccli_spoolss_DeletePrinterDriver_state);
2379 if (req == NULL) {
2380 return NULL;
2382 state->out_mem_ctx = NULL;
2383 state->dispatch_recv = cli->dispatch_recv;
2385 /* In parameters */
2386 state->orig.in.server = _server;
2387 state->orig.in.architecture = _architecture;
2388 state->orig.in.driver = _driver;
2390 /* Out parameters */
2392 /* Result */
2393 ZERO_STRUCT(state->orig.out.result);
2395 if (DEBUGLEVEL >= 10) {
2396 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriver, &state->orig);
2399 /* make a temporary copy, that we pass to the dispatch function */
2400 state->tmp = state->orig;
2402 subreq = cli->dispatch_send(state, ev, cli,
2403 &ndr_table_spoolss,
2404 NDR_SPOOLSS_DELETEPRINTERDRIVER,
2405 &state->tmp);
2406 if (tevent_req_nomem(subreq, req)) {
2407 return tevent_req_post(req, ev);
2409 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterDriver_done, req);
2410 return req;
2413 static void rpccli_spoolss_DeletePrinterDriver_done(struct tevent_req *subreq)
2415 struct tevent_req *req = tevent_req_callback_data(
2416 subreq, struct tevent_req);
2417 struct rpccli_spoolss_DeletePrinterDriver_state *state = tevent_req_data(
2418 req, struct rpccli_spoolss_DeletePrinterDriver_state);
2419 NTSTATUS status;
2420 TALLOC_CTX *mem_ctx;
2422 if (state->out_mem_ctx) {
2423 mem_ctx = state->out_mem_ctx;
2424 } else {
2425 mem_ctx = state;
2428 status = state->dispatch_recv(subreq, mem_ctx);
2429 TALLOC_FREE(subreq);
2430 if (!NT_STATUS_IS_OK(status)) {
2431 tevent_req_nterror(req, status);
2432 return;
2435 /* Copy out parameters */
2437 /* Copy result */
2438 state->orig.out.result = state->tmp.out.result;
2440 /* Reset temporary structure */
2441 ZERO_STRUCT(state->tmp);
2443 if (DEBUGLEVEL >= 10) {
2444 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriver, &state->orig);
2447 tevent_req_done(req);
2450 NTSTATUS rpccli_spoolss_DeletePrinterDriver_recv(struct tevent_req *req,
2451 TALLOC_CTX *mem_ctx,
2452 WERROR *result)
2454 struct rpccli_spoolss_DeletePrinterDriver_state *state = tevent_req_data(
2455 req, struct rpccli_spoolss_DeletePrinterDriver_state);
2456 NTSTATUS status;
2458 if (tevent_req_is_nterror(req, &status)) {
2459 tevent_req_received(req);
2460 return status;
2463 /* Steal possbile out parameters to the callers context */
2464 talloc_steal(mem_ctx, state->out_mem_ctx);
2466 /* Return result */
2467 *result = state->orig.out.result;
2469 tevent_req_received(req);
2470 return NT_STATUS_OK;
2473 NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli,
2474 TALLOC_CTX *mem_ctx,
2475 const char *server /* [in] [unique,charset(UTF16)] */,
2476 const char *architecture /* [in] [charset(UTF16)] */,
2477 const char *driver /* [in] [charset(UTF16)] */,
2478 WERROR *werror)
2480 struct spoolss_DeletePrinterDriver r;
2481 NTSTATUS status;
2483 /* In parameters */
2484 r.in.server = server;
2485 r.in.architecture = architecture;
2486 r.in.driver = driver;
2488 if (DEBUGLEVEL >= 10) {
2489 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriver, &r);
2492 status = cli->dispatch(cli,
2493 mem_ctx,
2494 &ndr_table_spoolss,
2495 NDR_SPOOLSS_DELETEPRINTERDRIVER,
2496 &r);
2498 if (!NT_STATUS_IS_OK(status)) {
2499 return status;
2502 if (DEBUGLEVEL >= 10) {
2503 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriver, &r);
2506 if (NT_STATUS_IS_ERR(status)) {
2507 return status;
2510 /* Return variables */
2512 /* Return result */
2513 if (werror) {
2514 *werror = r.out.result;
2517 return werror_to_ntstatus(r.out.result);
2520 struct rpccli_spoolss_AddPrintProcessor_state {
2521 struct spoolss_AddPrintProcessor orig;
2522 struct spoolss_AddPrintProcessor tmp;
2523 TALLOC_CTX *out_mem_ctx;
2524 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2527 static void rpccli_spoolss_AddPrintProcessor_done(struct tevent_req *subreq);
2529 struct tevent_req *rpccli_spoolss_AddPrintProcessor_send(TALLOC_CTX *mem_ctx,
2530 struct tevent_context *ev,
2531 struct rpc_pipe_client *cli,
2532 const char *_server /* [in] [unique,charset(UTF16)] */,
2533 const char *_architecture /* [in] [charset(UTF16)] */,
2534 const char *_path_name /* [in] [charset(UTF16)] */,
2535 const char *_print_processor_name /* [in] [charset(UTF16)] */)
2537 struct tevent_req *req;
2538 struct rpccli_spoolss_AddPrintProcessor_state *state;
2539 struct tevent_req *subreq;
2541 req = tevent_req_create(mem_ctx, &state,
2542 struct rpccli_spoolss_AddPrintProcessor_state);
2543 if (req == NULL) {
2544 return NULL;
2546 state->out_mem_ctx = NULL;
2547 state->dispatch_recv = cli->dispatch_recv;
2549 /* In parameters */
2550 state->orig.in.server = _server;
2551 state->orig.in.architecture = _architecture;
2552 state->orig.in.path_name = _path_name;
2553 state->orig.in.print_processor_name = _print_processor_name;
2555 /* Out parameters */
2557 /* Result */
2558 ZERO_STRUCT(state->orig.out.result);
2560 if (DEBUGLEVEL >= 10) {
2561 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProcessor, &state->orig);
2564 /* make a temporary copy, that we pass to the dispatch function */
2565 state->tmp = state->orig;
2567 subreq = cli->dispatch_send(state, ev, cli,
2568 &ndr_table_spoolss,
2569 NDR_SPOOLSS_ADDPRINTPROCESSOR,
2570 &state->tmp);
2571 if (tevent_req_nomem(subreq, req)) {
2572 return tevent_req_post(req, ev);
2574 tevent_req_set_callback(subreq, rpccli_spoolss_AddPrintProcessor_done, req);
2575 return req;
2578 static void rpccli_spoolss_AddPrintProcessor_done(struct tevent_req *subreq)
2580 struct tevent_req *req = tevent_req_callback_data(
2581 subreq, struct tevent_req);
2582 struct rpccli_spoolss_AddPrintProcessor_state *state = tevent_req_data(
2583 req, struct rpccli_spoolss_AddPrintProcessor_state);
2584 NTSTATUS status;
2585 TALLOC_CTX *mem_ctx;
2587 if (state->out_mem_ctx) {
2588 mem_ctx = state->out_mem_ctx;
2589 } else {
2590 mem_ctx = state;
2593 status = state->dispatch_recv(subreq, mem_ctx);
2594 TALLOC_FREE(subreq);
2595 if (!NT_STATUS_IS_OK(status)) {
2596 tevent_req_nterror(req, status);
2597 return;
2600 /* Copy out parameters */
2602 /* Copy result */
2603 state->orig.out.result = state->tmp.out.result;
2605 /* Reset temporary structure */
2606 ZERO_STRUCT(state->tmp);
2608 if (DEBUGLEVEL >= 10) {
2609 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProcessor, &state->orig);
2612 tevent_req_done(req);
2615 NTSTATUS rpccli_spoolss_AddPrintProcessor_recv(struct tevent_req *req,
2616 TALLOC_CTX *mem_ctx,
2617 WERROR *result)
2619 struct rpccli_spoolss_AddPrintProcessor_state *state = tevent_req_data(
2620 req, struct rpccli_spoolss_AddPrintProcessor_state);
2621 NTSTATUS status;
2623 if (tevent_req_is_nterror(req, &status)) {
2624 tevent_req_received(req);
2625 return status;
2628 /* Steal possbile out parameters to the callers context */
2629 talloc_steal(mem_ctx, state->out_mem_ctx);
2631 /* Return result */
2632 *result = state->orig.out.result;
2634 tevent_req_received(req);
2635 return NT_STATUS_OK;
2638 NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli,
2639 TALLOC_CTX *mem_ctx,
2640 const char *server /* [in] [unique,charset(UTF16)] */,
2641 const char *architecture /* [in] [charset(UTF16)] */,
2642 const char *path_name /* [in] [charset(UTF16)] */,
2643 const char *print_processor_name /* [in] [charset(UTF16)] */,
2644 WERROR *werror)
2646 struct spoolss_AddPrintProcessor r;
2647 NTSTATUS status;
2649 /* In parameters */
2650 r.in.server = server;
2651 r.in.architecture = architecture;
2652 r.in.path_name = path_name;
2653 r.in.print_processor_name = print_processor_name;
2655 if (DEBUGLEVEL >= 10) {
2656 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProcessor, &r);
2659 status = cli->dispatch(cli,
2660 mem_ctx,
2661 &ndr_table_spoolss,
2662 NDR_SPOOLSS_ADDPRINTPROCESSOR,
2663 &r);
2665 if (!NT_STATUS_IS_OK(status)) {
2666 return status;
2669 if (DEBUGLEVEL >= 10) {
2670 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProcessor, &r);
2673 if (NT_STATUS_IS_ERR(status)) {
2674 return status;
2677 /* Return variables */
2679 /* Return result */
2680 if (werror) {
2681 *werror = r.out.result;
2684 return werror_to_ntstatus(r.out.result);
2687 struct rpccli_spoolss_EnumPrintProcessors_state {
2688 struct spoolss_EnumPrintProcessors orig;
2689 struct spoolss_EnumPrintProcessors tmp;
2690 TALLOC_CTX *out_mem_ctx;
2691 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2694 static void rpccli_spoolss_EnumPrintProcessors_done(struct tevent_req *subreq);
2696 struct tevent_req *rpccli_spoolss_EnumPrintProcessors_send(TALLOC_CTX *mem_ctx,
2697 struct tevent_context *ev,
2698 struct rpc_pipe_client *cli,
2699 const char *_servername /* [in] [unique,charset(UTF16)] */,
2700 const char *_environment /* [in] [unique,charset(UTF16)] */,
2701 uint32_t _level /* [in] */,
2702 DATA_BLOB *_buffer /* [in] [unique] */,
2703 uint32_t _offered /* [in] */,
2704 uint32_t *_count /* [out] [ref] */,
2705 union spoolss_PrintProcessorInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
2706 uint32_t *_needed /* [out] [ref] */)
2708 struct tevent_req *req;
2709 struct rpccli_spoolss_EnumPrintProcessors_state *state;
2710 struct tevent_req *subreq;
2712 req = tevent_req_create(mem_ctx, &state,
2713 struct rpccli_spoolss_EnumPrintProcessors_state);
2714 if (req == NULL) {
2715 return NULL;
2717 state->out_mem_ctx = NULL;
2718 state->dispatch_recv = cli->dispatch_recv;
2720 /* In parameters */
2721 state->orig.in.servername = _servername;
2722 state->orig.in.environment = _environment;
2723 state->orig.in.level = _level;
2724 state->orig.in.buffer = _buffer;
2725 state->orig.in.offered = _offered;
2727 /* Out parameters */
2728 state->orig.out.count = _count;
2729 state->orig.out.info = _info;
2730 state->orig.out.needed = _needed;
2732 /* Result */
2733 ZERO_STRUCT(state->orig.out.result);
2735 if (DEBUGLEVEL >= 10) {
2736 NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcessors, &state->orig);
2739 state->out_mem_ctx = talloc_named_const(state, 0,
2740 "rpccli_spoolss_EnumPrintProcessors_out_memory");
2741 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2742 return tevent_req_post(req, ev);
2745 /* make a temporary copy, that we pass to the dispatch function */
2746 state->tmp = state->orig;
2748 subreq = cli->dispatch_send(state, ev, cli,
2749 &ndr_table_spoolss,
2750 NDR_SPOOLSS_ENUMPRINTPROCESSORS,
2751 &state->tmp);
2752 if (tevent_req_nomem(subreq, req)) {
2753 return tevent_req_post(req, ev);
2755 tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrintProcessors_done, req);
2756 return req;
2759 static void rpccli_spoolss_EnumPrintProcessors_done(struct tevent_req *subreq)
2761 struct tevent_req *req = tevent_req_callback_data(
2762 subreq, struct tevent_req);
2763 struct rpccli_spoolss_EnumPrintProcessors_state *state = tevent_req_data(
2764 req, struct rpccli_spoolss_EnumPrintProcessors_state);
2765 NTSTATUS status;
2766 TALLOC_CTX *mem_ctx;
2768 if (state->out_mem_ctx) {
2769 mem_ctx = state->out_mem_ctx;
2770 } else {
2771 mem_ctx = state;
2774 status = state->dispatch_recv(subreq, mem_ctx);
2775 TALLOC_FREE(subreq);
2776 if (!NT_STATUS_IS_OK(status)) {
2777 tevent_req_nterror(req, status);
2778 return;
2781 /* Copy out parameters */
2782 *state->orig.out.count = *state->tmp.out.count;
2783 *state->orig.out.info = *state->tmp.out.info;
2784 *state->orig.out.needed = *state->tmp.out.needed;
2786 /* Copy result */
2787 state->orig.out.result = state->tmp.out.result;
2789 /* Reset temporary structure */
2790 ZERO_STRUCT(state->tmp);
2792 if (DEBUGLEVEL >= 10) {
2793 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcessors, &state->orig);
2796 tevent_req_done(req);
2799 NTSTATUS rpccli_spoolss_EnumPrintProcessors_recv(struct tevent_req *req,
2800 TALLOC_CTX *mem_ctx,
2801 WERROR *result)
2803 struct rpccli_spoolss_EnumPrintProcessors_state *state = tevent_req_data(
2804 req, struct rpccli_spoolss_EnumPrintProcessors_state);
2805 NTSTATUS status;
2807 if (tevent_req_is_nterror(req, &status)) {
2808 tevent_req_received(req);
2809 return status;
2812 /* Steal possbile out parameters to the callers context */
2813 talloc_steal(mem_ctx, state->out_mem_ctx);
2815 /* Return result */
2816 *result = state->orig.out.result;
2818 tevent_req_received(req);
2819 return NT_STATUS_OK;
2822 NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
2823 TALLOC_CTX *mem_ctx,
2824 const char *servername /* [in] [unique,charset(UTF16)] */,
2825 const char *environment /* [in] [unique,charset(UTF16)] */,
2826 uint32_t level /* [in] */,
2827 DATA_BLOB *buffer /* [in] [unique] */,
2828 uint32_t offered /* [in] */,
2829 uint32_t *count /* [out] [ref] */,
2830 union spoolss_PrintProcessorInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
2831 uint32_t *needed /* [out] [ref] */,
2832 WERROR *werror)
2834 struct spoolss_EnumPrintProcessors r;
2835 NTSTATUS status;
2837 /* In parameters */
2838 r.in.servername = servername;
2839 r.in.environment = environment;
2840 r.in.level = level;
2841 r.in.buffer = buffer;
2842 r.in.offered = offered;
2844 if (DEBUGLEVEL >= 10) {
2845 NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcessors, &r);
2848 status = cli->dispatch(cli,
2849 mem_ctx,
2850 &ndr_table_spoolss,
2851 NDR_SPOOLSS_ENUMPRINTPROCESSORS,
2852 &r);
2854 if (!NT_STATUS_IS_OK(status)) {
2855 return status;
2858 if (DEBUGLEVEL >= 10) {
2859 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcessors, &r);
2862 if (NT_STATUS_IS_ERR(status)) {
2863 return status;
2866 /* Return variables */
2867 *count = *r.out.count;
2868 *info = *r.out.info;
2869 *needed = *r.out.needed;
2871 /* Return result */
2872 if (werror) {
2873 *werror = r.out.result;
2876 return werror_to_ntstatus(r.out.result);
2879 struct rpccli_spoolss_GetPrintProcessorDirectory_state {
2880 struct spoolss_GetPrintProcessorDirectory orig;
2881 struct spoolss_GetPrintProcessorDirectory tmp;
2882 TALLOC_CTX *out_mem_ctx;
2883 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2886 static void rpccli_spoolss_GetPrintProcessorDirectory_done(struct tevent_req *subreq);
2888 struct tevent_req *rpccli_spoolss_GetPrintProcessorDirectory_send(TALLOC_CTX *mem_ctx,
2889 struct tevent_context *ev,
2890 struct rpc_pipe_client *cli,
2891 const char *_server /* [in] [unique,charset(UTF16)] */,
2892 const char *_environment /* [in] [unique,charset(UTF16)] */,
2893 uint32_t _level /* [in] */,
2894 DATA_BLOB *_buffer /* [in] [unique] */,
2895 uint32_t _offered /* [in] */,
2896 union spoolss_PrintProcessorDirectoryInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2897 uint32_t *_needed /* [out] [ref] */)
2899 struct tevent_req *req;
2900 struct rpccli_spoolss_GetPrintProcessorDirectory_state *state;
2901 struct tevent_req *subreq;
2903 req = tevent_req_create(mem_ctx, &state,
2904 struct rpccli_spoolss_GetPrintProcessorDirectory_state);
2905 if (req == NULL) {
2906 return NULL;
2908 state->out_mem_ctx = NULL;
2909 state->dispatch_recv = cli->dispatch_recv;
2911 /* In parameters */
2912 state->orig.in.server = _server;
2913 state->orig.in.environment = _environment;
2914 state->orig.in.level = _level;
2915 state->orig.in.buffer = _buffer;
2916 state->orig.in.offered = _offered;
2918 /* Out parameters */
2919 state->orig.out.info = _info;
2920 state->orig.out.needed = _needed;
2922 /* Result */
2923 ZERO_STRUCT(state->orig.out.result);
2925 if (DEBUGLEVEL >= 10) {
2926 NDR_PRINT_IN_DEBUG(spoolss_GetPrintProcessorDirectory, &state->orig);
2929 state->out_mem_ctx = talloc_named_const(state, 0,
2930 "rpccli_spoolss_GetPrintProcessorDirectory_out_memory");
2931 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2932 return tevent_req_post(req, ev);
2935 /* make a temporary copy, that we pass to the dispatch function */
2936 state->tmp = state->orig;
2938 subreq = cli->dispatch_send(state, ev, cli,
2939 &ndr_table_spoolss,
2940 NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY,
2941 &state->tmp);
2942 if (tevent_req_nomem(subreq, req)) {
2943 return tevent_req_post(req, ev);
2945 tevent_req_set_callback(subreq, rpccli_spoolss_GetPrintProcessorDirectory_done, req);
2946 return req;
2949 static void rpccli_spoolss_GetPrintProcessorDirectory_done(struct tevent_req *subreq)
2951 struct tevent_req *req = tevent_req_callback_data(
2952 subreq, struct tevent_req);
2953 struct rpccli_spoolss_GetPrintProcessorDirectory_state *state = tevent_req_data(
2954 req, struct rpccli_spoolss_GetPrintProcessorDirectory_state);
2955 NTSTATUS status;
2956 TALLOC_CTX *mem_ctx;
2958 if (state->out_mem_ctx) {
2959 mem_ctx = state->out_mem_ctx;
2960 } else {
2961 mem_ctx = state;
2964 status = state->dispatch_recv(subreq, mem_ctx);
2965 TALLOC_FREE(subreq);
2966 if (!NT_STATUS_IS_OK(status)) {
2967 tevent_req_nterror(req, status);
2968 return;
2971 /* Copy out parameters */
2972 if (state->orig.out.info && state->tmp.out.info) {
2973 *state->orig.out.info = *state->tmp.out.info;
2975 *state->orig.out.needed = *state->tmp.out.needed;
2977 /* Copy result */
2978 state->orig.out.result = state->tmp.out.result;
2980 /* Reset temporary structure */
2981 ZERO_STRUCT(state->tmp);
2983 if (DEBUGLEVEL >= 10) {
2984 NDR_PRINT_OUT_DEBUG(spoolss_GetPrintProcessorDirectory, &state->orig);
2987 tevent_req_done(req);
2990 NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory_recv(struct tevent_req *req,
2991 TALLOC_CTX *mem_ctx,
2992 WERROR *result)
2994 struct rpccli_spoolss_GetPrintProcessorDirectory_state *state = tevent_req_data(
2995 req, struct rpccli_spoolss_GetPrintProcessorDirectory_state);
2996 NTSTATUS status;
2998 if (tevent_req_is_nterror(req, &status)) {
2999 tevent_req_received(req);
3000 return status;
3003 /* Steal possbile out parameters to the callers context */
3004 talloc_steal(mem_ctx, state->out_mem_ctx);
3006 /* Return result */
3007 *result = state->orig.out.result;
3009 tevent_req_received(req);
3010 return NT_STATUS_OK;
3013 NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli,
3014 TALLOC_CTX *mem_ctx,
3015 const char *server /* [in] [unique,charset(UTF16)] */,
3016 const char *environment /* [in] [unique,charset(UTF16)] */,
3017 uint32_t level /* [in] */,
3018 DATA_BLOB *buffer /* [in] [unique] */,
3019 uint32_t offered /* [in] */,
3020 union spoolss_PrintProcessorDirectoryInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
3021 uint32_t *needed /* [out] [ref] */,
3022 WERROR *werror)
3024 struct spoolss_GetPrintProcessorDirectory r;
3025 NTSTATUS status;
3027 /* In parameters */
3028 r.in.server = server;
3029 r.in.environment = environment;
3030 r.in.level = level;
3031 r.in.buffer = buffer;
3032 r.in.offered = offered;
3034 if (DEBUGLEVEL >= 10) {
3035 NDR_PRINT_IN_DEBUG(spoolss_GetPrintProcessorDirectory, &r);
3038 status = cli->dispatch(cli,
3039 mem_ctx,
3040 &ndr_table_spoolss,
3041 NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY,
3042 &r);
3044 if (!NT_STATUS_IS_OK(status)) {
3045 return status;
3048 if (DEBUGLEVEL >= 10) {
3049 NDR_PRINT_OUT_DEBUG(spoolss_GetPrintProcessorDirectory, &r);
3052 if (NT_STATUS_IS_ERR(status)) {
3053 return status;
3056 /* Return variables */
3057 if (info && r.out.info) {
3058 *info = *r.out.info;
3060 *needed = *r.out.needed;
3062 /* Return result */
3063 if (werror) {
3064 *werror = r.out.result;
3067 return werror_to_ntstatus(r.out.result);
3070 struct rpccli_spoolss_StartDocPrinter_state {
3071 struct spoolss_StartDocPrinter orig;
3072 struct spoolss_StartDocPrinter tmp;
3073 TALLOC_CTX *out_mem_ctx;
3074 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3077 static void rpccli_spoolss_StartDocPrinter_done(struct tevent_req *subreq);
3079 struct tevent_req *rpccli_spoolss_StartDocPrinter_send(TALLOC_CTX *mem_ctx,
3080 struct tevent_context *ev,
3081 struct rpc_pipe_client *cli,
3082 struct policy_handle *_handle /* [in] [ref] */,
3083 uint32_t _level /* [in] */,
3084 union spoolss_DocumentInfo _info /* [in] [switch_is(level)] */,
3085 uint32_t *_job_id /* [out] [ref] */)
3087 struct tevent_req *req;
3088 struct rpccli_spoolss_StartDocPrinter_state *state;
3089 struct tevent_req *subreq;
3091 req = tevent_req_create(mem_ctx, &state,
3092 struct rpccli_spoolss_StartDocPrinter_state);
3093 if (req == NULL) {
3094 return NULL;
3096 state->out_mem_ctx = NULL;
3097 state->dispatch_recv = cli->dispatch_recv;
3099 /* In parameters */
3100 state->orig.in.handle = _handle;
3101 state->orig.in.level = _level;
3102 state->orig.in.info = _info;
3104 /* Out parameters */
3105 state->orig.out.job_id = _job_id;
3107 /* Result */
3108 ZERO_STRUCT(state->orig.out.result);
3110 if (DEBUGLEVEL >= 10) {
3111 NDR_PRINT_IN_DEBUG(spoolss_StartDocPrinter, &state->orig);
3114 state->out_mem_ctx = talloc_named_const(state, 0,
3115 "rpccli_spoolss_StartDocPrinter_out_memory");
3116 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3117 return tevent_req_post(req, ev);
3120 /* make a temporary copy, that we pass to the dispatch function */
3121 state->tmp = state->orig;
3123 subreq = cli->dispatch_send(state, ev, cli,
3124 &ndr_table_spoolss,
3125 NDR_SPOOLSS_STARTDOCPRINTER,
3126 &state->tmp);
3127 if (tevent_req_nomem(subreq, req)) {
3128 return tevent_req_post(req, ev);
3130 tevent_req_set_callback(subreq, rpccli_spoolss_StartDocPrinter_done, req);
3131 return req;
3134 static void rpccli_spoolss_StartDocPrinter_done(struct tevent_req *subreq)
3136 struct tevent_req *req = tevent_req_callback_data(
3137 subreq, struct tevent_req);
3138 struct rpccli_spoolss_StartDocPrinter_state *state = tevent_req_data(
3139 req, struct rpccli_spoolss_StartDocPrinter_state);
3140 NTSTATUS status;
3141 TALLOC_CTX *mem_ctx;
3143 if (state->out_mem_ctx) {
3144 mem_ctx = state->out_mem_ctx;
3145 } else {
3146 mem_ctx = state;
3149 status = state->dispatch_recv(subreq, mem_ctx);
3150 TALLOC_FREE(subreq);
3151 if (!NT_STATUS_IS_OK(status)) {
3152 tevent_req_nterror(req, status);
3153 return;
3156 /* Copy out parameters */
3157 *state->orig.out.job_id = *state->tmp.out.job_id;
3159 /* Copy result */
3160 state->orig.out.result = state->tmp.out.result;
3162 /* Reset temporary structure */
3163 ZERO_STRUCT(state->tmp);
3165 if (DEBUGLEVEL >= 10) {
3166 NDR_PRINT_OUT_DEBUG(spoolss_StartDocPrinter, &state->orig);
3169 tevent_req_done(req);
3172 NTSTATUS rpccli_spoolss_StartDocPrinter_recv(struct tevent_req *req,
3173 TALLOC_CTX *mem_ctx,
3174 WERROR *result)
3176 struct rpccli_spoolss_StartDocPrinter_state *state = tevent_req_data(
3177 req, struct rpccli_spoolss_StartDocPrinter_state);
3178 NTSTATUS status;
3180 if (tevent_req_is_nterror(req, &status)) {
3181 tevent_req_received(req);
3182 return status;
3185 /* Steal possbile out parameters to the callers context */
3186 talloc_steal(mem_ctx, state->out_mem_ctx);
3188 /* Return result */
3189 *result = state->orig.out.result;
3191 tevent_req_received(req);
3192 return NT_STATUS_OK;
3195 NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
3196 TALLOC_CTX *mem_ctx,
3197 struct policy_handle *handle /* [in] [ref] */,
3198 uint32_t level /* [in] */,
3199 union spoolss_DocumentInfo info /* [in] [switch_is(level)] */,
3200 uint32_t *job_id /* [out] [ref] */,
3201 WERROR *werror)
3203 struct spoolss_StartDocPrinter r;
3204 NTSTATUS status;
3206 /* In parameters */
3207 r.in.handle = handle;
3208 r.in.level = level;
3209 r.in.info = info;
3211 if (DEBUGLEVEL >= 10) {
3212 NDR_PRINT_IN_DEBUG(spoolss_StartDocPrinter, &r);
3215 status = cli->dispatch(cli,
3216 mem_ctx,
3217 &ndr_table_spoolss,
3218 NDR_SPOOLSS_STARTDOCPRINTER,
3219 &r);
3221 if (!NT_STATUS_IS_OK(status)) {
3222 return status;
3225 if (DEBUGLEVEL >= 10) {
3226 NDR_PRINT_OUT_DEBUG(spoolss_StartDocPrinter, &r);
3229 if (NT_STATUS_IS_ERR(status)) {
3230 return status;
3233 /* Return variables */
3234 *job_id = *r.out.job_id;
3236 /* Return result */
3237 if (werror) {
3238 *werror = r.out.result;
3241 return werror_to_ntstatus(r.out.result);
3244 struct rpccli_spoolss_StartPagePrinter_state {
3245 struct spoolss_StartPagePrinter orig;
3246 struct spoolss_StartPagePrinter tmp;
3247 TALLOC_CTX *out_mem_ctx;
3248 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3251 static void rpccli_spoolss_StartPagePrinter_done(struct tevent_req *subreq);
3253 struct tevent_req *rpccli_spoolss_StartPagePrinter_send(TALLOC_CTX *mem_ctx,
3254 struct tevent_context *ev,
3255 struct rpc_pipe_client *cli,
3256 struct policy_handle *_handle /* [in] [ref] */)
3258 struct tevent_req *req;
3259 struct rpccli_spoolss_StartPagePrinter_state *state;
3260 struct tevent_req *subreq;
3262 req = tevent_req_create(mem_ctx, &state,
3263 struct rpccli_spoolss_StartPagePrinter_state);
3264 if (req == NULL) {
3265 return NULL;
3267 state->out_mem_ctx = NULL;
3268 state->dispatch_recv = cli->dispatch_recv;
3270 /* In parameters */
3271 state->orig.in.handle = _handle;
3273 /* Out parameters */
3275 /* Result */
3276 ZERO_STRUCT(state->orig.out.result);
3278 if (DEBUGLEVEL >= 10) {
3279 NDR_PRINT_IN_DEBUG(spoolss_StartPagePrinter, &state->orig);
3282 /* make a temporary copy, that we pass to the dispatch function */
3283 state->tmp = state->orig;
3285 subreq = cli->dispatch_send(state, ev, cli,
3286 &ndr_table_spoolss,
3287 NDR_SPOOLSS_STARTPAGEPRINTER,
3288 &state->tmp);
3289 if (tevent_req_nomem(subreq, req)) {
3290 return tevent_req_post(req, ev);
3292 tevent_req_set_callback(subreq, rpccli_spoolss_StartPagePrinter_done, req);
3293 return req;
3296 static void rpccli_spoolss_StartPagePrinter_done(struct tevent_req *subreq)
3298 struct tevent_req *req = tevent_req_callback_data(
3299 subreq, struct tevent_req);
3300 struct rpccli_spoolss_StartPagePrinter_state *state = tevent_req_data(
3301 req, struct rpccli_spoolss_StartPagePrinter_state);
3302 NTSTATUS status;
3303 TALLOC_CTX *mem_ctx;
3305 if (state->out_mem_ctx) {
3306 mem_ctx = state->out_mem_ctx;
3307 } else {
3308 mem_ctx = state;
3311 status = state->dispatch_recv(subreq, mem_ctx);
3312 TALLOC_FREE(subreq);
3313 if (!NT_STATUS_IS_OK(status)) {
3314 tevent_req_nterror(req, status);
3315 return;
3318 /* Copy out parameters */
3320 /* Copy result */
3321 state->orig.out.result = state->tmp.out.result;
3323 /* Reset temporary structure */
3324 ZERO_STRUCT(state->tmp);
3326 if (DEBUGLEVEL >= 10) {
3327 NDR_PRINT_OUT_DEBUG(spoolss_StartPagePrinter, &state->orig);
3330 tevent_req_done(req);
3333 NTSTATUS rpccli_spoolss_StartPagePrinter_recv(struct tevent_req *req,
3334 TALLOC_CTX *mem_ctx,
3335 WERROR *result)
3337 struct rpccli_spoolss_StartPagePrinter_state *state = tevent_req_data(
3338 req, struct rpccli_spoolss_StartPagePrinter_state);
3339 NTSTATUS status;
3341 if (tevent_req_is_nterror(req, &status)) {
3342 tevent_req_received(req);
3343 return status;
3346 /* Steal possbile out parameters to the callers context */
3347 talloc_steal(mem_ctx, state->out_mem_ctx);
3349 /* Return result */
3350 *result = state->orig.out.result;
3352 tevent_req_received(req);
3353 return NT_STATUS_OK;
3356 NTSTATUS rpccli_spoolss_StartPagePrinter(struct rpc_pipe_client *cli,
3357 TALLOC_CTX *mem_ctx,
3358 struct policy_handle *handle /* [in] [ref] */,
3359 WERROR *werror)
3361 struct spoolss_StartPagePrinter r;
3362 NTSTATUS status;
3364 /* In parameters */
3365 r.in.handle = handle;
3367 if (DEBUGLEVEL >= 10) {
3368 NDR_PRINT_IN_DEBUG(spoolss_StartPagePrinter, &r);
3371 status = cli->dispatch(cli,
3372 mem_ctx,
3373 &ndr_table_spoolss,
3374 NDR_SPOOLSS_STARTPAGEPRINTER,
3375 &r);
3377 if (!NT_STATUS_IS_OK(status)) {
3378 return status;
3381 if (DEBUGLEVEL >= 10) {
3382 NDR_PRINT_OUT_DEBUG(spoolss_StartPagePrinter, &r);
3385 if (NT_STATUS_IS_ERR(status)) {
3386 return status;
3389 /* Return variables */
3391 /* Return result */
3392 if (werror) {
3393 *werror = r.out.result;
3396 return werror_to_ntstatus(r.out.result);
3399 struct rpccli_spoolss_WritePrinter_state {
3400 struct spoolss_WritePrinter orig;
3401 struct spoolss_WritePrinter tmp;
3402 TALLOC_CTX *out_mem_ctx;
3403 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3406 static void rpccli_spoolss_WritePrinter_done(struct tevent_req *subreq);
3408 struct tevent_req *rpccli_spoolss_WritePrinter_send(TALLOC_CTX *mem_ctx,
3409 struct tevent_context *ev,
3410 struct rpc_pipe_client *cli,
3411 struct policy_handle *_handle /* [in] [ref] */,
3412 DATA_BLOB _data /* [in] */,
3413 uint32_t __data_size /* [in] [value(r->in.data.length)] */,
3414 uint32_t *_num_written /* [out] [ref] */)
3416 struct tevent_req *req;
3417 struct rpccli_spoolss_WritePrinter_state *state;
3418 struct tevent_req *subreq;
3420 req = tevent_req_create(mem_ctx, &state,
3421 struct rpccli_spoolss_WritePrinter_state);
3422 if (req == NULL) {
3423 return NULL;
3425 state->out_mem_ctx = NULL;
3426 state->dispatch_recv = cli->dispatch_recv;
3428 /* In parameters */
3429 state->orig.in.handle = _handle;
3430 state->orig.in.data = _data;
3431 state->orig.in._data_size = __data_size;
3433 /* Out parameters */
3434 state->orig.out.num_written = _num_written;
3436 /* Result */
3437 ZERO_STRUCT(state->orig.out.result);
3439 if (DEBUGLEVEL >= 10) {
3440 NDR_PRINT_IN_DEBUG(spoolss_WritePrinter, &state->orig);
3443 state->out_mem_ctx = talloc_named_const(state, 0,
3444 "rpccli_spoolss_WritePrinter_out_memory");
3445 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3446 return tevent_req_post(req, ev);
3449 /* make a temporary copy, that we pass to the dispatch function */
3450 state->tmp = state->orig;
3452 subreq = cli->dispatch_send(state, ev, cli,
3453 &ndr_table_spoolss,
3454 NDR_SPOOLSS_WRITEPRINTER,
3455 &state->tmp);
3456 if (tevent_req_nomem(subreq, req)) {
3457 return tevent_req_post(req, ev);
3459 tevent_req_set_callback(subreq, rpccli_spoolss_WritePrinter_done, req);
3460 return req;
3463 static void rpccli_spoolss_WritePrinter_done(struct tevent_req *subreq)
3465 struct tevent_req *req = tevent_req_callback_data(
3466 subreq, struct tevent_req);
3467 struct rpccli_spoolss_WritePrinter_state *state = tevent_req_data(
3468 req, struct rpccli_spoolss_WritePrinter_state);
3469 NTSTATUS status;
3470 TALLOC_CTX *mem_ctx;
3472 if (state->out_mem_ctx) {
3473 mem_ctx = state->out_mem_ctx;
3474 } else {
3475 mem_ctx = state;
3478 status = state->dispatch_recv(subreq, mem_ctx);
3479 TALLOC_FREE(subreq);
3480 if (!NT_STATUS_IS_OK(status)) {
3481 tevent_req_nterror(req, status);
3482 return;
3485 /* Copy out parameters */
3486 *state->orig.out.num_written = *state->tmp.out.num_written;
3488 /* Copy result */
3489 state->orig.out.result = state->tmp.out.result;
3491 /* Reset temporary structure */
3492 ZERO_STRUCT(state->tmp);
3494 if (DEBUGLEVEL >= 10) {
3495 NDR_PRINT_OUT_DEBUG(spoolss_WritePrinter, &state->orig);
3498 tevent_req_done(req);
3501 NTSTATUS rpccli_spoolss_WritePrinter_recv(struct tevent_req *req,
3502 TALLOC_CTX *mem_ctx,
3503 WERROR *result)
3505 struct rpccli_spoolss_WritePrinter_state *state = tevent_req_data(
3506 req, struct rpccli_spoolss_WritePrinter_state);
3507 NTSTATUS status;
3509 if (tevent_req_is_nterror(req, &status)) {
3510 tevent_req_received(req);
3511 return status;
3514 /* Steal possbile out parameters to the callers context */
3515 talloc_steal(mem_ctx, state->out_mem_ctx);
3517 /* Return result */
3518 *result = state->orig.out.result;
3520 tevent_req_received(req);
3521 return NT_STATUS_OK;
3524 NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli,
3525 TALLOC_CTX *mem_ctx,
3526 struct policy_handle *handle /* [in] [ref] */,
3527 DATA_BLOB data /* [in] */,
3528 uint32_t _data_size /* [in] [value(r->in.data.length)] */,
3529 uint32_t *num_written /* [out] [ref] */,
3530 WERROR *werror)
3532 struct spoolss_WritePrinter r;
3533 NTSTATUS status;
3535 /* In parameters */
3536 r.in.handle = handle;
3537 r.in.data = data;
3538 r.in._data_size = _data_size;
3540 if (DEBUGLEVEL >= 10) {
3541 NDR_PRINT_IN_DEBUG(spoolss_WritePrinter, &r);
3544 status = cli->dispatch(cli,
3545 mem_ctx,
3546 &ndr_table_spoolss,
3547 NDR_SPOOLSS_WRITEPRINTER,
3548 &r);
3550 if (!NT_STATUS_IS_OK(status)) {
3551 return status;
3554 if (DEBUGLEVEL >= 10) {
3555 NDR_PRINT_OUT_DEBUG(spoolss_WritePrinter, &r);
3558 if (NT_STATUS_IS_ERR(status)) {
3559 return status;
3562 /* Return variables */
3563 *num_written = *r.out.num_written;
3565 /* Return result */
3566 if (werror) {
3567 *werror = r.out.result;
3570 return werror_to_ntstatus(r.out.result);
3573 struct rpccli_spoolss_EndPagePrinter_state {
3574 struct spoolss_EndPagePrinter orig;
3575 struct spoolss_EndPagePrinter tmp;
3576 TALLOC_CTX *out_mem_ctx;
3577 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3580 static void rpccli_spoolss_EndPagePrinter_done(struct tevent_req *subreq);
3582 struct tevent_req *rpccli_spoolss_EndPagePrinter_send(TALLOC_CTX *mem_ctx,
3583 struct tevent_context *ev,
3584 struct rpc_pipe_client *cli,
3585 struct policy_handle *_handle /* [in] [ref] */)
3587 struct tevent_req *req;
3588 struct rpccli_spoolss_EndPagePrinter_state *state;
3589 struct tevent_req *subreq;
3591 req = tevent_req_create(mem_ctx, &state,
3592 struct rpccli_spoolss_EndPagePrinter_state);
3593 if (req == NULL) {
3594 return NULL;
3596 state->out_mem_ctx = NULL;
3597 state->dispatch_recv = cli->dispatch_recv;
3599 /* In parameters */
3600 state->orig.in.handle = _handle;
3602 /* Out parameters */
3604 /* Result */
3605 ZERO_STRUCT(state->orig.out.result);
3607 if (DEBUGLEVEL >= 10) {
3608 NDR_PRINT_IN_DEBUG(spoolss_EndPagePrinter, &state->orig);
3611 /* make a temporary copy, that we pass to the dispatch function */
3612 state->tmp = state->orig;
3614 subreq = cli->dispatch_send(state, ev, cli,
3615 &ndr_table_spoolss,
3616 NDR_SPOOLSS_ENDPAGEPRINTER,
3617 &state->tmp);
3618 if (tevent_req_nomem(subreq, req)) {
3619 return tevent_req_post(req, ev);
3621 tevent_req_set_callback(subreq, rpccli_spoolss_EndPagePrinter_done, req);
3622 return req;
3625 static void rpccli_spoolss_EndPagePrinter_done(struct tevent_req *subreq)
3627 struct tevent_req *req = tevent_req_callback_data(
3628 subreq, struct tevent_req);
3629 struct rpccli_spoolss_EndPagePrinter_state *state = tevent_req_data(
3630 req, struct rpccli_spoolss_EndPagePrinter_state);
3631 NTSTATUS status;
3632 TALLOC_CTX *mem_ctx;
3634 if (state->out_mem_ctx) {
3635 mem_ctx = state->out_mem_ctx;
3636 } else {
3637 mem_ctx = state;
3640 status = state->dispatch_recv(subreq, mem_ctx);
3641 TALLOC_FREE(subreq);
3642 if (!NT_STATUS_IS_OK(status)) {
3643 tevent_req_nterror(req, status);
3644 return;
3647 /* Copy out parameters */
3649 /* Copy result */
3650 state->orig.out.result = state->tmp.out.result;
3652 /* Reset temporary structure */
3653 ZERO_STRUCT(state->tmp);
3655 if (DEBUGLEVEL >= 10) {
3656 NDR_PRINT_OUT_DEBUG(spoolss_EndPagePrinter, &state->orig);
3659 tevent_req_done(req);
3662 NTSTATUS rpccli_spoolss_EndPagePrinter_recv(struct tevent_req *req,
3663 TALLOC_CTX *mem_ctx,
3664 WERROR *result)
3666 struct rpccli_spoolss_EndPagePrinter_state *state = tevent_req_data(
3667 req, struct rpccli_spoolss_EndPagePrinter_state);
3668 NTSTATUS status;
3670 if (tevent_req_is_nterror(req, &status)) {
3671 tevent_req_received(req);
3672 return status;
3675 /* Steal possbile out parameters to the callers context */
3676 talloc_steal(mem_ctx, state->out_mem_ctx);
3678 /* Return result */
3679 *result = state->orig.out.result;
3681 tevent_req_received(req);
3682 return NT_STATUS_OK;
3685 NTSTATUS rpccli_spoolss_EndPagePrinter(struct rpc_pipe_client *cli,
3686 TALLOC_CTX *mem_ctx,
3687 struct policy_handle *handle /* [in] [ref] */,
3688 WERROR *werror)
3690 struct spoolss_EndPagePrinter r;
3691 NTSTATUS status;
3693 /* In parameters */
3694 r.in.handle = handle;
3696 if (DEBUGLEVEL >= 10) {
3697 NDR_PRINT_IN_DEBUG(spoolss_EndPagePrinter, &r);
3700 status = cli->dispatch(cli,
3701 mem_ctx,
3702 &ndr_table_spoolss,
3703 NDR_SPOOLSS_ENDPAGEPRINTER,
3704 &r);
3706 if (!NT_STATUS_IS_OK(status)) {
3707 return status;
3710 if (DEBUGLEVEL >= 10) {
3711 NDR_PRINT_OUT_DEBUG(spoolss_EndPagePrinter, &r);
3714 if (NT_STATUS_IS_ERR(status)) {
3715 return status;
3718 /* Return variables */
3720 /* Return result */
3721 if (werror) {
3722 *werror = r.out.result;
3725 return werror_to_ntstatus(r.out.result);
3728 struct rpccli_spoolss_AbortPrinter_state {
3729 struct spoolss_AbortPrinter orig;
3730 struct spoolss_AbortPrinter tmp;
3731 TALLOC_CTX *out_mem_ctx;
3732 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3735 static void rpccli_spoolss_AbortPrinter_done(struct tevent_req *subreq);
3737 struct tevent_req *rpccli_spoolss_AbortPrinter_send(TALLOC_CTX *mem_ctx,
3738 struct tevent_context *ev,
3739 struct rpc_pipe_client *cli,
3740 struct policy_handle *_handle /* [in] [ref] */)
3742 struct tevent_req *req;
3743 struct rpccli_spoolss_AbortPrinter_state *state;
3744 struct tevent_req *subreq;
3746 req = tevent_req_create(mem_ctx, &state,
3747 struct rpccli_spoolss_AbortPrinter_state);
3748 if (req == NULL) {
3749 return NULL;
3751 state->out_mem_ctx = NULL;
3752 state->dispatch_recv = cli->dispatch_recv;
3754 /* In parameters */
3755 state->orig.in.handle = _handle;
3757 /* Out parameters */
3759 /* Result */
3760 ZERO_STRUCT(state->orig.out.result);
3762 if (DEBUGLEVEL >= 10) {
3763 NDR_PRINT_IN_DEBUG(spoolss_AbortPrinter, &state->orig);
3766 /* make a temporary copy, that we pass to the dispatch function */
3767 state->tmp = state->orig;
3769 subreq = cli->dispatch_send(state, ev, cli,
3770 &ndr_table_spoolss,
3771 NDR_SPOOLSS_ABORTPRINTER,
3772 &state->tmp);
3773 if (tevent_req_nomem(subreq, req)) {
3774 return tevent_req_post(req, ev);
3776 tevent_req_set_callback(subreq, rpccli_spoolss_AbortPrinter_done, req);
3777 return req;
3780 static void rpccli_spoolss_AbortPrinter_done(struct tevent_req *subreq)
3782 struct tevent_req *req = tevent_req_callback_data(
3783 subreq, struct tevent_req);
3784 struct rpccli_spoolss_AbortPrinter_state *state = tevent_req_data(
3785 req, struct rpccli_spoolss_AbortPrinter_state);
3786 NTSTATUS status;
3787 TALLOC_CTX *mem_ctx;
3789 if (state->out_mem_ctx) {
3790 mem_ctx = state->out_mem_ctx;
3791 } else {
3792 mem_ctx = state;
3795 status = state->dispatch_recv(subreq, mem_ctx);
3796 TALLOC_FREE(subreq);
3797 if (!NT_STATUS_IS_OK(status)) {
3798 tevent_req_nterror(req, status);
3799 return;
3802 /* Copy out parameters */
3804 /* Copy result */
3805 state->orig.out.result = state->tmp.out.result;
3807 /* Reset temporary structure */
3808 ZERO_STRUCT(state->tmp);
3810 if (DEBUGLEVEL >= 10) {
3811 NDR_PRINT_OUT_DEBUG(spoolss_AbortPrinter, &state->orig);
3814 tevent_req_done(req);
3817 NTSTATUS rpccli_spoolss_AbortPrinter_recv(struct tevent_req *req,
3818 TALLOC_CTX *mem_ctx,
3819 WERROR *result)
3821 struct rpccli_spoolss_AbortPrinter_state *state = tevent_req_data(
3822 req, struct rpccli_spoolss_AbortPrinter_state);
3823 NTSTATUS status;
3825 if (tevent_req_is_nterror(req, &status)) {
3826 tevent_req_received(req);
3827 return status;
3830 /* Steal possbile out parameters to the callers context */
3831 talloc_steal(mem_ctx, state->out_mem_ctx);
3833 /* Return result */
3834 *result = state->orig.out.result;
3836 tevent_req_received(req);
3837 return NT_STATUS_OK;
3840 NTSTATUS rpccli_spoolss_AbortPrinter(struct rpc_pipe_client *cli,
3841 TALLOC_CTX *mem_ctx,
3842 struct policy_handle *handle /* [in] [ref] */,
3843 WERROR *werror)
3845 struct spoolss_AbortPrinter r;
3846 NTSTATUS status;
3848 /* In parameters */
3849 r.in.handle = handle;
3851 if (DEBUGLEVEL >= 10) {
3852 NDR_PRINT_IN_DEBUG(spoolss_AbortPrinter, &r);
3855 status = cli->dispatch(cli,
3856 mem_ctx,
3857 &ndr_table_spoolss,
3858 NDR_SPOOLSS_ABORTPRINTER,
3859 &r);
3861 if (!NT_STATUS_IS_OK(status)) {
3862 return status;
3865 if (DEBUGLEVEL >= 10) {
3866 NDR_PRINT_OUT_DEBUG(spoolss_AbortPrinter, &r);
3869 if (NT_STATUS_IS_ERR(status)) {
3870 return status;
3873 /* Return variables */
3875 /* Return result */
3876 if (werror) {
3877 *werror = r.out.result;
3880 return werror_to_ntstatus(r.out.result);
3883 struct rpccli_spoolss_ReadPrinter_state {
3884 struct spoolss_ReadPrinter orig;
3885 struct spoolss_ReadPrinter tmp;
3886 TALLOC_CTX *out_mem_ctx;
3887 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3890 static void rpccli_spoolss_ReadPrinter_done(struct tevent_req *subreq);
3892 struct tevent_req *rpccli_spoolss_ReadPrinter_send(TALLOC_CTX *mem_ctx,
3893 struct tevent_context *ev,
3894 struct rpc_pipe_client *cli,
3895 struct policy_handle *_handle /* [in] [ref] */,
3896 uint8_t *_data /* [out] [ref,size_is(data_size)] */,
3897 uint32_t _data_size /* [in] */,
3898 uint32_t *__data_size /* [out] [ref] */)
3900 struct tevent_req *req;
3901 struct rpccli_spoolss_ReadPrinter_state *state;
3902 struct tevent_req *subreq;
3904 req = tevent_req_create(mem_ctx, &state,
3905 struct rpccli_spoolss_ReadPrinter_state);
3906 if (req == NULL) {
3907 return NULL;
3909 state->out_mem_ctx = NULL;
3910 state->dispatch_recv = cli->dispatch_recv;
3912 /* In parameters */
3913 state->orig.in.handle = _handle;
3914 state->orig.in.data_size = _data_size;
3916 /* Out parameters */
3917 state->orig.out.data = _data;
3918 state->orig.out._data_size = __data_size;
3920 /* Result */
3921 ZERO_STRUCT(state->orig.out.result);
3923 if (DEBUGLEVEL >= 10) {
3924 NDR_PRINT_IN_DEBUG(spoolss_ReadPrinter, &state->orig);
3927 state->out_mem_ctx = talloc_named_const(state, 0,
3928 "rpccli_spoolss_ReadPrinter_out_memory");
3929 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3930 return tevent_req_post(req, ev);
3933 /* make a temporary copy, that we pass to the dispatch function */
3934 state->tmp = state->orig;
3936 subreq = cli->dispatch_send(state, ev, cli,
3937 &ndr_table_spoolss,
3938 NDR_SPOOLSS_READPRINTER,
3939 &state->tmp);
3940 if (tevent_req_nomem(subreq, req)) {
3941 return tevent_req_post(req, ev);
3943 tevent_req_set_callback(subreq, rpccli_spoolss_ReadPrinter_done, req);
3944 return req;
3947 static void rpccli_spoolss_ReadPrinter_done(struct tevent_req *subreq)
3949 struct tevent_req *req = tevent_req_callback_data(
3950 subreq, struct tevent_req);
3951 struct rpccli_spoolss_ReadPrinter_state *state = tevent_req_data(
3952 req, struct rpccli_spoolss_ReadPrinter_state);
3953 NTSTATUS status;
3954 TALLOC_CTX *mem_ctx;
3956 if (state->out_mem_ctx) {
3957 mem_ctx = state->out_mem_ctx;
3958 } else {
3959 mem_ctx = state;
3962 status = state->dispatch_recv(subreq, mem_ctx);
3963 TALLOC_FREE(subreq);
3964 if (!NT_STATUS_IS_OK(status)) {
3965 tevent_req_nterror(req, status);
3966 return;
3969 /* Copy out parameters */
3970 memcpy(state->orig.out.data, state->tmp.out.data, state->tmp.in.data_size * sizeof(*state->orig.out.data));
3971 *state->orig.out._data_size = *state->tmp.out._data_size;
3973 /* Copy result */
3974 state->orig.out.result = state->tmp.out.result;
3976 /* Reset temporary structure */
3977 ZERO_STRUCT(state->tmp);
3979 if (DEBUGLEVEL >= 10) {
3980 NDR_PRINT_OUT_DEBUG(spoolss_ReadPrinter, &state->orig);
3983 tevent_req_done(req);
3986 NTSTATUS rpccli_spoolss_ReadPrinter_recv(struct tevent_req *req,
3987 TALLOC_CTX *mem_ctx,
3988 WERROR *result)
3990 struct rpccli_spoolss_ReadPrinter_state *state = tevent_req_data(
3991 req, struct rpccli_spoolss_ReadPrinter_state);
3992 NTSTATUS status;
3994 if (tevent_req_is_nterror(req, &status)) {
3995 tevent_req_received(req);
3996 return status;
3999 /* Steal possbile out parameters to the callers context */
4000 talloc_steal(mem_ctx, state->out_mem_ctx);
4002 /* Return result */
4003 *result = state->orig.out.result;
4005 tevent_req_received(req);
4006 return NT_STATUS_OK;
4009 NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
4010 TALLOC_CTX *mem_ctx,
4011 struct policy_handle *handle /* [in] [ref] */,
4012 uint8_t *data /* [out] [ref,size_is(data_size)] */,
4013 uint32_t data_size /* [in] */,
4014 uint32_t *_data_size /* [out] [ref] */,
4015 WERROR *werror)
4017 struct spoolss_ReadPrinter r;
4018 NTSTATUS status;
4020 /* In parameters */
4021 r.in.handle = handle;
4022 r.in.data_size = data_size;
4024 if (DEBUGLEVEL >= 10) {
4025 NDR_PRINT_IN_DEBUG(spoolss_ReadPrinter, &r);
4028 status = cli->dispatch(cli,
4029 mem_ctx,
4030 &ndr_table_spoolss,
4031 NDR_SPOOLSS_READPRINTER,
4032 &r);
4034 if (!NT_STATUS_IS_OK(status)) {
4035 return status;
4038 if (DEBUGLEVEL >= 10) {
4039 NDR_PRINT_OUT_DEBUG(spoolss_ReadPrinter, &r);
4042 if (NT_STATUS_IS_ERR(status)) {
4043 return status;
4046 /* Return variables */
4047 memcpy(data, r.out.data, r.in.data_size * sizeof(*data));
4048 *_data_size = *r.out._data_size;
4050 /* Return result */
4051 if (werror) {
4052 *werror = r.out.result;
4055 return werror_to_ntstatus(r.out.result);
4058 struct rpccli_spoolss_EndDocPrinter_state {
4059 struct spoolss_EndDocPrinter orig;
4060 struct spoolss_EndDocPrinter tmp;
4061 TALLOC_CTX *out_mem_ctx;
4062 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4065 static void rpccli_spoolss_EndDocPrinter_done(struct tevent_req *subreq);
4067 struct tevent_req *rpccli_spoolss_EndDocPrinter_send(TALLOC_CTX *mem_ctx,
4068 struct tevent_context *ev,
4069 struct rpc_pipe_client *cli,
4070 struct policy_handle *_handle /* [in] [ref] */)
4072 struct tevent_req *req;
4073 struct rpccli_spoolss_EndDocPrinter_state *state;
4074 struct tevent_req *subreq;
4076 req = tevent_req_create(mem_ctx, &state,
4077 struct rpccli_spoolss_EndDocPrinter_state);
4078 if (req == NULL) {
4079 return NULL;
4081 state->out_mem_ctx = NULL;
4082 state->dispatch_recv = cli->dispatch_recv;
4084 /* In parameters */
4085 state->orig.in.handle = _handle;
4087 /* Out parameters */
4089 /* Result */
4090 ZERO_STRUCT(state->orig.out.result);
4092 if (DEBUGLEVEL >= 10) {
4093 NDR_PRINT_IN_DEBUG(spoolss_EndDocPrinter, &state->orig);
4096 /* make a temporary copy, that we pass to the dispatch function */
4097 state->tmp = state->orig;
4099 subreq = cli->dispatch_send(state, ev, cli,
4100 &ndr_table_spoolss,
4101 NDR_SPOOLSS_ENDDOCPRINTER,
4102 &state->tmp);
4103 if (tevent_req_nomem(subreq, req)) {
4104 return tevent_req_post(req, ev);
4106 tevent_req_set_callback(subreq, rpccli_spoolss_EndDocPrinter_done, req);
4107 return req;
4110 static void rpccli_spoolss_EndDocPrinter_done(struct tevent_req *subreq)
4112 struct tevent_req *req = tevent_req_callback_data(
4113 subreq, struct tevent_req);
4114 struct rpccli_spoolss_EndDocPrinter_state *state = tevent_req_data(
4115 req, struct rpccli_spoolss_EndDocPrinter_state);
4116 NTSTATUS status;
4117 TALLOC_CTX *mem_ctx;
4119 if (state->out_mem_ctx) {
4120 mem_ctx = state->out_mem_ctx;
4121 } else {
4122 mem_ctx = state;
4125 status = state->dispatch_recv(subreq, mem_ctx);
4126 TALLOC_FREE(subreq);
4127 if (!NT_STATUS_IS_OK(status)) {
4128 tevent_req_nterror(req, status);
4129 return;
4132 /* Copy out parameters */
4134 /* Copy result */
4135 state->orig.out.result = state->tmp.out.result;
4137 /* Reset temporary structure */
4138 ZERO_STRUCT(state->tmp);
4140 if (DEBUGLEVEL >= 10) {
4141 NDR_PRINT_OUT_DEBUG(spoolss_EndDocPrinter, &state->orig);
4144 tevent_req_done(req);
4147 NTSTATUS rpccli_spoolss_EndDocPrinter_recv(struct tevent_req *req,
4148 TALLOC_CTX *mem_ctx,
4149 WERROR *result)
4151 struct rpccli_spoolss_EndDocPrinter_state *state = tevent_req_data(
4152 req, struct rpccli_spoolss_EndDocPrinter_state);
4153 NTSTATUS status;
4155 if (tevent_req_is_nterror(req, &status)) {
4156 tevent_req_received(req);
4157 return status;
4160 /* Steal possbile out parameters to the callers context */
4161 talloc_steal(mem_ctx, state->out_mem_ctx);
4163 /* Return result */
4164 *result = state->orig.out.result;
4166 tevent_req_received(req);
4167 return NT_STATUS_OK;
4170 NTSTATUS rpccli_spoolss_EndDocPrinter(struct rpc_pipe_client *cli,
4171 TALLOC_CTX *mem_ctx,
4172 struct policy_handle *handle /* [in] [ref] */,
4173 WERROR *werror)
4175 struct spoolss_EndDocPrinter r;
4176 NTSTATUS status;
4178 /* In parameters */
4179 r.in.handle = handle;
4181 if (DEBUGLEVEL >= 10) {
4182 NDR_PRINT_IN_DEBUG(spoolss_EndDocPrinter, &r);
4185 status = cli->dispatch(cli,
4186 mem_ctx,
4187 &ndr_table_spoolss,
4188 NDR_SPOOLSS_ENDDOCPRINTER,
4189 &r);
4191 if (!NT_STATUS_IS_OK(status)) {
4192 return status;
4195 if (DEBUGLEVEL >= 10) {
4196 NDR_PRINT_OUT_DEBUG(spoolss_EndDocPrinter, &r);
4199 if (NT_STATUS_IS_ERR(status)) {
4200 return status;
4203 /* Return variables */
4205 /* Return result */
4206 if (werror) {
4207 *werror = r.out.result;
4210 return werror_to_ntstatus(r.out.result);
4213 struct rpccli_spoolss_AddJob_state {
4214 struct spoolss_AddJob orig;
4215 struct spoolss_AddJob tmp;
4216 TALLOC_CTX *out_mem_ctx;
4217 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4220 static void rpccli_spoolss_AddJob_done(struct tevent_req *subreq);
4222 struct tevent_req *rpccli_spoolss_AddJob_send(TALLOC_CTX *mem_ctx,
4223 struct tevent_context *ev,
4224 struct rpc_pipe_client *cli,
4225 struct policy_handle *_handle /* [in] [ref] */,
4226 uint32_t _level /* [in] */,
4227 uint8_t *_buffer /* [in,out] [unique,size_is(offered)] */,
4228 uint32_t _offered /* [in] */,
4229 uint32_t *_needed /* [out] [ref] */)
4231 struct tevent_req *req;
4232 struct rpccli_spoolss_AddJob_state *state;
4233 struct tevent_req *subreq;
4235 req = tevent_req_create(mem_ctx, &state,
4236 struct rpccli_spoolss_AddJob_state);
4237 if (req == NULL) {
4238 return NULL;
4240 state->out_mem_ctx = NULL;
4241 state->dispatch_recv = cli->dispatch_recv;
4243 /* In parameters */
4244 state->orig.in.handle = _handle;
4245 state->orig.in.level = _level;
4246 state->orig.in.buffer = _buffer;
4247 state->orig.in.offered = _offered;
4249 /* Out parameters */
4250 state->orig.out.buffer = _buffer;
4251 state->orig.out.needed = _needed;
4253 /* Result */
4254 ZERO_STRUCT(state->orig.out.result);
4256 if (DEBUGLEVEL >= 10) {
4257 NDR_PRINT_IN_DEBUG(spoolss_AddJob, &state->orig);
4260 state->out_mem_ctx = talloc_named_const(state, 0,
4261 "rpccli_spoolss_AddJob_out_memory");
4262 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4263 return tevent_req_post(req, ev);
4266 /* make a temporary copy, that we pass to the dispatch function */
4267 state->tmp = state->orig;
4269 subreq = cli->dispatch_send(state, ev, cli,
4270 &ndr_table_spoolss,
4271 NDR_SPOOLSS_ADDJOB,
4272 &state->tmp);
4273 if (tevent_req_nomem(subreq, req)) {
4274 return tevent_req_post(req, ev);
4276 tevent_req_set_callback(subreq, rpccli_spoolss_AddJob_done, req);
4277 return req;
4280 static void rpccli_spoolss_AddJob_done(struct tevent_req *subreq)
4282 struct tevent_req *req = tevent_req_callback_data(
4283 subreq, struct tevent_req);
4284 struct rpccli_spoolss_AddJob_state *state = tevent_req_data(
4285 req, struct rpccli_spoolss_AddJob_state);
4286 NTSTATUS status;
4287 TALLOC_CTX *mem_ctx;
4289 if (state->out_mem_ctx) {
4290 mem_ctx = state->out_mem_ctx;
4291 } else {
4292 mem_ctx = state;
4295 status = state->dispatch_recv(subreq, mem_ctx);
4296 TALLOC_FREE(subreq);
4297 if (!NT_STATUS_IS_OK(status)) {
4298 tevent_req_nterror(req, status);
4299 return;
4302 /* Copy out parameters */
4303 if (state->orig.out.buffer && state->tmp.out.buffer) {
4304 memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
4306 *state->orig.out.needed = *state->tmp.out.needed;
4308 /* Copy result */
4309 state->orig.out.result = state->tmp.out.result;
4311 /* Reset temporary structure */
4312 ZERO_STRUCT(state->tmp);
4314 if (DEBUGLEVEL >= 10) {
4315 NDR_PRINT_OUT_DEBUG(spoolss_AddJob, &state->orig);
4318 tevent_req_done(req);
4321 NTSTATUS rpccli_spoolss_AddJob_recv(struct tevent_req *req,
4322 TALLOC_CTX *mem_ctx,
4323 WERROR *result)
4325 struct rpccli_spoolss_AddJob_state *state = tevent_req_data(
4326 req, struct rpccli_spoolss_AddJob_state);
4327 NTSTATUS status;
4329 if (tevent_req_is_nterror(req, &status)) {
4330 tevent_req_received(req);
4331 return status;
4334 /* Steal possbile out parameters to the callers context */
4335 talloc_steal(mem_ctx, state->out_mem_ctx);
4337 /* Return result */
4338 *result = state->orig.out.result;
4340 tevent_req_received(req);
4341 return NT_STATUS_OK;
4344 NTSTATUS rpccli_spoolss_AddJob(struct rpc_pipe_client *cli,
4345 TALLOC_CTX *mem_ctx,
4346 struct policy_handle *handle /* [in] [ref] */,
4347 uint32_t level /* [in] */,
4348 uint8_t *buffer /* [in,out] [unique,size_is(offered)] */,
4349 uint32_t offered /* [in] */,
4350 uint32_t *needed /* [out] [ref] */,
4351 WERROR *werror)
4353 struct spoolss_AddJob r;
4354 NTSTATUS status;
4356 /* In parameters */
4357 r.in.handle = handle;
4358 r.in.level = level;
4359 r.in.buffer = buffer;
4360 r.in.offered = offered;
4362 if (DEBUGLEVEL >= 10) {
4363 NDR_PRINT_IN_DEBUG(spoolss_AddJob, &r);
4366 status = cli->dispatch(cli,
4367 mem_ctx,
4368 &ndr_table_spoolss,
4369 NDR_SPOOLSS_ADDJOB,
4370 &r);
4372 if (!NT_STATUS_IS_OK(status)) {
4373 return status;
4376 if (DEBUGLEVEL >= 10) {
4377 NDR_PRINT_OUT_DEBUG(spoolss_AddJob, &r);
4380 if (NT_STATUS_IS_ERR(status)) {
4381 return status;
4384 /* Return variables */
4385 if (buffer && r.out.buffer) {
4386 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
4388 *needed = *r.out.needed;
4390 /* Return result */
4391 if (werror) {
4392 *werror = r.out.result;
4395 return werror_to_ntstatus(r.out.result);
4398 struct rpccli_spoolss_ScheduleJob_state {
4399 struct spoolss_ScheduleJob orig;
4400 struct spoolss_ScheduleJob tmp;
4401 TALLOC_CTX *out_mem_ctx;
4402 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4405 static void rpccli_spoolss_ScheduleJob_done(struct tevent_req *subreq);
4407 struct tevent_req *rpccli_spoolss_ScheduleJob_send(TALLOC_CTX *mem_ctx,
4408 struct tevent_context *ev,
4409 struct rpc_pipe_client *cli,
4410 struct policy_handle *_handle /* [in] [ref] */,
4411 uint32_t _jobid /* [in] */)
4413 struct tevent_req *req;
4414 struct rpccli_spoolss_ScheduleJob_state *state;
4415 struct tevent_req *subreq;
4417 req = tevent_req_create(mem_ctx, &state,
4418 struct rpccli_spoolss_ScheduleJob_state);
4419 if (req == NULL) {
4420 return NULL;
4422 state->out_mem_ctx = NULL;
4423 state->dispatch_recv = cli->dispatch_recv;
4425 /* In parameters */
4426 state->orig.in.handle = _handle;
4427 state->orig.in.jobid = _jobid;
4429 /* Out parameters */
4431 /* Result */
4432 ZERO_STRUCT(state->orig.out.result);
4434 if (DEBUGLEVEL >= 10) {
4435 NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, &state->orig);
4438 /* make a temporary copy, that we pass to the dispatch function */
4439 state->tmp = state->orig;
4441 subreq = cli->dispatch_send(state, ev, cli,
4442 &ndr_table_spoolss,
4443 NDR_SPOOLSS_SCHEDULEJOB,
4444 &state->tmp);
4445 if (tevent_req_nomem(subreq, req)) {
4446 return tevent_req_post(req, ev);
4448 tevent_req_set_callback(subreq, rpccli_spoolss_ScheduleJob_done, req);
4449 return req;
4452 static void rpccli_spoolss_ScheduleJob_done(struct tevent_req *subreq)
4454 struct tevent_req *req = tevent_req_callback_data(
4455 subreq, struct tevent_req);
4456 struct rpccli_spoolss_ScheduleJob_state *state = tevent_req_data(
4457 req, struct rpccli_spoolss_ScheduleJob_state);
4458 NTSTATUS status;
4459 TALLOC_CTX *mem_ctx;
4461 if (state->out_mem_ctx) {
4462 mem_ctx = state->out_mem_ctx;
4463 } else {
4464 mem_ctx = state;
4467 status = state->dispatch_recv(subreq, mem_ctx);
4468 TALLOC_FREE(subreq);
4469 if (!NT_STATUS_IS_OK(status)) {
4470 tevent_req_nterror(req, status);
4471 return;
4474 /* Copy out parameters */
4476 /* Copy result */
4477 state->orig.out.result = state->tmp.out.result;
4479 /* Reset temporary structure */
4480 ZERO_STRUCT(state->tmp);
4482 if (DEBUGLEVEL >= 10) {
4483 NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, &state->orig);
4486 tevent_req_done(req);
4489 NTSTATUS rpccli_spoolss_ScheduleJob_recv(struct tevent_req *req,
4490 TALLOC_CTX *mem_ctx,
4491 WERROR *result)
4493 struct rpccli_spoolss_ScheduleJob_state *state = tevent_req_data(
4494 req, struct rpccli_spoolss_ScheduleJob_state);
4495 NTSTATUS status;
4497 if (tevent_req_is_nterror(req, &status)) {
4498 tevent_req_received(req);
4499 return status;
4502 /* Steal possbile out parameters to the callers context */
4503 talloc_steal(mem_ctx, state->out_mem_ctx);
4505 /* Return result */
4506 *result = state->orig.out.result;
4508 tevent_req_received(req);
4509 return NT_STATUS_OK;
4512 NTSTATUS rpccli_spoolss_ScheduleJob(struct rpc_pipe_client *cli,
4513 TALLOC_CTX *mem_ctx,
4514 struct policy_handle *handle /* [in] [ref] */,
4515 uint32_t jobid /* [in] */,
4516 WERROR *werror)
4518 struct spoolss_ScheduleJob r;
4519 NTSTATUS status;
4521 /* In parameters */
4522 r.in.handle = handle;
4523 r.in.jobid = jobid;
4525 if (DEBUGLEVEL >= 10) {
4526 NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, &r);
4529 status = cli->dispatch(cli,
4530 mem_ctx,
4531 &ndr_table_spoolss,
4532 NDR_SPOOLSS_SCHEDULEJOB,
4533 &r);
4535 if (!NT_STATUS_IS_OK(status)) {
4536 return status;
4539 if (DEBUGLEVEL >= 10) {
4540 NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, &r);
4543 if (NT_STATUS_IS_ERR(status)) {
4544 return status;
4547 /* Return variables */
4549 /* Return result */
4550 if (werror) {
4551 *werror = r.out.result;
4554 return werror_to_ntstatus(r.out.result);
4557 struct rpccli_spoolss_GetPrinterData_state {
4558 struct spoolss_GetPrinterData orig;
4559 struct spoolss_GetPrinterData tmp;
4560 TALLOC_CTX *out_mem_ctx;
4561 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4564 static void rpccli_spoolss_GetPrinterData_done(struct tevent_req *subreq);
4566 struct tevent_req *rpccli_spoolss_GetPrinterData_send(TALLOC_CTX *mem_ctx,
4567 struct tevent_context *ev,
4568 struct rpc_pipe_client *cli,
4569 struct policy_handle *_handle /* [in] [ref] */,
4570 const char *_value_name /* [in] [charset(UTF16)] */,
4571 uint32_t _offered /* [in] */,
4572 enum winreg_Type *_type /* [out] [ref] */,
4573 union spoolss_PrinterData *_data /* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
4574 uint32_t *_needed /* [out] [ref] */)
4576 struct tevent_req *req;
4577 struct rpccli_spoolss_GetPrinterData_state *state;
4578 struct tevent_req *subreq;
4580 req = tevent_req_create(mem_ctx, &state,
4581 struct rpccli_spoolss_GetPrinterData_state);
4582 if (req == NULL) {
4583 return NULL;
4585 state->out_mem_ctx = NULL;
4586 state->dispatch_recv = cli->dispatch_recv;
4588 /* In parameters */
4589 state->orig.in.handle = _handle;
4590 state->orig.in.value_name = _value_name;
4591 state->orig.in.offered = _offered;
4593 /* Out parameters */
4594 state->orig.out.type = _type;
4595 state->orig.out.data = _data;
4596 state->orig.out.needed = _needed;
4598 /* Result */
4599 ZERO_STRUCT(state->orig.out.result);
4601 if (DEBUGLEVEL >= 10) {
4602 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterData, &state->orig);
4605 state->out_mem_ctx = talloc_named_const(state, 0,
4606 "rpccli_spoolss_GetPrinterData_out_memory");
4607 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4608 return tevent_req_post(req, ev);
4611 /* make a temporary copy, that we pass to the dispatch function */
4612 state->tmp = state->orig;
4614 subreq = cli->dispatch_send(state, ev, cli,
4615 &ndr_table_spoolss,
4616 NDR_SPOOLSS_GETPRINTERDATA,
4617 &state->tmp);
4618 if (tevent_req_nomem(subreq, req)) {
4619 return tevent_req_post(req, ev);
4621 tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterData_done, req);
4622 return req;
4625 static void rpccli_spoolss_GetPrinterData_done(struct tevent_req *subreq)
4627 struct tevent_req *req = tevent_req_callback_data(
4628 subreq, struct tevent_req);
4629 struct rpccli_spoolss_GetPrinterData_state *state = tevent_req_data(
4630 req, struct rpccli_spoolss_GetPrinterData_state);
4631 NTSTATUS status;
4632 TALLOC_CTX *mem_ctx;
4634 if (state->out_mem_ctx) {
4635 mem_ctx = state->out_mem_ctx;
4636 } else {
4637 mem_ctx = state;
4640 status = state->dispatch_recv(subreq, mem_ctx);
4641 TALLOC_FREE(subreq);
4642 if (!NT_STATUS_IS_OK(status)) {
4643 tevent_req_nterror(req, status);
4644 return;
4647 /* Copy out parameters */
4648 *state->orig.out.type = *state->tmp.out.type;
4649 *state->orig.out.data = *state->tmp.out.data;
4650 *state->orig.out.needed = *state->tmp.out.needed;
4652 /* Copy result */
4653 state->orig.out.result = state->tmp.out.result;
4655 /* Reset temporary structure */
4656 ZERO_STRUCT(state->tmp);
4658 if (DEBUGLEVEL >= 10) {
4659 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterData, &state->orig);
4662 tevent_req_done(req);
4665 NTSTATUS rpccli_spoolss_GetPrinterData_recv(struct tevent_req *req,
4666 TALLOC_CTX *mem_ctx,
4667 WERROR *result)
4669 struct rpccli_spoolss_GetPrinterData_state *state = tevent_req_data(
4670 req, struct rpccli_spoolss_GetPrinterData_state);
4671 NTSTATUS status;
4673 if (tevent_req_is_nterror(req, &status)) {
4674 tevent_req_received(req);
4675 return status;
4678 /* Steal possbile out parameters to the callers context */
4679 talloc_steal(mem_ctx, state->out_mem_ctx);
4681 /* Return result */
4682 *result = state->orig.out.result;
4684 tevent_req_received(req);
4685 return NT_STATUS_OK;
4688 NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
4689 TALLOC_CTX *mem_ctx,
4690 struct policy_handle *handle /* [in] [ref] */,
4691 const char *value_name /* [in] [charset(UTF16)] */,
4692 uint32_t offered /* [in] */,
4693 enum winreg_Type *type /* [out] [ref] */,
4694 union spoolss_PrinterData *data /* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
4695 uint32_t *needed /* [out] [ref] */,
4696 WERROR *werror)
4698 struct spoolss_GetPrinterData r;
4699 NTSTATUS status;
4701 /* In parameters */
4702 r.in.handle = handle;
4703 r.in.value_name = value_name;
4704 r.in.offered = offered;
4706 if (DEBUGLEVEL >= 10) {
4707 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterData, &r);
4710 status = cli->dispatch(cli,
4711 mem_ctx,
4712 &ndr_table_spoolss,
4713 NDR_SPOOLSS_GETPRINTERDATA,
4714 &r);
4716 if (!NT_STATUS_IS_OK(status)) {
4717 return status;
4720 if (DEBUGLEVEL >= 10) {
4721 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterData, &r);
4724 if (NT_STATUS_IS_ERR(status)) {
4725 return status;
4728 /* Return variables */
4729 *type = *r.out.type;
4730 *data = *r.out.data;
4731 *needed = *r.out.needed;
4733 /* Return result */
4734 if (werror) {
4735 *werror = r.out.result;
4738 return werror_to_ntstatus(r.out.result);
4741 struct rpccli_spoolss_SetPrinterData_state {
4742 struct spoolss_SetPrinterData orig;
4743 struct spoolss_SetPrinterData tmp;
4744 TALLOC_CTX *out_mem_ctx;
4745 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4748 static void rpccli_spoolss_SetPrinterData_done(struct tevent_req *subreq);
4750 struct tevent_req *rpccli_spoolss_SetPrinterData_send(TALLOC_CTX *mem_ctx,
4751 struct tevent_context *ev,
4752 struct rpc_pipe_client *cli,
4753 struct policy_handle *_handle /* [in] [ref] */,
4754 const char *_value_name /* [in] [charset(UTF16)] */,
4755 enum winreg_Type _type /* [in] */,
4756 union spoolss_PrinterData _data /* [in] [subcontext(4),switch_is(type)] */,
4757 uint32_t __offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */)
4759 struct tevent_req *req;
4760 struct rpccli_spoolss_SetPrinterData_state *state;
4761 struct tevent_req *subreq;
4763 req = tevent_req_create(mem_ctx, &state,
4764 struct rpccli_spoolss_SetPrinterData_state);
4765 if (req == NULL) {
4766 return NULL;
4768 state->out_mem_ctx = NULL;
4769 state->dispatch_recv = cli->dispatch_recv;
4771 /* In parameters */
4772 state->orig.in.handle = _handle;
4773 state->orig.in.value_name = _value_name;
4774 state->orig.in.type = _type;
4775 state->orig.in.data = _data;
4776 state->orig.in._offered = __offered;
4778 /* Out parameters */
4780 /* Result */
4781 ZERO_STRUCT(state->orig.out.result);
4783 if (DEBUGLEVEL >= 10) {
4784 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, &state->orig);
4787 /* make a temporary copy, that we pass to the dispatch function */
4788 state->tmp = state->orig;
4790 subreq = cli->dispatch_send(state, ev, cli,
4791 &ndr_table_spoolss,
4792 NDR_SPOOLSS_SETPRINTERDATA,
4793 &state->tmp);
4794 if (tevent_req_nomem(subreq, req)) {
4795 return tevent_req_post(req, ev);
4797 tevent_req_set_callback(subreq, rpccli_spoolss_SetPrinterData_done, req);
4798 return req;
4801 static void rpccli_spoolss_SetPrinterData_done(struct tevent_req *subreq)
4803 struct tevent_req *req = tevent_req_callback_data(
4804 subreq, struct tevent_req);
4805 struct rpccli_spoolss_SetPrinterData_state *state = tevent_req_data(
4806 req, struct rpccli_spoolss_SetPrinterData_state);
4807 NTSTATUS status;
4808 TALLOC_CTX *mem_ctx;
4810 if (state->out_mem_ctx) {
4811 mem_ctx = state->out_mem_ctx;
4812 } else {
4813 mem_ctx = state;
4816 status = state->dispatch_recv(subreq, mem_ctx);
4817 TALLOC_FREE(subreq);
4818 if (!NT_STATUS_IS_OK(status)) {
4819 tevent_req_nterror(req, status);
4820 return;
4823 /* Copy out parameters */
4825 /* Copy result */
4826 state->orig.out.result = state->tmp.out.result;
4828 /* Reset temporary structure */
4829 ZERO_STRUCT(state->tmp);
4831 if (DEBUGLEVEL >= 10) {
4832 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterData, &state->orig);
4835 tevent_req_done(req);
4838 NTSTATUS rpccli_spoolss_SetPrinterData_recv(struct tevent_req *req,
4839 TALLOC_CTX *mem_ctx,
4840 WERROR *result)
4842 struct rpccli_spoolss_SetPrinterData_state *state = tevent_req_data(
4843 req, struct rpccli_spoolss_SetPrinterData_state);
4844 NTSTATUS status;
4846 if (tevent_req_is_nterror(req, &status)) {
4847 tevent_req_received(req);
4848 return status;
4851 /* Steal possbile out parameters to the callers context */
4852 talloc_steal(mem_ctx, state->out_mem_ctx);
4854 /* Return result */
4855 *result = state->orig.out.result;
4857 tevent_req_received(req);
4858 return NT_STATUS_OK;
4861 NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli,
4862 TALLOC_CTX *mem_ctx,
4863 struct policy_handle *handle /* [in] [ref] */,
4864 const char *value_name /* [in] [charset(UTF16)] */,
4865 enum winreg_Type type /* [in] */,
4866 union spoolss_PrinterData data /* [in] [subcontext(4),switch_is(type)] */,
4867 uint32_t _offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */,
4868 WERROR *werror)
4870 struct spoolss_SetPrinterData r;
4871 NTSTATUS status;
4873 /* In parameters */
4874 r.in.handle = handle;
4875 r.in.value_name = value_name;
4876 r.in.type = type;
4877 r.in.data = data;
4878 r.in._offered = _offered;
4880 if (DEBUGLEVEL >= 10) {
4881 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, &r);
4884 status = cli->dispatch(cli,
4885 mem_ctx,
4886 &ndr_table_spoolss,
4887 NDR_SPOOLSS_SETPRINTERDATA,
4888 &r);
4890 if (!NT_STATUS_IS_OK(status)) {
4891 return status;
4894 if (DEBUGLEVEL >= 10) {
4895 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterData, &r);
4898 if (NT_STATUS_IS_ERR(status)) {
4899 return status;
4902 /* Return variables */
4904 /* Return result */
4905 if (werror) {
4906 *werror = r.out.result;
4909 return werror_to_ntstatus(r.out.result);
4912 struct rpccli_spoolss_WaitForPrinterChange_state {
4913 struct spoolss_WaitForPrinterChange orig;
4914 struct spoolss_WaitForPrinterChange tmp;
4915 TALLOC_CTX *out_mem_ctx;
4916 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4919 static void rpccli_spoolss_WaitForPrinterChange_done(struct tevent_req *subreq);
4921 struct tevent_req *rpccli_spoolss_WaitForPrinterChange_send(TALLOC_CTX *mem_ctx,
4922 struct tevent_context *ev,
4923 struct rpc_pipe_client *cli)
4925 struct tevent_req *req;
4926 struct rpccli_spoolss_WaitForPrinterChange_state *state;
4927 struct tevent_req *subreq;
4929 req = tevent_req_create(mem_ctx, &state,
4930 struct rpccli_spoolss_WaitForPrinterChange_state);
4931 if (req == NULL) {
4932 return NULL;
4934 state->out_mem_ctx = NULL;
4935 state->dispatch_recv = cli->dispatch_recv;
4937 /* In parameters */
4939 /* Out parameters */
4941 /* Result */
4942 ZERO_STRUCT(state->orig.out.result);
4944 if (DEBUGLEVEL >= 10) {
4945 NDR_PRINT_IN_DEBUG(spoolss_WaitForPrinterChange, &state->orig);
4948 /* make a temporary copy, that we pass to the dispatch function */
4949 state->tmp = state->orig;
4951 subreq = cli->dispatch_send(state, ev, cli,
4952 &ndr_table_spoolss,
4953 NDR_SPOOLSS_WAITFORPRINTERCHANGE,
4954 &state->tmp);
4955 if (tevent_req_nomem(subreq, req)) {
4956 return tevent_req_post(req, ev);
4958 tevent_req_set_callback(subreq, rpccli_spoolss_WaitForPrinterChange_done, req);
4959 return req;
4962 static void rpccli_spoolss_WaitForPrinterChange_done(struct tevent_req *subreq)
4964 struct tevent_req *req = tevent_req_callback_data(
4965 subreq, struct tevent_req);
4966 struct rpccli_spoolss_WaitForPrinterChange_state *state = tevent_req_data(
4967 req, struct rpccli_spoolss_WaitForPrinterChange_state);
4968 NTSTATUS status;
4969 TALLOC_CTX *mem_ctx;
4971 if (state->out_mem_ctx) {
4972 mem_ctx = state->out_mem_ctx;
4973 } else {
4974 mem_ctx = state;
4977 status = state->dispatch_recv(subreq, mem_ctx);
4978 TALLOC_FREE(subreq);
4979 if (!NT_STATUS_IS_OK(status)) {
4980 tevent_req_nterror(req, status);
4981 return;
4984 /* Copy out parameters */
4986 /* Copy result */
4987 state->orig.out.result = state->tmp.out.result;
4989 /* Reset temporary structure */
4990 ZERO_STRUCT(state->tmp);
4992 if (DEBUGLEVEL >= 10) {
4993 NDR_PRINT_OUT_DEBUG(spoolss_WaitForPrinterChange, &state->orig);
4996 tevent_req_done(req);
4999 NTSTATUS rpccli_spoolss_WaitForPrinterChange_recv(struct tevent_req *req,
5000 TALLOC_CTX *mem_ctx,
5001 WERROR *result)
5003 struct rpccli_spoolss_WaitForPrinterChange_state *state = tevent_req_data(
5004 req, struct rpccli_spoolss_WaitForPrinterChange_state);
5005 NTSTATUS status;
5007 if (tevent_req_is_nterror(req, &status)) {
5008 tevent_req_received(req);
5009 return status;
5012 /* Steal possbile out parameters to the callers context */
5013 talloc_steal(mem_ctx, state->out_mem_ctx);
5015 /* Return result */
5016 *result = state->orig.out.result;
5018 tevent_req_received(req);
5019 return NT_STATUS_OK;
5022 NTSTATUS rpccli_spoolss_WaitForPrinterChange(struct rpc_pipe_client *cli,
5023 TALLOC_CTX *mem_ctx,
5024 WERROR *werror)
5026 struct spoolss_WaitForPrinterChange r;
5027 NTSTATUS status;
5029 /* In parameters */
5031 if (DEBUGLEVEL >= 10) {
5032 NDR_PRINT_IN_DEBUG(spoolss_WaitForPrinterChange, &r);
5035 status = cli->dispatch(cli,
5036 mem_ctx,
5037 &ndr_table_spoolss,
5038 NDR_SPOOLSS_WAITFORPRINTERCHANGE,
5039 &r);
5041 if (!NT_STATUS_IS_OK(status)) {
5042 return status;
5045 if (DEBUGLEVEL >= 10) {
5046 NDR_PRINT_OUT_DEBUG(spoolss_WaitForPrinterChange, &r);
5049 if (NT_STATUS_IS_ERR(status)) {
5050 return status;
5053 /* Return variables */
5055 /* Return result */
5056 if (werror) {
5057 *werror = r.out.result;
5060 return werror_to_ntstatus(r.out.result);
5063 struct rpccli_spoolss_ClosePrinter_state {
5064 struct spoolss_ClosePrinter orig;
5065 struct spoolss_ClosePrinter tmp;
5066 TALLOC_CTX *out_mem_ctx;
5067 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5070 static void rpccli_spoolss_ClosePrinter_done(struct tevent_req *subreq);
5072 struct tevent_req *rpccli_spoolss_ClosePrinter_send(TALLOC_CTX *mem_ctx,
5073 struct tevent_context *ev,
5074 struct rpc_pipe_client *cli,
5075 struct policy_handle *_handle /* [in,out] [ref] */)
5077 struct tevent_req *req;
5078 struct rpccli_spoolss_ClosePrinter_state *state;
5079 struct tevent_req *subreq;
5081 req = tevent_req_create(mem_ctx, &state,
5082 struct rpccli_spoolss_ClosePrinter_state);
5083 if (req == NULL) {
5084 return NULL;
5086 state->out_mem_ctx = NULL;
5087 state->dispatch_recv = cli->dispatch_recv;
5089 /* In parameters */
5090 state->orig.in.handle = _handle;
5092 /* Out parameters */
5093 state->orig.out.handle = _handle;
5095 /* Result */
5096 ZERO_STRUCT(state->orig.out.result);
5098 if (DEBUGLEVEL >= 10) {
5099 NDR_PRINT_IN_DEBUG(spoolss_ClosePrinter, &state->orig);
5102 state->out_mem_ctx = talloc_named_const(state, 0,
5103 "rpccli_spoolss_ClosePrinter_out_memory");
5104 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5105 return tevent_req_post(req, ev);
5108 /* make a temporary copy, that we pass to the dispatch function */
5109 state->tmp = state->orig;
5111 subreq = cli->dispatch_send(state, ev, cli,
5112 &ndr_table_spoolss,
5113 NDR_SPOOLSS_CLOSEPRINTER,
5114 &state->tmp);
5115 if (tevent_req_nomem(subreq, req)) {
5116 return tevent_req_post(req, ev);
5118 tevent_req_set_callback(subreq, rpccli_spoolss_ClosePrinter_done, req);
5119 return req;
5122 static void rpccli_spoolss_ClosePrinter_done(struct tevent_req *subreq)
5124 struct tevent_req *req = tevent_req_callback_data(
5125 subreq, struct tevent_req);
5126 struct rpccli_spoolss_ClosePrinter_state *state = tevent_req_data(
5127 req, struct rpccli_spoolss_ClosePrinter_state);
5128 NTSTATUS status;
5129 TALLOC_CTX *mem_ctx;
5131 if (state->out_mem_ctx) {
5132 mem_ctx = state->out_mem_ctx;
5133 } else {
5134 mem_ctx = state;
5137 status = state->dispatch_recv(subreq, mem_ctx);
5138 TALLOC_FREE(subreq);
5139 if (!NT_STATUS_IS_OK(status)) {
5140 tevent_req_nterror(req, status);
5141 return;
5144 /* Copy out parameters */
5145 *state->orig.out.handle = *state->tmp.out.handle;
5147 /* Copy result */
5148 state->orig.out.result = state->tmp.out.result;
5150 /* Reset temporary structure */
5151 ZERO_STRUCT(state->tmp);
5153 if (DEBUGLEVEL >= 10) {
5154 NDR_PRINT_OUT_DEBUG(spoolss_ClosePrinter, &state->orig);
5157 tevent_req_done(req);
5160 NTSTATUS rpccli_spoolss_ClosePrinter_recv(struct tevent_req *req,
5161 TALLOC_CTX *mem_ctx,
5162 WERROR *result)
5164 struct rpccli_spoolss_ClosePrinter_state *state = tevent_req_data(
5165 req, struct rpccli_spoolss_ClosePrinter_state);
5166 NTSTATUS status;
5168 if (tevent_req_is_nterror(req, &status)) {
5169 tevent_req_received(req);
5170 return status;
5173 /* Steal possbile out parameters to the callers context */
5174 talloc_steal(mem_ctx, state->out_mem_ctx);
5176 /* Return result */
5177 *result = state->orig.out.result;
5179 tevent_req_received(req);
5180 return NT_STATUS_OK;
5183 NTSTATUS rpccli_spoolss_ClosePrinter(struct rpc_pipe_client *cli,
5184 TALLOC_CTX *mem_ctx,
5185 struct policy_handle *handle /* [in,out] [ref] */,
5186 WERROR *werror)
5188 struct spoolss_ClosePrinter r;
5189 NTSTATUS status;
5191 /* In parameters */
5192 r.in.handle = handle;
5194 if (DEBUGLEVEL >= 10) {
5195 NDR_PRINT_IN_DEBUG(spoolss_ClosePrinter, &r);
5198 status = cli->dispatch(cli,
5199 mem_ctx,
5200 &ndr_table_spoolss,
5201 NDR_SPOOLSS_CLOSEPRINTER,
5202 &r);
5204 if (!NT_STATUS_IS_OK(status)) {
5205 return status;
5208 if (DEBUGLEVEL >= 10) {
5209 NDR_PRINT_OUT_DEBUG(spoolss_ClosePrinter, &r);
5212 if (NT_STATUS_IS_ERR(status)) {
5213 return status;
5216 /* Return variables */
5217 *handle = *r.out.handle;
5219 /* Return result */
5220 if (werror) {
5221 *werror = r.out.result;
5224 return werror_to_ntstatus(r.out.result);
5227 struct rpccli_spoolss_AddForm_state {
5228 struct spoolss_AddForm orig;
5229 struct spoolss_AddForm tmp;
5230 TALLOC_CTX *out_mem_ctx;
5231 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5234 static void rpccli_spoolss_AddForm_done(struct tevent_req *subreq);
5236 struct tevent_req *rpccli_spoolss_AddForm_send(TALLOC_CTX *mem_ctx,
5237 struct tevent_context *ev,
5238 struct rpc_pipe_client *cli,
5239 struct policy_handle *_handle /* [in] [ref] */,
5240 uint32_t _level /* [in] */,
5241 union spoolss_AddFormInfo _info /* [in] [switch_is(level)] */)
5243 struct tevent_req *req;
5244 struct rpccli_spoolss_AddForm_state *state;
5245 struct tevent_req *subreq;
5247 req = tevent_req_create(mem_ctx, &state,
5248 struct rpccli_spoolss_AddForm_state);
5249 if (req == NULL) {
5250 return NULL;
5252 state->out_mem_ctx = NULL;
5253 state->dispatch_recv = cli->dispatch_recv;
5255 /* In parameters */
5256 state->orig.in.handle = _handle;
5257 state->orig.in.level = _level;
5258 state->orig.in.info = _info;
5260 /* Out parameters */
5262 /* Result */
5263 ZERO_STRUCT(state->orig.out.result);
5265 if (DEBUGLEVEL >= 10) {
5266 NDR_PRINT_IN_DEBUG(spoolss_AddForm, &state->orig);
5269 /* make a temporary copy, that we pass to the dispatch function */
5270 state->tmp = state->orig;
5272 subreq = cli->dispatch_send(state, ev, cli,
5273 &ndr_table_spoolss,
5274 NDR_SPOOLSS_ADDFORM,
5275 &state->tmp);
5276 if (tevent_req_nomem(subreq, req)) {
5277 return tevent_req_post(req, ev);
5279 tevent_req_set_callback(subreq, rpccli_spoolss_AddForm_done, req);
5280 return req;
5283 static void rpccli_spoolss_AddForm_done(struct tevent_req *subreq)
5285 struct tevent_req *req = tevent_req_callback_data(
5286 subreq, struct tevent_req);
5287 struct rpccli_spoolss_AddForm_state *state = tevent_req_data(
5288 req, struct rpccli_spoolss_AddForm_state);
5289 NTSTATUS status;
5290 TALLOC_CTX *mem_ctx;
5292 if (state->out_mem_ctx) {
5293 mem_ctx = state->out_mem_ctx;
5294 } else {
5295 mem_ctx = state;
5298 status = state->dispatch_recv(subreq, mem_ctx);
5299 TALLOC_FREE(subreq);
5300 if (!NT_STATUS_IS_OK(status)) {
5301 tevent_req_nterror(req, status);
5302 return;
5305 /* Copy out parameters */
5307 /* Copy result */
5308 state->orig.out.result = state->tmp.out.result;
5310 /* Reset temporary structure */
5311 ZERO_STRUCT(state->tmp);
5313 if (DEBUGLEVEL >= 10) {
5314 NDR_PRINT_OUT_DEBUG(spoolss_AddForm, &state->orig);
5317 tevent_req_done(req);
5320 NTSTATUS rpccli_spoolss_AddForm_recv(struct tevent_req *req,
5321 TALLOC_CTX *mem_ctx,
5322 WERROR *result)
5324 struct rpccli_spoolss_AddForm_state *state = tevent_req_data(
5325 req, struct rpccli_spoolss_AddForm_state);
5326 NTSTATUS status;
5328 if (tevent_req_is_nterror(req, &status)) {
5329 tevent_req_received(req);
5330 return status;
5333 /* Steal possbile out parameters to the callers context */
5334 talloc_steal(mem_ctx, state->out_mem_ctx);
5336 /* Return result */
5337 *result = state->orig.out.result;
5339 tevent_req_received(req);
5340 return NT_STATUS_OK;
5343 NTSTATUS rpccli_spoolss_AddForm(struct rpc_pipe_client *cli,
5344 TALLOC_CTX *mem_ctx,
5345 struct policy_handle *handle /* [in] [ref] */,
5346 uint32_t level /* [in] */,
5347 union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
5348 WERROR *werror)
5350 struct spoolss_AddForm r;
5351 NTSTATUS status;
5353 /* In parameters */
5354 r.in.handle = handle;
5355 r.in.level = level;
5356 r.in.info = info;
5358 if (DEBUGLEVEL >= 10) {
5359 NDR_PRINT_IN_DEBUG(spoolss_AddForm, &r);
5362 status = cli->dispatch(cli,
5363 mem_ctx,
5364 &ndr_table_spoolss,
5365 NDR_SPOOLSS_ADDFORM,
5366 &r);
5368 if (!NT_STATUS_IS_OK(status)) {
5369 return status;
5372 if (DEBUGLEVEL >= 10) {
5373 NDR_PRINT_OUT_DEBUG(spoolss_AddForm, &r);
5376 if (NT_STATUS_IS_ERR(status)) {
5377 return status;
5380 /* Return variables */
5382 /* Return result */
5383 if (werror) {
5384 *werror = r.out.result;
5387 return werror_to_ntstatus(r.out.result);
5390 struct rpccli_spoolss_DeleteForm_state {
5391 struct spoolss_DeleteForm orig;
5392 struct spoolss_DeleteForm tmp;
5393 TALLOC_CTX *out_mem_ctx;
5394 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5397 static void rpccli_spoolss_DeleteForm_done(struct tevent_req *subreq);
5399 struct tevent_req *rpccli_spoolss_DeleteForm_send(TALLOC_CTX *mem_ctx,
5400 struct tevent_context *ev,
5401 struct rpc_pipe_client *cli,
5402 struct policy_handle *_handle /* [in] [ref] */,
5403 const char *_form_name /* [in] [charset(UTF16)] */)
5405 struct tevent_req *req;
5406 struct rpccli_spoolss_DeleteForm_state *state;
5407 struct tevent_req *subreq;
5409 req = tevent_req_create(mem_ctx, &state,
5410 struct rpccli_spoolss_DeleteForm_state);
5411 if (req == NULL) {
5412 return NULL;
5414 state->out_mem_ctx = NULL;
5415 state->dispatch_recv = cli->dispatch_recv;
5417 /* In parameters */
5418 state->orig.in.handle = _handle;
5419 state->orig.in.form_name = _form_name;
5421 /* Out parameters */
5423 /* Result */
5424 ZERO_STRUCT(state->orig.out.result);
5426 if (DEBUGLEVEL >= 10) {
5427 NDR_PRINT_IN_DEBUG(spoolss_DeleteForm, &state->orig);
5430 /* make a temporary copy, that we pass to the dispatch function */
5431 state->tmp = state->orig;
5433 subreq = cli->dispatch_send(state, ev, cli,
5434 &ndr_table_spoolss,
5435 NDR_SPOOLSS_DELETEFORM,
5436 &state->tmp);
5437 if (tevent_req_nomem(subreq, req)) {
5438 return tevent_req_post(req, ev);
5440 tevent_req_set_callback(subreq, rpccli_spoolss_DeleteForm_done, req);
5441 return req;
5444 static void rpccli_spoolss_DeleteForm_done(struct tevent_req *subreq)
5446 struct tevent_req *req = tevent_req_callback_data(
5447 subreq, struct tevent_req);
5448 struct rpccli_spoolss_DeleteForm_state *state = tevent_req_data(
5449 req, struct rpccli_spoolss_DeleteForm_state);
5450 NTSTATUS status;
5451 TALLOC_CTX *mem_ctx;
5453 if (state->out_mem_ctx) {
5454 mem_ctx = state->out_mem_ctx;
5455 } else {
5456 mem_ctx = state;
5459 status = state->dispatch_recv(subreq, mem_ctx);
5460 TALLOC_FREE(subreq);
5461 if (!NT_STATUS_IS_OK(status)) {
5462 tevent_req_nterror(req, status);
5463 return;
5466 /* Copy out parameters */
5468 /* Copy result */
5469 state->orig.out.result = state->tmp.out.result;
5471 /* Reset temporary structure */
5472 ZERO_STRUCT(state->tmp);
5474 if (DEBUGLEVEL >= 10) {
5475 NDR_PRINT_OUT_DEBUG(spoolss_DeleteForm, &state->orig);
5478 tevent_req_done(req);
5481 NTSTATUS rpccli_spoolss_DeleteForm_recv(struct tevent_req *req,
5482 TALLOC_CTX *mem_ctx,
5483 WERROR *result)
5485 struct rpccli_spoolss_DeleteForm_state *state = tevent_req_data(
5486 req, struct rpccli_spoolss_DeleteForm_state);
5487 NTSTATUS status;
5489 if (tevent_req_is_nterror(req, &status)) {
5490 tevent_req_received(req);
5491 return status;
5494 /* Steal possbile out parameters to the callers context */
5495 talloc_steal(mem_ctx, state->out_mem_ctx);
5497 /* Return result */
5498 *result = state->orig.out.result;
5500 tevent_req_received(req);
5501 return NT_STATUS_OK;
5504 NTSTATUS rpccli_spoolss_DeleteForm(struct rpc_pipe_client *cli,
5505 TALLOC_CTX *mem_ctx,
5506 struct policy_handle *handle /* [in] [ref] */,
5507 const char *form_name /* [in] [charset(UTF16)] */,
5508 WERROR *werror)
5510 struct spoolss_DeleteForm r;
5511 NTSTATUS status;
5513 /* In parameters */
5514 r.in.handle = handle;
5515 r.in.form_name = form_name;
5517 if (DEBUGLEVEL >= 10) {
5518 NDR_PRINT_IN_DEBUG(spoolss_DeleteForm, &r);
5521 status = cli->dispatch(cli,
5522 mem_ctx,
5523 &ndr_table_spoolss,
5524 NDR_SPOOLSS_DELETEFORM,
5525 &r);
5527 if (!NT_STATUS_IS_OK(status)) {
5528 return status;
5531 if (DEBUGLEVEL >= 10) {
5532 NDR_PRINT_OUT_DEBUG(spoolss_DeleteForm, &r);
5535 if (NT_STATUS_IS_ERR(status)) {
5536 return status;
5539 /* Return variables */
5541 /* Return result */
5542 if (werror) {
5543 *werror = r.out.result;
5546 return werror_to_ntstatus(r.out.result);
5549 struct rpccli_spoolss_GetForm_state {
5550 struct spoolss_GetForm orig;
5551 struct spoolss_GetForm tmp;
5552 TALLOC_CTX *out_mem_ctx;
5553 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5556 static void rpccli_spoolss_GetForm_done(struct tevent_req *subreq);
5558 struct tevent_req *rpccli_spoolss_GetForm_send(TALLOC_CTX *mem_ctx,
5559 struct tevent_context *ev,
5560 struct rpc_pipe_client *cli,
5561 struct policy_handle *_handle /* [in] [ref] */,
5562 const char *_form_name /* [in] [charset(UTF16)] */,
5563 uint32_t _level /* [in] */,
5564 DATA_BLOB *_buffer /* [in] [unique] */,
5565 uint32_t _offered /* [in] */,
5566 union spoolss_FormInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
5567 uint32_t *_needed /* [out] [ref] */)
5569 struct tevent_req *req;
5570 struct rpccli_spoolss_GetForm_state *state;
5571 struct tevent_req *subreq;
5573 req = tevent_req_create(mem_ctx, &state,
5574 struct rpccli_spoolss_GetForm_state);
5575 if (req == NULL) {
5576 return NULL;
5578 state->out_mem_ctx = NULL;
5579 state->dispatch_recv = cli->dispatch_recv;
5581 /* In parameters */
5582 state->orig.in.handle = _handle;
5583 state->orig.in.form_name = _form_name;
5584 state->orig.in.level = _level;
5585 state->orig.in.buffer = _buffer;
5586 state->orig.in.offered = _offered;
5588 /* Out parameters */
5589 state->orig.out.info = _info;
5590 state->orig.out.needed = _needed;
5592 /* Result */
5593 ZERO_STRUCT(state->orig.out.result);
5595 if (DEBUGLEVEL >= 10) {
5596 NDR_PRINT_IN_DEBUG(spoolss_GetForm, &state->orig);
5599 state->out_mem_ctx = talloc_named_const(state, 0,
5600 "rpccli_spoolss_GetForm_out_memory");
5601 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5602 return tevent_req_post(req, ev);
5605 /* make a temporary copy, that we pass to the dispatch function */
5606 state->tmp = state->orig;
5608 subreq = cli->dispatch_send(state, ev, cli,
5609 &ndr_table_spoolss,
5610 NDR_SPOOLSS_GETFORM,
5611 &state->tmp);
5612 if (tevent_req_nomem(subreq, req)) {
5613 return tevent_req_post(req, ev);
5615 tevent_req_set_callback(subreq, rpccli_spoolss_GetForm_done, req);
5616 return req;
5619 static void rpccli_spoolss_GetForm_done(struct tevent_req *subreq)
5621 struct tevent_req *req = tevent_req_callback_data(
5622 subreq, struct tevent_req);
5623 struct rpccli_spoolss_GetForm_state *state = tevent_req_data(
5624 req, struct rpccli_spoolss_GetForm_state);
5625 NTSTATUS status;
5626 TALLOC_CTX *mem_ctx;
5628 if (state->out_mem_ctx) {
5629 mem_ctx = state->out_mem_ctx;
5630 } else {
5631 mem_ctx = state;
5634 status = state->dispatch_recv(subreq, mem_ctx);
5635 TALLOC_FREE(subreq);
5636 if (!NT_STATUS_IS_OK(status)) {
5637 tevent_req_nterror(req, status);
5638 return;
5641 /* Copy out parameters */
5642 if (state->orig.out.info && state->tmp.out.info) {
5643 *state->orig.out.info = *state->tmp.out.info;
5645 *state->orig.out.needed = *state->tmp.out.needed;
5647 /* Copy result */
5648 state->orig.out.result = state->tmp.out.result;
5650 /* Reset temporary structure */
5651 ZERO_STRUCT(state->tmp);
5653 if (DEBUGLEVEL >= 10) {
5654 NDR_PRINT_OUT_DEBUG(spoolss_GetForm, &state->orig);
5657 tevent_req_done(req);
5660 NTSTATUS rpccli_spoolss_GetForm_recv(struct tevent_req *req,
5661 TALLOC_CTX *mem_ctx,
5662 WERROR *result)
5664 struct rpccli_spoolss_GetForm_state *state = tevent_req_data(
5665 req, struct rpccli_spoolss_GetForm_state);
5666 NTSTATUS status;
5668 if (tevent_req_is_nterror(req, &status)) {
5669 tevent_req_received(req);
5670 return status;
5673 /* Steal possbile out parameters to the callers context */
5674 talloc_steal(mem_ctx, state->out_mem_ctx);
5676 /* Return result */
5677 *result = state->orig.out.result;
5679 tevent_req_received(req);
5680 return NT_STATUS_OK;
5683 NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
5684 TALLOC_CTX *mem_ctx,
5685 struct policy_handle *handle /* [in] [ref] */,
5686 const char *form_name /* [in] [charset(UTF16)] */,
5687 uint32_t level /* [in] */,
5688 DATA_BLOB *buffer /* [in] [unique] */,
5689 uint32_t offered /* [in] */,
5690 union spoolss_FormInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
5691 uint32_t *needed /* [out] [ref] */,
5692 WERROR *werror)
5694 struct spoolss_GetForm r;
5695 NTSTATUS status;
5697 /* In parameters */
5698 r.in.handle = handle;
5699 r.in.form_name = form_name;
5700 r.in.level = level;
5701 r.in.buffer = buffer;
5702 r.in.offered = offered;
5704 if (DEBUGLEVEL >= 10) {
5705 NDR_PRINT_IN_DEBUG(spoolss_GetForm, &r);
5708 status = cli->dispatch(cli,
5709 mem_ctx,
5710 &ndr_table_spoolss,
5711 NDR_SPOOLSS_GETFORM,
5712 &r);
5714 if (!NT_STATUS_IS_OK(status)) {
5715 return status;
5718 if (DEBUGLEVEL >= 10) {
5719 NDR_PRINT_OUT_DEBUG(spoolss_GetForm, &r);
5722 if (NT_STATUS_IS_ERR(status)) {
5723 return status;
5726 /* Return variables */
5727 if (info && r.out.info) {
5728 *info = *r.out.info;
5730 *needed = *r.out.needed;
5732 /* Return result */
5733 if (werror) {
5734 *werror = r.out.result;
5737 return werror_to_ntstatus(r.out.result);
5740 struct rpccli_spoolss_SetForm_state {
5741 struct spoolss_SetForm orig;
5742 struct spoolss_SetForm tmp;
5743 TALLOC_CTX *out_mem_ctx;
5744 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5747 static void rpccli_spoolss_SetForm_done(struct tevent_req *subreq);
5749 struct tevent_req *rpccli_spoolss_SetForm_send(TALLOC_CTX *mem_ctx,
5750 struct tevent_context *ev,
5751 struct rpc_pipe_client *cli,
5752 struct policy_handle *_handle /* [in] [ref] */,
5753 const char *_form_name /* [in] [charset(UTF16)] */,
5754 uint32_t _level /* [in] */,
5755 union spoolss_AddFormInfo _info /* [in] [switch_is(level)] */)
5757 struct tevent_req *req;
5758 struct rpccli_spoolss_SetForm_state *state;
5759 struct tevent_req *subreq;
5761 req = tevent_req_create(mem_ctx, &state,
5762 struct rpccli_spoolss_SetForm_state);
5763 if (req == NULL) {
5764 return NULL;
5766 state->out_mem_ctx = NULL;
5767 state->dispatch_recv = cli->dispatch_recv;
5769 /* In parameters */
5770 state->orig.in.handle = _handle;
5771 state->orig.in.form_name = _form_name;
5772 state->orig.in.level = _level;
5773 state->orig.in.info = _info;
5775 /* Out parameters */
5777 /* Result */
5778 ZERO_STRUCT(state->orig.out.result);
5780 if (DEBUGLEVEL >= 10) {
5781 NDR_PRINT_IN_DEBUG(spoolss_SetForm, &state->orig);
5784 /* make a temporary copy, that we pass to the dispatch function */
5785 state->tmp = state->orig;
5787 subreq = cli->dispatch_send(state, ev, cli,
5788 &ndr_table_spoolss,
5789 NDR_SPOOLSS_SETFORM,
5790 &state->tmp);
5791 if (tevent_req_nomem(subreq, req)) {
5792 return tevent_req_post(req, ev);
5794 tevent_req_set_callback(subreq, rpccli_spoolss_SetForm_done, req);
5795 return req;
5798 static void rpccli_spoolss_SetForm_done(struct tevent_req *subreq)
5800 struct tevent_req *req = tevent_req_callback_data(
5801 subreq, struct tevent_req);
5802 struct rpccli_spoolss_SetForm_state *state = tevent_req_data(
5803 req, struct rpccli_spoolss_SetForm_state);
5804 NTSTATUS status;
5805 TALLOC_CTX *mem_ctx;
5807 if (state->out_mem_ctx) {
5808 mem_ctx = state->out_mem_ctx;
5809 } else {
5810 mem_ctx = state;
5813 status = state->dispatch_recv(subreq, mem_ctx);
5814 TALLOC_FREE(subreq);
5815 if (!NT_STATUS_IS_OK(status)) {
5816 tevent_req_nterror(req, status);
5817 return;
5820 /* Copy out parameters */
5822 /* Copy result */
5823 state->orig.out.result = state->tmp.out.result;
5825 /* Reset temporary structure */
5826 ZERO_STRUCT(state->tmp);
5828 if (DEBUGLEVEL >= 10) {
5829 NDR_PRINT_OUT_DEBUG(spoolss_SetForm, &state->orig);
5832 tevent_req_done(req);
5835 NTSTATUS rpccli_spoolss_SetForm_recv(struct tevent_req *req,
5836 TALLOC_CTX *mem_ctx,
5837 WERROR *result)
5839 struct rpccli_spoolss_SetForm_state *state = tevent_req_data(
5840 req, struct rpccli_spoolss_SetForm_state);
5841 NTSTATUS status;
5843 if (tevent_req_is_nterror(req, &status)) {
5844 tevent_req_received(req);
5845 return status;
5848 /* Steal possbile out parameters to the callers context */
5849 talloc_steal(mem_ctx, state->out_mem_ctx);
5851 /* Return result */
5852 *result = state->orig.out.result;
5854 tevent_req_received(req);
5855 return NT_STATUS_OK;
5858 NTSTATUS rpccli_spoolss_SetForm(struct rpc_pipe_client *cli,
5859 TALLOC_CTX *mem_ctx,
5860 struct policy_handle *handle /* [in] [ref] */,
5861 const char *form_name /* [in] [charset(UTF16)] */,
5862 uint32_t level /* [in] */,
5863 union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
5864 WERROR *werror)
5866 struct spoolss_SetForm r;
5867 NTSTATUS status;
5869 /* In parameters */
5870 r.in.handle = handle;
5871 r.in.form_name = form_name;
5872 r.in.level = level;
5873 r.in.info = info;
5875 if (DEBUGLEVEL >= 10) {
5876 NDR_PRINT_IN_DEBUG(spoolss_SetForm, &r);
5879 status = cli->dispatch(cli,
5880 mem_ctx,
5881 &ndr_table_spoolss,
5882 NDR_SPOOLSS_SETFORM,
5883 &r);
5885 if (!NT_STATUS_IS_OK(status)) {
5886 return status;
5889 if (DEBUGLEVEL >= 10) {
5890 NDR_PRINT_OUT_DEBUG(spoolss_SetForm, &r);
5893 if (NT_STATUS_IS_ERR(status)) {
5894 return status;
5897 /* Return variables */
5899 /* Return result */
5900 if (werror) {
5901 *werror = r.out.result;
5904 return werror_to_ntstatus(r.out.result);
5907 struct rpccli_spoolss_EnumForms_state {
5908 struct spoolss_EnumForms orig;
5909 struct spoolss_EnumForms tmp;
5910 TALLOC_CTX *out_mem_ctx;
5911 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5914 static void rpccli_spoolss_EnumForms_done(struct tevent_req *subreq);
5916 struct tevent_req *rpccli_spoolss_EnumForms_send(TALLOC_CTX *mem_ctx,
5917 struct tevent_context *ev,
5918 struct rpc_pipe_client *cli,
5919 struct policy_handle *_handle /* [in] [ref] */,
5920 uint32_t _level /* [in] */,
5921 DATA_BLOB *_buffer /* [in] [unique] */,
5922 uint32_t _offered /* [in] */,
5923 uint32_t *_count /* [out] [ref] */,
5924 union spoolss_FormInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
5925 uint32_t *_needed /* [out] [ref] */)
5927 struct tevent_req *req;
5928 struct rpccli_spoolss_EnumForms_state *state;
5929 struct tevent_req *subreq;
5931 req = tevent_req_create(mem_ctx, &state,
5932 struct rpccli_spoolss_EnumForms_state);
5933 if (req == NULL) {
5934 return NULL;
5936 state->out_mem_ctx = NULL;
5937 state->dispatch_recv = cli->dispatch_recv;
5939 /* In parameters */
5940 state->orig.in.handle = _handle;
5941 state->orig.in.level = _level;
5942 state->orig.in.buffer = _buffer;
5943 state->orig.in.offered = _offered;
5945 /* Out parameters */
5946 state->orig.out.count = _count;
5947 state->orig.out.info = _info;
5948 state->orig.out.needed = _needed;
5950 /* Result */
5951 ZERO_STRUCT(state->orig.out.result);
5953 if (DEBUGLEVEL >= 10) {
5954 NDR_PRINT_IN_DEBUG(spoolss_EnumForms, &state->orig);
5957 state->out_mem_ctx = talloc_named_const(state, 0,
5958 "rpccli_spoolss_EnumForms_out_memory");
5959 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5960 return tevent_req_post(req, ev);
5963 /* make a temporary copy, that we pass to the dispatch function */
5964 state->tmp = state->orig;
5966 subreq = cli->dispatch_send(state, ev, cli,
5967 &ndr_table_spoolss,
5968 NDR_SPOOLSS_ENUMFORMS,
5969 &state->tmp);
5970 if (tevent_req_nomem(subreq, req)) {
5971 return tevent_req_post(req, ev);
5973 tevent_req_set_callback(subreq, rpccli_spoolss_EnumForms_done, req);
5974 return req;
5977 static void rpccli_spoolss_EnumForms_done(struct tevent_req *subreq)
5979 struct tevent_req *req = tevent_req_callback_data(
5980 subreq, struct tevent_req);
5981 struct rpccli_spoolss_EnumForms_state *state = tevent_req_data(
5982 req, struct rpccli_spoolss_EnumForms_state);
5983 NTSTATUS status;
5984 TALLOC_CTX *mem_ctx;
5986 if (state->out_mem_ctx) {
5987 mem_ctx = state->out_mem_ctx;
5988 } else {
5989 mem_ctx = state;
5992 status = state->dispatch_recv(subreq, mem_ctx);
5993 TALLOC_FREE(subreq);
5994 if (!NT_STATUS_IS_OK(status)) {
5995 tevent_req_nterror(req, status);
5996 return;
5999 /* Copy out parameters */
6000 *state->orig.out.count = *state->tmp.out.count;
6001 *state->orig.out.info = *state->tmp.out.info;
6002 *state->orig.out.needed = *state->tmp.out.needed;
6004 /* Copy result */
6005 state->orig.out.result = state->tmp.out.result;
6007 /* Reset temporary structure */
6008 ZERO_STRUCT(state->tmp);
6010 if (DEBUGLEVEL >= 10) {
6011 NDR_PRINT_OUT_DEBUG(spoolss_EnumForms, &state->orig);
6014 tevent_req_done(req);
6017 NTSTATUS rpccli_spoolss_EnumForms_recv(struct tevent_req *req,
6018 TALLOC_CTX *mem_ctx,
6019 WERROR *result)
6021 struct rpccli_spoolss_EnumForms_state *state = tevent_req_data(
6022 req, struct rpccli_spoolss_EnumForms_state);
6023 NTSTATUS status;
6025 if (tevent_req_is_nterror(req, &status)) {
6026 tevent_req_received(req);
6027 return status;
6030 /* Steal possbile out parameters to the callers context */
6031 talloc_steal(mem_ctx, state->out_mem_ctx);
6033 /* Return result */
6034 *result = state->orig.out.result;
6036 tevent_req_received(req);
6037 return NT_STATUS_OK;
6040 NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
6041 TALLOC_CTX *mem_ctx,
6042 struct policy_handle *handle /* [in] [ref] */,
6043 uint32_t level /* [in] */,
6044 DATA_BLOB *buffer /* [in] [unique] */,
6045 uint32_t offered /* [in] */,
6046 uint32_t *count /* [out] [ref] */,
6047 union spoolss_FormInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
6048 uint32_t *needed /* [out] [ref] */,
6049 WERROR *werror)
6051 struct spoolss_EnumForms r;
6052 NTSTATUS status;
6054 /* In parameters */
6055 r.in.handle = handle;
6056 r.in.level = level;
6057 r.in.buffer = buffer;
6058 r.in.offered = offered;
6060 if (DEBUGLEVEL >= 10) {
6061 NDR_PRINT_IN_DEBUG(spoolss_EnumForms, &r);
6064 status = cli->dispatch(cli,
6065 mem_ctx,
6066 &ndr_table_spoolss,
6067 NDR_SPOOLSS_ENUMFORMS,
6068 &r);
6070 if (!NT_STATUS_IS_OK(status)) {
6071 return status;
6074 if (DEBUGLEVEL >= 10) {
6075 NDR_PRINT_OUT_DEBUG(spoolss_EnumForms, &r);
6078 if (NT_STATUS_IS_ERR(status)) {
6079 return status;
6082 /* Return variables */
6083 *count = *r.out.count;
6084 *info = *r.out.info;
6085 *needed = *r.out.needed;
6087 /* Return result */
6088 if (werror) {
6089 *werror = r.out.result;
6092 return werror_to_ntstatus(r.out.result);
6095 struct rpccli_spoolss_EnumPorts_state {
6096 struct spoolss_EnumPorts orig;
6097 struct spoolss_EnumPorts tmp;
6098 TALLOC_CTX *out_mem_ctx;
6099 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6102 static void rpccli_spoolss_EnumPorts_done(struct tevent_req *subreq);
6104 struct tevent_req *rpccli_spoolss_EnumPorts_send(TALLOC_CTX *mem_ctx,
6105 struct tevent_context *ev,
6106 struct rpc_pipe_client *cli,
6107 const char *_servername /* [in] [unique,charset(UTF16)] */,
6108 uint32_t _level /* [in] */,
6109 DATA_BLOB *_buffer /* [in] [unique] */,
6110 uint32_t _offered /* [in] */,
6111 uint32_t *_count /* [out] [ref] */,
6112 union spoolss_PortInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
6113 uint32_t *_needed /* [out] [ref] */)
6115 struct tevent_req *req;
6116 struct rpccli_spoolss_EnumPorts_state *state;
6117 struct tevent_req *subreq;
6119 req = tevent_req_create(mem_ctx, &state,
6120 struct rpccli_spoolss_EnumPorts_state);
6121 if (req == NULL) {
6122 return NULL;
6124 state->out_mem_ctx = NULL;
6125 state->dispatch_recv = cli->dispatch_recv;
6127 /* In parameters */
6128 state->orig.in.servername = _servername;
6129 state->orig.in.level = _level;
6130 state->orig.in.buffer = _buffer;
6131 state->orig.in.offered = _offered;
6133 /* Out parameters */
6134 state->orig.out.count = _count;
6135 state->orig.out.info = _info;
6136 state->orig.out.needed = _needed;
6138 /* Result */
6139 ZERO_STRUCT(state->orig.out.result);
6141 if (DEBUGLEVEL >= 10) {
6142 NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, &state->orig);
6145 state->out_mem_ctx = talloc_named_const(state, 0,
6146 "rpccli_spoolss_EnumPorts_out_memory");
6147 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6148 return tevent_req_post(req, ev);
6151 /* make a temporary copy, that we pass to the dispatch function */
6152 state->tmp = state->orig;
6154 subreq = cli->dispatch_send(state, ev, cli,
6155 &ndr_table_spoolss,
6156 NDR_SPOOLSS_ENUMPORTS,
6157 &state->tmp);
6158 if (tevent_req_nomem(subreq, req)) {
6159 return tevent_req_post(req, ev);
6161 tevent_req_set_callback(subreq, rpccli_spoolss_EnumPorts_done, req);
6162 return req;
6165 static void rpccli_spoolss_EnumPorts_done(struct tevent_req *subreq)
6167 struct tevent_req *req = tevent_req_callback_data(
6168 subreq, struct tevent_req);
6169 struct rpccli_spoolss_EnumPorts_state *state = tevent_req_data(
6170 req, struct rpccli_spoolss_EnumPorts_state);
6171 NTSTATUS status;
6172 TALLOC_CTX *mem_ctx;
6174 if (state->out_mem_ctx) {
6175 mem_ctx = state->out_mem_ctx;
6176 } else {
6177 mem_ctx = state;
6180 status = state->dispatch_recv(subreq, mem_ctx);
6181 TALLOC_FREE(subreq);
6182 if (!NT_STATUS_IS_OK(status)) {
6183 tevent_req_nterror(req, status);
6184 return;
6187 /* Copy out parameters */
6188 *state->orig.out.count = *state->tmp.out.count;
6189 *state->orig.out.info = *state->tmp.out.info;
6190 *state->orig.out.needed = *state->tmp.out.needed;
6192 /* Copy result */
6193 state->orig.out.result = state->tmp.out.result;
6195 /* Reset temporary structure */
6196 ZERO_STRUCT(state->tmp);
6198 if (DEBUGLEVEL >= 10) {
6199 NDR_PRINT_OUT_DEBUG(spoolss_EnumPorts, &state->orig);
6202 tevent_req_done(req);
6205 NTSTATUS rpccli_spoolss_EnumPorts_recv(struct tevent_req *req,
6206 TALLOC_CTX *mem_ctx,
6207 WERROR *result)
6209 struct rpccli_spoolss_EnumPorts_state *state = tevent_req_data(
6210 req, struct rpccli_spoolss_EnumPorts_state);
6211 NTSTATUS status;
6213 if (tevent_req_is_nterror(req, &status)) {
6214 tevent_req_received(req);
6215 return status;
6218 /* Steal possbile out parameters to the callers context */
6219 talloc_steal(mem_ctx, state->out_mem_ctx);
6221 /* Return result */
6222 *result = state->orig.out.result;
6224 tevent_req_received(req);
6225 return NT_STATUS_OK;
6228 NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
6229 TALLOC_CTX *mem_ctx,
6230 const char *servername /* [in] [unique,charset(UTF16)] */,
6231 uint32_t level /* [in] */,
6232 DATA_BLOB *buffer /* [in] [unique] */,
6233 uint32_t offered /* [in] */,
6234 uint32_t *count /* [out] [ref] */,
6235 union spoolss_PortInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
6236 uint32_t *needed /* [out] [ref] */,
6237 WERROR *werror)
6239 struct spoolss_EnumPorts r;
6240 NTSTATUS status;
6242 /* In parameters */
6243 r.in.servername = servername;
6244 r.in.level = level;
6245 r.in.buffer = buffer;
6246 r.in.offered = offered;
6248 if (DEBUGLEVEL >= 10) {
6249 NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, &r);
6252 status = cli->dispatch(cli,
6253 mem_ctx,
6254 &ndr_table_spoolss,
6255 NDR_SPOOLSS_ENUMPORTS,
6256 &r);
6258 if (!NT_STATUS_IS_OK(status)) {
6259 return status;
6262 if (DEBUGLEVEL >= 10) {
6263 NDR_PRINT_OUT_DEBUG(spoolss_EnumPorts, &r);
6266 if (NT_STATUS_IS_ERR(status)) {
6267 return status;
6270 /* Return variables */
6271 *count = *r.out.count;
6272 *info = *r.out.info;
6273 *needed = *r.out.needed;
6275 /* Return result */
6276 if (werror) {
6277 *werror = r.out.result;
6280 return werror_to_ntstatus(r.out.result);
6283 struct rpccli_spoolss_EnumMonitors_state {
6284 struct spoolss_EnumMonitors orig;
6285 struct spoolss_EnumMonitors tmp;
6286 TALLOC_CTX *out_mem_ctx;
6287 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6290 static void rpccli_spoolss_EnumMonitors_done(struct tevent_req *subreq);
6292 struct tevent_req *rpccli_spoolss_EnumMonitors_send(TALLOC_CTX *mem_ctx,
6293 struct tevent_context *ev,
6294 struct rpc_pipe_client *cli,
6295 const char *_servername /* [in] [unique,charset(UTF16)] */,
6296 uint32_t _level /* [in] */,
6297 DATA_BLOB *_buffer /* [in] [unique] */,
6298 uint32_t _offered /* [in] */,
6299 uint32_t *_count /* [out] [ref] */,
6300 union spoolss_MonitorInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
6301 uint32_t *_needed /* [out] [ref] */)
6303 struct tevent_req *req;
6304 struct rpccli_spoolss_EnumMonitors_state *state;
6305 struct tevent_req *subreq;
6307 req = tevent_req_create(mem_ctx, &state,
6308 struct rpccli_spoolss_EnumMonitors_state);
6309 if (req == NULL) {
6310 return NULL;
6312 state->out_mem_ctx = NULL;
6313 state->dispatch_recv = cli->dispatch_recv;
6315 /* In parameters */
6316 state->orig.in.servername = _servername;
6317 state->orig.in.level = _level;
6318 state->orig.in.buffer = _buffer;
6319 state->orig.in.offered = _offered;
6321 /* Out parameters */
6322 state->orig.out.count = _count;
6323 state->orig.out.info = _info;
6324 state->orig.out.needed = _needed;
6326 /* Result */
6327 ZERO_STRUCT(state->orig.out.result);
6329 if (DEBUGLEVEL >= 10) {
6330 NDR_PRINT_IN_DEBUG(spoolss_EnumMonitors, &state->orig);
6333 state->out_mem_ctx = talloc_named_const(state, 0,
6334 "rpccli_spoolss_EnumMonitors_out_memory");
6335 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6336 return tevent_req_post(req, ev);
6339 /* make a temporary copy, that we pass to the dispatch function */
6340 state->tmp = state->orig;
6342 subreq = cli->dispatch_send(state, ev, cli,
6343 &ndr_table_spoolss,
6344 NDR_SPOOLSS_ENUMMONITORS,
6345 &state->tmp);
6346 if (tevent_req_nomem(subreq, req)) {
6347 return tevent_req_post(req, ev);
6349 tevent_req_set_callback(subreq, rpccli_spoolss_EnumMonitors_done, req);
6350 return req;
6353 static void rpccli_spoolss_EnumMonitors_done(struct tevent_req *subreq)
6355 struct tevent_req *req = tevent_req_callback_data(
6356 subreq, struct tevent_req);
6357 struct rpccli_spoolss_EnumMonitors_state *state = tevent_req_data(
6358 req, struct rpccli_spoolss_EnumMonitors_state);
6359 NTSTATUS status;
6360 TALLOC_CTX *mem_ctx;
6362 if (state->out_mem_ctx) {
6363 mem_ctx = state->out_mem_ctx;
6364 } else {
6365 mem_ctx = state;
6368 status = state->dispatch_recv(subreq, mem_ctx);
6369 TALLOC_FREE(subreq);
6370 if (!NT_STATUS_IS_OK(status)) {
6371 tevent_req_nterror(req, status);
6372 return;
6375 /* Copy out parameters */
6376 *state->orig.out.count = *state->tmp.out.count;
6377 *state->orig.out.info = *state->tmp.out.info;
6378 *state->orig.out.needed = *state->tmp.out.needed;
6380 /* Copy result */
6381 state->orig.out.result = state->tmp.out.result;
6383 /* Reset temporary structure */
6384 ZERO_STRUCT(state->tmp);
6386 if (DEBUGLEVEL >= 10) {
6387 NDR_PRINT_OUT_DEBUG(spoolss_EnumMonitors, &state->orig);
6390 tevent_req_done(req);
6393 NTSTATUS rpccli_spoolss_EnumMonitors_recv(struct tevent_req *req,
6394 TALLOC_CTX *mem_ctx,
6395 WERROR *result)
6397 struct rpccli_spoolss_EnumMonitors_state *state = tevent_req_data(
6398 req, struct rpccli_spoolss_EnumMonitors_state);
6399 NTSTATUS status;
6401 if (tevent_req_is_nterror(req, &status)) {
6402 tevent_req_received(req);
6403 return status;
6406 /* Steal possbile out parameters to the callers context */
6407 talloc_steal(mem_ctx, state->out_mem_ctx);
6409 /* Return result */
6410 *result = state->orig.out.result;
6412 tevent_req_received(req);
6413 return NT_STATUS_OK;
6416 NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
6417 TALLOC_CTX *mem_ctx,
6418 const char *servername /* [in] [unique,charset(UTF16)] */,
6419 uint32_t level /* [in] */,
6420 DATA_BLOB *buffer /* [in] [unique] */,
6421 uint32_t offered /* [in] */,
6422 uint32_t *count /* [out] [ref] */,
6423 union spoolss_MonitorInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
6424 uint32_t *needed /* [out] [ref] */,
6425 WERROR *werror)
6427 struct spoolss_EnumMonitors r;
6428 NTSTATUS status;
6430 /* In parameters */
6431 r.in.servername = servername;
6432 r.in.level = level;
6433 r.in.buffer = buffer;
6434 r.in.offered = offered;
6436 if (DEBUGLEVEL >= 10) {
6437 NDR_PRINT_IN_DEBUG(spoolss_EnumMonitors, &r);
6440 status = cli->dispatch(cli,
6441 mem_ctx,
6442 &ndr_table_spoolss,
6443 NDR_SPOOLSS_ENUMMONITORS,
6444 &r);
6446 if (!NT_STATUS_IS_OK(status)) {
6447 return status;
6450 if (DEBUGLEVEL >= 10) {
6451 NDR_PRINT_OUT_DEBUG(spoolss_EnumMonitors, &r);
6454 if (NT_STATUS_IS_ERR(status)) {
6455 return status;
6458 /* Return variables */
6459 *count = *r.out.count;
6460 *info = *r.out.info;
6461 *needed = *r.out.needed;
6463 /* Return result */
6464 if (werror) {
6465 *werror = r.out.result;
6468 return werror_to_ntstatus(r.out.result);
6471 struct rpccli_spoolss_AddPort_state {
6472 struct spoolss_AddPort orig;
6473 struct spoolss_AddPort tmp;
6474 TALLOC_CTX *out_mem_ctx;
6475 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6478 static void rpccli_spoolss_AddPort_done(struct tevent_req *subreq);
6480 struct tevent_req *rpccli_spoolss_AddPort_send(TALLOC_CTX *mem_ctx,
6481 struct tevent_context *ev,
6482 struct rpc_pipe_client *cli,
6483 const char *_server_name /* [in] [unique,charset(UTF16)] */,
6484 uint32_t _unknown /* [in] */,
6485 const char *_monitor_name /* [in] [charset(UTF16)] */)
6487 struct tevent_req *req;
6488 struct rpccli_spoolss_AddPort_state *state;
6489 struct tevent_req *subreq;
6491 req = tevent_req_create(mem_ctx, &state,
6492 struct rpccli_spoolss_AddPort_state);
6493 if (req == NULL) {
6494 return NULL;
6496 state->out_mem_ctx = NULL;
6497 state->dispatch_recv = cli->dispatch_recv;
6499 /* In parameters */
6500 state->orig.in.server_name = _server_name;
6501 state->orig.in.unknown = _unknown;
6502 state->orig.in.monitor_name = _monitor_name;
6504 /* Out parameters */
6506 /* Result */
6507 ZERO_STRUCT(state->orig.out.result);
6509 if (DEBUGLEVEL >= 10) {
6510 NDR_PRINT_IN_DEBUG(spoolss_AddPort, &state->orig);
6513 /* make a temporary copy, that we pass to the dispatch function */
6514 state->tmp = state->orig;
6516 subreq = cli->dispatch_send(state, ev, cli,
6517 &ndr_table_spoolss,
6518 NDR_SPOOLSS_ADDPORT,
6519 &state->tmp);
6520 if (tevent_req_nomem(subreq, req)) {
6521 return tevent_req_post(req, ev);
6523 tevent_req_set_callback(subreq, rpccli_spoolss_AddPort_done, req);
6524 return req;
6527 static void rpccli_spoolss_AddPort_done(struct tevent_req *subreq)
6529 struct tevent_req *req = tevent_req_callback_data(
6530 subreq, struct tevent_req);
6531 struct rpccli_spoolss_AddPort_state *state = tevent_req_data(
6532 req, struct rpccli_spoolss_AddPort_state);
6533 NTSTATUS status;
6534 TALLOC_CTX *mem_ctx;
6536 if (state->out_mem_ctx) {
6537 mem_ctx = state->out_mem_ctx;
6538 } else {
6539 mem_ctx = state;
6542 status = state->dispatch_recv(subreq, mem_ctx);
6543 TALLOC_FREE(subreq);
6544 if (!NT_STATUS_IS_OK(status)) {
6545 tevent_req_nterror(req, status);
6546 return;
6549 /* Copy out parameters */
6551 /* Copy result */
6552 state->orig.out.result = state->tmp.out.result;
6554 /* Reset temporary structure */
6555 ZERO_STRUCT(state->tmp);
6557 if (DEBUGLEVEL >= 10) {
6558 NDR_PRINT_OUT_DEBUG(spoolss_AddPort, &state->orig);
6561 tevent_req_done(req);
6564 NTSTATUS rpccli_spoolss_AddPort_recv(struct tevent_req *req,
6565 TALLOC_CTX *mem_ctx,
6566 WERROR *result)
6568 struct rpccli_spoolss_AddPort_state *state = tevent_req_data(
6569 req, struct rpccli_spoolss_AddPort_state);
6570 NTSTATUS status;
6572 if (tevent_req_is_nterror(req, &status)) {
6573 tevent_req_received(req);
6574 return status;
6577 /* Steal possbile out parameters to the callers context */
6578 talloc_steal(mem_ctx, state->out_mem_ctx);
6580 /* Return result */
6581 *result = state->orig.out.result;
6583 tevent_req_received(req);
6584 return NT_STATUS_OK;
6587 NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli,
6588 TALLOC_CTX *mem_ctx,
6589 const char *server_name /* [in] [unique,charset(UTF16)] */,
6590 uint32_t unknown /* [in] */,
6591 const char *monitor_name /* [in] [charset(UTF16)] */,
6592 WERROR *werror)
6594 struct spoolss_AddPort r;
6595 NTSTATUS status;
6597 /* In parameters */
6598 r.in.server_name = server_name;
6599 r.in.unknown = unknown;
6600 r.in.monitor_name = monitor_name;
6602 if (DEBUGLEVEL >= 10) {
6603 NDR_PRINT_IN_DEBUG(spoolss_AddPort, &r);
6606 status = cli->dispatch(cli,
6607 mem_ctx,
6608 &ndr_table_spoolss,
6609 NDR_SPOOLSS_ADDPORT,
6610 &r);
6612 if (!NT_STATUS_IS_OK(status)) {
6613 return status;
6616 if (DEBUGLEVEL >= 10) {
6617 NDR_PRINT_OUT_DEBUG(spoolss_AddPort, &r);
6620 if (NT_STATUS_IS_ERR(status)) {
6621 return status;
6624 /* Return variables */
6626 /* Return result */
6627 if (werror) {
6628 *werror = r.out.result;
6631 return werror_to_ntstatus(r.out.result);
6634 struct rpccli_spoolss_ConfigurePort_state {
6635 struct spoolss_ConfigurePort orig;
6636 struct spoolss_ConfigurePort tmp;
6637 TALLOC_CTX *out_mem_ctx;
6638 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6641 static void rpccli_spoolss_ConfigurePort_done(struct tevent_req *subreq);
6643 struct tevent_req *rpccli_spoolss_ConfigurePort_send(TALLOC_CTX *mem_ctx,
6644 struct tevent_context *ev,
6645 struct rpc_pipe_client *cli)
6647 struct tevent_req *req;
6648 struct rpccli_spoolss_ConfigurePort_state *state;
6649 struct tevent_req *subreq;
6651 req = tevent_req_create(mem_ctx, &state,
6652 struct rpccli_spoolss_ConfigurePort_state);
6653 if (req == NULL) {
6654 return NULL;
6656 state->out_mem_ctx = NULL;
6657 state->dispatch_recv = cli->dispatch_recv;
6659 /* In parameters */
6661 /* Out parameters */
6663 /* Result */
6664 ZERO_STRUCT(state->orig.out.result);
6666 if (DEBUGLEVEL >= 10) {
6667 NDR_PRINT_IN_DEBUG(spoolss_ConfigurePort, &state->orig);
6670 /* make a temporary copy, that we pass to the dispatch function */
6671 state->tmp = state->orig;
6673 subreq = cli->dispatch_send(state, ev, cli,
6674 &ndr_table_spoolss,
6675 NDR_SPOOLSS_CONFIGUREPORT,
6676 &state->tmp);
6677 if (tevent_req_nomem(subreq, req)) {
6678 return tevent_req_post(req, ev);
6680 tevent_req_set_callback(subreq, rpccli_spoolss_ConfigurePort_done, req);
6681 return req;
6684 static void rpccli_spoolss_ConfigurePort_done(struct tevent_req *subreq)
6686 struct tevent_req *req = tevent_req_callback_data(
6687 subreq, struct tevent_req);
6688 struct rpccli_spoolss_ConfigurePort_state *state = tevent_req_data(
6689 req, struct rpccli_spoolss_ConfigurePort_state);
6690 NTSTATUS status;
6691 TALLOC_CTX *mem_ctx;
6693 if (state->out_mem_ctx) {
6694 mem_ctx = state->out_mem_ctx;
6695 } else {
6696 mem_ctx = state;
6699 status = state->dispatch_recv(subreq, mem_ctx);
6700 TALLOC_FREE(subreq);
6701 if (!NT_STATUS_IS_OK(status)) {
6702 tevent_req_nterror(req, status);
6703 return;
6706 /* Copy out parameters */
6708 /* Copy result */
6709 state->orig.out.result = state->tmp.out.result;
6711 /* Reset temporary structure */
6712 ZERO_STRUCT(state->tmp);
6714 if (DEBUGLEVEL >= 10) {
6715 NDR_PRINT_OUT_DEBUG(spoolss_ConfigurePort, &state->orig);
6718 tevent_req_done(req);
6721 NTSTATUS rpccli_spoolss_ConfigurePort_recv(struct tevent_req *req,
6722 TALLOC_CTX *mem_ctx,
6723 WERROR *result)
6725 struct rpccli_spoolss_ConfigurePort_state *state = tevent_req_data(
6726 req, struct rpccli_spoolss_ConfigurePort_state);
6727 NTSTATUS status;
6729 if (tevent_req_is_nterror(req, &status)) {
6730 tevent_req_received(req);
6731 return status;
6734 /* Steal possbile out parameters to the callers context */
6735 talloc_steal(mem_ctx, state->out_mem_ctx);
6737 /* Return result */
6738 *result = state->orig.out.result;
6740 tevent_req_received(req);
6741 return NT_STATUS_OK;
6744 NTSTATUS rpccli_spoolss_ConfigurePort(struct rpc_pipe_client *cli,
6745 TALLOC_CTX *mem_ctx,
6746 WERROR *werror)
6748 struct spoolss_ConfigurePort r;
6749 NTSTATUS status;
6751 /* In parameters */
6753 if (DEBUGLEVEL >= 10) {
6754 NDR_PRINT_IN_DEBUG(spoolss_ConfigurePort, &r);
6757 status = cli->dispatch(cli,
6758 mem_ctx,
6759 &ndr_table_spoolss,
6760 NDR_SPOOLSS_CONFIGUREPORT,
6761 &r);
6763 if (!NT_STATUS_IS_OK(status)) {
6764 return status;
6767 if (DEBUGLEVEL >= 10) {
6768 NDR_PRINT_OUT_DEBUG(spoolss_ConfigurePort, &r);
6771 if (NT_STATUS_IS_ERR(status)) {
6772 return status;
6775 /* Return variables */
6777 /* Return result */
6778 if (werror) {
6779 *werror = r.out.result;
6782 return werror_to_ntstatus(r.out.result);
6785 struct rpccli_spoolss_DeletePort_state {
6786 struct spoolss_DeletePort orig;
6787 struct spoolss_DeletePort tmp;
6788 TALLOC_CTX *out_mem_ctx;
6789 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6792 static void rpccli_spoolss_DeletePort_done(struct tevent_req *subreq);
6794 struct tevent_req *rpccli_spoolss_DeletePort_send(TALLOC_CTX *mem_ctx,
6795 struct tevent_context *ev,
6796 struct rpc_pipe_client *cli)
6798 struct tevent_req *req;
6799 struct rpccli_spoolss_DeletePort_state *state;
6800 struct tevent_req *subreq;
6802 req = tevent_req_create(mem_ctx, &state,
6803 struct rpccli_spoolss_DeletePort_state);
6804 if (req == NULL) {
6805 return NULL;
6807 state->out_mem_ctx = NULL;
6808 state->dispatch_recv = cli->dispatch_recv;
6810 /* In parameters */
6812 /* Out parameters */
6814 /* Result */
6815 ZERO_STRUCT(state->orig.out.result);
6817 if (DEBUGLEVEL >= 10) {
6818 NDR_PRINT_IN_DEBUG(spoolss_DeletePort, &state->orig);
6821 /* make a temporary copy, that we pass to the dispatch function */
6822 state->tmp = state->orig;
6824 subreq = cli->dispatch_send(state, ev, cli,
6825 &ndr_table_spoolss,
6826 NDR_SPOOLSS_DELETEPORT,
6827 &state->tmp);
6828 if (tevent_req_nomem(subreq, req)) {
6829 return tevent_req_post(req, ev);
6831 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePort_done, req);
6832 return req;
6835 static void rpccli_spoolss_DeletePort_done(struct tevent_req *subreq)
6837 struct tevent_req *req = tevent_req_callback_data(
6838 subreq, struct tevent_req);
6839 struct rpccli_spoolss_DeletePort_state *state = tevent_req_data(
6840 req, struct rpccli_spoolss_DeletePort_state);
6841 NTSTATUS status;
6842 TALLOC_CTX *mem_ctx;
6844 if (state->out_mem_ctx) {
6845 mem_ctx = state->out_mem_ctx;
6846 } else {
6847 mem_ctx = state;
6850 status = state->dispatch_recv(subreq, mem_ctx);
6851 TALLOC_FREE(subreq);
6852 if (!NT_STATUS_IS_OK(status)) {
6853 tevent_req_nterror(req, status);
6854 return;
6857 /* Copy out parameters */
6859 /* Copy result */
6860 state->orig.out.result = state->tmp.out.result;
6862 /* Reset temporary structure */
6863 ZERO_STRUCT(state->tmp);
6865 if (DEBUGLEVEL >= 10) {
6866 NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, &state->orig);
6869 tevent_req_done(req);
6872 NTSTATUS rpccli_spoolss_DeletePort_recv(struct tevent_req *req,
6873 TALLOC_CTX *mem_ctx,
6874 WERROR *result)
6876 struct rpccli_spoolss_DeletePort_state *state = tevent_req_data(
6877 req, struct rpccli_spoolss_DeletePort_state);
6878 NTSTATUS status;
6880 if (tevent_req_is_nterror(req, &status)) {
6881 tevent_req_received(req);
6882 return status;
6885 /* Steal possbile out parameters to the callers context */
6886 talloc_steal(mem_ctx, state->out_mem_ctx);
6888 /* Return result */
6889 *result = state->orig.out.result;
6891 tevent_req_received(req);
6892 return NT_STATUS_OK;
6895 NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
6896 TALLOC_CTX *mem_ctx,
6897 WERROR *werror)
6899 struct spoolss_DeletePort r;
6900 NTSTATUS status;
6902 /* In parameters */
6904 if (DEBUGLEVEL >= 10) {
6905 NDR_PRINT_IN_DEBUG(spoolss_DeletePort, &r);
6908 status = cli->dispatch(cli,
6909 mem_ctx,
6910 &ndr_table_spoolss,
6911 NDR_SPOOLSS_DELETEPORT,
6912 &r);
6914 if (!NT_STATUS_IS_OK(status)) {
6915 return status;
6918 if (DEBUGLEVEL >= 10) {
6919 NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, &r);
6922 if (NT_STATUS_IS_ERR(status)) {
6923 return status;
6926 /* Return variables */
6928 /* Return result */
6929 if (werror) {
6930 *werror = r.out.result;
6933 return werror_to_ntstatus(r.out.result);
6936 struct rpccli_spoolss_CreatePrinterIC_state {
6937 struct spoolss_CreatePrinterIC orig;
6938 struct spoolss_CreatePrinterIC tmp;
6939 TALLOC_CTX *out_mem_ctx;
6940 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6943 static void rpccli_spoolss_CreatePrinterIC_done(struct tevent_req *subreq);
6945 struct tevent_req *rpccli_spoolss_CreatePrinterIC_send(TALLOC_CTX *mem_ctx,
6946 struct tevent_context *ev,
6947 struct rpc_pipe_client *cli,
6948 struct policy_handle *_handle /* [in] [ref] */,
6949 struct policy_handle *_gdi_handle /* [out] [ref] */,
6950 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */)
6952 struct tevent_req *req;
6953 struct rpccli_spoolss_CreatePrinterIC_state *state;
6954 struct tevent_req *subreq;
6956 req = tevent_req_create(mem_ctx, &state,
6957 struct rpccli_spoolss_CreatePrinterIC_state);
6958 if (req == NULL) {
6959 return NULL;
6961 state->out_mem_ctx = NULL;
6962 state->dispatch_recv = cli->dispatch_recv;
6964 /* In parameters */
6965 state->orig.in.handle = _handle;
6966 state->orig.in.devmode_ctr = _devmode_ctr;
6968 /* Out parameters */
6969 state->orig.out.gdi_handle = _gdi_handle;
6971 /* Result */
6972 ZERO_STRUCT(state->orig.out.result);
6974 if (DEBUGLEVEL >= 10) {
6975 NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &state->orig);
6978 state->out_mem_ctx = talloc_named_const(state, 0,
6979 "rpccli_spoolss_CreatePrinterIC_out_memory");
6980 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6981 return tevent_req_post(req, ev);
6984 /* make a temporary copy, that we pass to the dispatch function */
6985 state->tmp = state->orig;
6987 subreq = cli->dispatch_send(state, ev, cli,
6988 &ndr_table_spoolss,
6989 NDR_SPOOLSS_CREATEPRINTERIC,
6990 &state->tmp);
6991 if (tevent_req_nomem(subreq, req)) {
6992 return tevent_req_post(req, ev);
6994 tevent_req_set_callback(subreq, rpccli_spoolss_CreatePrinterIC_done, req);
6995 return req;
6998 static void rpccli_spoolss_CreatePrinterIC_done(struct tevent_req *subreq)
7000 struct tevent_req *req = tevent_req_callback_data(
7001 subreq, struct tevent_req);
7002 struct rpccli_spoolss_CreatePrinterIC_state *state = tevent_req_data(
7003 req, struct rpccli_spoolss_CreatePrinterIC_state);
7004 NTSTATUS status;
7005 TALLOC_CTX *mem_ctx;
7007 if (state->out_mem_ctx) {
7008 mem_ctx = state->out_mem_ctx;
7009 } else {
7010 mem_ctx = state;
7013 status = state->dispatch_recv(subreq, mem_ctx);
7014 TALLOC_FREE(subreq);
7015 if (!NT_STATUS_IS_OK(status)) {
7016 tevent_req_nterror(req, status);
7017 return;
7020 /* Copy out parameters */
7021 *state->orig.out.gdi_handle = *state->tmp.out.gdi_handle;
7023 /* Copy result */
7024 state->orig.out.result = state->tmp.out.result;
7026 /* Reset temporary structure */
7027 ZERO_STRUCT(state->tmp);
7029 if (DEBUGLEVEL >= 10) {
7030 NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, &state->orig);
7033 tevent_req_done(req);
7036 NTSTATUS rpccli_spoolss_CreatePrinterIC_recv(struct tevent_req *req,
7037 TALLOC_CTX *mem_ctx,
7038 WERROR *result)
7040 struct rpccli_spoolss_CreatePrinterIC_state *state = tevent_req_data(
7041 req, struct rpccli_spoolss_CreatePrinterIC_state);
7042 NTSTATUS status;
7044 if (tevent_req_is_nterror(req, &status)) {
7045 tevent_req_received(req);
7046 return status;
7049 /* Steal possbile out parameters to the callers context */
7050 talloc_steal(mem_ctx, state->out_mem_ctx);
7052 /* Return result */
7053 *result = state->orig.out.result;
7055 tevent_req_received(req);
7056 return NT_STATUS_OK;
7059 NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
7060 TALLOC_CTX *mem_ctx,
7061 struct policy_handle *handle /* [in] [ref] */,
7062 struct policy_handle *gdi_handle /* [out] [ref] */,
7063 struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
7064 WERROR *werror)
7066 struct spoolss_CreatePrinterIC r;
7067 NTSTATUS status;
7069 /* In parameters */
7070 r.in.handle = handle;
7071 r.in.devmode_ctr = devmode_ctr;
7073 if (DEBUGLEVEL >= 10) {
7074 NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &r);
7077 status = cli->dispatch(cli,
7078 mem_ctx,
7079 &ndr_table_spoolss,
7080 NDR_SPOOLSS_CREATEPRINTERIC,
7081 &r);
7083 if (!NT_STATUS_IS_OK(status)) {
7084 return status;
7087 if (DEBUGLEVEL >= 10) {
7088 NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, &r);
7091 if (NT_STATUS_IS_ERR(status)) {
7092 return status;
7095 /* Return variables */
7096 *gdi_handle = *r.out.gdi_handle;
7098 /* Return result */
7099 if (werror) {
7100 *werror = r.out.result;
7103 return werror_to_ntstatus(r.out.result);
7106 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state {
7107 struct spoolss_PlayGDIScriptOnPrinterIC orig;
7108 struct spoolss_PlayGDIScriptOnPrinterIC tmp;
7109 TALLOC_CTX *out_mem_ctx;
7110 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7113 static void rpccli_spoolss_PlayGDIScriptOnPrinterIC_done(struct tevent_req *subreq);
7115 struct tevent_req *rpccli_spoolss_PlayGDIScriptOnPrinterIC_send(TALLOC_CTX *mem_ctx,
7116 struct tevent_context *ev,
7117 struct rpc_pipe_client *cli)
7119 struct tevent_req *req;
7120 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state *state;
7121 struct tevent_req *subreq;
7123 req = tevent_req_create(mem_ctx, &state,
7124 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state);
7125 if (req == NULL) {
7126 return NULL;
7128 state->out_mem_ctx = NULL;
7129 state->dispatch_recv = cli->dispatch_recv;
7131 /* In parameters */
7133 /* Out parameters */
7135 /* Result */
7136 ZERO_STRUCT(state->orig.out.result);
7138 if (DEBUGLEVEL >= 10) {
7139 NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &state->orig);
7142 /* make a temporary copy, that we pass to the dispatch function */
7143 state->tmp = state->orig;
7145 subreq = cli->dispatch_send(state, ev, cli,
7146 &ndr_table_spoolss,
7147 NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
7148 &state->tmp);
7149 if (tevent_req_nomem(subreq, req)) {
7150 return tevent_req_post(req, ev);
7152 tevent_req_set_callback(subreq, rpccli_spoolss_PlayGDIScriptOnPrinterIC_done, req);
7153 return req;
7156 static void rpccli_spoolss_PlayGDIScriptOnPrinterIC_done(struct tevent_req *subreq)
7158 struct tevent_req *req = tevent_req_callback_data(
7159 subreq, struct tevent_req);
7160 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state *state = tevent_req_data(
7161 req, struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state);
7162 NTSTATUS status;
7163 TALLOC_CTX *mem_ctx;
7165 if (state->out_mem_ctx) {
7166 mem_ctx = state->out_mem_ctx;
7167 } else {
7168 mem_ctx = state;
7171 status = state->dispatch_recv(subreq, mem_ctx);
7172 TALLOC_FREE(subreq);
7173 if (!NT_STATUS_IS_OK(status)) {
7174 tevent_req_nterror(req, status);
7175 return;
7178 /* Copy out parameters */
7180 /* Copy result */
7181 state->orig.out.result = state->tmp.out.result;
7183 /* Reset temporary structure */
7184 ZERO_STRUCT(state->tmp);
7186 if (DEBUGLEVEL >= 10) {
7187 NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &state->orig);
7190 tevent_req_done(req);
7193 NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC_recv(struct tevent_req *req,
7194 TALLOC_CTX *mem_ctx,
7195 WERROR *result)
7197 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state *state = tevent_req_data(
7198 req, struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state);
7199 NTSTATUS status;
7201 if (tevent_req_is_nterror(req, &status)) {
7202 tevent_req_received(req);
7203 return status;
7206 /* Steal possbile out parameters to the callers context */
7207 talloc_steal(mem_ctx, state->out_mem_ctx);
7209 /* Return result */
7210 *result = state->orig.out.result;
7212 tevent_req_received(req);
7213 return NT_STATUS_OK;
7216 NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
7217 TALLOC_CTX *mem_ctx,
7218 WERROR *werror)
7220 struct spoolss_PlayGDIScriptOnPrinterIC r;
7221 NTSTATUS status;
7223 /* In parameters */
7225 if (DEBUGLEVEL >= 10) {
7226 NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
7229 status = cli->dispatch(cli,
7230 mem_ctx,
7231 &ndr_table_spoolss,
7232 NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
7233 &r);
7235 if (!NT_STATUS_IS_OK(status)) {
7236 return status;
7239 if (DEBUGLEVEL >= 10) {
7240 NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
7243 if (NT_STATUS_IS_ERR(status)) {
7244 return status;
7247 /* Return variables */
7249 /* Return result */
7250 if (werror) {
7251 *werror = r.out.result;
7254 return werror_to_ntstatus(r.out.result);
7257 struct rpccli_spoolss_DeletePrinterIC_state {
7258 struct spoolss_DeletePrinterIC orig;
7259 struct spoolss_DeletePrinterIC tmp;
7260 TALLOC_CTX *out_mem_ctx;
7261 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7264 static void rpccli_spoolss_DeletePrinterIC_done(struct tevent_req *subreq);
7266 struct tevent_req *rpccli_spoolss_DeletePrinterIC_send(TALLOC_CTX *mem_ctx,
7267 struct tevent_context *ev,
7268 struct rpc_pipe_client *cli,
7269 struct policy_handle *_gdi_handle /* [in,out] [ref] */)
7271 struct tevent_req *req;
7272 struct rpccli_spoolss_DeletePrinterIC_state *state;
7273 struct tevent_req *subreq;
7275 req = tevent_req_create(mem_ctx, &state,
7276 struct rpccli_spoolss_DeletePrinterIC_state);
7277 if (req == NULL) {
7278 return NULL;
7280 state->out_mem_ctx = NULL;
7281 state->dispatch_recv = cli->dispatch_recv;
7283 /* In parameters */
7284 state->orig.in.gdi_handle = _gdi_handle;
7286 /* Out parameters */
7287 state->orig.out.gdi_handle = _gdi_handle;
7289 /* Result */
7290 ZERO_STRUCT(state->orig.out.result);
7292 if (DEBUGLEVEL >= 10) {
7293 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &state->orig);
7296 state->out_mem_ctx = talloc_named_const(state, 0,
7297 "rpccli_spoolss_DeletePrinterIC_out_memory");
7298 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7299 return tevent_req_post(req, ev);
7302 /* make a temporary copy, that we pass to the dispatch function */
7303 state->tmp = state->orig;
7305 subreq = cli->dispatch_send(state, ev, cli,
7306 &ndr_table_spoolss,
7307 NDR_SPOOLSS_DELETEPRINTERIC,
7308 &state->tmp);
7309 if (tevent_req_nomem(subreq, req)) {
7310 return tevent_req_post(req, ev);
7312 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterIC_done, req);
7313 return req;
7316 static void rpccli_spoolss_DeletePrinterIC_done(struct tevent_req *subreq)
7318 struct tevent_req *req = tevent_req_callback_data(
7319 subreq, struct tevent_req);
7320 struct rpccli_spoolss_DeletePrinterIC_state *state = tevent_req_data(
7321 req, struct rpccli_spoolss_DeletePrinterIC_state);
7322 NTSTATUS status;
7323 TALLOC_CTX *mem_ctx;
7325 if (state->out_mem_ctx) {
7326 mem_ctx = state->out_mem_ctx;
7327 } else {
7328 mem_ctx = state;
7331 status = state->dispatch_recv(subreq, mem_ctx);
7332 TALLOC_FREE(subreq);
7333 if (!NT_STATUS_IS_OK(status)) {
7334 tevent_req_nterror(req, status);
7335 return;
7338 /* Copy out parameters */
7339 *state->orig.out.gdi_handle = *state->tmp.out.gdi_handle;
7341 /* Copy result */
7342 state->orig.out.result = state->tmp.out.result;
7344 /* Reset temporary structure */
7345 ZERO_STRUCT(state->tmp);
7347 if (DEBUGLEVEL >= 10) {
7348 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, &state->orig);
7351 tevent_req_done(req);
7354 NTSTATUS rpccli_spoolss_DeletePrinterIC_recv(struct tevent_req *req,
7355 TALLOC_CTX *mem_ctx,
7356 WERROR *result)
7358 struct rpccli_spoolss_DeletePrinterIC_state *state = tevent_req_data(
7359 req, struct rpccli_spoolss_DeletePrinterIC_state);
7360 NTSTATUS status;
7362 if (tevent_req_is_nterror(req, &status)) {
7363 tevent_req_received(req);
7364 return status;
7367 /* Steal possbile out parameters to the callers context */
7368 talloc_steal(mem_ctx, state->out_mem_ctx);
7370 /* Return result */
7371 *result = state->orig.out.result;
7373 tevent_req_received(req);
7374 return NT_STATUS_OK;
7377 NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
7378 TALLOC_CTX *mem_ctx,
7379 struct policy_handle *gdi_handle /* [in,out] [ref] */,
7380 WERROR *werror)
7382 struct spoolss_DeletePrinterIC r;
7383 NTSTATUS status;
7385 /* In parameters */
7386 r.in.gdi_handle = gdi_handle;
7388 if (DEBUGLEVEL >= 10) {
7389 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &r);
7392 status = cli->dispatch(cli,
7393 mem_ctx,
7394 &ndr_table_spoolss,
7395 NDR_SPOOLSS_DELETEPRINTERIC,
7396 &r);
7398 if (!NT_STATUS_IS_OK(status)) {
7399 return status;
7402 if (DEBUGLEVEL >= 10) {
7403 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, &r);
7406 if (NT_STATUS_IS_ERR(status)) {
7407 return status;
7410 /* Return variables */
7411 *gdi_handle = *r.out.gdi_handle;
7413 /* Return result */
7414 if (werror) {
7415 *werror = r.out.result;
7418 return werror_to_ntstatus(r.out.result);
7421 struct rpccli_spoolss_AddPrinterConnection_state {
7422 struct spoolss_AddPrinterConnection orig;
7423 struct spoolss_AddPrinterConnection tmp;
7424 TALLOC_CTX *out_mem_ctx;
7425 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7428 static void rpccli_spoolss_AddPrinterConnection_done(struct tevent_req *subreq);
7430 struct tevent_req *rpccli_spoolss_AddPrinterConnection_send(TALLOC_CTX *mem_ctx,
7431 struct tevent_context *ev,
7432 struct rpc_pipe_client *cli)
7434 struct tevent_req *req;
7435 struct rpccli_spoolss_AddPrinterConnection_state *state;
7436 struct tevent_req *subreq;
7438 req = tevent_req_create(mem_ctx, &state,
7439 struct rpccli_spoolss_AddPrinterConnection_state);
7440 if (req == NULL) {
7441 return NULL;
7443 state->out_mem_ctx = NULL;
7444 state->dispatch_recv = cli->dispatch_recv;
7446 /* In parameters */
7448 /* Out parameters */
7450 /* Result */
7451 ZERO_STRUCT(state->orig.out.result);
7453 if (DEBUGLEVEL >= 10) {
7454 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, &state->orig);
7457 /* make a temporary copy, that we pass to the dispatch function */
7458 state->tmp = state->orig;
7460 subreq = cli->dispatch_send(state, ev, cli,
7461 &ndr_table_spoolss,
7462 NDR_SPOOLSS_ADDPRINTERCONNECTION,
7463 &state->tmp);
7464 if (tevent_req_nomem(subreq, req)) {
7465 return tevent_req_post(req, ev);
7467 tevent_req_set_callback(subreq, rpccli_spoolss_AddPrinterConnection_done, req);
7468 return req;
7471 static void rpccli_spoolss_AddPrinterConnection_done(struct tevent_req *subreq)
7473 struct tevent_req *req = tevent_req_callback_data(
7474 subreq, struct tevent_req);
7475 struct rpccli_spoolss_AddPrinterConnection_state *state = tevent_req_data(
7476 req, struct rpccli_spoolss_AddPrinterConnection_state);
7477 NTSTATUS status;
7478 TALLOC_CTX *mem_ctx;
7480 if (state->out_mem_ctx) {
7481 mem_ctx = state->out_mem_ctx;
7482 } else {
7483 mem_ctx = state;
7486 status = state->dispatch_recv(subreq, mem_ctx);
7487 TALLOC_FREE(subreq);
7488 if (!NT_STATUS_IS_OK(status)) {
7489 tevent_req_nterror(req, status);
7490 return;
7493 /* Copy out parameters */
7495 /* Copy result */
7496 state->orig.out.result = state->tmp.out.result;
7498 /* Reset temporary structure */
7499 ZERO_STRUCT(state->tmp);
7501 if (DEBUGLEVEL >= 10) {
7502 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, &state->orig);
7505 tevent_req_done(req);
7508 NTSTATUS rpccli_spoolss_AddPrinterConnection_recv(struct tevent_req *req,
7509 TALLOC_CTX *mem_ctx,
7510 WERROR *result)
7512 struct rpccli_spoolss_AddPrinterConnection_state *state = tevent_req_data(
7513 req, struct rpccli_spoolss_AddPrinterConnection_state);
7514 NTSTATUS status;
7516 if (tevent_req_is_nterror(req, &status)) {
7517 tevent_req_received(req);
7518 return status;
7521 /* Steal possbile out parameters to the callers context */
7522 talloc_steal(mem_ctx, state->out_mem_ctx);
7524 /* Return result */
7525 *result = state->orig.out.result;
7527 tevent_req_received(req);
7528 return NT_STATUS_OK;
7531 NTSTATUS rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client *cli,
7532 TALLOC_CTX *mem_ctx,
7533 WERROR *werror)
7535 struct spoolss_AddPrinterConnection r;
7536 NTSTATUS status;
7538 /* In parameters */
7540 if (DEBUGLEVEL >= 10) {
7541 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, &r);
7544 status = cli->dispatch(cli,
7545 mem_ctx,
7546 &ndr_table_spoolss,
7547 NDR_SPOOLSS_ADDPRINTERCONNECTION,
7548 &r);
7550 if (!NT_STATUS_IS_OK(status)) {
7551 return status;
7554 if (DEBUGLEVEL >= 10) {
7555 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, &r);
7558 if (NT_STATUS_IS_ERR(status)) {
7559 return status;
7562 /* Return variables */
7564 /* Return result */
7565 if (werror) {
7566 *werror = r.out.result;
7569 return werror_to_ntstatus(r.out.result);
7572 struct rpccli_spoolss_DeletePrinterConnection_state {
7573 struct spoolss_DeletePrinterConnection orig;
7574 struct spoolss_DeletePrinterConnection tmp;
7575 TALLOC_CTX *out_mem_ctx;
7576 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7579 static void rpccli_spoolss_DeletePrinterConnection_done(struct tevent_req *subreq);
7581 struct tevent_req *rpccli_spoolss_DeletePrinterConnection_send(TALLOC_CTX *mem_ctx,
7582 struct tevent_context *ev,
7583 struct rpc_pipe_client *cli)
7585 struct tevent_req *req;
7586 struct rpccli_spoolss_DeletePrinterConnection_state *state;
7587 struct tevent_req *subreq;
7589 req = tevent_req_create(mem_ctx, &state,
7590 struct rpccli_spoolss_DeletePrinterConnection_state);
7591 if (req == NULL) {
7592 return NULL;
7594 state->out_mem_ctx = NULL;
7595 state->dispatch_recv = cli->dispatch_recv;
7597 /* In parameters */
7599 /* Out parameters */
7601 /* Result */
7602 ZERO_STRUCT(state->orig.out.result);
7604 if (DEBUGLEVEL >= 10) {
7605 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, &state->orig);
7608 /* make a temporary copy, that we pass to the dispatch function */
7609 state->tmp = state->orig;
7611 subreq = cli->dispatch_send(state, ev, cli,
7612 &ndr_table_spoolss,
7613 NDR_SPOOLSS_DELETEPRINTERCONNECTION,
7614 &state->tmp);
7615 if (tevent_req_nomem(subreq, req)) {
7616 return tevent_req_post(req, ev);
7618 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterConnection_done, req);
7619 return req;
7622 static void rpccli_spoolss_DeletePrinterConnection_done(struct tevent_req *subreq)
7624 struct tevent_req *req = tevent_req_callback_data(
7625 subreq, struct tevent_req);
7626 struct rpccli_spoolss_DeletePrinterConnection_state *state = tevent_req_data(
7627 req, struct rpccli_spoolss_DeletePrinterConnection_state);
7628 NTSTATUS status;
7629 TALLOC_CTX *mem_ctx;
7631 if (state->out_mem_ctx) {
7632 mem_ctx = state->out_mem_ctx;
7633 } else {
7634 mem_ctx = state;
7637 status = state->dispatch_recv(subreq, mem_ctx);
7638 TALLOC_FREE(subreq);
7639 if (!NT_STATUS_IS_OK(status)) {
7640 tevent_req_nterror(req, status);
7641 return;
7644 /* Copy out parameters */
7646 /* Copy result */
7647 state->orig.out.result = state->tmp.out.result;
7649 /* Reset temporary structure */
7650 ZERO_STRUCT(state->tmp);
7652 if (DEBUGLEVEL >= 10) {
7653 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, &state->orig);
7656 tevent_req_done(req);
7659 NTSTATUS rpccli_spoolss_DeletePrinterConnection_recv(struct tevent_req *req,
7660 TALLOC_CTX *mem_ctx,
7661 WERROR *result)
7663 struct rpccli_spoolss_DeletePrinterConnection_state *state = tevent_req_data(
7664 req, struct rpccli_spoolss_DeletePrinterConnection_state);
7665 NTSTATUS status;
7667 if (tevent_req_is_nterror(req, &status)) {
7668 tevent_req_received(req);
7669 return status;
7672 /* Steal possbile out parameters to the callers context */
7673 talloc_steal(mem_ctx, state->out_mem_ctx);
7675 /* Return result */
7676 *result = state->orig.out.result;
7678 tevent_req_received(req);
7679 return NT_STATUS_OK;
7682 NTSTATUS rpccli_spoolss_DeletePrinterConnection(struct rpc_pipe_client *cli,
7683 TALLOC_CTX *mem_ctx,
7684 WERROR *werror)
7686 struct spoolss_DeletePrinterConnection r;
7687 NTSTATUS status;
7689 /* In parameters */
7691 if (DEBUGLEVEL >= 10) {
7692 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, &r);
7695 status = cli->dispatch(cli,
7696 mem_ctx,
7697 &ndr_table_spoolss,
7698 NDR_SPOOLSS_DELETEPRINTERCONNECTION,
7699 &r);
7701 if (!NT_STATUS_IS_OK(status)) {
7702 return status;
7705 if (DEBUGLEVEL >= 10) {
7706 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, &r);
7709 if (NT_STATUS_IS_ERR(status)) {
7710 return status;
7713 /* Return variables */
7715 /* Return result */
7716 if (werror) {
7717 *werror = r.out.result;
7720 return werror_to_ntstatus(r.out.result);
7723 struct rpccli_spoolss_PrinterMessageBox_state {
7724 struct spoolss_PrinterMessageBox orig;
7725 struct spoolss_PrinterMessageBox tmp;
7726 TALLOC_CTX *out_mem_ctx;
7727 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7730 static void rpccli_spoolss_PrinterMessageBox_done(struct tevent_req *subreq);
7732 struct tevent_req *rpccli_spoolss_PrinterMessageBox_send(TALLOC_CTX *mem_ctx,
7733 struct tevent_context *ev,
7734 struct rpc_pipe_client *cli)
7736 struct tevent_req *req;
7737 struct rpccli_spoolss_PrinterMessageBox_state *state;
7738 struct tevent_req *subreq;
7740 req = tevent_req_create(mem_ctx, &state,
7741 struct rpccli_spoolss_PrinterMessageBox_state);
7742 if (req == NULL) {
7743 return NULL;
7745 state->out_mem_ctx = NULL;
7746 state->dispatch_recv = cli->dispatch_recv;
7748 /* In parameters */
7750 /* Out parameters */
7752 /* Result */
7753 ZERO_STRUCT(state->orig.out.result);
7755 if (DEBUGLEVEL >= 10) {
7756 NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, &state->orig);
7759 /* make a temporary copy, that we pass to the dispatch function */
7760 state->tmp = state->orig;
7762 subreq = cli->dispatch_send(state, ev, cli,
7763 &ndr_table_spoolss,
7764 NDR_SPOOLSS_PRINTERMESSAGEBOX,
7765 &state->tmp);
7766 if (tevent_req_nomem(subreq, req)) {
7767 return tevent_req_post(req, ev);
7769 tevent_req_set_callback(subreq, rpccli_spoolss_PrinterMessageBox_done, req);
7770 return req;
7773 static void rpccli_spoolss_PrinterMessageBox_done(struct tevent_req *subreq)
7775 struct tevent_req *req = tevent_req_callback_data(
7776 subreq, struct tevent_req);
7777 struct rpccli_spoolss_PrinterMessageBox_state *state = tevent_req_data(
7778 req, struct rpccli_spoolss_PrinterMessageBox_state);
7779 NTSTATUS status;
7780 TALLOC_CTX *mem_ctx;
7782 if (state->out_mem_ctx) {
7783 mem_ctx = state->out_mem_ctx;
7784 } else {
7785 mem_ctx = state;
7788 status = state->dispatch_recv(subreq, mem_ctx);
7789 TALLOC_FREE(subreq);
7790 if (!NT_STATUS_IS_OK(status)) {
7791 tevent_req_nterror(req, status);
7792 return;
7795 /* Copy out parameters */
7797 /* Copy result */
7798 state->orig.out.result = state->tmp.out.result;
7800 /* Reset temporary structure */
7801 ZERO_STRUCT(state->tmp);
7803 if (DEBUGLEVEL >= 10) {
7804 NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, &state->orig);
7807 tevent_req_done(req);
7810 NTSTATUS rpccli_spoolss_PrinterMessageBox_recv(struct tevent_req *req,
7811 TALLOC_CTX *mem_ctx,
7812 WERROR *result)
7814 struct rpccli_spoolss_PrinterMessageBox_state *state = tevent_req_data(
7815 req, struct rpccli_spoolss_PrinterMessageBox_state);
7816 NTSTATUS status;
7818 if (tevent_req_is_nterror(req, &status)) {
7819 tevent_req_received(req);
7820 return status;
7823 /* Steal possbile out parameters to the callers context */
7824 talloc_steal(mem_ctx, state->out_mem_ctx);
7826 /* Return result */
7827 *result = state->orig.out.result;
7829 tevent_req_received(req);
7830 return NT_STATUS_OK;
7833 NTSTATUS rpccli_spoolss_PrinterMessageBox(struct rpc_pipe_client *cli,
7834 TALLOC_CTX *mem_ctx,
7835 WERROR *werror)
7837 struct spoolss_PrinterMessageBox r;
7838 NTSTATUS status;
7840 /* In parameters */
7842 if (DEBUGLEVEL >= 10) {
7843 NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, &r);
7846 status = cli->dispatch(cli,
7847 mem_ctx,
7848 &ndr_table_spoolss,
7849 NDR_SPOOLSS_PRINTERMESSAGEBOX,
7850 &r);
7852 if (!NT_STATUS_IS_OK(status)) {
7853 return status;
7856 if (DEBUGLEVEL >= 10) {
7857 NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, &r);
7860 if (NT_STATUS_IS_ERR(status)) {
7861 return status;
7864 /* Return variables */
7866 /* Return result */
7867 if (werror) {
7868 *werror = r.out.result;
7871 return werror_to_ntstatus(r.out.result);
7874 struct rpccli_spoolss_AddMonitor_state {
7875 struct spoolss_AddMonitor orig;
7876 struct spoolss_AddMonitor tmp;
7877 TALLOC_CTX *out_mem_ctx;
7878 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7881 static void rpccli_spoolss_AddMonitor_done(struct tevent_req *subreq);
7883 struct tevent_req *rpccli_spoolss_AddMonitor_send(TALLOC_CTX *mem_ctx,
7884 struct tevent_context *ev,
7885 struct rpc_pipe_client *cli)
7887 struct tevent_req *req;
7888 struct rpccli_spoolss_AddMonitor_state *state;
7889 struct tevent_req *subreq;
7891 req = tevent_req_create(mem_ctx, &state,
7892 struct rpccli_spoolss_AddMonitor_state);
7893 if (req == NULL) {
7894 return NULL;
7896 state->out_mem_ctx = NULL;
7897 state->dispatch_recv = cli->dispatch_recv;
7899 /* In parameters */
7901 /* Out parameters */
7903 /* Result */
7904 ZERO_STRUCT(state->orig.out.result);
7906 if (DEBUGLEVEL >= 10) {
7907 NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, &state->orig);
7910 /* make a temporary copy, that we pass to the dispatch function */
7911 state->tmp = state->orig;
7913 subreq = cli->dispatch_send(state, ev, cli,
7914 &ndr_table_spoolss,
7915 NDR_SPOOLSS_ADDMONITOR,
7916 &state->tmp);
7917 if (tevent_req_nomem(subreq, req)) {
7918 return tevent_req_post(req, ev);
7920 tevent_req_set_callback(subreq, rpccli_spoolss_AddMonitor_done, req);
7921 return req;
7924 static void rpccli_spoolss_AddMonitor_done(struct tevent_req *subreq)
7926 struct tevent_req *req = tevent_req_callback_data(
7927 subreq, struct tevent_req);
7928 struct rpccli_spoolss_AddMonitor_state *state = tevent_req_data(
7929 req, struct rpccli_spoolss_AddMonitor_state);
7930 NTSTATUS status;
7931 TALLOC_CTX *mem_ctx;
7933 if (state->out_mem_ctx) {
7934 mem_ctx = state->out_mem_ctx;
7935 } else {
7936 mem_ctx = state;
7939 status = state->dispatch_recv(subreq, mem_ctx);
7940 TALLOC_FREE(subreq);
7941 if (!NT_STATUS_IS_OK(status)) {
7942 tevent_req_nterror(req, status);
7943 return;
7946 /* Copy out parameters */
7948 /* Copy result */
7949 state->orig.out.result = state->tmp.out.result;
7951 /* Reset temporary structure */
7952 ZERO_STRUCT(state->tmp);
7954 if (DEBUGLEVEL >= 10) {
7955 NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, &state->orig);
7958 tevent_req_done(req);
7961 NTSTATUS rpccli_spoolss_AddMonitor_recv(struct tevent_req *req,
7962 TALLOC_CTX *mem_ctx,
7963 WERROR *result)
7965 struct rpccli_spoolss_AddMonitor_state *state = tevent_req_data(
7966 req, struct rpccli_spoolss_AddMonitor_state);
7967 NTSTATUS status;
7969 if (tevent_req_is_nterror(req, &status)) {
7970 tevent_req_received(req);
7971 return status;
7974 /* Steal possbile out parameters to the callers context */
7975 talloc_steal(mem_ctx, state->out_mem_ctx);
7977 /* Return result */
7978 *result = state->orig.out.result;
7980 tevent_req_received(req);
7981 return NT_STATUS_OK;
7984 NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
7985 TALLOC_CTX *mem_ctx,
7986 WERROR *werror)
7988 struct spoolss_AddMonitor r;
7989 NTSTATUS status;
7991 /* In parameters */
7993 if (DEBUGLEVEL >= 10) {
7994 NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, &r);
7997 status = cli->dispatch(cli,
7998 mem_ctx,
7999 &ndr_table_spoolss,
8000 NDR_SPOOLSS_ADDMONITOR,
8001 &r);
8003 if (!NT_STATUS_IS_OK(status)) {
8004 return status;
8007 if (DEBUGLEVEL >= 10) {
8008 NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, &r);
8011 if (NT_STATUS_IS_ERR(status)) {
8012 return status;
8015 /* Return variables */
8017 /* Return result */
8018 if (werror) {
8019 *werror = r.out.result;
8022 return werror_to_ntstatus(r.out.result);
8025 struct rpccli_spoolss_DeleteMonitor_state {
8026 struct spoolss_DeleteMonitor orig;
8027 struct spoolss_DeleteMonitor tmp;
8028 TALLOC_CTX *out_mem_ctx;
8029 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8032 static void rpccli_spoolss_DeleteMonitor_done(struct tevent_req *subreq);
8034 struct tevent_req *rpccli_spoolss_DeleteMonitor_send(TALLOC_CTX *mem_ctx,
8035 struct tevent_context *ev,
8036 struct rpc_pipe_client *cli)
8038 struct tevent_req *req;
8039 struct rpccli_spoolss_DeleteMonitor_state *state;
8040 struct tevent_req *subreq;
8042 req = tevent_req_create(mem_ctx, &state,
8043 struct rpccli_spoolss_DeleteMonitor_state);
8044 if (req == NULL) {
8045 return NULL;
8047 state->out_mem_ctx = NULL;
8048 state->dispatch_recv = cli->dispatch_recv;
8050 /* In parameters */
8052 /* Out parameters */
8054 /* Result */
8055 ZERO_STRUCT(state->orig.out.result);
8057 if (DEBUGLEVEL >= 10) {
8058 NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, &state->orig);
8061 /* make a temporary copy, that we pass to the dispatch function */
8062 state->tmp = state->orig;
8064 subreq = cli->dispatch_send(state, ev, cli,
8065 &ndr_table_spoolss,
8066 NDR_SPOOLSS_DELETEMONITOR,
8067 &state->tmp);
8068 if (tevent_req_nomem(subreq, req)) {
8069 return tevent_req_post(req, ev);
8071 tevent_req_set_callback(subreq, rpccli_spoolss_DeleteMonitor_done, req);
8072 return req;
8075 static void rpccli_spoolss_DeleteMonitor_done(struct tevent_req *subreq)
8077 struct tevent_req *req = tevent_req_callback_data(
8078 subreq, struct tevent_req);
8079 struct rpccli_spoolss_DeleteMonitor_state *state = tevent_req_data(
8080 req, struct rpccli_spoolss_DeleteMonitor_state);
8081 NTSTATUS status;
8082 TALLOC_CTX *mem_ctx;
8084 if (state->out_mem_ctx) {
8085 mem_ctx = state->out_mem_ctx;
8086 } else {
8087 mem_ctx = state;
8090 status = state->dispatch_recv(subreq, mem_ctx);
8091 TALLOC_FREE(subreq);
8092 if (!NT_STATUS_IS_OK(status)) {
8093 tevent_req_nterror(req, status);
8094 return;
8097 /* Copy out parameters */
8099 /* Copy result */
8100 state->orig.out.result = state->tmp.out.result;
8102 /* Reset temporary structure */
8103 ZERO_STRUCT(state->tmp);
8105 if (DEBUGLEVEL >= 10) {
8106 NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, &state->orig);
8109 tevent_req_done(req);
8112 NTSTATUS rpccli_spoolss_DeleteMonitor_recv(struct tevent_req *req,
8113 TALLOC_CTX *mem_ctx,
8114 WERROR *result)
8116 struct rpccli_spoolss_DeleteMonitor_state *state = tevent_req_data(
8117 req, struct rpccli_spoolss_DeleteMonitor_state);
8118 NTSTATUS status;
8120 if (tevent_req_is_nterror(req, &status)) {
8121 tevent_req_received(req);
8122 return status;
8125 /* Steal possbile out parameters to the callers context */
8126 talloc_steal(mem_ctx, state->out_mem_ctx);
8128 /* Return result */
8129 *result = state->orig.out.result;
8131 tevent_req_received(req);
8132 return NT_STATUS_OK;
8135 NTSTATUS rpccli_spoolss_DeleteMonitor(struct rpc_pipe_client *cli,
8136 TALLOC_CTX *mem_ctx,
8137 WERROR *werror)
8139 struct spoolss_DeleteMonitor r;
8140 NTSTATUS status;
8142 /* In parameters */
8144 if (DEBUGLEVEL >= 10) {
8145 NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, &r);
8148 status = cli->dispatch(cli,
8149 mem_ctx,
8150 &ndr_table_spoolss,
8151 NDR_SPOOLSS_DELETEMONITOR,
8152 &r);
8154 if (!NT_STATUS_IS_OK(status)) {
8155 return status;
8158 if (DEBUGLEVEL >= 10) {
8159 NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, &r);
8162 if (NT_STATUS_IS_ERR(status)) {
8163 return status;
8166 /* Return variables */
8168 /* Return result */
8169 if (werror) {
8170 *werror = r.out.result;
8173 return werror_to_ntstatus(r.out.result);
8176 struct rpccli_spoolss_DeletePrintProcessor_state {
8177 struct spoolss_DeletePrintProcessor orig;
8178 struct spoolss_DeletePrintProcessor tmp;
8179 TALLOC_CTX *out_mem_ctx;
8180 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8183 static void rpccli_spoolss_DeletePrintProcessor_done(struct tevent_req *subreq);
8185 struct tevent_req *rpccli_spoolss_DeletePrintProcessor_send(TALLOC_CTX *mem_ctx,
8186 struct tevent_context *ev,
8187 struct rpc_pipe_client *cli)
8189 struct tevent_req *req;
8190 struct rpccli_spoolss_DeletePrintProcessor_state *state;
8191 struct tevent_req *subreq;
8193 req = tevent_req_create(mem_ctx, &state,
8194 struct rpccli_spoolss_DeletePrintProcessor_state);
8195 if (req == NULL) {
8196 return NULL;
8198 state->out_mem_ctx = NULL;
8199 state->dispatch_recv = cli->dispatch_recv;
8201 /* In parameters */
8203 /* Out parameters */
8205 /* Result */
8206 ZERO_STRUCT(state->orig.out.result);
8208 if (DEBUGLEVEL >= 10) {
8209 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, &state->orig);
8212 /* make a temporary copy, that we pass to the dispatch function */
8213 state->tmp = state->orig;
8215 subreq = cli->dispatch_send(state, ev, cli,
8216 &ndr_table_spoolss,
8217 NDR_SPOOLSS_DELETEPRINTPROCESSOR,
8218 &state->tmp);
8219 if (tevent_req_nomem(subreq, req)) {
8220 return tevent_req_post(req, ev);
8222 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrintProcessor_done, req);
8223 return req;
8226 static void rpccli_spoolss_DeletePrintProcessor_done(struct tevent_req *subreq)
8228 struct tevent_req *req = tevent_req_callback_data(
8229 subreq, struct tevent_req);
8230 struct rpccli_spoolss_DeletePrintProcessor_state *state = tevent_req_data(
8231 req, struct rpccli_spoolss_DeletePrintProcessor_state);
8232 NTSTATUS status;
8233 TALLOC_CTX *mem_ctx;
8235 if (state->out_mem_ctx) {
8236 mem_ctx = state->out_mem_ctx;
8237 } else {
8238 mem_ctx = state;
8241 status = state->dispatch_recv(subreq, mem_ctx);
8242 TALLOC_FREE(subreq);
8243 if (!NT_STATUS_IS_OK(status)) {
8244 tevent_req_nterror(req, status);
8245 return;
8248 /* Copy out parameters */
8250 /* Copy result */
8251 state->orig.out.result = state->tmp.out.result;
8253 /* Reset temporary structure */
8254 ZERO_STRUCT(state->tmp);
8256 if (DEBUGLEVEL >= 10) {
8257 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, &state->orig);
8260 tevent_req_done(req);
8263 NTSTATUS rpccli_spoolss_DeletePrintProcessor_recv(struct tevent_req *req,
8264 TALLOC_CTX *mem_ctx,
8265 WERROR *result)
8267 struct rpccli_spoolss_DeletePrintProcessor_state *state = tevent_req_data(
8268 req, struct rpccli_spoolss_DeletePrintProcessor_state);
8269 NTSTATUS status;
8271 if (tevent_req_is_nterror(req, &status)) {
8272 tevent_req_received(req);
8273 return status;
8276 /* Steal possbile out parameters to the callers context */
8277 talloc_steal(mem_ctx, state->out_mem_ctx);
8279 /* Return result */
8280 *result = state->orig.out.result;
8282 tevent_req_received(req);
8283 return NT_STATUS_OK;
8286 NTSTATUS rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client *cli,
8287 TALLOC_CTX *mem_ctx,
8288 WERROR *werror)
8290 struct spoolss_DeletePrintProcessor r;
8291 NTSTATUS status;
8293 /* In parameters */
8295 if (DEBUGLEVEL >= 10) {
8296 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, &r);
8299 status = cli->dispatch(cli,
8300 mem_ctx,
8301 &ndr_table_spoolss,
8302 NDR_SPOOLSS_DELETEPRINTPROCESSOR,
8303 &r);
8305 if (!NT_STATUS_IS_OK(status)) {
8306 return status;
8309 if (DEBUGLEVEL >= 10) {
8310 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, &r);
8313 if (NT_STATUS_IS_ERR(status)) {
8314 return status;
8317 /* Return variables */
8319 /* Return result */
8320 if (werror) {
8321 *werror = r.out.result;
8324 return werror_to_ntstatus(r.out.result);
8327 struct rpccli_spoolss_AddPrintProvidor_state {
8328 struct spoolss_AddPrintProvidor orig;
8329 struct spoolss_AddPrintProvidor tmp;
8330 TALLOC_CTX *out_mem_ctx;
8331 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8334 static void rpccli_spoolss_AddPrintProvidor_done(struct tevent_req *subreq);
8336 struct tevent_req *rpccli_spoolss_AddPrintProvidor_send(TALLOC_CTX *mem_ctx,
8337 struct tevent_context *ev,
8338 struct rpc_pipe_client *cli)
8340 struct tevent_req *req;
8341 struct rpccli_spoolss_AddPrintProvidor_state *state;
8342 struct tevent_req *subreq;
8344 req = tevent_req_create(mem_ctx, &state,
8345 struct rpccli_spoolss_AddPrintProvidor_state);
8346 if (req == NULL) {
8347 return NULL;
8349 state->out_mem_ctx = NULL;
8350 state->dispatch_recv = cli->dispatch_recv;
8352 /* In parameters */
8354 /* Out parameters */
8356 /* Result */
8357 ZERO_STRUCT(state->orig.out.result);
8359 if (DEBUGLEVEL >= 10) {
8360 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, &state->orig);
8363 /* make a temporary copy, that we pass to the dispatch function */
8364 state->tmp = state->orig;
8366 subreq = cli->dispatch_send(state, ev, cli,
8367 &ndr_table_spoolss,
8368 NDR_SPOOLSS_ADDPRINTPROVIDOR,
8369 &state->tmp);
8370 if (tevent_req_nomem(subreq, req)) {
8371 return tevent_req_post(req, ev);
8373 tevent_req_set_callback(subreq, rpccli_spoolss_AddPrintProvidor_done, req);
8374 return req;
8377 static void rpccli_spoolss_AddPrintProvidor_done(struct tevent_req *subreq)
8379 struct tevent_req *req = tevent_req_callback_data(
8380 subreq, struct tevent_req);
8381 struct rpccli_spoolss_AddPrintProvidor_state *state = tevent_req_data(
8382 req, struct rpccli_spoolss_AddPrintProvidor_state);
8383 NTSTATUS status;
8384 TALLOC_CTX *mem_ctx;
8386 if (state->out_mem_ctx) {
8387 mem_ctx = state->out_mem_ctx;
8388 } else {
8389 mem_ctx = state;
8392 status = state->dispatch_recv(subreq, mem_ctx);
8393 TALLOC_FREE(subreq);
8394 if (!NT_STATUS_IS_OK(status)) {
8395 tevent_req_nterror(req, status);
8396 return;
8399 /* Copy out parameters */
8401 /* Copy result */
8402 state->orig.out.result = state->tmp.out.result;
8404 /* Reset temporary structure */
8405 ZERO_STRUCT(state->tmp);
8407 if (DEBUGLEVEL >= 10) {
8408 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, &state->orig);
8411 tevent_req_done(req);
8414 NTSTATUS rpccli_spoolss_AddPrintProvidor_recv(struct tevent_req *req,
8415 TALLOC_CTX *mem_ctx,
8416 WERROR *result)
8418 struct rpccli_spoolss_AddPrintProvidor_state *state = tevent_req_data(
8419 req, struct rpccli_spoolss_AddPrintProvidor_state);
8420 NTSTATUS status;
8422 if (tevent_req_is_nterror(req, &status)) {
8423 tevent_req_received(req);
8424 return status;
8427 /* Steal possbile out parameters to the callers context */
8428 talloc_steal(mem_ctx, state->out_mem_ctx);
8430 /* Return result */
8431 *result = state->orig.out.result;
8433 tevent_req_received(req);
8434 return NT_STATUS_OK;
8437 NTSTATUS rpccli_spoolss_AddPrintProvidor(struct rpc_pipe_client *cli,
8438 TALLOC_CTX *mem_ctx,
8439 WERROR *werror)
8441 struct spoolss_AddPrintProvidor r;
8442 NTSTATUS status;
8444 /* In parameters */
8446 if (DEBUGLEVEL >= 10) {
8447 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, &r);
8450 status = cli->dispatch(cli,
8451 mem_ctx,
8452 &ndr_table_spoolss,
8453 NDR_SPOOLSS_ADDPRINTPROVIDOR,
8454 &r);
8456 if (!NT_STATUS_IS_OK(status)) {
8457 return status;
8460 if (DEBUGLEVEL >= 10) {
8461 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, &r);
8464 if (NT_STATUS_IS_ERR(status)) {
8465 return status;
8468 /* Return variables */
8470 /* Return result */
8471 if (werror) {
8472 *werror = r.out.result;
8475 return werror_to_ntstatus(r.out.result);
8478 struct rpccli_spoolss_DeletePrintProvidor_state {
8479 struct spoolss_DeletePrintProvidor orig;
8480 struct spoolss_DeletePrintProvidor tmp;
8481 TALLOC_CTX *out_mem_ctx;
8482 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8485 static void rpccli_spoolss_DeletePrintProvidor_done(struct tevent_req *subreq);
8487 struct tevent_req *rpccli_spoolss_DeletePrintProvidor_send(TALLOC_CTX *mem_ctx,
8488 struct tevent_context *ev,
8489 struct rpc_pipe_client *cli)
8491 struct tevent_req *req;
8492 struct rpccli_spoolss_DeletePrintProvidor_state *state;
8493 struct tevent_req *subreq;
8495 req = tevent_req_create(mem_ctx, &state,
8496 struct rpccli_spoolss_DeletePrintProvidor_state);
8497 if (req == NULL) {
8498 return NULL;
8500 state->out_mem_ctx = NULL;
8501 state->dispatch_recv = cli->dispatch_recv;
8503 /* In parameters */
8505 /* Out parameters */
8507 /* Result */
8508 ZERO_STRUCT(state->orig.out.result);
8510 if (DEBUGLEVEL >= 10) {
8511 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, &state->orig);
8514 /* make a temporary copy, that we pass to the dispatch function */
8515 state->tmp = state->orig;
8517 subreq = cli->dispatch_send(state, ev, cli,
8518 &ndr_table_spoolss,
8519 NDR_SPOOLSS_DELETEPRINTPROVIDOR,
8520 &state->tmp);
8521 if (tevent_req_nomem(subreq, req)) {
8522 return tevent_req_post(req, ev);
8524 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrintProvidor_done, req);
8525 return req;
8528 static void rpccli_spoolss_DeletePrintProvidor_done(struct tevent_req *subreq)
8530 struct tevent_req *req = tevent_req_callback_data(
8531 subreq, struct tevent_req);
8532 struct rpccli_spoolss_DeletePrintProvidor_state *state = tevent_req_data(
8533 req, struct rpccli_spoolss_DeletePrintProvidor_state);
8534 NTSTATUS status;
8535 TALLOC_CTX *mem_ctx;
8537 if (state->out_mem_ctx) {
8538 mem_ctx = state->out_mem_ctx;
8539 } else {
8540 mem_ctx = state;
8543 status = state->dispatch_recv(subreq, mem_ctx);
8544 TALLOC_FREE(subreq);
8545 if (!NT_STATUS_IS_OK(status)) {
8546 tevent_req_nterror(req, status);
8547 return;
8550 /* Copy out parameters */
8552 /* Copy result */
8553 state->orig.out.result = state->tmp.out.result;
8555 /* Reset temporary structure */
8556 ZERO_STRUCT(state->tmp);
8558 if (DEBUGLEVEL >= 10) {
8559 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, &state->orig);
8562 tevent_req_done(req);
8565 NTSTATUS rpccli_spoolss_DeletePrintProvidor_recv(struct tevent_req *req,
8566 TALLOC_CTX *mem_ctx,
8567 WERROR *result)
8569 struct rpccli_spoolss_DeletePrintProvidor_state *state = tevent_req_data(
8570 req, struct rpccli_spoolss_DeletePrintProvidor_state);
8571 NTSTATUS status;
8573 if (tevent_req_is_nterror(req, &status)) {
8574 tevent_req_received(req);
8575 return status;
8578 /* Steal possbile out parameters to the callers context */
8579 talloc_steal(mem_ctx, state->out_mem_ctx);
8581 /* Return result */
8582 *result = state->orig.out.result;
8584 tevent_req_received(req);
8585 return NT_STATUS_OK;
8588 NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli,
8589 TALLOC_CTX *mem_ctx,
8590 WERROR *werror)
8592 struct spoolss_DeletePrintProvidor r;
8593 NTSTATUS status;
8595 /* In parameters */
8597 if (DEBUGLEVEL >= 10) {
8598 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, &r);
8601 status = cli->dispatch(cli,
8602 mem_ctx,
8603 &ndr_table_spoolss,
8604 NDR_SPOOLSS_DELETEPRINTPROVIDOR,
8605 &r);
8607 if (!NT_STATUS_IS_OK(status)) {
8608 return status;
8611 if (DEBUGLEVEL >= 10) {
8612 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, &r);
8615 if (NT_STATUS_IS_ERR(status)) {
8616 return status;
8619 /* Return variables */
8621 /* Return result */
8622 if (werror) {
8623 *werror = r.out.result;
8626 return werror_to_ntstatus(r.out.result);
8629 struct rpccli_spoolss_EnumPrintProcDataTypes_state {
8630 struct spoolss_EnumPrintProcDataTypes orig;
8631 struct spoolss_EnumPrintProcDataTypes tmp;
8632 TALLOC_CTX *out_mem_ctx;
8633 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8636 static void rpccli_spoolss_EnumPrintProcDataTypes_done(struct tevent_req *subreq);
8638 struct tevent_req *rpccli_spoolss_EnumPrintProcDataTypes_send(TALLOC_CTX *mem_ctx,
8639 struct tevent_context *ev,
8640 struct rpc_pipe_client *cli,
8641 const char *_servername /* [in] [unique,charset(UTF16)] */,
8642 const char *_print_processor_name /* [in] [unique,charset(UTF16)] */,
8643 uint32_t _level /* [in] */,
8644 DATA_BLOB *_buffer /* [in] [unique] */,
8645 uint32_t _offered /* [in] */,
8646 uint32_t *_count /* [out] [ref] */,
8647 union spoolss_PrintProcDataTypesInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
8648 uint32_t *_needed /* [out] [ref] */)
8650 struct tevent_req *req;
8651 struct rpccli_spoolss_EnumPrintProcDataTypes_state *state;
8652 struct tevent_req *subreq;
8654 req = tevent_req_create(mem_ctx, &state,
8655 struct rpccli_spoolss_EnumPrintProcDataTypes_state);
8656 if (req == NULL) {
8657 return NULL;
8659 state->out_mem_ctx = NULL;
8660 state->dispatch_recv = cli->dispatch_recv;
8662 /* In parameters */
8663 state->orig.in.servername = _servername;
8664 state->orig.in.print_processor_name = _print_processor_name;
8665 state->orig.in.level = _level;
8666 state->orig.in.buffer = _buffer;
8667 state->orig.in.offered = _offered;
8669 /* Out parameters */
8670 state->orig.out.count = _count;
8671 state->orig.out.info = _info;
8672 state->orig.out.needed = _needed;
8674 /* Result */
8675 ZERO_STRUCT(state->orig.out.result);
8677 if (DEBUGLEVEL >= 10) {
8678 NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, &state->orig);
8681 state->out_mem_ctx = talloc_named_const(state, 0,
8682 "rpccli_spoolss_EnumPrintProcDataTypes_out_memory");
8683 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8684 return tevent_req_post(req, ev);
8687 /* make a temporary copy, that we pass to the dispatch function */
8688 state->tmp = state->orig;
8690 subreq = cli->dispatch_send(state, ev, cli,
8691 &ndr_table_spoolss,
8692 NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
8693 &state->tmp);
8694 if (tevent_req_nomem(subreq, req)) {
8695 return tevent_req_post(req, ev);
8697 tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrintProcDataTypes_done, req);
8698 return req;
8701 static void rpccli_spoolss_EnumPrintProcDataTypes_done(struct tevent_req *subreq)
8703 struct tevent_req *req = tevent_req_callback_data(
8704 subreq, struct tevent_req);
8705 struct rpccli_spoolss_EnumPrintProcDataTypes_state *state = tevent_req_data(
8706 req, struct rpccli_spoolss_EnumPrintProcDataTypes_state);
8707 NTSTATUS status;
8708 TALLOC_CTX *mem_ctx;
8710 if (state->out_mem_ctx) {
8711 mem_ctx = state->out_mem_ctx;
8712 } else {
8713 mem_ctx = state;
8716 status = state->dispatch_recv(subreq, mem_ctx);
8717 TALLOC_FREE(subreq);
8718 if (!NT_STATUS_IS_OK(status)) {
8719 tevent_req_nterror(req, status);
8720 return;
8723 /* Copy out parameters */
8724 *state->orig.out.count = *state->tmp.out.count;
8725 *state->orig.out.info = *state->tmp.out.info;
8726 *state->orig.out.needed = *state->tmp.out.needed;
8728 /* Copy result */
8729 state->orig.out.result = state->tmp.out.result;
8731 /* Reset temporary structure */
8732 ZERO_STRUCT(state->tmp);
8734 if (DEBUGLEVEL >= 10) {
8735 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, &state->orig);
8738 tevent_req_done(req);
8741 NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes_recv(struct tevent_req *req,
8742 TALLOC_CTX *mem_ctx,
8743 WERROR *result)
8745 struct rpccli_spoolss_EnumPrintProcDataTypes_state *state = tevent_req_data(
8746 req, struct rpccli_spoolss_EnumPrintProcDataTypes_state);
8747 NTSTATUS status;
8749 if (tevent_req_is_nterror(req, &status)) {
8750 tevent_req_received(req);
8751 return status;
8754 /* Steal possbile out parameters to the callers context */
8755 talloc_steal(mem_ctx, state->out_mem_ctx);
8757 /* Return result */
8758 *result = state->orig.out.result;
8760 tevent_req_received(req);
8761 return NT_STATUS_OK;
8764 NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli,
8765 TALLOC_CTX *mem_ctx,
8766 const char *servername /* [in] [unique,charset(UTF16)] */,
8767 const char *print_processor_name /* [in] [unique,charset(UTF16)] */,
8768 uint32_t level /* [in] */,
8769 DATA_BLOB *buffer /* [in] [unique] */,
8770 uint32_t offered /* [in] */,
8771 uint32_t *count /* [out] [ref] */,
8772 union spoolss_PrintProcDataTypesInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
8773 uint32_t *needed /* [out] [ref] */,
8774 WERROR *werror)
8776 struct spoolss_EnumPrintProcDataTypes r;
8777 NTSTATUS status;
8779 /* In parameters */
8780 r.in.servername = servername;
8781 r.in.print_processor_name = print_processor_name;
8782 r.in.level = level;
8783 r.in.buffer = buffer;
8784 r.in.offered = offered;
8786 if (DEBUGLEVEL >= 10) {
8787 NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
8790 status = cli->dispatch(cli,
8791 mem_ctx,
8792 &ndr_table_spoolss,
8793 NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
8794 &r);
8796 if (!NT_STATUS_IS_OK(status)) {
8797 return status;
8800 if (DEBUGLEVEL >= 10) {
8801 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
8804 if (NT_STATUS_IS_ERR(status)) {
8805 return status;
8808 /* Return variables */
8809 *count = *r.out.count;
8810 *info = *r.out.info;
8811 *needed = *r.out.needed;
8813 /* Return result */
8814 if (werror) {
8815 *werror = r.out.result;
8818 return werror_to_ntstatus(r.out.result);
8821 struct rpccli_spoolss_ResetPrinter_state {
8822 struct spoolss_ResetPrinter orig;
8823 struct spoolss_ResetPrinter tmp;
8824 TALLOC_CTX *out_mem_ctx;
8825 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8828 static void rpccli_spoolss_ResetPrinter_done(struct tevent_req *subreq);
8830 struct tevent_req *rpccli_spoolss_ResetPrinter_send(TALLOC_CTX *mem_ctx,
8831 struct tevent_context *ev,
8832 struct rpc_pipe_client *cli,
8833 struct policy_handle *_handle /* [in] [ref] */,
8834 const char *_data_type /* [in] [unique,charset(UTF16)] */,
8835 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */)
8837 struct tevent_req *req;
8838 struct rpccli_spoolss_ResetPrinter_state *state;
8839 struct tevent_req *subreq;
8841 req = tevent_req_create(mem_ctx, &state,
8842 struct rpccli_spoolss_ResetPrinter_state);
8843 if (req == NULL) {
8844 return NULL;
8846 state->out_mem_ctx = NULL;
8847 state->dispatch_recv = cli->dispatch_recv;
8849 /* In parameters */
8850 state->orig.in.handle = _handle;
8851 state->orig.in.data_type = _data_type;
8852 state->orig.in.devmode_ctr = _devmode_ctr;
8854 /* Out parameters */
8856 /* Result */
8857 ZERO_STRUCT(state->orig.out.result);
8859 if (DEBUGLEVEL >= 10) {
8860 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, &state->orig);
8863 /* make a temporary copy, that we pass to the dispatch function */
8864 state->tmp = state->orig;
8866 subreq = cli->dispatch_send(state, ev, cli,
8867 &ndr_table_spoolss,
8868 NDR_SPOOLSS_RESETPRINTER,
8869 &state->tmp);
8870 if (tevent_req_nomem(subreq, req)) {
8871 return tevent_req_post(req, ev);
8873 tevent_req_set_callback(subreq, rpccli_spoolss_ResetPrinter_done, req);
8874 return req;
8877 static void rpccli_spoolss_ResetPrinter_done(struct tevent_req *subreq)
8879 struct tevent_req *req = tevent_req_callback_data(
8880 subreq, struct tevent_req);
8881 struct rpccli_spoolss_ResetPrinter_state *state = tevent_req_data(
8882 req, struct rpccli_spoolss_ResetPrinter_state);
8883 NTSTATUS status;
8884 TALLOC_CTX *mem_ctx;
8886 if (state->out_mem_ctx) {
8887 mem_ctx = state->out_mem_ctx;
8888 } else {
8889 mem_ctx = state;
8892 status = state->dispatch_recv(subreq, mem_ctx);
8893 TALLOC_FREE(subreq);
8894 if (!NT_STATUS_IS_OK(status)) {
8895 tevent_req_nterror(req, status);
8896 return;
8899 /* Copy out parameters */
8901 /* Copy result */
8902 state->orig.out.result = state->tmp.out.result;
8904 /* Reset temporary structure */
8905 ZERO_STRUCT(state->tmp);
8907 if (DEBUGLEVEL >= 10) {
8908 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, &state->orig);
8911 tevent_req_done(req);
8914 NTSTATUS rpccli_spoolss_ResetPrinter_recv(struct tevent_req *req,
8915 TALLOC_CTX *mem_ctx,
8916 WERROR *result)
8918 struct rpccli_spoolss_ResetPrinter_state *state = tevent_req_data(
8919 req, struct rpccli_spoolss_ResetPrinter_state);
8920 NTSTATUS status;
8922 if (tevent_req_is_nterror(req, &status)) {
8923 tevent_req_received(req);
8924 return status;
8927 /* Steal possbile out parameters to the callers context */
8928 talloc_steal(mem_ctx, state->out_mem_ctx);
8930 /* Return result */
8931 *result = state->orig.out.result;
8933 tevent_req_received(req);
8934 return NT_STATUS_OK;
8937 NTSTATUS rpccli_spoolss_ResetPrinter(struct rpc_pipe_client *cli,
8938 TALLOC_CTX *mem_ctx,
8939 struct policy_handle *handle /* [in] [ref] */,
8940 const char *data_type /* [in] [unique,charset(UTF16)] */,
8941 struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
8942 WERROR *werror)
8944 struct spoolss_ResetPrinter r;
8945 NTSTATUS status;
8947 /* In parameters */
8948 r.in.handle = handle;
8949 r.in.data_type = data_type;
8950 r.in.devmode_ctr = devmode_ctr;
8952 if (DEBUGLEVEL >= 10) {
8953 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, &r);
8956 status = cli->dispatch(cli,
8957 mem_ctx,
8958 &ndr_table_spoolss,
8959 NDR_SPOOLSS_RESETPRINTER,
8960 &r);
8962 if (!NT_STATUS_IS_OK(status)) {
8963 return status;
8966 if (DEBUGLEVEL >= 10) {
8967 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, &r);
8970 if (NT_STATUS_IS_ERR(status)) {
8971 return status;
8974 /* Return variables */
8976 /* Return result */
8977 if (werror) {
8978 *werror = r.out.result;
8981 return werror_to_ntstatus(r.out.result);
8984 struct rpccli_spoolss_GetPrinterDriver2_state {
8985 struct spoolss_GetPrinterDriver2 orig;
8986 struct spoolss_GetPrinterDriver2 tmp;
8987 TALLOC_CTX *out_mem_ctx;
8988 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8991 static void rpccli_spoolss_GetPrinterDriver2_done(struct tevent_req *subreq);
8993 struct tevent_req *rpccli_spoolss_GetPrinterDriver2_send(TALLOC_CTX *mem_ctx,
8994 struct tevent_context *ev,
8995 struct rpc_pipe_client *cli,
8996 struct policy_handle *_handle /* [in] [ref] */,
8997 const char *_architecture /* [in] [unique,charset(UTF16)] */,
8998 uint32_t _level /* [in] */,
8999 DATA_BLOB *_buffer /* [in] [unique] */,
9000 uint32_t _offered /* [in] */,
9001 uint32_t _client_major_version /* [in] */,
9002 uint32_t _client_minor_version /* [in] */,
9003 union spoolss_DriverInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
9004 uint32_t *_needed /* [out] [ref] */,
9005 uint32_t *_server_major_version /* [out] [ref] */,
9006 uint32_t *_server_minor_version /* [out] [ref] */)
9008 struct tevent_req *req;
9009 struct rpccli_spoolss_GetPrinterDriver2_state *state;
9010 struct tevent_req *subreq;
9012 req = tevent_req_create(mem_ctx, &state,
9013 struct rpccli_spoolss_GetPrinterDriver2_state);
9014 if (req == NULL) {
9015 return NULL;
9017 state->out_mem_ctx = NULL;
9018 state->dispatch_recv = cli->dispatch_recv;
9020 /* In parameters */
9021 state->orig.in.handle = _handle;
9022 state->orig.in.architecture = _architecture;
9023 state->orig.in.level = _level;
9024 state->orig.in.buffer = _buffer;
9025 state->orig.in.offered = _offered;
9026 state->orig.in.client_major_version = _client_major_version;
9027 state->orig.in.client_minor_version = _client_minor_version;
9029 /* Out parameters */
9030 state->orig.out.info = _info;
9031 state->orig.out.needed = _needed;
9032 state->orig.out.server_major_version = _server_major_version;
9033 state->orig.out.server_minor_version = _server_minor_version;
9035 /* Result */
9036 ZERO_STRUCT(state->orig.out.result);
9038 if (DEBUGLEVEL >= 10) {
9039 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, &state->orig);
9042 state->out_mem_ctx = talloc_named_const(state, 0,
9043 "rpccli_spoolss_GetPrinterDriver2_out_memory");
9044 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9045 return tevent_req_post(req, ev);
9048 /* make a temporary copy, that we pass to the dispatch function */
9049 state->tmp = state->orig;
9051 subreq = cli->dispatch_send(state, ev, cli,
9052 &ndr_table_spoolss,
9053 NDR_SPOOLSS_GETPRINTERDRIVER2,
9054 &state->tmp);
9055 if (tevent_req_nomem(subreq, req)) {
9056 return tevent_req_post(req, ev);
9058 tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterDriver2_done, req);
9059 return req;
9062 static void rpccli_spoolss_GetPrinterDriver2_done(struct tevent_req *subreq)
9064 struct tevent_req *req = tevent_req_callback_data(
9065 subreq, struct tevent_req);
9066 struct rpccli_spoolss_GetPrinterDriver2_state *state = tevent_req_data(
9067 req, struct rpccli_spoolss_GetPrinterDriver2_state);
9068 NTSTATUS status;
9069 TALLOC_CTX *mem_ctx;
9071 if (state->out_mem_ctx) {
9072 mem_ctx = state->out_mem_ctx;
9073 } else {
9074 mem_ctx = state;
9077 status = state->dispatch_recv(subreq, mem_ctx);
9078 TALLOC_FREE(subreq);
9079 if (!NT_STATUS_IS_OK(status)) {
9080 tevent_req_nterror(req, status);
9081 return;
9084 /* Copy out parameters */
9085 if (state->orig.out.info && state->tmp.out.info) {
9086 *state->orig.out.info = *state->tmp.out.info;
9088 *state->orig.out.needed = *state->tmp.out.needed;
9089 *state->orig.out.server_major_version = *state->tmp.out.server_major_version;
9090 *state->orig.out.server_minor_version = *state->tmp.out.server_minor_version;
9092 /* Copy result */
9093 state->orig.out.result = state->tmp.out.result;
9095 /* Reset temporary structure */
9096 ZERO_STRUCT(state->tmp);
9098 if (DEBUGLEVEL >= 10) {
9099 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, &state->orig);
9102 tevent_req_done(req);
9105 NTSTATUS rpccli_spoolss_GetPrinterDriver2_recv(struct tevent_req *req,
9106 TALLOC_CTX *mem_ctx,
9107 WERROR *result)
9109 struct rpccli_spoolss_GetPrinterDriver2_state *state = tevent_req_data(
9110 req, struct rpccli_spoolss_GetPrinterDriver2_state);
9111 NTSTATUS status;
9113 if (tevent_req_is_nterror(req, &status)) {
9114 tevent_req_received(req);
9115 return status;
9118 /* Steal possbile out parameters to the callers context */
9119 talloc_steal(mem_ctx, state->out_mem_ctx);
9121 /* Return result */
9122 *result = state->orig.out.result;
9124 tevent_req_received(req);
9125 return NT_STATUS_OK;
9128 NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
9129 TALLOC_CTX *mem_ctx,
9130 struct policy_handle *handle /* [in] [ref] */,
9131 const char *architecture /* [in] [unique,charset(UTF16)] */,
9132 uint32_t level /* [in] */,
9133 DATA_BLOB *buffer /* [in] [unique] */,
9134 uint32_t offered /* [in] */,
9135 uint32_t client_major_version /* [in] */,
9136 uint32_t client_minor_version /* [in] */,
9137 union spoolss_DriverInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
9138 uint32_t *needed /* [out] [ref] */,
9139 uint32_t *server_major_version /* [out] [ref] */,
9140 uint32_t *server_minor_version /* [out] [ref] */,
9141 WERROR *werror)
9143 struct spoolss_GetPrinterDriver2 r;
9144 NTSTATUS status;
9146 /* In parameters */
9147 r.in.handle = handle;
9148 r.in.architecture = architecture;
9149 r.in.level = level;
9150 r.in.buffer = buffer;
9151 r.in.offered = offered;
9152 r.in.client_major_version = client_major_version;
9153 r.in.client_minor_version = client_minor_version;
9155 if (DEBUGLEVEL >= 10) {
9156 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, &r);
9159 status = cli->dispatch(cli,
9160 mem_ctx,
9161 &ndr_table_spoolss,
9162 NDR_SPOOLSS_GETPRINTERDRIVER2,
9163 &r);
9165 if (!NT_STATUS_IS_OK(status)) {
9166 return status;
9169 if (DEBUGLEVEL >= 10) {
9170 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, &r);
9173 if (NT_STATUS_IS_ERR(status)) {
9174 return status;
9177 /* Return variables */
9178 if (info && r.out.info) {
9179 *info = *r.out.info;
9181 *needed = *r.out.needed;
9182 *server_major_version = *r.out.server_major_version;
9183 *server_minor_version = *r.out.server_minor_version;
9185 /* Return result */
9186 if (werror) {
9187 *werror = r.out.result;
9190 return werror_to_ntstatus(r.out.result);
9193 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state {
9194 struct spoolss_FindFirstPrinterChangeNotification orig;
9195 struct spoolss_FindFirstPrinterChangeNotification tmp;
9196 TALLOC_CTX *out_mem_ctx;
9197 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9200 static void rpccli_spoolss_FindFirstPrinterChangeNotification_done(struct tevent_req *subreq);
9202 struct tevent_req *rpccli_spoolss_FindFirstPrinterChangeNotification_send(TALLOC_CTX *mem_ctx,
9203 struct tevent_context *ev,
9204 struct rpc_pipe_client *cli)
9206 struct tevent_req *req;
9207 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state *state;
9208 struct tevent_req *subreq;
9210 req = tevent_req_create(mem_ctx, &state,
9211 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state);
9212 if (req == NULL) {
9213 return NULL;
9215 state->out_mem_ctx = NULL;
9216 state->dispatch_recv = cli->dispatch_recv;
9218 /* In parameters */
9220 /* Out parameters */
9222 /* Result */
9223 ZERO_STRUCT(state->orig.out.result);
9225 if (DEBUGLEVEL >= 10) {
9226 NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, &state->orig);
9229 /* make a temporary copy, that we pass to the dispatch function */
9230 state->tmp = state->orig;
9232 subreq = cli->dispatch_send(state, ev, cli,
9233 &ndr_table_spoolss,
9234 NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
9235 &state->tmp);
9236 if (tevent_req_nomem(subreq, req)) {
9237 return tevent_req_post(req, ev);
9239 tevent_req_set_callback(subreq, rpccli_spoolss_FindFirstPrinterChangeNotification_done, req);
9240 return req;
9243 static void rpccli_spoolss_FindFirstPrinterChangeNotification_done(struct tevent_req *subreq)
9245 struct tevent_req *req = tevent_req_callback_data(
9246 subreq, struct tevent_req);
9247 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state *state = tevent_req_data(
9248 req, struct rpccli_spoolss_FindFirstPrinterChangeNotification_state);
9249 NTSTATUS status;
9250 TALLOC_CTX *mem_ctx;
9252 if (state->out_mem_ctx) {
9253 mem_ctx = state->out_mem_ctx;
9254 } else {
9255 mem_ctx = state;
9258 status = state->dispatch_recv(subreq, mem_ctx);
9259 TALLOC_FREE(subreq);
9260 if (!NT_STATUS_IS_OK(status)) {
9261 tevent_req_nterror(req, status);
9262 return;
9265 /* Copy out parameters */
9267 /* Copy result */
9268 state->orig.out.result = state->tmp.out.result;
9270 /* Reset temporary structure */
9271 ZERO_STRUCT(state->tmp);
9273 if (DEBUGLEVEL >= 10) {
9274 NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, &state->orig);
9277 tevent_req_done(req);
9280 NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification_recv(struct tevent_req *req,
9281 TALLOC_CTX *mem_ctx,
9282 WERROR *result)
9284 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state *state = tevent_req_data(
9285 req, struct rpccli_spoolss_FindFirstPrinterChangeNotification_state);
9286 NTSTATUS status;
9288 if (tevent_req_is_nterror(req, &status)) {
9289 tevent_req_received(req);
9290 return status;
9293 /* Steal possbile out parameters to the callers context */
9294 talloc_steal(mem_ctx, state->out_mem_ctx);
9296 /* Return result */
9297 *result = state->orig.out.result;
9299 tevent_req_received(req);
9300 return NT_STATUS_OK;
9303 NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
9304 TALLOC_CTX *mem_ctx,
9305 WERROR *werror)
9307 struct spoolss_FindFirstPrinterChangeNotification r;
9308 NTSTATUS status;
9310 /* In parameters */
9312 if (DEBUGLEVEL >= 10) {
9313 NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
9316 status = cli->dispatch(cli,
9317 mem_ctx,
9318 &ndr_table_spoolss,
9319 NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
9320 &r);
9322 if (!NT_STATUS_IS_OK(status)) {
9323 return status;
9326 if (DEBUGLEVEL >= 10) {
9327 NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
9330 if (NT_STATUS_IS_ERR(status)) {
9331 return status;
9334 /* Return variables */
9336 /* Return result */
9337 if (werror) {
9338 *werror = r.out.result;
9341 return werror_to_ntstatus(r.out.result);
9344 struct rpccli_spoolss_FindNextPrinterChangeNotification_state {
9345 struct spoolss_FindNextPrinterChangeNotification orig;
9346 struct spoolss_FindNextPrinterChangeNotification tmp;
9347 TALLOC_CTX *out_mem_ctx;
9348 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9351 static void rpccli_spoolss_FindNextPrinterChangeNotification_done(struct tevent_req *subreq);
9353 struct tevent_req *rpccli_spoolss_FindNextPrinterChangeNotification_send(TALLOC_CTX *mem_ctx,
9354 struct tevent_context *ev,
9355 struct rpc_pipe_client *cli)
9357 struct tevent_req *req;
9358 struct rpccli_spoolss_FindNextPrinterChangeNotification_state *state;
9359 struct tevent_req *subreq;
9361 req = tevent_req_create(mem_ctx, &state,
9362 struct rpccli_spoolss_FindNextPrinterChangeNotification_state);
9363 if (req == NULL) {
9364 return NULL;
9366 state->out_mem_ctx = NULL;
9367 state->dispatch_recv = cli->dispatch_recv;
9369 /* In parameters */
9371 /* Out parameters */
9373 /* Result */
9374 ZERO_STRUCT(state->orig.out.result);
9376 if (DEBUGLEVEL >= 10) {
9377 NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, &state->orig);
9380 /* make a temporary copy, that we pass to the dispatch function */
9381 state->tmp = state->orig;
9383 subreq = cli->dispatch_send(state, ev, cli,
9384 &ndr_table_spoolss,
9385 NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
9386 &state->tmp);
9387 if (tevent_req_nomem(subreq, req)) {
9388 return tevent_req_post(req, ev);
9390 tevent_req_set_callback(subreq, rpccli_spoolss_FindNextPrinterChangeNotification_done, req);
9391 return req;
9394 static void rpccli_spoolss_FindNextPrinterChangeNotification_done(struct tevent_req *subreq)
9396 struct tevent_req *req = tevent_req_callback_data(
9397 subreq, struct tevent_req);
9398 struct rpccli_spoolss_FindNextPrinterChangeNotification_state *state = tevent_req_data(
9399 req, struct rpccli_spoolss_FindNextPrinterChangeNotification_state);
9400 NTSTATUS status;
9401 TALLOC_CTX *mem_ctx;
9403 if (state->out_mem_ctx) {
9404 mem_ctx = state->out_mem_ctx;
9405 } else {
9406 mem_ctx = state;
9409 status = state->dispatch_recv(subreq, mem_ctx);
9410 TALLOC_FREE(subreq);
9411 if (!NT_STATUS_IS_OK(status)) {
9412 tevent_req_nterror(req, status);
9413 return;
9416 /* Copy out parameters */
9418 /* Copy result */
9419 state->orig.out.result = state->tmp.out.result;
9421 /* Reset temporary structure */
9422 ZERO_STRUCT(state->tmp);
9424 if (DEBUGLEVEL >= 10) {
9425 NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, &state->orig);
9428 tevent_req_done(req);
9431 NTSTATUS rpccli_spoolss_FindNextPrinterChangeNotification_recv(struct tevent_req *req,
9432 TALLOC_CTX *mem_ctx,
9433 WERROR *result)
9435 struct rpccli_spoolss_FindNextPrinterChangeNotification_state *state = tevent_req_data(
9436 req, struct rpccli_spoolss_FindNextPrinterChangeNotification_state);
9437 NTSTATUS status;
9439 if (tevent_req_is_nterror(req, &status)) {
9440 tevent_req_received(req);
9441 return status;
9444 /* Steal possbile out parameters to the callers context */
9445 talloc_steal(mem_ctx, state->out_mem_ctx);
9447 /* Return result */
9448 *result = state->orig.out.result;
9450 tevent_req_received(req);
9451 return NT_STATUS_OK;
9454 NTSTATUS rpccli_spoolss_FindNextPrinterChangeNotification(struct rpc_pipe_client *cli,
9455 TALLOC_CTX *mem_ctx,
9456 WERROR *werror)
9458 struct spoolss_FindNextPrinterChangeNotification r;
9459 NTSTATUS status;
9461 /* In parameters */
9463 if (DEBUGLEVEL >= 10) {
9464 NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
9467 status = cli->dispatch(cli,
9468 mem_ctx,
9469 &ndr_table_spoolss,
9470 NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
9471 &r);
9473 if (!NT_STATUS_IS_OK(status)) {
9474 return status;
9477 if (DEBUGLEVEL >= 10) {
9478 NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
9481 if (NT_STATUS_IS_ERR(status)) {
9482 return status;
9485 /* Return variables */
9487 /* Return result */
9488 if (werror) {
9489 *werror = r.out.result;
9492 return werror_to_ntstatus(r.out.result);
9495 struct rpccli_spoolss_FindClosePrinterNotify_state {
9496 struct spoolss_FindClosePrinterNotify orig;
9497 struct spoolss_FindClosePrinterNotify tmp;
9498 TALLOC_CTX *out_mem_ctx;
9499 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9502 static void rpccli_spoolss_FindClosePrinterNotify_done(struct tevent_req *subreq);
9504 struct tevent_req *rpccli_spoolss_FindClosePrinterNotify_send(TALLOC_CTX *mem_ctx,
9505 struct tevent_context *ev,
9506 struct rpc_pipe_client *cli,
9507 struct policy_handle *_handle /* [in] [ref] */)
9509 struct tevent_req *req;
9510 struct rpccli_spoolss_FindClosePrinterNotify_state *state;
9511 struct tevent_req *subreq;
9513 req = tevent_req_create(mem_ctx, &state,
9514 struct rpccli_spoolss_FindClosePrinterNotify_state);
9515 if (req == NULL) {
9516 return NULL;
9518 state->out_mem_ctx = NULL;
9519 state->dispatch_recv = cli->dispatch_recv;
9521 /* In parameters */
9522 state->orig.in.handle = _handle;
9524 /* Out parameters */
9526 /* Result */
9527 ZERO_STRUCT(state->orig.out.result);
9529 if (DEBUGLEVEL >= 10) {
9530 NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, &state->orig);
9533 /* make a temporary copy, that we pass to the dispatch function */
9534 state->tmp = state->orig;
9536 subreq = cli->dispatch_send(state, ev, cli,
9537 &ndr_table_spoolss,
9538 NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
9539 &state->tmp);
9540 if (tevent_req_nomem(subreq, req)) {
9541 return tevent_req_post(req, ev);
9543 tevent_req_set_callback(subreq, rpccli_spoolss_FindClosePrinterNotify_done, req);
9544 return req;
9547 static void rpccli_spoolss_FindClosePrinterNotify_done(struct tevent_req *subreq)
9549 struct tevent_req *req = tevent_req_callback_data(
9550 subreq, struct tevent_req);
9551 struct rpccli_spoolss_FindClosePrinterNotify_state *state = tevent_req_data(
9552 req, struct rpccli_spoolss_FindClosePrinterNotify_state);
9553 NTSTATUS status;
9554 TALLOC_CTX *mem_ctx;
9556 if (state->out_mem_ctx) {
9557 mem_ctx = state->out_mem_ctx;
9558 } else {
9559 mem_ctx = state;
9562 status = state->dispatch_recv(subreq, mem_ctx);
9563 TALLOC_FREE(subreq);
9564 if (!NT_STATUS_IS_OK(status)) {
9565 tevent_req_nterror(req, status);
9566 return;
9569 /* Copy out parameters */
9571 /* Copy result */
9572 state->orig.out.result = state->tmp.out.result;
9574 /* Reset temporary structure */
9575 ZERO_STRUCT(state->tmp);
9577 if (DEBUGLEVEL >= 10) {
9578 NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, &state->orig);
9581 tevent_req_done(req);
9584 NTSTATUS rpccli_spoolss_FindClosePrinterNotify_recv(struct tevent_req *req,
9585 TALLOC_CTX *mem_ctx,
9586 WERROR *result)
9588 struct rpccli_spoolss_FindClosePrinterNotify_state *state = tevent_req_data(
9589 req, struct rpccli_spoolss_FindClosePrinterNotify_state);
9590 NTSTATUS status;
9592 if (tevent_req_is_nterror(req, &status)) {
9593 tevent_req_received(req);
9594 return status;
9597 /* Steal possbile out parameters to the callers context */
9598 talloc_steal(mem_ctx, state->out_mem_ctx);
9600 /* Return result */
9601 *result = state->orig.out.result;
9603 tevent_req_received(req);
9604 return NT_STATUS_OK;
9607 NTSTATUS rpccli_spoolss_FindClosePrinterNotify(struct rpc_pipe_client *cli,
9608 TALLOC_CTX *mem_ctx,
9609 struct policy_handle *handle /* [in] [ref] */,
9610 WERROR *werror)
9612 struct spoolss_FindClosePrinterNotify r;
9613 NTSTATUS status;
9615 /* In parameters */
9616 r.in.handle = handle;
9618 if (DEBUGLEVEL >= 10) {
9619 NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, &r);
9622 status = cli->dispatch(cli,
9623 mem_ctx,
9624 &ndr_table_spoolss,
9625 NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
9626 &r);
9628 if (!NT_STATUS_IS_OK(status)) {
9629 return status;
9632 if (DEBUGLEVEL >= 10) {
9633 NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, &r);
9636 if (NT_STATUS_IS_ERR(status)) {
9637 return status;
9640 /* Return variables */
9642 /* Return result */
9643 if (werror) {
9644 *werror = r.out.result;
9647 return werror_to_ntstatus(r.out.result);
9650 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state {
9651 struct spoolss_RouterFindFirstPrinterChangeNotificationOld orig;
9652 struct spoolss_RouterFindFirstPrinterChangeNotificationOld tmp;
9653 TALLOC_CTX *out_mem_ctx;
9654 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9657 static void rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_done(struct tevent_req *subreq);
9659 struct tevent_req *rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_send(TALLOC_CTX *mem_ctx,
9660 struct tevent_context *ev,
9661 struct rpc_pipe_client *cli)
9663 struct tevent_req *req;
9664 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state *state;
9665 struct tevent_req *subreq;
9667 req = tevent_req_create(mem_ctx, &state,
9668 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state);
9669 if (req == NULL) {
9670 return NULL;
9672 state->out_mem_ctx = NULL;
9673 state->dispatch_recv = cli->dispatch_recv;
9675 /* In parameters */
9677 /* Out parameters */
9679 /* Result */
9680 ZERO_STRUCT(state->orig.out.result);
9682 if (DEBUGLEVEL >= 10) {
9683 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &state->orig);
9686 /* make a temporary copy, that we pass to the dispatch function */
9687 state->tmp = state->orig;
9689 subreq = cli->dispatch_send(state, ev, cli,
9690 &ndr_table_spoolss,
9691 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
9692 &state->tmp);
9693 if (tevent_req_nomem(subreq, req)) {
9694 return tevent_req_post(req, ev);
9696 tevent_req_set_callback(subreq, rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_done, req);
9697 return req;
9700 static void rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_done(struct tevent_req *subreq)
9702 struct tevent_req *req = tevent_req_callback_data(
9703 subreq, struct tevent_req);
9704 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state *state = tevent_req_data(
9705 req, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state);
9706 NTSTATUS status;
9707 TALLOC_CTX *mem_ctx;
9709 if (state->out_mem_ctx) {
9710 mem_ctx = state->out_mem_ctx;
9711 } else {
9712 mem_ctx = state;
9715 status = state->dispatch_recv(subreq, mem_ctx);
9716 TALLOC_FREE(subreq);
9717 if (!NT_STATUS_IS_OK(status)) {
9718 tevent_req_nterror(req, status);
9719 return;
9722 /* Copy out parameters */
9724 /* Copy result */
9725 state->orig.out.result = state->tmp.out.result;
9727 /* Reset temporary structure */
9728 ZERO_STRUCT(state->tmp);
9730 if (DEBUGLEVEL >= 10) {
9731 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &state->orig);
9734 tevent_req_done(req);
9737 NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_recv(struct tevent_req *req,
9738 TALLOC_CTX *mem_ctx,
9739 WERROR *result)
9741 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state *state = tevent_req_data(
9742 req, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state);
9743 NTSTATUS status;
9745 if (tevent_req_is_nterror(req, &status)) {
9746 tevent_req_received(req);
9747 return status;
9750 /* Steal possbile out parameters to the callers context */
9751 talloc_steal(mem_ctx, state->out_mem_ctx);
9753 /* Return result */
9754 *result = state->orig.out.result;
9756 tevent_req_received(req);
9757 return NT_STATUS_OK;
9760 NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld(struct rpc_pipe_client *cli,
9761 TALLOC_CTX *mem_ctx,
9762 WERROR *werror)
9764 struct spoolss_RouterFindFirstPrinterChangeNotificationOld r;
9765 NTSTATUS status;
9767 /* In parameters */
9769 if (DEBUGLEVEL >= 10) {
9770 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
9773 status = cli->dispatch(cli,
9774 mem_ctx,
9775 &ndr_table_spoolss,
9776 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
9777 &r);
9779 if (!NT_STATUS_IS_OK(status)) {
9780 return status;
9783 if (DEBUGLEVEL >= 10) {
9784 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
9787 if (NT_STATUS_IS_ERR(status)) {
9788 return status;
9791 /* Return variables */
9793 /* Return result */
9794 if (werror) {
9795 *werror = r.out.result;
9798 return werror_to_ntstatus(r.out.result);
9801 struct rpccli_spoolss_ReplyOpenPrinter_state {
9802 struct spoolss_ReplyOpenPrinter orig;
9803 struct spoolss_ReplyOpenPrinter tmp;
9804 TALLOC_CTX *out_mem_ctx;
9805 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9808 static void rpccli_spoolss_ReplyOpenPrinter_done(struct tevent_req *subreq);
9810 struct tevent_req *rpccli_spoolss_ReplyOpenPrinter_send(TALLOC_CTX *mem_ctx,
9811 struct tevent_context *ev,
9812 struct rpc_pipe_client *cli,
9813 const char *_server_name /* [in] [charset(UTF16)] */,
9814 uint32_t _printer_local /* [in] */,
9815 enum winreg_Type _type /* [in] */,
9816 uint32_t _bufsize /* [in] [range(0,512)] */,
9817 uint8_t *_buffer /* [in] [unique,size_is(bufsize)] */,
9818 struct policy_handle *_handle /* [out] [ref] */)
9820 struct tevent_req *req;
9821 struct rpccli_spoolss_ReplyOpenPrinter_state *state;
9822 struct tevent_req *subreq;
9824 req = tevent_req_create(mem_ctx, &state,
9825 struct rpccli_spoolss_ReplyOpenPrinter_state);
9826 if (req == NULL) {
9827 return NULL;
9829 state->out_mem_ctx = NULL;
9830 state->dispatch_recv = cli->dispatch_recv;
9832 /* In parameters */
9833 state->orig.in.server_name = _server_name;
9834 state->orig.in.printer_local = _printer_local;
9835 state->orig.in.type = _type;
9836 state->orig.in.bufsize = _bufsize;
9837 state->orig.in.buffer = _buffer;
9839 /* Out parameters */
9840 state->orig.out.handle = _handle;
9842 /* Result */
9843 ZERO_STRUCT(state->orig.out.result);
9845 if (DEBUGLEVEL >= 10) {
9846 NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, &state->orig);
9849 state->out_mem_ctx = talloc_named_const(state, 0,
9850 "rpccli_spoolss_ReplyOpenPrinter_out_memory");
9851 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9852 return tevent_req_post(req, ev);
9855 /* make a temporary copy, that we pass to the dispatch function */
9856 state->tmp = state->orig;
9858 subreq = cli->dispatch_send(state, ev, cli,
9859 &ndr_table_spoolss,
9860 NDR_SPOOLSS_REPLYOPENPRINTER,
9861 &state->tmp);
9862 if (tevent_req_nomem(subreq, req)) {
9863 return tevent_req_post(req, ev);
9865 tevent_req_set_callback(subreq, rpccli_spoolss_ReplyOpenPrinter_done, req);
9866 return req;
9869 static void rpccli_spoolss_ReplyOpenPrinter_done(struct tevent_req *subreq)
9871 struct tevent_req *req = tevent_req_callback_data(
9872 subreq, struct tevent_req);
9873 struct rpccli_spoolss_ReplyOpenPrinter_state *state = tevent_req_data(
9874 req, struct rpccli_spoolss_ReplyOpenPrinter_state);
9875 NTSTATUS status;
9876 TALLOC_CTX *mem_ctx;
9878 if (state->out_mem_ctx) {
9879 mem_ctx = state->out_mem_ctx;
9880 } else {
9881 mem_ctx = state;
9884 status = state->dispatch_recv(subreq, mem_ctx);
9885 TALLOC_FREE(subreq);
9886 if (!NT_STATUS_IS_OK(status)) {
9887 tevent_req_nterror(req, status);
9888 return;
9891 /* Copy out parameters */
9892 *state->orig.out.handle = *state->tmp.out.handle;
9894 /* Copy result */
9895 state->orig.out.result = state->tmp.out.result;
9897 /* Reset temporary structure */
9898 ZERO_STRUCT(state->tmp);
9900 if (DEBUGLEVEL >= 10) {
9901 NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, &state->orig);
9904 tevent_req_done(req);
9907 NTSTATUS rpccli_spoolss_ReplyOpenPrinter_recv(struct tevent_req *req,
9908 TALLOC_CTX *mem_ctx,
9909 WERROR *result)
9911 struct rpccli_spoolss_ReplyOpenPrinter_state *state = tevent_req_data(
9912 req, struct rpccli_spoolss_ReplyOpenPrinter_state);
9913 NTSTATUS status;
9915 if (tevent_req_is_nterror(req, &status)) {
9916 tevent_req_received(req);
9917 return status;
9920 /* Steal possbile out parameters to the callers context */
9921 talloc_steal(mem_ctx, state->out_mem_ctx);
9923 /* Return result */
9924 *result = state->orig.out.result;
9926 tevent_req_received(req);
9927 return NT_STATUS_OK;
9930 NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
9931 TALLOC_CTX *mem_ctx,
9932 const char *server_name /* [in] [charset(UTF16)] */,
9933 uint32_t printer_local /* [in] */,
9934 enum winreg_Type type /* [in] */,
9935 uint32_t bufsize /* [in] [range(0,512)] */,
9936 uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
9937 struct policy_handle *handle /* [out] [ref] */,
9938 WERROR *werror)
9940 struct spoolss_ReplyOpenPrinter r;
9941 NTSTATUS status;
9943 /* In parameters */
9944 r.in.server_name = server_name;
9945 r.in.printer_local = printer_local;
9946 r.in.type = type;
9947 r.in.bufsize = bufsize;
9948 r.in.buffer = buffer;
9950 if (DEBUGLEVEL >= 10) {
9951 NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, &r);
9954 status = cli->dispatch(cli,
9955 mem_ctx,
9956 &ndr_table_spoolss,
9957 NDR_SPOOLSS_REPLYOPENPRINTER,
9958 &r);
9960 if (!NT_STATUS_IS_OK(status)) {
9961 return status;
9964 if (DEBUGLEVEL >= 10) {
9965 NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, &r);
9968 if (NT_STATUS_IS_ERR(status)) {
9969 return status;
9972 /* Return variables */
9973 *handle = *r.out.handle;
9975 /* Return result */
9976 if (werror) {
9977 *werror = r.out.result;
9980 return werror_to_ntstatus(r.out.result);
9983 struct rpccli_spoolss_RouterReplyPrinter_state {
9984 struct spoolss_RouterReplyPrinter orig;
9985 struct spoolss_RouterReplyPrinter tmp;
9986 TALLOC_CTX *out_mem_ctx;
9987 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9990 static void rpccli_spoolss_RouterReplyPrinter_done(struct tevent_req *subreq);
9992 struct tevent_req *rpccli_spoolss_RouterReplyPrinter_send(TALLOC_CTX *mem_ctx,
9993 struct tevent_context *ev,
9994 struct rpc_pipe_client *cli,
9995 struct policy_handle *_handle /* [in] [ref] */,
9996 uint32_t _flags /* [in] */,
9997 uint32_t _bufsize /* [in] [range(0,512)] */,
9998 uint8_t *_buffer /* [in] [unique,size_is(bufsize)] */)
10000 struct tevent_req *req;
10001 struct rpccli_spoolss_RouterReplyPrinter_state *state;
10002 struct tevent_req *subreq;
10004 req = tevent_req_create(mem_ctx, &state,
10005 struct rpccli_spoolss_RouterReplyPrinter_state);
10006 if (req == NULL) {
10007 return NULL;
10009 state->out_mem_ctx = NULL;
10010 state->dispatch_recv = cli->dispatch_recv;
10012 /* In parameters */
10013 state->orig.in.handle = _handle;
10014 state->orig.in.flags = _flags;
10015 state->orig.in.bufsize = _bufsize;
10016 state->orig.in.buffer = _buffer;
10018 /* Out parameters */
10020 /* Result */
10021 ZERO_STRUCT(state->orig.out.result);
10023 if (DEBUGLEVEL >= 10) {
10024 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &state->orig);
10027 /* make a temporary copy, that we pass to the dispatch function */
10028 state->tmp = state->orig;
10030 subreq = cli->dispatch_send(state, ev, cli,
10031 &ndr_table_spoolss,
10032 NDR_SPOOLSS_ROUTERREPLYPRINTER,
10033 &state->tmp);
10034 if (tevent_req_nomem(subreq, req)) {
10035 return tevent_req_post(req, ev);
10037 tevent_req_set_callback(subreq, rpccli_spoolss_RouterReplyPrinter_done, req);
10038 return req;
10041 static void rpccli_spoolss_RouterReplyPrinter_done(struct tevent_req *subreq)
10043 struct tevent_req *req = tevent_req_callback_data(
10044 subreq, struct tevent_req);
10045 struct rpccli_spoolss_RouterReplyPrinter_state *state = tevent_req_data(
10046 req, struct rpccli_spoolss_RouterReplyPrinter_state);
10047 NTSTATUS status;
10048 TALLOC_CTX *mem_ctx;
10050 if (state->out_mem_ctx) {
10051 mem_ctx = state->out_mem_ctx;
10052 } else {
10053 mem_ctx = state;
10056 status = state->dispatch_recv(subreq, mem_ctx);
10057 TALLOC_FREE(subreq);
10058 if (!NT_STATUS_IS_OK(status)) {
10059 tevent_req_nterror(req, status);
10060 return;
10063 /* Copy out parameters */
10065 /* Copy result */
10066 state->orig.out.result = state->tmp.out.result;
10068 /* Reset temporary structure */
10069 ZERO_STRUCT(state->tmp);
10071 if (DEBUGLEVEL >= 10) {
10072 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, &state->orig);
10075 tevent_req_done(req);
10078 NTSTATUS rpccli_spoolss_RouterReplyPrinter_recv(struct tevent_req *req,
10079 TALLOC_CTX *mem_ctx,
10080 WERROR *result)
10082 struct rpccli_spoolss_RouterReplyPrinter_state *state = tevent_req_data(
10083 req, struct rpccli_spoolss_RouterReplyPrinter_state);
10084 NTSTATUS status;
10086 if (tevent_req_is_nterror(req, &status)) {
10087 tevent_req_received(req);
10088 return status;
10091 /* Steal possbile out parameters to the callers context */
10092 talloc_steal(mem_ctx, state->out_mem_ctx);
10094 /* Return result */
10095 *result = state->orig.out.result;
10097 tevent_req_received(req);
10098 return NT_STATUS_OK;
10101 NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
10102 TALLOC_CTX *mem_ctx,
10103 struct policy_handle *handle /* [in] [ref] */,
10104 uint32_t flags /* [in] */,
10105 uint32_t bufsize /* [in] [range(0,512)] */,
10106 uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
10107 WERROR *werror)
10109 struct spoolss_RouterReplyPrinter r;
10110 NTSTATUS status;
10112 /* In parameters */
10113 r.in.handle = handle;
10114 r.in.flags = flags;
10115 r.in.bufsize = bufsize;
10116 r.in.buffer = buffer;
10118 if (DEBUGLEVEL >= 10) {
10119 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &r);
10122 status = cli->dispatch(cli,
10123 mem_ctx,
10124 &ndr_table_spoolss,
10125 NDR_SPOOLSS_ROUTERREPLYPRINTER,
10126 &r);
10128 if (!NT_STATUS_IS_OK(status)) {
10129 return status;
10132 if (DEBUGLEVEL >= 10) {
10133 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, &r);
10136 if (NT_STATUS_IS_ERR(status)) {
10137 return status;
10140 /* Return variables */
10142 /* Return result */
10143 if (werror) {
10144 *werror = r.out.result;
10147 return werror_to_ntstatus(r.out.result);
10150 struct rpccli_spoolss_ReplyClosePrinter_state {
10151 struct spoolss_ReplyClosePrinter orig;
10152 struct spoolss_ReplyClosePrinter tmp;
10153 TALLOC_CTX *out_mem_ctx;
10154 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10157 static void rpccli_spoolss_ReplyClosePrinter_done(struct tevent_req *subreq);
10159 struct tevent_req *rpccli_spoolss_ReplyClosePrinter_send(TALLOC_CTX *mem_ctx,
10160 struct tevent_context *ev,
10161 struct rpc_pipe_client *cli,
10162 struct policy_handle *_handle /* [in,out] [ref] */)
10164 struct tevent_req *req;
10165 struct rpccli_spoolss_ReplyClosePrinter_state *state;
10166 struct tevent_req *subreq;
10168 req = tevent_req_create(mem_ctx, &state,
10169 struct rpccli_spoolss_ReplyClosePrinter_state);
10170 if (req == NULL) {
10171 return NULL;
10173 state->out_mem_ctx = NULL;
10174 state->dispatch_recv = cli->dispatch_recv;
10176 /* In parameters */
10177 state->orig.in.handle = _handle;
10179 /* Out parameters */
10180 state->orig.out.handle = _handle;
10182 /* Result */
10183 ZERO_STRUCT(state->orig.out.result);
10185 if (DEBUGLEVEL >= 10) {
10186 NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, &state->orig);
10189 state->out_mem_ctx = talloc_named_const(state, 0,
10190 "rpccli_spoolss_ReplyClosePrinter_out_memory");
10191 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10192 return tevent_req_post(req, ev);
10195 /* make a temporary copy, that we pass to the dispatch function */
10196 state->tmp = state->orig;
10198 subreq = cli->dispatch_send(state, ev, cli,
10199 &ndr_table_spoolss,
10200 NDR_SPOOLSS_REPLYCLOSEPRINTER,
10201 &state->tmp);
10202 if (tevent_req_nomem(subreq, req)) {
10203 return tevent_req_post(req, ev);
10205 tevent_req_set_callback(subreq, rpccli_spoolss_ReplyClosePrinter_done, req);
10206 return req;
10209 static void rpccli_spoolss_ReplyClosePrinter_done(struct tevent_req *subreq)
10211 struct tevent_req *req = tevent_req_callback_data(
10212 subreq, struct tevent_req);
10213 struct rpccli_spoolss_ReplyClosePrinter_state *state = tevent_req_data(
10214 req, struct rpccli_spoolss_ReplyClosePrinter_state);
10215 NTSTATUS status;
10216 TALLOC_CTX *mem_ctx;
10218 if (state->out_mem_ctx) {
10219 mem_ctx = state->out_mem_ctx;
10220 } else {
10221 mem_ctx = state;
10224 status = state->dispatch_recv(subreq, mem_ctx);
10225 TALLOC_FREE(subreq);
10226 if (!NT_STATUS_IS_OK(status)) {
10227 tevent_req_nterror(req, status);
10228 return;
10231 /* Copy out parameters */
10232 *state->orig.out.handle = *state->tmp.out.handle;
10234 /* Copy result */
10235 state->orig.out.result = state->tmp.out.result;
10237 /* Reset temporary structure */
10238 ZERO_STRUCT(state->tmp);
10240 if (DEBUGLEVEL >= 10) {
10241 NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, &state->orig);
10244 tevent_req_done(req);
10247 NTSTATUS rpccli_spoolss_ReplyClosePrinter_recv(struct tevent_req *req,
10248 TALLOC_CTX *mem_ctx,
10249 WERROR *result)
10251 struct rpccli_spoolss_ReplyClosePrinter_state *state = tevent_req_data(
10252 req, struct rpccli_spoolss_ReplyClosePrinter_state);
10253 NTSTATUS status;
10255 if (tevent_req_is_nterror(req, &status)) {
10256 tevent_req_received(req);
10257 return status;
10260 /* Steal possbile out parameters to the callers context */
10261 talloc_steal(mem_ctx, state->out_mem_ctx);
10263 /* Return result */
10264 *result = state->orig.out.result;
10266 tevent_req_received(req);
10267 return NT_STATUS_OK;
10270 NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
10271 TALLOC_CTX *mem_ctx,
10272 struct policy_handle *handle /* [in,out] [ref] */,
10273 WERROR *werror)
10275 struct spoolss_ReplyClosePrinter r;
10276 NTSTATUS status;
10278 /* In parameters */
10279 r.in.handle = handle;
10281 if (DEBUGLEVEL >= 10) {
10282 NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, &r);
10285 status = cli->dispatch(cli,
10286 mem_ctx,
10287 &ndr_table_spoolss,
10288 NDR_SPOOLSS_REPLYCLOSEPRINTER,
10289 &r);
10291 if (!NT_STATUS_IS_OK(status)) {
10292 return status;
10295 if (DEBUGLEVEL >= 10) {
10296 NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, &r);
10299 if (NT_STATUS_IS_ERR(status)) {
10300 return status;
10303 /* Return variables */
10304 *handle = *r.out.handle;
10306 /* Return result */
10307 if (werror) {
10308 *werror = r.out.result;
10311 return werror_to_ntstatus(r.out.result);
10314 struct rpccli_spoolss_AddPortEx_state {
10315 struct spoolss_AddPortEx orig;
10316 struct spoolss_AddPortEx tmp;
10317 TALLOC_CTX *out_mem_ctx;
10318 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10321 static void rpccli_spoolss_AddPortEx_done(struct tevent_req *subreq);
10323 struct tevent_req *rpccli_spoolss_AddPortEx_send(TALLOC_CTX *mem_ctx,
10324 struct tevent_context *ev,
10325 struct rpc_pipe_client *cli)
10327 struct tevent_req *req;
10328 struct rpccli_spoolss_AddPortEx_state *state;
10329 struct tevent_req *subreq;
10331 req = tevent_req_create(mem_ctx, &state,
10332 struct rpccli_spoolss_AddPortEx_state);
10333 if (req == NULL) {
10334 return NULL;
10336 state->out_mem_ctx = NULL;
10337 state->dispatch_recv = cli->dispatch_recv;
10339 /* In parameters */
10341 /* Out parameters */
10343 /* Result */
10344 ZERO_STRUCT(state->orig.out.result);
10346 if (DEBUGLEVEL >= 10) {
10347 NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, &state->orig);
10350 /* make a temporary copy, that we pass to the dispatch function */
10351 state->tmp = state->orig;
10353 subreq = cli->dispatch_send(state, ev, cli,
10354 &ndr_table_spoolss,
10355 NDR_SPOOLSS_ADDPORTEX,
10356 &state->tmp);
10357 if (tevent_req_nomem(subreq, req)) {
10358 return tevent_req_post(req, ev);
10360 tevent_req_set_callback(subreq, rpccli_spoolss_AddPortEx_done, req);
10361 return req;
10364 static void rpccli_spoolss_AddPortEx_done(struct tevent_req *subreq)
10366 struct tevent_req *req = tevent_req_callback_data(
10367 subreq, struct tevent_req);
10368 struct rpccli_spoolss_AddPortEx_state *state = tevent_req_data(
10369 req, struct rpccli_spoolss_AddPortEx_state);
10370 NTSTATUS status;
10371 TALLOC_CTX *mem_ctx;
10373 if (state->out_mem_ctx) {
10374 mem_ctx = state->out_mem_ctx;
10375 } else {
10376 mem_ctx = state;
10379 status = state->dispatch_recv(subreq, mem_ctx);
10380 TALLOC_FREE(subreq);
10381 if (!NT_STATUS_IS_OK(status)) {
10382 tevent_req_nterror(req, status);
10383 return;
10386 /* Copy out parameters */
10388 /* Copy result */
10389 state->orig.out.result = state->tmp.out.result;
10391 /* Reset temporary structure */
10392 ZERO_STRUCT(state->tmp);
10394 if (DEBUGLEVEL >= 10) {
10395 NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, &state->orig);
10398 tevent_req_done(req);
10401 NTSTATUS rpccli_spoolss_AddPortEx_recv(struct tevent_req *req,
10402 TALLOC_CTX *mem_ctx,
10403 WERROR *result)
10405 struct rpccli_spoolss_AddPortEx_state *state = tevent_req_data(
10406 req, struct rpccli_spoolss_AddPortEx_state);
10407 NTSTATUS status;
10409 if (tevent_req_is_nterror(req, &status)) {
10410 tevent_req_received(req);
10411 return status;
10414 /* Steal possbile out parameters to the callers context */
10415 talloc_steal(mem_ctx, state->out_mem_ctx);
10417 /* Return result */
10418 *result = state->orig.out.result;
10420 tevent_req_received(req);
10421 return NT_STATUS_OK;
10424 NTSTATUS rpccli_spoolss_AddPortEx(struct rpc_pipe_client *cli,
10425 TALLOC_CTX *mem_ctx,
10426 WERROR *werror)
10428 struct spoolss_AddPortEx r;
10429 NTSTATUS status;
10431 /* In parameters */
10433 if (DEBUGLEVEL >= 10) {
10434 NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, &r);
10437 status = cli->dispatch(cli,
10438 mem_ctx,
10439 &ndr_table_spoolss,
10440 NDR_SPOOLSS_ADDPORTEX,
10441 &r);
10443 if (!NT_STATUS_IS_OK(status)) {
10444 return status;
10447 if (DEBUGLEVEL >= 10) {
10448 NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, &r);
10451 if (NT_STATUS_IS_ERR(status)) {
10452 return status;
10455 /* Return variables */
10457 /* Return result */
10458 if (werror) {
10459 *werror = r.out.result;
10462 return werror_to_ntstatus(r.out.result);
10465 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state {
10466 struct spoolss_RouterFindFirstPrinterChangeNotification orig;
10467 struct spoolss_RouterFindFirstPrinterChangeNotification tmp;
10468 TALLOC_CTX *out_mem_ctx;
10469 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10472 static void rpccli_spoolss_RouterFindFirstPrinterChangeNotification_done(struct tevent_req *subreq);
10474 struct tevent_req *rpccli_spoolss_RouterFindFirstPrinterChangeNotification_send(TALLOC_CTX *mem_ctx,
10475 struct tevent_context *ev,
10476 struct rpc_pipe_client *cli)
10478 struct tevent_req *req;
10479 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state *state;
10480 struct tevent_req *subreq;
10482 req = tevent_req_create(mem_ctx, &state,
10483 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state);
10484 if (req == NULL) {
10485 return NULL;
10487 state->out_mem_ctx = NULL;
10488 state->dispatch_recv = cli->dispatch_recv;
10490 /* In parameters */
10492 /* Out parameters */
10494 /* Result */
10495 ZERO_STRUCT(state->orig.out.result);
10497 if (DEBUGLEVEL >= 10) {
10498 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &state->orig);
10501 /* make a temporary copy, that we pass to the dispatch function */
10502 state->tmp = state->orig;
10504 subreq = cli->dispatch_send(state, ev, cli,
10505 &ndr_table_spoolss,
10506 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION,
10507 &state->tmp);
10508 if (tevent_req_nomem(subreq, req)) {
10509 return tevent_req_post(req, ev);
10511 tevent_req_set_callback(subreq, rpccli_spoolss_RouterFindFirstPrinterChangeNotification_done, req);
10512 return req;
10515 static void rpccli_spoolss_RouterFindFirstPrinterChangeNotification_done(struct tevent_req *subreq)
10517 struct tevent_req *req = tevent_req_callback_data(
10518 subreq, struct tevent_req);
10519 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state *state = tevent_req_data(
10520 req, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state);
10521 NTSTATUS status;
10522 TALLOC_CTX *mem_ctx;
10524 if (state->out_mem_ctx) {
10525 mem_ctx = state->out_mem_ctx;
10526 } else {
10527 mem_ctx = state;
10530 status = state->dispatch_recv(subreq, mem_ctx);
10531 TALLOC_FREE(subreq);
10532 if (!NT_STATUS_IS_OK(status)) {
10533 tevent_req_nterror(req, status);
10534 return;
10537 /* Copy out parameters */
10539 /* Copy result */
10540 state->orig.out.result = state->tmp.out.result;
10542 /* Reset temporary structure */
10543 ZERO_STRUCT(state->tmp);
10545 if (DEBUGLEVEL >= 10) {
10546 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &state->orig);
10549 tevent_req_done(req);
10552 NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification_recv(struct tevent_req *req,
10553 TALLOC_CTX *mem_ctx,
10554 WERROR *result)
10556 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state *state = tevent_req_data(
10557 req, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state);
10558 NTSTATUS status;
10560 if (tevent_req_is_nterror(req, &status)) {
10561 tevent_req_received(req);
10562 return status;
10565 /* Steal possbile out parameters to the callers context */
10566 talloc_steal(mem_ctx, state->out_mem_ctx);
10568 /* Return result */
10569 *result = state->orig.out.result;
10571 tevent_req_received(req);
10572 return NT_STATUS_OK;
10575 NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
10576 TALLOC_CTX *mem_ctx,
10577 WERROR *werror)
10579 struct spoolss_RouterFindFirstPrinterChangeNotification r;
10580 NTSTATUS status;
10582 /* In parameters */
10584 if (DEBUGLEVEL >= 10) {
10585 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
10588 status = cli->dispatch(cli,
10589 mem_ctx,
10590 &ndr_table_spoolss,
10591 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION,
10592 &r);
10594 if (!NT_STATUS_IS_OK(status)) {
10595 return status;
10598 if (DEBUGLEVEL >= 10) {
10599 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
10602 if (NT_STATUS_IS_ERR(status)) {
10603 return status;
10606 /* Return variables */
10608 /* Return result */
10609 if (werror) {
10610 *werror = r.out.result;
10613 return werror_to_ntstatus(r.out.result);
10616 struct rpccli_spoolss_SpoolerInit_state {
10617 struct spoolss_SpoolerInit orig;
10618 struct spoolss_SpoolerInit tmp;
10619 TALLOC_CTX *out_mem_ctx;
10620 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10623 static void rpccli_spoolss_SpoolerInit_done(struct tevent_req *subreq);
10625 struct tevent_req *rpccli_spoolss_SpoolerInit_send(TALLOC_CTX *mem_ctx,
10626 struct tevent_context *ev,
10627 struct rpc_pipe_client *cli)
10629 struct tevent_req *req;
10630 struct rpccli_spoolss_SpoolerInit_state *state;
10631 struct tevent_req *subreq;
10633 req = tevent_req_create(mem_ctx, &state,
10634 struct rpccli_spoolss_SpoolerInit_state);
10635 if (req == NULL) {
10636 return NULL;
10638 state->out_mem_ctx = NULL;
10639 state->dispatch_recv = cli->dispatch_recv;
10641 /* In parameters */
10643 /* Out parameters */
10645 /* Result */
10646 ZERO_STRUCT(state->orig.out.result);
10648 if (DEBUGLEVEL >= 10) {
10649 NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, &state->orig);
10652 /* make a temporary copy, that we pass to the dispatch function */
10653 state->tmp = state->orig;
10655 subreq = cli->dispatch_send(state, ev, cli,
10656 &ndr_table_spoolss,
10657 NDR_SPOOLSS_SPOOLERINIT,
10658 &state->tmp);
10659 if (tevent_req_nomem(subreq, req)) {
10660 return tevent_req_post(req, ev);
10662 tevent_req_set_callback(subreq, rpccli_spoolss_SpoolerInit_done, req);
10663 return req;
10666 static void rpccli_spoolss_SpoolerInit_done(struct tevent_req *subreq)
10668 struct tevent_req *req = tevent_req_callback_data(
10669 subreq, struct tevent_req);
10670 struct rpccli_spoolss_SpoolerInit_state *state = tevent_req_data(
10671 req, struct rpccli_spoolss_SpoolerInit_state);
10672 NTSTATUS status;
10673 TALLOC_CTX *mem_ctx;
10675 if (state->out_mem_ctx) {
10676 mem_ctx = state->out_mem_ctx;
10677 } else {
10678 mem_ctx = state;
10681 status = state->dispatch_recv(subreq, mem_ctx);
10682 TALLOC_FREE(subreq);
10683 if (!NT_STATUS_IS_OK(status)) {
10684 tevent_req_nterror(req, status);
10685 return;
10688 /* Copy out parameters */
10690 /* Copy result */
10691 state->orig.out.result = state->tmp.out.result;
10693 /* Reset temporary structure */
10694 ZERO_STRUCT(state->tmp);
10696 if (DEBUGLEVEL >= 10) {
10697 NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, &state->orig);
10700 tevent_req_done(req);
10703 NTSTATUS rpccli_spoolss_SpoolerInit_recv(struct tevent_req *req,
10704 TALLOC_CTX *mem_ctx,
10705 WERROR *result)
10707 struct rpccli_spoolss_SpoolerInit_state *state = tevent_req_data(
10708 req, struct rpccli_spoolss_SpoolerInit_state);
10709 NTSTATUS status;
10711 if (tevent_req_is_nterror(req, &status)) {
10712 tevent_req_received(req);
10713 return status;
10716 /* Steal possbile out parameters to the callers context */
10717 talloc_steal(mem_ctx, state->out_mem_ctx);
10719 /* Return result */
10720 *result = state->orig.out.result;
10722 tevent_req_received(req);
10723 return NT_STATUS_OK;
10726 NTSTATUS rpccli_spoolss_SpoolerInit(struct rpc_pipe_client *cli,
10727 TALLOC_CTX *mem_ctx,
10728 WERROR *werror)
10730 struct spoolss_SpoolerInit r;
10731 NTSTATUS status;
10733 /* In parameters */
10735 if (DEBUGLEVEL >= 10) {
10736 NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, &r);
10739 status = cli->dispatch(cli,
10740 mem_ctx,
10741 &ndr_table_spoolss,
10742 NDR_SPOOLSS_SPOOLERINIT,
10743 &r);
10745 if (!NT_STATUS_IS_OK(status)) {
10746 return status;
10749 if (DEBUGLEVEL >= 10) {
10750 NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, &r);
10753 if (NT_STATUS_IS_ERR(status)) {
10754 return status;
10757 /* Return variables */
10759 /* Return result */
10760 if (werror) {
10761 *werror = r.out.result;
10764 return werror_to_ntstatus(r.out.result);
10767 struct rpccli_spoolss_ResetPrinterEx_state {
10768 struct spoolss_ResetPrinterEx orig;
10769 struct spoolss_ResetPrinterEx tmp;
10770 TALLOC_CTX *out_mem_ctx;
10771 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10774 static void rpccli_spoolss_ResetPrinterEx_done(struct tevent_req *subreq);
10776 struct tevent_req *rpccli_spoolss_ResetPrinterEx_send(TALLOC_CTX *mem_ctx,
10777 struct tevent_context *ev,
10778 struct rpc_pipe_client *cli)
10780 struct tevent_req *req;
10781 struct rpccli_spoolss_ResetPrinterEx_state *state;
10782 struct tevent_req *subreq;
10784 req = tevent_req_create(mem_ctx, &state,
10785 struct rpccli_spoolss_ResetPrinterEx_state);
10786 if (req == NULL) {
10787 return NULL;
10789 state->out_mem_ctx = NULL;
10790 state->dispatch_recv = cli->dispatch_recv;
10792 /* In parameters */
10794 /* Out parameters */
10796 /* Result */
10797 ZERO_STRUCT(state->orig.out.result);
10799 if (DEBUGLEVEL >= 10) {
10800 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, &state->orig);
10803 /* make a temporary copy, that we pass to the dispatch function */
10804 state->tmp = state->orig;
10806 subreq = cli->dispatch_send(state, ev, cli,
10807 &ndr_table_spoolss,
10808 NDR_SPOOLSS_RESETPRINTEREX,
10809 &state->tmp);
10810 if (tevent_req_nomem(subreq, req)) {
10811 return tevent_req_post(req, ev);
10813 tevent_req_set_callback(subreq, rpccli_spoolss_ResetPrinterEx_done, req);
10814 return req;
10817 static void rpccli_spoolss_ResetPrinterEx_done(struct tevent_req *subreq)
10819 struct tevent_req *req = tevent_req_callback_data(
10820 subreq, struct tevent_req);
10821 struct rpccli_spoolss_ResetPrinterEx_state *state = tevent_req_data(
10822 req, struct rpccli_spoolss_ResetPrinterEx_state);
10823 NTSTATUS status;
10824 TALLOC_CTX *mem_ctx;
10826 if (state->out_mem_ctx) {
10827 mem_ctx = state->out_mem_ctx;
10828 } else {
10829 mem_ctx = state;
10832 status = state->dispatch_recv(subreq, mem_ctx);
10833 TALLOC_FREE(subreq);
10834 if (!NT_STATUS_IS_OK(status)) {
10835 tevent_req_nterror(req, status);
10836 return;
10839 /* Copy out parameters */
10841 /* Copy result */
10842 state->orig.out.result = state->tmp.out.result;
10844 /* Reset temporary structure */
10845 ZERO_STRUCT(state->tmp);
10847 if (DEBUGLEVEL >= 10) {
10848 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, &state->orig);
10851 tevent_req_done(req);
10854 NTSTATUS rpccli_spoolss_ResetPrinterEx_recv(struct tevent_req *req,
10855 TALLOC_CTX *mem_ctx,
10856 WERROR *result)
10858 struct rpccli_spoolss_ResetPrinterEx_state *state = tevent_req_data(
10859 req, struct rpccli_spoolss_ResetPrinterEx_state);
10860 NTSTATUS status;
10862 if (tevent_req_is_nterror(req, &status)) {
10863 tevent_req_received(req);
10864 return status;
10867 /* Steal possbile out parameters to the callers context */
10868 talloc_steal(mem_ctx, state->out_mem_ctx);
10870 /* Return result */
10871 *result = state->orig.out.result;
10873 tevent_req_received(req);
10874 return NT_STATUS_OK;
10877 NTSTATUS rpccli_spoolss_ResetPrinterEx(struct rpc_pipe_client *cli,
10878 TALLOC_CTX *mem_ctx,
10879 WERROR *werror)
10881 struct spoolss_ResetPrinterEx r;
10882 NTSTATUS status;
10884 /* In parameters */
10886 if (DEBUGLEVEL >= 10) {
10887 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, &r);
10890 status = cli->dispatch(cli,
10891 mem_ctx,
10892 &ndr_table_spoolss,
10893 NDR_SPOOLSS_RESETPRINTEREX,
10894 &r);
10896 if (!NT_STATUS_IS_OK(status)) {
10897 return status;
10900 if (DEBUGLEVEL >= 10) {
10901 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, &r);
10904 if (NT_STATUS_IS_ERR(status)) {
10905 return status;
10908 /* Return variables */
10910 /* Return result */
10911 if (werror) {
10912 *werror = r.out.result;
10915 return werror_to_ntstatus(r.out.result);
10918 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state {
10919 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx orig;
10920 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx tmp;
10921 TALLOC_CTX *out_mem_ctx;
10922 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10925 static void rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done(struct tevent_req *subreq);
10927 struct tevent_req *rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_send(TALLOC_CTX *mem_ctx,
10928 struct tevent_context *ev,
10929 struct rpc_pipe_client *cli,
10930 struct policy_handle *_handle /* [in] [ref] */,
10931 uint32_t _flags /* [in] */,
10932 uint32_t _options /* [in] */,
10933 const char *_local_machine /* [in] [unique,charset(UTF16)] */,
10934 uint32_t _printer_local /* [in] */,
10935 struct spoolss_NotifyOption *_notify_options /* [in] [unique] */)
10937 struct tevent_req *req;
10938 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state;
10939 struct tevent_req *subreq;
10941 req = tevent_req_create(mem_ctx, &state,
10942 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
10943 if (req == NULL) {
10944 return NULL;
10946 state->out_mem_ctx = NULL;
10947 state->dispatch_recv = cli->dispatch_recv;
10949 /* In parameters */
10950 state->orig.in.handle = _handle;
10951 state->orig.in.flags = _flags;
10952 state->orig.in.options = _options;
10953 state->orig.in.local_machine = _local_machine;
10954 state->orig.in.printer_local = _printer_local;
10955 state->orig.in.notify_options = _notify_options;
10957 /* Out parameters */
10959 /* Result */
10960 ZERO_STRUCT(state->orig.out.result);
10962 if (DEBUGLEVEL >= 10) {
10963 NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &state->orig);
10966 /* make a temporary copy, that we pass to the dispatch function */
10967 state->tmp = state->orig;
10969 subreq = cli->dispatch_send(state, ev, cli,
10970 &ndr_table_spoolss,
10971 NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX,
10972 &state->tmp);
10973 if (tevent_req_nomem(subreq, req)) {
10974 return tevent_req_post(req, ev);
10976 tevent_req_set_callback(subreq, rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done, req);
10977 return req;
10980 static void rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done(struct tevent_req *subreq)
10982 struct tevent_req *req = tevent_req_callback_data(
10983 subreq, struct tevent_req);
10984 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state = tevent_req_data(
10985 req, struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
10986 NTSTATUS status;
10987 TALLOC_CTX *mem_ctx;
10989 if (state->out_mem_ctx) {
10990 mem_ctx = state->out_mem_ctx;
10991 } else {
10992 mem_ctx = state;
10995 status = state->dispatch_recv(subreq, mem_ctx);
10996 TALLOC_FREE(subreq);
10997 if (!NT_STATUS_IS_OK(status)) {
10998 tevent_req_nterror(req, status);
10999 return;
11002 /* Copy out parameters */
11004 /* Copy result */
11005 state->orig.out.result = state->tmp.out.result;
11007 /* Reset temporary structure */
11008 ZERO_STRUCT(state->tmp);
11010 if (DEBUGLEVEL >= 10) {
11011 NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &state->orig);
11014 tevent_req_done(req);
11017 NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_recv(struct tevent_req *req,
11018 TALLOC_CTX *mem_ctx,
11019 WERROR *result)
11021 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state = tevent_req_data(
11022 req, struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
11023 NTSTATUS status;
11025 if (tevent_req_is_nterror(req, &status)) {
11026 tevent_req_received(req);
11027 return status;
11030 /* Steal possbile out parameters to the callers context */
11031 talloc_steal(mem_ctx, state->out_mem_ctx);
11033 /* Return result */
11034 *result = state->orig.out.result;
11036 tevent_req_received(req);
11037 return NT_STATUS_OK;
11040 NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
11041 TALLOC_CTX *mem_ctx,
11042 struct policy_handle *handle /* [in] [ref] */,
11043 uint32_t flags /* [in] */,
11044 uint32_t options /* [in] */,
11045 const char *local_machine /* [in] [unique,charset(UTF16)] */,
11046 uint32_t printer_local /* [in] */,
11047 struct spoolss_NotifyOption *notify_options /* [in] [unique] */,
11048 WERROR *werror)
11050 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
11051 NTSTATUS status;
11053 /* In parameters */
11054 r.in.handle = handle;
11055 r.in.flags = flags;
11056 r.in.options = options;
11057 r.in.local_machine = local_machine;
11058 r.in.printer_local = printer_local;
11059 r.in.notify_options = notify_options;
11061 if (DEBUGLEVEL >= 10) {
11062 NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
11065 status = cli->dispatch(cli,
11066 mem_ctx,
11067 &ndr_table_spoolss,
11068 NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX,
11069 &r);
11071 if (!NT_STATUS_IS_OK(status)) {
11072 return status;
11075 if (DEBUGLEVEL >= 10) {
11076 NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
11079 if (NT_STATUS_IS_ERR(status)) {
11080 return status;
11083 /* Return variables */
11085 /* Return result */
11086 if (werror) {
11087 *werror = r.out.result;
11090 return werror_to_ntstatus(r.out.result);
11093 struct rpccli_spoolss_RouterReplyPrinterEx_state {
11094 struct spoolss_RouterReplyPrinterEx orig;
11095 struct spoolss_RouterReplyPrinterEx tmp;
11096 TALLOC_CTX *out_mem_ctx;
11097 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11100 static void rpccli_spoolss_RouterReplyPrinterEx_done(struct tevent_req *subreq);
11102 struct tevent_req *rpccli_spoolss_RouterReplyPrinterEx_send(TALLOC_CTX *mem_ctx,
11103 struct tevent_context *ev,
11104 struct rpc_pipe_client *cli,
11105 struct policy_handle *_handle /* [in] [ref] */,
11106 uint32_t _color /* [in] */,
11107 uint32_t _flags /* [in] */,
11108 uint32_t *_reply_result /* [out] [ref] */,
11109 uint32_t _reply_type /* [in] */,
11110 union spoolss_ReplyPrinterInfo _info /* [in] [switch_is(reply_type)] */)
11112 struct tevent_req *req;
11113 struct rpccli_spoolss_RouterReplyPrinterEx_state *state;
11114 struct tevent_req *subreq;
11116 req = tevent_req_create(mem_ctx, &state,
11117 struct rpccli_spoolss_RouterReplyPrinterEx_state);
11118 if (req == NULL) {
11119 return NULL;
11121 state->out_mem_ctx = NULL;
11122 state->dispatch_recv = cli->dispatch_recv;
11124 /* In parameters */
11125 state->orig.in.handle = _handle;
11126 state->orig.in.color = _color;
11127 state->orig.in.flags = _flags;
11128 state->orig.in.reply_type = _reply_type;
11129 state->orig.in.info = _info;
11131 /* Out parameters */
11132 state->orig.out.reply_result = _reply_result;
11134 /* Result */
11135 ZERO_STRUCT(state->orig.out.result);
11137 if (DEBUGLEVEL >= 10) {
11138 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, &state->orig);
11141 state->out_mem_ctx = talloc_named_const(state, 0,
11142 "rpccli_spoolss_RouterReplyPrinterEx_out_memory");
11143 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11144 return tevent_req_post(req, ev);
11147 /* make a temporary copy, that we pass to the dispatch function */
11148 state->tmp = state->orig;
11150 subreq = cli->dispatch_send(state, ev, cli,
11151 &ndr_table_spoolss,
11152 NDR_SPOOLSS_ROUTERREPLYPRINTEREX,
11153 &state->tmp);
11154 if (tevent_req_nomem(subreq, req)) {
11155 return tevent_req_post(req, ev);
11157 tevent_req_set_callback(subreq, rpccli_spoolss_RouterReplyPrinterEx_done, req);
11158 return req;
11161 static void rpccli_spoolss_RouterReplyPrinterEx_done(struct tevent_req *subreq)
11163 struct tevent_req *req = tevent_req_callback_data(
11164 subreq, struct tevent_req);
11165 struct rpccli_spoolss_RouterReplyPrinterEx_state *state = tevent_req_data(
11166 req, struct rpccli_spoolss_RouterReplyPrinterEx_state);
11167 NTSTATUS status;
11168 TALLOC_CTX *mem_ctx;
11170 if (state->out_mem_ctx) {
11171 mem_ctx = state->out_mem_ctx;
11172 } else {
11173 mem_ctx = state;
11176 status = state->dispatch_recv(subreq, mem_ctx);
11177 TALLOC_FREE(subreq);
11178 if (!NT_STATUS_IS_OK(status)) {
11179 tevent_req_nterror(req, status);
11180 return;
11183 /* Copy out parameters */
11184 *state->orig.out.reply_result = *state->tmp.out.reply_result;
11186 /* Copy result */
11187 state->orig.out.result = state->tmp.out.result;
11189 /* Reset temporary structure */
11190 ZERO_STRUCT(state->tmp);
11192 if (DEBUGLEVEL >= 10) {
11193 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinterEx, &state->orig);
11196 tevent_req_done(req);
11199 NTSTATUS rpccli_spoolss_RouterReplyPrinterEx_recv(struct tevent_req *req,
11200 TALLOC_CTX *mem_ctx,
11201 WERROR *result)
11203 struct rpccli_spoolss_RouterReplyPrinterEx_state *state = tevent_req_data(
11204 req, struct rpccli_spoolss_RouterReplyPrinterEx_state);
11205 NTSTATUS status;
11207 if (tevent_req_is_nterror(req, &status)) {
11208 tevent_req_received(req);
11209 return status;
11212 /* Steal possbile out parameters to the callers context */
11213 talloc_steal(mem_ctx, state->out_mem_ctx);
11215 /* Return result */
11216 *result = state->orig.out.result;
11218 tevent_req_received(req);
11219 return NT_STATUS_OK;
11222 NTSTATUS rpccli_spoolss_RouterReplyPrinterEx(struct rpc_pipe_client *cli,
11223 TALLOC_CTX *mem_ctx,
11224 struct policy_handle *handle /* [in] [ref] */,
11225 uint32_t color /* [in] */,
11226 uint32_t flags /* [in] */,
11227 uint32_t *reply_result /* [out] [ref] */,
11228 uint32_t reply_type /* [in] */,
11229 union spoolss_ReplyPrinterInfo info /* [in] [switch_is(reply_type)] */,
11230 WERROR *werror)
11232 struct spoolss_RouterReplyPrinterEx r;
11233 NTSTATUS status;
11235 /* In parameters */
11236 r.in.handle = handle;
11237 r.in.color = color;
11238 r.in.flags = flags;
11239 r.in.reply_type = reply_type;
11240 r.in.info = info;
11242 if (DEBUGLEVEL >= 10) {
11243 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, &r);
11246 status = cli->dispatch(cli,
11247 mem_ctx,
11248 &ndr_table_spoolss,
11249 NDR_SPOOLSS_ROUTERREPLYPRINTEREX,
11250 &r);
11252 if (!NT_STATUS_IS_OK(status)) {
11253 return status;
11256 if (DEBUGLEVEL >= 10) {
11257 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinterEx, &r);
11260 if (NT_STATUS_IS_ERR(status)) {
11261 return status;
11264 /* Return variables */
11265 *reply_result = *r.out.reply_result;
11267 /* Return result */
11268 if (werror) {
11269 *werror = r.out.result;
11272 return werror_to_ntstatus(r.out.result);
11275 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state {
11276 struct spoolss_RouterRefreshPrinterChangeNotify orig;
11277 struct spoolss_RouterRefreshPrinterChangeNotify tmp;
11278 TALLOC_CTX *out_mem_ctx;
11279 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11282 static void rpccli_spoolss_RouterRefreshPrinterChangeNotify_done(struct tevent_req *subreq);
11284 struct tevent_req *rpccli_spoolss_RouterRefreshPrinterChangeNotify_send(TALLOC_CTX *mem_ctx,
11285 struct tevent_context *ev,
11286 struct rpc_pipe_client *cli,
11287 struct policy_handle *_handle /* [in] [ref] */,
11288 uint32_t _change_low /* [in] */,
11289 struct spoolss_NotifyOption *_options /* [in] [unique] */,
11290 struct spoolss_NotifyInfo **_info /* [out] [ref] */)
11292 struct tevent_req *req;
11293 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state *state;
11294 struct tevent_req *subreq;
11296 req = tevent_req_create(mem_ctx, &state,
11297 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state);
11298 if (req == NULL) {
11299 return NULL;
11301 state->out_mem_ctx = NULL;
11302 state->dispatch_recv = cli->dispatch_recv;
11304 /* In parameters */
11305 state->orig.in.handle = _handle;
11306 state->orig.in.change_low = _change_low;
11307 state->orig.in.options = _options;
11309 /* Out parameters */
11310 state->orig.out.info = _info;
11312 /* Result */
11313 ZERO_STRUCT(state->orig.out.result);
11315 if (DEBUGLEVEL >= 10) {
11316 NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &state->orig);
11319 state->out_mem_ctx = talloc_named_const(state, 0,
11320 "rpccli_spoolss_RouterRefreshPrinterChangeNotify_out_memory");
11321 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11322 return tevent_req_post(req, ev);
11325 /* make a temporary copy, that we pass to the dispatch function */
11326 state->tmp = state->orig;
11328 subreq = cli->dispatch_send(state, ev, cli,
11329 &ndr_table_spoolss,
11330 NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY,
11331 &state->tmp);
11332 if (tevent_req_nomem(subreq, req)) {
11333 return tevent_req_post(req, ev);
11335 tevent_req_set_callback(subreq, rpccli_spoolss_RouterRefreshPrinterChangeNotify_done, req);
11336 return req;
11339 static void rpccli_spoolss_RouterRefreshPrinterChangeNotify_done(struct tevent_req *subreq)
11341 struct tevent_req *req = tevent_req_callback_data(
11342 subreq, struct tevent_req);
11343 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state *state = tevent_req_data(
11344 req, struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state);
11345 NTSTATUS status;
11346 TALLOC_CTX *mem_ctx;
11348 if (state->out_mem_ctx) {
11349 mem_ctx = state->out_mem_ctx;
11350 } else {
11351 mem_ctx = state;
11354 status = state->dispatch_recv(subreq, mem_ctx);
11355 TALLOC_FREE(subreq);
11356 if (!NT_STATUS_IS_OK(status)) {
11357 tevent_req_nterror(req, status);
11358 return;
11361 /* Copy out parameters */
11362 *state->orig.out.info = *state->tmp.out.info;
11364 /* Copy result */
11365 state->orig.out.result = state->tmp.out.result;
11367 /* Reset temporary structure */
11368 ZERO_STRUCT(state->tmp);
11370 if (DEBUGLEVEL >= 10) {
11371 NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &state->orig);
11374 tevent_req_done(req);
11377 NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify_recv(struct tevent_req *req,
11378 TALLOC_CTX *mem_ctx,
11379 WERROR *result)
11381 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state *state = tevent_req_data(
11382 req, struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state);
11383 NTSTATUS status;
11385 if (tevent_req_is_nterror(req, &status)) {
11386 tevent_req_received(req);
11387 return status;
11390 /* Steal possbile out parameters to the callers context */
11391 talloc_steal(mem_ctx, state->out_mem_ctx);
11393 /* Return result */
11394 *result = state->orig.out.result;
11396 tevent_req_received(req);
11397 return NT_STATUS_OK;
11400 NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify(struct rpc_pipe_client *cli,
11401 TALLOC_CTX *mem_ctx,
11402 struct policy_handle *handle /* [in] [ref] */,
11403 uint32_t change_low /* [in] */,
11404 struct spoolss_NotifyOption *options /* [in] [unique] */,
11405 struct spoolss_NotifyInfo **info /* [out] [ref] */,
11406 WERROR *werror)
11408 struct spoolss_RouterRefreshPrinterChangeNotify r;
11409 NTSTATUS status;
11411 /* In parameters */
11412 r.in.handle = handle;
11413 r.in.change_low = change_low;
11414 r.in.options = options;
11416 if (DEBUGLEVEL >= 10) {
11417 NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &r);
11420 status = cli->dispatch(cli,
11421 mem_ctx,
11422 &ndr_table_spoolss,
11423 NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY,
11424 &r);
11426 if (!NT_STATUS_IS_OK(status)) {
11427 return status;
11430 if (DEBUGLEVEL >= 10) {
11431 NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &r);
11434 if (NT_STATUS_IS_ERR(status)) {
11435 return status;
11438 /* Return variables */
11439 *info = *r.out.info;
11441 /* Return result */
11442 if (werror) {
11443 *werror = r.out.result;
11446 return werror_to_ntstatus(r.out.result);
11449 struct rpccli_spoolss_44_state {
11450 struct spoolss_44 orig;
11451 struct spoolss_44 tmp;
11452 TALLOC_CTX *out_mem_ctx;
11453 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11456 static void rpccli_spoolss_44_done(struct tevent_req *subreq);
11458 struct tevent_req *rpccli_spoolss_44_send(TALLOC_CTX *mem_ctx,
11459 struct tevent_context *ev,
11460 struct rpc_pipe_client *cli)
11462 struct tevent_req *req;
11463 struct rpccli_spoolss_44_state *state;
11464 struct tevent_req *subreq;
11466 req = tevent_req_create(mem_ctx, &state,
11467 struct rpccli_spoolss_44_state);
11468 if (req == NULL) {
11469 return NULL;
11471 state->out_mem_ctx = NULL;
11472 state->dispatch_recv = cli->dispatch_recv;
11474 /* In parameters */
11476 /* Out parameters */
11478 /* Result */
11479 ZERO_STRUCT(state->orig.out.result);
11481 if (DEBUGLEVEL >= 10) {
11482 NDR_PRINT_IN_DEBUG(spoolss_44, &state->orig);
11485 /* make a temporary copy, that we pass to the dispatch function */
11486 state->tmp = state->orig;
11488 subreq = cli->dispatch_send(state, ev, cli,
11489 &ndr_table_spoolss,
11490 NDR_SPOOLSS_44,
11491 &state->tmp);
11492 if (tevent_req_nomem(subreq, req)) {
11493 return tevent_req_post(req, ev);
11495 tevent_req_set_callback(subreq, rpccli_spoolss_44_done, req);
11496 return req;
11499 static void rpccli_spoolss_44_done(struct tevent_req *subreq)
11501 struct tevent_req *req = tevent_req_callback_data(
11502 subreq, struct tevent_req);
11503 struct rpccli_spoolss_44_state *state = tevent_req_data(
11504 req, struct rpccli_spoolss_44_state);
11505 NTSTATUS status;
11506 TALLOC_CTX *mem_ctx;
11508 if (state->out_mem_ctx) {
11509 mem_ctx = state->out_mem_ctx;
11510 } else {
11511 mem_ctx = state;
11514 status = state->dispatch_recv(subreq, mem_ctx);
11515 TALLOC_FREE(subreq);
11516 if (!NT_STATUS_IS_OK(status)) {
11517 tevent_req_nterror(req, status);
11518 return;
11521 /* Copy out parameters */
11523 /* Copy result */
11524 state->orig.out.result = state->tmp.out.result;
11526 /* Reset temporary structure */
11527 ZERO_STRUCT(state->tmp);
11529 if (DEBUGLEVEL >= 10) {
11530 NDR_PRINT_OUT_DEBUG(spoolss_44, &state->orig);
11533 tevent_req_done(req);
11536 NTSTATUS rpccli_spoolss_44_recv(struct tevent_req *req,
11537 TALLOC_CTX *mem_ctx,
11538 WERROR *result)
11540 struct rpccli_spoolss_44_state *state = tevent_req_data(
11541 req, struct rpccli_spoolss_44_state);
11542 NTSTATUS status;
11544 if (tevent_req_is_nterror(req, &status)) {
11545 tevent_req_received(req);
11546 return status;
11549 /* Steal possbile out parameters to the callers context */
11550 talloc_steal(mem_ctx, state->out_mem_ctx);
11552 /* Return result */
11553 *result = state->orig.out.result;
11555 tevent_req_received(req);
11556 return NT_STATUS_OK;
11559 NTSTATUS rpccli_spoolss_44(struct rpc_pipe_client *cli,
11560 TALLOC_CTX *mem_ctx,
11561 WERROR *werror)
11563 struct spoolss_44 r;
11564 NTSTATUS status;
11566 /* In parameters */
11568 if (DEBUGLEVEL >= 10) {
11569 NDR_PRINT_IN_DEBUG(spoolss_44, &r);
11572 status = cli->dispatch(cli,
11573 mem_ctx,
11574 &ndr_table_spoolss,
11575 NDR_SPOOLSS_44,
11576 &r);
11578 if (!NT_STATUS_IS_OK(status)) {
11579 return status;
11582 if (DEBUGLEVEL >= 10) {
11583 NDR_PRINT_OUT_DEBUG(spoolss_44, &r);
11586 if (NT_STATUS_IS_ERR(status)) {
11587 return status;
11590 /* Return variables */
11592 /* Return result */
11593 if (werror) {
11594 *werror = r.out.result;
11597 return werror_to_ntstatus(r.out.result);
11600 struct rpccli_spoolss_OpenPrinterEx_state {
11601 struct spoolss_OpenPrinterEx orig;
11602 struct spoolss_OpenPrinterEx tmp;
11603 TALLOC_CTX *out_mem_ctx;
11604 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11607 static void rpccli_spoolss_OpenPrinterEx_done(struct tevent_req *subreq);
11609 struct tevent_req *rpccli_spoolss_OpenPrinterEx_send(TALLOC_CTX *mem_ctx,
11610 struct tevent_context *ev,
11611 struct rpc_pipe_client *cli,
11612 const char *_printername /* [in] [unique,charset(UTF16)] */,
11613 const char *_datatype /* [in] [unique,charset(UTF16)] */,
11614 struct spoolss_DevmodeContainer _devmode_ctr /* [in] */,
11615 uint32_t _access_mask /* [in] */,
11616 uint32_t _level /* [in] */,
11617 union spoolss_UserLevel _userlevel /* [in] [switch_is(level)] */,
11618 struct policy_handle *_handle /* [out] [ref] */)
11620 struct tevent_req *req;
11621 struct rpccli_spoolss_OpenPrinterEx_state *state;
11622 struct tevent_req *subreq;
11624 req = tevent_req_create(mem_ctx, &state,
11625 struct rpccli_spoolss_OpenPrinterEx_state);
11626 if (req == NULL) {
11627 return NULL;
11629 state->out_mem_ctx = NULL;
11630 state->dispatch_recv = cli->dispatch_recv;
11632 /* In parameters */
11633 state->orig.in.printername = _printername;
11634 state->orig.in.datatype = _datatype;
11635 state->orig.in.devmode_ctr = _devmode_ctr;
11636 state->orig.in.access_mask = _access_mask;
11637 state->orig.in.level = _level;
11638 state->orig.in.userlevel = _userlevel;
11640 /* Out parameters */
11641 state->orig.out.handle = _handle;
11643 /* Result */
11644 ZERO_STRUCT(state->orig.out.result);
11646 if (DEBUGLEVEL >= 10) {
11647 NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, &state->orig);
11650 state->out_mem_ctx = talloc_named_const(state, 0,
11651 "rpccli_spoolss_OpenPrinterEx_out_memory");
11652 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11653 return tevent_req_post(req, ev);
11656 /* make a temporary copy, that we pass to the dispatch function */
11657 state->tmp = state->orig;
11659 subreq = cli->dispatch_send(state, ev, cli,
11660 &ndr_table_spoolss,
11661 NDR_SPOOLSS_OPENPRINTEREX,
11662 &state->tmp);
11663 if (tevent_req_nomem(subreq, req)) {
11664 return tevent_req_post(req, ev);
11666 tevent_req_set_callback(subreq, rpccli_spoolss_OpenPrinterEx_done, req);
11667 return req;
11670 static void rpccli_spoolss_OpenPrinterEx_done(struct tevent_req *subreq)
11672 struct tevent_req *req = tevent_req_callback_data(
11673 subreq, struct tevent_req);
11674 struct rpccli_spoolss_OpenPrinterEx_state *state = tevent_req_data(
11675 req, struct rpccli_spoolss_OpenPrinterEx_state);
11676 NTSTATUS status;
11677 TALLOC_CTX *mem_ctx;
11679 if (state->out_mem_ctx) {
11680 mem_ctx = state->out_mem_ctx;
11681 } else {
11682 mem_ctx = state;
11685 status = state->dispatch_recv(subreq, mem_ctx);
11686 TALLOC_FREE(subreq);
11687 if (!NT_STATUS_IS_OK(status)) {
11688 tevent_req_nterror(req, status);
11689 return;
11692 /* Copy out parameters */
11693 *state->orig.out.handle = *state->tmp.out.handle;
11695 /* Copy result */
11696 state->orig.out.result = state->tmp.out.result;
11698 /* Reset temporary structure */
11699 ZERO_STRUCT(state->tmp);
11701 if (DEBUGLEVEL >= 10) {
11702 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, &state->orig);
11705 tevent_req_done(req);
11708 NTSTATUS rpccli_spoolss_OpenPrinterEx_recv(struct tevent_req *req,
11709 TALLOC_CTX *mem_ctx,
11710 WERROR *result)
11712 struct rpccli_spoolss_OpenPrinterEx_state *state = tevent_req_data(
11713 req, struct rpccli_spoolss_OpenPrinterEx_state);
11714 NTSTATUS status;
11716 if (tevent_req_is_nterror(req, &status)) {
11717 tevent_req_received(req);
11718 return status;
11721 /* Steal possbile out parameters to the callers context */
11722 talloc_steal(mem_ctx, state->out_mem_ctx);
11724 /* Return result */
11725 *result = state->orig.out.result;
11727 tevent_req_received(req);
11728 return NT_STATUS_OK;
11731 NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
11732 TALLOC_CTX *mem_ctx,
11733 const char *printername /* [in] [unique,charset(UTF16)] */,
11734 const char *datatype /* [in] [unique,charset(UTF16)] */,
11735 struct spoolss_DevmodeContainer devmode_ctr /* [in] */,
11736 uint32_t access_mask /* [in] */,
11737 uint32_t level /* [in] */,
11738 union spoolss_UserLevel userlevel /* [in] [switch_is(level)] */,
11739 struct policy_handle *handle /* [out] [ref] */,
11740 WERROR *werror)
11742 struct spoolss_OpenPrinterEx r;
11743 NTSTATUS status;
11745 /* In parameters */
11746 r.in.printername = printername;
11747 r.in.datatype = datatype;
11748 r.in.devmode_ctr = devmode_ctr;
11749 r.in.access_mask = access_mask;
11750 r.in.level = level;
11751 r.in.userlevel = userlevel;
11753 if (DEBUGLEVEL >= 10) {
11754 NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, &r);
11757 status = cli->dispatch(cli,
11758 mem_ctx,
11759 &ndr_table_spoolss,
11760 NDR_SPOOLSS_OPENPRINTEREX,
11761 &r);
11763 if (!NT_STATUS_IS_OK(status)) {
11764 return status;
11767 if (DEBUGLEVEL >= 10) {
11768 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, &r);
11771 if (NT_STATUS_IS_ERR(status)) {
11772 return status;
11775 /* Return variables */
11776 *handle = *r.out.handle;
11778 /* Return result */
11779 if (werror) {
11780 *werror = r.out.result;
11783 return werror_to_ntstatus(r.out.result);
11786 struct rpccli_spoolss_AddPrinterEx_state {
11787 struct spoolss_AddPrinterEx orig;
11788 struct spoolss_AddPrinterEx tmp;
11789 TALLOC_CTX *out_mem_ctx;
11790 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11793 static void rpccli_spoolss_AddPrinterEx_done(struct tevent_req *subreq);
11795 struct tevent_req *rpccli_spoolss_AddPrinterEx_send(TALLOC_CTX *mem_ctx,
11796 struct tevent_context *ev,
11797 struct rpc_pipe_client *cli,
11798 const char *_server /* [in] [unique,charset(UTF16)] */,
11799 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
11800 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
11801 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
11802 struct spoolss_UserLevelCtr *_userlevel_ctr /* [in] [ref] */,
11803 struct policy_handle *_handle /* [out] [ref] */)
11805 struct tevent_req *req;
11806 struct rpccli_spoolss_AddPrinterEx_state *state;
11807 struct tevent_req *subreq;
11809 req = tevent_req_create(mem_ctx, &state,
11810 struct rpccli_spoolss_AddPrinterEx_state);
11811 if (req == NULL) {
11812 return NULL;
11814 state->out_mem_ctx = NULL;
11815 state->dispatch_recv = cli->dispatch_recv;
11817 /* In parameters */
11818 state->orig.in.server = _server;
11819 state->orig.in.info_ctr = _info_ctr;
11820 state->orig.in.devmode_ctr = _devmode_ctr;
11821 state->orig.in.secdesc_ctr = _secdesc_ctr;
11822 state->orig.in.userlevel_ctr = _userlevel_ctr;
11824 /* Out parameters */
11825 state->orig.out.handle = _handle;
11827 /* Result */
11828 ZERO_STRUCT(state->orig.out.result);
11830 if (DEBUGLEVEL >= 10) {
11831 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, &state->orig);
11834 state->out_mem_ctx = talloc_named_const(state, 0,
11835 "rpccli_spoolss_AddPrinterEx_out_memory");
11836 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11837 return tevent_req_post(req, ev);
11840 /* make a temporary copy, that we pass to the dispatch function */
11841 state->tmp = state->orig;
11843 subreq = cli->dispatch_send(state, ev, cli,
11844 &ndr_table_spoolss,
11845 NDR_SPOOLSS_ADDPRINTEREX,
11846 &state->tmp);
11847 if (tevent_req_nomem(subreq, req)) {
11848 return tevent_req_post(req, ev);
11850 tevent_req_set_callback(subreq, rpccli_spoolss_AddPrinterEx_done, req);
11851 return req;
11854 static void rpccli_spoolss_AddPrinterEx_done(struct tevent_req *subreq)
11856 struct tevent_req *req = tevent_req_callback_data(
11857 subreq, struct tevent_req);
11858 struct rpccli_spoolss_AddPrinterEx_state *state = tevent_req_data(
11859 req, struct rpccli_spoolss_AddPrinterEx_state);
11860 NTSTATUS status;
11861 TALLOC_CTX *mem_ctx;
11863 if (state->out_mem_ctx) {
11864 mem_ctx = state->out_mem_ctx;
11865 } else {
11866 mem_ctx = state;
11869 status = state->dispatch_recv(subreq, mem_ctx);
11870 TALLOC_FREE(subreq);
11871 if (!NT_STATUS_IS_OK(status)) {
11872 tevent_req_nterror(req, status);
11873 return;
11876 /* Copy out parameters */
11877 *state->orig.out.handle = *state->tmp.out.handle;
11879 /* Copy result */
11880 state->orig.out.result = state->tmp.out.result;
11882 /* Reset temporary structure */
11883 ZERO_STRUCT(state->tmp);
11885 if (DEBUGLEVEL >= 10) {
11886 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, &state->orig);
11889 tevent_req_done(req);
11892 NTSTATUS rpccli_spoolss_AddPrinterEx_recv(struct tevent_req *req,
11893 TALLOC_CTX *mem_ctx,
11894 WERROR *result)
11896 struct rpccli_spoolss_AddPrinterEx_state *state = tevent_req_data(
11897 req, struct rpccli_spoolss_AddPrinterEx_state);
11898 NTSTATUS status;
11900 if (tevent_req_is_nterror(req, &status)) {
11901 tevent_req_received(req);
11902 return status;
11905 /* Steal possbile out parameters to the callers context */
11906 talloc_steal(mem_ctx, state->out_mem_ctx);
11908 /* Return result */
11909 *result = state->orig.out.result;
11911 tevent_req_received(req);
11912 return NT_STATUS_OK;
11915 NTSTATUS rpccli_spoolss_AddPrinterEx(struct rpc_pipe_client *cli,
11916 TALLOC_CTX *mem_ctx,
11917 const char *server /* [in] [unique,charset(UTF16)] */,
11918 struct spoolss_SetPrinterInfoCtr *info_ctr /* [in] [ref] */,
11919 struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
11920 struct sec_desc_buf *secdesc_ctr /* [in] [ref] */,
11921 struct spoolss_UserLevelCtr *userlevel_ctr /* [in] [ref] */,
11922 struct policy_handle *handle /* [out] [ref] */,
11923 WERROR *werror)
11925 struct spoolss_AddPrinterEx r;
11926 NTSTATUS status;
11928 /* In parameters */
11929 r.in.server = server;
11930 r.in.info_ctr = info_ctr;
11931 r.in.devmode_ctr = devmode_ctr;
11932 r.in.secdesc_ctr = secdesc_ctr;
11933 r.in.userlevel_ctr = userlevel_ctr;
11935 if (DEBUGLEVEL >= 10) {
11936 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, &r);
11939 status = cli->dispatch(cli,
11940 mem_ctx,
11941 &ndr_table_spoolss,
11942 NDR_SPOOLSS_ADDPRINTEREX,
11943 &r);
11945 if (!NT_STATUS_IS_OK(status)) {
11946 return status;
11949 if (DEBUGLEVEL >= 10) {
11950 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, &r);
11953 if (NT_STATUS_IS_ERR(status)) {
11954 return status;
11957 /* Return variables */
11958 *handle = *r.out.handle;
11960 /* Return result */
11961 if (werror) {
11962 *werror = r.out.result;
11965 return werror_to_ntstatus(r.out.result);
11968 struct rpccli_spoolss_47_state {
11969 struct spoolss_47 orig;
11970 struct spoolss_47 tmp;
11971 TALLOC_CTX *out_mem_ctx;
11972 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11975 static void rpccli_spoolss_47_done(struct tevent_req *subreq);
11977 struct tevent_req *rpccli_spoolss_47_send(TALLOC_CTX *mem_ctx,
11978 struct tevent_context *ev,
11979 struct rpc_pipe_client *cli)
11981 struct tevent_req *req;
11982 struct rpccli_spoolss_47_state *state;
11983 struct tevent_req *subreq;
11985 req = tevent_req_create(mem_ctx, &state,
11986 struct rpccli_spoolss_47_state);
11987 if (req == NULL) {
11988 return NULL;
11990 state->out_mem_ctx = NULL;
11991 state->dispatch_recv = cli->dispatch_recv;
11993 /* In parameters */
11995 /* Out parameters */
11997 /* Result */
11998 ZERO_STRUCT(state->orig.out.result);
12000 if (DEBUGLEVEL >= 10) {
12001 NDR_PRINT_IN_DEBUG(spoolss_47, &state->orig);
12004 /* make a temporary copy, that we pass to the dispatch function */
12005 state->tmp = state->orig;
12007 subreq = cli->dispatch_send(state, ev, cli,
12008 &ndr_table_spoolss,
12009 NDR_SPOOLSS_47,
12010 &state->tmp);
12011 if (tevent_req_nomem(subreq, req)) {
12012 return tevent_req_post(req, ev);
12014 tevent_req_set_callback(subreq, rpccli_spoolss_47_done, req);
12015 return req;
12018 static void rpccli_spoolss_47_done(struct tevent_req *subreq)
12020 struct tevent_req *req = tevent_req_callback_data(
12021 subreq, struct tevent_req);
12022 struct rpccli_spoolss_47_state *state = tevent_req_data(
12023 req, struct rpccli_spoolss_47_state);
12024 NTSTATUS status;
12025 TALLOC_CTX *mem_ctx;
12027 if (state->out_mem_ctx) {
12028 mem_ctx = state->out_mem_ctx;
12029 } else {
12030 mem_ctx = state;
12033 status = state->dispatch_recv(subreq, mem_ctx);
12034 TALLOC_FREE(subreq);
12035 if (!NT_STATUS_IS_OK(status)) {
12036 tevent_req_nterror(req, status);
12037 return;
12040 /* Copy out parameters */
12042 /* Copy result */
12043 state->orig.out.result = state->tmp.out.result;
12045 /* Reset temporary structure */
12046 ZERO_STRUCT(state->tmp);
12048 if (DEBUGLEVEL >= 10) {
12049 NDR_PRINT_OUT_DEBUG(spoolss_47, &state->orig);
12052 tevent_req_done(req);
12055 NTSTATUS rpccli_spoolss_47_recv(struct tevent_req *req,
12056 TALLOC_CTX *mem_ctx,
12057 WERROR *result)
12059 struct rpccli_spoolss_47_state *state = tevent_req_data(
12060 req, struct rpccli_spoolss_47_state);
12061 NTSTATUS status;
12063 if (tevent_req_is_nterror(req, &status)) {
12064 tevent_req_received(req);
12065 return status;
12068 /* Steal possbile out parameters to the callers context */
12069 talloc_steal(mem_ctx, state->out_mem_ctx);
12071 /* Return result */
12072 *result = state->orig.out.result;
12074 tevent_req_received(req);
12075 return NT_STATUS_OK;
12078 NTSTATUS rpccli_spoolss_47(struct rpc_pipe_client *cli,
12079 TALLOC_CTX *mem_ctx,
12080 WERROR *werror)
12082 struct spoolss_47 r;
12083 NTSTATUS status;
12085 /* In parameters */
12087 if (DEBUGLEVEL >= 10) {
12088 NDR_PRINT_IN_DEBUG(spoolss_47, &r);
12091 status = cli->dispatch(cli,
12092 mem_ctx,
12093 &ndr_table_spoolss,
12094 NDR_SPOOLSS_47,
12095 &r);
12097 if (!NT_STATUS_IS_OK(status)) {
12098 return status;
12101 if (DEBUGLEVEL >= 10) {
12102 NDR_PRINT_OUT_DEBUG(spoolss_47, &r);
12105 if (NT_STATUS_IS_ERR(status)) {
12106 return status;
12109 /* Return variables */
12111 /* Return result */
12112 if (werror) {
12113 *werror = r.out.result;
12116 return werror_to_ntstatus(r.out.result);
12119 struct rpccli_spoolss_EnumPrinterData_state {
12120 struct spoolss_EnumPrinterData orig;
12121 struct spoolss_EnumPrinterData tmp;
12122 TALLOC_CTX *out_mem_ctx;
12123 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12126 static void rpccli_spoolss_EnumPrinterData_done(struct tevent_req *subreq);
12128 struct tevent_req *rpccli_spoolss_EnumPrinterData_send(TALLOC_CTX *mem_ctx,
12129 struct tevent_context *ev,
12130 struct rpc_pipe_client *cli,
12131 struct policy_handle *_handle /* [in] [ref] */,
12132 uint32_t _enum_index /* [in] */,
12133 const char *_value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
12134 uint32_t _value_offered /* [in] */,
12135 uint32_t *_value_needed /* [out] [ref] */,
12136 enum winreg_Type *_type /* [out] [ref] */,
12137 uint8_t *_data /* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */,
12138 uint32_t _data_offered /* [in] */,
12139 uint32_t *_data_needed /* [out] [ref] */)
12141 struct tevent_req *req;
12142 struct rpccli_spoolss_EnumPrinterData_state *state;
12143 struct tevent_req *subreq;
12145 req = tevent_req_create(mem_ctx, &state,
12146 struct rpccli_spoolss_EnumPrinterData_state);
12147 if (req == NULL) {
12148 return NULL;
12150 state->out_mem_ctx = NULL;
12151 state->dispatch_recv = cli->dispatch_recv;
12153 /* In parameters */
12154 state->orig.in.handle = _handle;
12155 state->orig.in.enum_index = _enum_index;
12156 state->orig.in.value_offered = _value_offered;
12157 state->orig.in.data_offered = _data_offered;
12159 /* Out parameters */
12160 state->orig.out.value_name = _value_name;
12161 state->orig.out.value_needed = _value_needed;
12162 state->orig.out.type = _type;
12163 state->orig.out.data = _data;
12164 state->orig.out.data_needed = _data_needed;
12166 /* Result */
12167 ZERO_STRUCT(state->orig.out.result);
12169 if (DEBUGLEVEL >= 10) {
12170 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterData, &state->orig);
12173 state->out_mem_ctx = talloc_named_const(state, 0,
12174 "rpccli_spoolss_EnumPrinterData_out_memory");
12175 if (tevent_req_nomem(state->out_mem_ctx, req)) {
12176 return tevent_req_post(req, ev);
12179 /* make a temporary copy, that we pass to the dispatch function */
12180 state->tmp = state->orig;
12182 subreq = cli->dispatch_send(state, ev, cli,
12183 &ndr_table_spoolss,
12184 NDR_SPOOLSS_ENUMPRINTERDATA,
12185 &state->tmp);
12186 if (tevent_req_nomem(subreq, req)) {
12187 return tevent_req_post(req, ev);
12189 tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrinterData_done, req);
12190 return req;
12193 static void rpccli_spoolss_EnumPrinterData_done(struct tevent_req *subreq)
12195 struct tevent_req *req = tevent_req_callback_data(
12196 subreq, struct tevent_req);
12197 struct rpccli_spoolss_EnumPrinterData_state *state = tevent_req_data(
12198 req, struct rpccli_spoolss_EnumPrinterData_state);
12199 NTSTATUS status;
12200 TALLOC_CTX *mem_ctx;
12202 if (state->out_mem_ctx) {
12203 mem_ctx = state->out_mem_ctx;
12204 } else {
12205 mem_ctx = state;
12208 status = state->dispatch_recv(subreq, mem_ctx);
12209 TALLOC_FREE(subreq);
12210 if (!NT_STATUS_IS_OK(status)) {
12211 tevent_req_nterror(req, status);
12212 return;
12215 /* Copy out parameters */
12216 memcpy(CONST_DISCARD(char *, state->orig.out.value_name), state->tmp.out.value_name, state->tmp.in.value_offered / 2 * sizeof(*state->orig.out.value_name));
12217 *state->orig.out.value_needed = *state->tmp.out.value_needed;
12218 *state->orig.out.type = *state->tmp.out.type;
12219 memcpy(state->orig.out.data, state->tmp.out.data, state->tmp.in.data_offered * sizeof(*state->orig.out.data));
12220 *state->orig.out.data_needed = *state->tmp.out.data_needed;
12222 /* Copy result */
12223 state->orig.out.result = state->tmp.out.result;
12225 /* Reset temporary structure */
12226 ZERO_STRUCT(state->tmp);
12228 if (DEBUGLEVEL >= 10) {
12229 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterData, &state->orig);
12232 tevent_req_done(req);
12235 NTSTATUS rpccli_spoolss_EnumPrinterData_recv(struct tevent_req *req,
12236 TALLOC_CTX *mem_ctx,
12237 WERROR *result)
12239 struct rpccli_spoolss_EnumPrinterData_state *state = tevent_req_data(
12240 req, struct rpccli_spoolss_EnumPrinterData_state);
12241 NTSTATUS status;
12243 if (tevent_req_is_nterror(req, &status)) {
12244 tevent_req_received(req);
12245 return status;
12248 /* Steal possbile out parameters to the callers context */
12249 talloc_steal(mem_ctx, state->out_mem_ctx);
12251 /* Return result */
12252 *result = state->orig.out.result;
12254 tevent_req_received(req);
12255 return NT_STATUS_OK;
12258 NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli,
12259 TALLOC_CTX *mem_ctx,
12260 struct policy_handle *handle /* [in] [ref] */,
12261 uint32_t enum_index /* [in] */,
12262 const char *value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
12263 uint32_t value_offered /* [in] */,
12264 uint32_t *value_needed /* [out] [ref] */,
12265 enum winreg_Type *type /* [out] [ref] */,
12266 uint8_t *data /* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */,
12267 uint32_t data_offered /* [in] */,
12268 uint32_t *data_needed /* [out] [ref] */,
12269 WERROR *werror)
12271 struct spoolss_EnumPrinterData r;
12272 NTSTATUS status;
12274 /* In parameters */
12275 r.in.handle = handle;
12276 r.in.enum_index = enum_index;
12277 r.in.value_offered = value_offered;
12278 r.in.data_offered = data_offered;
12280 if (DEBUGLEVEL >= 10) {
12281 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterData, &r);
12284 status = cli->dispatch(cli,
12285 mem_ctx,
12286 &ndr_table_spoolss,
12287 NDR_SPOOLSS_ENUMPRINTERDATA,
12288 &r);
12290 if (!NT_STATUS_IS_OK(status)) {
12291 return status;
12294 if (DEBUGLEVEL >= 10) {
12295 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterData, &r);
12298 if (NT_STATUS_IS_ERR(status)) {
12299 return status;
12302 /* Return variables */
12303 memcpy(CONST_DISCARD(char *, value_name), r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name));
12304 *value_needed = *r.out.value_needed;
12305 *type = *r.out.type;
12306 memcpy(data, r.out.data, r.in.data_offered * sizeof(*data));
12307 *data_needed = *r.out.data_needed;
12309 /* Return result */
12310 if (werror) {
12311 *werror = r.out.result;
12314 return werror_to_ntstatus(r.out.result);
12317 struct rpccli_spoolss_DeletePrinterData_state {
12318 struct spoolss_DeletePrinterData orig;
12319 struct spoolss_DeletePrinterData tmp;
12320 TALLOC_CTX *out_mem_ctx;
12321 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12324 static void rpccli_spoolss_DeletePrinterData_done(struct tevent_req *subreq);
12326 struct tevent_req *rpccli_spoolss_DeletePrinterData_send(TALLOC_CTX *mem_ctx,
12327 struct tevent_context *ev,
12328 struct rpc_pipe_client *cli,
12329 struct policy_handle *_handle /* [in] [ref] */,
12330 const char *_value_name /* [in] [charset(UTF16)] */)
12332 struct tevent_req *req;
12333 struct rpccli_spoolss_DeletePrinterData_state *state;
12334 struct tevent_req *subreq;
12336 req = tevent_req_create(mem_ctx, &state,
12337 struct rpccli_spoolss_DeletePrinterData_state);
12338 if (req == NULL) {
12339 return NULL;
12341 state->out_mem_ctx = NULL;
12342 state->dispatch_recv = cli->dispatch_recv;
12344 /* In parameters */
12345 state->orig.in.handle = _handle;
12346 state->orig.in.value_name = _value_name;
12348 /* Out parameters */
12350 /* Result */
12351 ZERO_STRUCT(state->orig.out.result);
12353 if (DEBUGLEVEL >= 10) {
12354 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterData, &state->orig);
12357 /* make a temporary copy, that we pass to the dispatch function */
12358 state->tmp = state->orig;
12360 subreq = cli->dispatch_send(state, ev, cli,
12361 &ndr_table_spoolss,
12362 NDR_SPOOLSS_DELETEPRINTERDATA,
12363 &state->tmp);
12364 if (tevent_req_nomem(subreq, req)) {
12365 return tevent_req_post(req, ev);
12367 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterData_done, req);
12368 return req;
12371 static void rpccli_spoolss_DeletePrinterData_done(struct tevent_req *subreq)
12373 struct tevent_req *req = tevent_req_callback_data(
12374 subreq, struct tevent_req);
12375 struct rpccli_spoolss_DeletePrinterData_state *state = tevent_req_data(
12376 req, struct rpccli_spoolss_DeletePrinterData_state);
12377 NTSTATUS status;
12378 TALLOC_CTX *mem_ctx;
12380 if (state->out_mem_ctx) {
12381 mem_ctx = state->out_mem_ctx;
12382 } else {
12383 mem_ctx = state;
12386 status = state->dispatch_recv(subreq, mem_ctx);
12387 TALLOC_FREE(subreq);
12388 if (!NT_STATUS_IS_OK(status)) {
12389 tevent_req_nterror(req, status);
12390 return;
12393 /* Copy out parameters */
12395 /* Copy result */
12396 state->orig.out.result = state->tmp.out.result;
12398 /* Reset temporary structure */
12399 ZERO_STRUCT(state->tmp);
12401 if (DEBUGLEVEL >= 10) {
12402 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterData, &state->orig);
12405 tevent_req_done(req);
12408 NTSTATUS rpccli_spoolss_DeletePrinterData_recv(struct tevent_req *req,
12409 TALLOC_CTX *mem_ctx,
12410 WERROR *result)
12412 struct rpccli_spoolss_DeletePrinterData_state *state = tevent_req_data(
12413 req, struct rpccli_spoolss_DeletePrinterData_state);
12414 NTSTATUS status;
12416 if (tevent_req_is_nterror(req, &status)) {
12417 tevent_req_received(req);
12418 return status;
12421 /* Steal possbile out parameters to the callers context */
12422 talloc_steal(mem_ctx, state->out_mem_ctx);
12424 /* Return result */
12425 *result = state->orig.out.result;
12427 tevent_req_received(req);
12428 return NT_STATUS_OK;
12431 NTSTATUS rpccli_spoolss_DeletePrinterData(struct rpc_pipe_client *cli,
12432 TALLOC_CTX *mem_ctx,
12433 struct policy_handle *handle /* [in] [ref] */,
12434 const char *value_name /* [in] [charset(UTF16)] */,
12435 WERROR *werror)
12437 struct spoolss_DeletePrinterData r;
12438 NTSTATUS status;
12440 /* In parameters */
12441 r.in.handle = handle;
12442 r.in.value_name = value_name;
12444 if (DEBUGLEVEL >= 10) {
12445 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterData, &r);
12448 status = cli->dispatch(cli,
12449 mem_ctx,
12450 &ndr_table_spoolss,
12451 NDR_SPOOLSS_DELETEPRINTERDATA,
12452 &r);
12454 if (!NT_STATUS_IS_OK(status)) {
12455 return status;
12458 if (DEBUGLEVEL >= 10) {
12459 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterData, &r);
12462 if (NT_STATUS_IS_ERR(status)) {
12463 return status;
12466 /* Return variables */
12468 /* Return result */
12469 if (werror) {
12470 *werror = r.out.result;
12473 return werror_to_ntstatus(r.out.result);
12476 struct rpccli_spoolss_4a_state {
12477 struct spoolss_4a orig;
12478 struct spoolss_4a tmp;
12479 TALLOC_CTX *out_mem_ctx;
12480 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12483 static void rpccli_spoolss_4a_done(struct tevent_req *subreq);
12485 struct tevent_req *rpccli_spoolss_4a_send(TALLOC_CTX *mem_ctx,
12486 struct tevent_context *ev,
12487 struct rpc_pipe_client *cli)
12489 struct tevent_req *req;
12490 struct rpccli_spoolss_4a_state *state;
12491 struct tevent_req *subreq;
12493 req = tevent_req_create(mem_ctx, &state,
12494 struct rpccli_spoolss_4a_state);
12495 if (req == NULL) {
12496 return NULL;
12498 state->out_mem_ctx = NULL;
12499 state->dispatch_recv = cli->dispatch_recv;
12501 /* In parameters */
12503 /* Out parameters */
12505 /* Result */
12506 ZERO_STRUCT(state->orig.out.result);
12508 if (DEBUGLEVEL >= 10) {
12509 NDR_PRINT_IN_DEBUG(spoolss_4a, &state->orig);
12512 /* make a temporary copy, that we pass to the dispatch function */
12513 state->tmp = state->orig;
12515 subreq = cli->dispatch_send(state, ev, cli,
12516 &ndr_table_spoolss,
12517 NDR_SPOOLSS_4A,
12518 &state->tmp);
12519 if (tevent_req_nomem(subreq, req)) {
12520 return tevent_req_post(req, ev);
12522 tevent_req_set_callback(subreq, rpccli_spoolss_4a_done, req);
12523 return req;
12526 static void rpccli_spoolss_4a_done(struct tevent_req *subreq)
12528 struct tevent_req *req = tevent_req_callback_data(
12529 subreq, struct tevent_req);
12530 struct rpccli_spoolss_4a_state *state = tevent_req_data(
12531 req, struct rpccli_spoolss_4a_state);
12532 NTSTATUS status;
12533 TALLOC_CTX *mem_ctx;
12535 if (state->out_mem_ctx) {
12536 mem_ctx = state->out_mem_ctx;
12537 } else {
12538 mem_ctx = state;
12541 status = state->dispatch_recv(subreq, mem_ctx);
12542 TALLOC_FREE(subreq);
12543 if (!NT_STATUS_IS_OK(status)) {
12544 tevent_req_nterror(req, status);
12545 return;
12548 /* Copy out parameters */
12550 /* Copy result */
12551 state->orig.out.result = state->tmp.out.result;
12553 /* Reset temporary structure */
12554 ZERO_STRUCT(state->tmp);
12556 if (DEBUGLEVEL >= 10) {
12557 NDR_PRINT_OUT_DEBUG(spoolss_4a, &state->orig);
12560 tevent_req_done(req);
12563 NTSTATUS rpccli_spoolss_4a_recv(struct tevent_req *req,
12564 TALLOC_CTX *mem_ctx,
12565 WERROR *result)
12567 struct rpccli_spoolss_4a_state *state = tevent_req_data(
12568 req, struct rpccli_spoolss_4a_state);
12569 NTSTATUS status;
12571 if (tevent_req_is_nterror(req, &status)) {
12572 tevent_req_received(req);
12573 return status;
12576 /* Steal possbile out parameters to the callers context */
12577 talloc_steal(mem_ctx, state->out_mem_ctx);
12579 /* Return result */
12580 *result = state->orig.out.result;
12582 tevent_req_received(req);
12583 return NT_STATUS_OK;
12586 NTSTATUS rpccli_spoolss_4a(struct rpc_pipe_client *cli,
12587 TALLOC_CTX *mem_ctx,
12588 WERROR *werror)
12590 struct spoolss_4a r;
12591 NTSTATUS status;
12593 /* In parameters */
12595 if (DEBUGLEVEL >= 10) {
12596 NDR_PRINT_IN_DEBUG(spoolss_4a, &r);
12599 status = cli->dispatch(cli,
12600 mem_ctx,
12601 &ndr_table_spoolss,
12602 NDR_SPOOLSS_4A,
12603 &r);
12605 if (!NT_STATUS_IS_OK(status)) {
12606 return status;
12609 if (DEBUGLEVEL >= 10) {
12610 NDR_PRINT_OUT_DEBUG(spoolss_4a, &r);
12613 if (NT_STATUS_IS_ERR(status)) {
12614 return status;
12617 /* Return variables */
12619 /* Return result */
12620 if (werror) {
12621 *werror = r.out.result;
12624 return werror_to_ntstatus(r.out.result);
12627 struct rpccli_spoolss_4b_state {
12628 struct spoolss_4b orig;
12629 struct spoolss_4b tmp;
12630 TALLOC_CTX *out_mem_ctx;
12631 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12634 static void rpccli_spoolss_4b_done(struct tevent_req *subreq);
12636 struct tevent_req *rpccli_spoolss_4b_send(TALLOC_CTX *mem_ctx,
12637 struct tevent_context *ev,
12638 struct rpc_pipe_client *cli)
12640 struct tevent_req *req;
12641 struct rpccli_spoolss_4b_state *state;
12642 struct tevent_req *subreq;
12644 req = tevent_req_create(mem_ctx, &state,
12645 struct rpccli_spoolss_4b_state);
12646 if (req == NULL) {
12647 return NULL;
12649 state->out_mem_ctx = NULL;
12650 state->dispatch_recv = cli->dispatch_recv;
12652 /* In parameters */
12654 /* Out parameters */
12656 /* Result */
12657 ZERO_STRUCT(state->orig.out.result);
12659 if (DEBUGLEVEL >= 10) {
12660 NDR_PRINT_IN_DEBUG(spoolss_4b, &state->orig);
12663 /* make a temporary copy, that we pass to the dispatch function */
12664 state->tmp = state->orig;
12666 subreq = cli->dispatch_send(state, ev, cli,
12667 &ndr_table_spoolss,
12668 NDR_SPOOLSS_4B,
12669 &state->tmp);
12670 if (tevent_req_nomem(subreq, req)) {
12671 return tevent_req_post(req, ev);
12673 tevent_req_set_callback(subreq, rpccli_spoolss_4b_done, req);
12674 return req;
12677 static void rpccli_spoolss_4b_done(struct tevent_req *subreq)
12679 struct tevent_req *req = tevent_req_callback_data(
12680 subreq, struct tevent_req);
12681 struct rpccli_spoolss_4b_state *state = tevent_req_data(
12682 req, struct rpccli_spoolss_4b_state);
12683 NTSTATUS status;
12684 TALLOC_CTX *mem_ctx;
12686 if (state->out_mem_ctx) {
12687 mem_ctx = state->out_mem_ctx;
12688 } else {
12689 mem_ctx = state;
12692 status = state->dispatch_recv(subreq, mem_ctx);
12693 TALLOC_FREE(subreq);
12694 if (!NT_STATUS_IS_OK(status)) {
12695 tevent_req_nterror(req, status);
12696 return;
12699 /* Copy out parameters */
12701 /* Copy result */
12702 state->orig.out.result = state->tmp.out.result;
12704 /* Reset temporary structure */
12705 ZERO_STRUCT(state->tmp);
12707 if (DEBUGLEVEL >= 10) {
12708 NDR_PRINT_OUT_DEBUG(spoolss_4b, &state->orig);
12711 tevent_req_done(req);
12714 NTSTATUS rpccli_spoolss_4b_recv(struct tevent_req *req,
12715 TALLOC_CTX *mem_ctx,
12716 WERROR *result)
12718 struct rpccli_spoolss_4b_state *state = tevent_req_data(
12719 req, struct rpccli_spoolss_4b_state);
12720 NTSTATUS status;
12722 if (tevent_req_is_nterror(req, &status)) {
12723 tevent_req_received(req);
12724 return status;
12727 /* Steal possbile out parameters to the callers context */
12728 talloc_steal(mem_ctx, state->out_mem_ctx);
12730 /* Return result */
12731 *result = state->orig.out.result;
12733 tevent_req_received(req);
12734 return NT_STATUS_OK;
12737 NTSTATUS rpccli_spoolss_4b(struct rpc_pipe_client *cli,
12738 TALLOC_CTX *mem_ctx,
12739 WERROR *werror)
12741 struct spoolss_4b r;
12742 NTSTATUS status;
12744 /* In parameters */
12746 if (DEBUGLEVEL >= 10) {
12747 NDR_PRINT_IN_DEBUG(spoolss_4b, &r);
12750 status = cli->dispatch(cli,
12751 mem_ctx,
12752 &ndr_table_spoolss,
12753 NDR_SPOOLSS_4B,
12754 &r);
12756 if (!NT_STATUS_IS_OK(status)) {
12757 return status;
12760 if (DEBUGLEVEL >= 10) {
12761 NDR_PRINT_OUT_DEBUG(spoolss_4b, &r);
12764 if (NT_STATUS_IS_ERR(status)) {
12765 return status;
12768 /* Return variables */
12770 /* Return result */
12771 if (werror) {
12772 *werror = r.out.result;
12775 return werror_to_ntstatus(r.out.result);
12778 struct rpccli_spoolss_4c_state {
12779 struct spoolss_4c orig;
12780 struct spoolss_4c tmp;
12781 TALLOC_CTX *out_mem_ctx;
12782 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12785 static void rpccli_spoolss_4c_done(struct tevent_req *subreq);
12787 struct tevent_req *rpccli_spoolss_4c_send(TALLOC_CTX *mem_ctx,
12788 struct tevent_context *ev,
12789 struct rpc_pipe_client *cli)
12791 struct tevent_req *req;
12792 struct rpccli_spoolss_4c_state *state;
12793 struct tevent_req *subreq;
12795 req = tevent_req_create(mem_ctx, &state,
12796 struct rpccli_spoolss_4c_state);
12797 if (req == NULL) {
12798 return NULL;
12800 state->out_mem_ctx = NULL;
12801 state->dispatch_recv = cli->dispatch_recv;
12803 /* In parameters */
12805 /* Out parameters */
12807 /* Result */
12808 ZERO_STRUCT(state->orig.out.result);
12810 if (DEBUGLEVEL >= 10) {
12811 NDR_PRINT_IN_DEBUG(spoolss_4c, &state->orig);
12814 /* make a temporary copy, that we pass to the dispatch function */
12815 state->tmp = state->orig;
12817 subreq = cli->dispatch_send(state, ev, cli,
12818 &ndr_table_spoolss,
12819 NDR_SPOOLSS_4C,
12820 &state->tmp);
12821 if (tevent_req_nomem(subreq, req)) {
12822 return tevent_req_post(req, ev);
12824 tevent_req_set_callback(subreq, rpccli_spoolss_4c_done, req);
12825 return req;
12828 static void rpccli_spoolss_4c_done(struct tevent_req *subreq)
12830 struct tevent_req *req = tevent_req_callback_data(
12831 subreq, struct tevent_req);
12832 struct rpccli_spoolss_4c_state *state = tevent_req_data(
12833 req, struct rpccli_spoolss_4c_state);
12834 NTSTATUS status;
12835 TALLOC_CTX *mem_ctx;
12837 if (state->out_mem_ctx) {
12838 mem_ctx = state->out_mem_ctx;
12839 } else {
12840 mem_ctx = state;
12843 status = state->dispatch_recv(subreq, mem_ctx);
12844 TALLOC_FREE(subreq);
12845 if (!NT_STATUS_IS_OK(status)) {
12846 tevent_req_nterror(req, status);
12847 return;
12850 /* Copy out parameters */
12852 /* Copy result */
12853 state->orig.out.result = state->tmp.out.result;
12855 /* Reset temporary structure */
12856 ZERO_STRUCT(state->tmp);
12858 if (DEBUGLEVEL >= 10) {
12859 NDR_PRINT_OUT_DEBUG(spoolss_4c, &state->orig);
12862 tevent_req_done(req);
12865 NTSTATUS rpccli_spoolss_4c_recv(struct tevent_req *req,
12866 TALLOC_CTX *mem_ctx,
12867 WERROR *result)
12869 struct rpccli_spoolss_4c_state *state = tevent_req_data(
12870 req, struct rpccli_spoolss_4c_state);
12871 NTSTATUS status;
12873 if (tevent_req_is_nterror(req, &status)) {
12874 tevent_req_received(req);
12875 return status;
12878 /* Steal possbile out parameters to the callers context */
12879 talloc_steal(mem_ctx, state->out_mem_ctx);
12881 /* Return result */
12882 *result = state->orig.out.result;
12884 tevent_req_received(req);
12885 return NT_STATUS_OK;
12888 NTSTATUS rpccli_spoolss_4c(struct rpc_pipe_client *cli,
12889 TALLOC_CTX *mem_ctx,
12890 WERROR *werror)
12892 struct spoolss_4c r;
12893 NTSTATUS status;
12895 /* In parameters */
12897 if (DEBUGLEVEL >= 10) {
12898 NDR_PRINT_IN_DEBUG(spoolss_4c, &r);
12901 status = cli->dispatch(cli,
12902 mem_ctx,
12903 &ndr_table_spoolss,
12904 NDR_SPOOLSS_4C,
12905 &r);
12907 if (!NT_STATUS_IS_OK(status)) {
12908 return status;
12911 if (DEBUGLEVEL >= 10) {
12912 NDR_PRINT_OUT_DEBUG(spoolss_4c, &r);
12915 if (NT_STATUS_IS_ERR(status)) {
12916 return status;
12919 /* Return variables */
12921 /* Return result */
12922 if (werror) {
12923 *werror = r.out.result;
12926 return werror_to_ntstatus(r.out.result);
12929 struct rpccli_spoolss_SetPrinterDataEx_state {
12930 struct spoolss_SetPrinterDataEx orig;
12931 struct spoolss_SetPrinterDataEx tmp;
12932 TALLOC_CTX *out_mem_ctx;
12933 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12936 static void rpccli_spoolss_SetPrinterDataEx_done(struct tevent_req *subreq);
12938 struct tevent_req *rpccli_spoolss_SetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
12939 struct tevent_context *ev,
12940 struct rpc_pipe_client *cli,
12941 struct policy_handle *_handle /* [in] [ref] */,
12942 const char *_key_name /* [in] [charset(UTF16)] */,
12943 const char *_value_name /* [in] [charset(UTF16)] */,
12944 enum winreg_Type _type /* [in] */,
12945 uint8_t *_buffer /* [in] [ref,size_is(offered)] */,
12946 uint32_t _offered /* [in] */)
12948 struct tevent_req *req;
12949 struct rpccli_spoolss_SetPrinterDataEx_state *state;
12950 struct tevent_req *subreq;
12952 req = tevent_req_create(mem_ctx, &state,
12953 struct rpccli_spoolss_SetPrinterDataEx_state);
12954 if (req == NULL) {
12955 return NULL;
12957 state->out_mem_ctx = NULL;
12958 state->dispatch_recv = cli->dispatch_recv;
12960 /* In parameters */
12961 state->orig.in.handle = _handle;
12962 state->orig.in.key_name = _key_name;
12963 state->orig.in.value_name = _value_name;
12964 state->orig.in.type = _type;
12965 state->orig.in.buffer = _buffer;
12966 state->orig.in.offered = _offered;
12968 /* Out parameters */
12970 /* Result */
12971 ZERO_STRUCT(state->orig.out.result);
12973 if (DEBUGLEVEL >= 10) {
12974 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterDataEx, &state->orig);
12977 /* make a temporary copy, that we pass to the dispatch function */
12978 state->tmp = state->orig;
12980 subreq = cli->dispatch_send(state, ev, cli,
12981 &ndr_table_spoolss,
12982 NDR_SPOOLSS_SETPRINTERDATAEX,
12983 &state->tmp);
12984 if (tevent_req_nomem(subreq, req)) {
12985 return tevent_req_post(req, ev);
12987 tevent_req_set_callback(subreq, rpccli_spoolss_SetPrinterDataEx_done, req);
12988 return req;
12991 static void rpccli_spoolss_SetPrinterDataEx_done(struct tevent_req *subreq)
12993 struct tevent_req *req = tevent_req_callback_data(
12994 subreq, struct tevent_req);
12995 struct rpccli_spoolss_SetPrinterDataEx_state *state = tevent_req_data(
12996 req, struct rpccli_spoolss_SetPrinterDataEx_state);
12997 NTSTATUS status;
12998 TALLOC_CTX *mem_ctx;
13000 if (state->out_mem_ctx) {
13001 mem_ctx = state->out_mem_ctx;
13002 } else {
13003 mem_ctx = state;
13006 status = state->dispatch_recv(subreq, mem_ctx);
13007 TALLOC_FREE(subreq);
13008 if (!NT_STATUS_IS_OK(status)) {
13009 tevent_req_nterror(req, status);
13010 return;
13013 /* Copy out parameters */
13015 /* Copy result */
13016 state->orig.out.result = state->tmp.out.result;
13018 /* Reset temporary structure */
13019 ZERO_STRUCT(state->tmp);
13021 if (DEBUGLEVEL >= 10) {
13022 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterDataEx, &state->orig);
13025 tevent_req_done(req);
13028 NTSTATUS rpccli_spoolss_SetPrinterDataEx_recv(struct tevent_req *req,
13029 TALLOC_CTX *mem_ctx,
13030 WERROR *result)
13032 struct rpccli_spoolss_SetPrinterDataEx_state *state = tevent_req_data(
13033 req, struct rpccli_spoolss_SetPrinterDataEx_state);
13034 NTSTATUS status;
13036 if (tevent_req_is_nterror(req, &status)) {
13037 tevent_req_received(req);
13038 return status;
13041 /* Steal possbile out parameters to the callers context */
13042 talloc_steal(mem_ctx, state->out_mem_ctx);
13044 /* Return result */
13045 *result = state->orig.out.result;
13047 tevent_req_received(req);
13048 return NT_STATUS_OK;
13051 NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli,
13052 TALLOC_CTX *mem_ctx,
13053 struct policy_handle *handle /* [in] [ref] */,
13054 const char *key_name /* [in] [charset(UTF16)] */,
13055 const char *value_name /* [in] [charset(UTF16)] */,
13056 enum winreg_Type type /* [in] */,
13057 uint8_t *buffer /* [in] [ref,size_is(offered)] */,
13058 uint32_t offered /* [in] */,
13059 WERROR *werror)
13061 struct spoolss_SetPrinterDataEx r;
13062 NTSTATUS status;
13064 /* In parameters */
13065 r.in.handle = handle;
13066 r.in.key_name = key_name;
13067 r.in.value_name = value_name;
13068 r.in.type = type;
13069 r.in.buffer = buffer;
13070 r.in.offered = offered;
13072 if (DEBUGLEVEL >= 10) {
13073 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterDataEx, &r);
13076 status = cli->dispatch(cli,
13077 mem_ctx,
13078 &ndr_table_spoolss,
13079 NDR_SPOOLSS_SETPRINTERDATAEX,
13080 &r);
13082 if (!NT_STATUS_IS_OK(status)) {
13083 return status;
13086 if (DEBUGLEVEL >= 10) {
13087 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterDataEx, &r);
13090 if (NT_STATUS_IS_ERR(status)) {
13091 return status;
13094 /* Return variables */
13096 /* Return result */
13097 if (werror) {
13098 *werror = r.out.result;
13101 return werror_to_ntstatus(r.out.result);
13104 struct rpccli_spoolss_GetPrinterDataEx_state {
13105 struct spoolss_GetPrinterDataEx orig;
13106 struct spoolss_GetPrinterDataEx tmp;
13107 TALLOC_CTX *out_mem_ctx;
13108 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
13111 static void rpccli_spoolss_GetPrinterDataEx_done(struct tevent_req *subreq);
13113 struct tevent_req *rpccli_spoolss_GetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
13114 struct tevent_context *ev,
13115 struct rpc_pipe_client *cli,
13116 struct policy_handle *_handle /* [in] [ref] */,
13117 const char *_key_name /* [in] [charset(UTF16)] */,
13118 const char *_value_name /* [in] [charset(UTF16)] */,
13119 enum winreg_Type *_type /* [out] [ref] */,
13120 uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
13121 uint32_t _offered /* [in] */,
13122 uint32_t *_needed /* [out] [ref] */)
13124 struct tevent_req *req;
13125 struct rpccli_spoolss_GetPrinterDataEx_state *state;
13126 struct tevent_req *subreq;
13128 req = tevent_req_create(mem_ctx, &state,
13129 struct rpccli_spoolss_GetPrinterDataEx_state);
13130 if (req == NULL) {
13131 return NULL;
13133 state->out_mem_ctx = NULL;
13134 state->dispatch_recv = cli->dispatch_recv;
13136 /* In parameters */
13137 state->orig.in.handle = _handle;
13138 state->orig.in.key_name = _key_name;
13139 state->orig.in.value_name = _value_name;
13140 state->orig.in.offered = _offered;
13142 /* Out parameters */
13143 state->orig.out.type = _type;
13144 state->orig.out.buffer = _buffer;
13145 state->orig.out.needed = _needed;
13147 /* Result */
13148 ZERO_STRUCT(state->orig.out.result);
13150 if (DEBUGLEVEL >= 10) {
13151 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDataEx, &state->orig);
13154 state->out_mem_ctx = talloc_named_const(state, 0,
13155 "rpccli_spoolss_GetPrinterDataEx_out_memory");
13156 if (tevent_req_nomem(state->out_mem_ctx, req)) {
13157 return tevent_req_post(req, ev);
13160 /* make a temporary copy, that we pass to the dispatch function */
13161 state->tmp = state->orig;
13163 subreq = cli->dispatch_send(state, ev, cli,
13164 &ndr_table_spoolss,
13165 NDR_SPOOLSS_GETPRINTERDATAEX,
13166 &state->tmp);
13167 if (tevent_req_nomem(subreq, req)) {
13168 return tevent_req_post(req, ev);
13170 tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterDataEx_done, req);
13171 return req;
13174 static void rpccli_spoolss_GetPrinterDataEx_done(struct tevent_req *subreq)
13176 struct tevent_req *req = tevent_req_callback_data(
13177 subreq, struct tevent_req);
13178 struct rpccli_spoolss_GetPrinterDataEx_state *state = tevent_req_data(
13179 req, struct rpccli_spoolss_GetPrinterDataEx_state);
13180 NTSTATUS status;
13181 TALLOC_CTX *mem_ctx;
13183 if (state->out_mem_ctx) {
13184 mem_ctx = state->out_mem_ctx;
13185 } else {
13186 mem_ctx = state;
13189 status = state->dispatch_recv(subreq, mem_ctx);
13190 TALLOC_FREE(subreq);
13191 if (!NT_STATUS_IS_OK(status)) {
13192 tevent_req_nterror(req, status);
13193 return;
13196 /* Copy out parameters */
13197 *state->orig.out.type = *state->tmp.out.type;
13198 memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
13199 *state->orig.out.needed = *state->tmp.out.needed;
13201 /* Copy result */
13202 state->orig.out.result = state->tmp.out.result;
13204 /* Reset temporary structure */
13205 ZERO_STRUCT(state->tmp);
13207 if (DEBUGLEVEL >= 10) {
13208 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDataEx, &state->orig);
13211 tevent_req_done(req);
13214 NTSTATUS rpccli_spoolss_GetPrinterDataEx_recv(struct tevent_req *req,
13215 TALLOC_CTX *mem_ctx,
13216 WERROR *result)
13218 struct rpccli_spoolss_GetPrinterDataEx_state *state = tevent_req_data(
13219 req, struct rpccli_spoolss_GetPrinterDataEx_state);
13220 NTSTATUS status;
13222 if (tevent_req_is_nterror(req, &status)) {
13223 tevent_req_received(req);
13224 return status;
13227 /* Steal possbile out parameters to the callers context */
13228 talloc_steal(mem_ctx, state->out_mem_ctx);
13230 /* Return result */
13231 *result = state->orig.out.result;
13233 tevent_req_received(req);
13234 return NT_STATUS_OK;
13237 NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
13238 TALLOC_CTX *mem_ctx,
13239 struct policy_handle *handle /* [in] [ref] */,
13240 const char *key_name /* [in] [charset(UTF16)] */,
13241 const char *value_name /* [in] [charset(UTF16)] */,
13242 enum winreg_Type *type /* [out] [ref] */,
13243 uint8_t *buffer /* [out] [ref,size_is(offered)] */,
13244 uint32_t offered /* [in] */,
13245 uint32_t *needed /* [out] [ref] */,
13246 WERROR *werror)
13248 struct spoolss_GetPrinterDataEx r;
13249 NTSTATUS status;
13251 /* In parameters */
13252 r.in.handle = handle;
13253 r.in.key_name = key_name;
13254 r.in.value_name = value_name;
13255 r.in.offered = offered;
13257 if (DEBUGLEVEL >= 10) {
13258 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDataEx, &r);
13261 status = cli->dispatch(cli,
13262 mem_ctx,
13263 &ndr_table_spoolss,
13264 NDR_SPOOLSS_GETPRINTERDATAEX,
13265 &r);
13267 if (!NT_STATUS_IS_OK(status)) {
13268 return status;
13271 if (DEBUGLEVEL >= 10) {
13272 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDataEx, &r);
13275 if (NT_STATUS_IS_ERR(status)) {
13276 return status;
13279 /* Return variables */
13280 *type = *r.out.type;
13281 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
13282 *needed = *r.out.needed;
13284 /* Return result */
13285 if (werror) {
13286 *werror = r.out.result;
13289 return werror_to_ntstatus(r.out.result);
13292 struct rpccli_spoolss_EnumPrinterDataEx_state {
13293 struct spoolss_EnumPrinterDataEx orig;
13294 struct spoolss_EnumPrinterDataEx tmp;
13295 TALLOC_CTX *out_mem_ctx;
13296 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
13299 static void rpccli_spoolss_EnumPrinterDataEx_done(struct tevent_req *subreq);
13301 struct tevent_req *rpccli_spoolss_EnumPrinterDataEx_send(TALLOC_CTX *mem_ctx,
13302 struct tevent_context *ev,
13303 struct rpc_pipe_client *cli,
13304 struct policy_handle *_handle /* [in] [ref] */,
13305 const char *_key_name /* [in] [charset(UTF16)] */,
13306 uint32_t _offered /* [in] */,
13307 uint32_t *_count /* [out] [ref] */,
13308 struct spoolss_PrinterEnumValues **_info /* [out] [ref,size_is(,*count)] */,
13309 uint32_t *_needed /* [out] [ref] */)
13311 struct tevent_req *req;
13312 struct rpccli_spoolss_EnumPrinterDataEx_state *state;
13313 struct tevent_req *subreq;
13315 req = tevent_req_create(mem_ctx, &state,
13316 struct rpccli_spoolss_EnumPrinterDataEx_state);
13317 if (req == NULL) {
13318 return NULL;
13320 state->out_mem_ctx = NULL;
13321 state->dispatch_recv = cli->dispatch_recv;
13323 /* In parameters */
13324 state->orig.in.handle = _handle;
13325 state->orig.in.key_name = _key_name;
13326 state->orig.in.offered = _offered;
13328 /* Out parameters */
13329 state->orig.out.count = _count;
13330 state->orig.out.info = _info;
13331 state->orig.out.needed = _needed;
13333 /* Result */
13334 ZERO_STRUCT(state->orig.out.result);
13336 if (DEBUGLEVEL >= 10) {
13337 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDataEx, &state->orig);
13340 state->out_mem_ctx = talloc_named_const(state, 0,
13341 "rpccli_spoolss_EnumPrinterDataEx_out_memory");
13342 if (tevent_req_nomem(state->out_mem_ctx, req)) {
13343 return tevent_req_post(req, ev);
13346 /* make a temporary copy, that we pass to the dispatch function */
13347 state->tmp = state->orig;
13349 subreq = cli->dispatch_send(state, ev, cli,
13350 &ndr_table_spoolss,
13351 NDR_SPOOLSS_ENUMPRINTERDATAEX,
13352 &state->tmp);
13353 if (tevent_req_nomem(subreq, req)) {
13354 return tevent_req_post(req, ev);
13356 tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrinterDataEx_done, req);
13357 return req;
13360 static void rpccli_spoolss_EnumPrinterDataEx_done(struct tevent_req *subreq)
13362 struct tevent_req *req = tevent_req_callback_data(
13363 subreq, struct tevent_req);
13364 struct rpccli_spoolss_EnumPrinterDataEx_state *state = tevent_req_data(
13365 req, struct rpccli_spoolss_EnumPrinterDataEx_state);
13366 NTSTATUS status;
13367 TALLOC_CTX *mem_ctx;
13369 if (state->out_mem_ctx) {
13370 mem_ctx = state->out_mem_ctx;
13371 } else {
13372 mem_ctx = state;
13375 status = state->dispatch_recv(subreq, mem_ctx);
13376 TALLOC_FREE(subreq);
13377 if (!NT_STATUS_IS_OK(status)) {
13378 tevent_req_nterror(req, status);
13379 return;
13382 /* Copy out parameters */
13383 *state->orig.out.count = *state->tmp.out.count;
13384 *state->orig.out.info = *state->tmp.out.info;
13385 *state->orig.out.needed = *state->tmp.out.needed;
13387 /* Copy result */
13388 state->orig.out.result = state->tmp.out.result;
13390 /* Reset temporary structure */
13391 ZERO_STRUCT(state->tmp);
13393 if (DEBUGLEVEL >= 10) {
13394 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDataEx, &state->orig);
13397 tevent_req_done(req);
13400 NTSTATUS rpccli_spoolss_EnumPrinterDataEx_recv(struct tevent_req *req,
13401 TALLOC_CTX *mem_ctx,
13402 WERROR *result)
13404 struct rpccli_spoolss_EnumPrinterDataEx_state *state = tevent_req_data(
13405 req, struct rpccli_spoolss_EnumPrinterDataEx_state);
13406 NTSTATUS status;
13408 if (tevent_req_is_nterror(req, &status)) {
13409 tevent_req_received(req);
13410 return status;
13413 /* Steal possbile out parameters to the callers context */
13414 talloc_steal(mem_ctx, state->out_mem_ctx);
13416 /* Return result */
13417 *result = state->orig.out.result;
13419 tevent_req_received(req);
13420 return NT_STATUS_OK;
13423 NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
13424 TALLOC_CTX *mem_ctx,
13425 struct policy_handle *handle /* [in] [ref] */,
13426 const char *key_name /* [in] [charset(UTF16)] */,
13427 uint32_t offered /* [in] */,
13428 uint32_t *count /* [out] [ref] */,
13429 struct spoolss_PrinterEnumValues **info /* [out] [ref,size_is(,*count)] */,
13430 uint32_t *needed /* [out] [ref] */,
13431 WERROR *werror)
13433 struct spoolss_EnumPrinterDataEx r;
13434 NTSTATUS status;
13436 /* In parameters */
13437 r.in.handle = handle;
13438 r.in.key_name = key_name;
13439 r.in.offered = offered;
13441 if (DEBUGLEVEL >= 10) {
13442 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDataEx, &r);
13445 status = cli->dispatch(cli,
13446 mem_ctx,
13447 &ndr_table_spoolss,
13448 NDR_SPOOLSS_ENUMPRINTERDATAEX,
13449 &r);
13451 if (!NT_STATUS_IS_OK(status)) {
13452 return status;
13455 if (DEBUGLEVEL >= 10) {
13456 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDataEx, &r);
13459 if (NT_STATUS_IS_ERR(status)) {
13460 return status;
13463 /* Return variables */
13464 *count = *r.out.count;
13465 *info = *r.out.info;
13466 *needed = *r.out.needed;
13468 /* Return result */
13469 if (werror) {
13470 *werror = r.out.result;
13473 return werror_to_ntstatus(r.out.result);
13476 struct rpccli_spoolss_EnumPrinterKey_state {
13477 struct spoolss_EnumPrinterKey orig;
13478 struct spoolss_EnumPrinterKey tmp;
13479 TALLOC_CTX *out_mem_ctx;
13480 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
13483 static void rpccli_spoolss_EnumPrinterKey_done(struct tevent_req *subreq);
13485 struct tevent_req *rpccli_spoolss_EnumPrinterKey_send(TALLOC_CTX *mem_ctx,
13486 struct tevent_context *ev,
13487 struct rpc_pipe_client *cli,
13488 struct policy_handle *_handle /* [in] [ref] */,
13489 const char *_key_name /* [in] [charset(UTF16)] */,
13490 const char ** *_key_buffer /* [out] [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */,
13491 uint32_t _offered /* [in] */,
13492 uint32_t *_needed /* [out] [ref] */)
13494 struct tevent_req *req;
13495 struct rpccli_spoolss_EnumPrinterKey_state *state;
13496 struct tevent_req *subreq;
13498 req = tevent_req_create(mem_ctx, &state,
13499 struct rpccli_spoolss_EnumPrinterKey_state);
13500 if (req == NULL) {
13501 return NULL;
13503 state->out_mem_ctx = NULL;
13504 state->dispatch_recv = cli->dispatch_recv;
13506 /* In parameters */
13507 state->orig.in.handle = _handle;
13508 state->orig.in.key_name = _key_name;
13509 state->orig.in.offered = _offered;
13511 /* Out parameters */
13512 state->orig.out.key_buffer = _key_buffer;
13513 state->orig.out.needed = _needed;
13515 /* Result */
13516 ZERO_STRUCT(state->orig.out.result);
13518 if (DEBUGLEVEL >= 10) {
13519 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &state->orig);
13522 state->out_mem_ctx = talloc_named_const(state, 0,
13523 "rpccli_spoolss_EnumPrinterKey_out_memory");
13524 if (tevent_req_nomem(state->out_mem_ctx, req)) {
13525 return tevent_req_post(req, ev);
13528 /* make a temporary copy, that we pass to the dispatch function */
13529 state->tmp = state->orig;
13531 subreq = cli->dispatch_send(state, ev, cli,
13532 &ndr_table_spoolss,
13533 NDR_SPOOLSS_ENUMPRINTERKEY,
13534 &state->tmp);
13535 if (tevent_req_nomem(subreq, req)) {
13536 return tevent_req_post(req, ev);
13538 tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrinterKey_done, req);
13539 return req;
13542 static void rpccli_spoolss_EnumPrinterKey_done(struct tevent_req *subreq)
13544 struct tevent_req *req = tevent_req_callback_data(
13545 subreq, struct tevent_req);
13546 struct rpccli_spoolss_EnumPrinterKey_state *state = tevent_req_data(
13547 req, struct rpccli_spoolss_EnumPrinterKey_state);
13548 NTSTATUS status;
13549 TALLOC_CTX *mem_ctx;
13551 if (state->out_mem_ctx) {
13552 mem_ctx = state->out_mem_ctx;
13553 } else {
13554 mem_ctx = state;
13557 status = state->dispatch_recv(subreq, mem_ctx);
13558 TALLOC_FREE(subreq);
13559 if (!NT_STATUS_IS_OK(status)) {
13560 tevent_req_nterror(req, status);
13561 return;
13564 /* Copy out parameters */
13565 *state->orig.out.key_buffer = *state->tmp.out.key_buffer;
13566 *state->orig.out.needed = *state->tmp.out.needed;
13568 /* Copy result */
13569 state->orig.out.result = state->tmp.out.result;
13571 /* Reset temporary structure */
13572 ZERO_STRUCT(state->tmp);
13574 if (DEBUGLEVEL >= 10) {
13575 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterKey, &state->orig);
13578 tevent_req_done(req);
13581 NTSTATUS rpccli_spoolss_EnumPrinterKey_recv(struct tevent_req *req,
13582 TALLOC_CTX *mem_ctx,
13583 WERROR *result)
13585 struct rpccli_spoolss_EnumPrinterKey_state *state = tevent_req_data(
13586 req, struct rpccli_spoolss_EnumPrinterKey_state);
13587 NTSTATUS status;
13589 if (tevent_req_is_nterror(req, &status)) {
13590 tevent_req_received(req);
13591 return status;
13594 /* Steal possbile out parameters to the callers context */
13595 talloc_steal(mem_ctx, state->out_mem_ctx);
13597 /* Return result */
13598 *result = state->orig.out.result;
13600 tevent_req_received(req);
13601 return NT_STATUS_OK;
13604 NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
13605 TALLOC_CTX *mem_ctx,
13606 struct policy_handle *handle /* [in] [ref] */,
13607 const char *key_name /* [in] [charset(UTF16)] */,
13608 const char ** *key_buffer /* [out] [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */,
13609 uint32_t offered /* [in] */,
13610 uint32_t *needed /* [out] [ref] */,
13611 WERROR *werror)
13613 struct spoolss_EnumPrinterKey r;
13614 NTSTATUS status;
13616 /* In parameters */
13617 r.in.handle = handle;
13618 r.in.key_name = key_name;
13619 r.in.offered = offered;
13621 if (DEBUGLEVEL >= 10) {
13622 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &r);
13625 status = cli->dispatch(cli,
13626 mem_ctx,
13627 &ndr_table_spoolss,
13628 NDR_SPOOLSS_ENUMPRINTERKEY,
13629 &r);
13631 if (!NT_STATUS_IS_OK(status)) {
13632 return status;
13635 if (DEBUGLEVEL >= 10) {
13636 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterKey, &r);
13639 if (NT_STATUS_IS_ERR(status)) {
13640 return status;
13643 /* Return variables */
13644 *key_buffer = *r.out.key_buffer;
13645 *needed = *r.out.needed;
13647 /* Return result */
13648 if (werror) {
13649 *werror = r.out.result;
13652 return werror_to_ntstatus(r.out.result);
13655 struct rpccli_spoolss_DeletePrinterDataEx_state {
13656 struct spoolss_DeletePrinterDataEx orig;
13657 struct spoolss_DeletePrinterDataEx tmp;
13658 TALLOC_CTX *out_mem_ctx;
13659 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
13662 static void rpccli_spoolss_DeletePrinterDataEx_done(struct tevent_req *subreq);
13664 struct tevent_req *rpccli_spoolss_DeletePrinterDataEx_send(TALLOC_CTX *mem_ctx,
13665 struct tevent_context *ev,
13666 struct rpc_pipe_client *cli,
13667 struct policy_handle *_handle /* [in] [ref] */,
13668 const char *_key_name /* [in] [charset(UTF16)] */,
13669 const char *_value_name /* [in] [charset(UTF16)] */)
13671 struct tevent_req *req;
13672 struct rpccli_spoolss_DeletePrinterDataEx_state *state;
13673 struct tevent_req *subreq;
13675 req = tevent_req_create(mem_ctx, &state,
13676 struct rpccli_spoolss_DeletePrinterDataEx_state);
13677 if (req == NULL) {
13678 return NULL;
13680 state->out_mem_ctx = NULL;
13681 state->dispatch_recv = cli->dispatch_recv;
13683 /* In parameters */
13684 state->orig.in.handle = _handle;
13685 state->orig.in.key_name = _key_name;
13686 state->orig.in.value_name = _value_name;
13688 /* Out parameters */
13690 /* Result */
13691 ZERO_STRUCT(state->orig.out.result);
13693 if (DEBUGLEVEL >= 10) {
13694 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDataEx, &state->orig);
13697 /* make a temporary copy, that we pass to the dispatch function */
13698 state->tmp = state->orig;
13700 subreq = cli->dispatch_send(state, ev, cli,
13701 &ndr_table_spoolss,
13702 NDR_SPOOLSS_DELETEPRINTERDATAEX,
13703 &state->tmp);
13704 if (tevent_req_nomem(subreq, req)) {
13705 return tevent_req_post(req, ev);
13707 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterDataEx_done, req);
13708 return req;
13711 static void rpccli_spoolss_DeletePrinterDataEx_done(struct tevent_req *subreq)
13713 struct tevent_req *req = tevent_req_callback_data(
13714 subreq, struct tevent_req);
13715 struct rpccli_spoolss_DeletePrinterDataEx_state *state = tevent_req_data(
13716 req, struct rpccli_spoolss_DeletePrinterDataEx_state);
13717 NTSTATUS status;
13718 TALLOC_CTX *mem_ctx;
13720 if (state->out_mem_ctx) {
13721 mem_ctx = state->out_mem_ctx;
13722 } else {
13723 mem_ctx = state;
13726 status = state->dispatch_recv(subreq, mem_ctx);
13727 TALLOC_FREE(subreq);
13728 if (!NT_STATUS_IS_OK(status)) {
13729 tevent_req_nterror(req, status);
13730 return;
13733 /* Copy out parameters */
13735 /* Copy result */
13736 state->orig.out.result = state->tmp.out.result;
13738 /* Reset temporary structure */
13739 ZERO_STRUCT(state->tmp);
13741 if (DEBUGLEVEL >= 10) {
13742 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDataEx, &state->orig);
13745 tevent_req_done(req);
13748 NTSTATUS rpccli_spoolss_DeletePrinterDataEx_recv(struct tevent_req *req,
13749 TALLOC_CTX *mem_ctx,
13750 WERROR *result)
13752 struct rpccli_spoolss_DeletePrinterDataEx_state *state = tevent_req_data(
13753 req, struct rpccli_spoolss_DeletePrinterDataEx_state);
13754 NTSTATUS status;
13756 if (tevent_req_is_nterror(req, &status)) {
13757 tevent_req_received(req);
13758 return status;
13761 /* Steal possbile out parameters to the callers context */
13762 talloc_steal(mem_ctx, state->out_mem_ctx);
13764 /* Return result */
13765 *result = state->orig.out.result;
13767 tevent_req_received(req);
13768 return NT_STATUS_OK;
13771 NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
13772 TALLOC_CTX *mem_ctx,
13773 struct policy_handle *handle /* [in] [ref] */,
13774 const char *key_name /* [in] [charset(UTF16)] */,
13775 const char *value_name /* [in] [charset(UTF16)] */,
13776 WERROR *werror)
13778 struct spoolss_DeletePrinterDataEx r;
13779 NTSTATUS status;
13781 /* In parameters */
13782 r.in.handle = handle;
13783 r.in.key_name = key_name;
13784 r.in.value_name = value_name;
13786 if (DEBUGLEVEL >= 10) {
13787 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDataEx, &r);
13790 status = cli->dispatch(cli,
13791 mem_ctx,
13792 &ndr_table_spoolss,
13793 NDR_SPOOLSS_DELETEPRINTERDATAEX,
13794 &r);
13796 if (!NT_STATUS_IS_OK(status)) {
13797 return status;
13800 if (DEBUGLEVEL >= 10) {
13801 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDataEx, &r);
13804 if (NT_STATUS_IS_ERR(status)) {
13805 return status;
13808 /* Return variables */
13810 /* Return result */
13811 if (werror) {
13812 *werror = r.out.result;
13815 return werror_to_ntstatus(r.out.result);
13818 struct rpccli_spoolss_DeletePrinterKey_state {
13819 struct spoolss_DeletePrinterKey orig;
13820 struct spoolss_DeletePrinterKey tmp;
13821 TALLOC_CTX *out_mem_ctx;
13822 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
13825 static void rpccli_spoolss_DeletePrinterKey_done(struct tevent_req *subreq);
13827 struct tevent_req *rpccli_spoolss_DeletePrinterKey_send(TALLOC_CTX *mem_ctx,
13828 struct tevent_context *ev,
13829 struct rpc_pipe_client *cli,
13830 struct policy_handle *_handle /* [in] [ref] */,
13831 const char *_key_name /* [in] [charset(UTF16)] */)
13833 struct tevent_req *req;
13834 struct rpccli_spoolss_DeletePrinterKey_state *state;
13835 struct tevent_req *subreq;
13837 req = tevent_req_create(mem_ctx, &state,
13838 struct rpccli_spoolss_DeletePrinterKey_state);
13839 if (req == NULL) {
13840 return NULL;
13842 state->out_mem_ctx = NULL;
13843 state->dispatch_recv = cli->dispatch_recv;
13845 /* In parameters */
13846 state->orig.in.handle = _handle;
13847 state->orig.in.key_name = _key_name;
13849 /* Out parameters */
13851 /* Result */
13852 ZERO_STRUCT(state->orig.out.result);
13854 if (DEBUGLEVEL >= 10) {
13855 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, &state->orig);
13858 /* make a temporary copy, that we pass to the dispatch function */
13859 state->tmp = state->orig;
13861 subreq = cli->dispatch_send(state, ev, cli,
13862 &ndr_table_spoolss,
13863 NDR_SPOOLSS_DELETEPRINTERKEY,
13864 &state->tmp);
13865 if (tevent_req_nomem(subreq, req)) {
13866 return tevent_req_post(req, ev);
13868 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterKey_done, req);
13869 return req;
13872 static void rpccli_spoolss_DeletePrinterKey_done(struct tevent_req *subreq)
13874 struct tevent_req *req = tevent_req_callback_data(
13875 subreq, struct tevent_req);
13876 struct rpccli_spoolss_DeletePrinterKey_state *state = tevent_req_data(
13877 req, struct rpccli_spoolss_DeletePrinterKey_state);
13878 NTSTATUS status;
13879 TALLOC_CTX *mem_ctx;
13881 if (state->out_mem_ctx) {
13882 mem_ctx = state->out_mem_ctx;
13883 } else {
13884 mem_ctx = state;
13887 status = state->dispatch_recv(subreq, mem_ctx);
13888 TALLOC_FREE(subreq);
13889 if (!NT_STATUS_IS_OK(status)) {
13890 tevent_req_nterror(req, status);
13891 return;
13894 /* Copy out parameters */
13896 /* Copy result */
13897 state->orig.out.result = state->tmp.out.result;
13899 /* Reset temporary structure */
13900 ZERO_STRUCT(state->tmp);
13902 if (DEBUGLEVEL >= 10) {
13903 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterKey, &state->orig);
13906 tevent_req_done(req);
13909 NTSTATUS rpccli_spoolss_DeletePrinterKey_recv(struct tevent_req *req,
13910 TALLOC_CTX *mem_ctx,
13911 WERROR *result)
13913 struct rpccli_spoolss_DeletePrinterKey_state *state = tevent_req_data(
13914 req, struct rpccli_spoolss_DeletePrinterKey_state);
13915 NTSTATUS status;
13917 if (tevent_req_is_nterror(req, &status)) {
13918 tevent_req_received(req);
13919 return status;
13922 /* Steal possbile out parameters to the callers context */
13923 talloc_steal(mem_ctx, state->out_mem_ctx);
13925 /* Return result */
13926 *result = state->orig.out.result;
13928 tevent_req_received(req);
13929 return NT_STATUS_OK;
13932 NTSTATUS rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client *cli,
13933 TALLOC_CTX *mem_ctx,
13934 struct policy_handle *handle /* [in] [ref] */,
13935 const char *key_name /* [in] [charset(UTF16)] */,
13936 WERROR *werror)
13938 struct spoolss_DeletePrinterKey r;
13939 NTSTATUS status;
13941 /* In parameters */
13942 r.in.handle = handle;
13943 r.in.key_name = key_name;
13945 if (DEBUGLEVEL >= 10) {
13946 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, &r);
13949 status = cli->dispatch(cli,
13950 mem_ctx,
13951 &ndr_table_spoolss,
13952 NDR_SPOOLSS_DELETEPRINTERKEY,
13953 &r);
13955 if (!NT_STATUS_IS_OK(status)) {
13956 return status;
13959 if (DEBUGLEVEL >= 10) {
13960 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterKey, &r);
13963 if (NT_STATUS_IS_ERR(status)) {
13964 return status;
13967 /* Return variables */
13969 /* Return result */
13970 if (werror) {
13971 *werror = r.out.result;
13974 return werror_to_ntstatus(r.out.result);
13977 struct rpccli_spoolss_53_state {
13978 struct spoolss_53 orig;
13979 struct spoolss_53 tmp;
13980 TALLOC_CTX *out_mem_ctx;
13981 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
13984 static void rpccli_spoolss_53_done(struct tevent_req *subreq);
13986 struct tevent_req *rpccli_spoolss_53_send(TALLOC_CTX *mem_ctx,
13987 struct tevent_context *ev,
13988 struct rpc_pipe_client *cli)
13990 struct tevent_req *req;
13991 struct rpccli_spoolss_53_state *state;
13992 struct tevent_req *subreq;
13994 req = tevent_req_create(mem_ctx, &state,
13995 struct rpccli_spoolss_53_state);
13996 if (req == NULL) {
13997 return NULL;
13999 state->out_mem_ctx = NULL;
14000 state->dispatch_recv = cli->dispatch_recv;
14002 /* In parameters */
14004 /* Out parameters */
14006 /* Result */
14007 ZERO_STRUCT(state->orig.out.result);
14009 if (DEBUGLEVEL >= 10) {
14010 NDR_PRINT_IN_DEBUG(spoolss_53, &state->orig);
14013 /* make a temporary copy, that we pass to the dispatch function */
14014 state->tmp = state->orig;
14016 subreq = cli->dispatch_send(state, ev, cli,
14017 &ndr_table_spoolss,
14018 NDR_SPOOLSS_53,
14019 &state->tmp);
14020 if (tevent_req_nomem(subreq, req)) {
14021 return tevent_req_post(req, ev);
14023 tevent_req_set_callback(subreq, rpccli_spoolss_53_done, req);
14024 return req;
14027 static void rpccli_spoolss_53_done(struct tevent_req *subreq)
14029 struct tevent_req *req = tevent_req_callback_data(
14030 subreq, struct tevent_req);
14031 struct rpccli_spoolss_53_state *state = tevent_req_data(
14032 req, struct rpccli_spoolss_53_state);
14033 NTSTATUS status;
14034 TALLOC_CTX *mem_ctx;
14036 if (state->out_mem_ctx) {
14037 mem_ctx = state->out_mem_ctx;
14038 } else {
14039 mem_ctx = state;
14042 status = state->dispatch_recv(subreq, mem_ctx);
14043 TALLOC_FREE(subreq);
14044 if (!NT_STATUS_IS_OK(status)) {
14045 tevent_req_nterror(req, status);
14046 return;
14049 /* Copy out parameters */
14051 /* Copy result */
14052 state->orig.out.result = state->tmp.out.result;
14054 /* Reset temporary structure */
14055 ZERO_STRUCT(state->tmp);
14057 if (DEBUGLEVEL >= 10) {
14058 NDR_PRINT_OUT_DEBUG(spoolss_53, &state->orig);
14061 tevent_req_done(req);
14064 NTSTATUS rpccli_spoolss_53_recv(struct tevent_req *req,
14065 TALLOC_CTX *mem_ctx,
14066 WERROR *result)
14068 struct rpccli_spoolss_53_state *state = tevent_req_data(
14069 req, struct rpccli_spoolss_53_state);
14070 NTSTATUS status;
14072 if (tevent_req_is_nterror(req, &status)) {
14073 tevent_req_received(req);
14074 return status;
14077 /* Steal possbile out parameters to the callers context */
14078 talloc_steal(mem_ctx, state->out_mem_ctx);
14080 /* Return result */
14081 *result = state->orig.out.result;
14083 tevent_req_received(req);
14084 return NT_STATUS_OK;
14087 NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli,
14088 TALLOC_CTX *mem_ctx,
14089 WERROR *werror)
14091 struct spoolss_53 r;
14092 NTSTATUS status;
14094 /* In parameters */
14096 if (DEBUGLEVEL >= 10) {
14097 NDR_PRINT_IN_DEBUG(spoolss_53, &r);
14100 status = cli->dispatch(cli,
14101 mem_ctx,
14102 &ndr_table_spoolss,
14103 NDR_SPOOLSS_53,
14104 &r);
14106 if (!NT_STATUS_IS_OK(status)) {
14107 return status;
14110 if (DEBUGLEVEL >= 10) {
14111 NDR_PRINT_OUT_DEBUG(spoolss_53, &r);
14114 if (NT_STATUS_IS_ERR(status)) {
14115 return status;
14118 /* Return variables */
14120 /* Return result */
14121 if (werror) {
14122 *werror = r.out.result;
14125 return werror_to_ntstatus(r.out.result);
14128 struct rpccli_spoolss_DeletePrinterDriverEx_state {
14129 struct spoolss_DeletePrinterDriverEx orig;
14130 struct spoolss_DeletePrinterDriverEx tmp;
14131 TALLOC_CTX *out_mem_ctx;
14132 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
14135 static void rpccli_spoolss_DeletePrinterDriverEx_done(struct tevent_req *subreq);
14137 struct tevent_req *rpccli_spoolss_DeletePrinterDriverEx_send(TALLOC_CTX *mem_ctx,
14138 struct tevent_context *ev,
14139 struct rpc_pipe_client *cli,
14140 const char *_server /* [in] [unique,charset(UTF16)] */,
14141 const char *_architecture /* [in] [charset(UTF16)] */,
14142 const char *_driver /* [in] [charset(UTF16)] */,
14143 uint32_t _delete_flags /* [in] */,
14144 uint32_t _version /* [in] */)
14146 struct tevent_req *req;
14147 struct rpccli_spoolss_DeletePrinterDriverEx_state *state;
14148 struct tevent_req *subreq;
14150 req = tevent_req_create(mem_ctx, &state,
14151 struct rpccli_spoolss_DeletePrinterDriverEx_state);
14152 if (req == NULL) {
14153 return NULL;
14155 state->out_mem_ctx = NULL;
14156 state->dispatch_recv = cli->dispatch_recv;
14158 /* In parameters */
14159 state->orig.in.server = _server;
14160 state->orig.in.architecture = _architecture;
14161 state->orig.in.driver = _driver;
14162 state->orig.in.delete_flags = _delete_flags;
14163 state->orig.in.version = _version;
14165 /* Out parameters */
14167 /* Result */
14168 ZERO_STRUCT(state->orig.out.result);
14170 if (DEBUGLEVEL >= 10) {
14171 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, &state->orig);
14174 /* make a temporary copy, that we pass to the dispatch function */
14175 state->tmp = state->orig;
14177 subreq = cli->dispatch_send(state, ev, cli,
14178 &ndr_table_spoolss,
14179 NDR_SPOOLSS_DELETEPRINTERDRIVEREX,
14180 &state->tmp);
14181 if (tevent_req_nomem(subreq, req)) {
14182 return tevent_req_post(req, ev);
14184 tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterDriverEx_done, req);
14185 return req;
14188 static void rpccli_spoolss_DeletePrinterDriverEx_done(struct tevent_req *subreq)
14190 struct tevent_req *req = tevent_req_callback_data(
14191 subreq, struct tevent_req);
14192 struct rpccli_spoolss_DeletePrinterDriverEx_state *state = tevent_req_data(
14193 req, struct rpccli_spoolss_DeletePrinterDriverEx_state);
14194 NTSTATUS status;
14195 TALLOC_CTX *mem_ctx;
14197 if (state->out_mem_ctx) {
14198 mem_ctx = state->out_mem_ctx;
14199 } else {
14200 mem_ctx = state;
14203 status = state->dispatch_recv(subreq, mem_ctx);
14204 TALLOC_FREE(subreq);
14205 if (!NT_STATUS_IS_OK(status)) {
14206 tevent_req_nterror(req, status);
14207 return;
14210 /* Copy out parameters */
14212 /* Copy result */
14213 state->orig.out.result = state->tmp.out.result;
14215 /* Reset temporary structure */
14216 ZERO_STRUCT(state->tmp);
14218 if (DEBUGLEVEL >= 10) {
14219 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriverEx, &state->orig);
14222 tevent_req_done(req);
14225 NTSTATUS rpccli_spoolss_DeletePrinterDriverEx_recv(struct tevent_req *req,
14226 TALLOC_CTX *mem_ctx,
14227 WERROR *result)
14229 struct rpccli_spoolss_DeletePrinterDriverEx_state *state = tevent_req_data(
14230 req, struct rpccli_spoolss_DeletePrinterDriverEx_state);
14231 NTSTATUS status;
14233 if (tevent_req_is_nterror(req, &status)) {
14234 tevent_req_received(req);
14235 return status;
14238 /* Steal possbile out parameters to the callers context */
14239 talloc_steal(mem_ctx, state->out_mem_ctx);
14241 /* Return result */
14242 *result = state->orig.out.result;
14244 tevent_req_received(req);
14245 return NT_STATUS_OK;
14248 NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli,
14249 TALLOC_CTX *mem_ctx,
14250 const char *server /* [in] [unique,charset(UTF16)] */,
14251 const char *architecture /* [in] [charset(UTF16)] */,
14252 const char *driver /* [in] [charset(UTF16)] */,
14253 uint32_t delete_flags /* [in] */,
14254 uint32_t version /* [in] */,
14255 WERROR *werror)
14257 struct spoolss_DeletePrinterDriverEx r;
14258 NTSTATUS status;
14260 /* In parameters */
14261 r.in.server = server;
14262 r.in.architecture = architecture;
14263 r.in.driver = driver;
14264 r.in.delete_flags = delete_flags;
14265 r.in.version = version;
14267 if (DEBUGLEVEL >= 10) {
14268 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, &r);
14271 status = cli->dispatch(cli,
14272 mem_ctx,
14273 &ndr_table_spoolss,
14274 NDR_SPOOLSS_DELETEPRINTERDRIVEREX,
14275 &r);
14277 if (!NT_STATUS_IS_OK(status)) {
14278 return status;
14281 if (DEBUGLEVEL >= 10) {
14282 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriverEx, &r);
14285 if (NT_STATUS_IS_ERR(status)) {
14286 return status;
14289 /* Return variables */
14291 /* Return result */
14292 if (werror) {
14293 *werror = r.out.result;
14296 return werror_to_ntstatus(r.out.result);
14299 struct rpccli_spoolss_55_state {
14300 struct spoolss_55 orig;
14301 struct spoolss_55 tmp;
14302 TALLOC_CTX *out_mem_ctx;
14303 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
14306 static void rpccli_spoolss_55_done(struct tevent_req *subreq);
14308 struct tevent_req *rpccli_spoolss_55_send(TALLOC_CTX *mem_ctx,
14309 struct tevent_context *ev,
14310 struct rpc_pipe_client *cli)
14312 struct tevent_req *req;
14313 struct rpccli_spoolss_55_state *state;
14314 struct tevent_req *subreq;
14316 req = tevent_req_create(mem_ctx, &state,
14317 struct rpccli_spoolss_55_state);
14318 if (req == NULL) {
14319 return NULL;
14321 state->out_mem_ctx = NULL;
14322 state->dispatch_recv = cli->dispatch_recv;
14324 /* In parameters */
14326 /* Out parameters */
14328 /* Result */
14329 ZERO_STRUCT(state->orig.out.result);
14331 if (DEBUGLEVEL >= 10) {
14332 NDR_PRINT_IN_DEBUG(spoolss_55, &state->orig);
14335 /* make a temporary copy, that we pass to the dispatch function */
14336 state->tmp = state->orig;
14338 subreq = cli->dispatch_send(state, ev, cli,
14339 &ndr_table_spoolss,
14340 NDR_SPOOLSS_55,
14341 &state->tmp);
14342 if (tevent_req_nomem(subreq, req)) {
14343 return tevent_req_post(req, ev);
14345 tevent_req_set_callback(subreq, rpccli_spoolss_55_done, req);
14346 return req;
14349 static void rpccli_spoolss_55_done(struct tevent_req *subreq)
14351 struct tevent_req *req = tevent_req_callback_data(
14352 subreq, struct tevent_req);
14353 struct rpccli_spoolss_55_state *state = tevent_req_data(
14354 req, struct rpccli_spoolss_55_state);
14355 NTSTATUS status;
14356 TALLOC_CTX *mem_ctx;
14358 if (state->out_mem_ctx) {
14359 mem_ctx = state->out_mem_ctx;
14360 } else {
14361 mem_ctx = state;
14364 status = state->dispatch_recv(subreq, mem_ctx);
14365 TALLOC_FREE(subreq);
14366 if (!NT_STATUS_IS_OK(status)) {
14367 tevent_req_nterror(req, status);
14368 return;
14371 /* Copy out parameters */
14373 /* Copy result */
14374 state->orig.out.result = state->tmp.out.result;
14376 /* Reset temporary structure */
14377 ZERO_STRUCT(state->tmp);
14379 if (DEBUGLEVEL >= 10) {
14380 NDR_PRINT_OUT_DEBUG(spoolss_55, &state->orig);
14383 tevent_req_done(req);
14386 NTSTATUS rpccli_spoolss_55_recv(struct tevent_req *req,
14387 TALLOC_CTX *mem_ctx,
14388 WERROR *result)
14390 struct rpccli_spoolss_55_state *state = tevent_req_data(
14391 req, struct rpccli_spoolss_55_state);
14392 NTSTATUS status;
14394 if (tevent_req_is_nterror(req, &status)) {
14395 tevent_req_received(req);
14396 return status;
14399 /* Steal possbile out parameters to the callers context */
14400 talloc_steal(mem_ctx, state->out_mem_ctx);
14402 /* Return result */
14403 *result = state->orig.out.result;
14405 tevent_req_received(req);
14406 return NT_STATUS_OK;
14409 NTSTATUS rpccli_spoolss_55(struct rpc_pipe_client *cli,
14410 TALLOC_CTX *mem_ctx,
14411 WERROR *werror)
14413 struct spoolss_55 r;
14414 NTSTATUS status;
14416 /* In parameters */
14418 if (DEBUGLEVEL >= 10) {
14419 NDR_PRINT_IN_DEBUG(spoolss_55, &r);
14422 status = cli->dispatch(cli,
14423 mem_ctx,
14424 &ndr_table_spoolss,
14425 NDR_SPOOLSS_55,
14426 &r);
14428 if (!NT_STATUS_IS_OK(status)) {
14429 return status;
14432 if (DEBUGLEVEL >= 10) {
14433 NDR_PRINT_OUT_DEBUG(spoolss_55, &r);
14436 if (NT_STATUS_IS_ERR(status)) {
14437 return status;
14440 /* Return variables */
14442 /* Return result */
14443 if (werror) {
14444 *werror = r.out.result;
14447 return werror_to_ntstatus(r.out.result);
14450 struct rpccli_spoolss_56_state {
14451 struct spoolss_56 orig;
14452 struct spoolss_56 tmp;
14453 TALLOC_CTX *out_mem_ctx;
14454 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
14457 static void rpccli_spoolss_56_done(struct tevent_req *subreq);
14459 struct tevent_req *rpccli_spoolss_56_send(TALLOC_CTX *mem_ctx,
14460 struct tevent_context *ev,
14461 struct rpc_pipe_client *cli)
14463 struct tevent_req *req;
14464 struct rpccli_spoolss_56_state *state;
14465 struct tevent_req *subreq;
14467 req = tevent_req_create(mem_ctx, &state,
14468 struct rpccli_spoolss_56_state);
14469 if (req == NULL) {
14470 return NULL;
14472 state->out_mem_ctx = NULL;
14473 state->dispatch_recv = cli->dispatch_recv;
14475 /* In parameters */
14477 /* Out parameters */
14479 /* Result */
14480 ZERO_STRUCT(state->orig.out.result);
14482 if (DEBUGLEVEL >= 10) {
14483 NDR_PRINT_IN_DEBUG(spoolss_56, &state->orig);
14486 /* make a temporary copy, that we pass to the dispatch function */
14487 state->tmp = state->orig;
14489 subreq = cli->dispatch_send(state, ev, cli,
14490 &ndr_table_spoolss,
14491 NDR_SPOOLSS_56,
14492 &state->tmp);
14493 if (tevent_req_nomem(subreq, req)) {
14494 return tevent_req_post(req, ev);
14496 tevent_req_set_callback(subreq, rpccli_spoolss_56_done, req);
14497 return req;
14500 static void rpccli_spoolss_56_done(struct tevent_req *subreq)
14502 struct tevent_req *req = tevent_req_callback_data(
14503 subreq, struct tevent_req);
14504 struct rpccli_spoolss_56_state *state = tevent_req_data(
14505 req, struct rpccli_spoolss_56_state);
14506 NTSTATUS status;
14507 TALLOC_CTX *mem_ctx;
14509 if (state->out_mem_ctx) {
14510 mem_ctx = state->out_mem_ctx;
14511 } else {
14512 mem_ctx = state;
14515 status = state->dispatch_recv(subreq, mem_ctx);
14516 TALLOC_FREE(subreq);
14517 if (!NT_STATUS_IS_OK(status)) {
14518 tevent_req_nterror(req, status);
14519 return;
14522 /* Copy out parameters */
14524 /* Copy result */
14525 state->orig.out.result = state->tmp.out.result;
14527 /* Reset temporary structure */
14528 ZERO_STRUCT(state->tmp);
14530 if (DEBUGLEVEL >= 10) {
14531 NDR_PRINT_OUT_DEBUG(spoolss_56, &state->orig);
14534 tevent_req_done(req);
14537 NTSTATUS rpccli_spoolss_56_recv(struct tevent_req *req,
14538 TALLOC_CTX *mem_ctx,
14539 WERROR *result)
14541 struct rpccli_spoolss_56_state *state = tevent_req_data(
14542 req, struct rpccli_spoolss_56_state);
14543 NTSTATUS status;
14545 if (tevent_req_is_nterror(req, &status)) {
14546 tevent_req_received(req);
14547 return status;
14550 /* Steal possbile out parameters to the callers context */
14551 talloc_steal(mem_ctx, state->out_mem_ctx);
14553 /* Return result */
14554 *result = state->orig.out.result;
14556 tevent_req_received(req);
14557 return NT_STATUS_OK;
14560 NTSTATUS rpccli_spoolss_56(struct rpc_pipe_client *cli,
14561 TALLOC_CTX *mem_ctx,
14562 WERROR *werror)
14564 struct spoolss_56 r;
14565 NTSTATUS status;
14567 /* In parameters */
14569 if (DEBUGLEVEL >= 10) {
14570 NDR_PRINT_IN_DEBUG(spoolss_56, &r);
14573 status = cli->dispatch(cli,
14574 mem_ctx,
14575 &ndr_table_spoolss,
14576 NDR_SPOOLSS_56,
14577 &r);
14579 if (!NT_STATUS_IS_OK(status)) {
14580 return status;
14583 if (DEBUGLEVEL >= 10) {
14584 NDR_PRINT_OUT_DEBUG(spoolss_56, &r);
14587 if (NT_STATUS_IS_ERR(status)) {
14588 return status;
14591 /* Return variables */
14593 /* Return result */
14594 if (werror) {
14595 *werror = r.out.result;
14598 return werror_to_ntstatus(r.out.result);
14601 struct rpccli_spoolss_57_state {
14602 struct spoolss_57 orig;
14603 struct spoolss_57 tmp;
14604 TALLOC_CTX *out_mem_ctx;
14605 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
14608 static void rpccli_spoolss_57_done(struct tevent_req *subreq);
14610 struct tevent_req *rpccli_spoolss_57_send(TALLOC_CTX *mem_ctx,
14611 struct tevent_context *ev,
14612 struct rpc_pipe_client *cli)
14614 struct tevent_req *req;
14615 struct rpccli_spoolss_57_state *state;
14616 struct tevent_req *subreq;
14618 req = tevent_req_create(mem_ctx, &state,
14619 struct rpccli_spoolss_57_state);
14620 if (req == NULL) {
14621 return NULL;
14623 state->out_mem_ctx = NULL;
14624 state->dispatch_recv = cli->dispatch_recv;
14626 /* In parameters */
14628 /* Out parameters */
14630 /* Result */
14631 ZERO_STRUCT(state->orig.out.result);
14633 if (DEBUGLEVEL >= 10) {
14634 NDR_PRINT_IN_DEBUG(spoolss_57, &state->orig);
14637 /* make a temporary copy, that we pass to the dispatch function */
14638 state->tmp = state->orig;
14640 subreq = cli->dispatch_send(state, ev, cli,
14641 &ndr_table_spoolss,
14642 NDR_SPOOLSS_57,
14643 &state->tmp);
14644 if (tevent_req_nomem(subreq, req)) {
14645 return tevent_req_post(req, ev);
14647 tevent_req_set_callback(subreq, rpccli_spoolss_57_done, req);
14648 return req;
14651 static void rpccli_spoolss_57_done(struct tevent_req *subreq)
14653 struct tevent_req *req = tevent_req_callback_data(
14654 subreq, struct tevent_req);
14655 struct rpccli_spoolss_57_state *state = tevent_req_data(
14656 req, struct rpccli_spoolss_57_state);
14657 NTSTATUS status;
14658 TALLOC_CTX *mem_ctx;
14660 if (state->out_mem_ctx) {
14661 mem_ctx = state->out_mem_ctx;
14662 } else {
14663 mem_ctx = state;
14666 status = state->dispatch_recv(subreq, mem_ctx);
14667 TALLOC_FREE(subreq);
14668 if (!NT_STATUS_IS_OK(status)) {
14669 tevent_req_nterror(req, status);
14670 return;
14673 /* Copy out parameters */
14675 /* Copy result */
14676 state->orig.out.result = state->tmp.out.result;
14678 /* Reset temporary structure */
14679 ZERO_STRUCT(state->tmp);
14681 if (DEBUGLEVEL >= 10) {
14682 NDR_PRINT_OUT_DEBUG(spoolss_57, &state->orig);
14685 tevent_req_done(req);
14688 NTSTATUS rpccli_spoolss_57_recv(struct tevent_req *req,
14689 TALLOC_CTX *mem_ctx,
14690 WERROR *result)
14692 struct rpccli_spoolss_57_state *state = tevent_req_data(
14693 req, struct rpccli_spoolss_57_state);
14694 NTSTATUS status;
14696 if (tevent_req_is_nterror(req, &status)) {
14697 tevent_req_received(req);
14698 return status;
14701 /* Steal possbile out parameters to the callers context */
14702 talloc_steal(mem_ctx, state->out_mem_ctx);
14704 /* Return result */
14705 *result = state->orig.out.result;
14707 tevent_req_received(req);
14708 return NT_STATUS_OK;
14711 NTSTATUS rpccli_spoolss_57(struct rpc_pipe_client *cli,
14712 TALLOC_CTX *mem_ctx,
14713 WERROR *werror)
14715 struct spoolss_57 r;
14716 NTSTATUS status;
14718 /* In parameters */
14720 if (DEBUGLEVEL >= 10) {
14721 NDR_PRINT_IN_DEBUG(spoolss_57, &r);
14724 status = cli->dispatch(cli,
14725 mem_ctx,
14726 &ndr_table_spoolss,
14727 NDR_SPOOLSS_57,
14728 &r);
14730 if (!NT_STATUS_IS_OK(status)) {
14731 return status;
14734 if (DEBUGLEVEL >= 10) {
14735 NDR_PRINT_OUT_DEBUG(spoolss_57, &r);
14738 if (NT_STATUS_IS_ERR(status)) {
14739 return status;
14742 /* Return variables */
14744 /* Return result */
14745 if (werror) {
14746 *werror = r.out.result;
14749 return werror_to_ntstatus(r.out.result);
14752 struct rpccli_spoolss_XcvData_state {
14753 struct spoolss_XcvData orig;
14754 struct spoolss_XcvData tmp;
14755 TALLOC_CTX *out_mem_ctx;
14756 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
14759 static void rpccli_spoolss_XcvData_done(struct tevent_req *subreq);
14761 struct tevent_req *rpccli_spoolss_XcvData_send(TALLOC_CTX *mem_ctx,
14762 struct tevent_context *ev,
14763 struct rpc_pipe_client *cli,
14764 struct policy_handle *_handle /* [in] [ref] */,
14765 const char *_function_name /* [in] [charset(UTF16)] */,
14766 DATA_BLOB _in_data /* [in] */,
14767 uint32_t __in_data_length /* [in] [value(r->in.in_data.length)] */,
14768 uint8_t *_out_data /* [out] [ref,size_is(out_data_size)] */,
14769 uint32_t _out_data_size /* [in] */,
14770 uint32_t *_needed /* [out] [ref] */,
14771 uint32_t *_status_code /* [in,out] [ref] */)
14773 struct tevent_req *req;
14774 struct rpccli_spoolss_XcvData_state *state;
14775 struct tevent_req *subreq;
14777 req = tevent_req_create(mem_ctx, &state,
14778 struct rpccli_spoolss_XcvData_state);
14779 if (req == NULL) {
14780 return NULL;
14782 state->out_mem_ctx = NULL;
14783 state->dispatch_recv = cli->dispatch_recv;
14785 /* In parameters */
14786 state->orig.in.handle = _handle;
14787 state->orig.in.function_name = _function_name;
14788 state->orig.in.in_data = _in_data;
14789 state->orig.in._in_data_length = __in_data_length;
14790 state->orig.in.out_data_size = _out_data_size;
14791 state->orig.in.status_code = _status_code;
14793 /* Out parameters */
14794 state->orig.out.out_data = _out_data;
14795 state->orig.out.needed = _needed;
14796 state->orig.out.status_code = _status_code;
14798 /* Result */
14799 ZERO_STRUCT(state->orig.out.result);
14801 if (DEBUGLEVEL >= 10) {
14802 NDR_PRINT_IN_DEBUG(spoolss_XcvData, &state->orig);
14805 state->out_mem_ctx = talloc_named_const(state, 0,
14806 "rpccli_spoolss_XcvData_out_memory");
14807 if (tevent_req_nomem(state->out_mem_ctx, req)) {
14808 return tevent_req_post(req, ev);
14811 /* make a temporary copy, that we pass to the dispatch function */
14812 state->tmp = state->orig;
14814 subreq = cli->dispatch_send(state, ev, cli,
14815 &ndr_table_spoolss,
14816 NDR_SPOOLSS_XCVDATA,
14817 &state->tmp);
14818 if (tevent_req_nomem(subreq, req)) {
14819 return tevent_req_post(req, ev);
14821 tevent_req_set_callback(subreq, rpccli_spoolss_XcvData_done, req);
14822 return req;
14825 static void rpccli_spoolss_XcvData_done(struct tevent_req *subreq)
14827 struct tevent_req *req = tevent_req_callback_data(
14828 subreq, struct tevent_req);
14829 struct rpccli_spoolss_XcvData_state *state = tevent_req_data(
14830 req, struct rpccli_spoolss_XcvData_state);
14831 NTSTATUS status;
14832 TALLOC_CTX *mem_ctx;
14834 if (state->out_mem_ctx) {
14835 mem_ctx = state->out_mem_ctx;
14836 } else {
14837 mem_ctx = state;
14840 status = state->dispatch_recv(subreq, mem_ctx);
14841 TALLOC_FREE(subreq);
14842 if (!NT_STATUS_IS_OK(status)) {
14843 tevent_req_nterror(req, status);
14844 return;
14847 /* Copy out parameters */
14848 memcpy(state->orig.out.out_data, state->tmp.out.out_data, state->tmp.in.out_data_size * sizeof(*state->orig.out.out_data));
14849 *state->orig.out.needed = *state->tmp.out.needed;
14850 *state->orig.out.status_code = *state->tmp.out.status_code;
14852 /* Copy result */
14853 state->orig.out.result = state->tmp.out.result;
14855 /* Reset temporary structure */
14856 ZERO_STRUCT(state->tmp);
14858 if (DEBUGLEVEL >= 10) {
14859 NDR_PRINT_OUT_DEBUG(spoolss_XcvData, &state->orig);
14862 tevent_req_done(req);
14865 NTSTATUS rpccli_spoolss_XcvData_recv(struct tevent_req *req,
14866 TALLOC_CTX *mem_ctx,
14867 WERROR *result)
14869 struct rpccli_spoolss_XcvData_state *state = tevent_req_data(
14870 req, struct rpccli_spoolss_XcvData_state);
14871 NTSTATUS status;
14873 if (tevent_req_is_nterror(req, &status)) {
14874 tevent_req_received(req);
14875 return status;
14878 /* Steal possbile out parameters to the callers context */
14879 talloc_steal(mem_ctx, state->out_mem_ctx);
14881 /* Return result */
14882 *result = state->orig.out.result;
14884 tevent_req_received(req);
14885 return NT_STATUS_OK;
14888 NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
14889 TALLOC_CTX *mem_ctx,
14890 struct policy_handle *handle /* [in] [ref] */,
14891 const char *function_name /* [in] [charset(UTF16)] */,
14892 DATA_BLOB in_data /* [in] */,
14893 uint32_t _in_data_length /* [in] [value(r->in.in_data.length)] */,
14894 uint8_t *out_data /* [out] [ref,size_is(out_data_size)] */,
14895 uint32_t out_data_size /* [in] */,
14896 uint32_t *needed /* [out] [ref] */,
14897 uint32_t *status_code /* [in,out] [ref] */,
14898 WERROR *werror)
14900 struct spoolss_XcvData r;
14901 NTSTATUS status;
14903 /* In parameters */
14904 r.in.handle = handle;
14905 r.in.function_name = function_name;
14906 r.in.in_data = in_data;
14907 r.in._in_data_length = _in_data_length;
14908 r.in.out_data_size = out_data_size;
14909 r.in.status_code = status_code;
14911 if (DEBUGLEVEL >= 10) {
14912 NDR_PRINT_IN_DEBUG(spoolss_XcvData, &r);
14915 status = cli->dispatch(cli,
14916 mem_ctx,
14917 &ndr_table_spoolss,
14918 NDR_SPOOLSS_XCVDATA,
14919 &r);
14921 if (!NT_STATUS_IS_OK(status)) {
14922 return status;
14925 if (DEBUGLEVEL >= 10) {
14926 NDR_PRINT_OUT_DEBUG(spoolss_XcvData, &r);
14929 if (NT_STATUS_IS_ERR(status)) {
14930 return status;
14933 /* Return variables */
14934 memcpy(out_data, r.out.out_data, r.in.out_data_size * sizeof(*out_data));
14935 *needed = *r.out.needed;
14936 *status_code = *r.out.status_code;
14938 /* Return result */
14939 if (werror) {
14940 *werror = r.out.result;
14943 return werror_to_ntstatus(r.out.result);
14946 struct rpccli_spoolss_AddPrinterDriverEx_state {
14947 struct spoolss_AddPrinterDriverEx orig;
14948 struct spoolss_AddPrinterDriverEx tmp;
14949 TALLOC_CTX *out_mem_ctx;
14950 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
14953 static void rpccli_spoolss_AddPrinterDriverEx_done(struct tevent_req *subreq);
14955 struct tevent_req *rpccli_spoolss_AddPrinterDriverEx_send(TALLOC_CTX *mem_ctx,
14956 struct tevent_context *ev,
14957 struct rpc_pipe_client *cli,
14958 const char *_servername /* [in] [unique,charset(UTF16)] */,
14959 struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */,
14960 uint32_t _flags /* [in] */)
14962 struct tevent_req *req;
14963 struct rpccli_spoolss_AddPrinterDriverEx_state *state;
14964 struct tevent_req *subreq;
14966 req = tevent_req_create(mem_ctx, &state,
14967 struct rpccli_spoolss_AddPrinterDriverEx_state);
14968 if (req == NULL) {
14969 return NULL;
14971 state->out_mem_ctx = NULL;
14972 state->dispatch_recv = cli->dispatch_recv;
14974 /* In parameters */
14975 state->orig.in.servername = _servername;
14976 state->orig.in.info_ctr = _info_ctr;
14977 state->orig.in.flags = _flags;
14979 /* Out parameters */
14981 /* Result */
14982 ZERO_STRUCT(state->orig.out.result);
14984 if (DEBUGLEVEL >= 10) {
14985 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriverEx, &state->orig);
14988 /* make a temporary copy, that we pass to the dispatch function */
14989 state->tmp = state->orig;
14991 subreq = cli->dispatch_send(state, ev, cli,
14992 &ndr_table_spoolss,
14993 NDR_SPOOLSS_ADDPRINTERDRIVEREX,
14994 &state->tmp);
14995 if (tevent_req_nomem(subreq, req)) {
14996 return tevent_req_post(req, ev);
14998 tevent_req_set_callback(subreq, rpccli_spoolss_AddPrinterDriverEx_done, req);
14999 return req;
15002 static void rpccli_spoolss_AddPrinterDriverEx_done(struct tevent_req *subreq)
15004 struct tevent_req *req = tevent_req_callback_data(
15005 subreq, struct tevent_req);
15006 struct rpccli_spoolss_AddPrinterDriverEx_state *state = tevent_req_data(
15007 req, struct rpccli_spoolss_AddPrinterDriverEx_state);
15008 NTSTATUS status;
15009 TALLOC_CTX *mem_ctx;
15011 if (state->out_mem_ctx) {
15012 mem_ctx = state->out_mem_ctx;
15013 } else {
15014 mem_ctx = state;
15017 status = state->dispatch_recv(subreq, mem_ctx);
15018 TALLOC_FREE(subreq);
15019 if (!NT_STATUS_IS_OK(status)) {
15020 tevent_req_nterror(req, status);
15021 return;
15024 /* Copy out parameters */
15026 /* Copy result */
15027 state->orig.out.result = state->tmp.out.result;
15029 /* Reset temporary structure */
15030 ZERO_STRUCT(state->tmp);
15032 if (DEBUGLEVEL >= 10) {
15033 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriverEx, &state->orig);
15036 tevent_req_done(req);
15039 NTSTATUS rpccli_spoolss_AddPrinterDriverEx_recv(struct tevent_req *req,
15040 TALLOC_CTX *mem_ctx,
15041 WERROR *result)
15043 struct rpccli_spoolss_AddPrinterDriverEx_state *state = tevent_req_data(
15044 req, struct rpccli_spoolss_AddPrinterDriverEx_state);
15045 NTSTATUS status;
15047 if (tevent_req_is_nterror(req, &status)) {
15048 tevent_req_received(req);
15049 return status;
15052 /* Steal possbile out parameters to the callers context */
15053 talloc_steal(mem_ctx, state->out_mem_ctx);
15055 /* Return result */
15056 *result = state->orig.out.result;
15058 tevent_req_received(req);
15059 return NT_STATUS_OK;
15062 NTSTATUS rpccli_spoolss_AddPrinterDriverEx(struct rpc_pipe_client *cli,
15063 TALLOC_CTX *mem_ctx,
15064 const char *servername /* [in] [unique,charset(UTF16)] */,
15065 struct spoolss_AddDriverInfoCtr *info_ctr /* [in] [ref] */,
15066 uint32_t flags /* [in] */,
15067 WERROR *werror)
15069 struct spoolss_AddPrinterDriverEx r;
15070 NTSTATUS status;
15072 /* In parameters */
15073 r.in.servername = servername;
15074 r.in.info_ctr = info_ctr;
15075 r.in.flags = flags;
15077 if (DEBUGLEVEL >= 10) {
15078 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriverEx, &r);
15081 status = cli->dispatch(cli,
15082 mem_ctx,
15083 &ndr_table_spoolss,
15084 NDR_SPOOLSS_ADDPRINTERDRIVEREX,
15085 &r);
15087 if (!NT_STATUS_IS_OK(status)) {
15088 return status;
15091 if (DEBUGLEVEL >= 10) {
15092 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriverEx, &r);
15095 if (NT_STATUS_IS_ERR(status)) {
15096 return status;
15099 /* Return variables */
15101 /* Return result */
15102 if (werror) {
15103 *werror = r.out.result;
15106 return werror_to_ntstatus(r.out.result);
15109 struct rpccli_spoolss_5a_state {
15110 struct spoolss_5a orig;
15111 struct spoolss_5a tmp;
15112 TALLOC_CTX *out_mem_ctx;
15113 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
15116 static void rpccli_spoolss_5a_done(struct tevent_req *subreq);
15118 struct tevent_req *rpccli_spoolss_5a_send(TALLOC_CTX *mem_ctx,
15119 struct tevent_context *ev,
15120 struct rpc_pipe_client *cli)
15122 struct tevent_req *req;
15123 struct rpccli_spoolss_5a_state *state;
15124 struct tevent_req *subreq;
15126 req = tevent_req_create(mem_ctx, &state,
15127 struct rpccli_spoolss_5a_state);
15128 if (req == NULL) {
15129 return NULL;
15131 state->out_mem_ctx = NULL;
15132 state->dispatch_recv = cli->dispatch_recv;
15134 /* In parameters */
15136 /* Out parameters */
15138 /* Result */
15139 ZERO_STRUCT(state->orig.out.result);
15141 if (DEBUGLEVEL >= 10) {
15142 NDR_PRINT_IN_DEBUG(spoolss_5a, &state->orig);
15145 /* make a temporary copy, that we pass to the dispatch function */
15146 state->tmp = state->orig;
15148 subreq = cli->dispatch_send(state, ev, cli,
15149 &ndr_table_spoolss,
15150 NDR_SPOOLSS_5A,
15151 &state->tmp);
15152 if (tevent_req_nomem(subreq, req)) {
15153 return tevent_req_post(req, ev);
15155 tevent_req_set_callback(subreq, rpccli_spoolss_5a_done, req);
15156 return req;
15159 static void rpccli_spoolss_5a_done(struct tevent_req *subreq)
15161 struct tevent_req *req = tevent_req_callback_data(
15162 subreq, struct tevent_req);
15163 struct rpccli_spoolss_5a_state *state = tevent_req_data(
15164 req, struct rpccli_spoolss_5a_state);
15165 NTSTATUS status;
15166 TALLOC_CTX *mem_ctx;
15168 if (state->out_mem_ctx) {
15169 mem_ctx = state->out_mem_ctx;
15170 } else {
15171 mem_ctx = state;
15174 status = state->dispatch_recv(subreq, mem_ctx);
15175 TALLOC_FREE(subreq);
15176 if (!NT_STATUS_IS_OK(status)) {
15177 tevent_req_nterror(req, status);
15178 return;
15181 /* Copy out parameters */
15183 /* Copy result */
15184 state->orig.out.result = state->tmp.out.result;
15186 /* Reset temporary structure */
15187 ZERO_STRUCT(state->tmp);
15189 if (DEBUGLEVEL >= 10) {
15190 NDR_PRINT_OUT_DEBUG(spoolss_5a, &state->orig);
15193 tevent_req_done(req);
15196 NTSTATUS rpccli_spoolss_5a_recv(struct tevent_req *req,
15197 TALLOC_CTX *mem_ctx,
15198 WERROR *result)
15200 struct rpccli_spoolss_5a_state *state = tevent_req_data(
15201 req, struct rpccli_spoolss_5a_state);
15202 NTSTATUS status;
15204 if (tevent_req_is_nterror(req, &status)) {
15205 tevent_req_received(req);
15206 return status;
15209 /* Steal possbile out parameters to the callers context */
15210 talloc_steal(mem_ctx, state->out_mem_ctx);
15212 /* Return result */
15213 *result = state->orig.out.result;
15215 tevent_req_received(req);
15216 return NT_STATUS_OK;
15219 NTSTATUS rpccli_spoolss_5a(struct rpc_pipe_client *cli,
15220 TALLOC_CTX *mem_ctx,
15221 WERROR *werror)
15223 struct spoolss_5a r;
15224 NTSTATUS status;
15226 /* In parameters */
15228 if (DEBUGLEVEL >= 10) {
15229 NDR_PRINT_IN_DEBUG(spoolss_5a, &r);
15232 status = cli->dispatch(cli,
15233 mem_ctx,
15234 &ndr_table_spoolss,
15235 NDR_SPOOLSS_5A,
15236 &r);
15238 if (!NT_STATUS_IS_OK(status)) {
15239 return status;
15242 if (DEBUGLEVEL >= 10) {
15243 NDR_PRINT_OUT_DEBUG(spoolss_5a, &r);
15246 if (NT_STATUS_IS_ERR(status)) {
15247 return status;
15250 /* Return variables */
15252 /* Return result */
15253 if (werror) {
15254 *werror = r.out.result;
15257 return werror_to_ntstatus(r.out.result);
15260 struct rpccli_spoolss_5b_state {
15261 struct spoolss_5b orig;
15262 struct spoolss_5b tmp;
15263 TALLOC_CTX *out_mem_ctx;
15264 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
15267 static void rpccli_spoolss_5b_done(struct tevent_req *subreq);
15269 struct tevent_req *rpccli_spoolss_5b_send(TALLOC_CTX *mem_ctx,
15270 struct tevent_context *ev,
15271 struct rpc_pipe_client *cli)
15273 struct tevent_req *req;
15274 struct rpccli_spoolss_5b_state *state;
15275 struct tevent_req *subreq;
15277 req = tevent_req_create(mem_ctx, &state,
15278 struct rpccli_spoolss_5b_state);
15279 if (req == NULL) {
15280 return NULL;
15282 state->out_mem_ctx = NULL;
15283 state->dispatch_recv = cli->dispatch_recv;
15285 /* In parameters */
15287 /* Out parameters */
15289 /* Result */
15290 ZERO_STRUCT(state->orig.out.result);
15292 if (DEBUGLEVEL >= 10) {
15293 NDR_PRINT_IN_DEBUG(spoolss_5b, &state->orig);
15296 /* make a temporary copy, that we pass to the dispatch function */
15297 state->tmp = state->orig;
15299 subreq = cli->dispatch_send(state, ev, cli,
15300 &ndr_table_spoolss,
15301 NDR_SPOOLSS_5B,
15302 &state->tmp);
15303 if (tevent_req_nomem(subreq, req)) {
15304 return tevent_req_post(req, ev);
15306 tevent_req_set_callback(subreq, rpccli_spoolss_5b_done, req);
15307 return req;
15310 static void rpccli_spoolss_5b_done(struct tevent_req *subreq)
15312 struct tevent_req *req = tevent_req_callback_data(
15313 subreq, struct tevent_req);
15314 struct rpccli_spoolss_5b_state *state = tevent_req_data(
15315 req, struct rpccli_spoolss_5b_state);
15316 NTSTATUS status;
15317 TALLOC_CTX *mem_ctx;
15319 if (state->out_mem_ctx) {
15320 mem_ctx = state->out_mem_ctx;
15321 } else {
15322 mem_ctx = state;
15325 status = state->dispatch_recv(subreq, mem_ctx);
15326 TALLOC_FREE(subreq);
15327 if (!NT_STATUS_IS_OK(status)) {
15328 tevent_req_nterror(req, status);
15329 return;
15332 /* Copy out parameters */
15334 /* Copy result */
15335 state->orig.out.result = state->tmp.out.result;
15337 /* Reset temporary structure */
15338 ZERO_STRUCT(state->tmp);
15340 if (DEBUGLEVEL >= 10) {
15341 NDR_PRINT_OUT_DEBUG(spoolss_5b, &state->orig);
15344 tevent_req_done(req);
15347 NTSTATUS rpccli_spoolss_5b_recv(struct tevent_req *req,
15348 TALLOC_CTX *mem_ctx,
15349 WERROR *result)
15351 struct rpccli_spoolss_5b_state *state = tevent_req_data(
15352 req, struct rpccli_spoolss_5b_state);
15353 NTSTATUS status;
15355 if (tevent_req_is_nterror(req, &status)) {
15356 tevent_req_received(req);
15357 return status;
15360 /* Steal possbile out parameters to the callers context */
15361 talloc_steal(mem_ctx, state->out_mem_ctx);
15363 /* Return result */
15364 *result = state->orig.out.result;
15366 tevent_req_received(req);
15367 return NT_STATUS_OK;
15370 NTSTATUS rpccli_spoolss_5b(struct rpc_pipe_client *cli,
15371 TALLOC_CTX *mem_ctx,
15372 WERROR *werror)
15374 struct spoolss_5b r;
15375 NTSTATUS status;
15377 /* In parameters */
15379 if (DEBUGLEVEL >= 10) {
15380 NDR_PRINT_IN_DEBUG(spoolss_5b, &r);
15383 status = cli->dispatch(cli,
15384 mem_ctx,
15385 &ndr_table_spoolss,
15386 NDR_SPOOLSS_5B,
15387 &r);
15389 if (!NT_STATUS_IS_OK(status)) {
15390 return status;
15393 if (DEBUGLEVEL >= 10) {
15394 NDR_PRINT_OUT_DEBUG(spoolss_5b, &r);
15397 if (NT_STATUS_IS_ERR(status)) {
15398 return status;
15401 /* Return variables */
15403 /* Return result */
15404 if (werror) {
15405 *werror = r.out.result;
15408 return werror_to_ntstatus(r.out.result);
15411 struct rpccli_spoolss_5c_state {
15412 struct spoolss_5c orig;
15413 struct spoolss_5c tmp;
15414 TALLOC_CTX *out_mem_ctx;
15415 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
15418 static void rpccli_spoolss_5c_done(struct tevent_req *subreq);
15420 struct tevent_req *rpccli_spoolss_5c_send(TALLOC_CTX *mem_ctx,
15421 struct tevent_context *ev,
15422 struct rpc_pipe_client *cli)
15424 struct tevent_req *req;
15425 struct rpccli_spoolss_5c_state *state;
15426 struct tevent_req *subreq;
15428 req = tevent_req_create(mem_ctx, &state,
15429 struct rpccli_spoolss_5c_state);
15430 if (req == NULL) {
15431 return NULL;
15433 state->out_mem_ctx = NULL;
15434 state->dispatch_recv = cli->dispatch_recv;
15436 /* In parameters */
15438 /* Out parameters */
15440 /* Result */
15441 ZERO_STRUCT(state->orig.out.result);
15443 if (DEBUGLEVEL >= 10) {
15444 NDR_PRINT_IN_DEBUG(spoolss_5c, &state->orig);
15447 /* make a temporary copy, that we pass to the dispatch function */
15448 state->tmp = state->orig;
15450 subreq = cli->dispatch_send(state, ev, cli,
15451 &ndr_table_spoolss,
15452 NDR_SPOOLSS_5C,
15453 &state->tmp);
15454 if (tevent_req_nomem(subreq, req)) {
15455 return tevent_req_post(req, ev);
15457 tevent_req_set_callback(subreq, rpccli_spoolss_5c_done, req);
15458 return req;
15461 static void rpccli_spoolss_5c_done(struct tevent_req *subreq)
15463 struct tevent_req *req = tevent_req_callback_data(
15464 subreq, struct tevent_req);
15465 struct rpccli_spoolss_5c_state *state = tevent_req_data(
15466 req, struct rpccli_spoolss_5c_state);
15467 NTSTATUS status;
15468 TALLOC_CTX *mem_ctx;
15470 if (state->out_mem_ctx) {
15471 mem_ctx = state->out_mem_ctx;
15472 } else {
15473 mem_ctx = state;
15476 status = state->dispatch_recv(subreq, mem_ctx);
15477 TALLOC_FREE(subreq);
15478 if (!NT_STATUS_IS_OK(status)) {
15479 tevent_req_nterror(req, status);
15480 return;
15483 /* Copy out parameters */
15485 /* Copy result */
15486 state->orig.out.result = state->tmp.out.result;
15488 /* Reset temporary structure */
15489 ZERO_STRUCT(state->tmp);
15491 if (DEBUGLEVEL >= 10) {
15492 NDR_PRINT_OUT_DEBUG(spoolss_5c, &state->orig);
15495 tevent_req_done(req);
15498 NTSTATUS rpccli_spoolss_5c_recv(struct tevent_req *req,
15499 TALLOC_CTX *mem_ctx,
15500 WERROR *result)
15502 struct rpccli_spoolss_5c_state *state = tevent_req_data(
15503 req, struct rpccli_spoolss_5c_state);
15504 NTSTATUS status;
15506 if (tevent_req_is_nterror(req, &status)) {
15507 tevent_req_received(req);
15508 return status;
15511 /* Steal possbile out parameters to the callers context */
15512 talloc_steal(mem_ctx, state->out_mem_ctx);
15514 /* Return result */
15515 *result = state->orig.out.result;
15517 tevent_req_received(req);
15518 return NT_STATUS_OK;
15521 NTSTATUS rpccli_spoolss_5c(struct rpc_pipe_client *cli,
15522 TALLOC_CTX *mem_ctx,
15523 WERROR *werror)
15525 struct spoolss_5c r;
15526 NTSTATUS status;
15528 /* In parameters */
15530 if (DEBUGLEVEL >= 10) {
15531 NDR_PRINT_IN_DEBUG(spoolss_5c, &r);
15534 status = cli->dispatch(cli,
15535 mem_ctx,
15536 &ndr_table_spoolss,
15537 NDR_SPOOLSS_5C,
15538 &r);
15540 if (!NT_STATUS_IS_OK(status)) {
15541 return status;
15544 if (DEBUGLEVEL >= 10) {
15545 NDR_PRINT_OUT_DEBUG(spoolss_5c, &r);
15548 if (NT_STATUS_IS_ERR(status)) {
15549 return status;
15552 /* Return variables */
15554 /* Return result */
15555 if (werror) {
15556 *werror = r.out.result;
15559 return werror_to_ntstatus(r.out.result);
15562 struct rpccli_spoolss_5d_state {
15563 struct spoolss_5d orig;
15564 struct spoolss_5d tmp;
15565 TALLOC_CTX *out_mem_ctx;
15566 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
15569 static void rpccli_spoolss_5d_done(struct tevent_req *subreq);
15571 struct tevent_req *rpccli_spoolss_5d_send(TALLOC_CTX *mem_ctx,
15572 struct tevent_context *ev,
15573 struct rpc_pipe_client *cli)
15575 struct tevent_req *req;
15576 struct rpccli_spoolss_5d_state *state;
15577 struct tevent_req *subreq;
15579 req = tevent_req_create(mem_ctx, &state,
15580 struct rpccli_spoolss_5d_state);
15581 if (req == NULL) {
15582 return NULL;
15584 state->out_mem_ctx = NULL;
15585 state->dispatch_recv = cli->dispatch_recv;
15587 /* In parameters */
15589 /* Out parameters */
15591 /* Result */
15592 ZERO_STRUCT(state->orig.out.result);
15594 if (DEBUGLEVEL >= 10) {
15595 NDR_PRINT_IN_DEBUG(spoolss_5d, &state->orig);
15598 /* make a temporary copy, that we pass to the dispatch function */
15599 state->tmp = state->orig;
15601 subreq = cli->dispatch_send(state, ev, cli,
15602 &ndr_table_spoolss,
15603 NDR_SPOOLSS_5D,
15604 &state->tmp);
15605 if (tevent_req_nomem(subreq, req)) {
15606 return tevent_req_post(req, ev);
15608 tevent_req_set_callback(subreq, rpccli_spoolss_5d_done, req);
15609 return req;
15612 static void rpccli_spoolss_5d_done(struct tevent_req *subreq)
15614 struct tevent_req *req = tevent_req_callback_data(
15615 subreq, struct tevent_req);
15616 struct rpccli_spoolss_5d_state *state = tevent_req_data(
15617 req, struct rpccli_spoolss_5d_state);
15618 NTSTATUS status;
15619 TALLOC_CTX *mem_ctx;
15621 if (state->out_mem_ctx) {
15622 mem_ctx = state->out_mem_ctx;
15623 } else {
15624 mem_ctx = state;
15627 status = state->dispatch_recv(subreq, mem_ctx);
15628 TALLOC_FREE(subreq);
15629 if (!NT_STATUS_IS_OK(status)) {
15630 tevent_req_nterror(req, status);
15631 return;
15634 /* Copy out parameters */
15636 /* Copy result */
15637 state->orig.out.result = state->tmp.out.result;
15639 /* Reset temporary structure */
15640 ZERO_STRUCT(state->tmp);
15642 if (DEBUGLEVEL >= 10) {
15643 NDR_PRINT_OUT_DEBUG(spoolss_5d, &state->orig);
15646 tevent_req_done(req);
15649 NTSTATUS rpccli_spoolss_5d_recv(struct tevent_req *req,
15650 TALLOC_CTX *mem_ctx,
15651 WERROR *result)
15653 struct rpccli_spoolss_5d_state *state = tevent_req_data(
15654 req, struct rpccli_spoolss_5d_state);
15655 NTSTATUS status;
15657 if (tevent_req_is_nterror(req, &status)) {
15658 tevent_req_received(req);
15659 return status;
15662 /* Steal possbile out parameters to the callers context */
15663 talloc_steal(mem_ctx, state->out_mem_ctx);
15665 /* Return result */
15666 *result = state->orig.out.result;
15668 tevent_req_received(req);
15669 return NT_STATUS_OK;
15672 NTSTATUS rpccli_spoolss_5d(struct rpc_pipe_client *cli,
15673 TALLOC_CTX *mem_ctx,
15674 WERROR *werror)
15676 struct spoolss_5d r;
15677 NTSTATUS status;
15679 /* In parameters */
15681 if (DEBUGLEVEL >= 10) {
15682 NDR_PRINT_IN_DEBUG(spoolss_5d, &r);
15685 status = cli->dispatch(cli,
15686 mem_ctx,
15687 &ndr_table_spoolss,
15688 NDR_SPOOLSS_5D,
15689 &r);
15691 if (!NT_STATUS_IS_OK(status)) {
15692 return status;
15695 if (DEBUGLEVEL >= 10) {
15696 NDR_PRINT_OUT_DEBUG(spoolss_5d, &r);
15699 if (NT_STATUS_IS_ERR(status)) {
15700 return status;
15703 /* Return variables */
15705 /* Return result */
15706 if (werror) {
15707 *werror = r.out.result;
15710 return werror_to_ntstatus(r.out.result);
15713 struct rpccli_spoolss_5e_state {
15714 struct spoolss_5e orig;
15715 struct spoolss_5e tmp;
15716 TALLOC_CTX *out_mem_ctx;
15717 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
15720 static void rpccli_spoolss_5e_done(struct tevent_req *subreq);
15722 struct tevent_req *rpccli_spoolss_5e_send(TALLOC_CTX *mem_ctx,
15723 struct tevent_context *ev,
15724 struct rpc_pipe_client *cli)
15726 struct tevent_req *req;
15727 struct rpccli_spoolss_5e_state *state;
15728 struct tevent_req *subreq;
15730 req = tevent_req_create(mem_ctx, &state,
15731 struct rpccli_spoolss_5e_state);
15732 if (req == NULL) {
15733 return NULL;
15735 state->out_mem_ctx = NULL;
15736 state->dispatch_recv = cli->dispatch_recv;
15738 /* In parameters */
15740 /* Out parameters */
15742 /* Result */
15743 ZERO_STRUCT(state->orig.out.result);
15745 if (DEBUGLEVEL >= 10) {
15746 NDR_PRINT_IN_DEBUG(spoolss_5e, &state->orig);
15749 /* make a temporary copy, that we pass to the dispatch function */
15750 state->tmp = state->orig;
15752 subreq = cli->dispatch_send(state, ev, cli,
15753 &ndr_table_spoolss,
15754 NDR_SPOOLSS_5E,
15755 &state->tmp);
15756 if (tevent_req_nomem(subreq, req)) {
15757 return tevent_req_post(req, ev);
15759 tevent_req_set_callback(subreq, rpccli_spoolss_5e_done, req);
15760 return req;
15763 static void rpccli_spoolss_5e_done(struct tevent_req *subreq)
15765 struct tevent_req *req = tevent_req_callback_data(
15766 subreq, struct tevent_req);
15767 struct rpccli_spoolss_5e_state *state = tevent_req_data(
15768 req, struct rpccli_spoolss_5e_state);
15769 NTSTATUS status;
15770 TALLOC_CTX *mem_ctx;
15772 if (state->out_mem_ctx) {
15773 mem_ctx = state->out_mem_ctx;
15774 } else {
15775 mem_ctx = state;
15778 status = state->dispatch_recv(subreq, mem_ctx);
15779 TALLOC_FREE(subreq);
15780 if (!NT_STATUS_IS_OK(status)) {
15781 tevent_req_nterror(req, status);
15782 return;
15785 /* Copy out parameters */
15787 /* Copy result */
15788 state->orig.out.result = state->tmp.out.result;
15790 /* Reset temporary structure */
15791 ZERO_STRUCT(state->tmp);
15793 if (DEBUGLEVEL >= 10) {
15794 NDR_PRINT_OUT_DEBUG(spoolss_5e, &state->orig);
15797 tevent_req_done(req);
15800 NTSTATUS rpccli_spoolss_5e_recv(struct tevent_req *req,
15801 TALLOC_CTX *mem_ctx,
15802 WERROR *result)
15804 struct rpccli_spoolss_5e_state *state = tevent_req_data(
15805 req, struct rpccli_spoolss_5e_state);
15806 NTSTATUS status;
15808 if (tevent_req_is_nterror(req, &status)) {
15809 tevent_req_received(req);
15810 return status;
15813 /* Steal possbile out parameters to the callers context */
15814 talloc_steal(mem_ctx, state->out_mem_ctx);
15816 /* Return result */
15817 *result = state->orig.out.result;
15819 tevent_req_received(req);
15820 return NT_STATUS_OK;
15823 NTSTATUS rpccli_spoolss_5e(struct rpc_pipe_client *cli,
15824 TALLOC_CTX *mem_ctx,
15825 WERROR *werror)
15827 struct spoolss_5e r;
15828 NTSTATUS status;
15830 /* In parameters */
15832 if (DEBUGLEVEL >= 10) {
15833 NDR_PRINT_IN_DEBUG(spoolss_5e, &r);
15836 status = cli->dispatch(cli,
15837 mem_ctx,
15838 &ndr_table_spoolss,
15839 NDR_SPOOLSS_5E,
15840 &r);
15842 if (!NT_STATUS_IS_OK(status)) {
15843 return status;
15846 if (DEBUGLEVEL >= 10) {
15847 NDR_PRINT_OUT_DEBUG(spoolss_5e, &r);
15850 if (NT_STATUS_IS_ERR(status)) {
15851 return status;
15854 /* Return variables */
15856 /* Return result */
15857 if (werror) {
15858 *werror = r.out.result;
15861 return werror_to_ntstatus(r.out.result);
15864 struct rpccli_spoolss_5f_state {
15865 struct spoolss_5f orig;
15866 struct spoolss_5f tmp;
15867 TALLOC_CTX *out_mem_ctx;
15868 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
15871 static void rpccli_spoolss_5f_done(struct tevent_req *subreq);
15873 struct tevent_req *rpccli_spoolss_5f_send(TALLOC_CTX *mem_ctx,
15874 struct tevent_context *ev,
15875 struct rpc_pipe_client *cli)
15877 struct tevent_req *req;
15878 struct rpccli_spoolss_5f_state *state;
15879 struct tevent_req *subreq;
15881 req = tevent_req_create(mem_ctx, &state,
15882 struct rpccli_spoolss_5f_state);
15883 if (req == NULL) {
15884 return NULL;
15886 state->out_mem_ctx = NULL;
15887 state->dispatch_recv = cli->dispatch_recv;
15889 /* In parameters */
15891 /* Out parameters */
15893 /* Result */
15894 ZERO_STRUCT(state->orig.out.result);
15896 if (DEBUGLEVEL >= 10) {
15897 NDR_PRINT_IN_DEBUG(spoolss_5f, &state->orig);
15900 /* make a temporary copy, that we pass to the dispatch function */
15901 state->tmp = state->orig;
15903 subreq = cli->dispatch_send(state, ev, cli,
15904 &ndr_table_spoolss,
15905 NDR_SPOOLSS_5F,
15906 &state->tmp);
15907 if (tevent_req_nomem(subreq, req)) {
15908 return tevent_req_post(req, ev);
15910 tevent_req_set_callback(subreq, rpccli_spoolss_5f_done, req);
15911 return req;
15914 static void rpccli_spoolss_5f_done(struct tevent_req *subreq)
15916 struct tevent_req *req = tevent_req_callback_data(
15917 subreq, struct tevent_req);
15918 struct rpccli_spoolss_5f_state *state = tevent_req_data(
15919 req, struct rpccli_spoolss_5f_state);
15920 NTSTATUS status;
15921 TALLOC_CTX *mem_ctx;
15923 if (state->out_mem_ctx) {
15924 mem_ctx = state->out_mem_ctx;
15925 } else {
15926 mem_ctx = state;
15929 status = state->dispatch_recv(subreq, mem_ctx);
15930 TALLOC_FREE(subreq);
15931 if (!NT_STATUS_IS_OK(status)) {
15932 tevent_req_nterror(req, status);
15933 return;
15936 /* Copy out parameters */
15938 /* Copy result */
15939 state->orig.out.result = state->tmp.out.result;
15941 /* Reset temporary structure */
15942 ZERO_STRUCT(state->tmp);
15944 if (DEBUGLEVEL >= 10) {
15945 NDR_PRINT_OUT_DEBUG(spoolss_5f, &state->orig);
15948 tevent_req_done(req);
15951 NTSTATUS rpccli_spoolss_5f_recv(struct tevent_req *req,
15952 TALLOC_CTX *mem_ctx,
15953 WERROR *result)
15955 struct rpccli_spoolss_5f_state *state = tevent_req_data(
15956 req, struct rpccli_spoolss_5f_state);
15957 NTSTATUS status;
15959 if (tevent_req_is_nterror(req, &status)) {
15960 tevent_req_received(req);
15961 return status;
15964 /* Steal possbile out parameters to the callers context */
15965 talloc_steal(mem_ctx, state->out_mem_ctx);
15967 /* Return result */
15968 *result = state->orig.out.result;
15970 tevent_req_received(req);
15971 return NT_STATUS_OK;
15974 NTSTATUS rpccli_spoolss_5f(struct rpc_pipe_client *cli,
15975 TALLOC_CTX *mem_ctx,
15976 WERROR *werror)
15978 struct spoolss_5f r;
15979 NTSTATUS status;
15981 /* In parameters */
15983 if (DEBUGLEVEL >= 10) {
15984 NDR_PRINT_IN_DEBUG(spoolss_5f, &r);
15987 status = cli->dispatch(cli,
15988 mem_ctx,
15989 &ndr_table_spoolss,
15990 NDR_SPOOLSS_5F,
15991 &r);
15993 if (!NT_STATUS_IS_OK(status)) {
15994 return status;
15997 if (DEBUGLEVEL >= 10) {
15998 NDR_PRINT_OUT_DEBUG(spoolss_5f, &r);
16001 if (NT_STATUS_IS_ERR(status)) {
16002 return status;
16005 /* Return variables */
16007 /* Return result */
16008 if (werror) {
16009 *werror = r.out.result;
16012 return werror_to_ntstatus(r.out.result);
16015 struct rpccli_spoolss_60_state {
16016 struct spoolss_60 orig;
16017 struct spoolss_60 tmp;
16018 TALLOC_CTX *out_mem_ctx;
16019 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16022 static void rpccli_spoolss_60_done(struct tevent_req *subreq);
16024 struct tevent_req *rpccli_spoolss_60_send(TALLOC_CTX *mem_ctx,
16025 struct tevent_context *ev,
16026 struct rpc_pipe_client *cli)
16028 struct tevent_req *req;
16029 struct rpccli_spoolss_60_state *state;
16030 struct tevent_req *subreq;
16032 req = tevent_req_create(mem_ctx, &state,
16033 struct rpccli_spoolss_60_state);
16034 if (req == NULL) {
16035 return NULL;
16037 state->out_mem_ctx = NULL;
16038 state->dispatch_recv = cli->dispatch_recv;
16040 /* In parameters */
16042 /* Out parameters */
16044 /* Result */
16045 ZERO_STRUCT(state->orig.out.result);
16047 if (DEBUGLEVEL >= 10) {
16048 NDR_PRINT_IN_DEBUG(spoolss_60, &state->orig);
16051 /* make a temporary copy, that we pass to the dispatch function */
16052 state->tmp = state->orig;
16054 subreq = cli->dispatch_send(state, ev, cli,
16055 &ndr_table_spoolss,
16056 NDR_SPOOLSS_60,
16057 &state->tmp);
16058 if (tevent_req_nomem(subreq, req)) {
16059 return tevent_req_post(req, ev);
16061 tevent_req_set_callback(subreq, rpccli_spoolss_60_done, req);
16062 return req;
16065 static void rpccli_spoolss_60_done(struct tevent_req *subreq)
16067 struct tevent_req *req = tevent_req_callback_data(
16068 subreq, struct tevent_req);
16069 struct rpccli_spoolss_60_state *state = tevent_req_data(
16070 req, struct rpccli_spoolss_60_state);
16071 NTSTATUS status;
16072 TALLOC_CTX *mem_ctx;
16074 if (state->out_mem_ctx) {
16075 mem_ctx = state->out_mem_ctx;
16076 } else {
16077 mem_ctx = state;
16080 status = state->dispatch_recv(subreq, mem_ctx);
16081 TALLOC_FREE(subreq);
16082 if (!NT_STATUS_IS_OK(status)) {
16083 tevent_req_nterror(req, status);
16084 return;
16087 /* Copy out parameters */
16089 /* Copy result */
16090 state->orig.out.result = state->tmp.out.result;
16092 /* Reset temporary structure */
16093 ZERO_STRUCT(state->tmp);
16095 if (DEBUGLEVEL >= 10) {
16096 NDR_PRINT_OUT_DEBUG(spoolss_60, &state->orig);
16099 tevent_req_done(req);
16102 NTSTATUS rpccli_spoolss_60_recv(struct tevent_req *req,
16103 TALLOC_CTX *mem_ctx,
16104 WERROR *result)
16106 struct rpccli_spoolss_60_state *state = tevent_req_data(
16107 req, struct rpccli_spoolss_60_state);
16108 NTSTATUS status;
16110 if (tevent_req_is_nterror(req, &status)) {
16111 tevent_req_received(req);
16112 return status;
16115 /* Steal possbile out parameters to the callers context */
16116 talloc_steal(mem_ctx, state->out_mem_ctx);
16118 /* Return result */
16119 *result = state->orig.out.result;
16121 tevent_req_received(req);
16122 return NT_STATUS_OK;
16125 NTSTATUS rpccli_spoolss_60(struct rpc_pipe_client *cli,
16126 TALLOC_CTX *mem_ctx,
16127 WERROR *werror)
16129 struct spoolss_60 r;
16130 NTSTATUS status;
16132 /* In parameters */
16134 if (DEBUGLEVEL >= 10) {
16135 NDR_PRINT_IN_DEBUG(spoolss_60, &r);
16138 status = cli->dispatch(cli,
16139 mem_ctx,
16140 &ndr_table_spoolss,
16141 NDR_SPOOLSS_60,
16142 &r);
16144 if (!NT_STATUS_IS_OK(status)) {
16145 return status;
16148 if (DEBUGLEVEL >= 10) {
16149 NDR_PRINT_OUT_DEBUG(spoolss_60, &r);
16152 if (NT_STATUS_IS_ERR(status)) {
16153 return status;
16156 /* Return variables */
16158 /* Return result */
16159 if (werror) {
16160 *werror = r.out.result;
16163 return werror_to_ntstatus(r.out.result);
16166 struct rpccli_spoolss_61_state {
16167 struct spoolss_61 orig;
16168 struct spoolss_61 tmp;
16169 TALLOC_CTX *out_mem_ctx;
16170 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16173 static void rpccli_spoolss_61_done(struct tevent_req *subreq);
16175 struct tevent_req *rpccli_spoolss_61_send(TALLOC_CTX *mem_ctx,
16176 struct tevent_context *ev,
16177 struct rpc_pipe_client *cli)
16179 struct tevent_req *req;
16180 struct rpccli_spoolss_61_state *state;
16181 struct tevent_req *subreq;
16183 req = tevent_req_create(mem_ctx, &state,
16184 struct rpccli_spoolss_61_state);
16185 if (req == NULL) {
16186 return NULL;
16188 state->out_mem_ctx = NULL;
16189 state->dispatch_recv = cli->dispatch_recv;
16191 /* In parameters */
16193 /* Out parameters */
16195 /* Result */
16196 ZERO_STRUCT(state->orig.out.result);
16198 if (DEBUGLEVEL >= 10) {
16199 NDR_PRINT_IN_DEBUG(spoolss_61, &state->orig);
16202 /* make a temporary copy, that we pass to the dispatch function */
16203 state->tmp = state->orig;
16205 subreq = cli->dispatch_send(state, ev, cli,
16206 &ndr_table_spoolss,
16207 NDR_SPOOLSS_61,
16208 &state->tmp);
16209 if (tevent_req_nomem(subreq, req)) {
16210 return tevent_req_post(req, ev);
16212 tevent_req_set_callback(subreq, rpccli_spoolss_61_done, req);
16213 return req;
16216 static void rpccli_spoolss_61_done(struct tevent_req *subreq)
16218 struct tevent_req *req = tevent_req_callback_data(
16219 subreq, struct tevent_req);
16220 struct rpccli_spoolss_61_state *state = tevent_req_data(
16221 req, struct rpccli_spoolss_61_state);
16222 NTSTATUS status;
16223 TALLOC_CTX *mem_ctx;
16225 if (state->out_mem_ctx) {
16226 mem_ctx = state->out_mem_ctx;
16227 } else {
16228 mem_ctx = state;
16231 status = state->dispatch_recv(subreq, mem_ctx);
16232 TALLOC_FREE(subreq);
16233 if (!NT_STATUS_IS_OK(status)) {
16234 tevent_req_nterror(req, status);
16235 return;
16238 /* Copy out parameters */
16240 /* Copy result */
16241 state->orig.out.result = state->tmp.out.result;
16243 /* Reset temporary structure */
16244 ZERO_STRUCT(state->tmp);
16246 if (DEBUGLEVEL >= 10) {
16247 NDR_PRINT_OUT_DEBUG(spoolss_61, &state->orig);
16250 tevent_req_done(req);
16253 NTSTATUS rpccli_spoolss_61_recv(struct tevent_req *req,
16254 TALLOC_CTX *mem_ctx,
16255 WERROR *result)
16257 struct rpccli_spoolss_61_state *state = tevent_req_data(
16258 req, struct rpccli_spoolss_61_state);
16259 NTSTATUS status;
16261 if (tevent_req_is_nterror(req, &status)) {
16262 tevent_req_received(req);
16263 return status;
16266 /* Steal possbile out parameters to the callers context */
16267 talloc_steal(mem_ctx, state->out_mem_ctx);
16269 /* Return result */
16270 *result = state->orig.out.result;
16272 tevent_req_received(req);
16273 return NT_STATUS_OK;
16276 NTSTATUS rpccli_spoolss_61(struct rpc_pipe_client *cli,
16277 TALLOC_CTX *mem_ctx,
16278 WERROR *werror)
16280 struct spoolss_61 r;
16281 NTSTATUS status;
16283 /* In parameters */
16285 if (DEBUGLEVEL >= 10) {
16286 NDR_PRINT_IN_DEBUG(spoolss_61, &r);
16289 status = cli->dispatch(cli,
16290 mem_ctx,
16291 &ndr_table_spoolss,
16292 NDR_SPOOLSS_61,
16293 &r);
16295 if (!NT_STATUS_IS_OK(status)) {
16296 return status;
16299 if (DEBUGLEVEL >= 10) {
16300 NDR_PRINT_OUT_DEBUG(spoolss_61, &r);
16303 if (NT_STATUS_IS_ERR(status)) {
16304 return status;
16307 /* Return variables */
16309 /* Return result */
16310 if (werror) {
16311 *werror = r.out.result;
16314 return werror_to_ntstatus(r.out.result);
16317 struct rpccli_spoolss_62_state {
16318 struct spoolss_62 orig;
16319 struct spoolss_62 tmp;
16320 TALLOC_CTX *out_mem_ctx;
16321 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16324 static void rpccli_spoolss_62_done(struct tevent_req *subreq);
16326 struct tevent_req *rpccli_spoolss_62_send(TALLOC_CTX *mem_ctx,
16327 struct tevent_context *ev,
16328 struct rpc_pipe_client *cli)
16330 struct tevent_req *req;
16331 struct rpccli_spoolss_62_state *state;
16332 struct tevent_req *subreq;
16334 req = tevent_req_create(mem_ctx, &state,
16335 struct rpccli_spoolss_62_state);
16336 if (req == NULL) {
16337 return NULL;
16339 state->out_mem_ctx = NULL;
16340 state->dispatch_recv = cli->dispatch_recv;
16342 /* In parameters */
16344 /* Out parameters */
16346 /* Result */
16347 ZERO_STRUCT(state->orig.out.result);
16349 if (DEBUGLEVEL >= 10) {
16350 NDR_PRINT_IN_DEBUG(spoolss_62, &state->orig);
16353 /* make a temporary copy, that we pass to the dispatch function */
16354 state->tmp = state->orig;
16356 subreq = cli->dispatch_send(state, ev, cli,
16357 &ndr_table_spoolss,
16358 NDR_SPOOLSS_62,
16359 &state->tmp);
16360 if (tevent_req_nomem(subreq, req)) {
16361 return tevent_req_post(req, ev);
16363 tevent_req_set_callback(subreq, rpccli_spoolss_62_done, req);
16364 return req;
16367 static void rpccli_spoolss_62_done(struct tevent_req *subreq)
16369 struct tevent_req *req = tevent_req_callback_data(
16370 subreq, struct tevent_req);
16371 struct rpccli_spoolss_62_state *state = tevent_req_data(
16372 req, struct rpccli_spoolss_62_state);
16373 NTSTATUS status;
16374 TALLOC_CTX *mem_ctx;
16376 if (state->out_mem_ctx) {
16377 mem_ctx = state->out_mem_ctx;
16378 } else {
16379 mem_ctx = state;
16382 status = state->dispatch_recv(subreq, mem_ctx);
16383 TALLOC_FREE(subreq);
16384 if (!NT_STATUS_IS_OK(status)) {
16385 tevent_req_nterror(req, status);
16386 return;
16389 /* Copy out parameters */
16391 /* Copy result */
16392 state->orig.out.result = state->tmp.out.result;
16394 /* Reset temporary structure */
16395 ZERO_STRUCT(state->tmp);
16397 if (DEBUGLEVEL >= 10) {
16398 NDR_PRINT_OUT_DEBUG(spoolss_62, &state->orig);
16401 tevent_req_done(req);
16404 NTSTATUS rpccli_spoolss_62_recv(struct tevent_req *req,
16405 TALLOC_CTX *mem_ctx,
16406 WERROR *result)
16408 struct rpccli_spoolss_62_state *state = tevent_req_data(
16409 req, struct rpccli_spoolss_62_state);
16410 NTSTATUS status;
16412 if (tevent_req_is_nterror(req, &status)) {
16413 tevent_req_received(req);
16414 return status;
16417 /* Steal possbile out parameters to the callers context */
16418 talloc_steal(mem_ctx, state->out_mem_ctx);
16420 /* Return result */
16421 *result = state->orig.out.result;
16423 tevent_req_received(req);
16424 return NT_STATUS_OK;
16427 NTSTATUS rpccli_spoolss_62(struct rpc_pipe_client *cli,
16428 TALLOC_CTX *mem_ctx,
16429 WERROR *werror)
16431 struct spoolss_62 r;
16432 NTSTATUS status;
16434 /* In parameters */
16436 if (DEBUGLEVEL >= 10) {
16437 NDR_PRINT_IN_DEBUG(spoolss_62, &r);
16440 status = cli->dispatch(cli,
16441 mem_ctx,
16442 &ndr_table_spoolss,
16443 NDR_SPOOLSS_62,
16444 &r);
16446 if (!NT_STATUS_IS_OK(status)) {
16447 return status;
16450 if (DEBUGLEVEL >= 10) {
16451 NDR_PRINT_OUT_DEBUG(spoolss_62, &r);
16454 if (NT_STATUS_IS_ERR(status)) {
16455 return status;
16458 /* Return variables */
16460 /* Return result */
16461 if (werror) {
16462 *werror = r.out.result;
16465 return werror_to_ntstatus(r.out.result);
16468 struct rpccli_spoolss_63_state {
16469 struct spoolss_63 orig;
16470 struct spoolss_63 tmp;
16471 TALLOC_CTX *out_mem_ctx;
16472 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16475 static void rpccli_spoolss_63_done(struct tevent_req *subreq);
16477 struct tevent_req *rpccli_spoolss_63_send(TALLOC_CTX *mem_ctx,
16478 struct tevent_context *ev,
16479 struct rpc_pipe_client *cli)
16481 struct tevent_req *req;
16482 struct rpccli_spoolss_63_state *state;
16483 struct tevent_req *subreq;
16485 req = tevent_req_create(mem_ctx, &state,
16486 struct rpccli_spoolss_63_state);
16487 if (req == NULL) {
16488 return NULL;
16490 state->out_mem_ctx = NULL;
16491 state->dispatch_recv = cli->dispatch_recv;
16493 /* In parameters */
16495 /* Out parameters */
16497 /* Result */
16498 ZERO_STRUCT(state->orig.out.result);
16500 if (DEBUGLEVEL >= 10) {
16501 NDR_PRINT_IN_DEBUG(spoolss_63, &state->orig);
16504 /* make a temporary copy, that we pass to the dispatch function */
16505 state->tmp = state->orig;
16507 subreq = cli->dispatch_send(state, ev, cli,
16508 &ndr_table_spoolss,
16509 NDR_SPOOLSS_63,
16510 &state->tmp);
16511 if (tevent_req_nomem(subreq, req)) {
16512 return tevent_req_post(req, ev);
16514 tevent_req_set_callback(subreq, rpccli_spoolss_63_done, req);
16515 return req;
16518 static void rpccli_spoolss_63_done(struct tevent_req *subreq)
16520 struct tevent_req *req = tevent_req_callback_data(
16521 subreq, struct tevent_req);
16522 struct rpccli_spoolss_63_state *state = tevent_req_data(
16523 req, struct rpccli_spoolss_63_state);
16524 NTSTATUS status;
16525 TALLOC_CTX *mem_ctx;
16527 if (state->out_mem_ctx) {
16528 mem_ctx = state->out_mem_ctx;
16529 } else {
16530 mem_ctx = state;
16533 status = state->dispatch_recv(subreq, mem_ctx);
16534 TALLOC_FREE(subreq);
16535 if (!NT_STATUS_IS_OK(status)) {
16536 tevent_req_nterror(req, status);
16537 return;
16540 /* Copy out parameters */
16542 /* Copy result */
16543 state->orig.out.result = state->tmp.out.result;
16545 /* Reset temporary structure */
16546 ZERO_STRUCT(state->tmp);
16548 if (DEBUGLEVEL >= 10) {
16549 NDR_PRINT_OUT_DEBUG(spoolss_63, &state->orig);
16552 tevent_req_done(req);
16555 NTSTATUS rpccli_spoolss_63_recv(struct tevent_req *req,
16556 TALLOC_CTX *mem_ctx,
16557 WERROR *result)
16559 struct rpccli_spoolss_63_state *state = tevent_req_data(
16560 req, struct rpccli_spoolss_63_state);
16561 NTSTATUS status;
16563 if (tevent_req_is_nterror(req, &status)) {
16564 tevent_req_received(req);
16565 return status;
16568 /* Steal possbile out parameters to the callers context */
16569 talloc_steal(mem_ctx, state->out_mem_ctx);
16571 /* Return result */
16572 *result = state->orig.out.result;
16574 tevent_req_received(req);
16575 return NT_STATUS_OK;
16578 NTSTATUS rpccli_spoolss_63(struct rpc_pipe_client *cli,
16579 TALLOC_CTX *mem_ctx,
16580 WERROR *werror)
16582 struct spoolss_63 r;
16583 NTSTATUS status;
16585 /* In parameters */
16587 if (DEBUGLEVEL >= 10) {
16588 NDR_PRINT_IN_DEBUG(spoolss_63, &r);
16591 status = cli->dispatch(cli,
16592 mem_ctx,
16593 &ndr_table_spoolss,
16594 NDR_SPOOLSS_63,
16595 &r);
16597 if (!NT_STATUS_IS_OK(status)) {
16598 return status;
16601 if (DEBUGLEVEL >= 10) {
16602 NDR_PRINT_OUT_DEBUG(spoolss_63, &r);
16605 if (NT_STATUS_IS_ERR(status)) {
16606 return status;
16609 /* Return variables */
16611 /* Return result */
16612 if (werror) {
16613 *werror = r.out.result;
16616 return werror_to_ntstatus(r.out.result);
16619 struct rpccli_spoolss_64_state {
16620 struct spoolss_64 orig;
16621 struct spoolss_64 tmp;
16622 TALLOC_CTX *out_mem_ctx;
16623 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16626 static void rpccli_spoolss_64_done(struct tevent_req *subreq);
16628 struct tevent_req *rpccli_spoolss_64_send(TALLOC_CTX *mem_ctx,
16629 struct tevent_context *ev,
16630 struct rpc_pipe_client *cli)
16632 struct tevent_req *req;
16633 struct rpccli_spoolss_64_state *state;
16634 struct tevent_req *subreq;
16636 req = tevent_req_create(mem_ctx, &state,
16637 struct rpccli_spoolss_64_state);
16638 if (req == NULL) {
16639 return NULL;
16641 state->out_mem_ctx = NULL;
16642 state->dispatch_recv = cli->dispatch_recv;
16644 /* In parameters */
16646 /* Out parameters */
16648 /* Result */
16649 ZERO_STRUCT(state->orig.out.result);
16651 if (DEBUGLEVEL >= 10) {
16652 NDR_PRINT_IN_DEBUG(spoolss_64, &state->orig);
16655 /* make a temporary copy, that we pass to the dispatch function */
16656 state->tmp = state->orig;
16658 subreq = cli->dispatch_send(state, ev, cli,
16659 &ndr_table_spoolss,
16660 NDR_SPOOLSS_64,
16661 &state->tmp);
16662 if (tevent_req_nomem(subreq, req)) {
16663 return tevent_req_post(req, ev);
16665 tevent_req_set_callback(subreq, rpccli_spoolss_64_done, req);
16666 return req;
16669 static void rpccli_spoolss_64_done(struct tevent_req *subreq)
16671 struct tevent_req *req = tevent_req_callback_data(
16672 subreq, struct tevent_req);
16673 struct rpccli_spoolss_64_state *state = tevent_req_data(
16674 req, struct rpccli_spoolss_64_state);
16675 NTSTATUS status;
16676 TALLOC_CTX *mem_ctx;
16678 if (state->out_mem_ctx) {
16679 mem_ctx = state->out_mem_ctx;
16680 } else {
16681 mem_ctx = state;
16684 status = state->dispatch_recv(subreq, mem_ctx);
16685 TALLOC_FREE(subreq);
16686 if (!NT_STATUS_IS_OK(status)) {
16687 tevent_req_nterror(req, status);
16688 return;
16691 /* Copy out parameters */
16693 /* Copy result */
16694 state->orig.out.result = state->tmp.out.result;
16696 /* Reset temporary structure */
16697 ZERO_STRUCT(state->tmp);
16699 if (DEBUGLEVEL >= 10) {
16700 NDR_PRINT_OUT_DEBUG(spoolss_64, &state->orig);
16703 tevent_req_done(req);
16706 NTSTATUS rpccli_spoolss_64_recv(struct tevent_req *req,
16707 TALLOC_CTX *mem_ctx,
16708 WERROR *result)
16710 struct rpccli_spoolss_64_state *state = tevent_req_data(
16711 req, struct rpccli_spoolss_64_state);
16712 NTSTATUS status;
16714 if (tevent_req_is_nterror(req, &status)) {
16715 tevent_req_received(req);
16716 return status;
16719 /* Steal possbile out parameters to the callers context */
16720 talloc_steal(mem_ctx, state->out_mem_ctx);
16722 /* Return result */
16723 *result = state->orig.out.result;
16725 tevent_req_received(req);
16726 return NT_STATUS_OK;
16729 NTSTATUS rpccli_spoolss_64(struct rpc_pipe_client *cli,
16730 TALLOC_CTX *mem_ctx,
16731 WERROR *werror)
16733 struct spoolss_64 r;
16734 NTSTATUS status;
16736 /* In parameters */
16738 if (DEBUGLEVEL >= 10) {
16739 NDR_PRINT_IN_DEBUG(spoolss_64, &r);
16742 status = cli->dispatch(cli,
16743 mem_ctx,
16744 &ndr_table_spoolss,
16745 NDR_SPOOLSS_64,
16746 &r);
16748 if (!NT_STATUS_IS_OK(status)) {
16749 return status;
16752 if (DEBUGLEVEL >= 10) {
16753 NDR_PRINT_OUT_DEBUG(spoolss_64, &r);
16756 if (NT_STATUS_IS_ERR(status)) {
16757 return status;
16760 /* Return variables */
16762 /* Return result */
16763 if (werror) {
16764 *werror = r.out.result;
16767 return werror_to_ntstatus(r.out.result);
16770 struct rpccli_spoolss_65_state {
16771 struct spoolss_65 orig;
16772 struct spoolss_65 tmp;
16773 TALLOC_CTX *out_mem_ctx;
16774 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16777 static void rpccli_spoolss_65_done(struct tevent_req *subreq);
16779 struct tevent_req *rpccli_spoolss_65_send(TALLOC_CTX *mem_ctx,
16780 struct tevent_context *ev,
16781 struct rpc_pipe_client *cli)
16783 struct tevent_req *req;
16784 struct rpccli_spoolss_65_state *state;
16785 struct tevent_req *subreq;
16787 req = tevent_req_create(mem_ctx, &state,
16788 struct rpccli_spoolss_65_state);
16789 if (req == NULL) {
16790 return NULL;
16792 state->out_mem_ctx = NULL;
16793 state->dispatch_recv = cli->dispatch_recv;
16795 /* In parameters */
16797 /* Out parameters */
16799 /* Result */
16800 ZERO_STRUCT(state->orig.out.result);
16802 if (DEBUGLEVEL >= 10) {
16803 NDR_PRINT_IN_DEBUG(spoolss_65, &state->orig);
16806 /* make a temporary copy, that we pass to the dispatch function */
16807 state->tmp = state->orig;
16809 subreq = cli->dispatch_send(state, ev, cli,
16810 &ndr_table_spoolss,
16811 NDR_SPOOLSS_65,
16812 &state->tmp);
16813 if (tevent_req_nomem(subreq, req)) {
16814 return tevent_req_post(req, ev);
16816 tevent_req_set_callback(subreq, rpccli_spoolss_65_done, req);
16817 return req;
16820 static void rpccli_spoolss_65_done(struct tevent_req *subreq)
16822 struct tevent_req *req = tevent_req_callback_data(
16823 subreq, struct tevent_req);
16824 struct rpccli_spoolss_65_state *state = tevent_req_data(
16825 req, struct rpccli_spoolss_65_state);
16826 NTSTATUS status;
16827 TALLOC_CTX *mem_ctx;
16829 if (state->out_mem_ctx) {
16830 mem_ctx = state->out_mem_ctx;
16831 } else {
16832 mem_ctx = state;
16835 status = state->dispatch_recv(subreq, mem_ctx);
16836 TALLOC_FREE(subreq);
16837 if (!NT_STATUS_IS_OK(status)) {
16838 tevent_req_nterror(req, status);
16839 return;
16842 /* Copy out parameters */
16844 /* Copy result */
16845 state->orig.out.result = state->tmp.out.result;
16847 /* Reset temporary structure */
16848 ZERO_STRUCT(state->tmp);
16850 if (DEBUGLEVEL >= 10) {
16851 NDR_PRINT_OUT_DEBUG(spoolss_65, &state->orig);
16854 tevent_req_done(req);
16857 NTSTATUS rpccli_spoolss_65_recv(struct tevent_req *req,
16858 TALLOC_CTX *mem_ctx,
16859 WERROR *result)
16861 struct rpccli_spoolss_65_state *state = tevent_req_data(
16862 req, struct rpccli_spoolss_65_state);
16863 NTSTATUS status;
16865 if (tevent_req_is_nterror(req, &status)) {
16866 tevent_req_received(req);
16867 return status;
16870 /* Steal possbile out parameters to the callers context */
16871 talloc_steal(mem_ctx, state->out_mem_ctx);
16873 /* Return result */
16874 *result = state->orig.out.result;
16876 tevent_req_received(req);
16877 return NT_STATUS_OK;
16880 NTSTATUS rpccli_spoolss_65(struct rpc_pipe_client *cli,
16881 TALLOC_CTX *mem_ctx,
16882 WERROR *werror)
16884 struct spoolss_65 r;
16885 NTSTATUS status;
16887 /* In parameters */
16889 if (DEBUGLEVEL >= 10) {
16890 NDR_PRINT_IN_DEBUG(spoolss_65, &r);
16893 status = cli->dispatch(cli,
16894 mem_ctx,
16895 &ndr_table_spoolss,
16896 NDR_SPOOLSS_65,
16897 &r);
16899 if (!NT_STATUS_IS_OK(status)) {
16900 return status;
16903 if (DEBUGLEVEL >= 10) {
16904 NDR_PRINT_OUT_DEBUG(spoolss_65, &r);
16907 if (NT_STATUS_IS_ERR(status)) {
16908 return status;
16911 /* Return variables */
16913 /* Return result */
16914 if (werror) {
16915 *werror = r.out.result;
16918 return werror_to_ntstatus(r.out.result);
16921 struct rpccli_spoolss_GetCorePrinterDrivers_state {
16922 struct spoolss_GetCorePrinterDrivers orig;
16923 struct spoolss_GetCorePrinterDrivers tmp;
16924 TALLOC_CTX *out_mem_ctx;
16925 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16928 static void rpccli_spoolss_GetCorePrinterDrivers_done(struct tevent_req *subreq);
16930 struct tevent_req *rpccli_spoolss_GetCorePrinterDrivers_send(TALLOC_CTX *mem_ctx,
16931 struct tevent_context *ev,
16932 struct rpc_pipe_client *cli,
16933 const char *_servername /* [in] [unique,charset(UTF16)] */,
16934 const char *_architecture /* [in] [ref,charset(UTF16)] */,
16935 uint32_t _core_driver_size /* [in] */,
16936 const char *_core_driver_dependencies /* [in] [ref,charset(UTF16),size_is(core_driver_size)] */,
16937 uint32_t _core_printer_driver_count /* [in] */,
16938 struct spoolss_CorePrinterDriver *_core_printer_drivers /* [out] [ref,size_is(core_printer_driver_count)] */)
16940 struct tevent_req *req;
16941 struct rpccli_spoolss_GetCorePrinterDrivers_state *state;
16942 struct tevent_req *subreq;
16944 req = tevent_req_create(mem_ctx, &state,
16945 struct rpccli_spoolss_GetCorePrinterDrivers_state);
16946 if (req == NULL) {
16947 return NULL;
16949 state->out_mem_ctx = NULL;
16950 state->dispatch_recv = cli->dispatch_recv;
16952 /* In parameters */
16953 state->orig.in.servername = _servername;
16954 state->orig.in.architecture = _architecture;
16955 state->orig.in.core_driver_size = _core_driver_size;
16956 state->orig.in.core_driver_dependencies = _core_driver_dependencies;
16957 state->orig.in.core_printer_driver_count = _core_printer_driver_count;
16959 /* Out parameters */
16960 state->orig.out.core_printer_drivers = _core_printer_drivers;
16962 /* Result */
16963 ZERO_STRUCT(state->orig.out.result);
16965 if (DEBUGLEVEL >= 10) {
16966 NDR_PRINT_IN_DEBUG(spoolss_GetCorePrinterDrivers, &state->orig);
16969 state->out_mem_ctx = talloc_named_const(state, 0,
16970 "rpccli_spoolss_GetCorePrinterDrivers_out_memory");
16971 if (tevent_req_nomem(state->out_mem_ctx, req)) {
16972 return tevent_req_post(req, ev);
16975 /* make a temporary copy, that we pass to the dispatch function */
16976 state->tmp = state->orig;
16978 subreq = cli->dispatch_send(state, ev, cli,
16979 &ndr_table_spoolss,
16980 NDR_SPOOLSS_GETCOREPRINTERDRIVERS,
16981 &state->tmp);
16982 if (tevent_req_nomem(subreq, req)) {
16983 return tevent_req_post(req, ev);
16985 tevent_req_set_callback(subreq, rpccli_spoolss_GetCorePrinterDrivers_done, req);
16986 return req;
16989 static void rpccli_spoolss_GetCorePrinterDrivers_done(struct tevent_req *subreq)
16991 struct tevent_req *req = tevent_req_callback_data(
16992 subreq, struct tevent_req);
16993 struct rpccli_spoolss_GetCorePrinterDrivers_state *state = tevent_req_data(
16994 req, struct rpccli_spoolss_GetCorePrinterDrivers_state);
16995 NTSTATUS status;
16996 TALLOC_CTX *mem_ctx;
16998 if (state->out_mem_ctx) {
16999 mem_ctx = state->out_mem_ctx;
17000 } else {
17001 mem_ctx = state;
17004 status = state->dispatch_recv(subreq, mem_ctx);
17005 TALLOC_FREE(subreq);
17006 if (!NT_STATUS_IS_OK(status)) {
17007 tevent_req_nterror(req, status);
17008 return;
17011 /* Copy out parameters */
17012 memcpy(state->orig.out.core_printer_drivers, state->tmp.out.core_printer_drivers, state->tmp.in.core_printer_driver_count * sizeof(*state->orig.out.core_printer_drivers));
17014 /* Copy result */
17015 state->orig.out.result = state->tmp.out.result;
17017 /* Reset temporary structure */
17018 ZERO_STRUCT(state->tmp);
17020 if (DEBUGLEVEL >= 10) {
17021 NDR_PRINT_OUT_DEBUG(spoolss_GetCorePrinterDrivers, &state->orig);
17024 tevent_req_done(req);
17027 NTSTATUS rpccli_spoolss_GetCorePrinterDrivers_recv(struct tevent_req *req,
17028 TALLOC_CTX *mem_ctx,
17029 WERROR *result)
17031 struct rpccli_spoolss_GetCorePrinterDrivers_state *state = tevent_req_data(
17032 req, struct rpccli_spoolss_GetCorePrinterDrivers_state);
17033 NTSTATUS status;
17035 if (tevent_req_is_nterror(req, &status)) {
17036 tevent_req_received(req);
17037 return status;
17040 /* Steal possbile out parameters to the callers context */
17041 talloc_steal(mem_ctx, state->out_mem_ctx);
17043 /* Return result */
17044 *result = state->orig.out.result;
17046 tevent_req_received(req);
17047 return NT_STATUS_OK;
17050 NTSTATUS rpccli_spoolss_GetCorePrinterDrivers(struct rpc_pipe_client *cli,
17051 TALLOC_CTX *mem_ctx,
17052 const char *servername /* [in] [unique,charset(UTF16)] */,
17053 const char *architecture /* [in] [ref,charset(UTF16)] */,
17054 uint32_t core_driver_size /* [in] */,
17055 const char *core_driver_dependencies /* [in] [ref,charset(UTF16),size_is(core_driver_size)] */,
17056 uint32_t core_printer_driver_count /* [in] */,
17057 struct spoolss_CorePrinterDriver *core_printer_drivers /* [out] [ref,size_is(core_printer_driver_count)] */,
17058 WERROR *werror)
17060 struct spoolss_GetCorePrinterDrivers r;
17061 NTSTATUS status;
17063 /* In parameters */
17064 r.in.servername = servername;
17065 r.in.architecture = architecture;
17066 r.in.core_driver_size = core_driver_size;
17067 r.in.core_driver_dependencies = core_driver_dependencies;
17068 r.in.core_printer_driver_count = core_printer_driver_count;
17070 if (DEBUGLEVEL >= 10) {
17071 NDR_PRINT_IN_DEBUG(spoolss_GetCorePrinterDrivers, &r);
17074 status = cli->dispatch(cli,
17075 mem_ctx,
17076 &ndr_table_spoolss,
17077 NDR_SPOOLSS_GETCOREPRINTERDRIVERS,
17078 &r);
17080 if (!NT_STATUS_IS_OK(status)) {
17081 return status;
17084 if (DEBUGLEVEL >= 10) {
17085 NDR_PRINT_OUT_DEBUG(spoolss_GetCorePrinterDrivers, &r);
17088 if (NT_STATUS_IS_ERR(status)) {
17089 return status;
17092 /* Return variables */
17093 memcpy(core_printer_drivers, r.out.core_printer_drivers, r.in.core_printer_driver_count * sizeof(*core_printer_drivers));
17095 /* Return result */
17096 if (werror) {
17097 *werror = r.out.result;
17100 return werror_to_ntstatus(r.out.result);
17103 struct rpccli_spoolss_67_state {
17104 struct spoolss_67 orig;
17105 struct spoolss_67 tmp;
17106 TALLOC_CTX *out_mem_ctx;
17107 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
17110 static void rpccli_spoolss_67_done(struct tevent_req *subreq);
17112 struct tevent_req *rpccli_spoolss_67_send(TALLOC_CTX *mem_ctx,
17113 struct tevent_context *ev,
17114 struct rpc_pipe_client *cli)
17116 struct tevent_req *req;
17117 struct rpccli_spoolss_67_state *state;
17118 struct tevent_req *subreq;
17120 req = tevent_req_create(mem_ctx, &state,
17121 struct rpccli_spoolss_67_state);
17122 if (req == NULL) {
17123 return NULL;
17125 state->out_mem_ctx = NULL;
17126 state->dispatch_recv = cli->dispatch_recv;
17128 /* In parameters */
17130 /* Out parameters */
17132 /* Result */
17133 ZERO_STRUCT(state->orig.out.result);
17135 if (DEBUGLEVEL >= 10) {
17136 NDR_PRINT_IN_DEBUG(spoolss_67, &state->orig);
17139 /* make a temporary copy, that we pass to the dispatch function */
17140 state->tmp = state->orig;
17142 subreq = cli->dispatch_send(state, ev, cli,
17143 &ndr_table_spoolss,
17144 NDR_SPOOLSS_67,
17145 &state->tmp);
17146 if (tevent_req_nomem(subreq, req)) {
17147 return tevent_req_post(req, ev);
17149 tevent_req_set_callback(subreq, rpccli_spoolss_67_done, req);
17150 return req;
17153 static void rpccli_spoolss_67_done(struct tevent_req *subreq)
17155 struct tevent_req *req = tevent_req_callback_data(
17156 subreq, struct tevent_req);
17157 struct rpccli_spoolss_67_state *state = tevent_req_data(
17158 req, struct rpccli_spoolss_67_state);
17159 NTSTATUS status;
17160 TALLOC_CTX *mem_ctx;
17162 if (state->out_mem_ctx) {
17163 mem_ctx = state->out_mem_ctx;
17164 } else {
17165 mem_ctx = state;
17168 status = state->dispatch_recv(subreq, mem_ctx);
17169 TALLOC_FREE(subreq);
17170 if (!NT_STATUS_IS_OK(status)) {
17171 tevent_req_nterror(req, status);
17172 return;
17175 /* Copy out parameters */
17177 /* Copy result */
17178 state->orig.out.result = state->tmp.out.result;
17180 /* Reset temporary structure */
17181 ZERO_STRUCT(state->tmp);
17183 if (DEBUGLEVEL >= 10) {
17184 NDR_PRINT_OUT_DEBUG(spoolss_67, &state->orig);
17187 tevent_req_done(req);
17190 NTSTATUS rpccli_spoolss_67_recv(struct tevent_req *req,
17191 TALLOC_CTX *mem_ctx,
17192 WERROR *result)
17194 struct rpccli_spoolss_67_state *state = tevent_req_data(
17195 req, struct rpccli_spoolss_67_state);
17196 NTSTATUS status;
17198 if (tevent_req_is_nterror(req, &status)) {
17199 tevent_req_received(req);
17200 return status;
17203 /* Steal possbile out parameters to the callers context */
17204 talloc_steal(mem_ctx, state->out_mem_ctx);
17206 /* Return result */
17207 *result = state->orig.out.result;
17209 tevent_req_received(req);
17210 return NT_STATUS_OK;
17213 NTSTATUS rpccli_spoolss_67(struct rpc_pipe_client *cli,
17214 TALLOC_CTX *mem_ctx,
17215 WERROR *werror)
17217 struct spoolss_67 r;
17218 NTSTATUS status;
17220 /* In parameters */
17222 if (DEBUGLEVEL >= 10) {
17223 NDR_PRINT_IN_DEBUG(spoolss_67, &r);
17226 status = cli->dispatch(cli,
17227 mem_ctx,
17228 &ndr_table_spoolss,
17229 NDR_SPOOLSS_67,
17230 &r);
17232 if (!NT_STATUS_IS_OK(status)) {
17233 return status;
17236 if (DEBUGLEVEL >= 10) {
17237 NDR_PRINT_OUT_DEBUG(spoolss_67, &r);
17240 if (NT_STATUS_IS_ERR(status)) {
17241 return status;
17244 /* Return variables */
17246 /* Return result */
17247 if (werror) {
17248 *werror = r.out.result;
17251 return werror_to_ntstatus(r.out.result);
17254 struct rpccli_spoolss_GetPrinterDriverPackagePath_state {
17255 struct spoolss_GetPrinterDriverPackagePath orig;
17256 struct spoolss_GetPrinterDriverPackagePath tmp;
17257 TALLOC_CTX *out_mem_ctx;
17258 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
17261 static void rpccli_spoolss_GetPrinterDriverPackagePath_done(struct tevent_req *subreq);
17263 struct tevent_req *rpccli_spoolss_GetPrinterDriverPackagePath_send(TALLOC_CTX *mem_ctx,
17264 struct tevent_context *ev,
17265 struct rpc_pipe_client *cli,
17266 const char *_servername /* [in] [unique,charset(UTF16)] */,
17267 const char *_architecture /* [in] [ref,charset(UTF16)] */,
17268 const char *_language /* [in] [unique,charset(UTF16)] */,
17269 const char *_package_id /* [in] [ref,charset(UTF16)] */,
17270 const char *_driver_package_cab /* [in,out] [unique,charset(UTF16),size_is(driver_package_cab_size)] */,
17271 uint32_t _driver_package_cab_size /* [in] */,
17272 uint32_t *_required /* [out] [ref] */)
17274 struct tevent_req *req;
17275 struct rpccli_spoolss_GetPrinterDriverPackagePath_state *state;
17276 struct tevent_req *subreq;
17278 req = tevent_req_create(mem_ctx, &state,
17279 struct rpccli_spoolss_GetPrinterDriverPackagePath_state);
17280 if (req == NULL) {
17281 return NULL;
17283 state->out_mem_ctx = NULL;
17284 state->dispatch_recv = cli->dispatch_recv;
17286 /* In parameters */
17287 state->orig.in.servername = _servername;
17288 state->orig.in.architecture = _architecture;
17289 state->orig.in.language = _language;
17290 state->orig.in.package_id = _package_id;
17291 state->orig.in.driver_package_cab = _driver_package_cab;
17292 state->orig.in.driver_package_cab_size = _driver_package_cab_size;
17294 /* Out parameters */
17295 state->orig.out.driver_package_cab = _driver_package_cab;
17296 state->orig.out.required = _required;
17298 /* Result */
17299 ZERO_STRUCT(state->orig.out.result);
17301 if (DEBUGLEVEL >= 10) {
17302 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriverPackagePath, &state->orig);
17305 state->out_mem_ctx = talloc_named_const(state, 0,
17306 "rpccli_spoolss_GetPrinterDriverPackagePath_out_memory");
17307 if (tevent_req_nomem(state->out_mem_ctx, req)) {
17308 return tevent_req_post(req, ev);
17311 /* make a temporary copy, that we pass to the dispatch function */
17312 state->tmp = state->orig;
17314 subreq = cli->dispatch_send(state, ev, cli,
17315 &ndr_table_spoolss,
17316 NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH,
17317 &state->tmp);
17318 if (tevent_req_nomem(subreq, req)) {
17319 return tevent_req_post(req, ev);
17321 tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterDriverPackagePath_done, req);
17322 return req;
17325 static void rpccli_spoolss_GetPrinterDriverPackagePath_done(struct tevent_req *subreq)
17327 struct tevent_req *req = tevent_req_callback_data(
17328 subreq, struct tevent_req);
17329 struct rpccli_spoolss_GetPrinterDriverPackagePath_state *state = tevent_req_data(
17330 req, struct rpccli_spoolss_GetPrinterDriverPackagePath_state);
17331 NTSTATUS status;
17332 TALLOC_CTX *mem_ctx;
17334 if (state->out_mem_ctx) {
17335 mem_ctx = state->out_mem_ctx;
17336 } else {
17337 mem_ctx = state;
17340 status = state->dispatch_recv(subreq, mem_ctx);
17341 TALLOC_FREE(subreq);
17342 if (!NT_STATUS_IS_OK(status)) {
17343 tevent_req_nterror(req, status);
17344 return;
17347 /* Copy out parameters */
17348 if (state->orig.out.driver_package_cab && state->tmp.out.driver_package_cab) {
17349 memcpy(CONST_DISCARD(char *, state->orig.out.driver_package_cab), state->tmp.out.driver_package_cab, state->tmp.in.driver_package_cab_size * sizeof(*state->orig.out.driver_package_cab));
17351 *state->orig.out.required = *state->tmp.out.required;
17353 /* Copy result */
17354 state->orig.out.result = state->tmp.out.result;
17356 /* Reset temporary structure */
17357 ZERO_STRUCT(state->tmp);
17359 if (DEBUGLEVEL >= 10) {
17360 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverPackagePath, &state->orig);
17363 tevent_req_done(req);
17366 NTSTATUS rpccli_spoolss_GetPrinterDriverPackagePath_recv(struct tevent_req *req,
17367 TALLOC_CTX *mem_ctx,
17368 WERROR *result)
17370 struct rpccli_spoolss_GetPrinterDriverPackagePath_state *state = tevent_req_data(
17371 req, struct rpccli_spoolss_GetPrinterDriverPackagePath_state);
17372 NTSTATUS status;
17374 if (tevent_req_is_nterror(req, &status)) {
17375 tevent_req_received(req);
17376 return status;
17379 /* Steal possbile out parameters to the callers context */
17380 talloc_steal(mem_ctx, state->out_mem_ctx);
17382 /* Return result */
17383 *result = state->orig.out.result;
17385 tevent_req_received(req);
17386 return NT_STATUS_OK;
17389 NTSTATUS rpccli_spoolss_GetPrinterDriverPackagePath(struct rpc_pipe_client *cli,
17390 TALLOC_CTX *mem_ctx,
17391 const char *servername /* [in] [unique,charset(UTF16)] */,
17392 const char *architecture /* [in] [ref,charset(UTF16)] */,
17393 const char *language /* [in] [unique,charset(UTF16)] */,
17394 const char *package_id /* [in] [ref,charset(UTF16)] */,
17395 const char *driver_package_cab /* [in,out] [unique,charset(UTF16),size_is(driver_package_cab_size)] */,
17396 uint32_t driver_package_cab_size /* [in] */,
17397 uint32_t *required /* [out] [ref] */,
17398 WERROR *werror)
17400 struct spoolss_GetPrinterDriverPackagePath r;
17401 NTSTATUS status;
17403 /* In parameters */
17404 r.in.servername = servername;
17405 r.in.architecture = architecture;
17406 r.in.language = language;
17407 r.in.package_id = package_id;
17408 r.in.driver_package_cab = driver_package_cab;
17409 r.in.driver_package_cab_size = driver_package_cab_size;
17411 if (DEBUGLEVEL >= 10) {
17412 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriverPackagePath, &r);
17415 status = cli->dispatch(cli,
17416 mem_ctx,
17417 &ndr_table_spoolss,
17418 NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH,
17419 &r);
17421 if (!NT_STATUS_IS_OK(status)) {
17422 return status;
17425 if (DEBUGLEVEL >= 10) {
17426 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverPackagePath, &r);
17429 if (NT_STATUS_IS_ERR(status)) {
17430 return status;
17433 /* Return variables */
17434 if (driver_package_cab && r.out.driver_package_cab) {
17435 memcpy(CONST_DISCARD(char *, driver_package_cab), r.out.driver_package_cab, r.in.driver_package_cab_size * sizeof(*driver_package_cab));
17437 *required = *r.out.required;
17439 /* Return result */
17440 if (werror) {
17441 *werror = r.out.result;
17444 return werror_to_ntstatus(r.out.result);
17447 struct rpccli_spoolss_69_state {
17448 struct spoolss_69 orig;
17449 struct spoolss_69 tmp;
17450 TALLOC_CTX *out_mem_ctx;
17451 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
17454 static void rpccli_spoolss_69_done(struct tevent_req *subreq);
17456 struct tevent_req *rpccli_spoolss_69_send(TALLOC_CTX *mem_ctx,
17457 struct tevent_context *ev,
17458 struct rpc_pipe_client *cli)
17460 struct tevent_req *req;
17461 struct rpccli_spoolss_69_state *state;
17462 struct tevent_req *subreq;
17464 req = tevent_req_create(mem_ctx, &state,
17465 struct rpccli_spoolss_69_state);
17466 if (req == NULL) {
17467 return NULL;
17469 state->out_mem_ctx = NULL;
17470 state->dispatch_recv = cli->dispatch_recv;
17472 /* In parameters */
17474 /* Out parameters */
17476 /* Result */
17477 ZERO_STRUCT(state->orig.out.result);
17479 if (DEBUGLEVEL >= 10) {
17480 NDR_PRINT_IN_DEBUG(spoolss_69, &state->orig);
17483 /* make a temporary copy, that we pass to the dispatch function */
17484 state->tmp = state->orig;
17486 subreq = cli->dispatch_send(state, ev, cli,
17487 &ndr_table_spoolss,
17488 NDR_SPOOLSS_69,
17489 &state->tmp);
17490 if (tevent_req_nomem(subreq, req)) {
17491 return tevent_req_post(req, ev);
17493 tevent_req_set_callback(subreq, rpccli_spoolss_69_done, req);
17494 return req;
17497 static void rpccli_spoolss_69_done(struct tevent_req *subreq)
17499 struct tevent_req *req = tevent_req_callback_data(
17500 subreq, struct tevent_req);
17501 struct rpccli_spoolss_69_state *state = tevent_req_data(
17502 req, struct rpccli_spoolss_69_state);
17503 NTSTATUS status;
17504 TALLOC_CTX *mem_ctx;
17506 if (state->out_mem_ctx) {
17507 mem_ctx = state->out_mem_ctx;
17508 } else {
17509 mem_ctx = state;
17512 status = state->dispatch_recv(subreq, mem_ctx);
17513 TALLOC_FREE(subreq);
17514 if (!NT_STATUS_IS_OK(status)) {
17515 tevent_req_nterror(req, status);
17516 return;
17519 /* Copy out parameters */
17521 /* Copy result */
17522 state->orig.out.result = state->tmp.out.result;
17524 /* Reset temporary structure */
17525 ZERO_STRUCT(state->tmp);
17527 if (DEBUGLEVEL >= 10) {
17528 NDR_PRINT_OUT_DEBUG(spoolss_69, &state->orig);
17531 tevent_req_done(req);
17534 NTSTATUS rpccli_spoolss_69_recv(struct tevent_req *req,
17535 TALLOC_CTX *mem_ctx,
17536 WERROR *result)
17538 struct rpccli_spoolss_69_state *state = tevent_req_data(
17539 req, struct rpccli_spoolss_69_state);
17540 NTSTATUS status;
17542 if (tevent_req_is_nterror(req, &status)) {
17543 tevent_req_received(req);
17544 return status;
17547 /* Steal possbile out parameters to the callers context */
17548 talloc_steal(mem_ctx, state->out_mem_ctx);
17550 /* Return result */
17551 *result = state->orig.out.result;
17553 tevent_req_received(req);
17554 return NT_STATUS_OK;
17557 NTSTATUS rpccli_spoolss_69(struct rpc_pipe_client *cli,
17558 TALLOC_CTX *mem_ctx,
17559 WERROR *werror)
17561 struct spoolss_69 r;
17562 NTSTATUS status;
17564 /* In parameters */
17566 if (DEBUGLEVEL >= 10) {
17567 NDR_PRINT_IN_DEBUG(spoolss_69, &r);
17570 status = cli->dispatch(cli,
17571 mem_ctx,
17572 &ndr_table_spoolss,
17573 NDR_SPOOLSS_69,
17574 &r);
17576 if (!NT_STATUS_IS_OK(status)) {
17577 return status;
17580 if (DEBUGLEVEL >= 10) {
17581 NDR_PRINT_OUT_DEBUG(spoolss_69, &r);
17584 if (NT_STATUS_IS_ERR(status)) {
17585 return status;
17588 /* Return variables */
17590 /* Return result */
17591 if (werror) {
17592 *werror = r.out.result;
17595 return werror_to_ntstatus(r.out.result);
17598 struct rpccli_spoolss_6a_state {
17599 struct spoolss_6a orig;
17600 struct spoolss_6a tmp;
17601 TALLOC_CTX *out_mem_ctx;
17602 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
17605 static void rpccli_spoolss_6a_done(struct tevent_req *subreq);
17607 struct tevent_req *rpccli_spoolss_6a_send(TALLOC_CTX *mem_ctx,
17608 struct tevent_context *ev,
17609 struct rpc_pipe_client *cli)
17611 struct tevent_req *req;
17612 struct rpccli_spoolss_6a_state *state;
17613 struct tevent_req *subreq;
17615 req = tevent_req_create(mem_ctx, &state,
17616 struct rpccli_spoolss_6a_state);
17617 if (req == NULL) {
17618 return NULL;
17620 state->out_mem_ctx = NULL;
17621 state->dispatch_recv = cli->dispatch_recv;
17623 /* In parameters */
17625 /* Out parameters */
17627 /* Result */
17628 ZERO_STRUCT(state->orig.out.result);
17630 if (DEBUGLEVEL >= 10) {
17631 NDR_PRINT_IN_DEBUG(spoolss_6a, &state->orig);
17634 /* make a temporary copy, that we pass to the dispatch function */
17635 state->tmp = state->orig;
17637 subreq = cli->dispatch_send(state, ev, cli,
17638 &ndr_table_spoolss,
17639 NDR_SPOOLSS_6A,
17640 &state->tmp);
17641 if (tevent_req_nomem(subreq, req)) {
17642 return tevent_req_post(req, ev);
17644 tevent_req_set_callback(subreq, rpccli_spoolss_6a_done, req);
17645 return req;
17648 static void rpccli_spoolss_6a_done(struct tevent_req *subreq)
17650 struct tevent_req *req = tevent_req_callback_data(
17651 subreq, struct tevent_req);
17652 struct rpccli_spoolss_6a_state *state = tevent_req_data(
17653 req, struct rpccli_spoolss_6a_state);
17654 NTSTATUS status;
17655 TALLOC_CTX *mem_ctx;
17657 if (state->out_mem_ctx) {
17658 mem_ctx = state->out_mem_ctx;
17659 } else {
17660 mem_ctx = state;
17663 status = state->dispatch_recv(subreq, mem_ctx);
17664 TALLOC_FREE(subreq);
17665 if (!NT_STATUS_IS_OK(status)) {
17666 tevent_req_nterror(req, status);
17667 return;
17670 /* Copy out parameters */
17672 /* Copy result */
17673 state->orig.out.result = state->tmp.out.result;
17675 /* Reset temporary structure */
17676 ZERO_STRUCT(state->tmp);
17678 if (DEBUGLEVEL >= 10) {
17679 NDR_PRINT_OUT_DEBUG(spoolss_6a, &state->orig);
17682 tevent_req_done(req);
17685 NTSTATUS rpccli_spoolss_6a_recv(struct tevent_req *req,
17686 TALLOC_CTX *mem_ctx,
17687 WERROR *result)
17689 struct rpccli_spoolss_6a_state *state = tevent_req_data(
17690 req, struct rpccli_spoolss_6a_state);
17691 NTSTATUS status;
17693 if (tevent_req_is_nterror(req, &status)) {
17694 tevent_req_received(req);
17695 return status;
17698 /* Steal possbile out parameters to the callers context */
17699 talloc_steal(mem_ctx, state->out_mem_ctx);
17701 /* Return result */
17702 *result = state->orig.out.result;
17704 tevent_req_received(req);
17705 return NT_STATUS_OK;
17708 NTSTATUS rpccli_spoolss_6a(struct rpc_pipe_client *cli,
17709 TALLOC_CTX *mem_ctx,
17710 WERROR *werror)
17712 struct spoolss_6a r;
17713 NTSTATUS status;
17715 /* In parameters */
17717 if (DEBUGLEVEL >= 10) {
17718 NDR_PRINT_IN_DEBUG(spoolss_6a, &r);
17721 status = cli->dispatch(cli,
17722 mem_ctx,
17723 &ndr_table_spoolss,
17724 NDR_SPOOLSS_6A,
17725 &r);
17727 if (!NT_STATUS_IS_OK(status)) {
17728 return status;
17731 if (DEBUGLEVEL >= 10) {
17732 NDR_PRINT_OUT_DEBUG(spoolss_6a, &r);
17735 if (NT_STATUS_IS_ERR(status)) {
17736 return status;
17739 /* Return variables */
17741 /* Return result */
17742 if (werror) {
17743 *werror = r.out.result;
17746 return werror_to_ntstatus(r.out.result);
17749 struct rpccli_spoolss_6b_state {
17750 struct spoolss_6b orig;
17751 struct spoolss_6b tmp;
17752 TALLOC_CTX *out_mem_ctx;
17753 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
17756 static void rpccli_spoolss_6b_done(struct tevent_req *subreq);
17758 struct tevent_req *rpccli_spoolss_6b_send(TALLOC_CTX *mem_ctx,
17759 struct tevent_context *ev,
17760 struct rpc_pipe_client *cli)
17762 struct tevent_req *req;
17763 struct rpccli_spoolss_6b_state *state;
17764 struct tevent_req *subreq;
17766 req = tevent_req_create(mem_ctx, &state,
17767 struct rpccli_spoolss_6b_state);
17768 if (req == NULL) {
17769 return NULL;
17771 state->out_mem_ctx = NULL;
17772 state->dispatch_recv = cli->dispatch_recv;
17774 /* In parameters */
17776 /* Out parameters */
17778 /* Result */
17779 ZERO_STRUCT(state->orig.out.result);
17781 if (DEBUGLEVEL >= 10) {
17782 NDR_PRINT_IN_DEBUG(spoolss_6b, &state->orig);
17785 /* make a temporary copy, that we pass to the dispatch function */
17786 state->tmp = state->orig;
17788 subreq = cli->dispatch_send(state, ev, cli,
17789 &ndr_table_spoolss,
17790 NDR_SPOOLSS_6B,
17791 &state->tmp);
17792 if (tevent_req_nomem(subreq, req)) {
17793 return tevent_req_post(req, ev);
17795 tevent_req_set_callback(subreq, rpccli_spoolss_6b_done, req);
17796 return req;
17799 static void rpccli_spoolss_6b_done(struct tevent_req *subreq)
17801 struct tevent_req *req = tevent_req_callback_data(
17802 subreq, struct tevent_req);
17803 struct rpccli_spoolss_6b_state *state = tevent_req_data(
17804 req, struct rpccli_spoolss_6b_state);
17805 NTSTATUS status;
17806 TALLOC_CTX *mem_ctx;
17808 if (state->out_mem_ctx) {
17809 mem_ctx = state->out_mem_ctx;
17810 } else {
17811 mem_ctx = state;
17814 status = state->dispatch_recv(subreq, mem_ctx);
17815 TALLOC_FREE(subreq);
17816 if (!NT_STATUS_IS_OK(status)) {
17817 tevent_req_nterror(req, status);
17818 return;
17821 /* Copy out parameters */
17823 /* Copy result */
17824 state->orig.out.result = state->tmp.out.result;
17826 /* Reset temporary structure */
17827 ZERO_STRUCT(state->tmp);
17829 if (DEBUGLEVEL >= 10) {
17830 NDR_PRINT_OUT_DEBUG(spoolss_6b, &state->orig);
17833 tevent_req_done(req);
17836 NTSTATUS rpccli_spoolss_6b_recv(struct tevent_req *req,
17837 TALLOC_CTX *mem_ctx,
17838 WERROR *result)
17840 struct rpccli_spoolss_6b_state *state = tevent_req_data(
17841 req, struct rpccli_spoolss_6b_state);
17842 NTSTATUS status;
17844 if (tevent_req_is_nterror(req, &status)) {
17845 tevent_req_received(req);
17846 return status;
17849 /* Steal possbile out parameters to the callers context */
17850 talloc_steal(mem_ctx, state->out_mem_ctx);
17852 /* Return result */
17853 *result = state->orig.out.result;
17855 tevent_req_received(req);
17856 return NT_STATUS_OK;
17859 NTSTATUS rpccli_spoolss_6b(struct rpc_pipe_client *cli,
17860 TALLOC_CTX *mem_ctx,
17861 WERROR *werror)
17863 struct spoolss_6b r;
17864 NTSTATUS status;
17866 /* In parameters */
17868 if (DEBUGLEVEL >= 10) {
17869 NDR_PRINT_IN_DEBUG(spoolss_6b, &r);
17872 status = cli->dispatch(cli,
17873 mem_ctx,
17874 &ndr_table_spoolss,
17875 NDR_SPOOLSS_6B,
17876 &r);
17878 if (!NT_STATUS_IS_OK(status)) {
17879 return status;
17882 if (DEBUGLEVEL >= 10) {
17883 NDR_PRINT_OUT_DEBUG(spoolss_6b, &r);
17886 if (NT_STATUS_IS_ERR(status)) {
17887 return status;
17890 /* Return variables */
17892 /* Return result */
17893 if (werror) {
17894 *werror = r.out.result;
17897 return werror_to_ntstatus(r.out.result);
17900 struct rpccli_spoolss_6c_state {
17901 struct spoolss_6c orig;
17902 struct spoolss_6c tmp;
17903 TALLOC_CTX *out_mem_ctx;
17904 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
17907 static void rpccli_spoolss_6c_done(struct tevent_req *subreq);
17909 struct tevent_req *rpccli_spoolss_6c_send(TALLOC_CTX *mem_ctx,
17910 struct tevent_context *ev,
17911 struct rpc_pipe_client *cli)
17913 struct tevent_req *req;
17914 struct rpccli_spoolss_6c_state *state;
17915 struct tevent_req *subreq;
17917 req = tevent_req_create(mem_ctx, &state,
17918 struct rpccli_spoolss_6c_state);
17919 if (req == NULL) {
17920 return NULL;
17922 state->out_mem_ctx = NULL;
17923 state->dispatch_recv = cli->dispatch_recv;
17925 /* In parameters */
17927 /* Out parameters */
17929 /* Result */
17930 ZERO_STRUCT(state->orig.out.result);
17932 if (DEBUGLEVEL >= 10) {
17933 NDR_PRINT_IN_DEBUG(spoolss_6c, &state->orig);
17936 /* make a temporary copy, that we pass to the dispatch function */
17937 state->tmp = state->orig;
17939 subreq = cli->dispatch_send(state, ev, cli,
17940 &ndr_table_spoolss,
17941 NDR_SPOOLSS_6C,
17942 &state->tmp);
17943 if (tevent_req_nomem(subreq, req)) {
17944 return tevent_req_post(req, ev);
17946 tevent_req_set_callback(subreq, rpccli_spoolss_6c_done, req);
17947 return req;
17950 static void rpccli_spoolss_6c_done(struct tevent_req *subreq)
17952 struct tevent_req *req = tevent_req_callback_data(
17953 subreq, struct tevent_req);
17954 struct rpccli_spoolss_6c_state *state = tevent_req_data(
17955 req, struct rpccli_spoolss_6c_state);
17956 NTSTATUS status;
17957 TALLOC_CTX *mem_ctx;
17959 if (state->out_mem_ctx) {
17960 mem_ctx = state->out_mem_ctx;
17961 } else {
17962 mem_ctx = state;
17965 status = state->dispatch_recv(subreq, mem_ctx);
17966 TALLOC_FREE(subreq);
17967 if (!NT_STATUS_IS_OK(status)) {
17968 tevent_req_nterror(req, status);
17969 return;
17972 /* Copy out parameters */
17974 /* Copy result */
17975 state->orig.out.result = state->tmp.out.result;
17977 /* Reset temporary structure */
17978 ZERO_STRUCT(state->tmp);
17980 if (DEBUGLEVEL >= 10) {
17981 NDR_PRINT_OUT_DEBUG(spoolss_6c, &state->orig);
17984 tevent_req_done(req);
17987 NTSTATUS rpccli_spoolss_6c_recv(struct tevent_req *req,
17988 TALLOC_CTX *mem_ctx,
17989 WERROR *result)
17991 struct rpccli_spoolss_6c_state *state = tevent_req_data(
17992 req, struct rpccli_spoolss_6c_state);
17993 NTSTATUS status;
17995 if (tevent_req_is_nterror(req, &status)) {
17996 tevent_req_received(req);
17997 return status;
18000 /* Steal possbile out parameters to the callers context */
18001 talloc_steal(mem_ctx, state->out_mem_ctx);
18003 /* Return result */
18004 *result = state->orig.out.result;
18006 tevent_req_received(req);
18007 return NT_STATUS_OK;
18010 NTSTATUS rpccli_spoolss_6c(struct rpc_pipe_client *cli,
18011 TALLOC_CTX *mem_ctx,
18012 WERROR *werror)
18014 struct spoolss_6c r;
18015 NTSTATUS status;
18017 /* In parameters */
18019 if (DEBUGLEVEL >= 10) {
18020 NDR_PRINT_IN_DEBUG(spoolss_6c, &r);
18023 status = cli->dispatch(cli,
18024 mem_ctx,
18025 &ndr_table_spoolss,
18026 NDR_SPOOLSS_6C,
18027 &r);
18029 if (!NT_STATUS_IS_OK(status)) {
18030 return status;
18033 if (DEBUGLEVEL >= 10) {
18034 NDR_PRINT_OUT_DEBUG(spoolss_6c, &r);
18037 if (NT_STATUS_IS_ERR(status)) {
18038 return status;
18041 /* Return variables */
18043 /* Return result */
18044 if (werror) {
18045 *werror = r.out.result;
18048 return werror_to_ntstatus(r.out.result);
18051 struct rpccli_spoolss_6d_state {
18052 struct spoolss_6d orig;
18053 struct spoolss_6d tmp;
18054 TALLOC_CTX *out_mem_ctx;
18055 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
18058 static void rpccli_spoolss_6d_done(struct tevent_req *subreq);
18060 struct tevent_req *rpccli_spoolss_6d_send(TALLOC_CTX *mem_ctx,
18061 struct tevent_context *ev,
18062 struct rpc_pipe_client *cli)
18064 struct tevent_req *req;
18065 struct rpccli_spoolss_6d_state *state;
18066 struct tevent_req *subreq;
18068 req = tevent_req_create(mem_ctx, &state,
18069 struct rpccli_spoolss_6d_state);
18070 if (req == NULL) {
18071 return NULL;
18073 state->out_mem_ctx = NULL;
18074 state->dispatch_recv = cli->dispatch_recv;
18076 /* In parameters */
18078 /* Out parameters */
18080 /* Result */
18081 ZERO_STRUCT(state->orig.out.result);
18083 if (DEBUGLEVEL >= 10) {
18084 NDR_PRINT_IN_DEBUG(spoolss_6d, &state->orig);
18087 /* make a temporary copy, that we pass to the dispatch function */
18088 state->tmp = state->orig;
18090 subreq = cli->dispatch_send(state, ev, cli,
18091 &ndr_table_spoolss,
18092 NDR_SPOOLSS_6D,
18093 &state->tmp);
18094 if (tevent_req_nomem(subreq, req)) {
18095 return tevent_req_post(req, ev);
18097 tevent_req_set_callback(subreq, rpccli_spoolss_6d_done, req);
18098 return req;
18101 static void rpccli_spoolss_6d_done(struct tevent_req *subreq)
18103 struct tevent_req *req = tevent_req_callback_data(
18104 subreq, struct tevent_req);
18105 struct rpccli_spoolss_6d_state *state = tevent_req_data(
18106 req, struct rpccli_spoolss_6d_state);
18107 NTSTATUS status;
18108 TALLOC_CTX *mem_ctx;
18110 if (state->out_mem_ctx) {
18111 mem_ctx = state->out_mem_ctx;
18112 } else {
18113 mem_ctx = state;
18116 status = state->dispatch_recv(subreq, mem_ctx);
18117 TALLOC_FREE(subreq);
18118 if (!NT_STATUS_IS_OK(status)) {
18119 tevent_req_nterror(req, status);
18120 return;
18123 /* Copy out parameters */
18125 /* Copy result */
18126 state->orig.out.result = state->tmp.out.result;
18128 /* Reset temporary structure */
18129 ZERO_STRUCT(state->tmp);
18131 if (DEBUGLEVEL >= 10) {
18132 NDR_PRINT_OUT_DEBUG(spoolss_6d, &state->orig);
18135 tevent_req_done(req);
18138 NTSTATUS rpccli_spoolss_6d_recv(struct tevent_req *req,
18139 TALLOC_CTX *mem_ctx,
18140 WERROR *result)
18142 struct rpccli_spoolss_6d_state *state = tevent_req_data(
18143 req, struct rpccli_spoolss_6d_state);
18144 NTSTATUS status;
18146 if (tevent_req_is_nterror(req, &status)) {
18147 tevent_req_received(req);
18148 return status;
18151 /* Steal possbile out parameters to the callers context */
18152 talloc_steal(mem_ctx, state->out_mem_ctx);
18154 /* Return result */
18155 *result = state->orig.out.result;
18157 tevent_req_received(req);
18158 return NT_STATUS_OK;
18161 NTSTATUS rpccli_spoolss_6d(struct rpc_pipe_client *cli,
18162 TALLOC_CTX *mem_ctx,
18163 WERROR *werror)
18165 struct spoolss_6d r;
18166 NTSTATUS status;
18168 /* In parameters */
18170 if (DEBUGLEVEL >= 10) {
18171 NDR_PRINT_IN_DEBUG(spoolss_6d, &r);
18174 status = cli->dispatch(cli,
18175 mem_ctx,
18176 &ndr_table_spoolss,
18177 NDR_SPOOLSS_6D,
18178 &r);
18180 if (!NT_STATUS_IS_OK(status)) {
18181 return status;
18184 if (DEBUGLEVEL >= 10) {
18185 NDR_PRINT_OUT_DEBUG(spoolss_6d, &r);
18188 if (NT_STATUS_IS_ERR(status)) {
18189 return status;
18192 /* Return variables */
18194 /* Return result */
18195 if (werror) {
18196 *werror = r.out.result;
18199 return werror_to_ntstatus(r.out.result);