2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
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);
39 state->out_mem_ctx = NULL;
40 state->dispatch_recv = cli->dispatch_recv;
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;
50 state->orig.out.count = _count;
51 state->orig.out.info = _info;
52 state->orig.out.needed = _needed;
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,
72 NDR_SPOOLSS_ENUMPRINTERS,
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);
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);
90 if (state->out_mem_ctx) {
91 mem_ctx = state->out_mem_ctx;
96 status = state->dispatch_recv(subreq, mem_ctx);
98 if (!NT_STATUS_IS_OK(status)) {
99 tevent_req_nterror(req, status);
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;
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,
125 struct rpccli_spoolss_EnumPrinters_state *state = tevent_req_data(
126 req, struct rpccli_spoolss_EnumPrinters_state);
129 if (tevent_req_is_nterror(req, &status)) {
130 tevent_req_received(req);
134 /* Steal possbile out parameters to the callers context */
135 talloc_steal(mem_ctx, state->out_mem_ctx);
138 *result = state->orig.out.result;
140 tevent_req_received(req);
144 NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
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] */,
156 struct spoolss_EnumPrinters r;
161 r.in.server = server;
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,
173 NDR_SPOOLSS_ENUMPRINTERS,
176 if (!NT_STATUS_IS_OK(status)) {
180 if (DEBUGLEVEL >= 10) {
181 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinters, &r);
184 if (NT_STATUS_IS_ERR(status)) {
188 /* Return variables */
189 *count = *r.out.count;
191 *needed = *r.out.needed;
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);
228 state->out_mem_ctx = NULL;
229 state->dispatch_recv = cli->dispatch_recv;
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;
238 state->orig.out.handle = _handle;
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,
258 NDR_SPOOLSS_OPENPRINTER,
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);
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);
276 if (state->out_mem_ctx) {
277 mem_ctx = state->out_mem_ctx;
282 status = state->dispatch_recv(subreq, mem_ctx);
284 if (!NT_STATUS_IS_OK(status)) {
285 tevent_req_nterror(req, status);
289 /* Copy out parameters */
290 *state->orig.out.handle = *state->tmp.out.handle;
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,
309 struct rpccli_spoolss_OpenPrinter_state *state = tevent_req_data(
310 req, struct rpccli_spoolss_OpenPrinter_state);
313 if (tevent_req_is_nterror(req, &status)) {
314 tevent_req_received(req);
318 /* Steal possbile out parameters to the callers context */
319 talloc_steal(mem_ctx, state->out_mem_ctx);
322 *result = state->orig.out.result;
324 tevent_req_received(req);
328 NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli,
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] */,
337 struct spoolss_OpenPrinter r;
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,
353 NDR_SPOOLSS_OPENPRINTER,
356 if (!NT_STATUS_IS_OK(status)) {
360 if (DEBUGLEVEL >= 10) {
361 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinter, &r);
364 if (NT_STATUS_IS_ERR(status)) {
368 /* Return variables */
369 *handle = *r.out.handle;
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);
405 state->out_mem_ctx = NULL;
406 state->dispatch_recv = cli->dispatch_recv;
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;
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,
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);
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);
446 if (state->out_mem_ctx) {
447 mem_ctx = state->out_mem_ctx;
452 status = state->dispatch_recv(subreq, mem_ctx);
454 if (!NT_STATUS_IS_OK(status)) {
455 tevent_req_nterror(req, status);
459 /* Copy out parameters */
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,
478 struct rpccli_spoolss_SetJob_state *state = tevent_req_data(
479 req, struct rpccli_spoolss_SetJob_state);
482 if (tevent_req_is_nterror(req, &status)) {
483 tevent_req_received(req);
487 /* Steal possbile out parameters to the callers context */
488 talloc_steal(mem_ctx, state->out_mem_ctx);
491 *result = state->orig.out.result;
493 tevent_req_received(req);
497 NTSTATUS rpccli_spoolss_SetJob(struct rpc_pipe_client *cli,
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] */,
505 struct spoolss_SetJob r;
509 r.in.handle = handle;
510 r.in.job_id = job_id;
512 r.in.command = command;
514 if (DEBUGLEVEL >= 10) {
515 NDR_PRINT_IN_DEBUG(spoolss_SetJob, &r);
518 status = cli->dispatch(cli,
524 if (!NT_STATUS_IS_OK(status)) {
528 if (DEBUGLEVEL >= 10) {
529 NDR_PRINT_OUT_DEBUG(spoolss_SetJob, &r);
532 if (NT_STATUS_IS_ERR(status)) {
536 /* Return variables */
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);
575 state->out_mem_ctx = NULL;
576 state->dispatch_recv = cli->dispatch_recv;
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;
586 state->orig.out.info = _info;
587 state->orig.out.needed = _needed;
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,
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);
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);
625 if (state->out_mem_ctx) {
626 mem_ctx = state->out_mem_ctx;
631 status = state->dispatch_recv(subreq, mem_ctx);
633 if (!NT_STATUS_IS_OK(status)) {
634 tevent_req_nterror(req, status);
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;
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,
661 struct rpccli_spoolss_GetJob_state *state = tevent_req_data(
662 req, struct rpccli_spoolss_GetJob_state);
665 if (tevent_req_is_nterror(req, &status)) {
666 tevent_req_received(req);
670 /* Steal possbile out parameters to the callers context */
671 talloc_steal(mem_ctx, state->out_mem_ctx);
674 *result = state->orig.out.result;
676 tevent_req_received(req);
680 NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
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] */,
691 struct spoolss_GetJob r;
695 r.in.handle = handle;
696 r.in.job_id = job_id;
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,
711 if (!NT_STATUS_IS_OK(status)) {
715 if (DEBUGLEVEL >= 10) {
716 NDR_PRINT_OUT_DEBUG(spoolss_GetJob, &r);
719 if (NT_STATUS_IS_ERR(status)) {
723 /* Return variables */
724 if (info && r.out.info) {
727 *needed = *r.out.needed;
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);
768 state->out_mem_ctx = NULL;
769 state->dispatch_recv = cli->dispatch_recv;
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;
780 state->orig.out.count = _count;
781 state->orig.out.info = _info;
782 state->orig.out.needed = _needed;
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,
802 NDR_SPOOLSS_ENUMJOBS,
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);
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);
820 if (state->out_mem_ctx) {
821 mem_ctx = state->out_mem_ctx;
826 status = state->dispatch_recv(subreq, mem_ctx);
828 if (!NT_STATUS_IS_OK(status)) {
829 tevent_req_nterror(req, status);
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;
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,
855 struct rpccli_spoolss_EnumJobs_state *state = tevent_req_data(
856 req, struct rpccli_spoolss_EnumJobs_state);
859 if (tevent_req_is_nterror(req, &status)) {
860 tevent_req_received(req);
864 /* Steal possbile out parameters to the callers context */
865 talloc_steal(mem_ctx, state->out_mem_ctx);
868 *result = state->orig.out.result;
870 tevent_req_received(req);
874 NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
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] */,
887 struct spoolss_EnumJobs r;
891 r.in.handle = handle;
892 r.in.firstjob = firstjob;
893 r.in.numjobs = numjobs;
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,
905 NDR_SPOOLSS_ENUMJOBS,
908 if (!NT_STATUS_IS_OK(status)) {
912 if (DEBUGLEVEL >= 10) {
913 NDR_PRINT_OUT_DEBUG(spoolss_EnumJobs, &r);
916 if (NT_STATUS_IS_ERR(status)) {
920 /* Return variables */
921 *count = *r.out.count;
923 *needed = *r.out.needed;
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);
960 state->out_mem_ctx = NULL;
961 state->dispatch_recv = cli->dispatch_recv;
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;
970 state->orig.out.handle = _handle;
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,
990 NDR_SPOOLSS_ADDPRINTER,
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);
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);
1006 TALLOC_CTX *mem_ctx;
1008 if (state->out_mem_ctx) {
1009 mem_ctx = state->out_mem_ctx;
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);
1021 /* Copy out parameters */
1022 *state->orig.out.handle = *state->tmp.out.handle;
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,
1041 struct rpccli_spoolss_AddPrinter_state *state = tevent_req_data(
1042 req, struct rpccli_spoolss_AddPrinter_state);
1045 if (tevent_req_is_nterror(req, &status)) {
1046 tevent_req_received(req);
1050 /* Steal possbile out parameters to the callers context */
1051 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
1069 struct spoolss_AddPrinter r;
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,
1085 NDR_SPOOLSS_ADDPRINTER,
1088 if (!NT_STATUS_IS_OK(status)) {
1092 if (DEBUGLEVEL >= 10) {
1093 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinter, &r);
1096 if (NT_STATUS_IS_ERR(status)) {
1100 /* Return variables */
1101 *handle = *r.out.handle;
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);
1134 state->out_mem_ctx = NULL;
1135 state->dispatch_recv = cli->dispatch_recv;
1138 state->orig.in.handle = _handle;
1140 /* Out parameters */
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,
1154 NDR_SPOOLSS_DELETEPRINTER,
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);
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);
1170 TALLOC_CTX *mem_ctx;
1172 if (state->out_mem_ctx) {
1173 mem_ctx = state->out_mem_ctx;
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);
1185 /* Copy out parameters */
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,
1204 struct rpccli_spoolss_DeletePrinter_state *state = tevent_req_data(
1205 req, struct rpccli_spoolss_DeletePrinter_state);
1208 if (tevent_req_is_nterror(req, &status)) {
1209 tevent_req_received(req);
1213 /* Steal possbile out parameters to the callers context */
1214 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
1228 struct spoolss_DeletePrinter r;
1232 r.in.handle = handle;
1234 if (DEBUGLEVEL >= 10) {
1235 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinter, &r);
1238 status = cli->dispatch(cli,
1241 NDR_SPOOLSS_DELETEPRINTER,
1244 if (!NT_STATUS_IS_OK(status)) {
1248 if (DEBUGLEVEL >= 10) {
1249 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinter, &r);
1252 if (NT_STATUS_IS_ERR(status)) {
1256 /* Return variables */
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);
1293 state->out_mem_ctx = NULL;
1294 state->dispatch_recv = cli->dispatch_recv;
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 */
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,
1317 NDR_SPOOLSS_SETPRINTER,
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);
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);
1333 TALLOC_CTX *mem_ctx;
1335 if (state->out_mem_ctx) {
1336 mem_ctx = state->out_mem_ctx;
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);
1348 /* Copy out parameters */
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,
1367 struct rpccli_spoolss_SetPrinter_state *state = tevent_req_data(
1368 req, struct rpccli_spoolss_SetPrinter_state);
1371 if (tevent_req_is_nterror(req, &status)) {
1372 tevent_req_received(req);
1376 /* Steal possbile out parameters to the callers context */
1377 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
1395 struct spoolss_SetPrinter r;
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,
1412 NDR_SPOOLSS_SETPRINTER,
1415 if (!NT_STATUS_IS_OK(status)) {
1419 if (DEBUGLEVEL >= 10) {
1420 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinter, &r);
1423 if (NT_STATUS_IS_ERR(status)) {
1427 /* Return variables */
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);
1465 state->out_mem_ctx = NULL;
1466 state->dispatch_recv = cli->dispatch_recv;
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;
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,
1496 NDR_SPOOLSS_GETPRINTER,
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);
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);
1512 TALLOC_CTX *mem_ctx;
1514 if (state->out_mem_ctx) {
1515 mem_ctx = state->out_mem_ctx;
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);
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;
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,
1550 struct rpccli_spoolss_GetPrinter_state *state = tevent_req_data(
1551 req, struct rpccli_spoolss_GetPrinter_state);
1554 if (tevent_req_is_nterror(req, &status)) {
1555 tevent_req_received(req);
1559 /* Steal possbile out parameters to the callers context */
1560 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
1579 struct spoolss_GetPrinter r;
1583 r.in.handle = handle;
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,
1595 NDR_SPOOLSS_GETPRINTER,
1598 if (!NT_STATUS_IS_OK(status)) {
1602 if (DEBUGLEVEL >= 10) {
1603 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinter, &r);
1606 if (NT_STATUS_IS_ERR(status)) {
1610 /* Return variables */
1611 if (info && r.out.info) {
1612 *info = *r.out.info;
1614 *needed = *r.out.needed;
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);
1648 state->out_mem_ctx = NULL;
1649 state->dispatch_recv = cli->dispatch_recv;
1652 state->orig.in.servername = _servername;
1653 state->orig.in.info_ctr = _info_ctr;
1655 /* Out parameters */
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,
1669 NDR_SPOOLSS_ADDPRINTERDRIVER,
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);
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);
1685 TALLOC_CTX *mem_ctx;
1687 if (state->out_mem_ctx) {
1688 mem_ctx = state->out_mem_ctx;
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);
1700 /* Copy out parameters */
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,
1719 struct rpccli_spoolss_AddPrinterDriver_state *state = tevent_req_data(
1720 req, struct rpccli_spoolss_AddPrinterDriver_state);
1723 if (tevent_req_is_nterror(req, &status)) {
1724 tevent_req_received(req);
1728 /* Steal possbile out parameters to the callers context */
1729 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
1744 struct spoolss_AddPrinterDriver r;
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,
1758 NDR_SPOOLSS_ADDPRINTERDRIVER,
1761 if (!NT_STATUS_IS_OK(status)) {
1765 if (DEBUGLEVEL >= 10) {
1766 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriver, &r);
1769 if (NT_STATUS_IS_ERR(status)) {
1773 /* Return variables */
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);
1813 state->out_mem_ctx = NULL;
1814 state->dispatch_recv = cli->dispatch_recv;
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;
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,
1846 NDR_SPOOLSS_ENUMPRINTERDRIVERS,
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);
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);
1862 TALLOC_CTX *mem_ctx;
1864 if (state->out_mem_ctx) {
1865 mem_ctx = state->out_mem_ctx;
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);
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;
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,
1899 struct rpccli_spoolss_EnumPrinterDrivers_state *state = tevent_req_data(
1900 req, struct rpccli_spoolss_EnumPrinterDrivers_state);
1903 if (tevent_req_is_nterror(req, &status)) {
1904 tevent_req_received(req);
1908 /* Steal possbile out parameters to the callers context */
1909 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
1930 struct spoolss_EnumPrinterDrivers r;
1934 r.in.server = server;
1935 r.in.environment = environment;
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,
1947 NDR_SPOOLSS_ENUMPRINTERDRIVERS,
1950 if (!NT_STATUS_IS_OK(status)) {
1954 if (DEBUGLEVEL >= 10) {
1955 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDrivers, &r);
1958 if (NT_STATUS_IS_ERR(status)) {
1962 /* Return variables */
1963 *count = *r.out.count;
1964 *info = *r.out.info;
1965 *needed = *r.out.needed;
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);
2004 state->out_mem_ctx = NULL;
2005 state->dispatch_recv = cli->dispatch_recv;
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;
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,
2036 NDR_SPOOLSS_GETPRINTERDRIVER,
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);
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);
2052 TALLOC_CTX *mem_ctx;
2054 if (state->out_mem_ctx) {
2055 mem_ctx = state->out_mem_ctx;
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);
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;
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,
2090 struct rpccli_spoolss_GetPrinterDriver_state *state = tevent_req_data(
2091 req, struct rpccli_spoolss_GetPrinterDriver_state);
2094 if (tevent_req_is_nterror(req, &status)) {
2095 tevent_req_received(req);
2099 /* Steal possbile out parameters to the callers context */
2100 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
2120 struct spoolss_GetPrinterDriver r;
2124 r.in.handle = handle;
2125 r.in.architecture = architecture;
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,
2137 NDR_SPOOLSS_GETPRINTERDRIVER,
2140 if (!NT_STATUS_IS_OK(status)) {
2144 if (DEBUGLEVEL >= 10) {
2145 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver, &r);
2148 if (NT_STATUS_IS_ERR(status)) {
2152 /* Return variables */
2153 if (info && r.out.info) {
2154 *info = *r.out.info;
2156 *needed = *r.out.needed;
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);
2195 state->out_mem_ctx = NULL;
2196 state->dispatch_recv = cli->dispatch_recv;
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;
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,
2227 NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY,
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);
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);
2243 TALLOC_CTX *mem_ctx;
2245 if (state->out_mem_ctx) {
2246 mem_ctx = state->out_mem_ctx;
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);
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;
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,
2281 struct rpccli_spoolss_GetPrinterDriverDirectory_state *state = tevent_req_data(
2282 req, struct rpccli_spoolss_GetPrinterDriverDirectory_state);
2285 if (tevent_req_is_nterror(req, &status)) {
2286 tevent_req_received(req);
2290 /* Steal possbile out parameters to the callers context */
2291 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
2311 struct spoolss_GetPrinterDriverDirectory r;
2315 r.in.server = server;
2316 r.in.environment = environment;
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,
2328 NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY,
2331 if (!NT_STATUS_IS_OK(status)) {
2335 if (DEBUGLEVEL >= 10) {
2336 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverDirectory, &r);
2339 if (NT_STATUS_IS_ERR(status)) {
2343 /* Return variables */
2344 if (info && r.out.info) {
2345 *info = *r.out.info;
2347 *needed = *r.out.needed;
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);
2382 state->out_mem_ctx = NULL;
2383 state->dispatch_recv = cli->dispatch_recv;
2386 state->orig.in.server = _server;
2387 state->orig.in.architecture = _architecture;
2388 state->orig.in.driver = _driver;
2390 /* Out parameters */
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,
2404 NDR_SPOOLSS_DELETEPRINTERDRIVER,
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);
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);
2420 TALLOC_CTX *mem_ctx;
2422 if (state->out_mem_ctx) {
2423 mem_ctx = state->out_mem_ctx;
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);
2435 /* Copy out parameters */
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,
2454 struct rpccli_spoolss_DeletePrinterDriver_state *state = tevent_req_data(
2455 req, struct rpccli_spoolss_DeletePrinterDriver_state);
2458 if (tevent_req_is_nterror(req, &status)) {
2459 tevent_req_received(req);
2463 /* Steal possbile out parameters to the callers context */
2464 talloc_steal(mem_ctx, state->out_mem_ctx);
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)] */,
2480 struct spoolss_DeletePrinterDriver r;
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,
2495 NDR_SPOOLSS_DELETEPRINTERDRIVER,
2498 if (!NT_STATUS_IS_OK(status)) {
2502 if (DEBUGLEVEL >= 10) {
2503 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriver, &r);
2506 if (NT_STATUS_IS_ERR(status)) {
2510 /* Return variables */
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);
2546 state->out_mem_ctx = NULL;
2547 state->dispatch_recv = cli->dispatch_recv;
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 */
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,
2569 NDR_SPOOLSS_ADDPRINTPROCESSOR,
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);
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);
2585 TALLOC_CTX *mem_ctx;
2587 if (state->out_mem_ctx) {
2588 mem_ctx = state->out_mem_ctx;
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);
2600 /* Copy out parameters */
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,
2619 struct rpccli_spoolss_AddPrintProcessor_state *state = tevent_req_data(
2620 req, struct rpccli_spoolss_AddPrintProcessor_state);
2623 if (tevent_req_is_nterror(req, &status)) {
2624 tevent_req_received(req);
2628 /* Steal possbile out parameters to the callers context */
2629 talloc_steal(mem_ctx, state->out_mem_ctx);
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)] */,
2646 struct spoolss_AddPrintProcessor r;
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,
2662 NDR_SPOOLSS_ADDPRINTPROCESSOR,
2665 if (!NT_STATUS_IS_OK(status)) {
2669 if (DEBUGLEVEL >= 10) {
2670 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProcessor, &r);
2673 if (NT_STATUS_IS_ERR(status)) {
2677 /* Return variables */
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);
2717 state->out_mem_ctx = NULL;
2718 state->dispatch_recv = cli->dispatch_recv;
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;
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,
2750 NDR_SPOOLSS_ENUMPRINTPROCESSORS,
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);
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);
2766 TALLOC_CTX *mem_ctx;
2768 if (state->out_mem_ctx) {
2769 mem_ctx = state->out_mem_ctx;
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);
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;
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,
2803 struct rpccli_spoolss_EnumPrintProcessors_state *state = tevent_req_data(
2804 req, struct rpccli_spoolss_EnumPrintProcessors_state);
2807 if (tevent_req_is_nterror(req, &status)) {
2808 tevent_req_received(req);
2812 /* Steal possbile out parameters to the callers context */
2813 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
2834 struct spoolss_EnumPrintProcessors r;
2838 r.in.servername = servername;
2839 r.in.environment = environment;
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,
2851 NDR_SPOOLSS_ENUMPRINTPROCESSORS,
2854 if (!NT_STATUS_IS_OK(status)) {
2858 if (DEBUGLEVEL >= 10) {
2859 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcessors, &r);
2862 if (NT_STATUS_IS_ERR(status)) {
2866 /* Return variables */
2867 *count = *r.out.count;
2868 *info = *r.out.info;
2869 *needed = *r.out.needed;
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);
2908 state->out_mem_ctx = NULL;
2909 state->dispatch_recv = cli->dispatch_recv;
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;
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,
2940 NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY,
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);
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);
2956 TALLOC_CTX *mem_ctx;
2958 if (state->out_mem_ctx) {
2959 mem_ctx = state->out_mem_ctx;
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);
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;
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,
2994 struct rpccli_spoolss_GetPrintProcessorDirectory_state *state = tevent_req_data(
2995 req, struct rpccli_spoolss_GetPrintProcessorDirectory_state);
2998 if (tevent_req_is_nterror(req, &status)) {
2999 tevent_req_received(req);
3003 /* Steal possbile out parameters to the callers context */
3004 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
3024 struct spoolss_GetPrintProcessorDirectory r;
3028 r.in.server = server;
3029 r.in.environment = environment;
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,
3041 NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY,
3044 if (!NT_STATUS_IS_OK(status)) {
3048 if (DEBUGLEVEL >= 10) {
3049 NDR_PRINT_OUT_DEBUG(spoolss_GetPrintProcessorDirectory, &r);
3052 if (NT_STATUS_IS_ERR(status)) {
3056 /* Return variables */
3057 if (info && r.out.info) {
3058 *info = *r.out.info;
3060 *needed = *r.out.needed;
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);
3096 state->out_mem_ctx = NULL;
3097 state->dispatch_recv = cli->dispatch_recv;
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;
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,
3125 NDR_SPOOLSS_STARTDOCPRINTER,
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);
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);
3141 TALLOC_CTX *mem_ctx;
3143 if (state->out_mem_ctx) {
3144 mem_ctx = state->out_mem_ctx;
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);
3156 /* Copy out parameters */
3157 *state->orig.out.job_id = *state->tmp.out.job_id;
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,
3176 struct rpccli_spoolss_StartDocPrinter_state *state = tevent_req_data(
3177 req, struct rpccli_spoolss_StartDocPrinter_state);
3180 if (tevent_req_is_nterror(req, &status)) {
3181 tevent_req_received(req);
3185 /* Steal possbile out parameters to the callers context */
3186 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
3203 struct spoolss_StartDocPrinter r;
3207 r.in.handle = handle;
3211 if (DEBUGLEVEL >= 10) {
3212 NDR_PRINT_IN_DEBUG(spoolss_StartDocPrinter, &r);
3215 status = cli->dispatch(cli,
3218 NDR_SPOOLSS_STARTDOCPRINTER,
3221 if (!NT_STATUS_IS_OK(status)) {
3225 if (DEBUGLEVEL >= 10) {
3226 NDR_PRINT_OUT_DEBUG(spoolss_StartDocPrinter, &r);
3229 if (NT_STATUS_IS_ERR(status)) {
3233 /* Return variables */
3234 *job_id = *r.out.job_id;
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);
3267 state->out_mem_ctx = NULL;
3268 state->dispatch_recv = cli->dispatch_recv;
3271 state->orig.in.handle = _handle;
3273 /* Out parameters */
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,
3287 NDR_SPOOLSS_STARTPAGEPRINTER,
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);
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);
3303 TALLOC_CTX *mem_ctx;
3305 if (state->out_mem_ctx) {
3306 mem_ctx = state->out_mem_ctx;
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);
3318 /* Copy out parameters */
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,
3337 struct rpccli_spoolss_StartPagePrinter_state *state = tevent_req_data(
3338 req, struct rpccli_spoolss_StartPagePrinter_state);
3341 if (tevent_req_is_nterror(req, &status)) {
3342 tevent_req_received(req);
3346 /* Steal possbile out parameters to the callers context */
3347 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
3361 struct spoolss_StartPagePrinter r;
3365 r.in.handle = handle;
3367 if (DEBUGLEVEL >= 10) {
3368 NDR_PRINT_IN_DEBUG(spoolss_StartPagePrinter, &r);
3371 status = cli->dispatch(cli,
3374 NDR_SPOOLSS_STARTPAGEPRINTER,
3377 if (!NT_STATUS_IS_OK(status)) {
3381 if (DEBUGLEVEL >= 10) {
3382 NDR_PRINT_OUT_DEBUG(spoolss_StartPagePrinter, &r);
3385 if (NT_STATUS_IS_ERR(status)) {
3389 /* Return variables */
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);
3425 state->out_mem_ctx = NULL;
3426 state->dispatch_recv = cli->dispatch_recv;
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;
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,
3454 NDR_SPOOLSS_WRITEPRINTER,
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);
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);
3470 TALLOC_CTX *mem_ctx;
3472 if (state->out_mem_ctx) {
3473 mem_ctx = state->out_mem_ctx;
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);
3485 /* Copy out parameters */
3486 *state->orig.out.num_written = *state->tmp.out.num_written;
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,
3505 struct rpccli_spoolss_WritePrinter_state *state = tevent_req_data(
3506 req, struct rpccli_spoolss_WritePrinter_state);
3509 if (tevent_req_is_nterror(req, &status)) {
3510 tevent_req_received(req);
3514 /* Steal possbile out parameters to the callers context */
3515 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
3532 struct spoolss_WritePrinter r;
3536 r.in.handle = handle;
3538 r.in._data_size = _data_size;
3540 if (DEBUGLEVEL >= 10) {
3541 NDR_PRINT_IN_DEBUG(spoolss_WritePrinter, &r);
3544 status = cli->dispatch(cli,
3547 NDR_SPOOLSS_WRITEPRINTER,
3550 if (!NT_STATUS_IS_OK(status)) {
3554 if (DEBUGLEVEL >= 10) {
3555 NDR_PRINT_OUT_DEBUG(spoolss_WritePrinter, &r);
3558 if (NT_STATUS_IS_ERR(status)) {
3562 /* Return variables */
3563 *num_written = *r.out.num_written;
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);
3596 state->out_mem_ctx = NULL;
3597 state->dispatch_recv = cli->dispatch_recv;
3600 state->orig.in.handle = _handle;
3602 /* Out parameters */
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,
3616 NDR_SPOOLSS_ENDPAGEPRINTER,
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);
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);
3632 TALLOC_CTX *mem_ctx;
3634 if (state->out_mem_ctx) {
3635 mem_ctx = state->out_mem_ctx;
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);
3647 /* Copy out parameters */
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,
3666 struct rpccli_spoolss_EndPagePrinter_state *state = tevent_req_data(
3667 req, struct rpccli_spoolss_EndPagePrinter_state);
3670 if (tevent_req_is_nterror(req, &status)) {
3671 tevent_req_received(req);
3675 /* Steal possbile out parameters to the callers context */
3676 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
3690 struct spoolss_EndPagePrinter r;
3694 r.in.handle = handle;
3696 if (DEBUGLEVEL >= 10) {
3697 NDR_PRINT_IN_DEBUG(spoolss_EndPagePrinter, &r);
3700 status = cli->dispatch(cli,
3703 NDR_SPOOLSS_ENDPAGEPRINTER,
3706 if (!NT_STATUS_IS_OK(status)) {
3710 if (DEBUGLEVEL >= 10) {
3711 NDR_PRINT_OUT_DEBUG(spoolss_EndPagePrinter, &r);
3714 if (NT_STATUS_IS_ERR(status)) {
3718 /* Return variables */
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);
3751 state->out_mem_ctx = NULL;
3752 state->dispatch_recv = cli->dispatch_recv;
3755 state->orig.in.handle = _handle;
3757 /* Out parameters */
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,
3771 NDR_SPOOLSS_ABORTPRINTER,
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);
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);
3787 TALLOC_CTX *mem_ctx;
3789 if (state->out_mem_ctx) {
3790 mem_ctx = state->out_mem_ctx;
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);
3802 /* Copy out parameters */
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,
3821 struct rpccli_spoolss_AbortPrinter_state *state = tevent_req_data(
3822 req, struct rpccli_spoolss_AbortPrinter_state);
3825 if (tevent_req_is_nterror(req, &status)) {
3826 tevent_req_received(req);
3830 /* Steal possbile out parameters to the callers context */
3831 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
3845 struct spoolss_AbortPrinter r;
3849 r.in.handle = handle;
3851 if (DEBUGLEVEL >= 10) {
3852 NDR_PRINT_IN_DEBUG(spoolss_AbortPrinter, &r);
3855 status = cli->dispatch(cli,
3858 NDR_SPOOLSS_ABORTPRINTER,
3861 if (!NT_STATUS_IS_OK(status)) {
3865 if (DEBUGLEVEL >= 10) {
3866 NDR_PRINT_OUT_DEBUG(spoolss_AbortPrinter, &r);
3869 if (NT_STATUS_IS_ERR(status)) {
3873 /* Return variables */
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);
3909 state->out_mem_ctx = NULL;
3910 state->dispatch_recv = cli->dispatch_recv;
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;
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,
3938 NDR_SPOOLSS_READPRINTER,
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);
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);
3954 TALLOC_CTX *mem_ctx;
3956 if (state->out_mem_ctx) {
3957 mem_ctx = state->out_mem_ctx;
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);
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;
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,
3990 struct rpccli_spoolss_ReadPrinter_state *state = tevent_req_data(
3991 req, struct rpccli_spoolss_ReadPrinter_state);
3994 if (tevent_req_is_nterror(req, &status)) {
3995 tevent_req_received(req);
3999 /* Steal possbile out parameters to the callers context */
4000 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
4017 struct spoolss_ReadPrinter r;
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,
4031 NDR_SPOOLSS_READPRINTER,
4034 if (!NT_STATUS_IS_OK(status)) {
4038 if (DEBUGLEVEL >= 10) {
4039 NDR_PRINT_OUT_DEBUG(spoolss_ReadPrinter, &r);
4042 if (NT_STATUS_IS_ERR(status)) {
4046 /* Return variables */
4047 memcpy(data, r.out.data, r.in.data_size * sizeof(*data));
4048 *_data_size = *r.out._data_size;
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);
4081 state->out_mem_ctx = NULL;
4082 state->dispatch_recv = cli->dispatch_recv;
4085 state->orig.in.handle = _handle;
4087 /* Out parameters */
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,
4101 NDR_SPOOLSS_ENDDOCPRINTER,
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);
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);
4117 TALLOC_CTX *mem_ctx;
4119 if (state->out_mem_ctx) {
4120 mem_ctx = state->out_mem_ctx;
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);
4132 /* Copy out parameters */
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,
4151 struct rpccli_spoolss_EndDocPrinter_state *state = tevent_req_data(
4152 req, struct rpccli_spoolss_EndDocPrinter_state);
4155 if (tevent_req_is_nterror(req, &status)) {
4156 tevent_req_received(req);
4160 /* Steal possbile out parameters to the callers context */
4161 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
4175 struct spoolss_EndDocPrinter r;
4179 r.in.handle = handle;
4181 if (DEBUGLEVEL >= 10) {
4182 NDR_PRINT_IN_DEBUG(spoolss_EndDocPrinter, &r);
4185 status = cli->dispatch(cli,
4188 NDR_SPOOLSS_ENDDOCPRINTER,
4191 if (!NT_STATUS_IS_OK(status)) {
4195 if (DEBUGLEVEL >= 10) {
4196 NDR_PRINT_OUT_DEBUG(spoolss_EndDocPrinter, &r);
4199 if (NT_STATUS_IS_ERR(status)) {
4203 /* Return variables */
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);
4240 state->out_mem_ctx = NULL;
4241 state->dispatch_recv = cli->dispatch_recv;
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;
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,
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);
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);
4287 TALLOC_CTX *mem_ctx;
4289 if (state->out_mem_ctx) {
4290 mem_ctx = state->out_mem_ctx;
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);
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;
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,
4325 struct rpccli_spoolss_AddJob_state *state = tevent_req_data(
4326 req, struct rpccli_spoolss_AddJob_state);
4329 if (tevent_req_is_nterror(req, &status)) {
4330 tevent_req_received(req);
4334 /* Steal possbile out parameters to the callers context */
4335 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
4353 struct spoolss_AddJob r;
4357 r.in.handle = handle;
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,
4372 if (!NT_STATUS_IS_OK(status)) {
4376 if (DEBUGLEVEL >= 10) {
4377 NDR_PRINT_OUT_DEBUG(spoolss_AddJob, &r);
4380 if (NT_STATUS_IS_ERR(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;
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);
4422 state->out_mem_ctx = NULL;
4423 state->dispatch_recv = cli->dispatch_recv;
4426 state->orig.in.handle = _handle;
4427 state->orig.in.jobid = _jobid;
4429 /* Out parameters */
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,
4443 NDR_SPOOLSS_SCHEDULEJOB,
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);
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);
4459 TALLOC_CTX *mem_ctx;
4461 if (state->out_mem_ctx) {
4462 mem_ctx = state->out_mem_ctx;
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);
4474 /* Copy out parameters */
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,
4493 struct rpccli_spoolss_ScheduleJob_state *state = tevent_req_data(
4494 req, struct rpccli_spoolss_ScheduleJob_state);
4497 if (tevent_req_is_nterror(req, &status)) {
4498 tevent_req_received(req);
4502 /* Steal possbile out parameters to the callers context */
4503 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
4518 struct spoolss_ScheduleJob r;
4522 r.in.handle = handle;
4525 if (DEBUGLEVEL >= 10) {
4526 NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, &r);
4529 status = cli->dispatch(cli,
4532 NDR_SPOOLSS_SCHEDULEJOB,
4535 if (!NT_STATUS_IS_OK(status)) {
4539 if (DEBUGLEVEL >= 10) {
4540 NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, &r);
4543 if (NT_STATUS_IS_ERR(status)) {
4547 /* Return variables */
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);
4585 state->out_mem_ctx = NULL;
4586 state->dispatch_recv = cli->dispatch_recv;
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;
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,
4616 NDR_SPOOLSS_GETPRINTERDATA,
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);
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);
4632 TALLOC_CTX *mem_ctx;
4634 if (state->out_mem_ctx) {
4635 mem_ctx = state->out_mem_ctx;
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);
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;
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,
4669 struct rpccli_spoolss_GetPrinterData_state *state = tevent_req_data(
4670 req, struct rpccli_spoolss_GetPrinterData_state);
4673 if (tevent_req_is_nterror(req, &status)) {
4674 tevent_req_received(req);
4678 /* Steal possbile out parameters to the callers context */
4679 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
4698 struct spoolss_GetPrinterData r;
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,
4713 NDR_SPOOLSS_GETPRINTERDATA,
4716 if (!NT_STATUS_IS_OK(status)) {
4720 if (DEBUGLEVEL >= 10) {
4721 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterData, &r);
4724 if (NT_STATUS_IS_ERR(status)) {
4728 /* Return variables */
4729 *type = *r.out.type;
4730 *data = *r.out.data;
4731 *needed = *r.out.needed;
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);
4768 state->out_mem_ctx = NULL;
4769 state->dispatch_recv = cli->dispatch_recv;
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 */
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,
4792 NDR_SPOOLSS_SETPRINTERDATA,
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);
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);
4808 TALLOC_CTX *mem_ctx;
4810 if (state->out_mem_ctx) {
4811 mem_ctx = state->out_mem_ctx;
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);
4823 /* Copy out parameters */
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,
4842 struct rpccli_spoolss_SetPrinterData_state *state = tevent_req_data(
4843 req, struct rpccli_spoolss_SetPrinterData_state);
4846 if (tevent_req_is_nterror(req, &status)) {
4847 tevent_req_received(req);
4851 /* Steal possbile out parameters to the callers context */
4852 talloc_steal(mem_ctx, state->out_mem_ctx);
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))] */,
4870 struct spoolss_SetPrinterData r;
4874 r.in.handle = handle;
4875 r.in.value_name = value_name;
4878 r.in._offered = _offered;
4880 if (DEBUGLEVEL >= 10) {
4881 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, &r);
4884 status = cli->dispatch(cli,
4887 NDR_SPOOLSS_SETPRINTERDATA,
4890 if (!NT_STATUS_IS_OK(status)) {
4894 if (DEBUGLEVEL >= 10) {
4895 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterData, &r);
4898 if (NT_STATUS_IS_ERR(status)) {
4902 /* Return variables */
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);
4934 state->out_mem_ctx = NULL;
4935 state->dispatch_recv = cli->dispatch_recv;
4939 /* Out parameters */
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,
4953 NDR_SPOOLSS_WAITFORPRINTERCHANGE,
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);
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);
4969 TALLOC_CTX *mem_ctx;
4971 if (state->out_mem_ctx) {
4972 mem_ctx = state->out_mem_ctx;
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);
4984 /* Copy out parameters */
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,
5003 struct rpccli_spoolss_WaitForPrinterChange_state *state = tevent_req_data(
5004 req, struct rpccli_spoolss_WaitForPrinterChange_state);
5007 if (tevent_req_is_nterror(req, &status)) {
5008 tevent_req_received(req);
5012 /* Steal possbile out parameters to the callers context */
5013 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
5026 struct spoolss_WaitForPrinterChange r;
5031 if (DEBUGLEVEL >= 10) {
5032 NDR_PRINT_IN_DEBUG(spoolss_WaitForPrinterChange, &r);
5035 status = cli->dispatch(cli,
5038 NDR_SPOOLSS_WAITFORPRINTERCHANGE,
5041 if (!NT_STATUS_IS_OK(status)) {
5045 if (DEBUGLEVEL >= 10) {
5046 NDR_PRINT_OUT_DEBUG(spoolss_WaitForPrinterChange, &r);
5049 if (NT_STATUS_IS_ERR(status)) {
5053 /* Return variables */
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);
5086 state->out_mem_ctx = NULL;
5087 state->dispatch_recv = cli->dispatch_recv;
5090 state->orig.in.handle = _handle;
5092 /* Out parameters */
5093 state->orig.out.handle = _handle;
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,
5113 NDR_SPOOLSS_CLOSEPRINTER,
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);
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);
5129 TALLOC_CTX *mem_ctx;
5131 if (state->out_mem_ctx) {
5132 mem_ctx = state->out_mem_ctx;
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);
5144 /* Copy out parameters */
5145 *state->orig.out.handle = *state->tmp.out.handle;
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,
5164 struct rpccli_spoolss_ClosePrinter_state *state = tevent_req_data(
5165 req, struct rpccli_spoolss_ClosePrinter_state);
5168 if (tevent_req_is_nterror(req, &status)) {
5169 tevent_req_received(req);
5173 /* Steal possbile out parameters to the callers context */
5174 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
5188 struct spoolss_ClosePrinter r;
5192 r.in.handle = handle;
5194 if (DEBUGLEVEL >= 10) {
5195 NDR_PRINT_IN_DEBUG(spoolss_ClosePrinter, &r);
5198 status = cli->dispatch(cli,
5201 NDR_SPOOLSS_CLOSEPRINTER,
5204 if (!NT_STATUS_IS_OK(status)) {
5208 if (DEBUGLEVEL >= 10) {
5209 NDR_PRINT_OUT_DEBUG(spoolss_ClosePrinter, &r);
5212 if (NT_STATUS_IS_ERR(status)) {
5216 /* Return variables */
5217 *handle = *r.out.handle;
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);
5252 state->out_mem_ctx = NULL;
5253 state->dispatch_recv = cli->dispatch_recv;
5256 state->orig.in.handle = _handle;
5257 state->orig.in.level = _level;
5258 state->orig.in.info = _info;
5260 /* Out parameters */
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,
5274 NDR_SPOOLSS_ADDFORM,
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);
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);
5290 TALLOC_CTX *mem_ctx;
5292 if (state->out_mem_ctx) {
5293 mem_ctx = state->out_mem_ctx;
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);
5305 /* Copy out parameters */
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,
5324 struct rpccli_spoolss_AddForm_state *state = tevent_req_data(
5325 req, struct rpccli_spoolss_AddForm_state);
5328 if (tevent_req_is_nterror(req, &status)) {
5329 tevent_req_received(req);
5333 /* Steal possbile out parameters to the callers context */
5334 talloc_steal(mem_ctx, state->out_mem_ctx);
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)] */,
5350 struct spoolss_AddForm r;
5354 r.in.handle = handle;
5358 if (DEBUGLEVEL >= 10) {
5359 NDR_PRINT_IN_DEBUG(spoolss_AddForm, &r);
5362 status = cli->dispatch(cli,
5365 NDR_SPOOLSS_ADDFORM,
5368 if (!NT_STATUS_IS_OK(status)) {
5372 if (DEBUGLEVEL >= 10) {
5373 NDR_PRINT_OUT_DEBUG(spoolss_AddForm, &r);
5376 if (NT_STATUS_IS_ERR(status)) {
5380 /* Return variables */
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);
5414 state->out_mem_ctx = NULL;
5415 state->dispatch_recv = cli->dispatch_recv;
5418 state->orig.in.handle = _handle;
5419 state->orig.in.form_name = _form_name;
5421 /* Out parameters */
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,
5435 NDR_SPOOLSS_DELETEFORM,
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);
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);
5451 TALLOC_CTX *mem_ctx;
5453 if (state->out_mem_ctx) {
5454 mem_ctx = state->out_mem_ctx;
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);
5466 /* Copy out parameters */
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,
5485 struct rpccli_spoolss_DeleteForm_state *state = tevent_req_data(
5486 req, struct rpccli_spoolss_DeleteForm_state);
5489 if (tevent_req_is_nterror(req, &status)) {
5490 tevent_req_received(req);
5494 /* Steal possbile out parameters to the callers context */
5495 talloc_steal(mem_ctx, state->out_mem_ctx);
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)] */,
5510 struct spoolss_DeleteForm r;
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,
5524 NDR_SPOOLSS_DELETEFORM,
5527 if (!NT_STATUS_IS_OK(status)) {
5531 if (DEBUGLEVEL >= 10) {
5532 NDR_PRINT_OUT_DEBUG(spoolss_DeleteForm, &r);
5535 if (NT_STATUS_IS_ERR(status)) {
5539 /* Return variables */
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);
5578 state->out_mem_ctx = NULL;
5579 state->dispatch_recv = cli->dispatch_recv;
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;
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,
5610 NDR_SPOOLSS_GETFORM,
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);
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);
5626 TALLOC_CTX *mem_ctx;
5628 if (state->out_mem_ctx) {
5629 mem_ctx = state->out_mem_ctx;
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);
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;
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,
5664 struct rpccli_spoolss_GetForm_state *state = tevent_req_data(
5665 req, struct rpccli_spoolss_GetForm_state);
5668 if (tevent_req_is_nterror(req, &status)) {
5669 tevent_req_received(req);
5673 /* Steal possbile out parameters to the callers context */
5674 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
5694 struct spoolss_GetForm r;
5698 r.in.handle = handle;
5699 r.in.form_name = form_name;
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,
5711 NDR_SPOOLSS_GETFORM,
5714 if (!NT_STATUS_IS_OK(status)) {
5718 if (DEBUGLEVEL >= 10) {
5719 NDR_PRINT_OUT_DEBUG(spoolss_GetForm, &r);
5722 if (NT_STATUS_IS_ERR(status)) {
5726 /* Return variables */
5727 if (info && r.out.info) {
5728 *info = *r.out.info;
5730 *needed = *r.out.needed;
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);
5766 state->out_mem_ctx = NULL;
5767 state->dispatch_recv = cli->dispatch_recv;
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 */
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,
5789 NDR_SPOOLSS_SETFORM,
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);
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);
5805 TALLOC_CTX *mem_ctx;
5807 if (state->out_mem_ctx) {
5808 mem_ctx = state->out_mem_ctx;
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);
5820 /* Copy out parameters */
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,
5839 struct rpccli_spoolss_SetForm_state *state = tevent_req_data(
5840 req, struct rpccli_spoolss_SetForm_state);
5843 if (tevent_req_is_nterror(req, &status)) {
5844 tevent_req_received(req);
5848 /* Steal possbile out parameters to the callers context */
5849 talloc_steal(mem_ctx, state->out_mem_ctx);
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)] */,
5866 struct spoolss_SetForm r;
5870 r.in.handle = handle;
5871 r.in.form_name = form_name;
5875 if (DEBUGLEVEL >= 10) {
5876 NDR_PRINT_IN_DEBUG(spoolss_SetForm, &r);
5879 status = cli->dispatch(cli,
5882 NDR_SPOOLSS_SETFORM,
5885 if (!NT_STATUS_IS_OK(status)) {
5889 if (DEBUGLEVEL >= 10) {
5890 NDR_PRINT_OUT_DEBUG(spoolss_SetForm, &r);
5893 if (NT_STATUS_IS_ERR(status)) {
5897 /* Return variables */
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);
5936 state->out_mem_ctx = NULL;
5937 state->dispatch_recv = cli->dispatch_recv;
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;
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,
5968 NDR_SPOOLSS_ENUMFORMS,
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);
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);
5984 TALLOC_CTX *mem_ctx;
5986 if (state->out_mem_ctx) {
5987 mem_ctx = state->out_mem_ctx;
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);
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;
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,
6021 struct rpccli_spoolss_EnumForms_state *state = tevent_req_data(
6022 req, struct rpccli_spoolss_EnumForms_state);
6025 if (tevent_req_is_nterror(req, &status)) {
6026 tevent_req_received(req);
6030 /* Steal possbile out parameters to the callers context */
6031 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
6051 struct spoolss_EnumForms r;
6055 r.in.handle = handle;
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,
6067 NDR_SPOOLSS_ENUMFORMS,
6070 if (!NT_STATUS_IS_OK(status)) {
6074 if (DEBUGLEVEL >= 10) {
6075 NDR_PRINT_OUT_DEBUG(spoolss_EnumForms, &r);
6078 if (NT_STATUS_IS_ERR(status)) {
6082 /* Return variables */
6083 *count = *r.out.count;
6084 *info = *r.out.info;
6085 *needed = *r.out.needed;
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);
6124 state->out_mem_ctx = NULL;
6125 state->dispatch_recv = cli->dispatch_recv;
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;
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,
6156 NDR_SPOOLSS_ENUMPORTS,
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);
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);
6172 TALLOC_CTX *mem_ctx;
6174 if (state->out_mem_ctx) {
6175 mem_ctx = state->out_mem_ctx;
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);
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;
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,
6209 struct rpccli_spoolss_EnumPorts_state *state = tevent_req_data(
6210 req, struct rpccli_spoolss_EnumPorts_state);
6213 if (tevent_req_is_nterror(req, &status)) {
6214 tevent_req_received(req);
6218 /* Steal possbile out parameters to the callers context */
6219 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
6239 struct spoolss_EnumPorts r;
6243 r.in.servername = servername;
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,
6255 NDR_SPOOLSS_ENUMPORTS,
6258 if (!NT_STATUS_IS_OK(status)) {
6262 if (DEBUGLEVEL >= 10) {
6263 NDR_PRINT_OUT_DEBUG(spoolss_EnumPorts, &r);
6266 if (NT_STATUS_IS_ERR(status)) {
6270 /* Return variables */
6271 *count = *r.out.count;
6272 *info = *r.out.info;
6273 *needed = *r.out.needed;
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);
6312 state->out_mem_ctx = NULL;
6313 state->dispatch_recv = cli->dispatch_recv;
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;
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,
6344 NDR_SPOOLSS_ENUMMONITORS,
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);
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);
6360 TALLOC_CTX *mem_ctx;
6362 if (state->out_mem_ctx) {
6363 mem_ctx = state->out_mem_ctx;
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);
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;
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,
6397 struct rpccli_spoolss_EnumMonitors_state *state = tevent_req_data(
6398 req, struct rpccli_spoolss_EnumMonitors_state);
6401 if (tevent_req_is_nterror(req, &status)) {
6402 tevent_req_received(req);
6406 /* Steal possbile out parameters to the callers context */
6407 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
6427 struct spoolss_EnumMonitors r;
6431 r.in.servername = servername;
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,
6443 NDR_SPOOLSS_ENUMMONITORS,
6446 if (!NT_STATUS_IS_OK(status)) {
6450 if (DEBUGLEVEL >= 10) {
6451 NDR_PRINT_OUT_DEBUG(spoolss_EnumMonitors, &r);
6454 if (NT_STATUS_IS_ERR(status)) {
6458 /* Return variables */
6459 *count = *r.out.count;
6460 *info = *r.out.info;
6461 *needed = *r.out.needed;
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);
6496 state->out_mem_ctx = NULL;
6497 state->dispatch_recv = cli->dispatch_recv;
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 */
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,
6518 NDR_SPOOLSS_ADDPORT,
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);
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);
6534 TALLOC_CTX *mem_ctx;
6536 if (state->out_mem_ctx) {
6537 mem_ctx = state->out_mem_ctx;
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);
6549 /* Copy out parameters */
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,
6568 struct rpccli_spoolss_AddPort_state *state = tevent_req_data(
6569 req, struct rpccli_spoolss_AddPort_state);
6572 if (tevent_req_is_nterror(req, &status)) {
6573 tevent_req_received(req);
6577 /* Steal possbile out parameters to the callers context */
6578 talloc_steal(mem_ctx, state->out_mem_ctx);
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)] */,
6594 struct spoolss_AddPort r;
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,
6609 NDR_SPOOLSS_ADDPORT,
6612 if (!NT_STATUS_IS_OK(status)) {
6616 if (DEBUGLEVEL >= 10) {
6617 NDR_PRINT_OUT_DEBUG(spoolss_AddPort, &r);
6620 if (NT_STATUS_IS_ERR(status)) {
6624 /* Return variables */
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);
6656 state->out_mem_ctx = NULL;
6657 state->dispatch_recv = cli->dispatch_recv;
6661 /* Out parameters */
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,
6675 NDR_SPOOLSS_CONFIGUREPORT,
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);
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);
6691 TALLOC_CTX *mem_ctx;
6693 if (state->out_mem_ctx) {
6694 mem_ctx = state->out_mem_ctx;
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);
6706 /* Copy out parameters */
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,
6725 struct rpccli_spoolss_ConfigurePort_state *state = tevent_req_data(
6726 req, struct rpccli_spoolss_ConfigurePort_state);
6729 if (tevent_req_is_nterror(req, &status)) {
6730 tevent_req_received(req);
6734 /* Steal possbile out parameters to the callers context */
6735 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
6748 struct spoolss_ConfigurePort r;
6753 if (DEBUGLEVEL >= 10) {
6754 NDR_PRINT_IN_DEBUG(spoolss_ConfigurePort, &r);
6757 status = cli->dispatch(cli,
6760 NDR_SPOOLSS_CONFIGUREPORT,
6763 if (!NT_STATUS_IS_OK(status)) {
6767 if (DEBUGLEVEL >= 10) {
6768 NDR_PRINT_OUT_DEBUG(spoolss_ConfigurePort, &r);
6771 if (NT_STATUS_IS_ERR(status)) {
6775 /* Return variables */
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);
6807 state->out_mem_ctx = NULL;
6808 state->dispatch_recv = cli->dispatch_recv;
6812 /* Out parameters */
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,
6826 NDR_SPOOLSS_DELETEPORT,
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);
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);
6842 TALLOC_CTX *mem_ctx;
6844 if (state->out_mem_ctx) {
6845 mem_ctx = state->out_mem_ctx;
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);
6857 /* Copy out parameters */
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,
6876 struct rpccli_spoolss_DeletePort_state *state = tevent_req_data(
6877 req, struct rpccli_spoolss_DeletePort_state);
6880 if (tevent_req_is_nterror(req, &status)) {
6881 tevent_req_received(req);
6885 /* Steal possbile out parameters to the callers context */
6886 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
6899 struct spoolss_DeletePort r;
6904 if (DEBUGLEVEL >= 10) {
6905 NDR_PRINT_IN_DEBUG(spoolss_DeletePort, &r);
6908 status = cli->dispatch(cli,
6911 NDR_SPOOLSS_DELETEPORT,
6914 if (!NT_STATUS_IS_OK(status)) {
6918 if (DEBUGLEVEL >= 10) {
6919 NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, &r);
6922 if (NT_STATUS_IS_ERR(status)) {
6926 /* Return variables */
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);
6961 state->out_mem_ctx = NULL;
6962 state->dispatch_recv = cli->dispatch_recv;
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;
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,
6989 NDR_SPOOLSS_CREATEPRINTERIC,
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);
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);
7005 TALLOC_CTX *mem_ctx;
7007 if (state->out_mem_ctx) {
7008 mem_ctx = state->out_mem_ctx;
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);
7020 /* Copy out parameters */
7021 *state->orig.out.gdi_handle = *state->tmp.out.gdi_handle;
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,
7040 struct rpccli_spoolss_CreatePrinterIC_state *state = tevent_req_data(
7041 req, struct rpccli_spoolss_CreatePrinterIC_state);
7044 if (tevent_req_is_nterror(req, &status)) {
7045 tevent_req_received(req);
7049 /* Steal possbile out parameters to the callers context */
7050 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
7066 struct spoolss_CreatePrinterIC r;
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,
7080 NDR_SPOOLSS_CREATEPRINTERIC,
7083 if (!NT_STATUS_IS_OK(status)) {
7087 if (DEBUGLEVEL >= 10) {
7088 NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, &r);
7091 if (NT_STATUS_IS_ERR(status)) {
7095 /* Return variables */
7096 *gdi_handle = *r.out.gdi_handle;
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);
7128 state->out_mem_ctx = NULL;
7129 state->dispatch_recv = cli->dispatch_recv;
7133 /* Out parameters */
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,
7147 NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
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);
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);
7163 TALLOC_CTX *mem_ctx;
7165 if (state->out_mem_ctx) {
7166 mem_ctx = state->out_mem_ctx;
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);
7178 /* Copy out parameters */
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,
7197 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state *state = tevent_req_data(
7198 req, struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state);
7201 if (tevent_req_is_nterror(req, &status)) {
7202 tevent_req_received(req);
7206 /* Steal possbile out parameters to the callers context */
7207 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
7220 struct spoolss_PlayGDIScriptOnPrinterIC r;
7225 if (DEBUGLEVEL >= 10) {
7226 NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
7229 status = cli->dispatch(cli,
7232 NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
7235 if (!NT_STATUS_IS_OK(status)) {
7239 if (DEBUGLEVEL >= 10) {
7240 NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
7243 if (NT_STATUS_IS_ERR(status)) {
7247 /* Return variables */
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);
7280 state->out_mem_ctx = NULL;
7281 state->dispatch_recv = cli->dispatch_recv;
7284 state->orig.in.gdi_handle = _gdi_handle;
7286 /* Out parameters */
7287 state->orig.out.gdi_handle = _gdi_handle;
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,
7307 NDR_SPOOLSS_DELETEPRINTERIC,
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);
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);
7323 TALLOC_CTX *mem_ctx;
7325 if (state->out_mem_ctx) {
7326 mem_ctx = state->out_mem_ctx;
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);
7338 /* Copy out parameters */
7339 *state->orig.out.gdi_handle = *state->tmp.out.gdi_handle;
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,
7358 struct rpccli_spoolss_DeletePrinterIC_state *state = tevent_req_data(
7359 req, struct rpccli_spoolss_DeletePrinterIC_state);
7362 if (tevent_req_is_nterror(req, &status)) {
7363 tevent_req_received(req);
7367 /* Steal possbile out parameters to the callers context */
7368 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
7382 struct spoolss_DeletePrinterIC r;
7386 r.in.gdi_handle = gdi_handle;
7388 if (DEBUGLEVEL >= 10) {
7389 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &r);
7392 status = cli->dispatch(cli,
7395 NDR_SPOOLSS_DELETEPRINTERIC,
7398 if (!NT_STATUS_IS_OK(status)) {
7402 if (DEBUGLEVEL >= 10) {
7403 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, &r);
7406 if (NT_STATUS_IS_ERR(status)) {
7410 /* Return variables */
7411 *gdi_handle = *r.out.gdi_handle;
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);
7443 state->out_mem_ctx = NULL;
7444 state->dispatch_recv = cli->dispatch_recv;
7448 /* Out parameters */
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,
7462 NDR_SPOOLSS_ADDPRINTERCONNECTION,
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);
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);
7478 TALLOC_CTX *mem_ctx;
7480 if (state->out_mem_ctx) {
7481 mem_ctx = state->out_mem_ctx;
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);
7493 /* Copy out parameters */
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,
7512 struct rpccli_spoolss_AddPrinterConnection_state *state = tevent_req_data(
7513 req, struct rpccli_spoolss_AddPrinterConnection_state);
7516 if (tevent_req_is_nterror(req, &status)) {
7517 tevent_req_received(req);
7521 /* Steal possbile out parameters to the callers context */
7522 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
7535 struct spoolss_AddPrinterConnection r;
7540 if (DEBUGLEVEL >= 10) {
7541 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, &r);
7544 status = cli->dispatch(cli,
7547 NDR_SPOOLSS_ADDPRINTERCONNECTION,
7550 if (!NT_STATUS_IS_OK(status)) {
7554 if (DEBUGLEVEL >= 10) {
7555 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, &r);
7558 if (NT_STATUS_IS_ERR(status)) {
7562 /* Return variables */
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);
7594 state->out_mem_ctx = NULL;
7595 state->dispatch_recv = cli->dispatch_recv;
7599 /* Out parameters */
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,
7613 NDR_SPOOLSS_DELETEPRINTERCONNECTION,
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);
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);
7629 TALLOC_CTX *mem_ctx;
7631 if (state->out_mem_ctx) {
7632 mem_ctx = state->out_mem_ctx;
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);
7644 /* Copy out parameters */
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,
7663 struct rpccli_spoolss_DeletePrinterConnection_state *state = tevent_req_data(
7664 req, struct rpccli_spoolss_DeletePrinterConnection_state);
7667 if (tevent_req_is_nterror(req, &status)) {
7668 tevent_req_received(req);
7672 /* Steal possbile out parameters to the callers context */
7673 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
7686 struct spoolss_DeletePrinterConnection r;
7691 if (DEBUGLEVEL >= 10) {
7692 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, &r);
7695 status = cli->dispatch(cli,
7698 NDR_SPOOLSS_DELETEPRINTERCONNECTION,
7701 if (!NT_STATUS_IS_OK(status)) {
7705 if (DEBUGLEVEL >= 10) {
7706 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, &r);
7709 if (NT_STATUS_IS_ERR(status)) {
7713 /* Return variables */
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);
7745 state->out_mem_ctx = NULL;
7746 state->dispatch_recv = cli->dispatch_recv;
7750 /* Out parameters */
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,
7764 NDR_SPOOLSS_PRINTERMESSAGEBOX,
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);
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);
7780 TALLOC_CTX *mem_ctx;
7782 if (state->out_mem_ctx) {
7783 mem_ctx = state->out_mem_ctx;
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);
7795 /* Copy out parameters */
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,
7814 struct rpccli_spoolss_PrinterMessageBox_state *state = tevent_req_data(
7815 req, struct rpccli_spoolss_PrinterMessageBox_state);
7818 if (tevent_req_is_nterror(req, &status)) {
7819 tevent_req_received(req);
7823 /* Steal possbile out parameters to the callers context */
7824 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
7837 struct spoolss_PrinterMessageBox r;
7842 if (DEBUGLEVEL >= 10) {
7843 NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, &r);
7846 status = cli->dispatch(cli,
7849 NDR_SPOOLSS_PRINTERMESSAGEBOX,
7852 if (!NT_STATUS_IS_OK(status)) {
7856 if (DEBUGLEVEL >= 10) {
7857 NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, &r);
7860 if (NT_STATUS_IS_ERR(status)) {
7864 /* Return variables */
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);
7896 state->out_mem_ctx = NULL;
7897 state->dispatch_recv = cli->dispatch_recv;
7901 /* Out parameters */
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,
7915 NDR_SPOOLSS_ADDMONITOR,
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);
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);
7931 TALLOC_CTX *mem_ctx;
7933 if (state->out_mem_ctx) {
7934 mem_ctx = state->out_mem_ctx;
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);
7946 /* Copy out parameters */
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,
7965 struct rpccli_spoolss_AddMonitor_state *state = tevent_req_data(
7966 req, struct rpccli_spoolss_AddMonitor_state);
7969 if (tevent_req_is_nterror(req, &status)) {
7970 tevent_req_received(req);
7974 /* Steal possbile out parameters to the callers context */
7975 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
7988 struct spoolss_AddMonitor r;
7993 if (DEBUGLEVEL >= 10) {
7994 NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, &r);
7997 status = cli->dispatch(cli,
8000 NDR_SPOOLSS_ADDMONITOR,
8003 if (!NT_STATUS_IS_OK(status)) {
8007 if (DEBUGLEVEL >= 10) {
8008 NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, &r);
8011 if (NT_STATUS_IS_ERR(status)) {
8015 /* Return variables */
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);
8047 state->out_mem_ctx = NULL;
8048 state->dispatch_recv = cli->dispatch_recv;
8052 /* Out parameters */
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,
8066 NDR_SPOOLSS_DELETEMONITOR,
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);
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);
8082 TALLOC_CTX *mem_ctx;
8084 if (state->out_mem_ctx) {
8085 mem_ctx = state->out_mem_ctx;
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);
8097 /* Copy out parameters */
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,
8116 struct rpccli_spoolss_DeleteMonitor_state *state = tevent_req_data(
8117 req, struct rpccli_spoolss_DeleteMonitor_state);
8120 if (tevent_req_is_nterror(req, &status)) {
8121 tevent_req_received(req);
8125 /* Steal possbile out parameters to the callers context */
8126 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
8139 struct spoolss_DeleteMonitor r;
8144 if (DEBUGLEVEL >= 10) {
8145 NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, &r);
8148 status = cli->dispatch(cli,
8151 NDR_SPOOLSS_DELETEMONITOR,
8154 if (!NT_STATUS_IS_OK(status)) {
8158 if (DEBUGLEVEL >= 10) {
8159 NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, &r);
8162 if (NT_STATUS_IS_ERR(status)) {
8166 /* Return variables */
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);
8198 state->out_mem_ctx = NULL;
8199 state->dispatch_recv = cli->dispatch_recv;
8203 /* Out parameters */
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,
8217 NDR_SPOOLSS_DELETEPRINTPROCESSOR,
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);
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);
8233 TALLOC_CTX *mem_ctx;
8235 if (state->out_mem_ctx) {
8236 mem_ctx = state->out_mem_ctx;
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);
8248 /* Copy out parameters */
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,
8267 struct rpccli_spoolss_DeletePrintProcessor_state *state = tevent_req_data(
8268 req, struct rpccli_spoolss_DeletePrintProcessor_state);
8271 if (tevent_req_is_nterror(req, &status)) {
8272 tevent_req_received(req);
8276 /* Steal possbile out parameters to the callers context */
8277 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
8290 struct spoolss_DeletePrintProcessor r;
8295 if (DEBUGLEVEL >= 10) {
8296 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, &r);
8299 status = cli->dispatch(cli,
8302 NDR_SPOOLSS_DELETEPRINTPROCESSOR,
8305 if (!NT_STATUS_IS_OK(status)) {
8309 if (DEBUGLEVEL >= 10) {
8310 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, &r);
8313 if (NT_STATUS_IS_ERR(status)) {
8317 /* Return variables */
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);
8349 state->out_mem_ctx = NULL;
8350 state->dispatch_recv = cli->dispatch_recv;
8354 /* Out parameters */
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,
8368 NDR_SPOOLSS_ADDPRINTPROVIDOR,
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);
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);
8384 TALLOC_CTX *mem_ctx;
8386 if (state->out_mem_ctx) {
8387 mem_ctx = state->out_mem_ctx;
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);
8399 /* Copy out parameters */
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,
8418 struct rpccli_spoolss_AddPrintProvidor_state *state = tevent_req_data(
8419 req, struct rpccli_spoolss_AddPrintProvidor_state);
8422 if (tevent_req_is_nterror(req, &status)) {
8423 tevent_req_received(req);
8427 /* Steal possbile out parameters to the callers context */
8428 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
8441 struct spoolss_AddPrintProvidor r;
8446 if (DEBUGLEVEL >= 10) {
8447 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, &r);
8450 status = cli->dispatch(cli,
8453 NDR_SPOOLSS_ADDPRINTPROVIDOR,
8456 if (!NT_STATUS_IS_OK(status)) {
8460 if (DEBUGLEVEL >= 10) {
8461 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, &r);
8464 if (NT_STATUS_IS_ERR(status)) {
8468 /* Return variables */
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);
8500 state->out_mem_ctx = NULL;
8501 state->dispatch_recv = cli->dispatch_recv;
8505 /* Out parameters */
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,
8519 NDR_SPOOLSS_DELETEPRINTPROVIDOR,
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);
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);
8535 TALLOC_CTX *mem_ctx;
8537 if (state->out_mem_ctx) {
8538 mem_ctx = state->out_mem_ctx;
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);
8550 /* Copy out parameters */
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,
8569 struct rpccli_spoolss_DeletePrintProvidor_state *state = tevent_req_data(
8570 req, struct rpccli_spoolss_DeletePrintProvidor_state);
8573 if (tevent_req_is_nterror(req, &status)) {
8574 tevent_req_received(req);
8578 /* Steal possbile out parameters to the callers context */
8579 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
8592 struct spoolss_DeletePrintProvidor r;
8597 if (DEBUGLEVEL >= 10) {
8598 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, &r);
8601 status = cli->dispatch(cli,
8604 NDR_SPOOLSS_DELETEPRINTPROVIDOR,
8607 if (!NT_STATUS_IS_OK(status)) {
8611 if (DEBUGLEVEL >= 10) {
8612 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, &r);
8615 if (NT_STATUS_IS_ERR(status)) {
8619 /* Return variables */
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);
8659 state->out_mem_ctx = NULL;
8660 state->dispatch_recv = cli->dispatch_recv;
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;
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,
8692 NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
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);
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);
8708 TALLOC_CTX *mem_ctx;
8710 if (state->out_mem_ctx) {
8711 mem_ctx = state->out_mem_ctx;
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);
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;
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,
8745 struct rpccli_spoolss_EnumPrintProcDataTypes_state *state = tevent_req_data(
8746 req, struct rpccli_spoolss_EnumPrintProcDataTypes_state);
8749 if (tevent_req_is_nterror(req, &status)) {
8750 tevent_req_received(req);
8754 /* Steal possbile out parameters to the callers context */
8755 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
8776 struct spoolss_EnumPrintProcDataTypes r;
8780 r.in.servername = servername;
8781 r.in.print_processor_name = print_processor_name;
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,
8793 NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
8796 if (!NT_STATUS_IS_OK(status)) {
8800 if (DEBUGLEVEL >= 10) {
8801 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
8804 if (NT_STATUS_IS_ERR(status)) {
8808 /* Return variables */
8809 *count = *r.out.count;
8810 *info = *r.out.info;
8811 *needed = *r.out.needed;
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);
8846 state->out_mem_ctx = NULL;
8847 state->dispatch_recv = cli->dispatch_recv;
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 */
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,
8868 NDR_SPOOLSS_RESETPRINTER,
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);
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);
8884 TALLOC_CTX *mem_ctx;
8886 if (state->out_mem_ctx) {
8887 mem_ctx = state->out_mem_ctx;
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);
8899 /* Copy out parameters */
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,
8918 struct rpccli_spoolss_ResetPrinter_state *state = tevent_req_data(
8919 req, struct rpccli_spoolss_ResetPrinter_state);
8922 if (tevent_req_is_nterror(req, &status)) {
8923 tevent_req_received(req);
8927 /* Steal possbile out parameters to the callers context */
8928 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
8944 struct spoolss_ResetPrinter r;
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,
8959 NDR_SPOOLSS_RESETPRINTER,
8962 if (!NT_STATUS_IS_OK(status)) {
8966 if (DEBUGLEVEL >= 10) {
8967 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, &r);
8970 if (NT_STATUS_IS_ERR(status)) {
8974 /* Return variables */
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);
9017 state->out_mem_ctx = NULL;
9018 state->dispatch_recv = cli->dispatch_recv;
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;
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,
9053 NDR_SPOOLSS_GETPRINTERDRIVER2,
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);
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);
9069 TALLOC_CTX *mem_ctx;
9071 if (state->out_mem_ctx) {
9072 mem_ctx = state->out_mem_ctx;
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);
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;
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,
9109 struct rpccli_spoolss_GetPrinterDriver2_state *state = tevent_req_data(
9110 req, struct rpccli_spoolss_GetPrinterDriver2_state);
9113 if (tevent_req_is_nterror(req, &status)) {
9114 tevent_req_received(req);
9118 /* Steal possbile out parameters to the callers context */
9119 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
9143 struct spoolss_GetPrinterDriver2 r;
9147 r.in.handle = handle;
9148 r.in.architecture = architecture;
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,
9162 NDR_SPOOLSS_GETPRINTERDRIVER2,
9165 if (!NT_STATUS_IS_OK(status)) {
9169 if (DEBUGLEVEL >= 10) {
9170 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, &r);
9173 if (NT_STATUS_IS_ERR(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;
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);
9215 state->out_mem_ctx = NULL;
9216 state->dispatch_recv = cli->dispatch_recv;
9220 /* Out parameters */
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,
9234 NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
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);
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);
9250 TALLOC_CTX *mem_ctx;
9252 if (state->out_mem_ctx) {
9253 mem_ctx = state->out_mem_ctx;
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);
9265 /* Copy out parameters */
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,
9284 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state *state = tevent_req_data(
9285 req, struct rpccli_spoolss_FindFirstPrinterChangeNotification_state);
9288 if (tevent_req_is_nterror(req, &status)) {
9289 tevent_req_received(req);
9293 /* Steal possbile out parameters to the callers context */
9294 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
9307 struct spoolss_FindFirstPrinterChangeNotification r;
9312 if (DEBUGLEVEL >= 10) {
9313 NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
9316 status = cli->dispatch(cli,
9319 NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
9322 if (!NT_STATUS_IS_OK(status)) {
9326 if (DEBUGLEVEL >= 10) {
9327 NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
9330 if (NT_STATUS_IS_ERR(status)) {
9334 /* Return variables */
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);
9366 state->out_mem_ctx = NULL;
9367 state->dispatch_recv = cli->dispatch_recv;
9371 /* Out parameters */
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,
9385 NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
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);
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);
9401 TALLOC_CTX *mem_ctx;
9403 if (state->out_mem_ctx) {
9404 mem_ctx = state->out_mem_ctx;
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);
9416 /* Copy out parameters */
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,
9435 struct rpccli_spoolss_FindNextPrinterChangeNotification_state *state = tevent_req_data(
9436 req, struct rpccli_spoolss_FindNextPrinterChangeNotification_state);
9439 if (tevent_req_is_nterror(req, &status)) {
9440 tevent_req_received(req);
9444 /* Steal possbile out parameters to the callers context */
9445 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
9458 struct spoolss_FindNextPrinterChangeNotification r;
9463 if (DEBUGLEVEL >= 10) {
9464 NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
9467 status = cli->dispatch(cli,
9470 NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
9473 if (!NT_STATUS_IS_OK(status)) {
9477 if (DEBUGLEVEL >= 10) {
9478 NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
9481 if (NT_STATUS_IS_ERR(status)) {
9485 /* Return variables */
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);
9518 state->out_mem_ctx = NULL;
9519 state->dispatch_recv = cli->dispatch_recv;
9522 state->orig.in.handle = _handle;
9524 /* Out parameters */
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,
9538 NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
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);
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);
9554 TALLOC_CTX *mem_ctx;
9556 if (state->out_mem_ctx) {
9557 mem_ctx = state->out_mem_ctx;
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);
9569 /* Copy out parameters */
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,
9588 struct rpccli_spoolss_FindClosePrinterNotify_state *state = tevent_req_data(
9589 req, struct rpccli_spoolss_FindClosePrinterNotify_state);
9592 if (tevent_req_is_nterror(req, &status)) {
9593 tevent_req_received(req);
9597 /* Steal possbile out parameters to the callers context */
9598 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
9612 struct spoolss_FindClosePrinterNotify r;
9616 r.in.handle = handle;
9618 if (DEBUGLEVEL >= 10) {
9619 NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, &r);
9622 status = cli->dispatch(cli,
9625 NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
9628 if (!NT_STATUS_IS_OK(status)) {
9632 if (DEBUGLEVEL >= 10) {
9633 NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, &r);
9636 if (NT_STATUS_IS_ERR(status)) {
9640 /* Return variables */
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);
9672 state->out_mem_ctx = NULL;
9673 state->dispatch_recv = cli->dispatch_recv;
9677 /* Out parameters */
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,
9691 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
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);
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);
9707 TALLOC_CTX *mem_ctx;
9709 if (state->out_mem_ctx) {
9710 mem_ctx = state->out_mem_ctx;
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);
9722 /* Copy out parameters */
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,
9741 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state *state = tevent_req_data(
9742 req, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state);
9745 if (tevent_req_is_nterror(req, &status)) {
9746 tevent_req_received(req);
9750 /* Steal possbile out parameters to the callers context */
9751 talloc_steal(mem_ctx, state->out_mem_ctx);
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,
9764 struct spoolss_RouterFindFirstPrinterChangeNotificationOld r;
9769 if (DEBUGLEVEL >= 10) {
9770 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
9773 status = cli->dispatch(cli,
9776 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
9779 if (!NT_STATUS_IS_OK(status)) {
9783 if (DEBUGLEVEL >= 10) {
9784 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
9787 if (NT_STATUS_IS_ERR(status)) {
9791 /* Return variables */
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);
9829 state->out_mem_ctx = NULL;
9830 state->dispatch_recv = cli->dispatch_recv;
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;
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,
9860 NDR_SPOOLSS_REPLYOPENPRINTER,
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);
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);
9876 TALLOC_CTX *mem_ctx;
9878 if (state->out_mem_ctx) {
9879 mem_ctx = state->out_mem_ctx;
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);
9891 /* Copy out parameters */
9892 *state->orig.out.handle = *state->tmp.out.handle;
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,
9911 struct rpccli_spoolss_ReplyOpenPrinter_state *state = tevent_req_data(
9912 req, struct rpccli_spoolss_ReplyOpenPrinter_state);
9915 if (tevent_req_is_nterror(req, &status)) {
9916 tevent_req_received(req);
9920 /* Steal possbile out parameters to the callers context */
9921 talloc_steal(mem_ctx, state->out_mem_ctx);
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] */,
9940 struct spoolss_ReplyOpenPrinter r;
9944 r.in.server_name = server_name;
9945 r.in.printer_local = printer_local;
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,
9957 NDR_SPOOLSS_REPLYOPENPRINTER,
9960 if (!NT_STATUS_IS_OK(status)) {
9964 if (DEBUGLEVEL >= 10) {
9965 NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, &r);
9968 if (NT_STATUS_IS_ERR(status)) {
9972 /* Return variables */
9973 *handle = *r.out.handle;
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);
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 */
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,
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);
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);
10048 TALLOC_CTX *mem_ctx;
10050 if (state->out_mem_ctx) {
10051 mem_ctx = state->out_mem_ctx;
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);
10063 /* Copy out parameters */
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,
10082 struct rpccli_spoolss_RouterReplyPrinter_state *state = tevent_req_data(
10083 req, struct rpccli_spoolss_RouterReplyPrinter_state);
10086 if (tevent_req_is_nterror(req, &status)) {
10087 tevent_req_received(req);
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)] */,
10109 struct spoolss_RouterReplyPrinter r;
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,
10124 &ndr_table_spoolss,
10125 NDR_SPOOLSS_ROUTERREPLYPRINTER,
10128 if (!NT_STATUS_IS_OK(status)) {
10132 if (DEBUGLEVEL >= 10) {
10133 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, &r);
10136 if (NT_STATUS_IS_ERR(status)) {
10140 /* Return variables */
10142 /* Return result */
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);
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;
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,
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);
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);
10216 TALLOC_CTX *mem_ctx;
10218 if (state->out_mem_ctx) {
10219 mem_ctx = state->out_mem_ctx;
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);
10231 /* Copy out parameters */
10232 *state->orig.out.handle = *state->tmp.out.handle;
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,
10251 struct rpccli_spoolss_ReplyClosePrinter_state *state = tevent_req_data(
10252 req, struct rpccli_spoolss_ReplyClosePrinter_state);
10255 if (tevent_req_is_nterror(req, &status)) {
10256 tevent_req_received(req);
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] */,
10275 struct spoolss_ReplyClosePrinter r;
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,
10287 &ndr_table_spoolss,
10288 NDR_SPOOLSS_REPLYCLOSEPRINTER,
10291 if (!NT_STATUS_IS_OK(status)) {
10295 if (DEBUGLEVEL >= 10) {
10296 NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, &r);
10299 if (NT_STATUS_IS_ERR(status)) {
10303 /* Return variables */
10304 *handle = *r.out.handle;
10306 /* Return result */
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);
10336 state->out_mem_ctx = NULL;
10337 state->dispatch_recv = cli->dispatch_recv;
10339 /* In parameters */
10341 /* Out parameters */
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,
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);
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);
10371 TALLOC_CTX *mem_ctx;
10373 if (state->out_mem_ctx) {
10374 mem_ctx = state->out_mem_ctx;
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);
10386 /* Copy out parameters */
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,
10405 struct rpccli_spoolss_AddPortEx_state *state = tevent_req_data(
10406 req, struct rpccli_spoolss_AddPortEx_state);
10409 if (tevent_req_is_nterror(req, &status)) {
10410 tevent_req_received(req);
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,
10428 struct spoolss_AddPortEx r;
10431 /* In parameters */
10433 if (DEBUGLEVEL >= 10) {
10434 NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, &r);
10437 status = cli->dispatch(cli,
10439 &ndr_table_spoolss,
10440 NDR_SPOOLSS_ADDPORTEX,
10443 if (!NT_STATUS_IS_OK(status)) {
10447 if (DEBUGLEVEL >= 10) {
10448 NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, &r);
10451 if (NT_STATUS_IS_ERR(status)) {
10455 /* Return variables */
10457 /* Return result */
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);
10487 state->out_mem_ctx = NULL;
10488 state->dispatch_recv = cli->dispatch_recv;
10490 /* In parameters */
10492 /* Out parameters */
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,
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);
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);
10522 TALLOC_CTX *mem_ctx;
10524 if (state->out_mem_ctx) {
10525 mem_ctx = state->out_mem_ctx;
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);
10537 /* Copy out parameters */
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,
10556 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state *state = tevent_req_data(
10557 req, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state);
10560 if (tevent_req_is_nterror(req, &status)) {
10561 tevent_req_received(req);
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,
10579 struct spoolss_RouterFindFirstPrinterChangeNotification r;
10582 /* In parameters */
10584 if (DEBUGLEVEL >= 10) {
10585 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
10588 status = cli->dispatch(cli,
10590 &ndr_table_spoolss,
10591 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION,
10594 if (!NT_STATUS_IS_OK(status)) {
10598 if (DEBUGLEVEL >= 10) {
10599 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
10602 if (NT_STATUS_IS_ERR(status)) {
10606 /* Return variables */
10608 /* Return result */
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);
10638 state->out_mem_ctx = NULL;
10639 state->dispatch_recv = cli->dispatch_recv;
10641 /* In parameters */
10643 /* Out parameters */
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,
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);
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);
10673 TALLOC_CTX *mem_ctx;
10675 if (state->out_mem_ctx) {
10676 mem_ctx = state->out_mem_ctx;
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);
10688 /* Copy out parameters */
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,
10707 struct rpccli_spoolss_SpoolerInit_state *state = tevent_req_data(
10708 req, struct rpccli_spoolss_SpoolerInit_state);
10711 if (tevent_req_is_nterror(req, &status)) {
10712 tevent_req_received(req);
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,
10730 struct spoolss_SpoolerInit r;
10733 /* In parameters */
10735 if (DEBUGLEVEL >= 10) {
10736 NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, &r);
10739 status = cli->dispatch(cli,
10741 &ndr_table_spoolss,
10742 NDR_SPOOLSS_SPOOLERINIT,
10745 if (!NT_STATUS_IS_OK(status)) {
10749 if (DEBUGLEVEL >= 10) {
10750 NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, &r);
10753 if (NT_STATUS_IS_ERR(status)) {
10757 /* Return variables */
10759 /* Return result */
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);
10789 state->out_mem_ctx = NULL;
10790 state->dispatch_recv = cli->dispatch_recv;
10792 /* In parameters */
10794 /* Out parameters */
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,
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);
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);
10824 TALLOC_CTX *mem_ctx;
10826 if (state->out_mem_ctx) {
10827 mem_ctx = state->out_mem_ctx;
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);
10839 /* Copy out parameters */
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,
10858 struct rpccli_spoolss_ResetPrinterEx_state *state = tevent_req_data(
10859 req, struct rpccli_spoolss_ResetPrinterEx_state);
10862 if (tevent_req_is_nterror(req, &status)) {
10863 tevent_req_received(req);
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,
10881 struct spoolss_ResetPrinterEx r;
10884 /* In parameters */
10886 if (DEBUGLEVEL >= 10) {
10887 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, &r);
10890 status = cli->dispatch(cli,
10892 &ndr_table_spoolss,
10893 NDR_SPOOLSS_RESETPRINTEREX,
10896 if (!NT_STATUS_IS_OK(status)) {
10900 if (DEBUGLEVEL >= 10) {
10901 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, &r);
10904 if (NT_STATUS_IS_ERR(status)) {
10908 /* Return variables */
10910 /* Return result */
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);
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 */
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,
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);
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);
10987 TALLOC_CTX *mem_ctx;
10989 if (state->out_mem_ctx) {
10990 mem_ctx = state->out_mem_ctx;
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);
11002 /* Copy out parameters */
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,
11021 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state = tevent_req_data(
11022 req, struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
11025 if (tevent_req_is_nterror(req, &status)) {
11026 tevent_req_received(req);
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] */,
11050 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
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,
11067 &ndr_table_spoolss,
11068 NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX,
11071 if (!NT_STATUS_IS_OK(status)) {
11075 if (DEBUGLEVEL >= 10) {
11076 NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
11079 if (NT_STATUS_IS_ERR(status)) {
11083 /* Return variables */
11085 /* Return result */
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);
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;
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,
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);
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);
11168 TALLOC_CTX *mem_ctx;
11170 if (state->out_mem_ctx) {
11171 mem_ctx = state->out_mem_ctx;
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);
11183 /* Copy out parameters */
11184 *state->orig.out.reply_result = *state->tmp.out.reply_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,
11203 struct rpccli_spoolss_RouterReplyPrinterEx_state *state = tevent_req_data(
11204 req, struct rpccli_spoolss_RouterReplyPrinterEx_state);
11207 if (tevent_req_is_nterror(req, &status)) {
11208 tevent_req_received(req);
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)] */,
11232 struct spoolss_RouterReplyPrinterEx r;
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;
11242 if (DEBUGLEVEL >= 10) {
11243 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, &r);
11246 status = cli->dispatch(cli,
11248 &ndr_table_spoolss,
11249 NDR_SPOOLSS_ROUTERREPLYPRINTEREX,
11252 if (!NT_STATUS_IS_OK(status)) {
11256 if (DEBUGLEVEL >= 10) {
11257 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinterEx, &r);
11260 if (NT_STATUS_IS_ERR(status)) {
11264 /* Return variables */
11265 *reply_result = *r.out.reply_result;
11267 /* Return result */
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);
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;
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,
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);
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);
11346 TALLOC_CTX *mem_ctx;
11348 if (state->out_mem_ctx) {
11349 mem_ctx = state->out_mem_ctx;
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);
11361 /* Copy out parameters */
11362 *state->orig.out.info = *state->tmp.out.info;
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,
11381 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state *state = tevent_req_data(
11382 req, struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state);
11385 if (tevent_req_is_nterror(req, &status)) {
11386 tevent_req_received(req);
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] */,
11408 struct spoolss_RouterRefreshPrinterChangeNotify r;
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,
11422 &ndr_table_spoolss,
11423 NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY,
11426 if (!NT_STATUS_IS_OK(status)) {
11430 if (DEBUGLEVEL >= 10) {
11431 NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &r);
11434 if (NT_STATUS_IS_ERR(status)) {
11438 /* Return variables */
11439 *info = *r.out.info;
11441 /* Return result */
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);
11471 state->out_mem_ctx = NULL;
11472 state->dispatch_recv = cli->dispatch_recv;
11474 /* In parameters */
11476 /* Out parameters */
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,
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);
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);
11506 TALLOC_CTX *mem_ctx;
11508 if (state->out_mem_ctx) {
11509 mem_ctx = state->out_mem_ctx;
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);
11521 /* Copy out parameters */
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,
11540 struct rpccli_spoolss_44_state *state = tevent_req_data(
11541 req, struct rpccli_spoolss_44_state);
11544 if (tevent_req_is_nterror(req, &status)) {
11545 tevent_req_received(req);
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,
11563 struct spoolss_44 r;
11566 /* In parameters */
11568 if (DEBUGLEVEL >= 10) {
11569 NDR_PRINT_IN_DEBUG(spoolss_44, &r);
11572 status = cli->dispatch(cli,
11574 &ndr_table_spoolss,
11578 if (!NT_STATUS_IS_OK(status)) {
11582 if (DEBUGLEVEL >= 10) {
11583 NDR_PRINT_OUT_DEBUG(spoolss_44, &r);
11586 if (NT_STATUS_IS_ERR(status)) {
11590 /* Return variables */
11592 /* Return result */
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);
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;
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,
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);
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);
11677 TALLOC_CTX *mem_ctx;
11679 if (state->out_mem_ctx) {
11680 mem_ctx = state->out_mem_ctx;
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);
11692 /* Copy out parameters */
11693 *state->orig.out.handle = *state->tmp.out.handle;
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,
11712 struct rpccli_spoolss_OpenPrinterEx_state *state = tevent_req_data(
11713 req, struct rpccli_spoolss_OpenPrinterEx_state);
11716 if (tevent_req_is_nterror(req, &status)) {
11717 tevent_req_received(req);
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] */,
11742 struct spoolss_OpenPrinterEx r;
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,
11759 &ndr_table_spoolss,
11760 NDR_SPOOLSS_OPENPRINTEREX,
11763 if (!NT_STATUS_IS_OK(status)) {
11767 if (DEBUGLEVEL >= 10) {
11768 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, &r);
11771 if (NT_STATUS_IS_ERR(status)) {
11775 /* Return variables */
11776 *handle = *r.out.handle;
11778 /* Return result */
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);
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;
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,
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);
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);
11861 TALLOC_CTX *mem_ctx;
11863 if (state->out_mem_ctx) {
11864 mem_ctx = state->out_mem_ctx;
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);
11876 /* Copy out parameters */
11877 *state->orig.out.handle = *state->tmp.out.handle;
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,
11896 struct rpccli_spoolss_AddPrinterEx_state *state = tevent_req_data(
11897 req, struct rpccli_spoolss_AddPrinterEx_state);
11900 if (tevent_req_is_nterror(req, &status)) {
11901 tevent_req_received(req);
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] */,
11925 struct spoolss_AddPrinterEx r;
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,
11941 &ndr_table_spoolss,
11942 NDR_SPOOLSS_ADDPRINTEREX,
11945 if (!NT_STATUS_IS_OK(status)) {
11949 if (DEBUGLEVEL >= 10) {
11950 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, &r);
11953 if (NT_STATUS_IS_ERR(status)) {
11957 /* Return variables */
11958 *handle = *r.out.handle;
11960 /* Return result */
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);
11990 state->out_mem_ctx = NULL;
11991 state->dispatch_recv = cli->dispatch_recv;
11993 /* In parameters */
11995 /* Out parameters */
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,
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);
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);
12025 TALLOC_CTX *mem_ctx;
12027 if (state->out_mem_ctx) {
12028 mem_ctx = state->out_mem_ctx;
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);
12040 /* Copy out parameters */
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,
12059 struct rpccli_spoolss_47_state *state = tevent_req_data(
12060 req, struct rpccli_spoolss_47_state);
12063 if (tevent_req_is_nterror(req, &status)) {
12064 tevent_req_received(req);
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,
12082 struct spoolss_47 r;
12085 /* In parameters */
12087 if (DEBUGLEVEL >= 10) {
12088 NDR_PRINT_IN_DEBUG(spoolss_47, &r);
12091 status = cli->dispatch(cli,
12093 &ndr_table_spoolss,
12097 if (!NT_STATUS_IS_OK(status)) {
12101 if (DEBUGLEVEL >= 10) {
12102 NDR_PRINT_OUT_DEBUG(spoolss_47, &r);
12105 if (NT_STATUS_IS_ERR(status)) {
12109 /* Return variables */
12111 /* Return result */
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);
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;
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,
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);
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);
12200 TALLOC_CTX *mem_ctx;
12202 if (state->out_mem_ctx) {
12203 mem_ctx = state->out_mem_ctx;
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);
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;
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,
12239 struct rpccli_spoolss_EnumPrinterData_state *state = tevent_req_data(
12240 req, struct rpccli_spoolss_EnumPrinterData_state);
12243 if (tevent_req_is_nterror(req, &status)) {
12244 tevent_req_received(req);
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] */,
12271 struct spoolss_EnumPrinterData r;
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,
12286 &ndr_table_spoolss,
12287 NDR_SPOOLSS_ENUMPRINTERDATA,
12290 if (!NT_STATUS_IS_OK(status)) {
12294 if (DEBUGLEVEL >= 10) {
12295 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterData, &r);
12298 if (NT_STATUS_IS_ERR(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 */
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);
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 */
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,
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);
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);
12378 TALLOC_CTX *mem_ctx;
12380 if (state->out_mem_ctx) {
12381 mem_ctx = state->out_mem_ctx;
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);
12393 /* Copy out parameters */
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,
12412 struct rpccli_spoolss_DeletePrinterData_state *state = tevent_req_data(
12413 req, struct rpccli_spoolss_DeletePrinterData_state);
12416 if (tevent_req_is_nterror(req, &status)) {
12417 tevent_req_received(req);
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)] */,
12437 struct spoolss_DeletePrinterData r;
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,
12450 &ndr_table_spoolss,
12451 NDR_SPOOLSS_DELETEPRINTERDATA,
12454 if (!NT_STATUS_IS_OK(status)) {
12458 if (DEBUGLEVEL >= 10) {
12459 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterData, &r);
12462 if (NT_STATUS_IS_ERR(status)) {
12466 /* Return variables */
12468 /* Return result */
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);
12498 state->out_mem_ctx = NULL;
12499 state->dispatch_recv = cli->dispatch_recv;
12501 /* In parameters */
12503 /* Out parameters */
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,
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);
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);
12533 TALLOC_CTX *mem_ctx;
12535 if (state->out_mem_ctx) {
12536 mem_ctx = state->out_mem_ctx;
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);
12548 /* Copy out parameters */
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,
12567 struct rpccli_spoolss_4a_state *state = tevent_req_data(
12568 req, struct rpccli_spoolss_4a_state);
12571 if (tevent_req_is_nterror(req, &status)) {
12572 tevent_req_received(req);
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,
12590 struct spoolss_4a r;
12593 /* In parameters */
12595 if (DEBUGLEVEL >= 10) {
12596 NDR_PRINT_IN_DEBUG(spoolss_4a, &r);
12599 status = cli->dispatch(cli,
12601 &ndr_table_spoolss,
12605 if (!NT_STATUS_IS_OK(status)) {
12609 if (DEBUGLEVEL >= 10) {
12610 NDR_PRINT_OUT_DEBUG(spoolss_4a, &r);
12613 if (NT_STATUS_IS_ERR(status)) {
12617 /* Return variables */
12619 /* Return result */
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);
12649 state->out_mem_ctx = NULL;
12650 state->dispatch_recv = cli->dispatch_recv;
12652 /* In parameters */
12654 /* Out parameters */
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,
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);
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);
12684 TALLOC_CTX *mem_ctx;
12686 if (state->out_mem_ctx) {
12687 mem_ctx = state->out_mem_ctx;
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);
12699 /* Copy out parameters */
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,
12718 struct rpccli_spoolss_4b_state *state = tevent_req_data(
12719 req, struct rpccli_spoolss_4b_state);
12722 if (tevent_req_is_nterror(req, &status)) {
12723 tevent_req_received(req);
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,
12741 struct spoolss_4b r;
12744 /* In parameters */
12746 if (DEBUGLEVEL >= 10) {
12747 NDR_PRINT_IN_DEBUG(spoolss_4b, &r);
12750 status = cli->dispatch(cli,
12752 &ndr_table_spoolss,
12756 if (!NT_STATUS_IS_OK(status)) {
12760 if (DEBUGLEVEL >= 10) {
12761 NDR_PRINT_OUT_DEBUG(spoolss_4b, &r);
12764 if (NT_STATUS_IS_ERR(status)) {
12768 /* Return variables */
12770 /* Return result */
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);
12800 state->out_mem_ctx = NULL;
12801 state->dispatch_recv = cli->dispatch_recv;
12803 /* In parameters */
12805 /* Out parameters */
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,
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);
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);
12835 TALLOC_CTX *mem_ctx;
12837 if (state->out_mem_ctx) {
12838 mem_ctx = state->out_mem_ctx;
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);
12850 /* Copy out parameters */
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,
12869 struct rpccli_spoolss_4c_state *state = tevent_req_data(
12870 req, struct rpccli_spoolss_4c_state);
12873 if (tevent_req_is_nterror(req, &status)) {
12874 tevent_req_received(req);
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,
12892 struct spoolss_4c r;
12895 /* In parameters */
12897 if (DEBUGLEVEL >= 10) {
12898 NDR_PRINT_IN_DEBUG(spoolss_4c, &r);
12901 status = cli->dispatch(cli,
12903 &ndr_table_spoolss,
12907 if (!NT_STATUS_IS_OK(status)) {
12911 if (DEBUGLEVEL >= 10) {
12912 NDR_PRINT_OUT_DEBUG(spoolss_4c, &r);
12915 if (NT_STATUS_IS_ERR(status)) {
12919 /* Return variables */
12921 /* Return result */
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);
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 */
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,
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);
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);
12998 TALLOC_CTX *mem_ctx;
13000 if (state->out_mem_ctx) {
13001 mem_ctx = state->out_mem_ctx;
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);
13013 /* Copy out parameters */
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,
13032 struct rpccli_spoolss_SetPrinterDataEx_state *state = tevent_req_data(
13033 req, struct rpccli_spoolss_SetPrinterDataEx_state);
13036 if (tevent_req_is_nterror(req, &status)) {
13037 tevent_req_received(req);
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] */,
13061 struct spoolss_SetPrinterDataEx r;
13064 /* In parameters */
13065 r.in.handle = handle;
13066 r.in.key_name = key_name;
13067 r.in.value_name = value_name;
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,
13078 &ndr_table_spoolss,
13079 NDR_SPOOLSS_SETPRINTERDATAEX,
13082 if (!NT_STATUS_IS_OK(status)) {
13086 if (DEBUGLEVEL >= 10) {
13087 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterDataEx, &r);
13090 if (NT_STATUS_IS_ERR(status)) {
13094 /* Return variables */
13096 /* Return result */
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);
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;
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,
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);
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);
13181 TALLOC_CTX *mem_ctx;
13183 if (state->out_mem_ctx) {
13184 mem_ctx = state->out_mem_ctx;
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);
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;
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,
13218 struct rpccli_spoolss_GetPrinterDataEx_state *state = tevent_req_data(
13219 req, struct rpccli_spoolss_GetPrinterDataEx_state);
13222 if (tevent_req_is_nterror(req, &status)) {
13223 tevent_req_received(req);
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] */,
13248 struct spoolss_GetPrinterDataEx r;
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,
13263 &ndr_table_spoolss,
13264 NDR_SPOOLSS_GETPRINTERDATAEX,
13267 if (!NT_STATUS_IS_OK(status)) {
13271 if (DEBUGLEVEL >= 10) {
13272 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDataEx, &r);
13275 if (NT_STATUS_IS_ERR(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 */
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);
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;
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,
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);
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);
13367 TALLOC_CTX *mem_ctx;
13369 if (state->out_mem_ctx) {
13370 mem_ctx = state->out_mem_ctx;
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);
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;
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,
13404 struct rpccli_spoolss_EnumPrinterDataEx_state *state = tevent_req_data(
13405 req, struct rpccli_spoolss_EnumPrinterDataEx_state);
13408 if (tevent_req_is_nterror(req, &status)) {
13409 tevent_req_received(req);
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] */,
13433 struct spoolss_EnumPrinterDataEx r;
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,
13447 &ndr_table_spoolss,
13448 NDR_SPOOLSS_ENUMPRINTERDATAEX,
13451 if (!NT_STATUS_IS_OK(status)) {
13455 if (DEBUGLEVEL >= 10) {
13456 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDataEx, &r);
13459 if (NT_STATUS_IS_ERR(status)) {
13463 /* Return variables */
13464 *count = *r.out.count;
13465 *info = *r.out.info;
13466 *needed = *r.out.needed;
13468 /* Return result */
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);
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;
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,
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);
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);
13549 TALLOC_CTX *mem_ctx;
13551 if (state->out_mem_ctx) {
13552 mem_ctx = state->out_mem_ctx;
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);
13564 /* Copy out parameters */
13565 *state->orig.out.key_buffer = *state->tmp.out.key_buffer;
13566 *state->orig.out.needed = *state->tmp.out.needed;
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,
13585 struct rpccli_spoolss_EnumPrinterKey_state *state = tevent_req_data(
13586 req, struct rpccli_spoolss_EnumPrinterKey_state);
13589 if (tevent_req_is_nterror(req, &status)) {
13590 tevent_req_received(req);
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] */,
13613 struct spoolss_EnumPrinterKey r;
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,
13627 &ndr_table_spoolss,
13628 NDR_SPOOLSS_ENUMPRINTERKEY,
13631 if (!NT_STATUS_IS_OK(status)) {
13635 if (DEBUGLEVEL >= 10) {
13636 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterKey, &r);
13639 if (NT_STATUS_IS_ERR(status)) {
13643 /* Return variables */
13644 *key_buffer = *r.out.key_buffer;
13645 *needed = *r.out.needed;
13647 /* Return result */
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);
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 */
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,
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);
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);
13718 TALLOC_CTX *mem_ctx;
13720 if (state->out_mem_ctx) {
13721 mem_ctx = state->out_mem_ctx;
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);
13733 /* Copy out parameters */
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,
13752 struct rpccli_spoolss_DeletePrinterDataEx_state *state = tevent_req_data(
13753 req, struct rpccli_spoolss_DeletePrinterDataEx_state);
13756 if (tevent_req_is_nterror(req, &status)) {
13757 tevent_req_received(req);
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)] */,
13778 struct spoolss_DeletePrinterDataEx r;
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,
13792 &ndr_table_spoolss,
13793 NDR_SPOOLSS_DELETEPRINTERDATAEX,
13796 if (!NT_STATUS_IS_OK(status)) {
13800 if (DEBUGLEVEL >= 10) {
13801 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDataEx, &r);
13804 if (NT_STATUS_IS_ERR(status)) {
13808 /* Return variables */
13810 /* Return result */
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);
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 */
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,
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);
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);
13879 TALLOC_CTX *mem_ctx;
13881 if (state->out_mem_ctx) {
13882 mem_ctx = state->out_mem_ctx;
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);
13894 /* Copy out parameters */
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,
13913 struct rpccli_spoolss_DeletePrinterKey_state *state = tevent_req_data(
13914 req, struct rpccli_spoolss_DeletePrinterKey_state);
13917 if (tevent_req_is_nterror(req, &status)) {
13918 tevent_req_received(req);
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)] */,
13938 struct spoolss_DeletePrinterKey r;
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,
13951 &ndr_table_spoolss,
13952 NDR_SPOOLSS_DELETEPRINTERKEY,
13955 if (!NT_STATUS_IS_OK(status)) {
13959 if (DEBUGLEVEL >= 10) {
13960 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterKey, &r);
13963 if (NT_STATUS_IS_ERR(status)) {
13967 /* Return variables */
13969 /* Return result */
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);
13999 state->out_mem_ctx = NULL;
14000 state->dispatch_recv = cli->dispatch_recv;
14002 /* In parameters */
14004 /* Out parameters */
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,
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);
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);
14034 TALLOC_CTX *mem_ctx;
14036 if (state->out_mem_ctx) {
14037 mem_ctx = state->out_mem_ctx;
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);
14049 /* Copy out parameters */
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,
14068 struct rpccli_spoolss_53_state *state = tevent_req_data(
14069 req, struct rpccli_spoolss_53_state);
14072 if (tevent_req_is_nterror(req, &status)) {
14073 tevent_req_received(req);
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,
14091 struct spoolss_53 r;
14094 /* In parameters */
14096 if (DEBUGLEVEL >= 10) {
14097 NDR_PRINT_IN_DEBUG(spoolss_53, &r);
14100 status = cli->dispatch(cli,
14102 &ndr_table_spoolss,
14106 if (!NT_STATUS_IS_OK(status)) {
14110 if (DEBUGLEVEL >= 10) {
14111 NDR_PRINT_OUT_DEBUG(spoolss_53, &r);
14114 if (NT_STATUS_IS_ERR(status)) {
14118 /* Return variables */
14120 /* Return result */
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);
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 */
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,
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);
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);
14195 TALLOC_CTX *mem_ctx;
14197 if (state->out_mem_ctx) {
14198 mem_ctx = state->out_mem_ctx;
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);
14210 /* Copy out parameters */
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,
14229 struct rpccli_spoolss_DeletePrinterDriverEx_state *state = tevent_req_data(
14230 req, struct rpccli_spoolss_DeletePrinterDriverEx_state);
14233 if (tevent_req_is_nterror(req, &status)) {
14234 tevent_req_received(req);
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] */,
14257 struct spoolss_DeletePrinterDriverEx r;
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,
14273 &ndr_table_spoolss,
14274 NDR_SPOOLSS_DELETEPRINTERDRIVEREX,
14277 if (!NT_STATUS_IS_OK(status)) {
14281 if (DEBUGLEVEL >= 10) {
14282 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriverEx, &r);
14285 if (NT_STATUS_IS_ERR(status)) {
14289 /* Return variables */
14291 /* Return result */
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);
14321 state->out_mem_ctx = NULL;
14322 state->dispatch_recv = cli->dispatch_recv;
14324 /* In parameters */
14326 /* Out parameters */
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,
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);
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);
14356 TALLOC_CTX *mem_ctx;
14358 if (state->out_mem_ctx) {
14359 mem_ctx = state->out_mem_ctx;
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);
14371 /* Copy out parameters */
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,
14390 struct rpccli_spoolss_55_state *state = tevent_req_data(
14391 req, struct rpccli_spoolss_55_state);
14394 if (tevent_req_is_nterror(req, &status)) {
14395 tevent_req_received(req);
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,
14413 struct spoolss_55 r;
14416 /* In parameters */
14418 if (DEBUGLEVEL >= 10) {
14419 NDR_PRINT_IN_DEBUG(spoolss_55, &r);
14422 status = cli->dispatch(cli,
14424 &ndr_table_spoolss,
14428 if (!NT_STATUS_IS_OK(status)) {
14432 if (DEBUGLEVEL >= 10) {
14433 NDR_PRINT_OUT_DEBUG(spoolss_55, &r);
14436 if (NT_STATUS_IS_ERR(status)) {
14440 /* Return variables */
14442 /* Return result */
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);
14472 state->out_mem_ctx = NULL;
14473 state->dispatch_recv = cli->dispatch_recv;
14475 /* In parameters */
14477 /* Out parameters */
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,
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);
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);
14507 TALLOC_CTX *mem_ctx;
14509 if (state->out_mem_ctx) {
14510 mem_ctx = state->out_mem_ctx;
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);
14522 /* Copy out parameters */
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,
14541 struct rpccli_spoolss_56_state *state = tevent_req_data(
14542 req, struct rpccli_spoolss_56_state);
14545 if (tevent_req_is_nterror(req, &status)) {
14546 tevent_req_received(req);
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,
14564 struct spoolss_56 r;
14567 /* In parameters */
14569 if (DEBUGLEVEL >= 10) {
14570 NDR_PRINT_IN_DEBUG(spoolss_56, &r);
14573 status = cli->dispatch(cli,
14575 &ndr_table_spoolss,
14579 if (!NT_STATUS_IS_OK(status)) {
14583 if (DEBUGLEVEL >= 10) {
14584 NDR_PRINT_OUT_DEBUG(spoolss_56, &r);
14587 if (NT_STATUS_IS_ERR(status)) {
14591 /* Return variables */
14593 /* Return result */
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);
14623 state->out_mem_ctx = NULL;
14624 state->dispatch_recv = cli->dispatch_recv;
14626 /* In parameters */
14628 /* Out parameters */
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,
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);
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);
14658 TALLOC_CTX *mem_ctx;
14660 if (state->out_mem_ctx) {
14661 mem_ctx = state->out_mem_ctx;
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);
14673 /* Copy out parameters */
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,
14692 struct rpccli_spoolss_57_state *state = tevent_req_data(
14693 req, struct rpccli_spoolss_57_state);
14696 if (tevent_req_is_nterror(req, &status)) {
14697 tevent_req_received(req);
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,
14715 struct spoolss_57 r;
14718 /* In parameters */
14720 if (DEBUGLEVEL >= 10) {
14721 NDR_PRINT_IN_DEBUG(spoolss_57, &r);
14724 status = cli->dispatch(cli,
14726 &ndr_table_spoolss,
14730 if (!NT_STATUS_IS_OK(status)) {
14734 if (DEBUGLEVEL >= 10) {
14735 NDR_PRINT_OUT_DEBUG(spoolss_57, &r);
14738 if (NT_STATUS_IS_ERR(status)) {
14742 /* Return variables */
14744 /* Return result */
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);
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;
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,
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);
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);
14832 TALLOC_CTX *mem_ctx;
14834 if (state->out_mem_ctx) {
14835 mem_ctx = state->out_mem_ctx;
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);
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;
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,
14869 struct rpccli_spoolss_XcvData_state *state = tevent_req_data(
14870 req, struct rpccli_spoolss_XcvData_state);
14873 if (tevent_req_is_nterror(req, &status)) {
14874 tevent_req_received(req);
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] */,
14900 struct spoolss_XcvData r;
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,
14917 &ndr_table_spoolss,
14918 NDR_SPOOLSS_XCVDATA,
14921 if (!NT_STATUS_IS_OK(status)) {
14925 if (DEBUGLEVEL >= 10) {
14926 NDR_PRINT_OUT_DEBUG(spoolss_XcvData, &r);
14929 if (NT_STATUS_IS_ERR(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 */
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);
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 */
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,
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);
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);
15009 TALLOC_CTX *mem_ctx;
15011 if (state->out_mem_ctx) {
15012 mem_ctx = state->out_mem_ctx;
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);
15024 /* Copy out parameters */
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,
15043 struct rpccli_spoolss_AddPrinterDriverEx_state *state = tevent_req_data(
15044 req, struct rpccli_spoolss_AddPrinterDriverEx_state);
15047 if (tevent_req_is_nterror(req, &status)) {
15048 tevent_req_received(req);
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] */,
15069 struct spoolss_AddPrinterDriverEx r;
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,
15083 &ndr_table_spoolss,
15084 NDR_SPOOLSS_ADDPRINTERDRIVEREX,
15087 if (!NT_STATUS_IS_OK(status)) {
15091 if (DEBUGLEVEL >= 10) {
15092 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriverEx, &r);
15095 if (NT_STATUS_IS_ERR(status)) {
15099 /* Return variables */
15101 /* Return result */
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);
15131 state->out_mem_ctx = NULL;
15132 state->dispatch_recv = cli->dispatch_recv;
15134 /* In parameters */
15136 /* Out parameters */
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,
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);
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);
15166 TALLOC_CTX *mem_ctx;
15168 if (state->out_mem_ctx) {
15169 mem_ctx = state->out_mem_ctx;
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);
15181 /* Copy out parameters */
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,
15200 struct rpccli_spoolss_5a_state *state = tevent_req_data(
15201 req, struct rpccli_spoolss_5a_state);
15204 if (tevent_req_is_nterror(req, &status)) {
15205 tevent_req_received(req);
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,
15223 struct spoolss_5a r;
15226 /* In parameters */
15228 if (DEBUGLEVEL >= 10) {
15229 NDR_PRINT_IN_DEBUG(spoolss_5a, &r);
15232 status = cli->dispatch(cli,
15234 &ndr_table_spoolss,
15238 if (!NT_STATUS_IS_OK(status)) {
15242 if (DEBUGLEVEL >= 10) {
15243 NDR_PRINT_OUT_DEBUG(spoolss_5a, &r);
15246 if (NT_STATUS_IS_ERR(status)) {
15250 /* Return variables */
15252 /* Return result */
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);
15282 state->out_mem_ctx = NULL;
15283 state->dispatch_recv = cli->dispatch_recv;
15285 /* In parameters */
15287 /* Out parameters */
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,
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);
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);
15317 TALLOC_CTX *mem_ctx;
15319 if (state->out_mem_ctx) {
15320 mem_ctx = state->out_mem_ctx;
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);
15332 /* Copy out parameters */
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,
15351 struct rpccli_spoolss_5b_state *state = tevent_req_data(
15352 req, struct rpccli_spoolss_5b_state);
15355 if (tevent_req_is_nterror(req, &status)) {
15356 tevent_req_received(req);
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,
15374 struct spoolss_5b r;
15377 /* In parameters */
15379 if (DEBUGLEVEL >= 10) {
15380 NDR_PRINT_IN_DEBUG(spoolss_5b, &r);
15383 status = cli->dispatch(cli,
15385 &ndr_table_spoolss,
15389 if (!NT_STATUS_IS_OK(status)) {
15393 if (DEBUGLEVEL >= 10) {
15394 NDR_PRINT_OUT_DEBUG(spoolss_5b, &r);
15397 if (NT_STATUS_IS_ERR(status)) {
15401 /* Return variables */
15403 /* Return result */
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);
15433 state->out_mem_ctx = NULL;
15434 state->dispatch_recv = cli->dispatch_recv;
15436 /* In parameters */
15438 /* Out parameters */
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,
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);
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);
15468 TALLOC_CTX *mem_ctx;
15470 if (state->out_mem_ctx) {
15471 mem_ctx = state->out_mem_ctx;
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);
15483 /* Copy out parameters */
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,
15502 struct rpccli_spoolss_5c_state *state = tevent_req_data(
15503 req, struct rpccli_spoolss_5c_state);
15506 if (tevent_req_is_nterror(req, &status)) {
15507 tevent_req_received(req);
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,
15525 struct spoolss_5c r;
15528 /* In parameters */
15530 if (DEBUGLEVEL >= 10) {
15531 NDR_PRINT_IN_DEBUG(spoolss_5c, &r);
15534 status = cli->dispatch(cli,
15536 &ndr_table_spoolss,
15540 if (!NT_STATUS_IS_OK(status)) {
15544 if (DEBUGLEVEL >= 10) {
15545 NDR_PRINT_OUT_DEBUG(spoolss_5c, &r);
15548 if (NT_STATUS_IS_ERR(status)) {
15552 /* Return variables */
15554 /* Return result */
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);
15584 state->out_mem_ctx = NULL;
15585 state->dispatch_recv = cli->dispatch_recv;
15587 /* In parameters */
15589 /* Out parameters */
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,
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);
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);
15619 TALLOC_CTX *mem_ctx;
15621 if (state->out_mem_ctx) {
15622 mem_ctx = state->out_mem_ctx;
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);
15634 /* Copy out parameters */
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,
15653 struct rpccli_spoolss_5d_state *state = tevent_req_data(
15654 req, struct rpccli_spoolss_5d_state);
15657 if (tevent_req_is_nterror(req, &status)) {
15658 tevent_req_received(req);
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,
15676 struct spoolss_5d r;
15679 /* In parameters */
15681 if (DEBUGLEVEL >= 10) {
15682 NDR_PRINT_IN_DEBUG(spoolss_5d, &r);
15685 status = cli->dispatch(cli,
15687 &ndr_table_spoolss,
15691 if (!NT_STATUS_IS_OK(status)) {
15695 if (DEBUGLEVEL >= 10) {
15696 NDR_PRINT_OUT_DEBUG(spoolss_5d, &r);
15699 if (NT_STATUS_IS_ERR(status)) {
15703 /* Return variables */
15705 /* Return result */
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);
15735 state->out_mem_ctx = NULL;
15736 state->dispatch_recv = cli->dispatch_recv;
15738 /* In parameters */
15740 /* Out parameters */
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,
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);
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);
15770 TALLOC_CTX *mem_ctx;
15772 if (state->out_mem_ctx) {
15773 mem_ctx = state->out_mem_ctx;
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);
15785 /* Copy out parameters */
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,
15804 struct rpccli_spoolss_5e_state *state = tevent_req_data(
15805 req, struct rpccli_spoolss_5e_state);
15808 if (tevent_req_is_nterror(req, &status)) {
15809 tevent_req_received(req);
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,
15827 struct spoolss_5e r;
15830 /* In parameters */
15832 if (DEBUGLEVEL >= 10) {
15833 NDR_PRINT_IN_DEBUG(spoolss_5e, &r);
15836 status = cli->dispatch(cli,
15838 &ndr_table_spoolss,
15842 if (!NT_STATUS_IS_OK(status)) {
15846 if (DEBUGLEVEL >= 10) {
15847 NDR_PRINT_OUT_DEBUG(spoolss_5e, &r);
15850 if (NT_STATUS_IS_ERR(status)) {
15854 /* Return variables */
15856 /* Return result */
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);
15886 state->out_mem_ctx = NULL;
15887 state->dispatch_recv = cli->dispatch_recv;
15889 /* In parameters */
15891 /* Out parameters */
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,
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);
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);
15921 TALLOC_CTX *mem_ctx;
15923 if (state->out_mem_ctx) {
15924 mem_ctx = state->out_mem_ctx;
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);
15936 /* Copy out parameters */
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,
15955 struct rpccli_spoolss_5f_state *state = tevent_req_data(
15956 req, struct rpccli_spoolss_5f_state);
15959 if (tevent_req_is_nterror(req, &status)) {
15960 tevent_req_received(req);
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,
15978 struct spoolss_5f r;
15981 /* In parameters */
15983 if (DEBUGLEVEL >= 10) {
15984 NDR_PRINT_IN_DEBUG(spoolss_5f, &r);
15987 status = cli->dispatch(cli,
15989 &ndr_table_spoolss,
15993 if (!NT_STATUS_IS_OK(status)) {
15997 if (DEBUGLEVEL >= 10) {
15998 NDR_PRINT_OUT_DEBUG(spoolss_5f, &r);
16001 if (NT_STATUS_IS_ERR(status)) {
16005 /* Return variables */
16007 /* Return result */
16009 *werror = r.out.result;
16012 return werror_to_ntstatus(r.out.result);