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 state
->out_mem_ctx
= talloc_named_const(state
, 0,
58 "rpccli_spoolss_EnumPrinters_out_memory");
59 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
60 return tevent_req_post(req
, ev
);
63 /* make a temporary copy, that we pass to the dispatch function */
64 state
->tmp
= state
->orig
;
66 subreq
= cli
->dispatch_send(state
, ev
, cli
,
68 NDR_SPOOLSS_ENUMPRINTERS
,
70 if (tevent_req_nomem(subreq
, req
)) {
71 return tevent_req_post(req
, ev
);
73 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumPrinters_done
, req
);
77 static void rpccli_spoolss_EnumPrinters_done(struct tevent_req
*subreq
)
79 struct tevent_req
*req
= tevent_req_callback_data(
80 subreq
, struct tevent_req
);
81 struct rpccli_spoolss_EnumPrinters_state
*state
= tevent_req_data(
82 req
, struct rpccli_spoolss_EnumPrinters_state
);
86 if (state
->out_mem_ctx
) {
87 mem_ctx
= state
->out_mem_ctx
;
92 status
= state
->dispatch_recv(subreq
, mem_ctx
);
94 if (!NT_STATUS_IS_OK(status
)) {
95 tevent_req_nterror(req
, status
);
99 /* Copy out parameters */
100 *state
->orig
.out
.count
= *state
->tmp
.out
.count
;
101 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
102 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
105 state
->orig
.out
.result
= state
->tmp
.out
.result
;
107 /* Reset temporary structure */
108 ZERO_STRUCT(state
->tmp
);
110 tevent_req_done(req
);
113 NTSTATUS
rpccli_spoolss_EnumPrinters_recv(struct tevent_req
*req
,
117 struct rpccli_spoolss_EnumPrinters_state
*state
= tevent_req_data(
118 req
, struct rpccli_spoolss_EnumPrinters_state
);
121 if (tevent_req_is_nterror(req
, &status
)) {
122 tevent_req_received(req
);
126 /* Steal possbile out parameters to the callers context */
127 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
130 *result
= state
->orig
.out
.result
;
132 tevent_req_received(req
);
136 NTSTATUS
rpccli_spoolss_EnumPrinters(struct rpc_pipe_client
*cli
,
138 uint32_t flags
/* [in] */,
139 const char *server
/* [in] [unique,charset(UTF16)] */,
140 uint32_t level
/* [in] */,
141 DATA_BLOB
*buffer
/* [in] [unique] */,
142 uint32_t offered
/* [in] */,
143 uint32_t *count
/* [out] [ref] */,
144 union spoolss_PrinterInfo
**info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
145 uint32_t *needed
/* [out] [ref] */,
148 struct spoolss_EnumPrinters r
;
153 r
.in
.server
= server
;
155 r
.in
.buffer
= buffer
;
156 r
.in
.offered
= offered
;
158 status
= cli
->dispatch(cli
,
161 NDR_SPOOLSS_ENUMPRINTERS
,
164 if (!NT_STATUS_IS_OK(status
)) {
168 if (NT_STATUS_IS_ERR(status
)) {
172 /* Return variables */
173 *count
= *r
.out
.count
;
175 *needed
= *r
.out
.needed
;
179 *werror
= r
.out
.result
;
182 return werror_to_ntstatus(r
.out
.result
);
185 struct rpccli_spoolss_OpenPrinter_state
{
186 struct spoolss_OpenPrinter orig
;
187 struct spoolss_OpenPrinter tmp
;
188 TALLOC_CTX
*out_mem_ctx
;
189 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
192 static void rpccli_spoolss_OpenPrinter_done(struct tevent_req
*subreq
);
194 struct tevent_req
*rpccli_spoolss_OpenPrinter_send(TALLOC_CTX
*mem_ctx
,
195 struct tevent_context
*ev
,
196 struct rpc_pipe_client
*cli
,
197 const char *_printername
/* [in] [unique,charset(UTF16)] */,
198 const char *_datatype
/* [in] [unique,charset(UTF16)] */,
199 struct spoolss_DevmodeContainer _devmode_ctr
/* [in] */,
200 uint32_t _access_mask
/* [in] */,
201 struct policy_handle
*_handle
/* [out] [ref] */)
203 struct tevent_req
*req
;
204 struct rpccli_spoolss_OpenPrinter_state
*state
;
205 struct tevent_req
*subreq
;
207 req
= tevent_req_create(mem_ctx
, &state
,
208 struct rpccli_spoolss_OpenPrinter_state
);
212 state
->out_mem_ctx
= NULL
;
213 state
->dispatch_recv
= cli
->dispatch_recv
;
216 state
->orig
.in
.printername
= _printername
;
217 state
->orig
.in
.datatype
= _datatype
;
218 state
->orig
.in
.devmode_ctr
= _devmode_ctr
;
219 state
->orig
.in
.access_mask
= _access_mask
;
222 state
->orig
.out
.handle
= _handle
;
225 ZERO_STRUCT(state
->orig
.out
.result
);
227 state
->out_mem_ctx
= talloc_named_const(state
, 0,
228 "rpccli_spoolss_OpenPrinter_out_memory");
229 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
230 return tevent_req_post(req
, ev
);
233 /* make a temporary copy, that we pass to the dispatch function */
234 state
->tmp
= state
->orig
;
236 subreq
= cli
->dispatch_send(state
, ev
, cli
,
238 NDR_SPOOLSS_OPENPRINTER
,
240 if (tevent_req_nomem(subreq
, req
)) {
241 return tevent_req_post(req
, ev
);
243 tevent_req_set_callback(subreq
, rpccli_spoolss_OpenPrinter_done
, req
);
247 static void rpccli_spoolss_OpenPrinter_done(struct tevent_req
*subreq
)
249 struct tevent_req
*req
= tevent_req_callback_data(
250 subreq
, struct tevent_req
);
251 struct rpccli_spoolss_OpenPrinter_state
*state
= tevent_req_data(
252 req
, struct rpccli_spoolss_OpenPrinter_state
);
256 if (state
->out_mem_ctx
) {
257 mem_ctx
= state
->out_mem_ctx
;
262 status
= state
->dispatch_recv(subreq
, mem_ctx
);
264 if (!NT_STATUS_IS_OK(status
)) {
265 tevent_req_nterror(req
, status
);
269 /* Copy out parameters */
270 *state
->orig
.out
.handle
= *state
->tmp
.out
.handle
;
273 state
->orig
.out
.result
= state
->tmp
.out
.result
;
275 /* Reset temporary structure */
276 ZERO_STRUCT(state
->tmp
);
278 tevent_req_done(req
);
281 NTSTATUS
rpccli_spoolss_OpenPrinter_recv(struct tevent_req
*req
,
285 struct rpccli_spoolss_OpenPrinter_state
*state
= tevent_req_data(
286 req
, struct rpccli_spoolss_OpenPrinter_state
);
289 if (tevent_req_is_nterror(req
, &status
)) {
290 tevent_req_received(req
);
294 /* Steal possbile out parameters to the callers context */
295 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
298 *result
= state
->orig
.out
.result
;
300 tevent_req_received(req
);
304 NTSTATUS
rpccli_spoolss_OpenPrinter(struct rpc_pipe_client
*cli
,
306 const char *printername
/* [in] [unique,charset(UTF16)] */,
307 const char *datatype
/* [in] [unique,charset(UTF16)] */,
308 struct spoolss_DevmodeContainer devmode_ctr
/* [in] */,
309 uint32_t access_mask
/* [in] */,
310 struct policy_handle
*handle
/* [out] [ref] */,
313 struct spoolss_OpenPrinter r
;
317 r
.in
.printername
= printername
;
318 r
.in
.datatype
= datatype
;
319 r
.in
.devmode_ctr
= devmode_ctr
;
320 r
.in
.access_mask
= access_mask
;
322 status
= cli
->dispatch(cli
,
325 NDR_SPOOLSS_OPENPRINTER
,
328 if (!NT_STATUS_IS_OK(status
)) {
332 if (NT_STATUS_IS_ERR(status
)) {
336 /* Return variables */
337 *handle
= *r
.out
.handle
;
341 *werror
= r
.out
.result
;
344 return werror_to_ntstatus(r
.out
.result
);
347 struct rpccli_spoolss_SetJob_state
{
348 struct spoolss_SetJob orig
;
349 struct spoolss_SetJob tmp
;
350 TALLOC_CTX
*out_mem_ctx
;
351 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
354 static void rpccli_spoolss_SetJob_done(struct tevent_req
*subreq
);
356 struct tevent_req
*rpccli_spoolss_SetJob_send(TALLOC_CTX
*mem_ctx
,
357 struct tevent_context
*ev
,
358 struct rpc_pipe_client
*cli
,
359 struct policy_handle
*_handle
/* [in] [ref] */,
360 uint32_t _job_id
/* [in] */,
361 struct spoolss_JobInfoContainer
*_ctr
/* [in] [unique] */,
362 enum spoolss_JobControl _command
/* [in] */)
364 struct tevent_req
*req
;
365 struct rpccli_spoolss_SetJob_state
*state
;
366 struct tevent_req
*subreq
;
368 req
= tevent_req_create(mem_ctx
, &state
,
369 struct rpccli_spoolss_SetJob_state
);
373 state
->out_mem_ctx
= NULL
;
374 state
->dispatch_recv
= cli
->dispatch_recv
;
377 state
->orig
.in
.handle
= _handle
;
378 state
->orig
.in
.job_id
= _job_id
;
379 state
->orig
.in
.ctr
= _ctr
;
380 state
->orig
.in
.command
= _command
;
385 ZERO_STRUCT(state
->orig
.out
.result
);
387 /* make a temporary copy, that we pass to the dispatch function */
388 state
->tmp
= state
->orig
;
390 subreq
= cli
->dispatch_send(state
, ev
, cli
,
394 if (tevent_req_nomem(subreq
, req
)) {
395 return tevent_req_post(req
, ev
);
397 tevent_req_set_callback(subreq
, rpccli_spoolss_SetJob_done
, req
);
401 static void rpccli_spoolss_SetJob_done(struct tevent_req
*subreq
)
403 struct tevent_req
*req
= tevent_req_callback_data(
404 subreq
, struct tevent_req
);
405 struct rpccli_spoolss_SetJob_state
*state
= tevent_req_data(
406 req
, struct rpccli_spoolss_SetJob_state
);
410 if (state
->out_mem_ctx
) {
411 mem_ctx
= state
->out_mem_ctx
;
416 status
= state
->dispatch_recv(subreq
, mem_ctx
);
418 if (!NT_STATUS_IS_OK(status
)) {
419 tevent_req_nterror(req
, status
);
423 /* Copy out parameters */
426 state
->orig
.out
.result
= state
->tmp
.out
.result
;
428 /* Reset temporary structure */
429 ZERO_STRUCT(state
->tmp
);
431 tevent_req_done(req
);
434 NTSTATUS
rpccli_spoolss_SetJob_recv(struct tevent_req
*req
,
438 struct rpccli_spoolss_SetJob_state
*state
= tevent_req_data(
439 req
, struct rpccli_spoolss_SetJob_state
);
442 if (tevent_req_is_nterror(req
, &status
)) {
443 tevent_req_received(req
);
447 /* Steal possbile out parameters to the callers context */
448 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
451 *result
= state
->orig
.out
.result
;
453 tevent_req_received(req
);
457 NTSTATUS
rpccli_spoolss_SetJob(struct rpc_pipe_client
*cli
,
459 struct policy_handle
*handle
/* [in] [ref] */,
460 uint32_t job_id
/* [in] */,
461 struct spoolss_JobInfoContainer
*ctr
/* [in] [unique] */,
462 enum spoolss_JobControl command
/* [in] */,
465 struct spoolss_SetJob r
;
469 r
.in
.handle
= handle
;
470 r
.in
.job_id
= job_id
;
472 r
.in
.command
= command
;
474 status
= cli
->dispatch(cli
,
480 if (!NT_STATUS_IS_OK(status
)) {
484 if (NT_STATUS_IS_ERR(status
)) {
488 /* Return variables */
492 *werror
= r
.out
.result
;
495 return werror_to_ntstatus(r
.out
.result
);
498 struct rpccli_spoolss_GetJob_state
{
499 struct spoolss_GetJob orig
;
500 struct spoolss_GetJob tmp
;
501 TALLOC_CTX
*out_mem_ctx
;
502 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
505 static void rpccli_spoolss_GetJob_done(struct tevent_req
*subreq
);
507 struct tevent_req
*rpccli_spoolss_GetJob_send(TALLOC_CTX
*mem_ctx
,
508 struct tevent_context
*ev
,
509 struct rpc_pipe_client
*cli
,
510 struct policy_handle
*_handle
/* [in] [ref] */,
511 uint32_t _job_id
/* [in] */,
512 uint32_t _level
/* [in] */,
513 DATA_BLOB
*_buffer
/* [in] [unique] */,
514 uint32_t _offered
/* [in] */,
515 union spoolss_JobInfo
*_info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
516 uint32_t *_needed
/* [out] [ref] */)
518 struct tevent_req
*req
;
519 struct rpccli_spoolss_GetJob_state
*state
;
520 struct tevent_req
*subreq
;
522 req
= tevent_req_create(mem_ctx
, &state
,
523 struct rpccli_spoolss_GetJob_state
);
527 state
->out_mem_ctx
= NULL
;
528 state
->dispatch_recv
= cli
->dispatch_recv
;
531 state
->orig
.in
.handle
= _handle
;
532 state
->orig
.in
.job_id
= _job_id
;
533 state
->orig
.in
.level
= _level
;
534 state
->orig
.in
.buffer
= _buffer
;
535 state
->orig
.in
.offered
= _offered
;
538 state
->orig
.out
.info
= _info
;
539 state
->orig
.out
.needed
= _needed
;
542 ZERO_STRUCT(state
->orig
.out
.result
);
544 state
->out_mem_ctx
= talloc_named_const(state
, 0,
545 "rpccli_spoolss_GetJob_out_memory");
546 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
547 return tevent_req_post(req
, ev
);
550 /* make a temporary copy, that we pass to the dispatch function */
551 state
->tmp
= state
->orig
;
553 subreq
= cli
->dispatch_send(state
, ev
, cli
,
557 if (tevent_req_nomem(subreq
, req
)) {
558 return tevent_req_post(req
, ev
);
560 tevent_req_set_callback(subreq
, rpccli_spoolss_GetJob_done
, req
);
564 static void rpccli_spoolss_GetJob_done(struct tevent_req
*subreq
)
566 struct tevent_req
*req
= tevent_req_callback_data(
567 subreq
, struct tevent_req
);
568 struct rpccli_spoolss_GetJob_state
*state
= tevent_req_data(
569 req
, struct rpccli_spoolss_GetJob_state
);
573 if (state
->out_mem_ctx
) {
574 mem_ctx
= state
->out_mem_ctx
;
579 status
= state
->dispatch_recv(subreq
, mem_ctx
);
581 if (!NT_STATUS_IS_OK(status
)) {
582 tevent_req_nterror(req
, status
);
586 /* Copy out parameters */
587 if (state
->orig
.out
.info
&& state
->tmp
.out
.info
) {
588 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
590 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
593 state
->orig
.out
.result
= state
->tmp
.out
.result
;
595 /* Reset temporary structure */
596 ZERO_STRUCT(state
->tmp
);
598 tevent_req_done(req
);
601 NTSTATUS
rpccli_spoolss_GetJob_recv(struct tevent_req
*req
,
605 struct rpccli_spoolss_GetJob_state
*state
= tevent_req_data(
606 req
, struct rpccli_spoolss_GetJob_state
);
609 if (tevent_req_is_nterror(req
, &status
)) {
610 tevent_req_received(req
);
614 /* Steal possbile out parameters to the callers context */
615 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
618 *result
= state
->orig
.out
.result
;
620 tevent_req_received(req
);
624 NTSTATUS
rpccli_spoolss_GetJob(struct rpc_pipe_client
*cli
,
626 struct policy_handle
*handle
/* [in] [ref] */,
627 uint32_t job_id
/* [in] */,
628 uint32_t level
/* [in] */,
629 DATA_BLOB
*buffer
/* [in] [unique] */,
630 uint32_t offered
/* [in] */,
631 union spoolss_JobInfo
*info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
632 uint32_t *needed
/* [out] [ref] */,
635 struct spoolss_GetJob r
;
639 r
.in
.handle
= handle
;
640 r
.in
.job_id
= job_id
;
642 r
.in
.buffer
= buffer
;
643 r
.in
.offered
= offered
;
645 status
= cli
->dispatch(cli
,
651 if (!NT_STATUS_IS_OK(status
)) {
655 if (NT_STATUS_IS_ERR(status
)) {
659 /* Return variables */
660 if (info
&& r
.out
.info
) {
663 *needed
= *r
.out
.needed
;
667 *werror
= r
.out
.result
;
670 return werror_to_ntstatus(r
.out
.result
);
673 struct rpccli_spoolss_EnumJobs_state
{
674 struct spoolss_EnumJobs orig
;
675 struct spoolss_EnumJobs tmp
;
676 TALLOC_CTX
*out_mem_ctx
;
677 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
680 static void rpccli_spoolss_EnumJobs_done(struct tevent_req
*subreq
);
682 struct tevent_req
*rpccli_spoolss_EnumJobs_send(TALLOC_CTX
*mem_ctx
,
683 struct tevent_context
*ev
,
684 struct rpc_pipe_client
*cli
,
685 struct policy_handle
*_handle
/* [in] [ref] */,
686 uint32_t _firstjob
/* [in] */,
687 uint32_t _numjobs
/* [in] */,
688 uint32_t _level
/* [in] */,
689 DATA_BLOB
*_buffer
/* [in] [unique] */,
690 uint32_t _offered
/* [in] */,
691 uint32_t *_count
/* [out] [ref] */,
692 union spoolss_JobInfo
**_info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
693 uint32_t *_needed
/* [out] [ref] */)
695 struct tevent_req
*req
;
696 struct rpccli_spoolss_EnumJobs_state
*state
;
697 struct tevent_req
*subreq
;
699 req
= tevent_req_create(mem_ctx
, &state
,
700 struct rpccli_spoolss_EnumJobs_state
);
704 state
->out_mem_ctx
= NULL
;
705 state
->dispatch_recv
= cli
->dispatch_recv
;
708 state
->orig
.in
.handle
= _handle
;
709 state
->orig
.in
.firstjob
= _firstjob
;
710 state
->orig
.in
.numjobs
= _numjobs
;
711 state
->orig
.in
.level
= _level
;
712 state
->orig
.in
.buffer
= _buffer
;
713 state
->orig
.in
.offered
= _offered
;
716 state
->orig
.out
.count
= _count
;
717 state
->orig
.out
.info
= _info
;
718 state
->orig
.out
.needed
= _needed
;
721 ZERO_STRUCT(state
->orig
.out
.result
);
723 state
->out_mem_ctx
= talloc_named_const(state
, 0,
724 "rpccli_spoolss_EnumJobs_out_memory");
725 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
726 return tevent_req_post(req
, ev
);
729 /* make a temporary copy, that we pass to the dispatch function */
730 state
->tmp
= state
->orig
;
732 subreq
= cli
->dispatch_send(state
, ev
, cli
,
734 NDR_SPOOLSS_ENUMJOBS
,
736 if (tevent_req_nomem(subreq
, req
)) {
737 return tevent_req_post(req
, ev
);
739 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumJobs_done
, req
);
743 static void rpccli_spoolss_EnumJobs_done(struct tevent_req
*subreq
)
745 struct tevent_req
*req
= tevent_req_callback_data(
746 subreq
, struct tevent_req
);
747 struct rpccli_spoolss_EnumJobs_state
*state
= tevent_req_data(
748 req
, struct rpccli_spoolss_EnumJobs_state
);
752 if (state
->out_mem_ctx
) {
753 mem_ctx
= state
->out_mem_ctx
;
758 status
= state
->dispatch_recv(subreq
, mem_ctx
);
760 if (!NT_STATUS_IS_OK(status
)) {
761 tevent_req_nterror(req
, status
);
765 /* Copy out parameters */
766 *state
->orig
.out
.count
= *state
->tmp
.out
.count
;
767 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
768 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
771 state
->orig
.out
.result
= state
->tmp
.out
.result
;
773 /* Reset temporary structure */
774 ZERO_STRUCT(state
->tmp
);
776 tevent_req_done(req
);
779 NTSTATUS
rpccli_spoolss_EnumJobs_recv(struct tevent_req
*req
,
783 struct rpccli_spoolss_EnumJobs_state
*state
= tevent_req_data(
784 req
, struct rpccli_spoolss_EnumJobs_state
);
787 if (tevent_req_is_nterror(req
, &status
)) {
788 tevent_req_received(req
);
792 /* Steal possbile out parameters to the callers context */
793 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
796 *result
= state
->orig
.out
.result
;
798 tevent_req_received(req
);
802 NTSTATUS
rpccli_spoolss_EnumJobs(struct rpc_pipe_client
*cli
,
804 struct policy_handle
*handle
/* [in] [ref] */,
805 uint32_t firstjob
/* [in] */,
806 uint32_t numjobs
/* [in] */,
807 uint32_t level
/* [in] */,
808 DATA_BLOB
*buffer
/* [in] [unique] */,
809 uint32_t offered
/* [in] */,
810 uint32_t *count
/* [out] [ref] */,
811 union spoolss_JobInfo
**info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
812 uint32_t *needed
/* [out] [ref] */,
815 struct spoolss_EnumJobs r
;
819 r
.in
.handle
= handle
;
820 r
.in
.firstjob
= firstjob
;
821 r
.in
.numjobs
= numjobs
;
823 r
.in
.buffer
= buffer
;
824 r
.in
.offered
= offered
;
826 status
= cli
->dispatch(cli
,
829 NDR_SPOOLSS_ENUMJOBS
,
832 if (!NT_STATUS_IS_OK(status
)) {
836 if (NT_STATUS_IS_ERR(status
)) {
840 /* Return variables */
841 *count
= *r
.out
.count
;
843 *needed
= *r
.out
.needed
;
847 *werror
= r
.out
.result
;
850 return werror_to_ntstatus(r
.out
.result
);
853 struct rpccli_spoolss_AddPrinter_state
{
854 struct spoolss_AddPrinter orig
;
855 struct spoolss_AddPrinter tmp
;
856 TALLOC_CTX
*out_mem_ctx
;
857 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
860 static void rpccli_spoolss_AddPrinter_done(struct tevent_req
*subreq
);
862 struct tevent_req
*rpccli_spoolss_AddPrinter_send(TALLOC_CTX
*mem_ctx
,
863 struct tevent_context
*ev
,
864 struct rpc_pipe_client
*cli
,
865 const char *_server
/* [in] [unique,charset(UTF16)] */,
866 struct spoolss_SetPrinterInfoCtr
*_info_ctr
/* [in] [ref] */,
867 struct spoolss_DevmodeContainer
*_devmode_ctr
/* [in] [ref] */,
868 struct sec_desc_buf
*_secdesc_ctr
/* [in] [ref] */,
869 struct policy_handle
*_handle
/* [out] [ref] */)
871 struct tevent_req
*req
;
872 struct rpccli_spoolss_AddPrinter_state
*state
;
873 struct tevent_req
*subreq
;
875 req
= tevent_req_create(mem_ctx
, &state
,
876 struct rpccli_spoolss_AddPrinter_state
);
880 state
->out_mem_ctx
= NULL
;
881 state
->dispatch_recv
= cli
->dispatch_recv
;
884 state
->orig
.in
.server
= _server
;
885 state
->orig
.in
.info_ctr
= _info_ctr
;
886 state
->orig
.in
.devmode_ctr
= _devmode_ctr
;
887 state
->orig
.in
.secdesc_ctr
= _secdesc_ctr
;
890 state
->orig
.out
.handle
= _handle
;
893 ZERO_STRUCT(state
->orig
.out
.result
);
895 state
->out_mem_ctx
= talloc_named_const(state
, 0,
896 "rpccli_spoolss_AddPrinter_out_memory");
897 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
898 return tevent_req_post(req
, ev
);
901 /* make a temporary copy, that we pass to the dispatch function */
902 state
->tmp
= state
->orig
;
904 subreq
= cli
->dispatch_send(state
, ev
, cli
,
906 NDR_SPOOLSS_ADDPRINTER
,
908 if (tevent_req_nomem(subreq
, req
)) {
909 return tevent_req_post(req
, ev
);
911 tevent_req_set_callback(subreq
, rpccli_spoolss_AddPrinter_done
, req
);
915 static void rpccli_spoolss_AddPrinter_done(struct tevent_req
*subreq
)
917 struct tevent_req
*req
= tevent_req_callback_data(
918 subreq
, struct tevent_req
);
919 struct rpccli_spoolss_AddPrinter_state
*state
= tevent_req_data(
920 req
, struct rpccli_spoolss_AddPrinter_state
);
924 if (state
->out_mem_ctx
) {
925 mem_ctx
= state
->out_mem_ctx
;
930 status
= state
->dispatch_recv(subreq
, mem_ctx
);
932 if (!NT_STATUS_IS_OK(status
)) {
933 tevent_req_nterror(req
, status
);
937 /* Copy out parameters */
938 *state
->orig
.out
.handle
= *state
->tmp
.out
.handle
;
941 state
->orig
.out
.result
= state
->tmp
.out
.result
;
943 /* Reset temporary structure */
944 ZERO_STRUCT(state
->tmp
);
946 tevent_req_done(req
);
949 NTSTATUS
rpccli_spoolss_AddPrinter_recv(struct tevent_req
*req
,
953 struct rpccli_spoolss_AddPrinter_state
*state
= tevent_req_data(
954 req
, struct rpccli_spoolss_AddPrinter_state
);
957 if (tevent_req_is_nterror(req
, &status
)) {
958 tevent_req_received(req
);
962 /* Steal possbile out parameters to the callers context */
963 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
966 *result
= state
->orig
.out
.result
;
968 tevent_req_received(req
);
972 NTSTATUS
rpccli_spoolss_AddPrinter(struct rpc_pipe_client
*cli
,
974 const char *server
/* [in] [unique,charset(UTF16)] */,
975 struct spoolss_SetPrinterInfoCtr
*info_ctr
/* [in] [ref] */,
976 struct spoolss_DevmodeContainer
*devmode_ctr
/* [in] [ref] */,
977 struct sec_desc_buf
*secdesc_ctr
/* [in] [ref] */,
978 struct policy_handle
*handle
/* [out] [ref] */,
981 struct spoolss_AddPrinter r
;
985 r
.in
.server
= server
;
986 r
.in
.info_ctr
= info_ctr
;
987 r
.in
.devmode_ctr
= devmode_ctr
;
988 r
.in
.secdesc_ctr
= secdesc_ctr
;
990 status
= cli
->dispatch(cli
,
993 NDR_SPOOLSS_ADDPRINTER
,
996 if (!NT_STATUS_IS_OK(status
)) {
1000 if (NT_STATUS_IS_ERR(status
)) {
1004 /* Return variables */
1005 *handle
= *r
.out
.handle
;
1009 *werror
= r
.out
.result
;
1012 return werror_to_ntstatus(r
.out
.result
);
1015 struct rpccli_spoolss_DeletePrinter_state
{
1016 struct spoolss_DeletePrinter orig
;
1017 struct spoolss_DeletePrinter tmp
;
1018 TALLOC_CTX
*out_mem_ctx
;
1019 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1022 static void rpccli_spoolss_DeletePrinter_done(struct tevent_req
*subreq
);
1024 struct tevent_req
*rpccli_spoolss_DeletePrinter_send(TALLOC_CTX
*mem_ctx
,
1025 struct tevent_context
*ev
,
1026 struct rpc_pipe_client
*cli
,
1027 struct policy_handle
*_handle
/* [in] [ref] */)
1029 struct tevent_req
*req
;
1030 struct rpccli_spoolss_DeletePrinter_state
*state
;
1031 struct tevent_req
*subreq
;
1033 req
= tevent_req_create(mem_ctx
, &state
,
1034 struct rpccli_spoolss_DeletePrinter_state
);
1038 state
->out_mem_ctx
= NULL
;
1039 state
->dispatch_recv
= cli
->dispatch_recv
;
1042 state
->orig
.in
.handle
= _handle
;
1044 /* Out parameters */
1047 ZERO_STRUCT(state
->orig
.out
.result
);
1049 /* make a temporary copy, that we pass to the dispatch function */
1050 state
->tmp
= state
->orig
;
1052 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1054 NDR_SPOOLSS_DELETEPRINTER
,
1056 if (tevent_req_nomem(subreq
, req
)) {
1057 return tevent_req_post(req
, ev
);
1059 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePrinter_done
, req
);
1063 static void rpccli_spoolss_DeletePrinter_done(struct tevent_req
*subreq
)
1065 struct tevent_req
*req
= tevent_req_callback_data(
1066 subreq
, struct tevent_req
);
1067 struct rpccli_spoolss_DeletePrinter_state
*state
= tevent_req_data(
1068 req
, struct rpccli_spoolss_DeletePrinter_state
);
1070 TALLOC_CTX
*mem_ctx
;
1072 if (state
->out_mem_ctx
) {
1073 mem_ctx
= state
->out_mem_ctx
;
1078 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1079 TALLOC_FREE(subreq
);
1080 if (!NT_STATUS_IS_OK(status
)) {
1081 tevent_req_nterror(req
, status
);
1085 /* Copy out parameters */
1088 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1090 /* Reset temporary structure */
1091 ZERO_STRUCT(state
->tmp
);
1093 tevent_req_done(req
);
1096 NTSTATUS
rpccli_spoolss_DeletePrinter_recv(struct tevent_req
*req
,
1097 TALLOC_CTX
*mem_ctx
,
1100 struct rpccli_spoolss_DeletePrinter_state
*state
= tevent_req_data(
1101 req
, struct rpccli_spoolss_DeletePrinter_state
);
1104 if (tevent_req_is_nterror(req
, &status
)) {
1105 tevent_req_received(req
);
1109 /* Steal possbile out parameters to the callers context */
1110 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1113 *result
= state
->orig
.out
.result
;
1115 tevent_req_received(req
);
1116 return NT_STATUS_OK
;
1119 NTSTATUS
rpccli_spoolss_DeletePrinter(struct rpc_pipe_client
*cli
,
1120 TALLOC_CTX
*mem_ctx
,
1121 struct policy_handle
*handle
/* [in] [ref] */,
1124 struct spoolss_DeletePrinter r
;
1128 r
.in
.handle
= handle
;
1130 status
= cli
->dispatch(cli
,
1133 NDR_SPOOLSS_DELETEPRINTER
,
1136 if (!NT_STATUS_IS_OK(status
)) {
1140 if (NT_STATUS_IS_ERR(status
)) {
1144 /* Return variables */
1148 *werror
= r
.out
.result
;
1151 return werror_to_ntstatus(r
.out
.result
);
1154 struct rpccli_spoolss_SetPrinter_state
{
1155 struct spoolss_SetPrinter orig
;
1156 struct spoolss_SetPrinter tmp
;
1157 TALLOC_CTX
*out_mem_ctx
;
1158 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1161 static void rpccli_spoolss_SetPrinter_done(struct tevent_req
*subreq
);
1163 struct tevent_req
*rpccli_spoolss_SetPrinter_send(TALLOC_CTX
*mem_ctx
,
1164 struct tevent_context
*ev
,
1165 struct rpc_pipe_client
*cli
,
1166 struct policy_handle
*_handle
/* [in] [ref] */,
1167 struct spoolss_SetPrinterInfoCtr
*_info_ctr
/* [in] [ref] */,
1168 struct spoolss_DevmodeContainer
*_devmode_ctr
/* [in] [ref] */,
1169 struct sec_desc_buf
*_secdesc_ctr
/* [in] [ref] */,
1170 enum spoolss_PrinterControl _command
/* [in] */)
1172 struct tevent_req
*req
;
1173 struct rpccli_spoolss_SetPrinter_state
*state
;
1174 struct tevent_req
*subreq
;
1176 req
= tevent_req_create(mem_ctx
, &state
,
1177 struct rpccli_spoolss_SetPrinter_state
);
1181 state
->out_mem_ctx
= NULL
;
1182 state
->dispatch_recv
= cli
->dispatch_recv
;
1185 state
->orig
.in
.handle
= _handle
;
1186 state
->orig
.in
.info_ctr
= _info_ctr
;
1187 state
->orig
.in
.devmode_ctr
= _devmode_ctr
;
1188 state
->orig
.in
.secdesc_ctr
= _secdesc_ctr
;
1189 state
->orig
.in
.command
= _command
;
1191 /* Out parameters */
1194 ZERO_STRUCT(state
->orig
.out
.result
);
1196 /* make a temporary copy, that we pass to the dispatch function */
1197 state
->tmp
= state
->orig
;
1199 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1201 NDR_SPOOLSS_SETPRINTER
,
1203 if (tevent_req_nomem(subreq
, req
)) {
1204 return tevent_req_post(req
, ev
);
1206 tevent_req_set_callback(subreq
, rpccli_spoolss_SetPrinter_done
, req
);
1210 static void rpccli_spoolss_SetPrinter_done(struct tevent_req
*subreq
)
1212 struct tevent_req
*req
= tevent_req_callback_data(
1213 subreq
, struct tevent_req
);
1214 struct rpccli_spoolss_SetPrinter_state
*state
= tevent_req_data(
1215 req
, struct rpccli_spoolss_SetPrinter_state
);
1217 TALLOC_CTX
*mem_ctx
;
1219 if (state
->out_mem_ctx
) {
1220 mem_ctx
= state
->out_mem_ctx
;
1225 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1226 TALLOC_FREE(subreq
);
1227 if (!NT_STATUS_IS_OK(status
)) {
1228 tevent_req_nterror(req
, status
);
1232 /* Copy out parameters */
1235 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1237 /* Reset temporary structure */
1238 ZERO_STRUCT(state
->tmp
);
1240 tevent_req_done(req
);
1243 NTSTATUS
rpccli_spoolss_SetPrinter_recv(struct tevent_req
*req
,
1244 TALLOC_CTX
*mem_ctx
,
1247 struct rpccli_spoolss_SetPrinter_state
*state
= tevent_req_data(
1248 req
, struct rpccli_spoolss_SetPrinter_state
);
1251 if (tevent_req_is_nterror(req
, &status
)) {
1252 tevent_req_received(req
);
1256 /* Steal possbile out parameters to the callers context */
1257 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1260 *result
= state
->orig
.out
.result
;
1262 tevent_req_received(req
);
1263 return NT_STATUS_OK
;
1266 NTSTATUS
rpccli_spoolss_SetPrinter(struct rpc_pipe_client
*cli
,
1267 TALLOC_CTX
*mem_ctx
,
1268 struct policy_handle
*handle
/* [in] [ref] */,
1269 struct spoolss_SetPrinterInfoCtr
*info_ctr
/* [in] [ref] */,
1270 struct spoolss_DevmodeContainer
*devmode_ctr
/* [in] [ref] */,
1271 struct sec_desc_buf
*secdesc_ctr
/* [in] [ref] */,
1272 enum spoolss_PrinterControl command
/* [in] */,
1275 struct spoolss_SetPrinter r
;
1279 r
.in
.handle
= handle
;
1280 r
.in
.info_ctr
= info_ctr
;
1281 r
.in
.devmode_ctr
= devmode_ctr
;
1282 r
.in
.secdesc_ctr
= secdesc_ctr
;
1283 r
.in
.command
= command
;
1285 status
= cli
->dispatch(cli
,
1288 NDR_SPOOLSS_SETPRINTER
,
1291 if (!NT_STATUS_IS_OK(status
)) {
1295 if (NT_STATUS_IS_ERR(status
)) {
1299 /* Return variables */
1303 *werror
= r
.out
.result
;
1306 return werror_to_ntstatus(r
.out
.result
);
1309 struct rpccli_spoolss_GetPrinter_state
{
1310 struct spoolss_GetPrinter orig
;
1311 struct spoolss_GetPrinter tmp
;
1312 TALLOC_CTX
*out_mem_ctx
;
1313 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1316 static void rpccli_spoolss_GetPrinter_done(struct tevent_req
*subreq
);
1318 struct tevent_req
*rpccli_spoolss_GetPrinter_send(TALLOC_CTX
*mem_ctx
,
1319 struct tevent_context
*ev
,
1320 struct rpc_pipe_client
*cli
,
1321 struct policy_handle
*_handle
/* [in] [ref] */,
1322 uint32_t _level
/* [in] */,
1323 DATA_BLOB
*_buffer
/* [in] [unique] */,
1324 uint32_t _offered
/* [in] */,
1325 union spoolss_PrinterInfo
*_info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1326 uint32_t *_needed
/* [out] [ref] */)
1328 struct tevent_req
*req
;
1329 struct rpccli_spoolss_GetPrinter_state
*state
;
1330 struct tevent_req
*subreq
;
1332 req
= tevent_req_create(mem_ctx
, &state
,
1333 struct rpccli_spoolss_GetPrinter_state
);
1337 state
->out_mem_ctx
= NULL
;
1338 state
->dispatch_recv
= cli
->dispatch_recv
;
1341 state
->orig
.in
.handle
= _handle
;
1342 state
->orig
.in
.level
= _level
;
1343 state
->orig
.in
.buffer
= _buffer
;
1344 state
->orig
.in
.offered
= _offered
;
1346 /* Out parameters */
1347 state
->orig
.out
.info
= _info
;
1348 state
->orig
.out
.needed
= _needed
;
1351 ZERO_STRUCT(state
->orig
.out
.result
);
1353 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1354 "rpccli_spoolss_GetPrinter_out_memory");
1355 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1356 return tevent_req_post(req
, ev
);
1359 /* make a temporary copy, that we pass to the dispatch function */
1360 state
->tmp
= state
->orig
;
1362 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1364 NDR_SPOOLSS_GETPRINTER
,
1366 if (tevent_req_nomem(subreq
, req
)) {
1367 return tevent_req_post(req
, ev
);
1369 tevent_req_set_callback(subreq
, rpccli_spoolss_GetPrinter_done
, req
);
1373 static void rpccli_spoolss_GetPrinter_done(struct tevent_req
*subreq
)
1375 struct tevent_req
*req
= tevent_req_callback_data(
1376 subreq
, struct tevent_req
);
1377 struct rpccli_spoolss_GetPrinter_state
*state
= tevent_req_data(
1378 req
, struct rpccli_spoolss_GetPrinter_state
);
1380 TALLOC_CTX
*mem_ctx
;
1382 if (state
->out_mem_ctx
) {
1383 mem_ctx
= state
->out_mem_ctx
;
1388 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1389 TALLOC_FREE(subreq
);
1390 if (!NT_STATUS_IS_OK(status
)) {
1391 tevent_req_nterror(req
, status
);
1395 /* Copy out parameters */
1396 if (state
->orig
.out
.info
&& state
->tmp
.out
.info
) {
1397 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
1399 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
1402 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1404 /* Reset temporary structure */
1405 ZERO_STRUCT(state
->tmp
);
1407 tevent_req_done(req
);
1410 NTSTATUS
rpccli_spoolss_GetPrinter_recv(struct tevent_req
*req
,
1411 TALLOC_CTX
*mem_ctx
,
1414 struct rpccli_spoolss_GetPrinter_state
*state
= tevent_req_data(
1415 req
, struct rpccli_spoolss_GetPrinter_state
);
1418 if (tevent_req_is_nterror(req
, &status
)) {
1419 tevent_req_received(req
);
1423 /* Steal possbile out parameters to the callers context */
1424 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1427 *result
= state
->orig
.out
.result
;
1429 tevent_req_received(req
);
1430 return NT_STATUS_OK
;
1433 NTSTATUS
rpccli_spoolss_GetPrinter(struct rpc_pipe_client
*cli
,
1434 TALLOC_CTX
*mem_ctx
,
1435 struct policy_handle
*handle
/* [in] [ref] */,
1436 uint32_t level
/* [in] */,
1437 DATA_BLOB
*buffer
/* [in] [unique] */,
1438 uint32_t offered
/* [in] */,
1439 union spoolss_PrinterInfo
*info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1440 uint32_t *needed
/* [out] [ref] */,
1443 struct spoolss_GetPrinter r
;
1447 r
.in
.handle
= handle
;
1449 r
.in
.buffer
= buffer
;
1450 r
.in
.offered
= offered
;
1452 status
= cli
->dispatch(cli
,
1455 NDR_SPOOLSS_GETPRINTER
,
1458 if (!NT_STATUS_IS_OK(status
)) {
1462 if (NT_STATUS_IS_ERR(status
)) {
1466 /* Return variables */
1467 if (info
&& r
.out
.info
) {
1468 *info
= *r
.out
.info
;
1470 *needed
= *r
.out
.needed
;
1474 *werror
= r
.out
.result
;
1477 return werror_to_ntstatus(r
.out
.result
);
1480 struct rpccli_spoolss_AddPrinterDriver_state
{
1481 struct spoolss_AddPrinterDriver orig
;
1482 struct spoolss_AddPrinterDriver tmp
;
1483 TALLOC_CTX
*out_mem_ctx
;
1484 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1487 static void rpccli_spoolss_AddPrinterDriver_done(struct tevent_req
*subreq
);
1489 struct tevent_req
*rpccli_spoolss_AddPrinterDriver_send(TALLOC_CTX
*mem_ctx
,
1490 struct tevent_context
*ev
,
1491 struct rpc_pipe_client
*cli
,
1492 const char *_servername
/* [in] [unique,charset(UTF16)] */,
1493 struct spoolss_AddDriverInfoCtr
*_info_ctr
/* [in] [ref] */)
1495 struct tevent_req
*req
;
1496 struct rpccli_spoolss_AddPrinterDriver_state
*state
;
1497 struct tevent_req
*subreq
;
1499 req
= tevent_req_create(mem_ctx
, &state
,
1500 struct rpccli_spoolss_AddPrinterDriver_state
);
1504 state
->out_mem_ctx
= NULL
;
1505 state
->dispatch_recv
= cli
->dispatch_recv
;
1508 state
->orig
.in
.servername
= _servername
;
1509 state
->orig
.in
.info_ctr
= _info_ctr
;
1511 /* Out parameters */
1514 ZERO_STRUCT(state
->orig
.out
.result
);
1516 /* make a temporary copy, that we pass to the dispatch function */
1517 state
->tmp
= state
->orig
;
1519 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1521 NDR_SPOOLSS_ADDPRINTERDRIVER
,
1523 if (tevent_req_nomem(subreq
, req
)) {
1524 return tevent_req_post(req
, ev
);
1526 tevent_req_set_callback(subreq
, rpccli_spoolss_AddPrinterDriver_done
, req
);
1530 static void rpccli_spoolss_AddPrinterDriver_done(struct tevent_req
*subreq
)
1532 struct tevent_req
*req
= tevent_req_callback_data(
1533 subreq
, struct tevent_req
);
1534 struct rpccli_spoolss_AddPrinterDriver_state
*state
= tevent_req_data(
1535 req
, struct rpccli_spoolss_AddPrinterDriver_state
);
1537 TALLOC_CTX
*mem_ctx
;
1539 if (state
->out_mem_ctx
) {
1540 mem_ctx
= state
->out_mem_ctx
;
1545 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1546 TALLOC_FREE(subreq
);
1547 if (!NT_STATUS_IS_OK(status
)) {
1548 tevent_req_nterror(req
, status
);
1552 /* Copy out parameters */
1555 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1557 /* Reset temporary structure */
1558 ZERO_STRUCT(state
->tmp
);
1560 tevent_req_done(req
);
1563 NTSTATUS
rpccli_spoolss_AddPrinterDriver_recv(struct tevent_req
*req
,
1564 TALLOC_CTX
*mem_ctx
,
1567 struct rpccli_spoolss_AddPrinterDriver_state
*state
= tevent_req_data(
1568 req
, struct rpccli_spoolss_AddPrinterDriver_state
);
1571 if (tevent_req_is_nterror(req
, &status
)) {
1572 tevent_req_received(req
);
1576 /* Steal possbile out parameters to the callers context */
1577 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1580 *result
= state
->orig
.out
.result
;
1582 tevent_req_received(req
);
1583 return NT_STATUS_OK
;
1586 NTSTATUS
rpccli_spoolss_AddPrinterDriver(struct rpc_pipe_client
*cli
,
1587 TALLOC_CTX
*mem_ctx
,
1588 const char *servername
/* [in] [unique,charset(UTF16)] */,
1589 struct spoolss_AddDriverInfoCtr
*info_ctr
/* [in] [ref] */,
1592 struct spoolss_AddPrinterDriver r
;
1596 r
.in
.servername
= servername
;
1597 r
.in
.info_ctr
= info_ctr
;
1599 status
= cli
->dispatch(cli
,
1602 NDR_SPOOLSS_ADDPRINTERDRIVER
,
1605 if (!NT_STATUS_IS_OK(status
)) {
1609 if (NT_STATUS_IS_ERR(status
)) {
1613 /* Return variables */
1617 *werror
= r
.out
.result
;
1620 return werror_to_ntstatus(r
.out
.result
);
1623 struct rpccli_spoolss_EnumPrinterDrivers_state
{
1624 struct spoolss_EnumPrinterDrivers orig
;
1625 struct spoolss_EnumPrinterDrivers tmp
;
1626 TALLOC_CTX
*out_mem_ctx
;
1627 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1630 static void rpccli_spoolss_EnumPrinterDrivers_done(struct tevent_req
*subreq
);
1632 struct tevent_req
*rpccli_spoolss_EnumPrinterDrivers_send(TALLOC_CTX
*mem_ctx
,
1633 struct tevent_context
*ev
,
1634 struct rpc_pipe_client
*cli
,
1635 const char *_server
/* [in] [unique,charset(UTF16)] */,
1636 const char *_environment
/* [in] [unique,charset(UTF16)] */,
1637 uint32_t _level
/* [in] */,
1638 DATA_BLOB
*_buffer
/* [in] [unique] */,
1639 uint32_t _offered
/* [in] */,
1640 uint32_t *_count
/* [out] [ref] */,
1641 union spoolss_DriverInfo
**_info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
1642 uint32_t *_needed
/* [out] [ref] */)
1644 struct tevent_req
*req
;
1645 struct rpccli_spoolss_EnumPrinterDrivers_state
*state
;
1646 struct tevent_req
*subreq
;
1648 req
= tevent_req_create(mem_ctx
, &state
,
1649 struct rpccli_spoolss_EnumPrinterDrivers_state
);
1653 state
->out_mem_ctx
= NULL
;
1654 state
->dispatch_recv
= cli
->dispatch_recv
;
1657 state
->orig
.in
.server
= _server
;
1658 state
->orig
.in
.environment
= _environment
;
1659 state
->orig
.in
.level
= _level
;
1660 state
->orig
.in
.buffer
= _buffer
;
1661 state
->orig
.in
.offered
= _offered
;
1663 /* Out parameters */
1664 state
->orig
.out
.count
= _count
;
1665 state
->orig
.out
.info
= _info
;
1666 state
->orig
.out
.needed
= _needed
;
1669 ZERO_STRUCT(state
->orig
.out
.result
);
1671 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1672 "rpccli_spoolss_EnumPrinterDrivers_out_memory");
1673 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1674 return tevent_req_post(req
, ev
);
1677 /* make a temporary copy, that we pass to the dispatch function */
1678 state
->tmp
= state
->orig
;
1680 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1682 NDR_SPOOLSS_ENUMPRINTERDRIVERS
,
1684 if (tevent_req_nomem(subreq
, req
)) {
1685 return tevent_req_post(req
, ev
);
1687 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumPrinterDrivers_done
, req
);
1691 static void rpccli_spoolss_EnumPrinterDrivers_done(struct tevent_req
*subreq
)
1693 struct tevent_req
*req
= tevent_req_callback_data(
1694 subreq
, struct tevent_req
);
1695 struct rpccli_spoolss_EnumPrinterDrivers_state
*state
= tevent_req_data(
1696 req
, struct rpccli_spoolss_EnumPrinterDrivers_state
);
1698 TALLOC_CTX
*mem_ctx
;
1700 if (state
->out_mem_ctx
) {
1701 mem_ctx
= state
->out_mem_ctx
;
1706 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1707 TALLOC_FREE(subreq
);
1708 if (!NT_STATUS_IS_OK(status
)) {
1709 tevent_req_nterror(req
, status
);
1713 /* Copy out parameters */
1714 *state
->orig
.out
.count
= *state
->tmp
.out
.count
;
1715 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
1716 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
1719 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1721 /* Reset temporary structure */
1722 ZERO_STRUCT(state
->tmp
);
1724 tevent_req_done(req
);
1727 NTSTATUS
rpccli_spoolss_EnumPrinterDrivers_recv(struct tevent_req
*req
,
1728 TALLOC_CTX
*mem_ctx
,
1731 struct rpccli_spoolss_EnumPrinterDrivers_state
*state
= tevent_req_data(
1732 req
, struct rpccli_spoolss_EnumPrinterDrivers_state
);
1735 if (tevent_req_is_nterror(req
, &status
)) {
1736 tevent_req_received(req
);
1740 /* Steal possbile out parameters to the callers context */
1741 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1744 *result
= state
->orig
.out
.result
;
1746 tevent_req_received(req
);
1747 return NT_STATUS_OK
;
1750 NTSTATUS
rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client
*cli
,
1751 TALLOC_CTX
*mem_ctx
,
1752 const char *server
/* [in] [unique,charset(UTF16)] */,
1753 const char *environment
/* [in] [unique,charset(UTF16)] */,
1754 uint32_t level
/* [in] */,
1755 DATA_BLOB
*buffer
/* [in] [unique] */,
1756 uint32_t offered
/* [in] */,
1757 uint32_t *count
/* [out] [ref] */,
1758 union spoolss_DriverInfo
**info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
1759 uint32_t *needed
/* [out] [ref] */,
1762 struct spoolss_EnumPrinterDrivers r
;
1766 r
.in
.server
= server
;
1767 r
.in
.environment
= environment
;
1769 r
.in
.buffer
= buffer
;
1770 r
.in
.offered
= offered
;
1772 status
= cli
->dispatch(cli
,
1775 NDR_SPOOLSS_ENUMPRINTERDRIVERS
,
1778 if (!NT_STATUS_IS_OK(status
)) {
1782 if (NT_STATUS_IS_ERR(status
)) {
1786 /* Return variables */
1787 *count
= *r
.out
.count
;
1788 *info
= *r
.out
.info
;
1789 *needed
= *r
.out
.needed
;
1793 *werror
= r
.out
.result
;
1796 return werror_to_ntstatus(r
.out
.result
);
1799 struct rpccli_spoolss_GetPrinterDriver_state
{
1800 struct spoolss_GetPrinterDriver orig
;
1801 struct spoolss_GetPrinterDriver tmp
;
1802 TALLOC_CTX
*out_mem_ctx
;
1803 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1806 static void rpccli_spoolss_GetPrinterDriver_done(struct tevent_req
*subreq
);
1808 struct tevent_req
*rpccli_spoolss_GetPrinterDriver_send(TALLOC_CTX
*mem_ctx
,
1809 struct tevent_context
*ev
,
1810 struct rpc_pipe_client
*cli
,
1811 struct policy_handle
*_handle
/* [in] [ref] */,
1812 const char *_architecture
/* [in] [unique,charset(UTF16)] */,
1813 uint32_t _level
/* [in] */,
1814 DATA_BLOB
*_buffer
/* [in] [unique] */,
1815 uint32_t _offered
/* [in] */,
1816 union spoolss_DriverInfo
*_info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1817 uint32_t *_needed
/* [out] [ref] */)
1819 struct tevent_req
*req
;
1820 struct rpccli_spoolss_GetPrinterDriver_state
*state
;
1821 struct tevent_req
*subreq
;
1823 req
= tevent_req_create(mem_ctx
, &state
,
1824 struct rpccli_spoolss_GetPrinterDriver_state
);
1828 state
->out_mem_ctx
= NULL
;
1829 state
->dispatch_recv
= cli
->dispatch_recv
;
1832 state
->orig
.in
.handle
= _handle
;
1833 state
->orig
.in
.architecture
= _architecture
;
1834 state
->orig
.in
.level
= _level
;
1835 state
->orig
.in
.buffer
= _buffer
;
1836 state
->orig
.in
.offered
= _offered
;
1838 /* Out parameters */
1839 state
->orig
.out
.info
= _info
;
1840 state
->orig
.out
.needed
= _needed
;
1843 ZERO_STRUCT(state
->orig
.out
.result
);
1845 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1846 "rpccli_spoolss_GetPrinterDriver_out_memory");
1847 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1848 return tevent_req_post(req
, ev
);
1851 /* make a temporary copy, that we pass to the dispatch function */
1852 state
->tmp
= state
->orig
;
1854 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1856 NDR_SPOOLSS_GETPRINTERDRIVER
,
1858 if (tevent_req_nomem(subreq
, req
)) {
1859 return tevent_req_post(req
, ev
);
1861 tevent_req_set_callback(subreq
, rpccli_spoolss_GetPrinterDriver_done
, req
);
1865 static void rpccli_spoolss_GetPrinterDriver_done(struct tevent_req
*subreq
)
1867 struct tevent_req
*req
= tevent_req_callback_data(
1868 subreq
, struct tevent_req
);
1869 struct rpccli_spoolss_GetPrinterDriver_state
*state
= tevent_req_data(
1870 req
, struct rpccli_spoolss_GetPrinterDriver_state
);
1872 TALLOC_CTX
*mem_ctx
;
1874 if (state
->out_mem_ctx
) {
1875 mem_ctx
= state
->out_mem_ctx
;
1880 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1881 TALLOC_FREE(subreq
);
1882 if (!NT_STATUS_IS_OK(status
)) {
1883 tevent_req_nterror(req
, status
);
1887 /* Copy out parameters */
1888 if (state
->orig
.out
.info
&& state
->tmp
.out
.info
) {
1889 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
1891 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
1894 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1896 /* Reset temporary structure */
1897 ZERO_STRUCT(state
->tmp
);
1899 tevent_req_done(req
);
1902 NTSTATUS
rpccli_spoolss_GetPrinterDriver_recv(struct tevent_req
*req
,
1903 TALLOC_CTX
*mem_ctx
,
1906 struct rpccli_spoolss_GetPrinterDriver_state
*state
= tevent_req_data(
1907 req
, struct rpccli_spoolss_GetPrinterDriver_state
);
1910 if (tevent_req_is_nterror(req
, &status
)) {
1911 tevent_req_received(req
);
1915 /* Steal possbile out parameters to the callers context */
1916 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1919 *result
= state
->orig
.out
.result
;
1921 tevent_req_received(req
);
1922 return NT_STATUS_OK
;
1925 NTSTATUS
rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client
*cli
,
1926 TALLOC_CTX
*mem_ctx
,
1927 struct policy_handle
*handle
/* [in] [ref] */,
1928 const char *architecture
/* [in] [unique,charset(UTF16)] */,
1929 uint32_t level
/* [in] */,
1930 DATA_BLOB
*buffer
/* [in] [unique] */,
1931 uint32_t offered
/* [in] */,
1932 union spoolss_DriverInfo
*info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1933 uint32_t *needed
/* [out] [ref] */,
1936 struct spoolss_GetPrinterDriver r
;
1940 r
.in
.handle
= handle
;
1941 r
.in
.architecture
= architecture
;
1943 r
.in
.buffer
= buffer
;
1944 r
.in
.offered
= offered
;
1946 status
= cli
->dispatch(cli
,
1949 NDR_SPOOLSS_GETPRINTERDRIVER
,
1952 if (!NT_STATUS_IS_OK(status
)) {
1956 if (NT_STATUS_IS_ERR(status
)) {
1960 /* Return variables */
1961 if (info
&& r
.out
.info
) {
1962 *info
= *r
.out
.info
;
1964 *needed
= *r
.out
.needed
;
1968 *werror
= r
.out
.result
;
1971 return werror_to_ntstatus(r
.out
.result
);
1974 struct rpccli_spoolss_GetPrinterDriverDirectory_state
{
1975 struct spoolss_GetPrinterDriverDirectory orig
;
1976 struct spoolss_GetPrinterDriverDirectory tmp
;
1977 TALLOC_CTX
*out_mem_ctx
;
1978 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1981 static void rpccli_spoolss_GetPrinterDriverDirectory_done(struct tevent_req
*subreq
);
1983 struct tevent_req
*rpccli_spoolss_GetPrinterDriverDirectory_send(TALLOC_CTX
*mem_ctx
,
1984 struct tevent_context
*ev
,
1985 struct rpc_pipe_client
*cli
,
1986 const char *_server
/* [in] [unique,charset(UTF16)] */,
1987 const char *_environment
/* [in] [unique,charset(UTF16)] */,
1988 uint32_t _level
/* [in] */,
1989 DATA_BLOB
*_buffer
/* [in] [unique] */,
1990 uint32_t _offered
/* [in] */,
1991 union spoolss_DriverDirectoryInfo
*_info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1992 uint32_t *_needed
/* [out] [ref] */)
1994 struct tevent_req
*req
;
1995 struct rpccli_spoolss_GetPrinterDriverDirectory_state
*state
;
1996 struct tevent_req
*subreq
;
1998 req
= tevent_req_create(mem_ctx
, &state
,
1999 struct rpccli_spoolss_GetPrinterDriverDirectory_state
);
2003 state
->out_mem_ctx
= NULL
;
2004 state
->dispatch_recv
= cli
->dispatch_recv
;
2007 state
->orig
.in
.server
= _server
;
2008 state
->orig
.in
.environment
= _environment
;
2009 state
->orig
.in
.level
= _level
;
2010 state
->orig
.in
.buffer
= _buffer
;
2011 state
->orig
.in
.offered
= _offered
;
2013 /* Out parameters */
2014 state
->orig
.out
.info
= _info
;
2015 state
->orig
.out
.needed
= _needed
;
2018 ZERO_STRUCT(state
->orig
.out
.result
);
2020 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2021 "rpccli_spoolss_GetPrinterDriverDirectory_out_memory");
2022 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2023 return tevent_req_post(req
, ev
);
2026 /* make a temporary copy, that we pass to the dispatch function */
2027 state
->tmp
= state
->orig
;
2029 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2031 NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY
,
2033 if (tevent_req_nomem(subreq
, req
)) {
2034 return tevent_req_post(req
, ev
);
2036 tevent_req_set_callback(subreq
, rpccli_spoolss_GetPrinterDriverDirectory_done
, req
);
2040 static void rpccli_spoolss_GetPrinterDriverDirectory_done(struct tevent_req
*subreq
)
2042 struct tevent_req
*req
= tevent_req_callback_data(
2043 subreq
, struct tevent_req
);
2044 struct rpccli_spoolss_GetPrinterDriverDirectory_state
*state
= tevent_req_data(
2045 req
, struct rpccli_spoolss_GetPrinterDriverDirectory_state
);
2047 TALLOC_CTX
*mem_ctx
;
2049 if (state
->out_mem_ctx
) {
2050 mem_ctx
= state
->out_mem_ctx
;
2055 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2056 TALLOC_FREE(subreq
);
2057 if (!NT_STATUS_IS_OK(status
)) {
2058 tevent_req_nterror(req
, status
);
2062 /* Copy out parameters */
2063 if (state
->orig
.out
.info
&& state
->tmp
.out
.info
) {
2064 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
2066 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
2069 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2071 /* Reset temporary structure */
2072 ZERO_STRUCT(state
->tmp
);
2074 tevent_req_done(req
);
2077 NTSTATUS
rpccli_spoolss_GetPrinterDriverDirectory_recv(struct tevent_req
*req
,
2078 TALLOC_CTX
*mem_ctx
,
2081 struct rpccli_spoolss_GetPrinterDriverDirectory_state
*state
= tevent_req_data(
2082 req
, struct rpccli_spoolss_GetPrinterDriverDirectory_state
);
2085 if (tevent_req_is_nterror(req
, &status
)) {
2086 tevent_req_received(req
);
2090 /* Steal possbile out parameters to the callers context */
2091 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2094 *result
= state
->orig
.out
.result
;
2096 tevent_req_received(req
);
2097 return NT_STATUS_OK
;
2100 NTSTATUS
rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client
*cli
,
2101 TALLOC_CTX
*mem_ctx
,
2102 const char *server
/* [in] [unique,charset(UTF16)] */,
2103 const char *environment
/* [in] [unique,charset(UTF16)] */,
2104 uint32_t level
/* [in] */,
2105 DATA_BLOB
*buffer
/* [in] [unique] */,
2106 uint32_t offered
/* [in] */,
2107 union spoolss_DriverDirectoryInfo
*info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2108 uint32_t *needed
/* [out] [ref] */,
2111 struct spoolss_GetPrinterDriverDirectory r
;
2115 r
.in
.server
= server
;
2116 r
.in
.environment
= environment
;
2118 r
.in
.buffer
= buffer
;
2119 r
.in
.offered
= offered
;
2121 status
= cli
->dispatch(cli
,
2124 NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY
,
2127 if (!NT_STATUS_IS_OK(status
)) {
2131 if (NT_STATUS_IS_ERR(status
)) {
2135 /* Return variables */
2136 if (info
&& r
.out
.info
) {
2137 *info
= *r
.out
.info
;
2139 *needed
= *r
.out
.needed
;
2143 *werror
= r
.out
.result
;
2146 return werror_to_ntstatus(r
.out
.result
);
2149 struct rpccli_spoolss_DeletePrinterDriver_state
{
2150 struct spoolss_DeletePrinterDriver orig
;
2151 struct spoolss_DeletePrinterDriver tmp
;
2152 TALLOC_CTX
*out_mem_ctx
;
2153 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2156 static void rpccli_spoolss_DeletePrinterDriver_done(struct tevent_req
*subreq
);
2158 struct tevent_req
*rpccli_spoolss_DeletePrinterDriver_send(TALLOC_CTX
*mem_ctx
,
2159 struct tevent_context
*ev
,
2160 struct rpc_pipe_client
*cli
,
2161 const char *_server
/* [in] [unique,charset(UTF16)] */,
2162 const char *_architecture
/* [in] [charset(UTF16)] */,
2163 const char *_driver
/* [in] [charset(UTF16)] */)
2165 struct tevent_req
*req
;
2166 struct rpccli_spoolss_DeletePrinterDriver_state
*state
;
2167 struct tevent_req
*subreq
;
2169 req
= tevent_req_create(mem_ctx
, &state
,
2170 struct rpccli_spoolss_DeletePrinterDriver_state
);
2174 state
->out_mem_ctx
= NULL
;
2175 state
->dispatch_recv
= cli
->dispatch_recv
;
2178 state
->orig
.in
.server
= _server
;
2179 state
->orig
.in
.architecture
= _architecture
;
2180 state
->orig
.in
.driver
= _driver
;
2182 /* Out parameters */
2185 ZERO_STRUCT(state
->orig
.out
.result
);
2187 /* make a temporary copy, that we pass to the dispatch function */
2188 state
->tmp
= state
->orig
;
2190 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2192 NDR_SPOOLSS_DELETEPRINTERDRIVER
,
2194 if (tevent_req_nomem(subreq
, req
)) {
2195 return tevent_req_post(req
, ev
);
2197 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePrinterDriver_done
, req
);
2201 static void rpccli_spoolss_DeletePrinterDriver_done(struct tevent_req
*subreq
)
2203 struct tevent_req
*req
= tevent_req_callback_data(
2204 subreq
, struct tevent_req
);
2205 struct rpccli_spoolss_DeletePrinterDriver_state
*state
= tevent_req_data(
2206 req
, struct rpccli_spoolss_DeletePrinterDriver_state
);
2208 TALLOC_CTX
*mem_ctx
;
2210 if (state
->out_mem_ctx
) {
2211 mem_ctx
= state
->out_mem_ctx
;
2216 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2217 TALLOC_FREE(subreq
);
2218 if (!NT_STATUS_IS_OK(status
)) {
2219 tevent_req_nterror(req
, status
);
2223 /* Copy out parameters */
2226 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2228 /* Reset temporary structure */
2229 ZERO_STRUCT(state
->tmp
);
2231 tevent_req_done(req
);
2234 NTSTATUS
rpccli_spoolss_DeletePrinterDriver_recv(struct tevent_req
*req
,
2235 TALLOC_CTX
*mem_ctx
,
2238 struct rpccli_spoolss_DeletePrinterDriver_state
*state
= tevent_req_data(
2239 req
, struct rpccli_spoolss_DeletePrinterDriver_state
);
2242 if (tevent_req_is_nterror(req
, &status
)) {
2243 tevent_req_received(req
);
2247 /* Steal possbile out parameters to the callers context */
2248 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2251 *result
= state
->orig
.out
.result
;
2253 tevent_req_received(req
);
2254 return NT_STATUS_OK
;
2257 NTSTATUS
rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client
*cli
,
2258 TALLOC_CTX
*mem_ctx
,
2259 const char *server
/* [in] [unique,charset(UTF16)] */,
2260 const char *architecture
/* [in] [charset(UTF16)] */,
2261 const char *driver
/* [in] [charset(UTF16)] */,
2264 struct spoolss_DeletePrinterDriver r
;
2268 r
.in
.server
= server
;
2269 r
.in
.architecture
= architecture
;
2270 r
.in
.driver
= driver
;
2272 status
= cli
->dispatch(cli
,
2275 NDR_SPOOLSS_DELETEPRINTERDRIVER
,
2278 if (!NT_STATUS_IS_OK(status
)) {
2282 if (NT_STATUS_IS_ERR(status
)) {
2286 /* Return variables */
2290 *werror
= r
.out
.result
;
2293 return werror_to_ntstatus(r
.out
.result
);
2296 struct rpccli_spoolss_AddPrintProcessor_state
{
2297 struct spoolss_AddPrintProcessor orig
;
2298 struct spoolss_AddPrintProcessor tmp
;
2299 TALLOC_CTX
*out_mem_ctx
;
2300 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2303 static void rpccli_spoolss_AddPrintProcessor_done(struct tevent_req
*subreq
);
2305 struct tevent_req
*rpccli_spoolss_AddPrintProcessor_send(TALLOC_CTX
*mem_ctx
,
2306 struct tevent_context
*ev
,
2307 struct rpc_pipe_client
*cli
,
2308 const char *_server
/* [in] [unique,charset(UTF16)] */,
2309 const char *_architecture
/* [in] [charset(UTF16)] */,
2310 const char *_path_name
/* [in] [charset(UTF16)] */,
2311 const char *_print_processor_name
/* [in] [charset(UTF16)] */)
2313 struct tevent_req
*req
;
2314 struct rpccli_spoolss_AddPrintProcessor_state
*state
;
2315 struct tevent_req
*subreq
;
2317 req
= tevent_req_create(mem_ctx
, &state
,
2318 struct rpccli_spoolss_AddPrintProcessor_state
);
2322 state
->out_mem_ctx
= NULL
;
2323 state
->dispatch_recv
= cli
->dispatch_recv
;
2326 state
->orig
.in
.server
= _server
;
2327 state
->orig
.in
.architecture
= _architecture
;
2328 state
->orig
.in
.path_name
= _path_name
;
2329 state
->orig
.in
.print_processor_name
= _print_processor_name
;
2331 /* Out parameters */
2334 ZERO_STRUCT(state
->orig
.out
.result
);
2336 /* make a temporary copy, that we pass to the dispatch function */
2337 state
->tmp
= state
->orig
;
2339 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2341 NDR_SPOOLSS_ADDPRINTPROCESSOR
,
2343 if (tevent_req_nomem(subreq
, req
)) {
2344 return tevent_req_post(req
, ev
);
2346 tevent_req_set_callback(subreq
, rpccli_spoolss_AddPrintProcessor_done
, req
);
2350 static void rpccli_spoolss_AddPrintProcessor_done(struct tevent_req
*subreq
)
2352 struct tevent_req
*req
= tevent_req_callback_data(
2353 subreq
, struct tevent_req
);
2354 struct rpccli_spoolss_AddPrintProcessor_state
*state
= tevent_req_data(
2355 req
, struct rpccli_spoolss_AddPrintProcessor_state
);
2357 TALLOC_CTX
*mem_ctx
;
2359 if (state
->out_mem_ctx
) {
2360 mem_ctx
= state
->out_mem_ctx
;
2365 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2366 TALLOC_FREE(subreq
);
2367 if (!NT_STATUS_IS_OK(status
)) {
2368 tevent_req_nterror(req
, status
);
2372 /* Copy out parameters */
2375 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2377 /* Reset temporary structure */
2378 ZERO_STRUCT(state
->tmp
);
2380 tevent_req_done(req
);
2383 NTSTATUS
rpccli_spoolss_AddPrintProcessor_recv(struct tevent_req
*req
,
2384 TALLOC_CTX
*mem_ctx
,
2387 struct rpccli_spoolss_AddPrintProcessor_state
*state
= tevent_req_data(
2388 req
, struct rpccli_spoolss_AddPrintProcessor_state
);
2391 if (tevent_req_is_nterror(req
, &status
)) {
2392 tevent_req_received(req
);
2396 /* Steal possbile out parameters to the callers context */
2397 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2400 *result
= state
->orig
.out
.result
;
2402 tevent_req_received(req
);
2403 return NT_STATUS_OK
;
2406 NTSTATUS
rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client
*cli
,
2407 TALLOC_CTX
*mem_ctx
,
2408 const char *server
/* [in] [unique,charset(UTF16)] */,
2409 const char *architecture
/* [in] [charset(UTF16)] */,
2410 const char *path_name
/* [in] [charset(UTF16)] */,
2411 const char *print_processor_name
/* [in] [charset(UTF16)] */,
2414 struct spoolss_AddPrintProcessor r
;
2418 r
.in
.server
= server
;
2419 r
.in
.architecture
= architecture
;
2420 r
.in
.path_name
= path_name
;
2421 r
.in
.print_processor_name
= print_processor_name
;
2423 status
= cli
->dispatch(cli
,
2426 NDR_SPOOLSS_ADDPRINTPROCESSOR
,
2429 if (!NT_STATUS_IS_OK(status
)) {
2433 if (NT_STATUS_IS_ERR(status
)) {
2437 /* Return variables */
2441 *werror
= r
.out
.result
;
2444 return werror_to_ntstatus(r
.out
.result
);
2447 struct rpccli_spoolss_EnumPrintProcessors_state
{
2448 struct spoolss_EnumPrintProcessors orig
;
2449 struct spoolss_EnumPrintProcessors tmp
;
2450 TALLOC_CTX
*out_mem_ctx
;
2451 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2454 static void rpccli_spoolss_EnumPrintProcessors_done(struct tevent_req
*subreq
);
2456 struct tevent_req
*rpccli_spoolss_EnumPrintProcessors_send(TALLOC_CTX
*mem_ctx
,
2457 struct tevent_context
*ev
,
2458 struct rpc_pipe_client
*cli
,
2459 const char *_servername
/* [in] [unique,charset(UTF16)] */,
2460 const char *_environment
/* [in] [unique,charset(UTF16)] */,
2461 uint32_t _level
/* [in] */,
2462 DATA_BLOB
*_buffer
/* [in] [unique] */,
2463 uint32_t _offered
/* [in] */,
2464 uint32_t *_count
/* [out] [ref] */,
2465 union spoolss_PrintProcessorInfo
**_info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
2466 uint32_t *_needed
/* [out] [ref] */)
2468 struct tevent_req
*req
;
2469 struct rpccli_spoolss_EnumPrintProcessors_state
*state
;
2470 struct tevent_req
*subreq
;
2472 req
= tevent_req_create(mem_ctx
, &state
,
2473 struct rpccli_spoolss_EnumPrintProcessors_state
);
2477 state
->out_mem_ctx
= NULL
;
2478 state
->dispatch_recv
= cli
->dispatch_recv
;
2481 state
->orig
.in
.servername
= _servername
;
2482 state
->orig
.in
.environment
= _environment
;
2483 state
->orig
.in
.level
= _level
;
2484 state
->orig
.in
.buffer
= _buffer
;
2485 state
->orig
.in
.offered
= _offered
;
2487 /* Out parameters */
2488 state
->orig
.out
.count
= _count
;
2489 state
->orig
.out
.info
= _info
;
2490 state
->orig
.out
.needed
= _needed
;
2493 ZERO_STRUCT(state
->orig
.out
.result
);
2495 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2496 "rpccli_spoolss_EnumPrintProcessors_out_memory");
2497 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2498 return tevent_req_post(req
, ev
);
2501 /* make a temporary copy, that we pass to the dispatch function */
2502 state
->tmp
= state
->orig
;
2504 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2506 NDR_SPOOLSS_ENUMPRINTPROCESSORS
,
2508 if (tevent_req_nomem(subreq
, req
)) {
2509 return tevent_req_post(req
, ev
);
2511 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumPrintProcessors_done
, req
);
2515 static void rpccli_spoolss_EnumPrintProcessors_done(struct tevent_req
*subreq
)
2517 struct tevent_req
*req
= tevent_req_callback_data(
2518 subreq
, struct tevent_req
);
2519 struct rpccli_spoolss_EnumPrintProcessors_state
*state
= tevent_req_data(
2520 req
, struct rpccli_spoolss_EnumPrintProcessors_state
);
2522 TALLOC_CTX
*mem_ctx
;
2524 if (state
->out_mem_ctx
) {
2525 mem_ctx
= state
->out_mem_ctx
;
2530 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2531 TALLOC_FREE(subreq
);
2532 if (!NT_STATUS_IS_OK(status
)) {
2533 tevent_req_nterror(req
, status
);
2537 /* Copy out parameters */
2538 *state
->orig
.out
.count
= *state
->tmp
.out
.count
;
2539 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
2540 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
2543 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2545 /* Reset temporary structure */
2546 ZERO_STRUCT(state
->tmp
);
2548 tevent_req_done(req
);
2551 NTSTATUS
rpccli_spoolss_EnumPrintProcessors_recv(struct tevent_req
*req
,
2552 TALLOC_CTX
*mem_ctx
,
2555 struct rpccli_spoolss_EnumPrintProcessors_state
*state
= tevent_req_data(
2556 req
, struct rpccli_spoolss_EnumPrintProcessors_state
);
2559 if (tevent_req_is_nterror(req
, &status
)) {
2560 tevent_req_received(req
);
2564 /* Steal possbile out parameters to the callers context */
2565 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2568 *result
= state
->orig
.out
.result
;
2570 tevent_req_received(req
);
2571 return NT_STATUS_OK
;
2574 NTSTATUS
rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client
*cli
,
2575 TALLOC_CTX
*mem_ctx
,
2576 const char *servername
/* [in] [unique,charset(UTF16)] */,
2577 const char *environment
/* [in] [unique,charset(UTF16)] */,
2578 uint32_t level
/* [in] */,
2579 DATA_BLOB
*buffer
/* [in] [unique] */,
2580 uint32_t offered
/* [in] */,
2581 uint32_t *count
/* [out] [ref] */,
2582 union spoolss_PrintProcessorInfo
**info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
2583 uint32_t *needed
/* [out] [ref] */,
2586 struct spoolss_EnumPrintProcessors r
;
2590 r
.in
.servername
= servername
;
2591 r
.in
.environment
= environment
;
2593 r
.in
.buffer
= buffer
;
2594 r
.in
.offered
= offered
;
2596 status
= cli
->dispatch(cli
,
2599 NDR_SPOOLSS_ENUMPRINTPROCESSORS
,
2602 if (!NT_STATUS_IS_OK(status
)) {
2606 if (NT_STATUS_IS_ERR(status
)) {
2610 /* Return variables */
2611 *count
= *r
.out
.count
;
2612 *info
= *r
.out
.info
;
2613 *needed
= *r
.out
.needed
;
2617 *werror
= r
.out
.result
;
2620 return werror_to_ntstatus(r
.out
.result
);
2623 struct rpccli_spoolss_GetPrintProcessorDirectory_state
{
2624 struct spoolss_GetPrintProcessorDirectory orig
;
2625 struct spoolss_GetPrintProcessorDirectory tmp
;
2626 TALLOC_CTX
*out_mem_ctx
;
2627 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2630 static void rpccli_spoolss_GetPrintProcessorDirectory_done(struct tevent_req
*subreq
);
2632 struct tevent_req
*rpccli_spoolss_GetPrintProcessorDirectory_send(TALLOC_CTX
*mem_ctx
,
2633 struct tevent_context
*ev
,
2634 struct rpc_pipe_client
*cli
,
2635 const char *_server
/* [in] [unique,charset(UTF16)] */,
2636 const char *_environment
/* [in] [unique,charset(UTF16)] */,
2637 uint32_t _level
/* [in] */,
2638 DATA_BLOB
*_buffer
/* [in] [unique] */,
2639 uint32_t _offered
/* [in] */,
2640 union spoolss_PrintProcessorDirectoryInfo
*_info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2641 uint32_t *_needed
/* [out] [ref] */)
2643 struct tevent_req
*req
;
2644 struct rpccli_spoolss_GetPrintProcessorDirectory_state
*state
;
2645 struct tevent_req
*subreq
;
2647 req
= tevent_req_create(mem_ctx
, &state
,
2648 struct rpccli_spoolss_GetPrintProcessorDirectory_state
);
2652 state
->out_mem_ctx
= NULL
;
2653 state
->dispatch_recv
= cli
->dispatch_recv
;
2656 state
->orig
.in
.server
= _server
;
2657 state
->orig
.in
.environment
= _environment
;
2658 state
->orig
.in
.level
= _level
;
2659 state
->orig
.in
.buffer
= _buffer
;
2660 state
->orig
.in
.offered
= _offered
;
2662 /* Out parameters */
2663 state
->orig
.out
.info
= _info
;
2664 state
->orig
.out
.needed
= _needed
;
2667 ZERO_STRUCT(state
->orig
.out
.result
);
2669 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2670 "rpccli_spoolss_GetPrintProcessorDirectory_out_memory");
2671 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2672 return tevent_req_post(req
, ev
);
2675 /* make a temporary copy, that we pass to the dispatch function */
2676 state
->tmp
= state
->orig
;
2678 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2680 NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY
,
2682 if (tevent_req_nomem(subreq
, req
)) {
2683 return tevent_req_post(req
, ev
);
2685 tevent_req_set_callback(subreq
, rpccli_spoolss_GetPrintProcessorDirectory_done
, req
);
2689 static void rpccli_spoolss_GetPrintProcessorDirectory_done(struct tevent_req
*subreq
)
2691 struct tevent_req
*req
= tevent_req_callback_data(
2692 subreq
, struct tevent_req
);
2693 struct rpccli_spoolss_GetPrintProcessorDirectory_state
*state
= tevent_req_data(
2694 req
, struct rpccli_spoolss_GetPrintProcessorDirectory_state
);
2696 TALLOC_CTX
*mem_ctx
;
2698 if (state
->out_mem_ctx
) {
2699 mem_ctx
= state
->out_mem_ctx
;
2704 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2705 TALLOC_FREE(subreq
);
2706 if (!NT_STATUS_IS_OK(status
)) {
2707 tevent_req_nterror(req
, status
);
2711 /* Copy out parameters */
2712 if (state
->orig
.out
.info
&& state
->tmp
.out
.info
) {
2713 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
2715 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
2718 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2720 /* Reset temporary structure */
2721 ZERO_STRUCT(state
->tmp
);
2723 tevent_req_done(req
);
2726 NTSTATUS
rpccli_spoolss_GetPrintProcessorDirectory_recv(struct tevent_req
*req
,
2727 TALLOC_CTX
*mem_ctx
,
2730 struct rpccli_spoolss_GetPrintProcessorDirectory_state
*state
= tevent_req_data(
2731 req
, struct rpccli_spoolss_GetPrintProcessorDirectory_state
);
2734 if (tevent_req_is_nterror(req
, &status
)) {
2735 tevent_req_received(req
);
2739 /* Steal possbile out parameters to the callers context */
2740 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2743 *result
= state
->orig
.out
.result
;
2745 tevent_req_received(req
);
2746 return NT_STATUS_OK
;
2749 NTSTATUS
rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client
*cli
,
2750 TALLOC_CTX
*mem_ctx
,
2751 const char *server
/* [in] [unique,charset(UTF16)] */,
2752 const char *environment
/* [in] [unique,charset(UTF16)] */,
2753 uint32_t level
/* [in] */,
2754 DATA_BLOB
*buffer
/* [in] [unique] */,
2755 uint32_t offered
/* [in] */,
2756 union spoolss_PrintProcessorDirectoryInfo
*info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2757 uint32_t *needed
/* [out] [ref] */,
2760 struct spoolss_GetPrintProcessorDirectory r
;
2764 r
.in
.server
= server
;
2765 r
.in
.environment
= environment
;
2767 r
.in
.buffer
= buffer
;
2768 r
.in
.offered
= offered
;
2770 status
= cli
->dispatch(cli
,
2773 NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY
,
2776 if (!NT_STATUS_IS_OK(status
)) {
2780 if (NT_STATUS_IS_ERR(status
)) {
2784 /* Return variables */
2785 if (info
&& r
.out
.info
) {
2786 *info
= *r
.out
.info
;
2788 *needed
= *r
.out
.needed
;
2792 *werror
= r
.out
.result
;
2795 return werror_to_ntstatus(r
.out
.result
);
2798 struct rpccli_spoolss_StartDocPrinter_state
{
2799 struct spoolss_StartDocPrinter orig
;
2800 struct spoolss_StartDocPrinter tmp
;
2801 TALLOC_CTX
*out_mem_ctx
;
2802 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2805 static void rpccli_spoolss_StartDocPrinter_done(struct tevent_req
*subreq
);
2807 struct tevent_req
*rpccli_spoolss_StartDocPrinter_send(TALLOC_CTX
*mem_ctx
,
2808 struct tevent_context
*ev
,
2809 struct rpc_pipe_client
*cli
,
2810 struct policy_handle
*_handle
/* [in] [ref] */,
2811 uint32_t _level
/* [in] */,
2812 union spoolss_DocumentInfo _info
/* [in] [switch_is(level)] */,
2813 uint32_t *_job_id
/* [out] [ref] */)
2815 struct tevent_req
*req
;
2816 struct rpccli_spoolss_StartDocPrinter_state
*state
;
2817 struct tevent_req
*subreq
;
2819 req
= tevent_req_create(mem_ctx
, &state
,
2820 struct rpccli_spoolss_StartDocPrinter_state
);
2824 state
->out_mem_ctx
= NULL
;
2825 state
->dispatch_recv
= cli
->dispatch_recv
;
2828 state
->orig
.in
.handle
= _handle
;
2829 state
->orig
.in
.level
= _level
;
2830 state
->orig
.in
.info
= _info
;
2832 /* Out parameters */
2833 state
->orig
.out
.job_id
= _job_id
;
2836 ZERO_STRUCT(state
->orig
.out
.result
);
2838 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2839 "rpccli_spoolss_StartDocPrinter_out_memory");
2840 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2841 return tevent_req_post(req
, ev
);
2844 /* make a temporary copy, that we pass to the dispatch function */
2845 state
->tmp
= state
->orig
;
2847 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2849 NDR_SPOOLSS_STARTDOCPRINTER
,
2851 if (tevent_req_nomem(subreq
, req
)) {
2852 return tevent_req_post(req
, ev
);
2854 tevent_req_set_callback(subreq
, rpccli_spoolss_StartDocPrinter_done
, req
);
2858 static void rpccli_spoolss_StartDocPrinter_done(struct tevent_req
*subreq
)
2860 struct tevent_req
*req
= tevent_req_callback_data(
2861 subreq
, struct tevent_req
);
2862 struct rpccli_spoolss_StartDocPrinter_state
*state
= tevent_req_data(
2863 req
, struct rpccli_spoolss_StartDocPrinter_state
);
2865 TALLOC_CTX
*mem_ctx
;
2867 if (state
->out_mem_ctx
) {
2868 mem_ctx
= state
->out_mem_ctx
;
2873 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2874 TALLOC_FREE(subreq
);
2875 if (!NT_STATUS_IS_OK(status
)) {
2876 tevent_req_nterror(req
, status
);
2880 /* Copy out parameters */
2881 *state
->orig
.out
.job_id
= *state
->tmp
.out
.job_id
;
2884 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2886 /* Reset temporary structure */
2887 ZERO_STRUCT(state
->tmp
);
2889 tevent_req_done(req
);
2892 NTSTATUS
rpccli_spoolss_StartDocPrinter_recv(struct tevent_req
*req
,
2893 TALLOC_CTX
*mem_ctx
,
2896 struct rpccli_spoolss_StartDocPrinter_state
*state
= tevent_req_data(
2897 req
, struct rpccli_spoolss_StartDocPrinter_state
);
2900 if (tevent_req_is_nterror(req
, &status
)) {
2901 tevent_req_received(req
);
2905 /* Steal possbile out parameters to the callers context */
2906 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2909 *result
= state
->orig
.out
.result
;
2911 tevent_req_received(req
);
2912 return NT_STATUS_OK
;
2915 NTSTATUS
rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client
*cli
,
2916 TALLOC_CTX
*mem_ctx
,
2917 struct policy_handle
*handle
/* [in] [ref] */,
2918 uint32_t level
/* [in] */,
2919 union spoolss_DocumentInfo info
/* [in] [switch_is(level)] */,
2920 uint32_t *job_id
/* [out] [ref] */,
2923 struct spoolss_StartDocPrinter r
;
2927 r
.in
.handle
= handle
;
2931 status
= cli
->dispatch(cli
,
2934 NDR_SPOOLSS_STARTDOCPRINTER
,
2937 if (!NT_STATUS_IS_OK(status
)) {
2941 if (NT_STATUS_IS_ERR(status
)) {
2945 /* Return variables */
2946 *job_id
= *r
.out
.job_id
;
2950 *werror
= r
.out
.result
;
2953 return werror_to_ntstatus(r
.out
.result
);
2956 struct rpccli_spoolss_StartPagePrinter_state
{
2957 struct spoolss_StartPagePrinter orig
;
2958 struct spoolss_StartPagePrinter tmp
;
2959 TALLOC_CTX
*out_mem_ctx
;
2960 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2963 static void rpccli_spoolss_StartPagePrinter_done(struct tevent_req
*subreq
);
2965 struct tevent_req
*rpccli_spoolss_StartPagePrinter_send(TALLOC_CTX
*mem_ctx
,
2966 struct tevent_context
*ev
,
2967 struct rpc_pipe_client
*cli
,
2968 struct policy_handle
*_handle
/* [in] [ref] */)
2970 struct tevent_req
*req
;
2971 struct rpccli_spoolss_StartPagePrinter_state
*state
;
2972 struct tevent_req
*subreq
;
2974 req
= tevent_req_create(mem_ctx
, &state
,
2975 struct rpccli_spoolss_StartPagePrinter_state
);
2979 state
->out_mem_ctx
= NULL
;
2980 state
->dispatch_recv
= cli
->dispatch_recv
;
2983 state
->orig
.in
.handle
= _handle
;
2985 /* Out parameters */
2988 ZERO_STRUCT(state
->orig
.out
.result
);
2990 /* make a temporary copy, that we pass to the dispatch function */
2991 state
->tmp
= state
->orig
;
2993 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2995 NDR_SPOOLSS_STARTPAGEPRINTER
,
2997 if (tevent_req_nomem(subreq
, req
)) {
2998 return tevent_req_post(req
, ev
);
3000 tevent_req_set_callback(subreq
, rpccli_spoolss_StartPagePrinter_done
, req
);
3004 static void rpccli_spoolss_StartPagePrinter_done(struct tevent_req
*subreq
)
3006 struct tevent_req
*req
= tevent_req_callback_data(
3007 subreq
, struct tevent_req
);
3008 struct rpccli_spoolss_StartPagePrinter_state
*state
= tevent_req_data(
3009 req
, struct rpccli_spoolss_StartPagePrinter_state
);
3011 TALLOC_CTX
*mem_ctx
;
3013 if (state
->out_mem_ctx
) {
3014 mem_ctx
= state
->out_mem_ctx
;
3019 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3020 TALLOC_FREE(subreq
);
3021 if (!NT_STATUS_IS_OK(status
)) {
3022 tevent_req_nterror(req
, status
);
3026 /* Copy out parameters */
3029 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3031 /* Reset temporary structure */
3032 ZERO_STRUCT(state
->tmp
);
3034 tevent_req_done(req
);
3037 NTSTATUS
rpccli_spoolss_StartPagePrinter_recv(struct tevent_req
*req
,
3038 TALLOC_CTX
*mem_ctx
,
3041 struct rpccli_spoolss_StartPagePrinter_state
*state
= tevent_req_data(
3042 req
, struct rpccli_spoolss_StartPagePrinter_state
);
3045 if (tevent_req_is_nterror(req
, &status
)) {
3046 tevent_req_received(req
);
3050 /* Steal possbile out parameters to the callers context */
3051 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3054 *result
= state
->orig
.out
.result
;
3056 tevent_req_received(req
);
3057 return NT_STATUS_OK
;
3060 NTSTATUS
rpccli_spoolss_StartPagePrinter(struct rpc_pipe_client
*cli
,
3061 TALLOC_CTX
*mem_ctx
,
3062 struct policy_handle
*handle
/* [in] [ref] */,
3065 struct spoolss_StartPagePrinter r
;
3069 r
.in
.handle
= handle
;
3071 status
= cli
->dispatch(cli
,
3074 NDR_SPOOLSS_STARTPAGEPRINTER
,
3077 if (!NT_STATUS_IS_OK(status
)) {
3081 if (NT_STATUS_IS_ERR(status
)) {
3085 /* Return variables */
3089 *werror
= r
.out
.result
;
3092 return werror_to_ntstatus(r
.out
.result
);
3095 struct rpccli_spoolss_WritePrinter_state
{
3096 struct spoolss_WritePrinter orig
;
3097 struct spoolss_WritePrinter tmp
;
3098 TALLOC_CTX
*out_mem_ctx
;
3099 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3102 static void rpccli_spoolss_WritePrinter_done(struct tevent_req
*subreq
);
3104 struct tevent_req
*rpccli_spoolss_WritePrinter_send(TALLOC_CTX
*mem_ctx
,
3105 struct tevent_context
*ev
,
3106 struct rpc_pipe_client
*cli
,
3107 struct policy_handle
*_handle
/* [in] [ref] */,
3108 DATA_BLOB _data
/* [in] */,
3109 uint32_t __data_size
/* [in] [value(r->in.data.length)] */,
3110 uint32_t *_num_written
/* [out] [ref] */)
3112 struct tevent_req
*req
;
3113 struct rpccli_spoolss_WritePrinter_state
*state
;
3114 struct tevent_req
*subreq
;
3116 req
= tevent_req_create(mem_ctx
, &state
,
3117 struct rpccli_spoolss_WritePrinter_state
);
3121 state
->out_mem_ctx
= NULL
;
3122 state
->dispatch_recv
= cli
->dispatch_recv
;
3125 state
->orig
.in
.handle
= _handle
;
3126 state
->orig
.in
.data
= _data
;
3127 state
->orig
.in
._data_size
= __data_size
;
3129 /* Out parameters */
3130 state
->orig
.out
.num_written
= _num_written
;
3133 ZERO_STRUCT(state
->orig
.out
.result
);
3135 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3136 "rpccli_spoolss_WritePrinter_out_memory");
3137 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3138 return tevent_req_post(req
, ev
);
3141 /* make a temporary copy, that we pass to the dispatch function */
3142 state
->tmp
= state
->orig
;
3144 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3146 NDR_SPOOLSS_WRITEPRINTER
,
3148 if (tevent_req_nomem(subreq
, req
)) {
3149 return tevent_req_post(req
, ev
);
3151 tevent_req_set_callback(subreq
, rpccli_spoolss_WritePrinter_done
, req
);
3155 static void rpccli_spoolss_WritePrinter_done(struct tevent_req
*subreq
)
3157 struct tevent_req
*req
= tevent_req_callback_data(
3158 subreq
, struct tevent_req
);
3159 struct rpccli_spoolss_WritePrinter_state
*state
= tevent_req_data(
3160 req
, struct rpccli_spoolss_WritePrinter_state
);
3162 TALLOC_CTX
*mem_ctx
;
3164 if (state
->out_mem_ctx
) {
3165 mem_ctx
= state
->out_mem_ctx
;
3170 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3171 TALLOC_FREE(subreq
);
3172 if (!NT_STATUS_IS_OK(status
)) {
3173 tevent_req_nterror(req
, status
);
3177 /* Copy out parameters */
3178 *state
->orig
.out
.num_written
= *state
->tmp
.out
.num_written
;
3181 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3183 /* Reset temporary structure */
3184 ZERO_STRUCT(state
->tmp
);
3186 tevent_req_done(req
);
3189 NTSTATUS
rpccli_spoolss_WritePrinter_recv(struct tevent_req
*req
,
3190 TALLOC_CTX
*mem_ctx
,
3193 struct rpccli_spoolss_WritePrinter_state
*state
= tevent_req_data(
3194 req
, struct rpccli_spoolss_WritePrinter_state
);
3197 if (tevent_req_is_nterror(req
, &status
)) {
3198 tevent_req_received(req
);
3202 /* Steal possbile out parameters to the callers context */
3203 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3206 *result
= state
->orig
.out
.result
;
3208 tevent_req_received(req
);
3209 return NT_STATUS_OK
;
3212 NTSTATUS
rpccli_spoolss_WritePrinter(struct rpc_pipe_client
*cli
,
3213 TALLOC_CTX
*mem_ctx
,
3214 struct policy_handle
*handle
/* [in] [ref] */,
3215 DATA_BLOB data
/* [in] */,
3216 uint32_t _data_size
/* [in] [value(r->in.data.length)] */,
3217 uint32_t *num_written
/* [out] [ref] */,
3220 struct spoolss_WritePrinter r
;
3224 r
.in
.handle
= handle
;
3226 r
.in
._data_size
= _data_size
;
3228 status
= cli
->dispatch(cli
,
3231 NDR_SPOOLSS_WRITEPRINTER
,
3234 if (!NT_STATUS_IS_OK(status
)) {
3238 if (NT_STATUS_IS_ERR(status
)) {
3242 /* Return variables */
3243 *num_written
= *r
.out
.num_written
;
3247 *werror
= r
.out
.result
;
3250 return werror_to_ntstatus(r
.out
.result
);
3253 struct rpccli_spoolss_EndPagePrinter_state
{
3254 struct spoolss_EndPagePrinter orig
;
3255 struct spoolss_EndPagePrinter tmp
;
3256 TALLOC_CTX
*out_mem_ctx
;
3257 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3260 static void rpccli_spoolss_EndPagePrinter_done(struct tevent_req
*subreq
);
3262 struct tevent_req
*rpccli_spoolss_EndPagePrinter_send(TALLOC_CTX
*mem_ctx
,
3263 struct tevent_context
*ev
,
3264 struct rpc_pipe_client
*cli
,
3265 struct policy_handle
*_handle
/* [in] [ref] */)
3267 struct tevent_req
*req
;
3268 struct rpccli_spoolss_EndPagePrinter_state
*state
;
3269 struct tevent_req
*subreq
;
3271 req
= tevent_req_create(mem_ctx
, &state
,
3272 struct rpccli_spoolss_EndPagePrinter_state
);
3276 state
->out_mem_ctx
= NULL
;
3277 state
->dispatch_recv
= cli
->dispatch_recv
;
3280 state
->orig
.in
.handle
= _handle
;
3282 /* Out parameters */
3285 ZERO_STRUCT(state
->orig
.out
.result
);
3287 /* make a temporary copy, that we pass to the dispatch function */
3288 state
->tmp
= state
->orig
;
3290 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3292 NDR_SPOOLSS_ENDPAGEPRINTER
,
3294 if (tevent_req_nomem(subreq
, req
)) {
3295 return tevent_req_post(req
, ev
);
3297 tevent_req_set_callback(subreq
, rpccli_spoolss_EndPagePrinter_done
, req
);
3301 static void rpccli_spoolss_EndPagePrinter_done(struct tevent_req
*subreq
)
3303 struct tevent_req
*req
= tevent_req_callback_data(
3304 subreq
, struct tevent_req
);
3305 struct rpccli_spoolss_EndPagePrinter_state
*state
= tevent_req_data(
3306 req
, struct rpccli_spoolss_EndPagePrinter_state
);
3308 TALLOC_CTX
*mem_ctx
;
3310 if (state
->out_mem_ctx
) {
3311 mem_ctx
= state
->out_mem_ctx
;
3316 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3317 TALLOC_FREE(subreq
);
3318 if (!NT_STATUS_IS_OK(status
)) {
3319 tevent_req_nterror(req
, status
);
3323 /* Copy out parameters */
3326 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3328 /* Reset temporary structure */
3329 ZERO_STRUCT(state
->tmp
);
3331 tevent_req_done(req
);
3334 NTSTATUS
rpccli_spoolss_EndPagePrinter_recv(struct tevent_req
*req
,
3335 TALLOC_CTX
*mem_ctx
,
3338 struct rpccli_spoolss_EndPagePrinter_state
*state
= tevent_req_data(
3339 req
, struct rpccli_spoolss_EndPagePrinter_state
);
3342 if (tevent_req_is_nterror(req
, &status
)) {
3343 tevent_req_received(req
);
3347 /* Steal possbile out parameters to the callers context */
3348 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3351 *result
= state
->orig
.out
.result
;
3353 tevent_req_received(req
);
3354 return NT_STATUS_OK
;
3357 NTSTATUS
rpccli_spoolss_EndPagePrinter(struct rpc_pipe_client
*cli
,
3358 TALLOC_CTX
*mem_ctx
,
3359 struct policy_handle
*handle
/* [in] [ref] */,
3362 struct spoolss_EndPagePrinter r
;
3366 r
.in
.handle
= handle
;
3368 status
= cli
->dispatch(cli
,
3371 NDR_SPOOLSS_ENDPAGEPRINTER
,
3374 if (!NT_STATUS_IS_OK(status
)) {
3378 if (NT_STATUS_IS_ERR(status
)) {
3382 /* Return variables */
3386 *werror
= r
.out
.result
;
3389 return werror_to_ntstatus(r
.out
.result
);
3392 struct rpccli_spoolss_AbortPrinter_state
{
3393 struct spoolss_AbortPrinter orig
;
3394 struct spoolss_AbortPrinter tmp
;
3395 TALLOC_CTX
*out_mem_ctx
;
3396 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3399 static void rpccli_spoolss_AbortPrinter_done(struct tevent_req
*subreq
);
3401 struct tevent_req
*rpccli_spoolss_AbortPrinter_send(TALLOC_CTX
*mem_ctx
,
3402 struct tevent_context
*ev
,
3403 struct rpc_pipe_client
*cli
,
3404 struct policy_handle
*_handle
/* [in] [ref] */)
3406 struct tevent_req
*req
;
3407 struct rpccli_spoolss_AbortPrinter_state
*state
;
3408 struct tevent_req
*subreq
;
3410 req
= tevent_req_create(mem_ctx
, &state
,
3411 struct rpccli_spoolss_AbortPrinter_state
);
3415 state
->out_mem_ctx
= NULL
;
3416 state
->dispatch_recv
= cli
->dispatch_recv
;
3419 state
->orig
.in
.handle
= _handle
;
3421 /* Out parameters */
3424 ZERO_STRUCT(state
->orig
.out
.result
);
3426 /* make a temporary copy, that we pass to the dispatch function */
3427 state
->tmp
= state
->orig
;
3429 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3431 NDR_SPOOLSS_ABORTPRINTER
,
3433 if (tevent_req_nomem(subreq
, req
)) {
3434 return tevent_req_post(req
, ev
);
3436 tevent_req_set_callback(subreq
, rpccli_spoolss_AbortPrinter_done
, req
);
3440 static void rpccli_spoolss_AbortPrinter_done(struct tevent_req
*subreq
)
3442 struct tevent_req
*req
= tevent_req_callback_data(
3443 subreq
, struct tevent_req
);
3444 struct rpccli_spoolss_AbortPrinter_state
*state
= tevent_req_data(
3445 req
, struct rpccli_spoolss_AbortPrinter_state
);
3447 TALLOC_CTX
*mem_ctx
;
3449 if (state
->out_mem_ctx
) {
3450 mem_ctx
= state
->out_mem_ctx
;
3455 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3456 TALLOC_FREE(subreq
);
3457 if (!NT_STATUS_IS_OK(status
)) {
3458 tevent_req_nterror(req
, status
);
3462 /* Copy out parameters */
3465 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3467 /* Reset temporary structure */
3468 ZERO_STRUCT(state
->tmp
);
3470 tevent_req_done(req
);
3473 NTSTATUS
rpccli_spoolss_AbortPrinter_recv(struct tevent_req
*req
,
3474 TALLOC_CTX
*mem_ctx
,
3477 struct rpccli_spoolss_AbortPrinter_state
*state
= tevent_req_data(
3478 req
, struct rpccli_spoolss_AbortPrinter_state
);
3481 if (tevent_req_is_nterror(req
, &status
)) {
3482 tevent_req_received(req
);
3486 /* Steal possbile out parameters to the callers context */
3487 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3490 *result
= state
->orig
.out
.result
;
3492 tevent_req_received(req
);
3493 return NT_STATUS_OK
;
3496 NTSTATUS
rpccli_spoolss_AbortPrinter(struct rpc_pipe_client
*cli
,
3497 TALLOC_CTX
*mem_ctx
,
3498 struct policy_handle
*handle
/* [in] [ref] */,
3501 struct spoolss_AbortPrinter r
;
3505 r
.in
.handle
= handle
;
3507 status
= cli
->dispatch(cli
,
3510 NDR_SPOOLSS_ABORTPRINTER
,
3513 if (!NT_STATUS_IS_OK(status
)) {
3517 if (NT_STATUS_IS_ERR(status
)) {
3521 /* Return variables */
3525 *werror
= r
.out
.result
;
3528 return werror_to_ntstatus(r
.out
.result
);
3531 struct rpccli_spoolss_ReadPrinter_state
{
3532 struct spoolss_ReadPrinter orig
;
3533 struct spoolss_ReadPrinter tmp
;
3534 TALLOC_CTX
*out_mem_ctx
;
3535 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3538 static void rpccli_spoolss_ReadPrinter_done(struct tevent_req
*subreq
);
3540 struct tevent_req
*rpccli_spoolss_ReadPrinter_send(TALLOC_CTX
*mem_ctx
,
3541 struct tevent_context
*ev
,
3542 struct rpc_pipe_client
*cli
,
3543 struct policy_handle
*_handle
/* [in] [ref] */,
3544 uint8_t *_data
/* [out] [ref,size_is(data_size)] */,
3545 uint32_t _data_size
/* [in] */,
3546 uint32_t *__data_size
/* [out] [ref] */)
3548 struct tevent_req
*req
;
3549 struct rpccli_spoolss_ReadPrinter_state
*state
;
3550 struct tevent_req
*subreq
;
3552 req
= tevent_req_create(mem_ctx
, &state
,
3553 struct rpccli_spoolss_ReadPrinter_state
);
3557 state
->out_mem_ctx
= NULL
;
3558 state
->dispatch_recv
= cli
->dispatch_recv
;
3561 state
->orig
.in
.handle
= _handle
;
3562 state
->orig
.in
.data_size
= _data_size
;
3564 /* Out parameters */
3565 state
->orig
.out
.data
= _data
;
3566 state
->orig
.out
._data_size
= __data_size
;
3569 ZERO_STRUCT(state
->orig
.out
.result
);
3571 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3572 "rpccli_spoolss_ReadPrinter_out_memory");
3573 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3574 return tevent_req_post(req
, ev
);
3577 /* make a temporary copy, that we pass to the dispatch function */
3578 state
->tmp
= state
->orig
;
3580 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3582 NDR_SPOOLSS_READPRINTER
,
3584 if (tevent_req_nomem(subreq
, req
)) {
3585 return tevent_req_post(req
, ev
);
3587 tevent_req_set_callback(subreq
, rpccli_spoolss_ReadPrinter_done
, req
);
3591 static void rpccli_spoolss_ReadPrinter_done(struct tevent_req
*subreq
)
3593 struct tevent_req
*req
= tevent_req_callback_data(
3594 subreq
, struct tevent_req
);
3595 struct rpccli_spoolss_ReadPrinter_state
*state
= tevent_req_data(
3596 req
, struct rpccli_spoolss_ReadPrinter_state
);
3598 TALLOC_CTX
*mem_ctx
;
3600 if (state
->out_mem_ctx
) {
3601 mem_ctx
= state
->out_mem_ctx
;
3606 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3607 TALLOC_FREE(subreq
);
3608 if (!NT_STATUS_IS_OK(status
)) {
3609 tevent_req_nterror(req
, status
);
3613 /* Copy out parameters */
3614 memcpy(state
->orig
.out
.data
, state
->tmp
.out
.data
, (state
->tmp
.in
.data_size
) * sizeof(*state
->orig
.out
.data
));
3615 *state
->orig
.out
._data_size
= *state
->tmp
.out
._data_size
;
3618 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3620 /* Reset temporary structure */
3621 ZERO_STRUCT(state
->tmp
);
3623 tevent_req_done(req
);
3626 NTSTATUS
rpccli_spoolss_ReadPrinter_recv(struct tevent_req
*req
,
3627 TALLOC_CTX
*mem_ctx
,
3630 struct rpccli_spoolss_ReadPrinter_state
*state
= tevent_req_data(
3631 req
, struct rpccli_spoolss_ReadPrinter_state
);
3634 if (tevent_req_is_nterror(req
, &status
)) {
3635 tevent_req_received(req
);
3639 /* Steal possbile out parameters to the callers context */
3640 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3643 *result
= state
->orig
.out
.result
;
3645 tevent_req_received(req
);
3646 return NT_STATUS_OK
;
3649 NTSTATUS
rpccli_spoolss_ReadPrinter(struct rpc_pipe_client
*cli
,
3650 TALLOC_CTX
*mem_ctx
,
3651 struct policy_handle
*handle
/* [in] [ref] */,
3652 uint8_t *data
/* [out] [ref,size_is(data_size)] */,
3653 uint32_t data_size
/* [in] */,
3654 uint32_t *_data_size
/* [out] [ref] */,
3657 struct spoolss_ReadPrinter r
;
3661 r
.in
.handle
= handle
;
3662 r
.in
.data_size
= data_size
;
3664 status
= cli
->dispatch(cli
,
3667 NDR_SPOOLSS_READPRINTER
,
3670 if (!NT_STATUS_IS_OK(status
)) {
3674 if (NT_STATUS_IS_ERR(status
)) {
3678 /* Return variables */
3679 memcpy(data
, r
.out
.data
, (r
.in
.data_size
) * sizeof(*data
));
3680 *_data_size
= *r
.out
._data_size
;
3684 *werror
= r
.out
.result
;
3687 return werror_to_ntstatus(r
.out
.result
);
3690 struct rpccli_spoolss_EndDocPrinter_state
{
3691 struct spoolss_EndDocPrinter orig
;
3692 struct spoolss_EndDocPrinter tmp
;
3693 TALLOC_CTX
*out_mem_ctx
;
3694 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3697 static void rpccli_spoolss_EndDocPrinter_done(struct tevent_req
*subreq
);
3699 struct tevent_req
*rpccli_spoolss_EndDocPrinter_send(TALLOC_CTX
*mem_ctx
,
3700 struct tevent_context
*ev
,
3701 struct rpc_pipe_client
*cli
,
3702 struct policy_handle
*_handle
/* [in] [ref] */)
3704 struct tevent_req
*req
;
3705 struct rpccli_spoolss_EndDocPrinter_state
*state
;
3706 struct tevent_req
*subreq
;
3708 req
= tevent_req_create(mem_ctx
, &state
,
3709 struct rpccli_spoolss_EndDocPrinter_state
);
3713 state
->out_mem_ctx
= NULL
;
3714 state
->dispatch_recv
= cli
->dispatch_recv
;
3717 state
->orig
.in
.handle
= _handle
;
3719 /* Out parameters */
3722 ZERO_STRUCT(state
->orig
.out
.result
);
3724 /* make a temporary copy, that we pass to the dispatch function */
3725 state
->tmp
= state
->orig
;
3727 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3729 NDR_SPOOLSS_ENDDOCPRINTER
,
3731 if (tevent_req_nomem(subreq
, req
)) {
3732 return tevent_req_post(req
, ev
);
3734 tevent_req_set_callback(subreq
, rpccli_spoolss_EndDocPrinter_done
, req
);
3738 static void rpccli_spoolss_EndDocPrinter_done(struct tevent_req
*subreq
)
3740 struct tevent_req
*req
= tevent_req_callback_data(
3741 subreq
, struct tevent_req
);
3742 struct rpccli_spoolss_EndDocPrinter_state
*state
= tevent_req_data(
3743 req
, struct rpccli_spoolss_EndDocPrinter_state
);
3745 TALLOC_CTX
*mem_ctx
;
3747 if (state
->out_mem_ctx
) {
3748 mem_ctx
= state
->out_mem_ctx
;
3753 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3754 TALLOC_FREE(subreq
);
3755 if (!NT_STATUS_IS_OK(status
)) {
3756 tevent_req_nterror(req
, status
);
3760 /* Copy out parameters */
3763 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3765 /* Reset temporary structure */
3766 ZERO_STRUCT(state
->tmp
);
3768 tevent_req_done(req
);
3771 NTSTATUS
rpccli_spoolss_EndDocPrinter_recv(struct tevent_req
*req
,
3772 TALLOC_CTX
*mem_ctx
,
3775 struct rpccli_spoolss_EndDocPrinter_state
*state
= tevent_req_data(
3776 req
, struct rpccli_spoolss_EndDocPrinter_state
);
3779 if (tevent_req_is_nterror(req
, &status
)) {
3780 tevent_req_received(req
);
3784 /* Steal possbile out parameters to the callers context */
3785 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3788 *result
= state
->orig
.out
.result
;
3790 tevent_req_received(req
);
3791 return NT_STATUS_OK
;
3794 NTSTATUS
rpccli_spoolss_EndDocPrinter(struct rpc_pipe_client
*cli
,
3795 TALLOC_CTX
*mem_ctx
,
3796 struct policy_handle
*handle
/* [in] [ref] */,
3799 struct spoolss_EndDocPrinter r
;
3803 r
.in
.handle
= handle
;
3805 status
= cli
->dispatch(cli
,
3808 NDR_SPOOLSS_ENDDOCPRINTER
,
3811 if (!NT_STATUS_IS_OK(status
)) {
3815 if (NT_STATUS_IS_ERR(status
)) {
3819 /* Return variables */
3823 *werror
= r
.out
.result
;
3826 return werror_to_ntstatus(r
.out
.result
);
3829 struct rpccli_spoolss_AddJob_state
{
3830 struct spoolss_AddJob orig
;
3831 struct spoolss_AddJob tmp
;
3832 TALLOC_CTX
*out_mem_ctx
;
3833 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3836 static void rpccli_spoolss_AddJob_done(struct tevent_req
*subreq
);
3838 struct tevent_req
*rpccli_spoolss_AddJob_send(TALLOC_CTX
*mem_ctx
,
3839 struct tevent_context
*ev
,
3840 struct rpc_pipe_client
*cli
,
3841 struct policy_handle
*_handle
/* [in] [ref] */,
3842 uint32_t _level
/* [in] */,
3843 uint8_t *_buffer
/* [in,out] [unique,size_is(offered)] */,
3844 uint32_t _offered
/* [in] */,
3845 uint32_t *_needed
/* [out] [ref] */)
3847 struct tevent_req
*req
;
3848 struct rpccli_spoolss_AddJob_state
*state
;
3849 struct tevent_req
*subreq
;
3851 req
= tevent_req_create(mem_ctx
, &state
,
3852 struct rpccli_spoolss_AddJob_state
);
3856 state
->out_mem_ctx
= NULL
;
3857 state
->dispatch_recv
= cli
->dispatch_recv
;
3860 state
->orig
.in
.handle
= _handle
;
3861 state
->orig
.in
.level
= _level
;
3862 state
->orig
.in
.buffer
= _buffer
;
3863 state
->orig
.in
.offered
= _offered
;
3865 /* Out parameters */
3866 state
->orig
.out
.buffer
= _buffer
;
3867 state
->orig
.out
.needed
= _needed
;
3870 ZERO_STRUCT(state
->orig
.out
.result
);
3872 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3873 "rpccli_spoolss_AddJob_out_memory");
3874 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3875 return tevent_req_post(req
, ev
);
3878 /* make a temporary copy, that we pass to the dispatch function */
3879 state
->tmp
= state
->orig
;
3881 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3885 if (tevent_req_nomem(subreq
, req
)) {
3886 return tevent_req_post(req
, ev
);
3888 tevent_req_set_callback(subreq
, rpccli_spoolss_AddJob_done
, req
);
3892 static void rpccli_spoolss_AddJob_done(struct tevent_req
*subreq
)
3894 struct tevent_req
*req
= tevent_req_callback_data(
3895 subreq
, struct tevent_req
);
3896 struct rpccli_spoolss_AddJob_state
*state
= tevent_req_data(
3897 req
, struct rpccli_spoolss_AddJob_state
);
3899 TALLOC_CTX
*mem_ctx
;
3901 if (state
->out_mem_ctx
) {
3902 mem_ctx
= state
->out_mem_ctx
;
3907 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3908 TALLOC_FREE(subreq
);
3909 if (!NT_STATUS_IS_OK(status
)) {
3910 tevent_req_nterror(req
, status
);
3914 /* Copy out parameters */
3915 if (state
->orig
.out
.buffer
&& state
->tmp
.out
.buffer
) {
3916 memcpy(state
->orig
.out
.buffer
, state
->tmp
.out
.buffer
, (state
->tmp
.in
.offered
) * sizeof(*state
->orig
.out
.buffer
));
3918 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
3921 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3923 /* Reset temporary structure */
3924 ZERO_STRUCT(state
->tmp
);
3926 tevent_req_done(req
);
3929 NTSTATUS
rpccli_spoolss_AddJob_recv(struct tevent_req
*req
,
3930 TALLOC_CTX
*mem_ctx
,
3933 struct rpccli_spoolss_AddJob_state
*state
= tevent_req_data(
3934 req
, struct rpccli_spoolss_AddJob_state
);
3937 if (tevent_req_is_nterror(req
, &status
)) {
3938 tevent_req_received(req
);
3942 /* Steal possbile out parameters to the callers context */
3943 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3946 *result
= state
->orig
.out
.result
;
3948 tevent_req_received(req
);
3949 return NT_STATUS_OK
;
3952 NTSTATUS
rpccli_spoolss_AddJob(struct rpc_pipe_client
*cli
,
3953 TALLOC_CTX
*mem_ctx
,
3954 struct policy_handle
*handle
/* [in] [ref] */,
3955 uint32_t level
/* [in] */,
3956 uint8_t *buffer
/* [in,out] [unique,size_is(offered)] */,
3957 uint32_t offered
/* [in] */,
3958 uint32_t *needed
/* [out] [ref] */,
3961 struct spoolss_AddJob r
;
3965 r
.in
.handle
= handle
;
3967 r
.in
.buffer
= buffer
;
3968 r
.in
.offered
= offered
;
3970 status
= cli
->dispatch(cli
,
3976 if (!NT_STATUS_IS_OK(status
)) {
3980 if (NT_STATUS_IS_ERR(status
)) {
3984 /* Return variables */
3985 if (buffer
&& r
.out
.buffer
) {
3986 memcpy(buffer
, r
.out
.buffer
, (r
.in
.offered
) * sizeof(*buffer
));
3988 *needed
= *r
.out
.needed
;
3992 *werror
= r
.out
.result
;
3995 return werror_to_ntstatus(r
.out
.result
);
3998 struct rpccli_spoolss_ScheduleJob_state
{
3999 struct spoolss_ScheduleJob orig
;
4000 struct spoolss_ScheduleJob tmp
;
4001 TALLOC_CTX
*out_mem_ctx
;
4002 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4005 static void rpccli_spoolss_ScheduleJob_done(struct tevent_req
*subreq
);
4007 struct tevent_req
*rpccli_spoolss_ScheduleJob_send(TALLOC_CTX
*mem_ctx
,
4008 struct tevent_context
*ev
,
4009 struct rpc_pipe_client
*cli
,
4010 struct policy_handle
*_handle
/* [in] [ref] */,
4011 uint32_t _jobid
/* [in] */)
4013 struct tevent_req
*req
;
4014 struct rpccli_spoolss_ScheduleJob_state
*state
;
4015 struct tevent_req
*subreq
;
4017 req
= tevent_req_create(mem_ctx
, &state
,
4018 struct rpccli_spoolss_ScheduleJob_state
);
4022 state
->out_mem_ctx
= NULL
;
4023 state
->dispatch_recv
= cli
->dispatch_recv
;
4026 state
->orig
.in
.handle
= _handle
;
4027 state
->orig
.in
.jobid
= _jobid
;
4029 /* Out parameters */
4032 ZERO_STRUCT(state
->orig
.out
.result
);
4034 /* make a temporary copy, that we pass to the dispatch function */
4035 state
->tmp
= state
->orig
;
4037 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4039 NDR_SPOOLSS_SCHEDULEJOB
,
4041 if (tevent_req_nomem(subreq
, req
)) {
4042 return tevent_req_post(req
, ev
);
4044 tevent_req_set_callback(subreq
, rpccli_spoolss_ScheduleJob_done
, req
);
4048 static void rpccli_spoolss_ScheduleJob_done(struct tevent_req
*subreq
)
4050 struct tevent_req
*req
= tevent_req_callback_data(
4051 subreq
, struct tevent_req
);
4052 struct rpccli_spoolss_ScheduleJob_state
*state
= tevent_req_data(
4053 req
, struct rpccli_spoolss_ScheduleJob_state
);
4055 TALLOC_CTX
*mem_ctx
;
4057 if (state
->out_mem_ctx
) {
4058 mem_ctx
= state
->out_mem_ctx
;
4063 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4064 TALLOC_FREE(subreq
);
4065 if (!NT_STATUS_IS_OK(status
)) {
4066 tevent_req_nterror(req
, status
);
4070 /* Copy out parameters */
4073 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4075 /* Reset temporary structure */
4076 ZERO_STRUCT(state
->tmp
);
4078 tevent_req_done(req
);
4081 NTSTATUS
rpccli_spoolss_ScheduleJob_recv(struct tevent_req
*req
,
4082 TALLOC_CTX
*mem_ctx
,
4085 struct rpccli_spoolss_ScheduleJob_state
*state
= tevent_req_data(
4086 req
, struct rpccli_spoolss_ScheduleJob_state
);
4089 if (tevent_req_is_nterror(req
, &status
)) {
4090 tevent_req_received(req
);
4094 /* Steal possbile out parameters to the callers context */
4095 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4098 *result
= state
->orig
.out
.result
;
4100 tevent_req_received(req
);
4101 return NT_STATUS_OK
;
4104 NTSTATUS
rpccli_spoolss_ScheduleJob(struct rpc_pipe_client
*cli
,
4105 TALLOC_CTX
*mem_ctx
,
4106 struct policy_handle
*handle
/* [in] [ref] */,
4107 uint32_t jobid
/* [in] */,
4110 struct spoolss_ScheduleJob r
;
4114 r
.in
.handle
= handle
;
4117 status
= cli
->dispatch(cli
,
4120 NDR_SPOOLSS_SCHEDULEJOB
,
4123 if (!NT_STATUS_IS_OK(status
)) {
4127 if (NT_STATUS_IS_ERR(status
)) {
4131 /* Return variables */
4135 *werror
= r
.out
.result
;
4138 return werror_to_ntstatus(r
.out
.result
);
4141 struct rpccli_spoolss_GetPrinterData_state
{
4142 struct spoolss_GetPrinterData orig
;
4143 struct spoolss_GetPrinterData tmp
;
4144 TALLOC_CTX
*out_mem_ctx
;
4145 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4148 static void rpccli_spoolss_GetPrinterData_done(struct tevent_req
*subreq
);
4150 struct tevent_req
*rpccli_spoolss_GetPrinterData_send(TALLOC_CTX
*mem_ctx
,
4151 struct tevent_context
*ev
,
4152 struct rpc_pipe_client
*cli
,
4153 struct policy_handle
*_handle
/* [in] [ref] */,
4154 const char *_value_name
/* [in] [charset(UTF16)] */,
4155 uint32_t _offered
/* [in] */,
4156 enum winreg_Type
*_type
/* [out] [ref] */,
4157 union spoolss_PrinterData
*_data
/* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
4158 uint32_t *_needed
/* [out] [ref] */)
4160 struct tevent_req
*req
;
4161 struct rpccli_spoolss_GetPrinterData_state
*state
;
4162 struct tevent_req
*subreq
;
4164 req
= tevent_req_create(mem_ctx
, &state
,
4165 struct rpccli_spoolss_GetPrinterData_state
);
4169 state
->out_mem_ctx
= NULL
;
4170 state
->dispatch_recv
= cli
->dispatch_recv
;
4173 state
->orig
.in
.handle
= _handle
;
4174 state
->orig
.in
.value_name
= _value_name
;
4175 state
->orig
.in
.offered
= _offered
;
4177 /* Out parameters */
4178 state
->orig
.out
.type
= _type
;
4179 state
->orig
.out
.data
= _data
;
4180 state
->orig
.out
.needed
= _needed
;
4183 ZERO_STRUCT(state
->orig
.out
.result
);
4185 state
->out_mem_ctx
= talloc_named_const(state
, 0,
4186 "rpccli_spoolss_GetPrinterData_out_memory");
4187 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
4188 return tevent_req_post(req
, ev
);
4191 /* make a temporary copy, that we pass to the dispatch function */
4192 state
->tmp
= state
->orig
;
4194 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4196 NDR_SPOOLSS_GETPRINTERDATA
,
4198 if (tevent_req_nomem(subreq
, req
)) {
4199 return tevent_req_post(req
, ev
);
4201 tevent_req_set_callback(subreq
, rpccli_spoolss_GetPrinterData_done
, req
);
4205 static void rpccli_spoolss_GetPrinterData_done(struct tevent_req
*subreq
)
4207 struct tevent_req
*req
= tevent_req_callback_data(
4208 subreq
, struct tevent_req
);
4209 struct rpccli_spoolss_GetPrinterData_state
*state
= tevent_req_data(
4210 req
, struct rpccli_spoolss_GetPrinterData_state
);
4212 TALLOC_CTX
*mem_ctx
;
4214 if (state
->out_mem_ctx
) {
4215 mem_ctx
= state
->out_mem_ctx
;
4220 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4221 TALLOC_FREE(subreq
);
4222 if (!NT_STATUS_IS_OK(status
)) {
4223 tevent_req_nterror(req
, status
);
4227 /* Copy out parameters */
4228 *state
->orig
.out
.type
= *state
->tmp
.out
.type
;
4229 *state
->orig
.out
.data
= *state
->tmp
.out
.data
;
4230 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
4233 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4235 /* Reset temporary structure */
4236 ZERO_STRUCT(state
->tmp
);
4238 tevent_req_done(req
);
4241 NTSTATUS
rpccli_spoolss_GetPrinterData_recv(struct tevent_req
*req
,
4242 TALLOC_CTX
*mem_ctx
,
4245 struct rpccli_spoolss_GetPrinterData_state
*state
= tevent_req_data(
4246 req
, struct rpccli_spoolss_GetPrinterData_state
);
4249 if (tevent_req_is_nterror(req
, &status
)) {
4250 tevent_req_received(req
);
4254 /* Steal possbile out parameters to the callers context */
4255 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4258 *result
= state
->orig
.out
.result
;
4260 tevent_req_received(req
);
4261 return NT_STATUS_OK
;
4264 NTSTATUS
rpccli_spoolss_GetPrinterData(struct rpc_pipe_client
*cli
,
4265 TALLOC_CTX
*mem_ctx
,
4266 struct policy_handle
*handle
/* [in] [ref] */,
4267 const char *value_name
/* [in] [charset(UTF16)] */,
4268 uint32_t offered
/* [in] */,
4269 enum winreg_Type
*type
/* [out] [ref] */,
4270 union spoolss_PrinterData
*data
/* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
4271 uint32_t *needed
/* [out] [ref] */,
4274 struct spoolss_GetPrinterData r
;
4278 r
.in
.handle
= handle
;
4279 r
.in
.value_name
= value_name
;
4280 r
.in
.offered
= offered
;
4282 status
= cli
->dispatch(cli
,
4285 NDR_SPOOLSS_GETPRINTERDATA
,
4288 if (!NT_STATUS_IS_OK(status
)) {
4292 if (NT_STATUS_IS_ERR(status
)) {
4296 /* Return variables */
4297 *type
= *r
.out
.type
;
4298 *data
= *r
.out
.data
;
4299 *needed
= *r
.out
.needed
;
4303 *werror
= r
.out
.result
;
4306 return werror_to_ntstatus(r
.out
.result
);
4309 struct rpccli_spoolss_SetPrinterData_state
{
4310 struct spoolss_SetPrinterData orig
;
4311 struct spoolss_SetPrinterData tmp
;
4312 TALLOC_CTX
*out_mem_ctx
;
4313 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4316 static void rpccli_spoolss_SetPrinterData_done(struct tevent_req
*subreq
);
4318 struct tevent_req
*rpccli_spoolss_SetPrinterData_send(TALLOC_CTX
*mem_ctx
,
4319 struct tevent_context
*ev
,
4320 struct rpc_pipe_client
*cli
,
4321 struct policy_handle
*_handle
/* [in] [ref] */,
4322 const char *_value_name
/* [in] [charset(UTF16)] */,
4323 enum winreg_Type _type
/* [in] */,
4324 union spoolss_PrinterData _data
/* [in] [subcontext(4),switch_is(type)] */,
4325 uint32_t __offered
/* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */)
4327 struct tevent_req
*req
;
4328 struct rpccli_spoolss_SetPrinterData_state
*state
;
4329 struct tevent_req
*subreq
;
4331 req
= tevent_req_create(mem_ctx
, &state
,
4332 struct rpccli_spoolss_SetPrinterData_state
);
4336 state
->out_mem_ctx
= NULL
;
4337 state
->dispatch_recv
= cli
->dispatch_recv
;
4340 state
->orig
.in
.handle
= _handle
;
4341 state
->orig
.in
.value_name
= _value_name
;
4342 state
->orig
.in
.type
= _type
;
4343 state
->orig
.in
.data
= _data
;
4344 state
->orig
.in
._offered
= __offered
;
4346 /* Out parameters */
4349 ZERO_STRUCT(state
->orig
.out
.result
);
4351 /* make a temporary copy, that we pass to the dispatch function */
4352 state
->tmp
= state
->orig
;
4354 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4356 NDR_SPOOLSS_SETPRINTERDATA
,
4358 if (tevent_req_nomem(subreq
, req
)) {
4359 return tevent_req_post(req
, ev
);
4361 tevent_req_set_callback(subreq
, rpccli_spoolss_SetPrinterData_done
, req
);
4365 static void rpccli_spoolss_SetPrinterData_done(struct tevent_req
*subreq
)
4367 struct tevent_req
*req
= tevent_req_callback_data(
4368 subreq
, struct tevent_req
);
4369 struct rpccli_spoolss_SetPrinterData_state
*state
= tevent_req_data(
4370 req
, struct rpccli_spoolss_SetPrinterData_state
);
4372 TALLOC_CTX
*mem_ctx
;
4374 if (state
->out_mem_ctx
) {
4375 mem_ctx
= state
->out_mem_ctx
;
4380 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4381 TALLOC_FREE(subreq
);
4382 if (!NT_STATUS_IS_OK(status
)) {
4383 tevent_req_nterror(req
, status
);
4387 /* Copy out parameters */
4390 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4392 /* Reset temporary structure */
4393 ZERO_STRUCT(state
->tmp
);
4395 tevent_req_done(req
);
4398 NTSTATUS
rpccli_spoolss_SetPrinterData_recv(struct tevent_req
*req
,
4399 TALLOC_CTX
*mem_ctx
,
4402 struct rpccli_spoolss_SetPrinterData_state
*state
= tevent_req_data(
4403 req
, struct rpccli_spoolss_SetPrinterData_state
);
4406 if (tevent_req_is_nterror(req
, &status
)) {
4407 tevent_req_received(req
);
4411 /* Steal possbile out parameters to the callers context */
4412 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4415 *result
= state
->orig
.out
.result
;
4417 tevent_req_received(req
);
4418 return NT_STATUS_OK
;
4421 NTSTATUS
rpccli_spoolss_SetPrinterData(struct rpc_pipe_client
*cli
,
4422 TALLOC_CTX
*mem_ctx
,
4423 struct policy_handle
*handle
/* [in] [ref] */,
4424 const char *value_name
/* [in] [charset(UTF16)] */,
4425 enum winreg_Type type
/* [in] */,
4426 union spoolss_PrinterData data
/* [in] [subcontext(4),switch_is(type)] */,
4427 uint32_t _offered
/* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */,
4430 struct spoolss_SetPrinterData r
;
4434 r
.in
.handle
= handle
;
4435 r
.in
.value_name
= value_name
;
4438 r
.in
._offered
= _offered
;
4440 status
= cli
->dispatch(cli
,
4443 NDR_SPOOLSS_SETPRINTERDATA
,
4446 if (!NT_STATUS_IS_OK(status
)) {
4450 if (NT_STATUS_IS_ERR(status
)) {
4454 /* Return variables */
4458 *werror
= r
.out
.result
;
4461 return werror_to_ntstatus(r
.out
.result
);
4464 struct rpccli_spoolss_WaitForPrinterChange_state
{
4465 struct spoolss_WaitForPrinterChange orig
;
4466 struct spoolss_WaitForPrinterChange tmp
;
4467 TALLOC_CTX
*out_mem_ctx
;
4468 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4471 static void rpccli_spoolss_WaitForPrinterChange_done(struct tevent_req
*subreq
);
4473 struct tevent_req
*rpccli_spoolss_WaitForPrinterChange_send(TALLOC_CTX
*mem_ctx
,
4474 struct tevent_context
*ev
,
4475 struct rpc_pipe_client
*cli
)
4477 struct tevent_req
*req
;
4478 struct rpccli_spoolss_WaitForPrinterChange_state
*state
;
4479 struct tevent_req
*subreq
;
4481 req
= tevent_req_create(mem_ctx
, &state
,
4482 struct rpccli_spoolss_WaitForPrinterChange_state
);
4486 state
->out_mem_ctx
= NULL
;
4487 state
->dispatch_recv
= cli
->dispatch_recv
;
4491 /* Out parameters */
4494 ZERO_STRUCT(state
->orig
.out
.result
);
4496 /* make a temporary copy, that we pass to the dispatch function */
4497 state
->tmp
= state
->orig
;
4499 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4501 NDR_SPOOLSS_WAITFORPRINTERCHANGE
,
4503 if (tevent_req_nomem(subreq
, req
)) {
4504 return tevent_req_post(req
, ev
);
4506 tevent_req_set_callback(subreq
, rpccli_spoolss_WaitForPrinterChange_done
, req
);
4510 static void rpccli_spoolss_WaitForPrinterChange_done(struct tevent_req
*subreq
)
4512 struct tevent_req
*req
= tevent_req_callback_data(
4513 subreq
, struct tevent_req
);
4514 struct rpccli_spoolss_WaitForPrinterChange_state
*state
= tevent_req_data(
4515 req
, struct rpccli_spoolss_WaitForPrinterChange_state
);
4517 TALLOC_CTX
*mem_ctx
;
4519 if (state
->out_mem_ctx
) {
4520 mem_ctx
= state
->out_mem_ctx
;
4525 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4526 TALLOC_FREE(subreq
);
4527 if (!NT_STATUS_IS_OK(status
)) {
4528 tevent_req_nterror(req
, status
);
4532 /* Copy out parameters */
4535 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4537 /* Reset temporary structure */
4538 ZERO_STRUCT(state
->tmp
);
4540 tevent_req_done(req
);
4543 NTSTATUS
rpccli_spoolss_WaitForPrinterChange_recv(struct tevent_req
*req
,
4544 TALLOC_CTX
*mem_ctx
,
4547 struct rpccli_spoolss_WaitForPrinterChange_state
*state
= tevent_req_data(
4548 req
, struct rpccli_spoolss_WaitForPrinterChange_state
);
4551 if (tevent_req_is_nterror(req
, &status
)) {
4552 tevent_req_received(req
);
4556 /* Steal possbile out parameters to the callers context */
4557 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4560 *result
= state
->orig
.out
.result
;
4562 tevent_req_received(req
);
4563 return NT_STATUS_OK
;
4566 NTSTATUS
rpccli_spoolss_WaitForPrinterChange(struct rpc_pipe_client
*cli
,
4567 TALLOC_CTX
*mem_ctx
,
4570 struct spoolss_WaitForPrinterChange r
;
4575 status
= cli
->dispatch(cli
,
4578 NDR_SPOOLSS_WAITFORPRINTERCHANGE
,
4581 if (!NT_STATUS_IS_OK(status
)) {
4585 if (NT_STATUS_IS_ERR(status
)) {
4589 /* Return variables */
4593 *werror
= r
.out
.result
;
4596 return werror_to_ntstatus(r
.out
.result
);
4599 struct rpccli_spoolss_ClosePrinter_state
{
4600 struct spoolss_ClosePrinter orig
;
4601 struct spoolss_ClosePrinter tmp
;
4602 TALLOC_CTX
*out_mem_ctx
;
4603 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4606 static void rpccli_spoolss_ClosePrinter_done(struct tevent_req
*subreq
);
4608 struct tevent_req
*rpccli_spoolss_ClosePrinter_send(TALLOC_CTX
*mem_ctx
,
4609 struct tevent_context
*ev
,
4610 struct rpc_pipe_client
*cli
,
4611 struct policy_handle
*_handle
/* [in,out] [ref] */)
4613 struct tevent_req
*req
;
4614 struct rpccli_spoolss_ClosePrinter_state
*state
;
4615 struct tevent_req
*subreq
;
4617 req
= tevent_req_create(mem_ctx
, &state
,
4618 struct rpccli_spoolss_ClosePrinter_state
);
4622 state
->out_mem_ctx
= NULL
;
4623 state
->dispatch_recv
= cli
->dispatch_recv
;
4626 state
->orig
.in
.handle
= _handle
;
4628 /* Out parameters */
4629 state
->orig
.out
.handle
= _handle
;
4632 ZERO_STRUCT(state
->orig
.out
.result
);
4634 state
->out_mem_ctx
= talloc_named_const(state
, 0,
4635 "rpccli_spoolss_ClosePrinter_out_memory");
4636 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
4637 return tevent_req_post(req
, ev
);
4640 /* make a temporary copy, that we pass to the dispatch function */
4641 state
->tmp
= state
->orig
;
4643 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4645 NDR_SPOOLSS_CLOSEPRINTER
,
4647 if (tevent_req_nomem(subreq
, req
)) {
4648 return tevent_req_post(req
, ev
);
4650 tevent_req_set_callback(subreq
, rpccli_spoolss_ClosePrinter_done
, req
);
4654 static void rpccli_spoolss_ClosePrinter_done(struct tevent_req
*subreq
)
4656 struct tevent_req
*req
= tevent_req_callback_data(
4657 subreq
, struct tevent_req
);
4658 struct rpccli_spoolss_ClosePrinter_state
*state
= tevent_req_data(
4659 req
, struct rpccli_spoolss_ClosePrinter_state
);
4661 TALLOC_CTX
*mem_ctx
;
4663 if (state
->out_mem_ctx
) {
4664 mem_ctx
= state
->out_mem_ctx
;
4669 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4670 TALLOC_FREE(subreq
);
4671 if (!NT_STATUS_IS_OK(status
)) {
4672 tevent_req_nterror(req
, status
);
4676 /* Copy out parameters */
4677 *state
->orig
.out
.handle
= *state
->tmp
.out
.handle
;
4680 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4682 /* Reset temporary structure */
4683 ZERO_STRUCT(state
->tmp
);
4685 tevent_req_done(req
);
4688 NTSTATUS
rpccli_spoolss_ClosePrinter_recv(struct tevent_req
*req
,
4689 TALLOC_CTX
*mem_ctx
,
4692 struct rpccli_spoolss_ClosePrinter_state
*state
= tevent_req_data(
4693 req
, struct rpccli_spoolss_ClosePrinter_state
);
4696 if (tevent_req_is_nterror(req
, &status
)) {
4697 tevent_req_received(req
);
4701 /* Steal possbile out parameters to the callers context */
4702 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4705 *result
= state
->orig
.out
.result
;
4707 tevent_req_received(req
);
4708 return NT_STATUS_OK
;
4711 NTSTATUS
rpccli_spoolss_ClosePrinter(struct rpc_pipe_client
*cli
,
4712 TALLOC_CTX
*mem_ctx
,
4713 struct policy_handle
*handle
/* [in,out] [ref] */,
4716 struct spoolss_ClosePrinter r
;
4720 r
.in
.handle
= handle
;
4722 status
= cli
->dispatch(cli
,
4725 NDR_SPOOLSS_CLOSEPRINTER
,
4728 if (!NT_STATUS_IS_OK(status
)) {
4732 if (NT_STATUS_IS_ERR(status
)) {
4736 /* Return variables */
4737 *handle
= *r
.out
.handle
;
4741 *werror
= r
.out
.result
;
4744 return werror_to_ntstatus(r
.out
.result
);
4747 struct rpccli_spoolss_AddForm_state
{
4748 struct spoolss_AddForm orig
;
4749 struct spoolss_AddForm tmp
;
4750 TALLOC_CTX
*out_mem_ctx
;
4751 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4754 static void rpccli_spoolss_AddForm_done(struct tevent_req
*subreq
);
4756 struct tevent_req
*rpccli_spoolss_AddForm_send(TALLOC_CTX
*mem_ctx
,
4757 struct tevent_context
*ev
,
4758 struct rpc_pipe_client
*cli
,
4759 struct policy_handle
*_handle
/* [in] [ref] */,
4760 uint32_t _level
/* [in] */,
4761 union spoolss_AddFormInfo _info
/* [in] [switch_is(level)] */)
4763 struct tevent_req
*req
;
4764 struct rpccli_spoolss_AddForm_state
*state
;
4765 struct tevent_req
*subreq
;
4767 req
= tevent_req_create(mem_ctx
, &state
,
4768 struct rpccli_spoolss_AddForm_state
);
4772 state
->out_mem_ctx
= NULL
;
4773 state
->dispatch_recv
= cli
->dispatch_recv
;
4776 state
->orig
.in
.handle
= _handle
;
4777 state
->orig
.in
.level
= _level
;
4778 state
->orig
.in
.info
= _info
;
4780 /* Out parameters */
4783 ZERO_STRUCT(state
->orig
.out
.result
);
4785 /* make a temporary copy, that we pass to the dispatch function */
4786 state
->tmp
= state
->orig
;
4788 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4790 NDR_SPOOLSS_ADDFORM
,
4792 if (tevent_req_nomem(subreq
, req
)) {
4793 return tevent_req_post(req
, ev
);
4795 tevent_req_set_callback(subreq
, rpccli_spoolss_AddForm_done
, req
);
4799 static void rpccli_spoolss_AddForm_done(struct tevent_req
*subreq
)
4801 struct tevent_req
*req
= tevent_req_callback_data(
4802 subreq
, struct tevent_req
);
4803 struct rpccli_spoolss_AddForm_state
*state
= tevent_req_data(
4804 req
, struct rpccli_spoolss_AddForm_state
);
4806 TALLOC_CTX
*mem_ctx
;
4808 if (state
->out_mem_ctx
) {
4809 mem_ctx
= state
->out_mem_ctx
;
4814 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4815 TALLOC_FREE(subreq
);
4816 if (!NT_STATUS_IS_OK(status
)) {
4817 tevent_req_nterror(req
, status
);
4821 /* Copy out parameters */
4824 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4826 /* Reset temporary structure */
4827 ZERO_STRUCT(state
->tmp
);
4829 tevent_req_done(req
);
4832 NTSTATUS
rpccli_spoolss_AddForm_recv(struct tevent_req
*req
,
4833 TALLOC_CTX
*mem_ctx
,
4836 struct rpccli_spoolss_AddForm_state
*state
= tevent_req_data(
4837 req
, struct rpccli_spoolss_AddForm_state
);
4840 if (tevent_req_is_nterror(req
, &status
)) {
4841 tevent_req_received(req
);
4845 /* Steal possbile out parameters to the callers context */
4846 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4849 *result
= state
->orig
.out
.result
;
4851 tevent_req_received(req
);
4852 return NT_STATUS_OK
;
4855 NTSTATUS
rpccli_spoolss_AddForm(struct rpc_pipe_client
*cli
,
4856 TALLOC_CTX
*mem_ctx
,
4857 struct policy_handle
*handle
/* [in] [ref] */,
4858 uint32_t level
/* [in] */,
4859 union spoolss_AddFormInfo info
/* [in] [switch_is(level)] */,
4862 struct spoolss_AddForm r
;
4866 r
.in
.handle
= handle
;
4870 status
= cli
->dispatch(cli
,
4873 NDR_SPOOLSS_ADDFORM
,
4876 if (!NT_STATUS_IS_OK(status
)) {
4880 if (NT_STATUS_IS_ERR(status
)) {
4884 /* Return variables */
4888 *werror
= r
.out
.result
;
4891 return werror_to_ntstatus(r
.out
.result
);
4894 struct rpccli_spoolss_DeleteForm_state
{
4895 struct spoolss_DeleteForm orig
;
4896 struct spoolss_DeleteForm tmp
;
4897 TALLOC_CTX
*out_mem_ctx
;
4898 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4901 static void rpccli_spoolss_DeleteForm_done(struct tevent_req
*subreq
);
4903 struct tevent_req
*rpccli_spoolss_DeleteForm_send(TALLOC_CTX
*mem_ctx
,
4904 struct tevent_context
*ev
,
4905 struct rpc_pipe_client
*cli
,
4906 struct policy_handle
*_handle
/* [in] [ref] */,
4907 const char *_form_name
/* [in] [charset(UTF16)] */)
4909 struct tevent_req
*req
;
4910 struct rpccli_spoolss_DeleteForm_state
*state
;
4911 struct tevent_req
*subreq
;
4913 req
= tevent_req_create(mem_ctx
, &state
,
4914 struct rpccli_spoolss_DeleteForm_state
);
4918 state
->out_mem_ctx
= NULL
;
4919 state
->dispatch_recv
= cli
->dispatch_recv
;
4922 state
->orig
.in
.handle
= _handle
;
4923 state
->orig
.in
.form_name
= _form_name
;
4925 /* Out parameters */
4928 ZERO_STRUCT(state
->orig
.out
.result
);
4930 /* make a temporary copy, that we pass to the dispatch function */
4931 state
->tmp
= state
->orig
;
4933 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4935 NDR_SPOOLSS_DELETEFORM
,
4937 if (tevent_req_nomem(subreq
, req
)) {
4938 return tevent_req_post(req
, ev
);
4940 tevent_req_set_callback(subreq
, rpccli_spoolss_DeleteForm_done
, req
);
4944 static void rpccli_spoolss_DeleteForm_done(struct tevent_req
*subreq
)
4946 struct tevent_req
*req
= tevent_req_callback_data(
4947 subreq
, struct tevent_req
);
4948 struct rpccli_spoolss_DeleteForm_state
*state
= tevent_req_data(
4949 req
, struct rpccli_spoolss_DeleteForm_state
);
4951 TALLOC_CTX
*mem_ctx
;
4953 if (state
->out_mem_ctx
) {
4954 mem_ctx
= state
->out_mem_ctx
;
4959 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4960 TALLOC_FREE(subreq
);
4961 if (!NT_STATUS_IS_OK(status
)) {
4962 tevent_req_nterror(req
, status
);
4966 /* Copy out parameters */
4969 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4971 /* Reset temporary structure */
4972 ZERO_STRUCT(state
->tmp
);
4974 tevent_req_done(req
);
4977 NTSTATUS
rpccli_spoolss_DeleteForm_recv(struct tevent_req
*req
,
4978 TALLOC_CTX
*mem_ctx
,
4981 struct rpccli_spoolss_DeleteForm_state
*state
= tevent_req_data(
4982 req
, struct rpccli_spoolss_DeleteForm_state
);
4985 if (tevent_req_is_nterror(req
, &status
)) {
4986 tevent_req_received(req
);
4990 /* Steal possbile out parameters to the callers context */
4991 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4994 *result
= state
->orig
.out
.result
;
4996 tevent_req_received(req
);
4997 return NT_STATUS_OK
;
5000 NTSTATUS
rpccli_spoolss_DeleteForm(struct rpc_pipe_client
*cli
,
5001 TALLOC_CTX
*mem_ctx
,
5002 struct policy_handle
*handle
/* [in] [ref] */,
5003 const char *form_name
/* [in] [charset(UTF16)] */,
5006 struct spoolss_DeleteForm r
;
5010 r
.in
.handle
= handle
;
5011 r
.in
.form_name
= form_name
;
5013 status
= cli
->dispatch(cli
,
5016 NDR_SPOOLSS_DELETEFORM
,
5019 if (!NT_STATUS_IS_OK(status
)) {
5023 if (NT_STATUS_IS_ERR(status
)) {
5027 /* Return variables */
5031 *werror
= r
.out
.result
;
5034 return werror_to_ntstatus(r
.out
.result
);
5037 struct rpccli_spoolss_GetForm_state
{
5038 struct spoolss_GetForm orig
;
5039 struct spoolss_GetForm tmp
;
5040 TALLOC_CTX
*out_mem_ctx
;
5041 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5044 static void rpccli_spoolss_GetForm_done(struct tevent_req
*subreq
);
5046 struct tevent_req
*rpccli_spoolss_GetForm_send(TALLOC_CTX
*mem_ctx
,
5047 struct tevent_context
*ev
,
5048 struct rpc_pipe_client
*cli
,
5049 struct policy_handle
*_handle
/* [in] [ref] */,
5050 const char *_form_name
/* [in] [charset(UTF16)] */,
5051 uint32_t _level
/* [in] */,
5052 DATA_BLOB
*_buffer
/* [in] [unique] */,
5053 uint32_t _offered
/* [in] */,
5054 union spoolss_FormInfo
*_info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
5055 uint32_t *_needed
/* [out] [ref] */)
5057 struct tevent_req
*req
;
5058 struct rpccli_spoolss_GetForm_state
*state
;
5059 struct tevent_req
*subreq
;
5061 req
= tevent_req_create(mem_ctx
, &state
,
5062 struct rpccli_spoolss_GetForm_state
);
5066 state
->out_mem_ctx
= NULL
;
5067 state
->dispatch_recv
= cli
->dispatch_recv
;
5070 state
->orig
.in
.handle
= _handle
;
5071 state
->orig
.in
.form_name
= _form_name
;
5072 state
->orig
.in
.level
= _level
;
5073 state
->orig
.in
.buffer
= _buffer
;
5074 state
->orig
.in
.offered
= _offered
;
5076 /* Out parameters */
5077 state
->orig
.out
.info
= _info
;
5078 state
->orig
.out
.needed
= _needed
;
5081 ZERO_STRUCT(state
->orig
.out
.result
);
5083 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5084 "rpccli_spoolss_GetForm_out_memory");
5085 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5086 return tevent_req_post(req
, ev
);
5089 /* make a temporary copy, that we pass to the dispatch function */
5090 state
->tmp
= state
->orig
;
5092 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5094 NDR_SPOOLSS_GETFORM
,
5096 if (tevent_req_nomem(subreq
, req
)) {
5097 return tevent_req_post(req
, ev
);
5099 tevent_req_set_callback(subreq
, rpccli_spoolss_GetForm_done
, req
);
5103 static void rpccli_spoolss_GetForm_done(struct tevent_req
*subreq
)
5105 struct tevent_req
*req
= tevent_req_callback_data(
5106 subreq
, struct tevent_req
);
5107 struct rpccli_spoolss_GetForm_state
*state
= tevent_req_data(
5108 req
, struct rpccli_spoolss_GetForm_state
);
5110 TALLOC_CTX
*mem_ctx
;
5112 if (state
->out_mem_ctx
) {
5113 mem_ctx
= state
->out_mem_ctx
;
5118 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5119 TALLOC_FREE(subreq
);
5120 if (!NT_STATUS_IS_OK(status
)) {
5121 tevent_req_nterror(req
, status
);
5125 /* Copy out parameters */
5126 if (state
->orig
.out
.info
&& state
->tmp
.out
.info
) {
5127 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
5129 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
5132 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5134 /* Reset temporary structure */
5135 ZERO_STRUCT(state
->tmp
);
5137 tevent_req_done(req
);
5140 NTSTATUS
rpccli_spoolss_GetForm_recv(struct tevent_req
*req
,
5141 TALLOC_CTX
*mem_ctx
,
5144 struct rpccli_spoolss_GetForm_state
*state
= tevent_req_data(
5145 req
, struct rpccli_spoolss_GetForm_state
);
5148 if (tevent_req_is_nterror(req
, &status
)) {
5149 tevent_req_received(req
);
5153 /* Steal possbile out parameters to the callers context */
5154 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5157 *result
= state
->orig
.out
.result
;
5159 tevent_req_received(req
);
5160 return NT_STATUS_OK
;
5163 NTSTATUS
rpccli_spoolss_GetForm(struct rpc_pipe_client
*cli
,
5164 TALLOC_CTX
*mem_ctx
,
5165 struct policy_handle
*handle
/* [in] [ref] */,
5166 const char *form_name
/* [in] [charset(UTF16)] */,
5167 uint32_t level
/* [in] */,
5168 DATA_BLOB
*buffer
/* [in] [unique] */,
5169 uint32_t offered
/* [in] */,
5170 union spoolss_FormInfo
*info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
5171 uint32_t *needed
/* [out] [ref] */,
5174 struct spoolss_GetForm r
;
5178 r
.in
.handle
= handle
;
5179 r
.in
.form_name
= form_name
;
5181 r
.in
.buffer
= buffer
;
5182 r
.in
.offered
= offered
;
5184 status
= cli
->dispatch(cli
,
5187 NDR_SPOOLSS_GETFORM
,
5190 if (!NT_STATUS_IS_OK(status
)) {
5194 if (NT_STATUS_IS_ERR(status
)) {
5198 /* Return variables */
5199 if (info
&& r
.out
.info
) {
5200 *info
= *r
.out
.info
;
5202 *needed
= *r
.out
.needed
;
5206 *werror
= r
.out
.result
;
5209 return werror_to_ntstatus(r
.out
.result
);
5212 struct rpccli_spoolss_SetForm_state
{
5213 struct spoolss_SetForm orig
;
5214 struct spoolss_SetForm tmp
;
5215 TALLOC_CTX
*out_mem_ctx
;
5216 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5219 static void rpccli_spoolss_SetForm_done(struct tevent_req
*subreq
);
5221 struct tevent_req
*rpccli_spoolss_SetForm_send(TALLOC_CTX
*mem_ctx
,
5222 struct tevent_context
*ev
,
5223 struct rpc_pipe_client
*cli
,
5224 struct policy_handle
*_handle
/* [in] [ref] */,
5225 const char *_form_name
/* [in] [charset(UTF16)] */,
5226 uint32_t _level
/* [in] */,
5227 union spoolss_AddFormInfo _info
/* [in] [switch_is(level)] */)
5229 struct tevent_req
*req
;
5230 struct rpccli_spoolss_SetForm_state
*state
;
5231 struct tevent_req
*subreq
;
5233 req
= tevent_req_create(mem_ctx
, &state
,
5234 struct rpccli_spoolss_SetForm_state
);
5238 state
->out_mem_ctx
= NULL
;
5239 state
->dispatch_recv
= cli
->dispatch_recv
;
5242 state
->orig
.in
.handle
= _handle
;
5243 state
->orig
.in
.form_name
= _form_name
;
5244 state
->orig
.in
.level
= _level
;
5245 state
->orig
.in
.info
= _info
;
5247 /* Out parameters */
5250 ZERO_STRUCT(state
->orig
.out
.result
);
5252 /* make a temporary copy, that we pass to the dispatch function */
5253 state
->tmp
= state
->orig
;
5255 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5257 NDR_SPOOLSS_SETFORM
,
5259 if (tevent_req_nomem(subreq
, req
)) {
5260 return tevent_req_post(req
, ev
);
5262 tevent_req_set_callback(subreq
, rpccli_spoolss_SetForm_done
, req
);
5266 static void rpccli_spoolss_SetForm_done(struct tevent_req
*subreq
)
5268 struct tevent_req
*req
= tevent_req_callback_data(
5269 subreq
, struct tevent_req
);
5270 struct rpccli_spoolss_SetForm_state
*state
= tevent_req_data(
5271 req
, struct rpccli_spoolss_SetForm_state
);
5273 TALLOC_CTX
*mem_ctx
;
5275 if (state
->out_mem_ctx
) {
5276 mem_ctx
= state
->out_mem_ctx
;
5281 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5282 TALLOC_FREE(subreq
);
5283 if (!NT_STATUS_IS_OK(status
)) {
5284 tevent_req_nterror(req
, status
);
5288 /* Copy out parameters */
5291 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5293 /* Reset temporary structure */
5294 ZERO_STRUCT(state
->tmp
);
5296 tevent_req_done(req
);
5299 NTSTATUS
rpccli_spoolss_SetForm_recv(struct tevent_req
*req
,
5300 TALLOC_CTX
*mem_ctx
,
5303 struct rpccli_spoolss_SetForm_state
*state
= tevent_req_data(
5304 req
, struct rpccli_spoolss_SetForm_state
);
5307 if (tevent_req_is_nterror(req
, &status
)) {
5308 tevent_req_received(req
);
5312 /* Steal possbile out parameters to the callers context */
5313 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5316 *result
= state
->orig
.out
.result
;
5318 tevent_req_received(req
);
5319 return NT_STATUS_OK
;
5322 NTSTATUS
rpccli_spoolss_SetForm(struct rpc_pipe_client
*cli
,
5323 TALLOC_CTX
*mem_ctx
,
5324 struct policy_handle
*handle
/* [in] [ref] */,
5325 const char *form_name
/* [in] [charset(UTF16)] */,
5326 uint32_t level
/* [in] */,
5327 union spoolss_AddFormInfo info
/* [in] [switch_is(level)] */,
5330 struct spoolss_SetForm r
;
5334 r
.in
.handle
= handle
;
5335 r
.in
.form_name
= form_name
;
5339 status
= cli
->dispatch(cli
,
5342 NDR_SPOOLSS_SETFORM
,
5345 if (!NT_STATUS_IS_OK(status
)) {
5349 if (NT_STATUS_IS_ERR(status
)) {
5353 /* Return variables */
5357 *werror
= r
.out
.result
;
5360 return werror_to_ntstatus(r
.out
.result
);
5363 struct rpccli_spoolss_EnumForms_state
{
5364 struct spoolss_EnumForms orig
;
5365 struct spoolss_EnumForms tmp
;
5366 TALLOC_CTX
*out_mem_ctx
;
5367 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5370 static void rpccli_spoolss_EnumForms_done(struct tevent_req
*subreq
);
5372 struct tevent_req
*rpccli_spoolss_EnumForms_send(TALLOC_CTX
*mem_ctx
,
5373 struct tevent_context
*ev
,
5374 struct rpc_pipe_client
*cli
,
5375 struct policy_handle
*_handle
/* [in] [ref] */,
5376 uint32_t _level
/* [in] */,
5377 DATA_BLOB
*_buffer
/* [in] [unique] */,
5378 uint32_t _offered
/* [in] */,
5379 uint32_t *_count
/* [out] [ref] */,
5380 union spoolss_FormInfo
**_info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
5381 uint32_t *_needed
/* [out] [ref] */)
5383 struct tevent_req
*req
;
5384 struct rpccli_spoolss_EnumForms_state
*state
;
5385 struct tevent_req
*subreq
;
5387 req
= tevent_req_create(mem_ctx
, &state
,
5388 struct rpccli_spoolss_EnumForms_state
);
5392 state
->out_mem_ctx
= NULL
;
5393 state
->dispatch_recv
= cli
->dispatch_recv
;
5396 state
->orig
.in
.handle
= _handle
;
5397 state
->orig
.in
.level
= _level
;
5398 state
->orig
.in
.buffer
= _buffer
;
5399 state
->orig
.in
.offered
= _offered
;
5401 /* Out parameters */
5402 state
->orig
.out
.count
= _count
;
5403 state
->orig
.out
.info
= _info
;
5404 state
->orig
.out
.needed
= _needed
;
5407 ZERO_STRUCT(state
->orig
.out
.result
);
5409 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5410 "rpccli_spoolss_EnumForms_out_memory");
5411 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5412 return tevent_req_post(req
, ev
);
5415 /* make a temporary copy, that we pass to the dispatch function */
5416 state
->tmp
= state
->orig
;
5418 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5420 NDR_SPOOLSS_ENUMFORMS
,
5422 if (tevent_req_nomem(subreq
, req
)) {
5423 return tevent_req_post(req
, ev
);
5425 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumForms_done
, req
);
5429 static void rpccli_spoolss_EnumForms_done(struct tevent_req
*subreq
)
5431 struct tevent_req
*req
= tevent_req_callback_data(
5432 subreq
, struct tevent_req
);
5433 struct rpccli_spoolss_EnumForms_state
*state
= tevent_req_data(
5434 req
, struct rpccli_spoolss_EnumForms_state
);
5436 TALLOC_CTX
*mem_ctx
;
5438 if (state
->out_mem_ctx
) {
5439 mem_ctx
= state
->out_mem_ctx
;
5444 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5445 TALLOC_FREE(subreq
);
5446 if (!NT_STATUS_IS_OK(status
)) {
5447 tevent_req_nterror(req
, status
);
5451 /* Copy out parameters */
5452 *state
->orig
.out
.count
= *state
->tmp
.out
.count
;
5453 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
5454 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
5457 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5459 /* Reset temporary structure */
5460 ZERO_STRUCT(state
->tmp
);
5462 tevent_req_done(req
);
5465 NTSTATUS
rpccli_spoolss_EnumForms_recv(struct tevent_req
*req
,
5466 TALLOC_CTX
*mem_ctx
,
5469 struct rpccli_spoolss_EnumForms_state
*state
= tevent_req_data(
5470 req
, struct rpccli_spoolss_EnumForms_state
);
5473 if (tevent_req_is_nterror(req
, &status
)) {
5474 tevent_req_received(req
);
5478 /* Steal possbile out parameters to the callers context */
5479 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5482 *result
= state
->orig
.out
.result
;
5484 tevent_req_received(req
);
5485 return NT_STATUS_OK
;
5488 NTSTATUS
rpccli_spoolss_EnumForms(struct rpc_pipe_client
*cli
,
5489 TALLOC_CTX
*mem_ctx
,
5490 struct policy_handle
*handle
/* [in] [ref] */,
5491 uint32_t level
/* [in] */,
5492 DATA_BLOB
*buffer
/* [in] [unique] */,
5493 uint32_t offered
/* [in] */,
5494 uint32_t *count
/* [out] [ref] */,
5495 union spoolss_FormInfo
**info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
5496 uint32_t *needed
/* [out] [ref] */,
5499 struct spoolss_EnumForms r
;
5503 r
.in
.handle
= handle
;
5505 r
.in
.buffer
= buffer
;
5506 r
.in
.offered
= offered
;
5508 status
= cli
->dispatch(cli
,
5511 NDR_SPOOLSS_ENUMFORMS
,
5514 if (!NT_STATUS_IS_OK(status
)) {
5518 if (NT_STATUS_IS_ERR(status
)) {
5522 /* Return variables */
5523 *count
= *r
.out
.count
;
5524 *info
= *r
.out
.info
;
5525 *needed
= *r
.out
.needed
;
5529 *werror
= r
.out
.result
;
5532 return werror_to_ntstatus(r
.out
.result
);
5535 struct rpccli_spoolss_EnumPorts_state
{
5536 struct spoolss_EnumPorts orig
;
5537 struct spoolss_EnumPorts tmp
;
5538 TALLOC_CTX
*out_mem_ctx
;
5539 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5542 static void rpccli_spoolss_EnumPorts_done(struct tevent_req
*subreq
);
5544 struct tevent_req
*rpccli_spoolss_EnumPorts_send(TALLOC_CTX
*mem_ctx
,
5545 struct tevent_context
*ev
,
5546 struct rpc_pipe_client
*cli
,
5547 const char *_servername
/* [in] [unique,charset(UTF16)] */,
5548 uint32_t _level
/* [in] */,
5549 DATA_BLOB
*_buffer
/* [in] [unique] */,
5550 uint32_t _offered
/* [in] */,
5551 uint32_t *_count
/* [out] [ref] */,
5552 union spoolss_PortInfo
**_info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
5553 uint32_t *_needed
/* [out] [ref] */)
5555 struct tevent_req
*req
;
5556 struct rpccli_spoolss_EnumPorts_state
*state
;
5557 struct tevent_req
*subreq
;
5559 req
= tevent_req_create(mem_ctx
, &state
,
5560 struct rpccli_spoolss_EnumPorts_state
);
5564 state
->out_mem_ctx
= NULL
;
5565 state
->dispatch_recv
= cli
->dispatch_recv
;
5568 state
->orig
.in
.servername
= _servername
;
5569 state
->orig
.in
.level
= _level
;
5570 state
->orig
.in
.buffer
= _buffer
;
5571 state
->orig
.in
.offered
= _offered
;
5573 /* Out parameters */
5574 state
->orig
.out
.count
= _count
;
5575 state
->orig
.out
.info
= _info
;
5576 state
->orig
.out
.needed
= _needed
;
5579 ZERO_STRUCT(state
->orig
.out
.result
);
5581 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5582 "rpccli_spoolss_EnumPorts_out_memory");
5583 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5584 return tevent_req_post(req
, ev
);
5587 /* make a temporary copy, that we pass to the dispatch function */
5588 state
->tmp
= state
->orig
;
5590 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5592 NDR_SPOOLSS_ENUMPORTS
,
5594 if (tevent_req_nomem(subreq
, req
)) {
5595 return tevent_req_post(req
, ev
);
5597 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumPorts_done
, req
);
5601 static void rpccli_spoolss_EnumPorts_done(struct tevent_req
*subreq
)
5603 struct tevent_req
*req
= tevent_req_callback_data(
5604 subreq
, struct tevent_req
);
5605 struct rpccli_spoolss_EnumPorts_state
*state
= tevent_req_data(
5606 req
, struct rpccli_spoolss_EnumPorts_state
);
5608 TALLOC_CTX
*mem_ctx
;
5610 if (state
->out_mem_ctx
) {
5611 mem_ctx
= state
->out_mem_ctx
;
5616 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5617 TALLOC_FREE(subreq
);
5618 if (!NT_STATUS_IS_OK(status
)) {
5619 tevent_req_nterror(req
, status
);
5623 /* Copy out parameters */
5624 *state
->orig
.out
.count
= *state
->tmp
.out
.count
;
5625 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
5626 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
5629 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5631 /* Reset temporary structure */
5632 ZERO_STRUCT(state
->tmp
);
5634 tevent_req_done(req
);
5637 NTSTATUS
rpccli_spoolss_EnumPorts_recv(struct tevent_req
*req
,
5638 TALLOC_CTX
*mem_ctx
,
5641 struct rpccli_spoolss_EnumPorts_state
*state
= tevent_req_data(
5642 req
, struct rpccli_spoolss_EnumPorts_state
);
5645 if (tevent_req_is_nterror(req
, &status
)) {
5646 tevent_req_received(req
);
5650 /* Steal possbile out parameters to the callers context */
5651 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5654 *result
= state
->orig
.out
.result
;
5656 tevent_req_received(req
);
5657 return NT_STATUS_OK
;
5660 NTSTATUS
rpccli_spoolss_EnumPorts(struct rpc_pipe_client
*cli
,
5661 TALLOC_CTX
*mem_ctx
,
5662 const char *servername
/* [in] [unique,charset(UTF16)] */,
5663 uint32_t level
/* [in] */,
5664 DATA_BLOB
*buffer
/* [in] [unique] */,
5665 uint32_t offered
/* [in] */,
5666 uint32_t *count
/* [out] [ref] */,
5667 union spoolss_PortInfo
**info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
5668 uint32_t *needed
/* [out] [ref] */,
5671 struct spoolss_EnumPorts r
;
5675 r
.in
.servername
= servername
;
5677 r
.in
.buffer
= buffer
;
5678 r
.in
.offered
= offered
;
5680 status
= cli
->dispatch(cli
,
5683 NDR_SPOOLSS_ENUMPORTS
,
5686 if (!NT_STATUS_IS_OK(status
)) {
5690 if (NT_STATUS_IS_ERR(status
)) {
5694 /* Return variables */
5695 *count
= *r
.out
.count
;
5696 *info
= *r
.out
.info
;
5697 *needed
= *r
.out
.needed
;
5701 *werror
= r
.out
.result
;
5704 return werror_to_ntstatus(r
.out
.result
);
5707 struct rpccli_spoolss_EnumMonitors_state
{
5708 struct spoolss_EnumMonitors orig
;
5709 struct spoolss_EnumMonitors tmp
;
5710 TALLOC_CTX
*out_mem_ctx
;
5711 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5714 static void rpccli_spoolss_EnumMonitors_done(struct tevent_req
*subreq
);
5716 struct tevent_req
*rpccli_spoolss_EnumMonitors_send(TALLOC_CTX
*mem_ctx
,
5717 struct tevent_context
*ev
,
5718 struct rpc_pipe_client
*cli
,
5719 const char *_servername
/* [in] [unique,charset(UTF16)] */,
5720 uint32_t _level
/* [in] */,
5721 DATA_BLOB
*_buffer
/* [in] [unique] */,
5722 uint32_t _offered
/* [in] */,
5723 uint32_t *_count
/* [out] [ref] */,
5724 union spoolss_MonitorInfo
**_info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
5725 uint32_t *_needed
/* [out] [ref] */)
5727 struct tevent_req
*req
;
5728 struct rpccli_spoolss_EnumMonitors_state
*state
;
5729 struct tevent_req
*subreq
;
5731 req
= tevent_req_create(mem_ctx
, &state
,
5732 struct rpccli_spoolss_EnumMonitors_state
);
5736 state
->out_mem_ctx
= NULL
;
5737 state
->dispatch_recv
= cli
->dispatch_recv
;
5740 state
->orig
.in
.servername
= _servername
;
5741 state
->orig
.in
.level
= _level
;
5742 state
->orig
.in
.buffer
= _buffer
;
5743 state
->orig
.in
.offered
= _offered
;
5745 /* Out parameters */
5746 state
->orig
.out
.count
= _count
;
5747 state
->orig
.out
.info
= _info
;
5748 state
->orig
.out
.needed
= _needed
;
5751 ZERO_STRUCT(state
->orig
.out
.result
);
5753 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5754 "rpccli_spoolss_EnumMonitors_out_memory");
5755 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5756 return tevent_req_post(req
, ev
);
5759 /* make a temporary copy, that we pass to the dispatch function */
5760 state
->tmp
= state
->orig
;
5762 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5764 NDR_SPOOLSS_ENUMMONITORS
,
5766 if (tevent_req_nomem(subreq
, req
)) {
5767 return tevent_req_post(req
, ev
);
5769 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumMonitors_done
, req
);
5773 static void rpccli_spoolss_EnumMonitors_done(struct tevent_req
*subreq
)
5775 struct tevent_req
*req
= tevent_req_callback_data(
5776 subreq
, struct tevent_req
);
5777 struct rpccli_spoolss_EnumMonitors_state
*state
= tevent_req_data(
5778 req
, struct rpccli_spoolss_EnumMonitors_state
);
5780 TALLOC_CTX
*mem_ctx
;
5782 if (state
->out_mem_ctx
) {
5783 mem_ctx
= state
->out_mem_ctx
;
5788 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5789 TALLOC_FREE(subreq
);
5790 if (!NT_STATUS_IS_OK(status
)) {
5791 tevent_req_nterror(req
, status
);
5795 /* Copy out parameters */
5796 *state
->orig
.out
.count
= *state
->tmp
.out
.count
;
5797 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
5798 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
5801 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5803 /* Reset temporary structure */
5804 ZERO_STRUCT(state
->tmp
);
5806 tevent_req_done(req
);
5809 NTSTATUS
rpccli_spoolss_EnumMonitors_recv(struct tevent_req
*req
,
5810 TALLOC_CTX
*mem_ctx
,
5813 struct rpccli_spoolss_EnumMonitors_state
*state
= tevent_req_data(
5814 req
, struct rpccli_spoolss_EnumMonitors_state
);
5817 if (tevent_req_is_nterror(req
, &status
)) {
5818 tevent_req_received(req
);
5822 /* Steal possbile out parameters to the callers context */
5823 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5826 *result
= state
->orig
.out
.result
;
5828 tevent_req_received(req
);
5829 return NT_STATUS_OK
;
5832 NTSTATUS
rpccli_spoolss_EnumMonitors(struct rpc_pipe_client
*cli
,
5833 TALLOC_CTX
*mem_ctx
,
5834 const char *servername
/* [in] [unique,charset(UTF16)] */,
5835 uint32_t level
/* [in] */,
5836 DATA_BLOB
*buffer
/* [in] [unique] */,
5837 uint32_t offered
/* [in] */,
5838 uint32_t *count
/* [out] [ref] */,
5839 union spoolss_MonitorInfo
**info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
5840 uint32_t *needed
/* [out] [ref] */,
5843 struct spoolss_EnumMonitors r
;
5847 r
.in
.servername
= servername
;
5849 r
.in
.buffer
= buffer
;
5850 r
.in
.offered
= offered
;
5852 status
= cli
->dispatch(cli
,
5855 NDR_SPOOLSS_ENUMMONITORS
,
5858 if (!NT_STATUS_IS_OK(status
)) {
5862 if (NT_STATUS_IS_ERR(status
)) {
5866 /* Return variables */
5867 *count
= *r
.out
.count
;
5868 *info
= *r
.out
.info
;
5869 *needed
= *r
.out
.needed
;
5873 *werror
= r
.out
.result
;
5876 return werror_to_ntstatus(r
.out
.result
);
5879 struct rpccli_spoolss_AddPort_state
{
5880 struct spoolss_AddPort orig
;
5881 struct spoolss_AddPort tmp
;
5882 TALLOC_CTX
*out_mem_ctx
;
5883 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5886 static void rpccli_spoolss_AddPort_done(struct tevent_req
*subreq
);
5888 struct tevent_req
*rpccli_spoolss_AddPort_send(TALLOC_CTX
*mem_ctx
,
5889 struct tevent_context
*ev
,
5890 struct rpc_pipe_client
*cli
,
5891 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
5892 uint32_t _unknown
/* [in] */,
5893 const char *_monitor_name
/* [in] [charset(UTF16)] */)
5895 struct tevent_req
*req
;
5896 struct rpccli_spoolss_AddPort_state
*state
;
5897 struct tevent_req
*subreq
;
5899 req
= tevent_req_create(mem_ctx
, &state
,
5900 struct rpccli_spoolss_AddPort_state
);
5904 state
->out_mem_ctx
= NULL
;
5905 state
->dispatch_recv
= cli
->dispatch_recv
;
5908 state
->orig
.in
.server_name
= _server_name
;
5909 state
->orig
.in
.unknown
= _unknown
;
5910 state
->orig
.in
.monitor_name
= _monitor_name
;
5912 /* Out parameters */
5915 ZERO_STRUCT(state
->orig
.out
.result
);
5917 /* make a temporary copy, that we pass to the dispatch function */
5918 state
->tmp
= state
->orig
;
5920 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5922 NDR_SPOOLSS_ADDPORT
,
5924 if (tevent_req_nomem(subreq
, req
)) {
5925 return tevent_req_post(req
, ev
);
5927 tevent_req_set_callback(subreq
, rpccli_spoolss_AddPort_done
, req
);
5931 static void rpccli_spoolss_AddPort_done(struct tevent_req
*subreq
)
5933 struct tevent_req
*req
= tevent_req_callback_data(
5934 subreq
, struct tevent_req
);
5935 struct rpccli_spoolss_AddPort_state
*state
= tevent_req_data(
5936 req
, struct rpccli_spoolss_AddPort_state
);
5938 TALLOC_CTX
*mem_ctx
;
5940 if (state
->out_mem_ctx
) {
5941 mem_ctx
= state
->out_mem_ctx
;
5946 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5947 TALLOC_FREE(subreq
);
5948 if (!NT_STATUS_IS_OK(status
)) {
5949 tevent_req_nterror(req
, status
);
5953 /* Copy out parameters */
5956 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5958 /* Reset temporary structure */
5959 ZERO_STRUCT(state
->tmp
);
5961 tevent_req_done(req
);
5964 NTSTATUS
rpccli_spoolss_AddPort_recv(struct tevent_req
*req
,
5965 TALLOC_CTX
*mem_ctx
,
5968 struct rpccli_spoolss_AddPort_state
*state
= tevent_req_data(
5969 req
, struct rpccli_spoolss_AddPort_state
);
5972 if (tevent_req_is_nterror(req
, &status
)) {
5973 tevent_req_received(req
);
5977 /* Steal possbile out parameters to the callers context */
5978 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5981 *result
= state
->orig
.out
.result
;
5983 tevent_req_received(req
);
5984 return NT_STATUS_OK
;
5987 NTSTATUS
rpccli_spoolss_AddPort(struct rpc_pipe_client
*cli
,
5988 TALLOC_CTX
*mem_ctx
,
5989 const char *server_name
/* [in] [unique,charset(UTF16)] */,
5990 uint32_t unknown
/* [in] */,
5991 const char *monitor_name
/* [in] [charset(UTF16)] */,
5994 struct spoolss_AddPort r
;
5998 r
.in
.server_name
= server_name
;
5999 r
.in
.unknown
= unknown
;
6000 r
.in
.monitor_name
= monitor_name
;
6002 status
= cli
->dispatch(cli
,
6005 NDR_SPOOLSS_ADDPORT
,
6008 if (!NT_STATUS_IS_OK(status
)) {
6012 if (NT_STATUS_IS_ERR(status
)) {
6016 /* Return variables */
6020 *werror
= r
.out
.result
;
6023 return werror_to_ntstatus(r
.out
.result
);
6026 struct rpccli_spoolss_ConfigurePort_state
{
6027 struct spoolss_ConfigurePort orig
;
6028 struct spoolss_ConfigurePort tmp
;
6029 TALLOC_CTX
*out_mem_ctx
;
6030 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6033 static void rpccli_spoolss_ConfigurePort_done(struct tevent_req
*subreq
);
6035 struct tevent_req
*rpccli_spoolss_ConfigurePort_send(TALLOC_CTX
*mem_ctx
,
6036 struct tevent_context
*ev
,
6037 struct rpc_pipe_client
*cli
)
6039 struct tevent_req
*req
;
6040 struct rpccli_spoolss_ConfigurePort_state
*state
;
6041 struct tevent_req
*subreq
;
6043 req
= tevent_req_create(mem_ctx
, &state
,
6044 struct rpccli_spoolss_ConfigurePort_state
);
6048 state
->out_mem_ctx
= NULL
;
6049 state
->dispatch_recv
= cli
->dispatch_recv
;
6053 /* Out parameters */
6056 ZERO_STRUCT(state
->orig
.out
.result
);
6058 /* make a temporary copy, that we pass to the dispatch function */
6059 state
->tmp
= state
->orig
;
6061 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6063 NDR_SPOOLSS_CONFIGUREPORT
,
6065 if (tevent_req_nomem(subreq
, req
)) {
6066 return tevent_req_post(req
, ev
);
6068 tevent_req_set_callback(subreq
, rpccli_spoolss_ConfigurePort_done
, req
);
6072 static void rpccli_spoolss_ConfigurePort_done(struct tevent_req
*subreq
)
6074 struct tevent_req
*req
= tevent_req_callback_data(
6075 subreq
, struct tevent_req
);
6076 struct rpccli_spoolss_ConfigurePort_state
*state
= tevent_req_data(
6077 req
, struct rpccli_spoolss_ConfigurePort_state
);
6079 TALLOC_CTX
*mem_ctx
;
6081 if (state
->out_mem_ctx
) {
6082 mem_ctx
= state
->out_mem_ctx
;
6087 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6088 TALLOC_FREE(subreq
);
6089 if (!NT_STATUS_IS_OK(status
)) {
6090 tevent_req_nterror(req
, status
);
6094 /* Copy out parameters */
6097 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6099 /* Reset temporary structure */
6100 ZERO_STRUCT(state
->tmp
);
6102 tevent_req_done(req
);
6105 NTSTATUS
rpccli_spoolss_ConfigurePort_recv(struct tevent_req
*req
,
6106 TALLOC_CTX
*mem_ctx
,
6109 struct rpccli_spoolss_ConfigurePort_state
*state
= tevent_req_data(
6110 req
, struct rpccli_spoolss_ConfigurePort_state
);
6113 if (tevent_req_is_nterror(req
, &status
)) {
6114 tevent_req_received(req
);
6118 /* Steal possbile out parameters to the callers context */
6119 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6122 *result
= state
->orig
.out
.result
;
6124 tevent_req_received(req
);
6125 return NT_STATUS_OK
;
6128 NTSTATUS
rpccli_spoolss_ConfigurePort(struct rpc_pipe_client
*cli
,
6129 TALLOC_CTX
*mem_ctx
,
6132 struct spoolss_ConfigurePort r
;
6137 status
= cli
->dispatch(cli
,
6140 NDR_SPOOLSS_CONFIGUREPORT
,
6143 if (!NT_STATUS_IS_OK(status
)) {
6147 if (NT_STATUS_IS_ERR(status
)) {
6151 /* Return variables */
6155 *werror
= r
.out
.result
;
6158 return werror_to_ntstatus(r
.out
.result
);
6161 struct rpccli_spoolss_DeletePort_state
{
6162 struct spoolss_DeletePort orig
;
6163 struct spoolss_DeletePort tmp
;
6164 TALLOC_CTX
*out_mem_ctx
;
6165 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6168 static void rpccli_spoolss_DeletePort_done(struct tevent_req
*subreq
);
6170 struct tevent_req
*rpccli_spoolss_DeletePort_send(TALLOC_CTX
*mem_ctx
,
6171 struct tevent_context
*ev
,
6172 struct rpc_pipe_client
*cli
)
6174 struct tevent_req
*req
;
6175 struct rpccli_spoolss_DeletePort_state
*state
;
6176 struct tevent_req
*subreq
;
6178 req
= tevent_req_create(mem_ctx
, &state
,
6179 struct rpccli_spoolss_DeletePort_state
);
6183 state
->out_mem_ctx
= NULL
;
6184 state
->dispatch_recv
= cli
->dispatch_recv
;
6188 /* Out parameters */
6191 ZERO_STRUCT(state
->orig
.out
.result
);
6193 /* make a temporary copy, that we pass to the dispatch function */
6194 state
->tmp
= state
->orig
;
6196 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6198 NDR_SPOOLSS_DELETEPORT
,
6200 if (tevent_req_nomem(subreq
, req
)) {
6201 return tevent_req_post(req
, ev
);
6203 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePort_done
, req
);
6207 static void rpccli_spoolss_DeletePort_done(struct tevent_req
*subreq
)
6209 struct tevent_req
*req
= tevent_req_callback_data(
6210 subreq
, struct tevent_req
);
6211 struct rpccli_spoolss_DeletePort_state
*state
= tevent_req_data(
6212 req
, struct rpccli_spoolss_DeletePort_state
);
6214 TALLOC_CTX
*mem_ctx
;
6216 if (state
->out_mem_ctx
) {
6217 mem_ctx
= state
->out_mem_ctx
;
6222 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6223 TALLOC_FREE(subreq
);
6224 if (!NT_STATUS_IS_OK(status
)) {
6225 tevent_req_nterror(req
, status
);
6229 /* Copy out parameters */
6232 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6234 /* Reset temporary structure */
6235 ZERO_STRUCT(state
->tmp
);
6237 tevent_req_done(req
);
6240 NTSTATUS
rpccli_spoolss_DeletePort_recv(struct tevent_req
*req
,
6241 TALLOC_CTX
*mem_ctx
,
6244 struct rpccli_spoolss_DeletePort_state
*state
= tevent_req_data(
6245 req
, struct rpccli_spoolss_DeletePort_state
);
6248 if (tevent_req_is_nterror(req
, &status
)) {
6249 tevent_req_received(req
);
6253 /* Steal possbile out parameters to the callers context */
6254 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6257 *result
= state
->orig
.out
.result
;
6259 tevent_req_received(req
);
6260 return NT_STATUS_OK
;
6263 NTSTATUS
rpccli_spoolss_DeletePort(struct rpc_pipe_client
*cli
,
6264 TALLOC_CTX
*mem_ctx
,
6267 struct spoolss_DeletePort r
;
6272 status
= cli
->dispatch(cli
,
6275 NDR_SPOOLSS_DELETEPORT
,
6278 if (!NT_STATUS_IS_OK(status
)) {
6282 if (NT_STATUS_IS_ERR(status
)) {
6286 /* Return variables */
6290 *werror
= r
.out
.result
;
6293 return werror_to_ntstatus(r
.out
.result
);
6296 struct rpccli_spoolss_CreatePrinterIC_state
{
6297 struct spoolss_CreatePrinterIC orig
;
6298 struct spoolss_CreatePrinterIC tmp
;
6299 TALLOC_CTX
*out_mem_ctx
;
6300 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6303 static void rpccli_spoolss_CreatePrinterIC_done(struct tevent_req
*subreq
);
6305 struct tevent_req
*rpccli_spoolss_CreatePrinterIC_send(TALLOC_CTX
*mem_ctx
,
6306 struct tevent_context
*ev
,
6307 struct rpc_pipe_client
*cli
,
6308 struct policy_handle
*_handle
/* [in] [ref] */,
6309 struct policy_handle
*_gdi_handle
/* [out] [ref] */,
6310 struct spoolss_DevmodeContainer
*_devmode_ctr
/* [in] [ref] */)
6312 struct tevent_req
*req
;
6313 struct rpccli_spoolss_CreatePrinterIC_state
*state
;
6314 struct tevent_req
*subreq
;
6316 req
= tevent_req_create(mem_ctx
, &state
,
6317 struct rpccli_spoolss_CreatePrinterIC_state
);
6321 state
->out_mem_ctx
= NULL
;
6322 state
->dispatch_recv
= cli
->dispatch_recv
;
6325 state
->orig
.in
.handle
= _handle
;
6326 state
->orig
.in
.devmode_ctr
= _devmode_ctr
;
6328 /* Out parameters */
6329 state
->orig
.out
.gdi_handle
= _gdi_handle
;
6332 ZERO_STRUCT(state
->orig
.out
.result
);
6334 state
->out_mem_ctx
= talloc_named_const(state
, 0,
6335 "rpccli_spoolss_CreatePrinterIC_out_memory");
6336 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
6337 return tevent_req_post(req
, ev
);
6340 /* make a temporary copy, that we pass to the dispatch function */
6341 state
->tmp
= state
->orig
;
6343 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6345 NDR_SPOOLSS_CREATEPRINTERIC
,
6347 if (tevent_req_nomem(subreq
, req
)) {
6348 return tevent_req_post(req
, ev
);
6350 tevent_req_set_callback(subreq
, rpccli_spoolss_CreatePrinterIC_done
, req
);
6354 static void rpccli_spoolss_CreatePrinterIC_done(struct tevent_req
*subreq
)
6356 struct tevent_req
*req
= tevent_req_callback_data(
6357 subreq
, struct tevent_req
);
6358 struct rpccli_spoolss_CreatePrinterIC_state
*state
= tevent_req_data(
6359 req
, struct rpccli_spoolss_CreatePrinterIC_state
);
6361 TALLOC_CTX
*mem_ctx
;
6363 if (state
->out_mem_ctx
) {
6364 mem_ctx
= state
->out_mem_ctx
;
6369 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6370 TALLOC_FREE(subreq
);
6371 if (!NT_STATUS_IS_OK(status
)) {
6372 tevent_req_nterror(req
, status
);
6376 /* Copy out parameters */
6377 *state
->orig
.out
.gdi_handle
= *state
->tmp
.out
.gdi_handle
;
6380 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6382 /* Reset temporary structure */
6383 ZERO_STRUCT(state
->tmp
);
6385 tevent_req_done(req
);
6388 NTSTATUS
rpccli_spoolss_CreatePrinterIC_recv(struct tevent_req
*req
,
6389 TALLOC_CTX
*mem_ctx
,
6392 struct rpccli_spoolss_CreatePrinterIC_state
*state
= tevent_req_data(
6393 req
, struct rpccli_spoolss_CreatePrinterIC_state
);
6396 if (tevent_req_is_nterror(req
, &status
)) {
6397 tevent_req_received(req
);
6401 /* Steal possbile out parameters to the callers context */
6402 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6405 *result
= state
->orig
.out
.result
;
6407 tevent_req_received(req
);
6408 return NT_STATUS_OK
;
6411 NTSTATUS
rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client
*cli
,
6412 TALLOC_CTX
*mem_ctx
,
6413 struct policy_handle
*handle
/* [in] [ref] */,
6414 struct policy_handle
*gdi_handle
/* [out] [ref] */,
6415 struct spoolss_DevmodeContainer
*devmode_ctr
/* [in] [ref] */,
6418 struct spoolss_CreatePrinterIC r
;
6422 r
.in
.handle
= handle
;
6423 r
.in
.devmode_ctr
= devmode_ctr
;
6425 status
= cli
->dispatch(cli
,
6428 NDR_SPOOLSS_CREATEPRINTERIC
,
6431 if (!NT_STATUS_IS_OK(status
)) {
6435 if (NT_STATUS_IS_ERR(status
)) {
6439 /* Return variables */
6440 *gdi_handle
= *r
.out
.gdi_handle
;
6444 *werror
= r
.out
.result
;
6447 return werror_to_ntstatus(r
.out
.result
);
6450 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state
{
6451 struct spoolss_PlayGDIScriptOnPrinterIC orig
;
6452 struct spoolss_PlayGDIScriptOnPrinterIC tmp
;
6453 TALLOC_CTX
*out_mem_ctx
;
6454 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6457 static void rpccli_spoolss_PlayGDIScriptOnPrinterIC_done(struct tevent_req
*subreq
);
6459 struct tevent_req
*rpccli_spoolss_PlayGDIScriptOnPrinterIC_send(TALLOC_CTX
*mem_ctx
,
6460 struct tevent_context
*ev
,
6461 struct rpc_pipe_client
*cli
)
6463 struct tevent_req
*req
;
6464 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state
*state
;
6465 struct tevent_req
*subreq
;
6467 req
= tevent_req_create(mem_ctx
, &state
,
6468 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state
);
6472 state
->out_mem_ctx
= NULL
;
6473 state
->dispatch_recv
= cli
->dispatch_recv
;
6477 /* Out parameters */
6480 ZERO_STRUCT(state
->orig
.out
.result
);
6482 /* make a temporary copy, that we pass to the dispatch function */
6483 state
->tmp
= state
->orig
;
6485 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6487 NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC
,
6489 if (tevent_req_nomem(subreq
, req
)) {
6490 return tevent_req_post(req
, ev
);
6492 tevent_req_set_callback(subreq
, rpccli_spoolss_PlayGDIScriptOnPrinterIC_done
, req
);
6496 static void rpccli_spoolss_PlayGDIScriptOnPrinterIC_done(struct tevent_req
*subreq
)
6498 struct tevent_req
*req
= tevent_req_callback_data(
6499 subreq
, struct tevent_req
);
6500 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state
*state
= tevent_req_data(
6501 req
, struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state
);
6503 TALLOC_CTX
*mem_ctx
;
6505 if (state
->out_mem_ctx
) {
6506 mem_ctx
= state
->out_mem_ctx
;
6511 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6512 TALLOC_FREE(subreq
);
6513 if (!NT_STATUS_IS_OK(status
)) {
6514 tevent_req_nterror(req
, status
);
6518 /* Copy out parameters */
6521 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6523 /* Reset temporary structure */
6524 ZERO_STRUCT(state
->tmp
);
6526 tevent_req_done(req
);
6529 NTSTATUS
rpccli_spoolss_PlayGDIScriptOnPrinterIC_recv(struct tevent_req
*req
,
6530 TALLOC_CTX
*mem_ctx
,
6533 struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state
*state
= tevent_req_data(
6534 req
, struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state
);
6537 if (tevent_req_is_nterror(req
, &status
)) {
6538 tevent_req_received(req
);
6542 /* Steal possbile out parameters to the callers context */
6543 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6546 *result
= state
->orig
.out
.result
;
6548 tevent_req_received(req
);
6549 return NT_STATUS_OK
;
6552 NTSTATUS
rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client
*cli
,
6553 TALLOC_CTX
*mem_ctx
,
6556 struct spoolss_PlayGDIScriptOnPrinterIC r
;
6561 status
= cli
->dispatch(cli
,
6564 NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC
,
6567 if (!NT_STATUS_IS_OK(status
)) {
6571 if (NT_STATUS_IS_ERR(status
)) {
6575 /* Return variables */
6579 *werror
= r
.out
.result
;
6582 return werror_to_ntstatus(r
.out
.result
);
6585 struct rpccli_spoolss_DeletePrinterIC_state
{
6586 struct spoolss_DeletePrinterIC orig
;
6587 struct spoolss_DeletePrinterIC tmp
;
6588 TALLOC_CTX
*out_mem_ctx
;
6589 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6592 static void rpccli_spoolss_DeletePrinterIC_done(struct tevent_req
*subreq
);
6594 struct tevent_req
*rpccli_spoolss_DeletePrinterIC_send(TALLOC_CTX
*mem_ctx
,
6595 struct tevent_context
*ev
,
6596 struct rpc_pipe_client
*cli
,
6597 struct policy_handle
*_gdi_handle
/* [in,out] [ref] */)
6599 struct tevent_req
*req
;
6600 struct rpccli_spoolss_DeletePrinterIC_state
*state
;
6601 struct tevent_req
*subreq
;
6603 req
= tevent_req_create(mem_ctx
, &state
,
6604 struct rpccli_spoolss_DeletePrinterIC_state
);
6608 state
->out_mem_ctx
= NULL
;
6609 state
->dispatch_recv
= cli
->dispatch_recv
;
6612 state
->orig
.in
.gdi_handle
= _gdi_handle
;
6614 /* Out parameters */
6615 state
->orig
.out
.gdi_handle
= _gdi_handle
;
6618 ZERO_STRUCT(state
->orig
.out
.result
);
6620 state
->out_mem_ctx
= talloc_named_const(state
, 0,
6621 "rpccli_spoolss_DeletePrinterIC_out_memory");
6622 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
6623 return tevent_req_post(req
, ev
);
6626 /* make a temporary copy, that we pass to the dispatch function */
6627 state
->tmp
= state
->orig
;
6629 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6631 NDR_SPOOLSS_DELETEPRINTERIC
,
6633 if (tevent_req_nomem(subreq
, req
)) {
6634 return tevent_req_post(req
, ev
);
6636 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePrinterIC_done
, req
);
6640 static void rpccli_spoolss_DeletePrinterIC_done(struct tevent_req
*subreq
)
6642 struct tevent_req
*req
= tevent_req_callback_data(
6643 subreq
, struct tevent_req
);
6644 struct rpccli_spoolss_DeletePrinterIC_state
*state
= tevent_req_data(
6645 req
, struct rpccli_spoolss_DeletePrinterIC_state
);
6647 TALLOC_CTX
*mem_ctx
;
6649 if (state
->out_mem_ctx
) {
6650 mem_ctx
= state
->out_mem_ctx
;
6655 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6656 TALLOC_FREE(subreq
);
6657 if (!NT_STATUS_IS_OK(status
)) {
6658 tevent_req_nterror(req
, status
);
6662 /* Copy out parameters */
6663 *state
->orig
.out
.gdi_handle
= *state
->tmp
.out
.gdi_handle
;
6666 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6668 /* Reset temporary structure */
6669 ZERO_STRUCT(state
->tmp
);
6671 tevent_req_done(req
);
6674 NTSTATUS
rpccli_spoolss_DeletePrinterIC_recv(struct tevent_req
*req
,
6675 TALLOC_CTX
*mem_ctx
,
6678 struct rpccli_spoolss_DeletePrinterIC_state
*state
= tevent_req_data(
6679 req
, struct rpccli_spoolss_DeletePrinterIC_state
);
6682 if (tevent_req_is_nterror(req
, &status
)) {
6683 tevent_req_received(req
);
6687 /* Steal possbile out parameters to the callers context */
6688 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6691 *result
= state
->orig
.out
.result
;
6693 tevent_req_received(req
);
6694 return NT_STATUS_OK
;
6697 NTSTATUS
rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client
*cli
,
6698 TALLOC_CTX
*mem_ctx
,
6699 struct policy_handle
*gdi_handle
/* [in,out] [ref] */,
6702 struct spoolss_DeletePrinterIC r
;
6706 r
.in
.gdi_handle
= gdi_handle
;
6708 status
= cli
->dispatch(cli
,
6711 NDR_SPOOLSS_DELETEPRINTERIC
,
6714 if (!NT_STATUS_IS_OK(status
)) {
6718 if (NT_STATUS_IS_ERR(status
)) {
6722 /* Return variables */
6723 *gdi_handle
= *r
.out
.gdi_handle
;
6727 *werror
= r
.out
.result
;
6730 return werror_to_ntstatus(r
.out
.result
);
6733 struct rpccli_spoolss_AddPrinterConnection_state
{
6734 struct spoolss_AddPrinterConnection orig
;
6735 struct spoolss_AddPrinterConnection tmp
;
6736 TALLOC_CTX
*out_mem_ctx
;
6737 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6740 static void rpccli_spoolss_AddPrinterConnection_done(struct tevent_req
*subreq
);
6742 struct tevent_req
*rpccli_spoolss_AddPrinterConnection_send(TALLOC_CTX
*mem_ctx
,
6743 struct tevent_context
*ev
,
6744 struct rpc_pipe_client
*cli
)
6746 struct tevent_req
*req
;
6747 struct rpccli_spoolss_AddPrinterConnection_state
*state
;
6748 struct tevent_req
*subreq
;
6750 req
= tevent_req_create(mem_ctx
, &state
,
6751 struct rpccli_spoolss_AddPrinterConnection_state
);
6755 state
->out_mem_ctx
= NULL
;
6756 state
->dispatch_recv
= cli
->dispatch_recv
;
6760 /* Out parameters */
6763 ZERO_STRUCT(state
->orig
.out
.result
);
6765 /* make a temporary copy, that we pass to the dispatch function */
6766 state
->tmp
= state
->orig
;
6768 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6770 NDR_SPOOLSS_ADDPRINTERCONNECTION
,
6772 if (tevent_req_nomem(subreq
, req
)) {
6773 return tevent_req_post(req
, ev
);
6775 tevent_req_set_callback(subreq
, rpccli_spoolss_AddPrinterConnection_done
, req
);
6779 static void rpccli_spoolss_AddPrinterConnection_done(struct tevent_req
*subreq
)
6781 struct tevent_req
*req
= tevent_req_callback_data(
6782 subreq
, struct tevent_req
);
6783 struct rpccli_spoolss_AddPrinterConnection_state
*state
= tevent_req_data(
6784 req
, struct rpccli_spoolss_AddPrinterConnection_state
);
6786 TALLOC_CTX
*mem_ctx
;
6788 if (state
->out_mem_ctx
) {
6789 mem_ctx
= state
->out_mem_ctx
;
6794 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6795 TALLOC_FREE(subreq
);
6796 if (!NT_STATUS_IS_OK(status
)) {
6797 tevent_req_nterror(req
, status
);
6801 /* Copy out parameters */
6804 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6806 /* Reset temporary structure */
6807 ZERO_STRUCT(state
->tmp
);
6809 tevent_req_done(req
);
6812 NTSTATUS
rpccli_spoolss_AddPrinterConnection_recv(struct tevent_req
*req
,
6813 TALLOC_CTX
*mem_ctx
,
6816 struct rpccli_spoolss_AddPrinterConnection_state
*state
= tevent_req_data(
6817 req
, struct rpccli_spoolss_AddPrinterConnection_state
);
6820 if (tevent_req_is_nterror(req
, &status
)) {
6821 tevent_req_received(req
);
6825 /* Steal possbile out parameters to the callers context */
6826 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6829 *result
= state
->orig
.out
.result
;
6831 tevent_req_received(req
);
6832 return NT_STATUS_OK
;
6835 NTSTATUS
rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client
*cli
,
6836 TALLOC_CTX
*mem_ctx
,
6839 struct spoolss_AddPrinterConnection r
;
6844 status
= cli
->dispatch(cli
,
6847 NDR_SPOOLSS_ADDPRINTERCONNECTION
,
6850 if (!NT_STATUS_IS_OK(status
)) {
6854 if (NT_STATUS_IS_ERR(status
)) {
6858 /* Return variables */
6862 *werror
= r
.out
.result
;
6865 return werror_to_ntstatus(r
.out
.result
);
6868 struct rpccli_spoolss_DeletePrinterConnection_state
{
6869 struct spoolss_DeletePrinterConnection orig
;
6870 struct spoolss_DeletePrinterConnection tmp
;
6871 TALLOC_CTX
*out_mem_ctx
;
6872 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6875 static void rpccli_spoolss_DeletePrinterConnection_done(struct tevent_req
*subreq
);
6877 struct tevent_req
*rpccli_spoolss_DeletePrinterConnection_send(TALLOC_CTX
*mem_ctx
,
6878 struct tevent_context
*ev
,
6879 struct rpc_pipe_client
*cli
)
6881 struct tevent_req
*req
;
6882 struct rpccli_spoolss_DeletePrinterConnection_state
*state
;
6883 struct tevent_req
*subreq
;
6885 req
= tevent_req_create(mem_ctx
, &state
,
6886 struct rpccli_spoolss_DeletePrinterConnection_state
);
6890 state
->out_mem_ctx
= NULL
;
6891 state
->dispatch_recv
= cli
->dispatch_recv
;
6895 /* Out parameters */
6898 ZERO_STRUCT(state
->orig
.out
.result
);
6900 /* make a temporary copy, that we pass to the dispatch function */
6901 state
->tmp
= state
->orig
;
6903 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6905 NDR_SPOOLSS_DELETEPRINTERCONNECTION
,
6907 if (tevent_req_nomem(subreq
, req
)) {
6908 return tevent_req_post(req
, ev
);
6910 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePrinterConnection_done
, req
);
6914 static void rpccli_spoolss_DeletePrinterConnection_done(struct tevent_req
*subreq
)
6916 struct tevent_req
*req
= tevent_req_callback_data(
6917 subreq
, struct tevent_req
);
6918 struct rpccli_spoolss_DeletePrinterConnection_state
*state
= tevent_req_data(
6919 req
, struct rpccli_spoolss_DeletePrinterConnection_state
);
6921 TALLOC_CTX
*mem_ctx
;
6923 if (state
->out_mem_ctx
) {
6924 mem_ctx
= state
->out_mem_ctx
;
6929 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6930 TALLOC_FREE(subreq
);
6931 if (!NT_STATUS_IS_OK(status
)) {
6932 tevent_req_nterror(req
, status
);
6936 /* Copy out parameters */
6939 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6941 /* Reset temporary structure */
6942 ZERO_STRUCT(state
->tmp
);
6944 tevent_req_done(req
);
6947 NTSTATUS
rpccli_spoolss_DeletePrinterConnection_recv(struct tevent_req
*req
,
6948 TALLOC_CTX
*mem_ctx
,
6951 struct rpccli_spoolss_DeletePrinterConnection_state
*state
= tevent_req_data(
6952 req
, struct rpccli_spoolss_DeletePrinterConnection_state
);
6955 if (tevent_req_is_nterror(req
, &status
)) {
6956 tevent_req_received(req
);
6960 /* Steal possbile out parameters to the callers context */
6961 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6964 *result
= state
->orig
.out
.result
;
6966 tevent_req_received(req
);
6967 return NT_STATUS_OK
;
6970 NTSTATUS
rpccli_spoolss_DeletePrinterConnection(struct rpc_pipe_client
*cli
,
6971 TALLOC_CTX
*mem_ctx
,
6974 struct spoolss_DeletePrinterConnection r
;
6979 status
= cli
->dispatch(cli
,
6982 NDR_SPOOLSS_DELETEPRINTERCONNECTION
,
6985 if (!NT_STATUS_IS_OK(status
)) {
6989 if (NT_STATUS_IS_ERR(status
)) {
6993 /* Return variables */
6997 *werror
= r
.out
.result
;
7000 return werror_to_ntstatus(r
.out
.result
);
7003 struct rpccli_spoolss_PrinterMessageBox_state
{
7004 struct spoolss_PrinterMessageBox orig
;
7005 struct spoolss_PrinterMessageBox tmp
;
7006 TALLOC_CTX
*out_mem_ctx
;
7007 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7010 static void rpccli_spoolss_PrinterMessageBox_done(struct tevent_req
*subreq
);
7012 struct tevent_req
*rpccli_spoolss_PrinterMessageBox_send(TALLOC_CTX
*mem_ctx
,
7013 struct tevent_context
*ev
,
7014 struct rpc_pipe_client
*cli
)
7016 struct tevent_req
*req
;
7017 struct rpccli_spoolss_PrinterMessageBox_state
*state
;
7018 struct tevent_req
*subreq
;
7020 req
= tevent_req_create(mem_ctx
, &state
,
7021 struct rpccli_spoolss_PrinterMessageBox_state
);
7025 state
->out_mem_ctx
= NULL
;
7026 state
->dispatch_recv
= cli
->dispatch_recv
;
7030 /* Out parameters */
7033 ZERO_STRUCT(state
->orig
.out
.result
);
7035 /* make a temporary copy, that we pass to the dispatch function */
7036 state
->tmp
= state
->orig
;
7038 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7040 NDR_SPOOLSS_PRINTERMESSAGEBOX
,
7042 if (tevent_req_nomem(subreq
, req
)) {
7043 return tevent_req_post(req
, ev
);
7045 tevent_req_set_callback(subreq
, rpccli_spoolss_PrinterMessageBox_done
, req
);
7049 static void rpccli_spoolss_PrinterMessageBox_done(struct tevent_req
*subreq
)
7051 struct tevent_req
*req
= tevent_req_callback_data(
7052 subreq
, struct tevent_req
);
7053 struct rpccli_spoolss_PrinterMessageBox_state
*state
= tevent_req_data(
7054 req
, struct rpccli_spoolss_PrinterMessageBox_state
);
7056 TALLOC_CTX
*mem_ctx
;
7058 if (state
->out_mem_ctx
) {
7059 mem_ctx
= state
->out_mem_ctx
;
7064 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7065 TALLOC_FREE(subreq
);
7066 if (!NT_STATUS_IS_OK(status
)) {
7067 tevent_req_nterror(req
, status
);
7071 /* Copy out parameters */
7074 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7076 /* Reset temporary structure */
7077 ZERO_STRUCT(state
->tmp
);
7079 tevent_req_done(req
);
7082 NTSTATUS
rpccli_spoolss_PrinterMessageBox_recv(struct tevent_req
*req
,
7083 TALLOC_CTX
*mem_ctx
,
7086 struct rpccli_spoolss_PrinterMessageBox_state
*state
= tevent_req_data(
7087 req
, struct rpccli_spoolss_PrinterMessageBox_state
);
7090 if (tevent_req_is_nterror(req
, &status
)) {
7091 tevent_req_received(req
);
7095 /* Steal possbile out parameters to the callers context */
7096 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7099 *result
= state
->orig
.out
.result
;
7101 tevent_req_received(req
);
7102 return NT_STATUS_OK
;
7105 NTSTATUS
rpccli_spoolss_PrinterMessageBox(struct rpc_pipe_client
*cli
,
7106 TALLOC_CTX
*mem_ctx
,
7109 struct spoolss_PrinterMessageBox r
;
7114 status
= cli
->dispatch(cli
,
7117 NDR_SPOOLSS_PRINTERMESSAGEBOX
,
7120 if (!NT_STATUS_IS_OK(status
)) {
7124 if (NT_STATUS_IS_ERR(status
)) {
7128 /* Return variables */
7132 *werror
= r
.out
.result
;
7135 return werror_to_ntstatus(r
.out
.result
);
7138 struct rpccli_spoolss_AddMonitor_state
{
7139 struct spoolss_AddMonitor orig
;
7140 struct spoolss_AddMonitor tmp
;
7141 TALLOC_CTX
*out_mem_ctx
;
7142 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7145 static void rpccli_spoolss_AddMonitor_done(struct tevent_req
*subreq
);
7147 struct tevent_req
*rpccli_spoolss_AddMonitor_send(TALLOC_CTX
*mem_ctx
,
7148 struct tevent_context
*ev
,
7149 struct rpc_pipe_client
*cli
)
7151 struct tevent_req
*req
;
7152 struct rpccli_spoolss_AddMonitor_state
*state
;
7153 struct tevent_req
*subreq
;
7155 req
= tevent_req_create(mem_ctx
, &state
,
7156 struct rpccli_spoolss_AddMonitor_state
);
7160 state
->out_mem_ctx
= NULL
;
7161 state
->dispatch_recv
= cli
->dispatch_recv
;
7165 /* Out parameters */
7168 ZERO_STRUCT(state
->orig
.out
.result
);
7170 /* make a temporary copy, that we pass to the dispatch function */
7171 state
->tmp
= state
->orig
;
7173 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7175 NDR_SPOOLSS_ADDMONITOR
,
7177 if (tevent_req_nomem(subreq
, req
)) {
7178 return tevent_req_post(req
, ev
);
7180 tevent_req_set_callback(subreq
, rpccli_spoolss_AddMonitor_done
, req
);
7184 static void rpccli_spoolss_AddMonitor_done(struct tevent_req
*subreq
)
7186 struct tevent_req
*req
= tevent_req_callback_data(
7187 subreq
, struct tevent_req
);
7188 struct rpccli_spoolss_AddMonitor_state
*state
= tevent_req_data(
7189 req
, struct rpccli_spoolss_AddMonitor_state
);
7191 TALLOC_CTX
*mem_ctx
;
7193 if (state
->out_mem_ctx
) {
7194 mem_ctx
= state
->out_mem_ctx
;
7199 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7200 TALLOC_FREE(subreq
);
7201 if (!NT_STATUS_IS_OK(status
)) {
7202 tevent_req_nterror(req
, status
);
7206 /* Copy out parameters */
7209 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7211 /* Reset temporary structure */
7212 ZERO_STRUCT(state
->tmp
);
7214 tevent_req_done(req
);
7217 NTSTATUS
rpccli_spoolss_AddMonitor_recv(struct tevent_req
*req
,
7218 TALLOC_CTX
*mem_ctx
,
7221 struct rpccli_spoolss_AddMonitor_state
*state
= tevent_req_data(
7222 req
, struct rpccli_spoolss_AddMonitor_state
);
7225 if (tevent_req_is_nterror(req
, &status
)) {
7226 tevent_req_received(req
);
7230 /* Steal possbile out parameters to the callers context */
7231 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7234 *result
= state
->orig
.out
.result
;
7236 tevent_req_received(req
);
7237 return NT_STATUS_OK
;
7240 NTSTATUS
rpccli_spoolss_AddMonitor(struct rpc_pipe_client
*cli
,
7241 TALLOC_CTX
*mem_ctx
,
7244 struct spoolss_AddMonitor r
;
7249 status
= cli
->dispatch(cli
,
7252 NDR_SPOOLSS_ADDMONITOR
,
7255 if (!NT_STATUS_IS_OK(status
)) {
7259 if (NT_STATUS_IS_ERR(status
)) {
7263 /* Return variables */
7267 *werror
= r
.out
.result
;
7270 return werror_to_ntstatus(r
.out
.result
);
7273 struct rpccli_spoolss_DeleteMonitor_state
{
7274 struct spoolss_DeleteMonitor orig
;
7275 struct spoolss_DeleteMonitor tmp
;
7276 TALLOC_CTX
*out_mem_ctx
;
7277 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7280 static void rpccli_spoolss_DeleteMonitor_done(struct tevent_req
*subreq
);
7282 struct tevent_req
*rpccli_spoolss_DeleteMonitor_send(TALLOC_CTX
*mem_ctx
,
7283 struct tevent_context
*ev
,
7284 struct rpc_pipe_client
*cli
)
7286 struct tevent_req
*req
;
7287 struct rpccli_spoolss_DeleteMonitor_state
*state
;
7288 struct tevent_req
*subreq
;
7290 req
= tevent_req_create(mem_ctx
, &state
,
7291 struct rpccli_spoolss_DeleteMonitor_state
);
7295 state
->out_mem_ctx
= NULL
;
7296 state
->dispatch_recv
= cli
->dispatch_recv
;
7300 /* Out parameters */
7303 ZERO_STRUCT(state
->orig
.out
.result
);
7305 /* make a temporary copy, that we pass to the dispatch function */
7306 state
->tmp
= state
->orig
;
7308 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7310 NDR_SPOOLSS_DELETEMONITOR
,
7312 if (tevent_req_nomem(subreq
, req
)) {
7313 return tevent_req_post(req
, ev
);
7315 tevent_req_set_callback(subreq
, rpccli_spoolss_DeleteMonitor_done
, req
);
7319 static void rpccli_spoolss_DeleteMonitor_done(struct tevent_req
*subreq
)
7321 struct tevent_req
*req
= tevent_req_callback_data(
7322 subreq
, struct tevent_req
);
7323 struct rpccli_spoolss_DeleteMonitor_state
*state
= tevent_req_data(
7324 req
, struct rpccli_spoolss_DeleteMonitor_state
);
7326 TALLOC_CTX
*mem_ctx
;
7328 if (state
->out_mem_ctx
) {
7329 mem_ctx
= state
->out_mem_ctx
;
7334 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7335 TALLOC_FREE(subreq
);
7336 if (!NT_STATUS_IS_OK(status
)) {
7337 tevent_req_nterror(req
, status
);
7341 /* Copy out parameters */
7344 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7346 /* Reset temporary structure */
7347 ZERO_STRUCT(state
->tmp
);
7349 tevent_req_done(req
);
7352 NTSTATUS
rpccli_spoolss_DeleteMonitor_recv(struct tevent_req
*req
,
7353 TALLOC_CTX
*mem_ctx
,
7356 struct rpccli_spoolss_DeleteMonitor_state
*state
= tevent_req_data(
7357 req
, struct rpccli_spoolss_DeleteMonitor_state
);
7360 if (tevent_req_is_nterror(req
, &status
)) {
7361 tevent_req_received(req
);
7365 /* Steal possbile out parameters to the callers context */
7366 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7369 *result
= state
->orig
.out
.result
;
7371 tevent_req_received(req
);
7372 return NT_STATUS_OK
;
7375 NTSTATUS
rpccli_spoolss_DeleteMonitor(struct rpc_pipe_client
*cli
,
7376 TALLOC_CTX
*mem_ctx
,
7379 struct spoolss_DeleteMonitor r
;
7384 status
= cli
->dispatch(cli
,
7387 NDR_SPOOLSS_DELETEMONITOR
,
7390 if (!NT_STATUS_IS_OK(status
)) {
7394 if (NT_STATUS_IS_ERR(status
)) {
7398 /* Return variables */
7402 *werror
= r
.out
.result
;
7405 return werror_to_ntstatus(r
.out
.result
);
7408 struct rpccli_spoolss_DeletePrintProcessor_state
{
7409 struct spoolss_DeletePrintProcessor orig
;
7410 struct spoolss_DeletePrintProcessor tmp
;
7411 TALLOC_CTX
*out_mem_ctx
;
7412 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7415 static void rpccli_spoolss_DeletePrintProcessor_done(struct tevent_req
*subreq
);
7417 struct tevent_req
*rpccli_spoolss_DeletePrintProcessor_send(TALLOC_CTX
*mem_ctx
,
7418 struct tevent_context
*ev
,
7419 struct rpc_pipe_client
*cli
)
7421 struct tevent_req
*req
;
7422 struct rpccli_spoolss_DeletePrintProcessor_state
*state
;
7423 struct tevent_req
*subreq
;
7425 req
= tevent_req_create(mem_ctx
, &state
,
7426 struct rpccli_spoolss_DeletePrintProcessor_state
);
7430 state
->out_mem_ctx
= NULL
;
7431 state
->dispatch_recv
= cli
->dispatch_recv
;
7435 /* Out parameters */
7438 ZERO_STRUCT(state
->orig
.out
.result
);
7440 /* make a temporary copy, that we pass to the dispatch function */
7441 state
->tmp
= state
->orig
;
7443 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7445 NDR_SPOOLSS_DELETEPRINTPROCESSOR
,
7447 if (tevent_req_nomem(subreq
, req
)) {
7448 return tevent_req_post(req
, ev
);
7450 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePrintProcessor_done
, req
);
7454 static void rpccli_spoolss_DeletePrintProcessor_done(struct tevent_req
*subreq
)
7456 struct tevent_req
*req
= tevent_req_callback_data(
7457 subreq
, struct tevent_req
);
7458 struct rpccli_spoolss_DeletePrintProcessor_state
*state
= tevent_req_data(
7459 req
, struct rpccli_spoolss_DeletePrintProcessor_state
);
7461 TALLOC_CTX
*mem_ctx
;
7463 if (state
->out_mem_ctx
) {
7464 mem_ctx
= state
->out_mem_ctx
;
7469 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7470 TALLOC_FREE(subreq
);
7471 if (!NT_STATUS_IS_OK(status
)) {
7472 tevent_req_nterror(req
, status
);
7476 /* Copy out parameters */
7479 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7481 /* Reset temporary structure */
7482 ZERO_STRUCT(state
->tmp
);
7484 tevent_req_done(req
);
7487 NTSTATUS
rpccli_spoolss_DeletePrintProcessor_recv(struct tevent_req
*req
,
7488 TALLOC_CTX
*mem_ctx
,
7491 struct rpccli_spoolss_DeletePrintProcessor_state
*state
= tevent_req_data(
7492 req
, struct rpccli_spoolss_DeletePrintProcessor_state
);
7495 if (tevent_req_is_nterror(req
, &status
)) {
7496 tevent_req_received(req
);
7500 /* Steal possbile out parameters to the callers context */
7501 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7504 *result
= state
->orig
.out
.result
;
7506 tevent_req_received(req
);
7507 return NT_STATUS_OK
;
7510 NTSTATUS
rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client
*cli
,
7511 TALLOC_CTX
*mem_ctx
,
7514 struct spoolss_DeletePrintProcessor r
;
7519 status
= cli
->dispatch(cli
,
7522 NDR_SPOOLSS_DELETEPRINTPROCESSOR
,
7525 if (!NT_STATUS_IS_OK(status
)) {
7529 if (NT_STATUS_IS_ERR(status
)) {
7533 /* Return variables */
7537 *werror
= r
.out
.result
;
7540 return werror_to_ntstatus(r
.out
.result
);
7543 struct rpccli_spoolss_AddPrintProvidor_state
{
7544 struct spoolss_AddPrintProvidor orig
;
7545 struct spoolss_AddPrintProvidor tmp
;
7546 TALLOC_CTX
*out_mem_ctx
;
7547 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7550 static void rpccli_spoolss_AddPrintProvidor_done(struct tevent_req
*subreq
);
7552 struct tevent_req
*rpccli_spoolss_AddPrintProvidor_send(TALLOC_CTX
*mem_ctx
,
7553 struct tevent_context
*ev
,
7554 struct rpc_pipe_client
*cli
)
7556 struct tevent_req
*req
;
7557 struct rpccli_spoolss_AddPrintProvidor_state
*state
;
7558 struct tevent_req
*subreq
;
7560 req
= tevent_req_create(mem_ctx
, &state
,
7561 struct rpccli_spoolss_AddPrintProvidor_state
);
7565 state
->out_mem_ctx
= NULL
;
7566 state
->dispatch_recv
= cli
->dispatch_recv
;
7570 /* Out parameters */
7573 ZERO_STRUCT(state
->orig
.out
.result
);
7575 /* make a temporary copy, that we pass to the dispatch function */
7576 state
->tmp
= state
->orig
;
7578 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7580 NDR_SPOOLSS_ADDPRINTPROVIDOR
,
7582 if (tevent_req_nomem(subreq
, req
)) {
7583 return tevent_req_post(req
, ev
);
7585 tevent_req_set_callback(subreq
, rpccli_spoolss_AddPrintProvidor_done
, req
);
7589 static void rpccli_spoolss_AddPrintProvidor_done(struct tevent_req
*subreq
)
7591 struct tevent_req
*req
= tevent_req_callback_data(
7592 subreq
, struct tevent_req
);
7593 struct rpccli_spoolss_AddPrintProvidor_state
*state
= tevent_req_data(
7594 req
, struct rpccli_spoolss_AddPrintProvidor_state
);
7596 TALLOC_CTX
*mem_ctx
;
7598 if (state
->out_mem_ctx
) {
7599 mem_ctx
= state
->out_mem_ctx
;
7604 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7605 TALLOC_FREE(subreq
);
7606 if (!NT_STATUS_IS_OK(status
)) {
7607 tevent_req_nterror(req
, status
);
7611 /* Copy out parameters */
7614 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7616 /* Reset temporary structure */
7617 ZERO_STRUCT(state
->tmp
);
7619 tevent_req_done(req
);
7622 NTSTATUS
rpccli_spoolss_AddPrintProvidor_recv(struct tevent_req
*req
,
7623 TALLOC_CTX
*mem_ctx
,
7626 struct rpccli_spoolss_AddPrintProvidor_state
*state
= tevent_req_data(
7627 req
, struct rpccli_spoolss_AddPrintProvidor_state
);
7630 if (tevent_req_is_nterror(req
, &status
)) {
7631 tevent_req_received(req
);
7635 /* Steal possbile out parameters to the callers context */
7636 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7639 *result
= state
->orig
.out
.result
;
7641 tevent_req_received(req
);
7642 return NT_STATUS_OK
;
7645 NTSTATUS
rpccli_spoolss_AddPrintProvidor(struct rpc_pipe_client
*cli
,
7646 TALLOC_CTX
*mem_ctx
,
7649 struct spoolss_AddPrintProvidor r
;
7654 status
= cli
->dispatch(cli
,
7657 NDR_SPOOLSS_ADDPRINTPROVIDOR
,
7660 if (!NT_STATUS_IS_OK(status
)) {
7664 if (NT_STATUS_IS_ERR(status
)) {
7668 /* Return variables */
7672 *werror
= r
.out
.result
;
7675 return werror_to_ntstatus(r
.out
.result
);
7678 struct rpccli_spoolss_DeletePrintProvidor_state
{
7679 struct spoolss_DeletePrintProvidor orig
;
7680 struct spoolss_DeletePrintProvidor tmp
;
7681 TALLOC_CTX
*out_mem_ctx
;
7682 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7685 static void rpccli_spoolss_DeletePrintProvidor_done(struct tevent_req
*subreq
);
7687 struct tevent_req
*rpccli_spoolss_DeletePrintProvidor_send(TALLOC_CTX
*mem_ctx
,
7688 struct tevent_context
*ev
,
7689 struct rpc_pipe_client
*cli
)
7691 struct tevent_req
*req
;
7692 struct rpccli_spoolss_DeletePrintProvidor_state
*state
;
7693 struct tevent_req
*subreq
;
7695 req
= tevent_req_create(mem_ctx
, &state
,
7696 struct rpccli_spoolss_DeletePrintProvidor_state
);
7700 state
->out_mem_ctx
= NULL
;
7701 state
->dispatch_recv
= cli
->dispatch_recv
;
7705 /* Out parameters */
7708 ZERO_STRUCT(state
->orig
.out
.result
);
7710 /* make a temporary copy, that we pass to the dispatch function */
7711 state
->tmp
= state
->orig
;
7713 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7715 NDR_SPOOLSS_DELETEPRINTPROVIDOR
,
7717 if (tevent_req_nomem(subreq
, req
)) {
7718 return tevent_req_post(req
, ev
);
7720 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePrintProvidor_done
, req
);
7724 static void rpccli_spoolss_DeletePrintProvidor_done(struct tevent_req
*subreq
)
7726 struct tevent_req
*req
= tevent_req_callback_data(
7727 subreq
, struct tevent_req
);
7728 struct rpccli_spoolss_DeletePrintProvidor_state
*state
= tevent_req_data(
7729 req
, struct rpccli_spoolss_DeletePrintProvidor_state
);
7731 TALLOC_CTX
*mem_ctx
;
7733 if (state
->out_mem_ctx
) {
7734 mem_ctx
= state
->out_mem_ctx
;
7739 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7740 TALLOC_FREE(subreq
);
7741 if (!NT_STATUS_IS_OK(status
)) {
7742 tevent_req_nterror(req
, status
);
7746 /* Copy out parameters */
7749 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7751 /* Reset temporary structure */
7752 ZERO_STRUCT(state
->tmp
);
7754 tevent_req_done(req
);
7757 NTSTATUS
rpccli_spoolss_DeletePrintProvidor_recv(struct tevent_req
*req
,
7758 TALLOC_CTX
*mem_ctx
,
7761 struct rpccli_spoolss_DeletePrintProvidor_state
*state
= tevent_req_data(
7762 req
, struct rpccli_spoolss_DeletePrintProvidor_state
);
7765 if (tevent_req_is_nterror(req
, &status
)) {
7766 tevent_req_received(req
);
7770 /* Steal possbile out parameters to the callers context */
7771 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7774 *result
= state
->orig
.out
.result
;
7776 tevent_req_received(req
);
7777 return NT_STATUS_OK
;
7780 NTSTATUS
rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client
*cli
,
7781 TALLOC_CTX
*mem_ctx
,
7784 struct spoolss_DeletePrintProvidor r
;
7789 status
= cli
->dispatch(cli
,
7792 NDR_SPOOLSS_DELETEPRINTPROVIDOR
,
7795 if (!NT_STATUS_IS_OK(status
)) {
7799 if (NT_STATUS_IS_ERR(status
)) {
7803 /* Return variables */
7807 *werror
= r
.out
.result
;
7810 return werror_to_ntstatus(r
.out
.result
);
7813 struct rpccli_spoolss_EnumPrintProcDataTypes_state
{
7814 struct spoolss_EnumPrintProcDataTypes orig
;
7815 struct spoolss_EnumPrintProcDataTypes tmp
;
7816 TALLOC_CTX
*out_mem_ctx
;
7817 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7820 static void rpccli_spoolss_EnumPrintProcDataTypes_done(struct tevent_req
*subreq
);
7822 struct tevent_req
*rpccli_spoolss_EnumPrintProcDataTypes_send(TALLOC_CTX
*mem_ctx
,
7823 struct tevent_context
*ev
,
7824 struct rpc_pipe_client
*cli
,
7825 const char *_servername
/* [in] [unique,charset(UTF16)] */,
7826 const char *_print_processor_name
/* [in] [unique,charset(UTF16)] */,
7827 uint32_t _level
/* [in] */,
7828 DATA_BLOB
*_buffer
/* [in] [unique] */,
7829 uint32_t _offered
/* [in] */,
7830 uint32_t *_count
/* [out] [ref] */,
7831 union spoolss_PrintProcDataTypesInfo
**_info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
7832 uint32_t *_needed
/* [out] [ref] */)
7834 struct tevent_req
*req
;
7835 struct rpccli_spoolss_EnumPrintProcDataTypes_state
*state
;
7836 struct tevent_req
*subreq
;
7838 req
= tevent_req_create(mem_ctx
, &state
,
7839 struct rpccli_spoolss_EnumPrintProcDataTypes_state
);
7843 state
->out_mem_ctx
= NULL
;
7844 state
->dispatch_recv
= cli
->dispatch_recv
;
7847 state
->orig
.in
.servername
= _servername
;
7848 state
->orig
.in
.print_processor_name
= _print_processor_name
;
7849 state
->orig
.in
.level
= _level
;
7850 state
->orig
.in
.buffer
= _buffer
;
7851 state
->orig
.in
.offered
= _offered
;
7853 /* Out parameters */
7854 state
->orig
.out
.count
= _count
;
7855 state
->orig
.out
.info
= _info
;
7856 state
->orig
.out
.needed
= _needed
;
7859 ZERO_STRUCT(state
->orig
.out
.result
);
7861 state
->out_mem_ctx
= talloc_named_const(state
, 0,
7862 "rpccli_spoolss_EnumPrintProcDataTypes_out_memory");
7863 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
7864 return tevent_req_post(req
, ev
);
7867 /* make a temporary copy, that we pass to the dispatch function */
7868 state
->tmp
= state
->orig
;
7870 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7872 NDR_SPOOLSS_ENUMPRINTPROCDATATYPES
,
7874 if (tevent_req_nomem(subreq
, req
)) {
7875 return tevent_req_post(req
, ev
);
7877 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumPrintProcDataTypes_done
, req
);
7881 static void rpccli_spoolss_EnumPrintProcDataTypes_done(struct tevent_req
*subreq
)
7883 struct tevent_req
*req
= tevent_req_callback_data(
7884 subreq
, struct tevent_req
);
7885 struct rpccli_spoolss_EnumPrintProcDataTypes_state
*state
= tevent_req_data(
7886 req
, struct rpccli_spoolss_EnumPrintProcDataTypes_state
);
7888 TALLOC_CTX
*mem_ctx
;
7890 if (state
->out_mem_ctx
) {
7891 mem_ctx
= state
->out_mem_ctx
;
7896 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7897 TALLOC_FREE(subreq
);
7898 if (!NT_STATUS_IS_OK(status
)) {
7899 tevent_req_nterror(req
, status
);
7903 /* Copy out parameters */
7904 *state
->orig
.out
.count
= *state
->tmp
.out
.count
;
7905 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
7906 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
7909 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7911 /* Reset temporary structure */
7912 ZERO_STRUCT(state
->tmp
);
7914 tevent_req_done(req
);
7917 NTSTATUS
rpccli_spoolss_EnumPrintProcDataTypes_recv(struct tevent_req
*req
,
7918 TALLOC_CTX
*mem_ctx
,
7921 struct rpccli_spoolss_EnumPrintProcDataTypes_state
*state
= tevent_req_data(
7922 req
, struct rpccli_spoolss_EnumPrintProcDataTypes_state
);
7925 if (tevent_req_is_nterror(req
, &status
)) {
7926 tevent_req_received(req
);
7930 /* Steal possbile out parameters to the callers context */
7931 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7934 *result
= state
->orig
.out
.result
;
7936 tevent_req_received(req
);
7937 return NT_STATUS_OK
;
7940 NTSTATUS
rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client
*cli
,
7941 TALLOC_CTX
*mem_ctx
,
7942 const char *servername
/* [in] [unique,charset(UTF16)] */,
7943 const char *print_processor_name
/* [in] [unique,charset(UTF16)] */,
7944 uint32_t level
/* [in] */,
7945 DATA_BLOB
*buffer
/* [in] [unique] */,
7946 uint32_t offered
/* [in] */,
7947 uint32_t *count
/* [out] [ref] */,
7948 union spoolss_PrintProcDataTypesInfo
**info
/* [out] [ref,switch_is(level),size_is(,*count)] */,
7949 uint32_t *needed
/* [out] [ref] */,
7952 struct spoolss_EnumPrintProcDataTypes r
;
7956 r
.in
.servername
= servername
;
7957 r
.in
.print_processor_name
= print_processor_name
;
7959 r
.in
.buffer
= buffer
;
7960 r
.in
.offered
= offered
;
7962 status
= cli
->dispatch(cli
,
7965 NDR_SPOOLSS_ENUMPRINTPROCDATATYPES
,
7968 if (!NT_STATUS_IS_OK(status
)) {
7972 if (NT_STATUS_IS_ERR(status
)) {
7976 /* Return variables */
7977 *count
= *r
.out
.count
;
7978 *info
= *r
.out
.info
;
7979 *needed
= *r
.out
.needed
;
7983 *werror
= r
.out
.result
;
7986 return werror_to_ntstatus(r
.out
.result
);
7989 struct rpccli_spoolss_ResetPrinter_state
{
7990 struct spoolss_ResetPrinter orig
;
7991 struct spoolss_ResetPrinter tmp
;
7992 TALLOC_CTX
*out_mem_ctx
;
7993 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7996 static void rpccli_spoolss_ResetPrinter_done(struct tevent_req
*subreq
);
7998 struct tevent_req
*rpccli_spoolss_ResetPrinter_send(TALLOC_CTX
*mem_ctx
,
7999 struct tevent_context
*ev
,
8000 struct rpc_pipe_client
*cli
,
8001 struct policy_handle
*_handle
/* [in] [ref] */,
8002 const char *_data_type
/* [in] [unique,charset(UTF16)] */,
8003 struct spoolss_DevmodeContainer
*_devmode_ctr
/* [in] [ref] */)
8005 struct tevent_req
*req
;
8006 struct rpccli_spoolss_ResetPrinter_state
*state
;
8007 struct tevent_req
*subreq
;
8009 req
= tevent_req_create(mem_ctx
, &state
,
8010 struct rpccli_spoolss_ResetPrinter_state
);
8014 state
->out_mem_ctx
= NULL
;
8015 state
->dispatch_recv
= cli
->dispatch_recv
;
8018 state
->orig
.in
.handle
= _handle
;
8019 state
->orig
.in
.data_type
= _data_type
;
8020 state
->orig
.in
.devmode_ctr
= _devmode_ctr
;
8022 /* Out parameters */
8025 ZERO_STRUCT(state
->orig
.out
.result
);
8027 /* make a temporary copy, that we pass to the dispatch function */
8028 state
->tmp
= state
->orig
;
8030 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8032 NDR_SPOOLSS_RESETPRINTER
,
8034 if (tevent_req_nomem(subreq
, req
)) {
8035 return tevent_req_post(req
, ev
);
8037 tevent_req_set_callback(subreq
, rpccli_spoolss_ResetPrinter_done
, req
);
8041 static void rpccli_spoolss_ResetPrinter_done(struct tevent_req
*subreq
)
8043 struct tevent_req
*req
= tevent_req_callback_data(
8044 subreq
, struct tevent_req
);
8045 struct rpccli_spoolss_ResetPrinter_state
*state
= tevent_req_data(
8046 req
, struct rpccli_spoolss_ResetPrinter_state
);
8048 TALLOC_CTX
*mem_ctx
;
8050 if (state
->out_mem_ctx
) {
8051 mem_ctx
= state
->out_mem_ctx
;
8056 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8057 TALLOC_FREE(subreq
);
8058 if (!NT_STATUS_IS_OK(status
)) {
8059 tevent_req_nterror(req
, status
);
8063 /* Copy out parameters */
8066 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8068 /* Reset temporary structure */
8069 ZERO_STRUCT(state
->tmp
);
8071 tevent_req_done(req
);
8074 NTSTATUS
rpccli_spoolss_ResetPrinter_recv(struct tevent_req
*req
,
8075 TALLOC_CTX
*mem_ctx
,
8078 struct rpccli_spoolss_ResetPrinter_state
*state
= tevent_req_data(
8079 req
, struct rpccli_spoolss_ResetPrinter_state
);
8082 if (tevent_req_is_nterror(req
, &status
)) {
8083 tevent_req_received(req
);
8087 /* Steal possbile out parameters to the callers context */
8088 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8091 *result
= state
->orig
.out
.result
;
8093 tevent_req_received(req
);
8094 return NT_STATUS_OK
;
8097 NTSTATUS
rpccli_spoolss_ResetPrinter(struct rpc_pipe_client
*cli
,
8098 TALLOC_CTX
*mem_ctx
,
8099 struct policy_handle
*handle
/* [in] [ref] */,
8100 const char *data_type
/* [in] [unique,charset(UTF16)] */,
8101 struct spoolss_DevmodeContainer
*devmode_ctr
/* [in] [ref] */,
8104 struct spoolss_ResetPrinter r
;
8108 r
.in
.handle
= handle
;
8109 r
.in
.data_type
= data_type
;
8110 r
.in
.devmode_ctr
= devmode_ctr
;
8112 status
= cli
->dispatch(cli
,
8115 NDR_SPOOLSS_RESETPRINTER
,
8118 if (!NT_STATUS_IS_OK(status
)) {
8122 if (NT_STATUS_IS_ERR(status
)) {
8126 /* Return variables */
8130 *werror
= r
.out
.result
;
8133 return werror_to_ntstatus(r
.out
.result
);
8136 struct rpccli_spoolss_GetPrinterDriver2_state
{
8137 struct spoolss_GetPrinterDriver2 orig
;
8138 struct spoolss_GetPrinterDriver2 tmp
;
8139 TALLOC_CTX
*out_mem_ctx
;
8140 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8143 static void rpccli_spoolss_GetPrinterDriver2_done(struct tevent_req
*subreq
);
8145 struct tevent_req
*rpccli_spoolss_GetPrinterDriver2_send(TALLOC_CTX
*mem_ctx
,
8146 struct tevent_context
*ev
,
8147 struct rpc_pipe_client
*cli
,
8148 struct policy_handle
*_handle
/* [in] [ref] */,
8149 const char *_architecture
/* [in] [unique,charset(UTF16)] */,
8150 uint32_t _level
/* [in] */,
8151 DATA_BLOB
*_buffer
/* [in] [unique] */,
8152 uint32_t _offered
/* [in] */,
8153 uint32_t _client_major_version
/* [in] */,
8154 uint32_t _client_minor_version
/* [in] */,
8155 union spoolss_DriverInfo
*_info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
8156 uint32_t *_needed
/* [out] [ref] */,
8157 uint32_t *_server_major_version
/* [out] [ref] */,
8158 uint32_t *_server_minor_version
/* [out] [ref] */)
8160 struct tevent_req
*req
;
8161 struct rpccli_spoolss_GetPrinterDriver2_state
*state
;
8162 struct tevent_req
*subreq
;
8164 req
= tevent_req_create(mem_ctx
, &state
,
8165 struct rpccli_spoolss_GetPrinterDriver2_state
);
8169 state
->out_mem_ctx
= NULL
;
8170 state
->dispatch_recv
= cli
->dispatch_recv
;
8173 state
->orig
.in
.handle
= _handle
;
8174 state
->orig
.in
.architecture
= _architecture
;
8175 state
->orig
.in
.level
= _level
;
8176 state
->orig
.in
.buffer
= _buffer
;
8177 state
->orig
.in
.offered
= _offered
;
8178 state
->orig
.in
.client_major_version
= _client_major_version
;
8179 state
->orig
.in
.client_minor_version
= _client_minor_version
;
8181 /* Out parameters */
8182 state
->orig
.out
.info
= _info
;
8183 state
->orig
.out
.needed
= _needed
;
8184 state
->orig
.out
.server_major_version
= _server_major_version
;
8185 state
->orig
.out
.server_minor_version
= _server_minor_version
;
8188 ZERO_STRUCT(state
->orig
.out
.result
);
8190 state
->out_mem_ctx
= talloc_named_const(state
, 0,
8191 "rpccli_spoolss_GetPrinterDriver2_out_memory");
8192 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
8193 return tevent_req_post(req
, ev
);
8196 /* make a temporary copy, that we pass to the dispatch function */
8197 state
->tmp
= state
->orig
;
8199 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8201 NDR_SPOOLSS_GETPRINTERDRIVER2
,
8203 if (tevent_req_nomem(subreq
, req
)) {
8204 return tevent_req_post(req
, ev
);
8206 tevent_req_set_callback(subreq
, rpccli_spoolss_GetPrinterDriver2_done
, req
);
8210 static void rpccli_spoolss_GetPrinterDriver2_done(struct tevent_req
*subreq
)
8212 struct tevent_req
*req
= tevent_req_callback_data(
8213 subreq
, struct tevent_req
);
8214 struct rpccli_spoolss_GetPrinterDriver2_state
*state
= tevent_req_data(
8215 req
, struct rpccli_spoolss_GetPrinterDriver2_state
);
8217 TALLOC_CTX
*mem_ctx
;
8219 if (state
->out_mem_ctx
) {
8220 mem_ctx
= state
->out_mem_ctx
;
8225 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8226 TALLOC_FREE(subreq
);
8227 if (!NT_STATUS_IS_OK(status
)) {
8228 tevent_req_nterror(req
, status
);
8232 /* Copy out parameters */
8233 if (state
->orig
.out
.info
&& state
->tmp
.out
.info
) {
8234 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
8236 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
8237 *state
->orig
.out
.server_major_version
= *state
->tmp
.out
.server_major_version
;
8238 *state
->orig
.out
.server_minor_version
= *state
->tmp
.out
.server_minor_version
;
8241 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8243 /* Reset temporary structure */
8244 ZERO_STRUCT(state
->tmp
);
8246 tevent_req_done(req
);
8249 NTSTATUS
rpccli_spoolss_GetPrinterDriver2_recv(struct tevent_req
*req
,
8250 TALLOC_CTX
*mem_ctx
,
8253 struct rpccli_spoolss_GetPrinterDriver2_state
*state
= tevent_req_data(
8254 req
, struct rpccli_spoolss_GetPrinterDriver2_state
);
8257 if (tevent_req_is_nterror(req
, &status
)) {
8258 tevent_req_received(req
);
8262 /* Steal possbile out parameters to the callers context */
8263 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8266 *result
= state
->orig
.out
.result
;
8268 tevent_req_received(req
);
8269 return NT_STATUS_OK
;
8272 NTSTATUS
rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client
*cli
,
8273 TALLOC_CTX
*mem_ctx
,
8274 struct policy_handle
*handle
/* [in] [ref] */,
8275 const char *architecture
/* [in] [unique,charset(UTF16)] */,
8276 uint32_t level
/* [in] */,
8277 DATA_BLOB
*buffer
/* [in] [unique] */,
8278 uint32_t offered
/* [in] */,
8279 uint32_t client_major_version
/* [in] */,
8280 uint32_t client_minor_version
/* [in] */,
8281 union spoolss_DriverInfo
*info
/* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
8282 uint32_t *needed
/* [out] [ref] */,
8283 uint32_t *server_major_version
/* [out] [ref] */,
8284 uint32_t *server_minor_version
/* [out] [ref] */,
8287 struct spoolss_GetPrinterDriver2 r
;
8291 r
.in
.handle
= handle
;
8292 r
.in
.architecture
= architecture
;
8294 r
.in
.buffer
= buffer
;
8295 r
.in
.offered
= offered
;
8296 r
.in
.client_major_version
= client_major_version
;
8297 r
.in
.client_minor_version
= client_minor_version
;
8299 status
= cli
->dispatch(cli
,
8302 NDR_SPOOLSS_GETPRINTERDRIVER2
,
8305 if (!NT_STATUS_IS_OK(status
)) {
8309 if (NT_STATUS_IS_ERR(status
)) {
8313 /* Return variables */
8314 if (info
&& r
.out
.info
) {
8315 *info
= *r
.out
.info
;
8317 *needed
= *r
.out
.needed
;
8318 *server_major_version
= *r
.out
.server_major_version
;
8319 *server_minor_version
= *r
.out
.server_minor_version
;
8323 *werror
= r
.out
.result
;
8326 return werror_to_ntstatus(r
.out
.result
);
8329 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state
{
8330 struct spoolss_FindFirstPrinterChangeNotification orig
;
8331 struct spoolss_FindFirstPrinterChangeNotification tmp
;
8332 TALLOC_CTX
*out_mem_ctx
;
8333 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8336 static void rpccli_spoolss_FindFirstPrinterChangeNotification_done(struct tevent_req
*subreq
);
8338 struct tevent_req
*rpccli_spoolss_FindFirstPrinterChangeNotification_send(TALLOC_CTX
*mem_ctx
,
8339 struct tevent_context
*ev
,
8340 struct rpc_pipe_client
*cli
)
8342 struct tevent_req
*req
;
8343 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state
*state
;
8344 struct tevent_req
*subreq
;
8346 req
= tevent_req_create(mem_ctx
, &state
,
8347 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state
);
8351 state
->out_mem_ctx
= NULL
;
8352 state
->dispatch_recv
= cli
->dispatch_recv
;
8356 /* Out parameters */
8359 ZERO_STRUCT(state
->orig
.out
.result
);
8361 /* make a temporary copy, that we pass to the dispatch function */
8362 state
->tmp
= state
->orig
;
8364 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8366 NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION
,
8368 if (tevent_req_nomem(subreq
, req
)) {
8369 return tevent_req_post(req
, ev
);
8371 tevent_req_set_callback(subreq
, rpccli_spoolss_FindFirstPrinterChangeNotification_done
, req
);
8375 static void rpccli_spoolss_FindFirstPrinterChangeNotification_done(struct tevent_req
*subreq
)
8377 struct tevent_req
*req
= tevent_req_callback_data(
8378 subreq
, struct tevent_req
);
8379 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state
*state
= tevent_req_data(
8380 req
, struct rpccli_spoolss_FindFirstPrinterChangeNotification_state
);
8382 TALLOC_CTX
*mem_ctx
;
8384 if (state
->out_mem_ctx
) {
8385 mem_ctx
= state
->out_mem_ctx
;
8390 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8391 TALLOC_FREE(subreq
);
8392 if (!NT_STATUS_IS_OK(status
)) {
8393 tevent_req_nterror(req
, status
);
8397 /* Copy out parameters */
8400 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8402 /* Reset temporary structure */
8403 ZERO_STRUCT(state
->tmp
);
8405 tevent_req_done(req
);
8408 NTSTATUS
rpccli_spoolss_FindFirstPrinterChangeNotification_recv(struct tevent_req
*req
,
8409 TALLOC_CTX
*mem_ctx
,
8412 struct rpccli_spoolss_FindFirstPrinterChangeNotification_state
*state
= tevent_req_data(
8413 req
, struct rpccli_spoolss_FindFirstPrinterChangeNotification_state
);
8416 if (tevent_req_is_nterror(req
, &status
)) {
8417 tevent_req_received(req
);
8421 /* Steal possbile out parameters to the callers context */
8422 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8425 *result
= state
->orig
.out
.result
;
8427 tevent_req_received(req
);
8428 return NT_STATUS_OK
;
8431 NTSTATUS
rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client
*cli
,
8432 TALLOC_CTX
*mem_ctx
,
8435 struct spoolss_FindFirstPrinterChangeNotification r
;
8440 status
= cli
->dispatch(cli
,
8443 NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION
,
8446 if (!NT_STATUS_IS_OK(status
)) {
8450 if (NT_STATUS_IS_ERR(status
)) {
8454 /* Return variables */
8458 *werror
= r
.out
.result
;
8461 return werror_to_ntstatus(r
.out
.result
);
8464 struct rpccli_spoolss_FindNextPrinterChangeNotification_state
{
8465 struct spoolss_FindNextPrinterChangeNotification orig
;
8466 struct spoolss_FindNextPrinterChangeNotification tmp
;
8467 TALLOC_CTX
*out_mem_ctx
;
8468 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8471 static void rpccli_spoolss_FindNextPrinterChangeNotification_done(struct tevent_req
*subreq
);
8473 struct tevent_req
*rpccli_spoolss_FindNextPrinterChangeNotification_send(TALLOC_CTX
*mem_ctx
,
8474 struct tevent_context
*ev
,
8475 struct rpc_pipe_client
*cli
)
8477 struct tevent_req
*req
;
8478 struct rpccli_spoolss_FindNextPrinterChangeNotification_state
*state
;
8479 struct tevent_req
*subreq
;
8481 req
= tevent_req_create(mem_ctx
, &state
,
8482 struct rpccli_spoolss_FindNextPrinterChangeNotification_state
);
8486 state
->out_mem_ctx
= NULL
;
8487 state
->dispatch_recv
= cli
->dispatch_recv
;
8491 /* Out parameters */
8494 ZERO_STRUCT(state
->orig
.out
.result
);
8496 /* make a temporary copy, that we pass to the dispatch function */
8497 state
->tmp
= state
->orig
;
8499 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8501 NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION
,
8503 if (tevent_req_nomem(subreq
, req
)) {
8504 return tevent_req_post(req
, ev
);
8506 tevent_req_set_callback(subreq
, rpccli_spoolss_FindNextPrinterChangeNotification_done
, req
);
8510 static void rpccli_spoolss_FindNextPrinterChangeNotification_done(struct tevent_req
*subreq
)
8512 struct tevent_req
*req
= tevent_req_callback_data(
8513 subreq
, struct tevent_req
);
8514 struct rpccli_spoolss_FindNextPrinterChangeNotification_state
*state
= tevent_req_data(
8515 req
, struct rpccli_spoolss_FindNextPrinterChangeNotification_state
);
8517 TALLOC_CTX
*mem_ctx
;
8519 if (state
->out_mem_ctx
) {
8520 mem_ctx
= state
->out_mem_ctx
;
8525 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8526 TALLOC_FREE(subreq
);
8527 if (!NT_STATUS_IS_OK(status
)) {
8528 tevent_req_nterror(req
, status
);
8532 /* Copy out parameters */
8535 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8537 /* Reset temporary structure */
8538 ZERO_STRUCT(state
->tmp
);
8540 tevent_req_done(req
);
8543 NTSTATUS
rpccli_spoolss_FindNextPrinterChangeNotification_recv(struct tevent_req
*req
,
8544 TALLOC_CTX
*mem_ctx
,
8547 struct rpccli_spoolss_FindNextPrinterChangeNotification_state
*state
= tevent_req_data(
8548 req
, struct rpccli_spoolss_FindNextPrinterChangeNotification_state
);
8551 if (tevent_req_is_nterror(req
, &status
)) {
8552 tevent_req_received(req
);
8556 /* Steal possbile out parameters to the callers context */
8557 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8560 *result
= state
->orig
.out
.result
;
8562 tevent_req_received(req
);
8563 return NT_STATUS_OK
;
8566 NTSTATUS
rpccli_spoolss_FindNextPrinterChangeNotification(struct rpc_pipe_client
*cli
,
8567 TALLOC_CTX
*mem_ctx
,
8570 struct spoolss_FindNextPrinterChangeNotification r
;
8575 status
= cli
->dispatch(cli
,
8578 NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION
,
8581 if (!NT_STATUS_IS_OK(status
)) {
8585 if (NT_STATUS_IS_ERR(status
)) {
8589 /* Return variables */
8593 *werror
= r
.out
.result
;
8596 return werror_to_ntstatus(r
.out
.result
);
8599 struct rpccli_spoolss_FindClosePrinterNotify_state
{
8600 struct spoolss_FindClosePrinterNotify orig
;
8601 struct spoolss_FindClosePrinterNotify tmp
;
8602 TALLOC_CTX
*out_mem_ctx
;
8603 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8606 static void rpccli_spoolss_FindClosePrinterNotify_done(struct tevent_req
*subreq
);
8608 struct tevent_req
*rpccli_spoolss_FindClosePrinterNotify_send(TALLOC_CTX
*mem_ctx
,
8609 struct tevent_context
*ev
,
8610 struct rpc_pipe_client
*cli
,
8611 struct policy_handle
*_handle
/* [in] [ref] */)
8613 struct tevent_req
*req
;
8614 struct rpccli_spoolss_FindClosePrinterNotify_state
*state
;
8615 struct tevent_req
*subreq
;
8617 req
= tevent_req_create(mem_ctx
, &state
,
8618 struct rpccli_spoolss_FindClosePrinterNotify_state
);
8622 state
->out_mem_ctx
= NULL
;
8623 state
->dispatch_recv
= cli
->dispatch_recv
;
8626 state
->orig
.in
.handle
= _handle
;
8628 /* Out parameters */
8631 ZERO_STRUCT(state
->orig
.out
.result
);
8633 /* make a temporary copy, that we pass to the dispatch function */
8634 state
->tmp
= state
->orig
;
8636 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8638 NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY
,
8640 if (tevent_req_nomem(subreq
, req
)) {
8641 return tevent_req_post(req
, ev
);
8643 tevent_req_set_callback(subreq
, rpccli_spoolss_FindClosePrinterNotify_done
, req
);
8647 static void rpccli_spoolss_FindClosePrinterNotify_done(struct tevent_req
*subreq
)
8649 struct tevent_req
*req
= tevent_req_callback_data(
8650 subreq
, struct tevent_req
);
8651 struct rpccli_spoolss_FindClosePrinterNotify_state
*state
= tevent_req_data(
8652 req
, struct rpccli_spoolss_FindClosePrinterNotify_state
);
8654 TALLOC_CTX
*mem_ctx
;
8656 if (state
->out_mem_ctx
) {
8657 mem_ctx
= state
->out_mem_ctx
;
8662 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8663 TALLOC_FREE(subreq
);
8664 if (!NT_STATUS_IS_OK(status
)) {
8665 tevent_req_nterror(req
, status
);
8669 /* Copy out parameters */
8672 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8674 /* Reset temporary structure */
8675 ZERO_STRUCT(state
->tmp
);
8677 tevent_req_done(req
);
8680 NTSTATUS
rpccli_spoolss_FindClosePrinterNotify_recv(struct tevent_req
*req
,
8681 TALLOC_CTX
*mem_ctx
,
8684 struct rpccli_spoolss_FindClosePrinterNotify_state
*state
= tevent_req_data(
8685 req
, struct rpccli_spoolss_FindClosePrinterNotify_state
);
8688 if (tevent_req_is_nterror(req
, &status
)) {
8689 tevent_req_received(req
);
8693 /* Steal possbile out parameters to the callers context */
8694 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8697 *result
= state
->orig
.out
.result
;
8699 tevent_req_received(req
);
8700 return NT_STATUS_OK
;
8703 NTSTATUS
rpccli_spoolss_FindClosePrinterNotify(struct rpc_pipe_client
*cli
,
8704 TALLOC_CTX
*mem_ctx
,
8705 struct policy_handle
*handle
/* [in] [ref] */,
8708 struct spoolss_FindClosePrinterNotify r
;
8712 r
.in
.handle
= handle
;
8714 status
= cli
->dispatch(cli
,
8717 NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY
,
8720 if (!NT_STATUS_IS_OK(status
)) {
8724 if (NT_STATUS_IS_ERR(status
)) {
8728 /* Return variables */
8732 *werror
= r
.out
.result
;
8735 return werror_to_ntstatus(r
.out
.result
);
8738 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state
{
8739 struct spoolss_RouterFindFirstPrinterChangeNotificationOld orig
;
8740 struct spoolss_RouterFindFirstPrinterChangeNotificationOld tmp
;
8741 TALLOC_CTX
*out_mem_ctx
;
8742 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8745 static void rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_done(struct tevent_req
*subreq
);
8747 struct tevent_req
*rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_send(TALLOC_CTX
*mem_ctx
,
8748 struct tevent_context
*ev
,
8749 struct rpc_pipe_client
*cli
)
8751 struct tevent_req
*req
;
8752 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state
*state
;
8753 struct tevent_req
*subreq
;
8755 req
= tevent_req_create(mem_ctx
, &state
,
8756 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state
);
8760 state
->out_mem_ctx
= NULL
;
8761 state
->dispatch_recv
= cli
->dispatch_recv
;
8765 /* Out parameters */
8768 ZERO_STRUCT(state
->orig
.out
.result
);
8770 /* make a temporary copy, that we pass to the dispatch function */
8771 state
->tmp
= state
->orig
;
8773 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8775 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD
,
8777 if (tevent_req_nomem(subreq
, req
)) {
8778 return tevent_req_post(req
, ev
);
8780 tevent_req_set_callback(subreq
, rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_done
, req
);
8784 static void rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_done(struct tevent_req
*subreq
)
8786 struct tevent_req
*req
= tevent_req_callback_data(
8787 subreq
, struct tevent_req
);
8788 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state
*state
= tevent_req_data(
8789 req
, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state
);
8791 TALLOC_CTX
*mem_ctx
;
8793 if (state
->out_mem_ctx
) {
8794 mem_ctx
= state
->out_mem_ctx
;
8799 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8800 TALLOC_FREE(subreq
);
8801 if (!NT_STATUS_IS_OK(status
)) {
8802 tevent_req_nterror(req
, status
);
8806 /* Copy out parameters */
8809 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8811 /* Reset temporary structure */
8812 ZERO_STRUCT(state
->tmp
);
8814 tevent_req_done(req
);
8817 NTSTATUS
rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_recv(struct tevent_req
*req
,
8818 TALLOC_CTX
*mem_ctx
,
8821 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state
*state
= tevent_req_data(
8822 req
, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state
);
8825 if (tevent_req_is_nterror(req
, &status
)) {
8826 tevent_req_received(req
);
8830 /* Steal possbile out parameters to the callers context */
8831 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8834 *result
= state
->orig
.out
.result
;
8836 tevent_req_received(req
);
8837 return NT_STATUS_OK
;
8840 NTSTATUS
rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld(struct rpc_pipe_client
*cli
,
8841 TALLOC_CTX
*mem_ctx
,
8844 struct spoolss_RouterFindFirstPrinterChangeNotificationOld r
;
8849 status
= cli
->dispatch(cli
,
8852 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD
,
8855 if (!NT_STATUS_IS_OK(status
)) {
8859 if (NT_STATUS_IS_ERR(status
)) {
8863 /* Return variables */
8867 *werror
= r
.out
.result
;
8870 return werror_to_ntstatus(r
.out
.result
);
8873 struct rpccli_spoolss_ReplyOpenPrinter_state
{
8874 struct spoolss_ReplyOpenPrinter orig
;
8875 struct spoolss_ReplyOpenPrinter tmp
;
8876 TALLOC_CTX
*out_mem_ctx
;
8877 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8880 static void rpccli_spoolss_ReplyOpenPrinter_done(struct tevent_req
*subreq
);
8882 struct tevent_req
*rpccli_spoolss_ReplyOpenPrinter_send(TALLOC_CTX
*mem_ctx
,
8883 struct tevent_context
*ev
,
8884 struct rpc_pipe_client
*cli
,
8885 const char *_server_name
/* [in] [charset(UTF16)] */,
8886 uint32_t _printer_local
/* [in] */,
8887 enum winreg_Type _type
/* [in] */,
8888 uint32_t _bufsize
/* [in] [range(0,512)] */,
8889 uint8_t *_buffer
/* [in] [unique,size_is(bufsize)] */,
8890 struct policy_handle
*_handle
/* [out] [ref] */)
8892 struct tevent_req
*req
;
8893 struct rpccli_spoolss_ReplyOpenPrinter_state
*state
;
8894 struct tevent_req
*subreq
;
8896 req
= tevent_req_create(mem_ctx
, &state
,
8897 struct rpccli_spoolss_ReplyOpenPrinter_state
);
8901 state
->out_mem_ctx
= NULL
;
8902 state
->dispatch_recv
= cli
->dispatch_recv
;
8905 state
->orig
.in
.server_name
= _server_name
;
8906 state
->orig
.in
.printer_local
= _printer_local
;
8907 state
->orig
.in
.type
= _type
;
8908 state
->orig
.in
.bufsize
= _bufsize
;
8909 state
->orig
.in
.buffer
= _buffer
;
8911 /* Out parameters */
8912 state
->orig
.out
.handle
= _handle
;
8915 ZERO_STRUCT(state
->orig
.out
.result
);
8917 state
->out_mem_ctx
= talloc_named_const(state
, 0,
8918 "rpccli_spoolss_ReplyOpenPrinter_out_memory");
8919 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
8920 return tevent_req_post(req
, ev
);
8923 /* make a temporary copy, that we pass to the dispatch function */
8924 state
->tmp
= state
->orig
;
8926 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8928 NDR_SPOOLSS_REPLYOPENPRINTER
,
8930 if (tevent_req_nomem(subreq
, req
)) {
8931 return tevent_req_post(req
, ev
);
8933 tevent_req_set_callback(subreq
, rpccli_spoolss_ReplyOpenPrinter_done
, req
);
8937 static void rpccli_spoolss_ReplyOpenPrinter_done(struct tevent_req
*subreq
)
8939 struct tevent_req
*req
= tevent_req_callback_data(
8940 subreq
, struct tevent_req
);
8941 struct rpccli_spoolss_ReplyOpenPrinter_state
*state
= tevent_req_data(
8942 req
, struct rpccli_spoolss_ReplyOpenPrinter_state
);
8944 TALLOC_CTX
*mem_ctx
;
8946 if (state
->out_mem_ctx
) {
8947 mem_ctx
= state
->out_mem_ctx
;
8952 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8953 TALLOC_FREE(subreq
);
8954 if (!NT_STATUS_IS_OK(status
)) {
8955 tevent_req_nterror(req
, status
);
8959 /* Copy out parameters */
8960 *state
->orig
.out
.handle
= *state
->tmp
.out
.handle
;
8963 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8965 /* Reset temporary structure */
8966 ZERO_STRUCT(state
->tmp
);
8968 tevent_req_done(req
);
8971 NTSTATUS
rpccli_spoolss_ReplyOpenPrinter_recv(struct tevent_req
*req
,
8972 TALLOC_CTX
*mem_ctx
,
8975 struct rpccli_spoolss_ReplyOpenPrinter_state
*state
= tevent_req_data(
8976 req
, struct rpccli_spoolss_ReplyOpenPrinter_state
);
8979 if (tevent_req_is_nterror(req
, &status
)) {
8980 tevent_req_received(req
);
8984 /* Steal possbile out parameters to the callers context */
8985 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8988 *result
= state
->orig
.out
.result
;
8990 tevent_req_received(req
);
8991 return NT_STATUS_OK
;
8994 NTSTATUS
rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client
*cli
,
8995 TALLOC_CTX
*mem_ctx
,
8996 const char *server_name
/* [in] [charset(UTF16)] */,
8997 uint32_t printer_local
/* [in] */,
8998 enum winreg_Type type
/* [in] */,
8999 uint32_t bufsize
/* [in] [range(0,512)] */,
9000 uint8_t *buffer
/* [in] [unique,size_is(bufsize)] */,
9001 struct policy_handle
*handle
/* [out] [ref] */,
9004 struct spoolss_ReplyOpenPrinter r
;
9008 r
.in
.server_name
= server_name
;
9009 r
.in
.printer_local
= printer_local
;
9011 r
.in
.bufsize
= bufsize
;
9012 r
.in
.buffer
= buffer
;
9014 status
= cli
->dispatch(cli
,
9017 NDR_SPOOLSS_REPLYOPENPRINTER
,
9020 if (!NT_STATUS_IS_OK(status
)) {
9024 if (NT_STATUS_IS_ERR(status
)) {
9028 /* Return variables */
9029 *handle
= *r
.out
.handle
;
9033 *werror
= r
.out
.result
;
9036 return werror_to_ntstatus(r
.out
.result
);
9039 struct rpccli_spoolss_RouterReplyPrinter_state
{
9040 struct spoolss_RouterReplyPrinter orig
;
9041 struct spoolss_RouterReplyPrinter tmp
;
9042 TALLOC_CTX
*out_mem_ctx
;
9043 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9046 static void rpccli_spoolss_RouterReplyPrinter_done(struct tevent_req
*subreq
);
9048 struct tevent_req
*rpccli_spoolss_RouterReplyPrinter_send(TALLOC_CTX
*mem_ctx
,
9049 struct tevent_context
*ev
,
9050 struct rpc_pipe_client
*cli
,
9051 struct policy_handle
*_handle
/* [in] [ref] */,
9052 uint32_t _flags
/* [in] */,
9053 uint32_t _bufsize
/* [in] [range(0,512)] */,
9054 uint8_t *_buffer
/* [in] [unique,size_is(bufsize)] */)
9056 struct tevent_req
*req
;
9057 struct rpccli_spoolss_RouterReplyPrinter_state
*state
;
9058 struct tevent_req
*subreq
;
9060 req
= tevent_req_create(mem_ctx
, &state
,
9061 struct rpccli_spoolss_RouterReplyPrinter_state
);
9065 state
->out_mem_ctx
= NULL
;
9066 state
->dispatch_recv
= cli
->dispatch_recv
;
9069 state
->orig
.in
.handle
= _handle
;
9070 state
->orig
.in
.flags
= _flags
;
9071 state
->orig
.in
.bufsize
= _bufsize
;
9072 state
->orig
.in
.buffer
= _buffer
;
9074 /* Out parameters */
9077 ZERO_STRUCT(state
->orig
.out
.result
);
9079 /* make a temporary copy, that we pass to the dispatch function */
9080 state
->tmp
= state
->orig
;
9082 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9084 NDR_SPOOLSS_ROUTERREPLYPRINTER
,
9086 if (tevent_req_nomem(subreq
, req
)) {
9087 return tevent_req_post(req
, ev
);
9089 tevent_req_set_callback(subreq
, rpccli_spoolss_RouterReplyPrinter_done
, req
);
9093 static void rpccli_spoolss_RouterReplyPrinter_done(struct tevent_req
*subreq
)
9095 struct tevent_req
*req
= tevent_req_callback_data(
9096 subreq
, struct tevent_req
);
9097 struct rpccli_spoolss_RouterReplyPrinter_state
*state
= tevent_req_data(
9098 req
, struct rpccli_spoolss_RouterReplyPrinter_state
);
9100 TALLOC_CTX
*mem_ctx
;
9102 if (state
->out_mem_ctx
) {
9103 mem_ctx
= state
->out_mem_ctx
;
9108 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9109 TALLOC_FREE(subreq
);
9110 if (!NT_STATUS_IS_OK(status
)) {
9111 tevent_req_nterror(req
, status
);
9115 /* Copy out parameters */
9118 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9120 /* Reset temporary structure */
9121 ZERO_STRUCT(state
->tmp
);
9123 tevent_req_done(req
);
9126 NTSTATUS
rpccli_spoolss_RouterReplyPrinter_recv(struct tevent_req
*req
,
9127 TALLOC_CTX
*mem_ctx
,
9130 struct rpccli_spoolss_RouterReplyPrinter_state
*state
= tevent_req_data(
9131 req
, struct rpccli_spoolss_RouterReplyPrinter_state
);
9134 if (tevent_req_is_nterror(req
, &status
)) {
9135 tevent_req_received(req
);
9139 /* Steal possbile out parameters to the callers context */
9140 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9143 *result
= state
->orig
.out
.result
;
9145 tevent_req_received(req
);
9146 return NT_STATUS_OK
;
9149 NTSTATUS
rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client
*cli
,
9150 TALLOC_CTX
*mem_ctx
,
9151 struct policy_handle
*handle
/* [in] [ref] */,
9152 uint32_t flags
/* [in] */,
9153 uint32_t bufsize
/* [in] [range(0,512)] */,
9154 uint8_t *buffer
/* [in] [unique,size_is(bufsize)] */,
9157 struct spoolss_RouterReplyPrinter r
;
9161 r
.in
.handle
= handle
;
9163 r
.in
.bufsize
= bufsize
;
9164 r
.in
.buffer
= buffer
;
9166 status
= cli
->dispatch(cli
,
9169 NDR_SPOOLSS_ROUTERREPLYPRINTER
,
9172 if (!NT_STATUS_IS_OK(status
)) {
9176 if (NT_STATUS_IS_ERR(status
)) {
9180 /* Return variables */
9184 *werror
= r
.out
.result
;
9187 return werror_to_ntstatus(r
.out
.result
);
9190 struct rpccli_spoolss_ReplyClosePrinter_state
{
9191 struct spoolss_ReplyClosePrinter orig
;
9192 struct spoolss_ReplyClosePrinter tmp
;
9193 TALLOC_CTX
*out_mem_ctx
;
9194 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9197 static void rpccli_spoolss_ReplyClosePrinter_done(struct tevent_req
*subreq
);
9199 struct tevent_req
*rpccli_spoolss_ReplyClosePrinter_send(TALLOC_CTX
*mem_ctx
,
9200 struct tevent_context
*ev
,
9201 struct rpc_pipe_client
*cli
,
9202 struct policy_handle
*_handle
/* [in,out] [ref] */)
9204 struct tevent_req
*req
;
9205 struct rpccli_spoolss_ReplyClosePrinter_state
*state
;
9206 struct tevent_req
*subreq
;
9208 req
= tevent_req_create(mem_ctx
, &state
,
9209 struct rpccli_spoolss_ReplyClosePrinter_state
);
9213 state
->out_mem_ctx
= NULL
;
9214 state
->dispatch_recv
= cli
->dispatch_recv
;
9217 state
->orig
.in
.handle
= _handle
;
9219 /* Out parameters */
9220 state
->orig
.out
.handle
= _handle
;
9223 ZERO_STRUCT(state
->orig
.out
.result
);
9225 state
->out_mem_ctx
= talloc_named_const(state
, 0,
9226 "rpccli_spoolss_ReplyClosePrinter_out_memory");
9227 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
9228 return tevent_req_post(req
, ev
);
9231 /* make a temporary copy, that we pass to the dispatch function */
9232 state
->tmp
= state
->orig
;
9234 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9236 NDR_SPOOLSS_REPLYCLOSEPRINTER
,
9238 if (tevent_req_nomem(subreq
, req
)) {
9239 return tevent_req_post(req
, ev
);
9241 tevent_req_set_callback(subreq
, rpccli_spoolss_ReplyClosePrinter_done
, req
);
9245 static void rpccli_spoolss_ReplyClosePrinter_done(struct tevent_req
*subreq
)
9247 struct tevent_req
*req
= tevent_req_callback_data(
9248 subreq
, struct tevent_req
);
9249 struct rpccli_spoolss_ReplyClosePrinter_state
*state
= tevent_req_data(
9250 req
, struct rpccli_spoolss_ReplyClosePrinter_state
);
9252 TALLOC_CTX
*mem_ctx
;
9254 if (state
->out_mem_ctx
) {
9255 mem_ctx
= state
->out_mem_ctx
;
9260 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9261 TALLOC_FREE(subreq
);
9262 if (!NT_STATUS_IS_OK(status
)) {
9263 tevent_req_nterror(req
, status
);
9267 /* Copy out parameters */
9268 *state
->orig
.out
.handle
= *state
->tmp
.out
.handle
;
9271 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9273 /* Reset temporary structure */
9274 ZERO_STRUCT(state
->tmp
);
9276 tevent_req_done(req
);
9279 NTSTATUS
rpccli_spoolss_ReplyClosePrinter_recv(struct tevent_req
*req
,
9280 TALLOC_CTX
*mem_ctx
,
9283 struct rpccli_spoolss_ReplyClosePrinter_state
*state
= tevent_req_data(
9284 req
, struct rpccli_spoolss_ReplyClosePrinter_state
);
9287 if (tevent_req_is_nterror(req
, &status
)) {
9288 tevent_req_received(req
);
9292 /* Steal possbile out parameters to the callers context */
9293 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9296 *result
= state
->orig
.out
.result
;
9298 tevent_req_received(req
);
9299 return NT_STATUS_OK
;
9302 NTSTATUS
rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client
*cli
,
9303 TALLOC_CTX
*mem_ctx
,
9304 struct policy_handle
*handle
/* [in,out] [ref] */,
9307 struct spoolss_ReplyClosePrinter r
;
9311 r
.in
.handle
= handle
;
9313 status
= cli
->dispatch(cli
,
9316 NDR_SPOOLSS_REPLYCLOSEPRINTER
,
9319 if (!NT_STATUS_IS_OK(status
)) {
9323 if (NT_STATUS_IS_ERR(status
)) {
9327 /* Return variables */
9328 *handle
= *r
.out
.handle
;
9332 *werror
= r
.out
.result
;
9335 return werror_to_ntstatus(r
.out
.result
);
9338 struct rpccli_spoolss_AddPortEx_state
{
9339 struct spoolss_AddPortEx orig
;
9340 struct spoolss_AddPortEx tmp
;
9341 TALLOC_CTX
*out_mem_ctx
;
9342 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9345 static void rpccli_spoolss_AddPortEx_done(struct tevent_req
*subreq
);
9347 struct tevent_req
*rpccli_spoolss_AddPortEx_send(TALLOC_CTX
*mem_ctx
,
9348 struct tevent_context
*ev
,
9349 struct rpc_pipe_client
*cli
)
9351 struct tevent_req
*req
;
9352 struct rpccli_spoolss_AddPortEx_state
*state
;
9353 struct tevent_req
*subreq
;
9355 req
= tevent_req_create(mem_ctx
, &state
,
9356 struct rpccli_spoolss_AddPortEx_state
);
9360 state
->out_mem_ctx
= NULL
;
9361 state
->dispatch_recv
= cli
->dispatch_recv
;
9365 /* Out parameters */
9368 ZERO_STRUCT(state
->orig
.out
.result
);
9370 /* make a temporary copy, that we pass to the dispatch function */
9371 state
->tmp
= state
->orig
;
9373 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9375 NDR_SPOOLSS_ADDPORTEX
,
9377 if (tevent_req_nomem(subreq
, req
)) {
9378 return tevent_req_post(req
, ev
);
9380 tevent_req_set_callback(subreq
, rpccli_spoolss_AddPortEx_done
, req
);
9384 static void rpccli_spoolss_AddPortEx_done(struct tevent_req
*subreq
)
9386 struct tevent_req
*req
= tevent_req_callback_data(
9387 subreq
, struct tevent_req
);
9388 struct rpccli_spoolss_AddPortEx_state
*state
= tevent_req_data(
9389 req
, struct rpccli_spoolss_AddPortEx_state
);
9391 TALLOC_CTX
*mem_ctx
;
9393 if (state
->out_mem_ctx
) {
9394 mem_ctx
= state
->out_mem_ctx
;
9399 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9400 TALLOC_FREE(subreq
);
9401 if (!NT_STATUS_IS_OK(status
)) {
9402 tevent_req_nterror(req
, status
);
9406 /* Copy out parameters */
9409 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9411 /* Reset temporary structure */
9412 ZERO_STRUCT(state
->tmp
);
9414 tevent_req_done(req
);
9417 NTSTATUS
rpccli_spoolss_AddPortEx_recv(struct tevent_req
*req
,
9418 TALLOC_CTX
*mem_ctx
,
9421 struct rpccli_spoolss_AddPortEx_state
*state
= tevent_req_data(
9422 req
, struct rpccli_spoolss_AddPortEx_state
);
9425 if (tevent_req_is_nterror(req
, &status
)) {
9426 tevent_req_received(req
);
9430 /* Steal possbile out parameters to the callers context */
9431 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9434 *result
= state
->orig
.out
.result
;
9436 tevent_req_received(req
);
9437 return NT_STATUS_OK
;
9440 NTSTATUS
rpccli_spoolss_AddPortEx(struct rpc_pipe_client
*cli
,
9441 TALLOC_CTX
*mem_ctx
,
9444 struct spoolss_AddPortEx r
;
9449 status
= cli
->dispatch(cli
,
9452 NDR_SPOOLSS_ADDPORTEX
,
9455 if (!NT_STATUS_IS_OK(status
)) {
9459 if (NT_STATUS_IS_ERR(status
)) {
9463 /* Return variables */
9467 *werror
= r
.out
.result
;
9470 return werror_to_ntstatus(r
.out
.result
);
9473 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state
{
9474 struct spoolss_RouterFindFirstPrinterChangeNotification orig
;
9475 struct spoolss_RouterFindFirstPrinterChangeNotification tmp
;
9476 TALLOC_CTX
*out_mem_ctx
;
9477 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9480 static void rpccli_spoolss_RouterFindFirstPrinterChangeNotification_done(struct tevent_req
*subreq
);
9482 struct tevent_req
*rpccli_spoolss_RouterFindFirstPrinterChangeNotification_send(TALLOC_CTX
*mem_ctx
,
9483 struct tevent_context
*ev
,
9484 struct rpc_pipe_client
*cli
)
9486 struct tevent_req
*req
;
9487 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state
*state
;
9488 struct tevent_req
*subreq
;
9490 req
= tevent_req_create(mem_ctx
, &state
,
9491 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state
);
9495 state
->out_mem_ctx
= NULL
;
9496 state
->dispatch_recv
= cli
->dispatch_recv
;
9500 /* Out parameters */
9503 ZERO_STRUCT(state
->orig
.out
.result
);
9505 /* make a temporary copy, that we pass to the dispatch function */
9506 state
->tmp
= state
->orig
;
9508 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9510 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION
,
9512 if (tevent_req_nomem(subreq
, req
)) {
9513 return tevent_req_post(req
, ev
);
9515 tevent_req_set_callback(subreq
, rpccli_spoolss_RouterFindFirstPrinterChangeNotification_done
, req
);
9519 static void rpccli_spoolss_RouterFindFirstPrinterChangeNotification_done(struct tevent_req
*subreq
)
9521 struct tevent_req
*req
= tevent_req_callback_data(
9522 subreq
, struct tevent_req
);
9523 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state
*state
= tevent_req_data(
9524 req
, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state
);
9526 TALLOC_CTX
*mem_ctx
;
9528 if (state
->out_mem_ctx
) {
9529 mem_ctx
= state
->out_mem_ctx
;
9534 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9535 TALLOC_FREE(subreq
);
9536 if (!NT_STATUS_IS_OK(status
)) {
9537 tevent_req_nterror(req
, status
);
9541 /* Copy out parameters */
9544 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9546 /* Reset temporary structure */
9547 ZERO_STRUCT(state
->tmp
);
9549 tevent_req_done(req
);
9552 NTSTATUS
rpccli_spoolss_RouterFindFirstPrinterChangeNotification_recv(struct tevent_req
*req
,
9553 TALLOC_CTX
*mem_ctx
,
9556 struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state
*state
= tevent_req_data(
9557 req
, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state
);
9560 if (tevent_req_is_nterror(req
, &status
)) {
9561 tevent_req_received(req
);
9565 /* Steal possbile out parameters to the callers context */
9566 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9569 *result
= state
->orig
.out
.result
;
9571 tevent_req_received(req
);
9572 return NT_STATUS_OK
;
9575 NTSTATUS
rpccli_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe_client
*cli
,
9576 TALLOC_CTX
*mem_ctx
,
9579 struct spoolss_RouterFindFirstPrinterChangeNotification r
;
9584 status
= cli
->dispatch(cli
,
9587 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION
,
9590 if (!NT_STATUS_IS_OK(status
)) {
9594 if (NT_STATUS_IS_ERR(status
)) {
9598 /* Return variables */
9602 *werror
= r
.out
.result
;
9605 return werror_to_ntstatus(r
.out
.result
);
9608 struct rpccli_spoolss_SpoolerInit_state
{
9609 struct spoolss_SpoolerInit orig
;
9610 struct spoolss_SpoolerInit tmp
;
9611 TALLOC_CTX
*out_mem_ctx
;
9612 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9615 static void rpccli_spoolss_SpoolerInit_done(struct tevent_req
*subreq
);
9617 struct tevent_req
*rpccli_spoolss_SpoolerInit_send(TALLOC_CTX
*mem_ctx
,
9618 struct tevent_context
*ev
,
9619 struct rpc_pipe_client
*cli
)
9621 struct tevent_req
*req
;
9622 struct rpccli_spoolss_SpoolerInit_state
*state
;
9623 struct tevent_req
*subreq
;
9625 req
= tevent_req_create(mem_ctx
, &state
,
9626 struct rpccli_spoolss_SpoolerInit_state
);
9630 state
->out_mem_ctx
= NULL
;
9631 state
->dispatch_recv
= cli
->dispatch_recv
;
9635 /* Out parameters */
9638 ZERO_STRUCT(state
->orig
.out
.result
);
9640 /* make a temporary copy, that we pass to the dispatch function */
9641 state
->tmp
= state
->orig
;
9643 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9645 NDR_SPOOLSS_SPOOLERINIT
,
9647 if (tevent_req_nomem(subreq
, req
)) {
9648 return tevent_req_post(req
, ev
);
9650 tevent_req_set_callback(subreq
, rpccli_spoolss_SpoolerInit_done
, req
);
9654 static void rpccli_spoolss_SpoolerInit_done(struct tevent_req
*subreq
)
9656 struct tevent_req
*req
= tevent_req_callback_data(
9657 subreq
, struct tevent_req
);
9658 struct rpccli_spoolss_SpoolerInit_state
*state
= tevent_req_data(
9659 req
, struct rpccli_spoolss_SpoolerInit_state
);
9661 TALLOC_CTX
*mem_ctx
;
9663 if (state
->out_mem_ctx
) {
9664 mem_ctx
= state
->out_mem_ctx
;
9669 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9670 TALLOC_FREE(subreq
);
9671 if (!NT_STATUS_IS_OK(status
)) {
9672 tevent_req_nterror(req
, status
);
9676 /* Copy out parameters */
9679 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9681 /* Reset temporary structure */
9682 ZERO_STRUCT(state
->tmp
);
9684 tevent_req_done(req
);
9687 NTSTATUS
rpccli_spoolss_SpoolerInit_recv(struct tevent_req
*req
,
9688 TALLOC_CTX
*mem_ctx
,
9691 struct rpccli_spoolss_SpoolerInit_state
*state
= tevent_req_data(
9692 req
, struct rpccli_spoolss_SpoolerInit_state
);
9695 if (tevent_req_is_nterror(req
, &status
)) {
9696 tevent_req_received(req
);
9700 /* Steal possbile out parameters to the callers context */
9701 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9704 *result
= state
->orig
.out
.result
;
9706 tevent_req_received(req
);
9707 return NT_STATUS_OK
;
9710 NTSTATUS
rpccli_spoolss_SpoolerInit(struct rpc_pipe_client
*cli
,
9711 TALLOC_CTX
*mem_ctx
,
9714 struct spoolss_SpoolerInit r
;
9719 status
= cli
->dispatch(cli
,
9722 NDR_SPOOLSS_SPOOLERINIT
,
9725 if (!NT_STATUS_IS_OK(status
)) {
9729 if (NT_STATUS_IS_ERR(status
)) {
9733 /* Return variables */
9737 *werror
= r
.out
.result
;
9740 return werror_to_ntstatus(r
.out
.result
);
9743 struct rpccli_spoolss_ResetPrinterEx_state
{
9744 struct spoolss_ResetPrinterEx orig
;
9745 struct spoolss_ResetPrinterEx tmp
;
9746 TALLOC_CTX
*out_mem_ctx
;
9747 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9750 static void rpccli_spoolss_ResetPrinterEx_done(struct tevent_req
*subreq
);
9752 struct tevent_req
*rpccli_spoolss_ResetPrinterEx_send(TALLOC_CTX
*mem_ctx
,
9753 struct tevent_context
*ev
,
9754 struct rpc_pipe_client
*cli
)
9756 struct tevent_req
*req
;
9757 struct rpccli_spoolss_ResetPrinterEx_state
*state
;
9758 struct tevent_req
*subreq
;
9760 req
= tevent_req_create(mem_ctx
, &state
,
9761 struct rpccli_spoolss_ResetPrinterEx_state
);
9765 state
->out_mem_ctx
= NULL
;
9766 state
->dispatch_recv
= cli
->dispatch_recv
;
9770 /* Out parameters */
9773 ZERO_STRUCT(state
->orig
.out
.result
);
9775 /* make a temporary copy, that we pass to the dispatch function */
9776 state
->tmp
= state
->orig
;
9778 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9780 NDR_SPOOLSS_RESETPRINTEREX
,
9782 if (tevent_req_nomem(subreq
, req
)) {
9783 return tevent_req_post(req
, ev
);
9785 tevent_req_set_callback(subreq
, rpccli_spoolss_ResetPrinterEx_done
, req
);
9789 static void rpccli_spoolss_ResetPrinterEx_done(struct tevent_req
*subreq
)
9791 struct tevent_req
*req
= tevent_req_callback_data(
9792 subreq
, struct tevent_req
);
9793 struct rpccli_spoolss_ResetPrinterEx_state
*state
= tevent_req_data(
9794 req
, struct rpccli_spoolss_ResetPrinterEx_state
);
9796 TALLOC_CTX
*mem_ctx
;
9798 if (state
->out_mem_ctx
) {
9799 mem_ctx
= state
->out_mem_ctx
;
9804 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9805 TALLOC_FREE(subreq
);
9806 if (!NT_STATUS_IS_OK(status
)) {
9807 tevent_req_nterror(req
, status
);
9811 /* Copy out parameters */
9814 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9816 /* Reset temporary structure */
9817 ZERO_STRUCT(state
->tmp
);
9819 tevent_req_done(req
);
9822 NTSTATUS
rpccli_spoolss_ResetPrinterEx_recv(struct tevent_req
*req
,
9823 TALLOC_CTX
*mem_ctx
,
9826 struct rpccli_spoolss_ResetPrinterEx_state
*state
= tevent_req_data(
9827 req
, struct rpccli_spoolss_ResetPrinterEx_state
);
9830 if (tevent_req_is_nterror(req
, &status
)) {
9831 tevent_req_received(req
);
9835 /* Steal possbile out parameters to the callers context */
9836 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9839 *result
= state
->orig
.out
.result
;
9841 tevent_req_received(req
);
9842 return NT_STATUS_OK
;
9845 NTSTATUS
rpccli_spoolss_ResetPrinterEx(struct rpc_pipe_client
*cli
,
9846 TALLOC_CTX
*mem_ctx
,
9849 struct spoolss_ResetPrinterEx r
;
9854 status
= cli
->dispatch(cli
,
9857 NDR_SPOOLSS_RESETPRINTEREX
,
9860 if (!NT_STATUS_IS_OK(status
)) {
9864 if (NT_STATUS_IS_ERR(status
)) {
9868 /* Return variables */
9872 *werror
= r
.out
.result
;
9875 return werror_to_ntstatus(r
.out
.result
);
9878 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state
{
9879 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx orig
;
9880 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx tmp
;
9881 TALLOC_CTX
*out_mem_ctx
;
9882 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9885 static void rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done(struct tevent_req
*subreq
);
9887 struct tevent_req
*rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_send(TALLOC_CTX
*mem_ctx
,
9888 struct tevent_context
*ev
,
9889 struct rpc_pipe_client
*cli
,
9890 struct policy_handle
*_handle
/* [in] [ref] */,
9891 uint32_t _flags
/* [in] */,
9892 uint32_t _options
/* [in] */,
9893 const char *_local_machine
/* [in] [unique,charset(UTF16)] */,
9894 uint32_t _printer_local
/* [in] */,
9895 struct spoolss_NotifyOption
*_notify_options
/* [in] [unique] */)
9897 struct tevent_req
*req
;
9898 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state
*state
;
9899 struct tevent_req
*subreq
;
9901 req
= tevent_req_create(mem_ctx
, &state
,
9902 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state
);
9906 state
->out_mem_ctx
= NULL
;
9907 state
->dispatch_recv
= cli
->dispatch_recv
;
9910 state
->orig
.in
.handle
= _handle
;
9911 state
->orig
.in
.flags
= _flags
;
9912 state
->orig
.in
.options
= _options
;
9913 state
->orig
.in
.local_machine
= _local_machine
;
9914 state
->orig
.in
.printer_local
= _printer_local
;
9915 state
->orig
.in
.notify_options
= _notify_options
;
9917 /* Out parameters */
9920 ZERO_STRUCT(state
->orig
.out
.result
);
9922 /* make a temporary copy, that we pass to the dispatch function */
9923 state
->tmp
= state
->orig
;
9925 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9927 NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX
,
9929 if (tevent_req_nomem(subreq
, req
)) {
9930 return tevent_req_post(req
, ev
);
9932 tevent_req_set_callback(subreq
, rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done
, req
);
9936 static void rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done(struct tevent_req
*subreq
)
9938 struct tevent_req
*req
= tevent_req_callback_data(
9939 subreq
, struct tevent_req
);
9940 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state
*state
= tevent_req_data(
9941 req
, struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state
);
9943 TALLOC_CTX
*mem_ctx
;
9945 if (state
->out_mem_ctx
) {
9946 mem_ctx
= state
->out_mem_ctx
;
9951 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9952 TALLOC_FREE(subreq
);
9953 if (!NT_STATUS_IS_OK(status
)) {
9954 tevent_req_nterror(req
, status
);
9958 /* Copy out parameters */
9961 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9963 /* Reset temporary structure */
9964 ZERO_STRUCT(state
->tmp
);
9966 tevent_req_done(req
);
9969 NTSTATUS
rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_recv(struct tevent_req
*req
,
9970 TALLOC_CTX
*mem_ctx
,
9973 struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state
*state
= tevent_req_data(
9974 req
, struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state
);
9977 if (tevent_req_is_nterror(req
, &status
)) {
9978 tevent_req_received(req
);
9982 /* Steal possbile out parameters to the callers context */
9983 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9986 *result
= state
->orig
.out
.result
;
9988 tevent_req_received(req
);
9989 return NT_STATUS_OK
;
9992 NTSTATUS
rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_client
*cli
,
9993 TALLOC_CTX
*mem_ctx
,
9994 struct policy_handle
*handle
/* [in] [ref] */,
9995 uint32_t flags
/* [in] */,
9996 uint32_t options
/* [in] */,
9997 const char *local_machine
/* [in] [unique,charset(UTF16)] */,
9998 uint32_t printer_local
/* [in] */,
9999 struct spoolss_NotifyOption
*notify_options
/* [in] [unique] */,
10002 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r
;
10005 /* In parameters */
10006 r
.in
.handle
= handle
;
10007 r
.in
.flags
= flags
;
10008 r
.in
.options
= options
;
10009 r
.in
.local_machine
= local_machine
;
10010 r
.in
.printer_local
= printer_local
;
10011 r
.in
.notify_options
= notify_options
;
10013 status
= cli
->dispatch(cli
,
10015 &ndr_table_spoolss
,
10016 NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX
,
10019 if (!NT_STATUS_IS_OK(status
)) {
10023 if (NT_STATUS_IS_ERR(status
)) {
10027 /* Return variables */
10029 /* Return result */
10031 *werror
= r
.out
.result
;
10034 return werror_to_ntstatus(r
.out
.result
);
10037 struct rpccli_spoolss_RouterReplyPrinterEx_state
{
10038 struct spoolss_RouterReplyPrinterEx orig
;
10039 struct spoolss_RouterReplyPrinterEx tmp
;
10040 TALLOC_CTX
*out_mem_ctx
;
10041 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10044 static void rpccli_spoolss_RouterReplyPrinterEx_done(struct tevent_req
*subreq
);
10046 struct tevent_req
*rpccli_spoolss_RouterReplyPrinterEx_send(TALLOC_CTX
*mem_ctx
,
10047 struct tevent_context
*ev
,
10048 struct rpc_pipe_client
*cli
,
10049 struct policy_handle
*_handle
/* [in] [ref] */,
10050 uint32_t _color
/* [in] */,
10051 uint32_t _flags
/* [in] */,
10052 uint32_t *_reply_result
/* [out] [ref] */,
10053 uint32_t _reply_type
/* [in] */,
10054 union spoolss_ReplyPrinterInfo _info
/* [in] [switch_is(reply_type)] */)
10056 struct tevent_req
*req
;
10057 struct rpccli_spoolss_RouterReplyPrinterEx_state
*state
;
10058 struct tevent_req
*subreq
;
10060 req
= tevent_req_create(mem_ctx
, &state
,
10061 struct rpccli_spoolss_RouterReplyPrinterEx_state
);
10065 state
->out_mem_ctx
= NULL
;
10066 state
->dispatch_recv
= cli
->dispatch_recv
;
10068 /* In parameters */
10069 state
->orig
.in
.handle
= _handle
;
10070 state
->orig
.in
.color
= _color
;
10071 state
->orig
.in
.flags
= _flags
;
10072 state
->orig
.in
.reply_type
= _reply_type
;
10073 state
->orig
.in
.info
= _info
;
10075 /* Out parameters */
10076 state
->orig
.out
.reply_result
= _reply_result
;
10079 ZERO_STRUCT(state
->orig
.out
.result
);
10081 state
->out_mem_ctx
= talloc_named_const(state
, 0,
10082 "rpccli_spoolss_RouterReplyPrinterEx_out_memory");
10083 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
10084 return tevent_req_post(req
, ev
);
10087 /* make a temporary copy, that we pass to the dispatch function */
10088 state
->tmp
= state
->orig
;
10090 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10091 &ndr_table_spoolss
,
10092 NDR_SPOOLSS_ROUTERREPLYPRINTEREX
,
10094 if (tevent_req_nomem(subreq
, req
)) {
10095 return tevent_req_post(req
, ev
);
10097 tevent_req_set_callback(subreq
, rpccli_spoolss_RouterReplyPrinterEx_done
, req
);
10101 static void rpccli_spoolss_RouterReplyPrinterEx_done(struct tevent_req
*subreq
)
10103 struct tevent_req
*req
= tevent_req_callback_data(
10104 subreq
, struct tevent_req
);
10105 struct rpccli_spoolss_RouterReplyPrinterEx_state
*state
= tevent_req_data(
10106 req
, struct rpccli_spoolss_RouterReplyPrinterEx_state
);
10108 TALLOC_CTX
*mem_ctx
;
10110 if (state
->out_mem_ctx
) {
10111 mem_ctx
= state
->out_mem_ctx
;
10116 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10117 TALLOC_FREE(subreq
);
10118 if (!NT_STATUS_IS_OK(status
)) {
10119 tevent_req_nterror(req
, status
);
10123 /* Copy out parameters */
10124 *state
->orig
.out
.reply_result
= *state
->tmp
.out
.reply_result
;
10127 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10129 /* Reset temporary structure */
10130 ZERO_STRUCT(state
->tmp
);
10132 tevent_req_done(req
);
10135 NTSTATUS
rpccli_spoolss_RouterReplyPrinterEx_recv(struct tevent_req
*req
,
10136 TALLOC_CTX
*mem_ctx
,
10139 struct rpccli_spoolss_RouterReplyPrinterEx_state
*state
= tevent_req_data(
10140 req
, struct rpccli_spoolss_RouterReplyPrinterEx_state
);
10143 if (tevent_req_is_nterror(req
, &status
)) {
10144 tevent_req_received(req
);
10148 /* Steal possbile out parameters to the callers context */
10149 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10151 /* Return result */
10152 *result
= state
->orig
.out
.result
;
10154 tevent_req_received(req
);
10155 return NT_STATUS_OK
;
10158 NTSTATUS
rpccli_spoolss_RouterReplyPrinterEx(struct rpc_pipe_client
*cli
,
10159 TALLOC_CTX
*mem_ctx
,
10160 struct policy_handle
*handle
/* [in] [ref] */,
10161 uint32_t color
/* [in] */,
10162 uint32_t flags
/* [in] */,
10163 uint32_t *reply_result
/* [out] [ref] */,
10164 uint32_t reply_type
/* [in] */,
10165 union spoolss_ReplyPrinterInfo info
/* [in] [switch_is(reply_type)] */,
10168 struct spoolss_RouterReplyPrinterEx r
;
10171 /* In parameters */
10172 r
.in
.handle
= handle
;
10173 r
.in
.color
= color
;
10174 r
.in
.flags
= flags
;
10175 r
.in
.reply_type
= reply_type
;
10178 status
= cli
->dispatch(cli
,
10180 &ndr_table_spoolss
,
10181 NDR_SPOOLSS_ROUTERREPLYPRINTEREX
,
10184 if (!NT_STATUS_IS_OK(status
)) {
10188 if (NT_STATUS_IS_ERR(status
)) {
10192 /* Return variables */
10193 *reply_result
= *r
.out
.reply_result
;
10195 /* Return result */
10197 *werror
= r
.out
.result
;
10200 return werror_to_ntstatus(r
.out
.result
);
10203 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state
{
10204 struct spoolss_RouterRefreshPrinterChangeNotify orig
;
10205 struct spoolss_RouterRefreshPrinterChangeNotify tmp
;
10206 TALLOC_CTX
*out_mem_ctx
;
10207 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10210 static void rpccli_spoolss_RouterRefreshPrinterChangeNotify_done(struct tevent_req
*subreq
);
10212 struct tevent_req
*rpccli_spoolss_RouterRefreshPrinterChangeNotify_send(TALLOC_CTX
*mem_ctx
,
10213 struct tevent_context
*ev
,
10214 struct rpc_pipe_client
*cli
,
10215 struct policy_handle
*_handle
/* [in] [ref] */,
10216 uint32_t _change_low
/* [in] */,
10217 struct spoolss_NotifyOption
*_options
/* [in] [unique] */,
10218 struct spoolss_NotifyInfo
**_info
/* [out] [ref] */)
10220 struct tevent_req
*req
;
10221 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state
*state
;
10222 struct tevent_req
*subreq
;
10224 req
= tevent_req_create(mem_ctx
, &state
,
10225 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state
);
10229 state
->out_mem_ctx
= NULL
;
10230 state
->dispatch_recv
= cli
->dispatch_recv
;
10232 /* In parameters */
10233 state
->orig
.in
.handle
= _handle
;
10234 state
->orig
.in
.change_low
= _change_low
;
10235 state
->orig
.in
.options
= _options
;
10237 /* Out parameters */
10238 state
->orig
.out
.info
= _info
;
10241 ZERO_STRUCT(state
->orig
.out
.result
);
10243 state
->out_mem_ctx
= talloc_named_const(state
, 0,
10244 "rpccli_spoolss_RouterRefreshPrinterChangeNotify_out_memory");
10245 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
10246 return tevent_req_post(req
, ev
);
10249 /* make a temporary copy, that we pass to the dispatch function */
10250 state
->tmp
= state
->orig
;
10252 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10253 &ndr_table_spoolss
,
10254 NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY
,
10256 if (tevent_req_nomem(subreq
, req
)) {
10257 return tevent_req_post(req
, ev
);
10259 tevent_req_set_callback(subreq
, rpccli_spoolss_RouterRefreshPrinterChangeNotify_done
, req
);
10263 static void rpccli_spoolss_RouterRefreshPrinterChangeNotify_done(struct tevent_req
*subreq
)
10265 struct tevent_req
*req
= tevent_req_callback_data(
10266 subreq
, struct tevent_req
);
10267 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state
*state
= tevent_req_data(
10268 req
, struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state
);
10270 TALLOC_CTX
*mem_ctx
;
10272 if (state
->out_mem_ctx
) {
10273 mem_ctx
= state
->out_mem_ctx
;
10278 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10279 TALLOC_FREE(subreq
);
10280 if (!NT_STATUS_IS_OK(status
)) {
10281 tevent_req_nterror(req
, status
);
10285 /* Copy out parameters */
10286 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
10289 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10291 /* Reset temporary structure */
10292 ZERO_STRUCT(state
->tmp
);
10294 tevent_req_done(req
);
10297 NTSTATUS
rpccli_spoolss_RouterRefreshPrinterChangeNotify_recv(struct tevent_req
*req
,
10298 TALLOC_CTX
*mem_ctx
,
10301 struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state
*state
= tevent_req_data(
10302 req
, struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state
);
10305 if (tevent_req_is_nterror(req
, &status
)) {
10306 tevent_req_received(req
);
10310 /* Steal possbile out parameters to the callers context */
10311 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10313 /* Return result */
10314 *result
= state
->orig
.out
.result
;
10316 tevent_req_received(req
);
10317 return NT_STATUS_OK
;
10320 NTSTATUS
rpccli_spoolss_RouterRefreshPrinterChangeNotify(struct rpc_pipe_client
*cli
,
10321 TALLOC_CTX
*mem_ctx
,
10322 struct policy_handle
*handle
/* [in] [ref] */,
10323 uint32_t change_low
/* [in] */,
10324 struct spoolss_NotifyOption
*options
/* [in] [unique] */,
10325 struct spoolss_NotifyInfo
**info
/* [out] [ref] */,
10328 struct spoolss_RouterRefreshPrinterChangeNotify r
;
10331 /* In parameters */
10332 r
.in
.handle
= handle
;
10333 r
.in
.change_low
= change_low
;
10334 r
.in
.options
= options
;
10336 status
= cli
->dispatch(cli
,
10338 &ndr_table_spoolss
,
10339 NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY
,
10342 if (!NT_STATUS_IS_OK(status
)) {
10346 if (NT_STATUS_IS_ERR(status
)) {
10350 /* Return variables */
10351 *info
= *r
.out
.info
;
10353 /* Return result */
10355 *werror
= r
.out
.result
;
10358 return werror_to_ntstatus(r
.out
.result
);
10361 struct rpccli_spoolss_44_state
{
10362 struct spoolss_44 orig
;
10363 struct spoolss_44 tmp
;
10364 TALLOC_CTX
*out_mem_ctx
;
10365 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10368 static void rpccli_spoolss_44_done(struct tevent_req
*subreq
);
10370 struct tevent_req
*rpccli_spoolss_44_send(TALLOC_CTX
*mem_ctx
,
10371 struct tevent_context
*ev
,
10372 struct rpc_pipe_client
*cli
)
10374 struct tevent_req
*req
;
10375 struct rpccli_spoolss_44_state
*state
;
10376 struct tevent_req
*subreq
;
10378 req
= tevent_req_create(mem_ctx
, &state
,
10379 struct rpccli_spoolss_44_state
);
10383 state
->out_mem_ctx
= NULL
;
10384 state
->dispatch_recv
= cli
->dispatch_recv
;
10386 /* In parameters */
10388 /* Out parameters */
10391 ZERO_STRUCT(state
->orig
.out
.result
);
10393 /* make a temporary copy, that we pass to the dispatch function */
10394 state
->tmp
= state
->orig
;
10396 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10397 &ndr_table_spoolss
,
10400 if (tevent_req_nomem(subreq
, req
)) {
10401 return tevent_req_post(req
, ev
);
10403 tevent_req_set_callback(subreq
, rpccli_spoolss_44_done
, req
);
10407 static void rpccli_spoolss_44_done(struct tevent_req
*subreq
)
10409 struct tevent_req
*req
= tevent_req_callback_data(
10410 subreq
, struct tevent_req
);
10411 struct rpccli_spoolss_44_state
*state
= tevent_req_data(
10412 req
, struct rpccli_spoolss_44_state
);
10414 TALLOC_CTX
*mem_ctx
;
10416 if (state
->out_mem_ctx
) {
10417 mem_ctx
= state
->out_mem_ctx
;
10422 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10423 TALLOC_FREE(subreq
);
10424 if (!NT_STATUS_IS_OK(status
)) {
10425 tevent_req_nterror(req
, status
);
10429 /* Copy out parameters */
10432 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10434 /* Reset temporary structure */
10435 ZERO_STRUCT(state
->tmp
);
10437 tevent_req_done(req
);
10440 NTSTATUS
rpccli_spoolss_44_recv(struct tevent_req
*req
,
10441 TALLOC_CTX
*mem_ctx
,
10444 struct rpccli_spoolss_44_state
*state
= tevent_req_data(
10445 req
, struct rpccli_spoolss_44_state
);
10448 if (tevent_req_is_nterror(req
, &status
)) {
10449 tevent_req_received(req
);
10453 /* Steal possbile out parameters to the callers context */
10454 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10456 /* Return result */
10457 *result
= state
->orig
.out
.result
;
10459 tevent_req_received(req
);
10460 return NT_STATUS_OK
;
10463 NTSTATUS
rpccli_spoolss_44(struct rpc_pipe_client
*cli
,
10464 TALLOC_CTX
*mem_ctx
,
10467 struct spoolss_44 r
;
10470 /* In parameters */
10472 status
= cli
->dispatch(cli
,
10474 &ndr_table_spoolss
,
10478 if (!NT_STATUS_IS_OK(status
)) {
10482 if (NT_STATUS_IS_ERR(status
)) {
10486 /* Return variables */
10488 /* Return result */
10490 *werror
= r
.out
.result
;
10493 return werror_to_ntstatus(r
.out
.result
);
10496 struct rpccli_spoolss_OpenPrinterEx_state
{
10497 struct spoolss_OpenPrinterEx orig
;
10498 struct spoolss_OpenPrinterEx tmp
;
10499 TALLOC_CTX
*out_mem_ctx
;
10500 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10503 static void rpccli_spoolss_OpenPrinterEx_done(struct tevent_req
*subreq
);
10505 struct tevent_req
*rpccli_spoolss_OpenPrinterEx_send(TALLOC_CTX
*mem_ctx
,
10506 struct tevent_context
*ev
,
10507 struct rpc_pipe_client
*cli
,
10508 const char *_printername
/* [in] [unique,charset(UTF16)] */,
10509 const char *_datatype
/* [in] [unique,charset(UTF16)] */,
10510 struct spoolss_DevmodeContainer _devmode_ctr
/* [in] */,
10511 uint32_t _access_mask
/* [in] */,
10512 uint32_t _level
/* [in] */,
10513 union spoolss_UserLevel _userlevel
/* [in] [switch_is(level)] */,
10514 struct policy_handle
*_handle
/* [out] [ref] */)
10516 struct tevent_req
*req
;
10517 struct rpccli_spoolss_OpenPrinterEx_state
*state
;
10518 struct tevent_req
*subreq
;
10520 req
= tevent_req_create(mem_ctx
, &state
,
10521 struct rpccli_spoolss_OpenPrinterEx_state
);
10525 state
->out_mem_ctx
= NULL
;
10526 state
->dispatch_recv
= cli
->dispatch_recv
;
10528 /* In parameters */
10529 state
->orig
.in
.printername
= _printername
;
10530 state
->orig
.in
.datatype
= _datatype
;
10531 state
->orig
.in
.devmode_ctr
= _devmode_ctr
;
10532 state
->orig
.in
.access_mask
= _access_mask
;
10533 state
->orig
.in
.level
= _level
;
10534 state
->orig
.in
.userlevel
= _userlevel
;
10536 /* Out parameters */
10537 state
->orig
.out
.handle
= _handle
;
10540 ZERO_STRUCT(state
->orig
.out
.result
);
10542 state
->out_mem_ctx
= talloc_named_const(state
, 0,
10543 "rpccli_spoolss_OpenPrinterEx_out_memory");
10544 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
10545 return tevent_req_post(req
, ev
);
10548 /* make a temporary copy, that we pass to the dispatch function */
10549 state
->tmp
= state
->orig
;
10551 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10552 &ndr_table_spoolss
,
10553 NDR_SPOOLSS_OPENPRINTEREX
,
10555 if (tevent_req_nomem(subreq
, req
)) {
10556 return tevent_req_post(req
, ev
);
10558 tevent_req_set_callback(subreq
, rpccli_spoolss_OpenPrinterEx_done
, req
);
10562 static void rpccli_spoolss_OpenPrinterEx_done(struct tevent_req
*subreq
)
10564 struct tevent_req
*req
= tevent_req_callback_data(
10565 subreq
, struct tevent_req
);
10566 struct rpccli_spoolss_OpenPrinterEx_state
*state
= tevent_req_data(
10567 req
, struct rpccli_spoolss_OpenPrinterEx_state
);
10569 TALLOC_CTX
*mem_ctx
;
10571 if (state
->out_mem_ctx
) {
10572 mem_ctx
= state
->out_mem_ctx
;
10577 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10578 TALLOC_FREE(subreq
);
10579 if (!NT_STATUS_IS_OK(status
)) {
10580 tevent_req_nterror(req
, status
);
10584 /* Copy out parameters */
10585 *state
->orig
.out
.handle
= *state
->tmp
.out
.handle
;
10588 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10590 /* Reset temporary structure */
10591 ZERO_STRUCT(state
->tmp
);
10593 tevent_req_done(req
);
10596 NTSTATUS
rpccli_spoolss_OpenPrinterEx_recv(struct tevent_req
*req
,
10597 TALLOC_CTX
*mem_ctx
,
10600 struct rpccli_spoolss_OpenPrinterEx_state
*state
= tevent_req_data(
10601 req
, struct rpccli_spoolss_OpenPrinterEx_state
);
10604 if (tevent_req_is_nterror(req
, &status
)) {
10605 tevent_req_received(req
);
10609 /* Steal possbile out parameters to the callers context */
10610 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10612 /* Return result */
10613 *result
= state
->orig
.out
.result
;
10615 tevent_req_received(req
);
10616 return NT_STATUS_OK
;
10619 NTSTATUS
rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client
*cli
,
10620 TALLOC_CTX
*mem_ctx
,
10621 const char *printername
/* [in] [unique,charset(UTF16)] */,
10622 const char *datatype
/* [in] [unique,charset(UTF16)] */,
10623 struct spoolss_DevmodeContainer devmode_ctr
/* [in] */,
10624 uint32_t access_mask
/* [in] */,
10625 uint32_t level
/* [in] */,
10626 union spoolss_UserLevel userlevel
/* [in] [switch_is(level)] */,
10627 struct policy_handle
*handle
/* [out] [ref] */,
10630 struct spoolss_OpenPrinterEx r
;
10633 /* In parameters */
10634 r
.in
.printername
= printername
;
10635 r
.in
.datatype
= datatype
;
10636 r
.in
.devmode_ctr
= devmode_ctr
;
10637 r
.in
.access_mask
= access_mask
;
10638 r
.in
.level
= level
;
10639 r
.in
.userlevel
= userlevel
;
10641 status
= cli
->dispatch(cli
,
10643 &ndr_table_spoolss
,
10644 NDR_SPOOLSS_OPENPRINTEREX
,
10647 if (!NT_STATUS_IS_OK(status
)) {
10651 if (NT_STATUS_IS_ERR(status
)) {
10655 /* Return variables */
10656 *handle
= *r
.out
.handle
;
10658 /* Return result */
10660 *werror
= r
.out
.result
;
10663 return werror_to_ntstatus(r
.out
.result
);
10666 struct rpccli_spoolss_AddPrinterEx_state
{
10667 struct spoolss_AddPrinterEx orig
;
10668 struct spoolss_AddPrinterEx tmp
;
10669 TALLOC_CTX
*out_mem_ctx
;
10670 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10673 static void rpccli_spoolss_AddPrinterEx_done(struct tevent_req
*subreq
);
10675 struct tevent_req
*rpccli_spoolss_AddPrinterEx_send(TALLOC_CTX
*mem_ctx
,
10676 struct tevent_context
*ev
,
10677 struct rpc_pipe_client
*cli
,
10678 const char *_server
/* [in] [unique,charset(UTF16)] */,
10679 struct spoolss_SetPrinterInfoCtr
*_info_ctr
/* [in] [ref] */,
10680 struct spoolss_DevmodeContainer
*_devmode_ctr
/* [in] [ref] */,
10681 struct sec_desc_buf
*_secdesc_ctr
/* [in] [ref] */,
10682 struct spoolss_UserLevelCtr
*_userlevel_ctr
/* [in] [ref] */,
10683 struct policy_handle
*_handle
/* [out] [ref] */)
10685 struct tevent_req
*req
;
10686 struct rpccli_spoolss_AddPrinterEx_state
*state
;
10687 struct tevent_req
*subreq
;
10689 req
= tevent_req_create(mem_ctx
, &state
,
10690 struct rpccli_spoolss_AddPrinterEx_state
);
10694 state
->out_mem_ctx
= NULL
;
10695 state
->dispatch_recv
= cli
->dispatch_recv
;
10697 /* In parameters */
10698 state
->orig
.in
.server
= _server
;
10699 state
->orig
.in
.info_ctr
= _info_ctr
;
10700 state
->orig
.in
.devmode_ctr
= _devmode_ctr
;
10701 state
->orig
.in
.secdesc_ctr
= _secdesc_ctr
;
10702 state
->orig
.in
.userlevel_ctr
= _userlevel_ctr
;
10704 /* Out parameters */
10705 state
->orig
.out
.handle
= _handle
;
10708 ZERO_STRUCT(state
->orig
.out
.result
);
10710 state
->out_mem_ctx
= talloc_named_const(state
, 0,
10711 "rpccli_spoolss_AddPrinterEx_out_memory");
10712 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
10713 return tevent_req_post(req
, ev
);
10716 /* make a temporary copy, that we pass to the dispatch function */
10717 state
->tmp
= state
->orig
;
10719 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10720 &ndr_table_spoolss
,
10721 NDR_SPOOLSS_ADDPRINTEREX
,
10723 if (tevent_req_nomem(subreq
, req
)) {
10724 return tevent_req_post(req
, ev
);
10726 tevent_req_set_callback(subreq
, rpccli_spoolss_AddPrinterEx_done
, req
);
10730 static void rpccli_spoolss_AddPrinterEx_done(struct tevent_req
*subreq
)
10732 struct tevent_req
*req
= tevent_req_callback_data(
10733 subreq
, struct tevent_req
);
10734 struct rpccli_spoolss_AddPrinterEx_state
*state
= tevent_req_data(
10735 req
, struct rpccli_spoolss_AddPrinterEx_state
);
10737 TALLOC_CTX
*mem_ctx
;
10739 if (state
->out_mem_ctx
) {
10740 mem_ctx
= state
->out_mem_ctx
;
10745 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10746 TALLOC_FREE(subreq
);
10747 if (!NT_STATUS_IS_OK(status
)) {
10748 tevent_req_nterror(req
, status
);
10752 /* Copy out parameters */
10753 *state
->orig
.out
.handle
= *state
->tmp
.out
.handle
;
10756 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10758 /* Reset temporary structure */
10759 ZERO_STRUCT(state
->tmp
);
10761 tevent_req_done(req
);
10764 NTSTATUS
rpccli_spoolss_AddPrinterEx_recv(struct tevent_req
*req
,
10765 TALLOC_CTX
*mem_ctx
,
10768 struct rpccli_spoolss_AddPrinterEx_state
*state
= tevent_req_data(
10769 req
, struct rpccli_spoolss_AddPrinterEx_state
);
10772 if (tevent_req_is_nterror(req
, &status
)) {
10773 tevent_req_received(req
);
10777 /* Steal possbile out parameters to the callers context */
10778 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10780 /* Return result */
10781 *result
= state
->orig
.out
.result
;
10783 tevent_req_received(req
);
10784 return NT_STATUS_OK
;
10787 NTSTATUS
rpccli_spoolss_AddPrinterEx(struct rpc_pipe_client
*cli
,
10788 TALLOC_CTX
*mem_ctx
,
10789 const char *server
/* [in] [unique,charset(UTF16)] */,
10790 struct spoolss_SetPrinterInfoCtr
*info_ctr
/* [in] [ref] */,
10791 struct spoolss_DevmodeContainer
*devmode_ctr
/* [in] [ref] */,
10792 struct sec_desc_buf
*secdesc_ctr
/* [in] [ref] */,
10793 struct spoolss_UserLevelCtr
*userlevel_ctr
/* [in] [ref] */,
10794 struct policy_handle
*handle
/* [out] [ref] */,
10797 struct spoolss_AddPrinterEx r
;
10800 /* In parameters */
10801 r
.in
.server
= server
;
10802 r
.in
.info_ctr
= info_ctr
;
10803 r
.in
.devmode_ctr
= devmode_ctr
;
10804 r
.in
.secdesc_ctr
= secdesc_ctr
;
10805 r
.in
.userlevel_ctr
= userlevel_ctr
;
10807 status
= cli
->dispatch(cli
,
10809 &ndr_table_spoolss
,
10810 NDR_SPOOLSS_ADDPRINTEREX
,
10813 if (!NT_STATUS_IS_OK(status
)) {
10817 if (NT_STATUS_IS_ERR(status
)) {
10821 /* Return variables */
10822 *handle
= *r
.out
.handle
;
10824 /* Return result */
10826 *werror
= r
.out
.result
;
10829 return werror_to_ntstatus(r
.out
.result
);
10832 struct rpccli_spoolss_47_state
{
10833 struct spoolss_47 orig
;
10834 struct spoolss_47 tmp
;
10835 TALLOC_CTX
*out_mem_ctx
;
10836 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10839 static void rpccli_spoolss_47_done(struct tevent_req
*subreq
);
10841 struct tevent_req
*rpccli_spoolss_47_send(TALLOC_CTX
*mem_ctx
,
10842 struct tevent_context
*ev
,
10843 struct rpc_pipe_client
*cli
)
10845 struct tevent_req
*req
;
10846 struct rpccli_spoolss_47_state
*state
;
10847 struct tevent_req
*subreq
;
10849 req
= tevent_req_create(mem_ctx
, &state
,
10850 struct rpccli_spoolss_47_state
);
10854 state
->out_mem_ctx
= NULL
;
10855 state
->dispatch_recv
= cli
->dispatch_recv
;
10857 /* In parameters */
10859 /* Out parameters */
10862 ZERO_STRUCT(state
->orig
.out
.result
);
10864 /* make a temporary copy, that we pass to the dispatch function */
10865 state
->tmp
= state
->orig
;
10867 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10868 &ndr_table_spoolss
,
10871 if (tevent_req_nomem(subreq
, req
)) {
10872 return tevent_req_post(req
, ev
);
10874 tevent_req_set_callback(subreq
, rpccli_spoolss_47_done
, req
);
10878 static void rpccli_spoolss_47_done(struct tevent_req
*subreq
)
10880 struct tevent_req
*req
= tevent_req_callback_data(
10881 subreq
, struct tevent_req
);
10882 struct rpccli_spoolss_47_state
*state
= tevent_req_data(
10883 req
, struct rpccli_spoolss_47_state
);
10885 TALLOC_CTX
*mem_ctx
;
10887 if (state
->out_mem_ctx
) {
10888 mem_ctx
= state
->out_mem_ctx
;
10893 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10894 TALLOC_FREE(subreq
);
10895 if (!NT_STATUS_IS_OK(status
)) {
10896 tevent_req_nterror(req
, status
);
10900 /* Copy out parameters */
10903 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10905 /* Reset temporary structure */
10906 ZERO_STRUCT(state
->tmp
);
10908 tevent_req_done(req
);
10911 NTSTATUS
rpccli_spoolss_47_recv(struct tevent_req
*req
,
10912 TALLOC_CTX
*mem_ctx
,
10915 struct rpccli_spoolss_47_state
*state
= tevent_req_data(
10916 req
, struct rpccli_spoolss_47_state
);
10919 if (tevent_req_is_nterror(req
, &status
)) {
10920 tevent_req_received(req
);
10924 /* Steal possbile out parameters to the callers context */
10925 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10927 /* Return result */
10928 *result
= state
->orig
.out
.result
;
10930 tevent_req_received(req
);
10931 return NT_STATUS_OK
;
10934 NTSTATUS
rpccli_spoolss_47(struct rpc_pipe_client
*cli
,
10935 TALLOC_CTX
*mem_ctx
,
10938 struct spoolss_47 r
;
10941 /* In parameters */
10943 status
= cli
->dispatch(cli
,
10945 &ndr_table_spoolss
,
10949 if (!NT_STATUS_IS_OK(status
)) {
10953 if (NT_STATUS_IS_ERR(status
)) {
10957 /* Return variables */
10959 /* Return result */
10961 *werror
= r
.out
.result
;
10964 return werror_to_ntstatus(r
.out
.result
);
10967 struct rpccli_spoolss_EnumPrinterData_state
{
10968 struct spoolss_EnumPrinterData orig
;
10969 struct spoolss_EnumPrinterData tmp
;
10970 TALLOC_CTX
*out_mem_ctx
;
10971 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10974 static void rpccli_spoolss_EnumPrinterData_done(struct tevent_req
*subreq
);
10976 struct tevent_req
*rpccli_spoolss_EnumPrinterData_send(TALLOC_CTX
*mem_ctx
,
10977 struct tevent_context
*ev
,
10978 struct rpc_pipe_client
*cli
,
10979 struct policy_handle
*_handle
/* [in] [ref] */,
10980 uint32_t _enum_index
/* [in] */,
10981 const char *_value_name
/* [out] [charset(UTF16),size_is(value_offered/2)] */,
10982 uint32_t _value_offered
/* [in] */,
10983 uint32_t *_value_needed
/* [out] [ref] */,
10984 enum winreg_Type
*_type
/* [out] [ref] */,
10985 uint8_t *_data
/* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */,
10986 uint32_t _data_offered
/* [in] */,
10987 uint32_t *_data_needed
/* [out] [ref] */)
10989 struct tevent_req
*req
;
10990 struct rpccli_spoolss_EnumPrinterData_state
*state
;
10991 struct tevent_req
*subreq
;
10993 req
= tevent_req_create(mem_ctx
, &state
,
10994 struct rpccli_spoolss_EnumPrinterData_state
);
10998 state
->out_mem_ctx
= NULL
;
10999 state
->dispatch_recv
= cli
->dispatch_recv
;
11001 /* In parameters */
11002 state
->orig
.in
.handle
= _handle
;
11003 state
->orig
.in
.enum_index
= _enum_index
;
11004 state
->orig
.in
.value_offered
= _value_offered
;
11005 state
->orig
.in
.data_offered
= _data_offered
;
11007 /* Out parameters */
11008 state
->orig
.out
.value_name
= _value_name
;
11009 state
->orig
.out
.value_needed
= _value_needed
;
11010 state
->orig
.out
.type
= _type
;
11011 state
->orig
.out
.data
= _data
;
11012 state
->orig
.out
.data_needed
= _data_needed
;
11015 ZERO_STRUCT(state
->orig
.out
.result
);
11017 state
->out_mem_ctx
= talloc_named_const(state
, 0,
11018 "rpccli_spoolss_EnumPrinterData_out_memory");
11019 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
11020 return tevent_req_post(req
, ev
);
11023 /* make a temporary copy, that we pass to the dispatch function */
11024 state
->tmp
= state
->orig
;
11026 subreq
= cli
->dispatch_send(state
, ev
, cli
,
11027 &ndr_table_spoolss
,
11028 NDR_SPOOLSS_ENUMPRINTERDATA
,
11030 if (tevent_req_nomem(subreq
, req
)) {
11031 return tevent_req_post(req
, ev
);
11033 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumPrinterData_done
, req
);
11037 static void rpccli_spoolss_EnumPrinterData_done(struct tevent_req
*subreq
)
11039 struct tevent_req
*req
= tevent_req_callback_data(
11040 subreq
, struct tevent_req
);
11041 struct rpccli_spoolss_EnumPrinterData_state
*state
= tevent_req_data(
11042 req
, struct rpccli_spoolss_EnumPrinterData_state
);
11044 TALLOC_CTX
*mem_ctx
;
11046 if (state
->out_mem_ctx
) {
11047 mem_ctx
= state
->out_mem_ctx
;
11052 status
= state
->dispatch_recv(subreq
, mem_ctx
);
11053 TALLOC_FREE(subreq
);
11054 if (!NT_STATUS_IS_OK(status
)) {
11055 tevent_req_nterror(req
, status
);
11059 /* Copy out parameters */
11060 memcpy(discard_const_p(uint8_t *, state
->orig
.out
.value_name
), state
->tmp
.out
.value_name
, (state
->tmp
.in
.value_offered
/ 2) * sizeof(*state
->orig
.out
.value_name
));
11061 *state
->orig
.out
.value_needed
= *state
->tmp
.out
.value_needed
;
11062 *state
->orig
.out
.type
= *state
->tmp
.out
.type
;
11063 memcpy(state
->orig
.out
.data
, state
->tmp
.out
.data
, (state
->tmp
.in
.data_offered
) * sizeof(*state
->orig
.out
.data
));
11064 *state
->orig
.out
.data_needed
= *state
->tmp
.out
.data_needed
;
11067 state
->orig
.out
.result
= state
->tmp
.out
.result
;
11069 /* Reset temporary structure */
11070 ZERO_STRUCT(state
->tmp
);
11072 tevent_req_done(req
);
11075 NTSTATUS
rpccli_spoolss_EnumPrinterData_recv(struct tevent_req
*req
,
11076 TALLOC_CTX
*mem_ctx
,
11079 struct rpccli_spoolss_EnumPrinterData_state
*state
= tevent_req_data(
11080 req
, struct rpccli_spoolss_EnumPrinterData_state
);
11083 if (tevent_req_is_nterror(req
, &status
)) {
11084 tevent_req_received(req
);
11088 /* Steal possbile out parameters to the callers context */
11089 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
11091 /* Return result */
11092 *result
= state
->orig
.out
.result
;
11094 tevent_req_received(req
);
11095 return NT_STATUS_OK
;
11098 NTSTATUS
rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client
*cli
,
11099 TALLOC_CTX
*mem_ctx
,
11100 struct policy_handle
*handle
/* [in] [ref] */,
11101 uint32_t enum_index
/* [in] */,
11102 const char *value_name
/* [out] [charset(UTF16),size_is(value_offered/2)] */,
11103 uint32_t value_offered
/* [in] */,
11104 uint32_t *value_needed
/* [out] [ref] */,
11105 enum winreg_Type
*type
/* [out] [ref] */,
11106 uint8_t *data
/* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */,
11107 uint32_t data_offered
/* [in] */,
11108 uint32_t *data_needed
/* [out] [ref] */,
11111 struct spoolss_EnumPrinterData r
;
11114 /* In parameters */
11115 r
.in
.handle
= handle
;
11116 r
.in
.enum_index
= enum_index
;
11117 r
.in
.value_offered
= value_offered
;
11118 r
.in
.data_offered
= data_offered
;
11120 status
= cli
->dispatch(cli
,
11122 &ndr_table_spoolss
,
11123 NDR_SPOOLSS_ENUMPRINTERDATA
,
11126 if (!NT_STATUS_IS_OK(status
)) {
11130 if (NT_STATUS_IS_ERR(status
)) {
11134 /* Return variables */
11135 memcpy(discard_const_p(uint8_t *, value_name
), r
.out
.value_name
, (r
.in
.value_offered
/ 2) * sizeof(*value_name
));
11136 *value_needed
= *r
.out
.value_needed
;
11137 *type
= *r
.out
.type
;
11138 memcpy(data
, r
.out
.data
, (r
.in
.data_offered
) * sizeof(*data
));
11139 *data_needed
= *r
.out
.data_needed
;
11141 /* Return result */
11143 *werror
= r
.out
.result
;
11146 return werror_to_ntstatus(r
.out
.result
);
11149 struct rpccli_spoolss_DeletePrinterData_state
{
11150 struct spoolss_DeletePrinterData orig
;
11151 struct spoolss_DeletePrinterData tmp
;
11152 TALLOC_CTX
*out_mem_ctx
;
11153 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
11156 static void rpccli_spoolss_DeletePrinterData_done(struct tevent_req
*subreq
);
11158 struct tevent_req
*rpccli_spoolss_DeletePrinterData_send(TALLOC_CTX
*mem_ctx
,
11159 struct tevent_context
*ev
,
11160 struct rpc_pipe_client
*cli
,
11161 struct policy_handle
*_handle
/* [in] [ref] */,
11162 const char *_value_name
/* [in] [charset(UTF16)] */)
11164 struct tevent_req
*req
;
11165 struct rpccli_spoolss_DeletePrinterData_state
*state
;
11166 struct tevent_req
*subreq
;
11168 req
= tevent_req_create(mem_ctx
, &state
,
11169 struct rpccli_spoolss_DeletePrinterData_state
);
11173 state
->out_mem_ctx
= NULL
;
11174 state
->dispatch_recv
= cli
->dispatch_recv
;
11176 /* In parameters */
11177 state
->orig
.in
.handle
= _handle
;
11178 state
->orig
.in
.value_name
= _value_name
;
11180 /* Out parameters */
11183 ZERO_STRUCT(state
->orig
.out
.result
);
11185 /* make a temporary copy, that we pass to the dispatch function */
11186 state
->tmp
= state
->orig
;
11188 subreq
= cli
->dispatch_send(state
, ev
, cli
,
11189 &ndr_table_spoolss
,
11190 NDR_SPOOLSS_DELETEPRINTERDATA
,
11192 if (tevent_req_nomem(subreq
, req
)) {
11193 return tevent_req_post(req
, ev
);
11195 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePrinterData_done
, req
);
11199 static void rpccli_spoolss_DeletePrinterData_done(struct tevent_req
*subreq
)
11201 struct tevent_req
*req
= tevent_req_callback_data(
11202 subreq
, struct tevent_req
);
11203 struct rpccli_spoolss_DeletePrinterData_state
*state
= tevent_req_data(
11204 req
, struct rpccli_spoolss_DeletePrinterData_state
);
11206 TALLOC_CTX
*mem_ctx
;
11208 if (state
->out_mem_ctx
) {
11209 mem_ctx
= state
->out_mem_ctx
;
11214 status
= state
->dispatch_recv(subreq
, mem_ctx
);
11215 TALLOC_FREE(subreq
);
11216 if (!NT_STATUS_IS_OK(status
)) {
11217 tevent_req_nterror(req
, status
);
11221 /* Copy out parameters */
11224 state
->orig
.out
.result
= state
->tmp
.out
.result
;
11226 /* Reset temporary structure */
11227 ZERO_STRUCT(state
->tmp
);
11229 tevent_req_done(req
);
11232 NTSTATUS
rpccli_spoolss_DeletePrinterData_recv(struct tevent_req
*req
,
11233 TALLOC_CTX
*mem_ctx
,
11236 struct rpccli_spoolss_DeletePrinterData_state
*state
= tevent_req_data(
11237 req
, struct rpccli_spoolss_DeletePrinterData_state
);
11240 if (tevent_req_is_nterror(req
, &status
)) {
11241 tevent_req_received(req
);
11245 /* Steal possbile out parameters to the callers context */
11246 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
11248 /* Return result */
11249 *result
= state
->orig
.out
.result
;
11251 tevent_req_received(req
);
11252 return NT_STATUS_OK
;
11255 NTSTATUS
rpccli_spoolss_DeletePrinterData(struct rpc_pipe_client
*cli
,
11256 TALLOC_CTX
*mem_ctx
,
11257 struct policy_handle
*handle
/* [in] [ref] */,
11258 const char *value_name
/* [in] [charset(UTF16)] */,
11261 struct spoolss_DeletePrinterData r
;
11264 /* In parameters */
11265 r
.in
.handle
= handle
;
11266 r
.in
.value_name
= value_name
;
11268 status
= cli
->dispatch(cli
,
11270 &ndr_table_spoolss
,
11271 NDR_SPOOLSS_DELETEPRINTERDATA
,
11274 if (!NT_STATUS_IS_OK(status
)) {
11278 if (NT_STATUS_IS_ERR(status
)) {
11282 /* Return variables */
11284 /* Return result */
11286 *werror
= r
.out
.result
;
11289 return werror_to_ntstatus(r
.out
.result
);
11292 struct rpccli_spoolss_4a_state
{
11293 struct spoolss_4a orig
;
11294 struct spoolss_4a tmp
;
11295 TALLOC_CTX
*out_mem_ctx
;
11296 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
11299 static void rpccli_spoolss_4a_done(struct tevent_req
*subreq
);
11301 struct tevent_req
*rpccli_spoolss_4a_send(TALLOC_CTX
*mem_ctx
,
11302 struct tevent_context
*ev
,
11303 struct rpc_pipe_client
*cli
)
11305 struct tevent_req
*req
;
11306 struct rpccli_spoolss_4a_state
*state
;
11307 struct tevent_req
*subreq
;
11309 req
= tevent_req_create(mem_ctx
, &state
,
11310 struct rpccli_spoolss_4a_state
);
11314 state
->out_mem_ctx
= NULL
;
11315 state
->dispatch_recv
= cli
->dispatch_recv
;
11317 /* In parameters */
11319 /* Out parameters */
11322 ZERO_STRUCT(state
->orig
.out
.result
);
11324 /* make a temporary copy, that we pass to the dispatch function */
11325 state
->tmp
= state
->orig
;
11327 subreq
= cli
->dispatch_send(state
, ev
, cli
,
11328 &ndr_table_spoolss
,
11331 if (tevent_req_nomem(subreq
, req
)) {
11332 return tevent_req_post(req
, ev
);
11334 tevent_req_set_callback(subreq
, rpccli_spoolss_4a_done
, req
);
11338 static void rpccli_spoolss_4a_done(struct tevent_req
*subreq
)
11340 struct tevent_req
*req
= tevent_req_callback_data(
11341 subreq
, struct tevent_req
);
11342 struct rpccli_spoolss_4a_state
*state
= tevent_req_data(
11343 req
, struct rpccli_spoolss_4a_state
);
11345 TALLOC_CTX
*mem_ctx
;
11347 if (state
->out_mem_ctx
) {
11348 mem_ctx
= state
->out_mem_ctx
;
11353 status
= state
->dispatch_recv(subreq
, mem_ctx
);
11354 TALLOC_FREE(subreq
);
11355 if (!NT_STATUS_IS_OK(status
)) {
11356 tevent_req_nterror(req
, status
);
11360 /* Copy out parameters */
11363 state
->orig
.out
.result
= state
->tmp
.out
.result
;
11365 /* Reset temporary structure */
11366 ZERO_STRUCT(state
->tmp
);
11368 tevent_req_done(req
);
11371 NTSTATUS
rpccli_spoolss_4a_recv(struct tevent_req
*req
,
11372 TALLOC_CTX
*mem_ctx
,
11375 struct rpccli_spoolss_4a_state
*state
= tevent_req_data(
11376 req
, struct rpccli_spoolss_4a_state
);
11379 if (tevent_req_is_nterror(req
, &status
)) {
11380 tevent_req_received(req
);
11384 /* Steal possbile out parameters to the callers context */
11385 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
11387 /* Return result */
11388 *result
= state
->orig
.out
.result
;
11390 tevent_req_received(req
);
11391 return NT_STATUS_OK
;
11394 NTSTATUS
rpccli_spoolss_4a(struct rpc_pipe_client
*cli
,
11395 TALLOC_CTX
*mem_ctx
,
11398 struct spoolss_4a r
;
11401 /* In parameters */
11403 status
= cli
->dispatch(cli
,
11405 &ndr_table_spoolss
,
11409 if (!NT_STATUS_IS_OK(status
)) {
11413 if (NT_STATUS_IS_ERR(status
)) {
11417 /* Return variables */
11419 /* Return result */
11421 *werror
= r
.out
.result
;
11424 return werror_to_ntstatus(r
.out
.result
);
11427 struct rpccli_spoolss_4b_state
{
11428 struct spoolss_4b orig
;
11429 struct spoolss_4b tmp
;
11430 TALLOC_CTX
*out_mem_ctx
;
11431 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
11434 static void rpccli_spoolss_4b_done(struct tevent_req
*subreq
);
11436 struct tevent_req
*rpccli_spoolss_4b_send(TALLOC_CTX
*mem_ctx
,
11437 struct tevent_context
*ev
,
11438 struct rpc_pipe_client
*cli
)
11440 struct tevent_req
*req
;
11441 struct rpccli_spoolss_4b_state
*state
;
11442 struct tevent_req
*subreq
;
11444 req
= tevent_req_create(mem_ctx
, &state
,
11445 struct rpccli_spoolss_4b_state
);
11449 state
->out_mem_ctx
= NULL
;
11450 state
->dispatch_recv
= cli
->dispatch_recv
;
11452 /* In parameters */
11454 /* Out parameters */
11457 ZERO_STRUCT(state
->orig
.out
.result
);
11459 /* make a temporary copy, that we pass to the dispatch function */
11460 state
->tmp
= state
->orig
;
11462 subreq
= cli
->dispatch_send(state
, ev
, cli
,
11463 &ndr_table_spoolss
,
11466 if (tevent_req_nomem(subreq
, req
)) {
11467 return tevent_req_post(req
, ev
);
11469 tevent_req_set_callback(subreq
, rpccli_spoolss_4b_done
, req
);
11473 static void rpccli_spoolss_4b_done(struct tevent_req
*subreq
)
11475 struct tevent_req
*req
= tevent_req_callback_data(
11476 subreq
, struct tevent_req
);
11477 struct rpccli_spoolss_4b_state
*state
= tevent_req_data(
11478 req
, struct rpccli_spoolss_4b_state
);
11480 TALLOC_CTX
*mem_ctx
;
11482 if (state
->out_mem_ctx
) {
11483 mem_ctx
= state
->out_mem_ctx
;
11488 status
= state
->dispatch_recv(subreq
, mem_ctx
);
11489 TALLOC_FREE(subreq
);
11490 if (!NT_STATUS_IS_OK(status
)) {
11491 tevent_req_nterror(req
, status
);
11495 /* Copy out parameters */
11498 state
->orig
.out
.result
= state
->tmp
.out
.result
;
11500 /* Reset temporary structure */
11501 ZERO_STRUCT(state
->tmp
);
11503 tevent_req_done(req
);
11506 NTSTATUS
rpccli_spoolss_4b_recv(struct tevent_req
*req
,
11507 TALLOC_CTX
*mem_ctx
,
11510 struct rpccli_spoolss_4b_state
*state
= tevent_req_data(
11511 req
, struct rpccli_spoolss_4b_state
);
11514 if (tevent_req_is_nterror(req
, &status
)) {
11515 tevent_req_received(req
);
11519 /* Steal possbile out parameters to the callers context */
11520 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
11522 /* Return result */
11523 *result
= state
->orig
.out
.result
;
11525 tevent_req_received(req
);
11526 return NT_STATUS_OK
;
11529 NTSTATUS
rpccli_spoolss_4b(struct rpc_pipe_client
*cli
,
11530 TALLOC_CTX
*mem_ctx
,
11533 struct spoolss_4b r
;
11536 /* In parameters */
11538 status
= cli
->dispatch(cli
,
11540 &ndr_table_spoolss
,
11544 if (!NT_STATUS_IS_OK(status
)) {
11548 if (NT_STATUS_IS_ERR(status
)) {
11552 /* Return variables */
11554 /* Return result */
11556 *werror
= r
.out
.result
;
11559 return werror_to_ntstatus(r
.out
.result
);
11562 struct rpccli_spoolss_4c_state
{
11563 struct spoolss_4c orig
;
11564 struct spoolss_4c tmp
;
11565 TALLOC_CTX
*out_mem_ctx
;
11566 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
11569 static void rpccli_spoolss_4c_done(struct tevent_req
*subreq
);
11571 struct tevent_req
*rpccli_spoolss_4c_send(TALLOC_CTX
*mem_ctx
,
11572 struct tevent_context
*ev
,
11573 struct rpc_pipe_client
*cli
)
11575 struct tevent_req
*req
;
11576 struct rpccli_spoolss_4c_state
*state
;
11577 struct tevent_req
*subreq
;
11579 req
= tevent_req_create(mem_ctx
, &state
,
11580 struct rpccli_spoolss_4c_state
);
11584 state
->out_mem_ctx
= NULL
;
11585 state
->dispatch_recv
= cli
->dispatch_recv
;
11587 /* In parameters */
11589 /* Out parameters */
11592 ZERO_STRUCT(state
->orig
.out
.result
);
11594 /* make a temporary copy, that we pass to the dispatch function */
11595 state
->tmp
= state
->orig
;
11597 subreq
= cli
->dispatch_send(state
, ev
, cli
,
11598 &ndr_table_spoolss
,
11601 if (tevent_req_nomem(subreq
, req
)) {
11602 return tevent_req_post(req
, ev
);
11604 tevent_req_set_callback(subreq
, rpccli_spoolss_4c_done
, req
);
11608 static void rpccli_spoolss_4c_done(struct tevent_req
*subreq
)
11610 struct tevent_req
*req
= tevent_req_callback_data(
11611 subreq
, struct tevent_req
);
11612 struct rpccli_spoolss_4c_state
*state
= tevent_req_data(
11613 req
, struct rpccli_spoolss_4c_state
);
11615 TALLOC_CTX
*mem_ctx
;
11617 if (state
->out_mem_ctx
) {
11618 mem_ctx
= state
->out_mem_ctx
;
11623 status
= state
->dispatch_recv(subreq
, mem_ctx
);
11624 TALLOC_FREE(subreq
);
11625 if (!NT_STATUS_IS_OK(status
)) {
11626 tevent_req_nterror(req
, status
);
11630 /* Copy out parameters */
11633 state
->orig
.out
.result
= state
->tmp
.out
.result
;
11635 /* Reset temporary structure */
11636 ZERO_STRUCT(state
->tmp
);
11638 tevent_req_done(req
);
11641 NTSTATUS
rpccli_spoolss_4c_recv(struct tevent_req
*req
,
11642 TALLOC_CTX
*mem_ctx
,
11645 struct rpccli_spoolss_4c_state
*state
= tevent_req_data(
11646 req
, struct rpccli_spoolss_4c_state
);
11649 if (tevent_req_is_nterror(req
, &status
)) {
11650 tevent_req_received(req
);
11654 /* Steal possbile out parameters to the callers context */
11655 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
11657 /* Return result */
11658 *result
= state
->orig
.out
.result
;
11660 tevent_req_received(req
);
11661 return NT_STATUS_OK
;
11664 NTSTATUS
rpccli_spoolss_4c(struct rpc_pipe_client
*cli
,
11665 TALLOC_CTX
*mem_ctx
,
11668 struct spoolss_4c r
;
11671 /* In parameters */
11673 status
= cli
->dispatch(cli
,
11675 &ndr_table_spoolss
,
11679 if (!NT_STATUS_IS_OK(status
)) {
11683 if (NT_STATUS_IS_ERR(status
)) {
11687 /* Return variables */
11689 /* Return result */
11691 *werror
= r
.out
.result
;
11694 return werror_to_ntstatus(r
.out
.result
);
11697 struct rpccli_spoolss_SetPrinterDataEx_state
{
11698 struct spoolss_SetPrinterDataEx orig
;
11699 struct spoolss_SetPrinterDataEx tmp
;
11700 TALLOC_CTX
*out_mem_ctx
;
11701 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
11704 static void rpccli_spoolss_SetPrinterDataEx_done(struct tevent_req
*subreq
);
11706 struct tevent_req
*rpccli_spoolss_SetPrinterDataEx_send(TALLOC_CTX
*mem_ctx
,
11707 struct tevent_context
*ev
,
11708 struct rpc_pipe_client
*cli
,
11709 struct policy_handle
*_handle
/* [in] [ref] */,
11710 const char *_key_name
/* [in] [charset(UTF16)] */,
11711 const char *_value_name
/* [in] [charset(UTF16)] */,
11712 enum winreg_Type _type
/* [in] */,
11713 uint8_t *_buffer
/* [in] [ref,size_is(offered)] */,
11714 uint32_t _offered
/* [in] */)
11716 struct tevent_req
*req
;
11717 struct rpccli_spoolss_SetPrinterDataEx_state
*state
;
11718 struct tevent_req
*subreq
;
11720 req
= tevent_req_create(mem_ctx
, &state
,
11721 struct rpccli_spoolss_SetPrinterDataEx_state
);
11725 state
->out_mem_ctx
= NULL
;
11726 state
->dispatch_recv
= cli
->dispatch_recv
;
11728 /* In parameters */
11729 state
->orig
.in
.handle
= _handle
;
11730 state
->orig
.in
.key_name
= _key_name
;
11731 state
->orig
.in
.value_name
= _value_name
;
11732 state
->orig
.in
.type
= _type
;
11733 state
->orig
.in
.buffer
= _buffer
;
11734 state
->orig
.in
.offered
= _offered
;
11736 /* Out parameters */
11739 ZERO_STRUCT(state
->orig
.out
.result
);
11741 /* make a temporary copy, that we pass to the dispatch function */
11742 state
->tmp
= state
->orig
;
11744 subreq
= cli
->dispatch_send(state
, ev
, cli
,
11745 &ndr_table_spoolss
,
11746 NDR_SPOOLSS_SETPRINTERDATAEX
,
11748 if (tevent_req_nomem(subreq
, req
)) {
11749 return tevent_req_post(req
, ev
);
11751 tevent_req_set_callback(subreq
, rpccli_spoolss_SetPrinterDataEx_done
, req
);
11755 static void rpccli_spoolss_SetPrinterDataEx_done(struct tevent_req
*subreq
)
11757 struct tevent_req
*req
= tevent_req_callback_data(
11758 subreq
, struct tevent_req
);
11759 struct rpccli_spoolss_SetPrinterDataEx_state
*state
= tevent_req_data(
11760 req
, struct rpccli_spoolss_SetPrinterDataEx_state
);
11762 TALLOC_CTX
*mem_ctx
;
11764 if (state
->out_mem_ctx
) {
11765 mem_ctx
= state
->out_mem_ctx
;
11770 status
= state
->dispatch_recv(subreq
, mem_ctx
);
11771 TALLOC_FREE(subreq
);
11772 if (!NT_STATUS_IS_OK(status
)) {
11773 tevent_req_nterror(req
, status
);
11777 /* Copy out parameters */
11780 state
->orig
.out
.result
= state
->tmp
.out
.result
;
11782 /* Reset temporary structure */
11783 ZERO_STRUCT(state
->tmp
);
11785 tevent_req_done(req
);
11788 NTSTATUS
rpccli_spoolss_SetPrinterDataEx_recv(struct tevent_req
*req
,
11789 TALLOC_CTX
*mem_ctx
,
11792 struct rpccli_spoolss_SetPrinterDataEx_state
*state
= tevent_req_data(
11793 req
, struct rpccli_spoolss_SetPrinterDataEx_state
);
11796 if (tevent_req_is_nterror(req
, &status
)) {
11797 tevent_req_received(req
);
11801 /* Steal possbile out parameters to the callers context */
11802 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
11804 /* Return result */
11805 *result
= state
->orig
.out
.result
;
11807 tevent_req_received(req
);
11808 return NT_STATUS_OK
;
11811 NTSTATUS
rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client
*cli
,
11812 TALLOC_CTX
*mem_ctx
,
11813 struct policy_handle
*handle
/* [in] [ref] */,
11814 const char *key_name
/* [in] [charset(UTF16)] */,
11815 const char *value_name
/* [in] [charset(UTF16)] */,
11816 enum winreg_Type type
/* [in] */,
11817 uint8_t *buffer
/* [in] [ref,size_is(offered)] */,
11818 uint32_t offered
/* [in] */,
11821 struct spoolss_SetPrinterDataEx r
;
11824 /* In parameters */
11825 r
.in
.handle
= handle
;
11826 r
.in
.key_name
= key_name
;
11827 r
.in
.value_name
= value_name
;
11829 r
.in
.buffer
= buffer
;
11830 r
.in
.offered
= offered
;
11832 status
= cli
->dispatch(cli
,
11834 &ndr_table_spoolss
,
11835 NDR_SPOOLSS_SETPRINTERDATAEX
,
11838 if (!NT_STATUS_IS_OK(status
)) {
11842 if (NT_STATUS_IS_ERR(status
)) {
11846 /* Return variables */
11848 /* Return result */
11850 *werror
= r
.out
.result
;
11853 return werror_to_ntstatus(r
.out
.result
);
11856 struct rpccli_spoolss_GetPrinterDataEx_state
{
11857 struct spoolss_GetPrinterDataEx orig
;
11858 struct spoolss_GetPrinterDataEx tmp
;
11859 TALLOC_CTX
*out_mem_ctx
;
11860 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
11863 static void rpccli_spoolss_GetPrinterDataEx_done(struct tevent_req
*subreq
);
11865 struct tevent_req
*rpccli_spoolss_GetPrinterDataEx_send(TALLOC_CTX
*mem_ctx
,
11866 struct tevent_context
*ev
,
11867 struct rpc_pipe_client
*cli
,
11868 struct policy_handle
*_handle
/* [in] [ref] */,
11869 const char *_key_name
/* [in] [charset(UTF16)] */,
11870 const char *_value_name
/* [in] [charset(UTF16)] */,
11871 enum winreg_Type
*_type
/* [out] [ref] */,
11872 uint8_t *_buffer
/* [out] [ref,size_is(offered)] */,
11873 uint32_t _offered
/* [in] */,
11874 uint32_t *_needed
/* [out] [ref] */)
11876 struct tevent_req
*req
;
11877 struct rpccli_spoolss_GetPrinterDataEx_state
*state
;
11878 struct tevent_req
*subreq
;
11880 req
= tevent_req_create(mem_ctx
, &state
,
11881 struct rpccli_spoolss_GetPrinterDataEx_state
);
11885 state
->out_mem_ctx
= NULL
;
11886 state
->dispatch_recv
= cli
->dispatch_recv
;
11888 /* In parameters */
11889 state
->orig
.in
.handle
= _handle
;
11890 state
->orig
.in
.key_name
= _key_name
;
11891 state
->orig
.in
.value_name
= _value_name
;
11892 state
->orig
.in
.offered
= _offered
;
11894 /* Out parameters */
11895 state
->orig
.out
.type
= _type
;
11896 state
->orig
.out
.buffer
= _buffer
;
11897 state
->orig
.out
.needed
= _needed
;
11900 ZERO_STRUCT(state
->orig
.out
.result
);
11902 state
->out_mem_ctx
= talloc_named_const(state
, 0,
11903 "rpccli_spoolss_GetPrinterDataEx_out_memory");
11904 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
11905 return tevent_req_post(req
, ev
);
11908 /* make a temporary copy, that we pass to the dispatch function */
11909 state
->tmp
= state
->orig
;
11911 subreq
= cli
->dispatch_send(state
, ev
, cli
,
11912 &ndr_table_spoolss
,
11913 NDR_SPOOLSS_GETPRINTERDATAEX
,
11915 if (tevent_req_nomem(subreq
, req
)) {
11916 return tevent_req_post(req
, ev
);
11918 tevent_req_set_callback(subreq
, rpccli_spoolss_GetPrinterDataEx_done
, req
);
11922 static void rpccli_spoolss_GetPrinterDataEx_done(struct tevent_req
*subreq
)
11924 struct tevent_req
*req
= tevent_req_callback_data(
11925 subreq
, struct tevent_req
);
11926 struct rpccli_spoolss_GetPrinterDataEx_state
*state
= tevent_req_data(
11927 req
, struct rpccli_spoolss_GetPrinterDataEx_state
);
11929 TALLOC_CTX
*mem_ctx
;
11931 if (state
->out_mem_ctx
) {
11932 mem_ctx
= state
->out_mem_ctx
;
11937 status
= state
->dispatch_recv(subreq
, mem_ctx
);
11938 TALLOC_FREE(subreq
);
11939 if (!NT_STATUS_IS_OK(status
)) {
11940 tevent_req_nterror(req
, status
);
11944 /* Copy out parameters */
11945 *state
->orig
.out
.type
= *state
->tmp
.out
.type
;
11946 memcpy(state
->orig
.out
.buffer
, state
->tmp
.out
.buffer
, (state
->tmp
.in
.offered
) * sizeof(*state
->orig
.out
.buffer
));
11947 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
11950 state
->orig
.out
.result
= state
->tmp
.out
.result
;
11952 /* Reset temporary structure */
11953 ZERO_STRUCT(state
->tmp
);
11955 tevent_req_done(req
);
11958 NTSTATUS
rpccli_spoolss_GetPrinterDataEx_recv(struct tevent_req
*req
,
11959 TALLOC_CTX
*mem_ctx
,
11962 struct rpccli_spoolss_GetPrinterDataEx_state
*state
= tevent_req_data(
11963 req
, struct rpccli_spoolss_GetPrinterDataEx_state
);
11966 if (tevent_req_is_nterror(req
, &status
)) {
11967 tevent_req_received(req
);
11971 /* Steal possbile out parameters to the callers context */
11972 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
11974 /* Return result */
11975 *result
= state
->orig
.out
.result
;
11977 tevent_req_received(req
);
11978 return NT_STATUS_OK
;
11981 NTSTATUS
rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client
*cli
,
11982 TALLOC_CTX
*mem_ctx
,
11983 struct policy_handle
*handle
/* [in] [ref] */,
11984 const char *key_name
/* [in] [charset(UTF16)] */,
11985 const char *value_name
/* [in] [charset(UTF16)] */,
11986 enum winreg_Type
*type
/* [out] [ref] */,
11987 uint8_t *buffer
/* [out] [ref,size_is(offered)] */,
11988 uint32_t offered
/* [in] */,
11989 uint32_t *needed
/* [out] [ref] */,
11992 struct spoolss_GetPrinterDataEx r
;
11995 /* In parameters */
11996 r
.in
.handle
= handle
;
11997 r
.in
.key_name
= key_name
;
11998 r
.in
.value_name
= value_name
;
11999 r
.in
.offered
= offered
;
12001 status
= cli
->dispatch(cli
,
12003 &ndr_table_spoolss
,
12004 NDR_SPOOLSS_GETPRINTERDATAEX
,
12007 if (!NT_STATUS_IS_OK(status
)) {
12011 if (NT_STATUS_IS_ERR(status
)) {
12015 /* Return variables */
12016 *type
= *r
.out
.type
;
12017 memcpy(buffer
, r
.out
.buffer
, (r
.in
.offered
) * sizeof(*buffer
));
12018 *needed
= *r
.out
.needed
;
12020 /* Return result */
12022 *werror
= r
.out
.result
;
12025 return werror_to_ntstatus(r
.out
.result
);
12028 struct rpccli_spoolss_EnumPrinterDataEx_state
{
12029 struct spoolss_EnumPrinterDataEx orig
;
12030 struct spoolss_EnumPrinterDataEx tmp
;
12031 TALLOC_CTX
*out_mem_ctx
;
12032 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
12035 static void rpccli_spoolss_EnumPrinterDataEx_done(struct tevent_req
*subreq
);
12037 struct tevent_req
*rpccli_spoolss_EnumPrinterDataEx_send(TALLOC_CTX
*mem_ctx
,
12038 struct tevent_context
*ev
,
12039 struct rpc_pipe_client
*cli
,
12040 struct policy_handle
*_handle
/* [in] [ref] */,
12041 const char *_key_name
/* [in] [charset(UTF16)] */,
12042 uint32_t _offered
/* [in] */,
12043 uint32_t *_count
/* [out] [ref] */,
12044 struct spoolss_PrinterEnumValues
**_info
/* [out] [ref,size_is(,*count)] */,
12045 uint32_t *_needed
/* [out] [ref] */)
12047 struct tevent_req
*req
;
12048 struct rpccli_spoolss_EnumPrinterDataEx_state
*state
;
12049 struct tevent_req
*subreq
;
12051 req
= tevent_req_create(mem_ctx
, &state
,
12052 struct rpccli_spoolss_EnumPrinterDataEx_state
);
12056 state
->out_mem_ctx
= NULL
;
12057 state
->dispatch_recv
= cli
->dispatch_recv
;
12059 /* In parameters */
12060 state
->orig
.in
.handle
= _handle
;
12061 state
->orig
.in
.key_name
= _key_name
;
12062 state
->orig
.in
.offered
= _offered
;
12064 /* Out parameters */
12065 state
->orig
.out
.count
= _count
;
12066 state
->orig
.out
.info
= _info
;
12067 state
->orig
.out
.needed
= _needed
;
12070 ZERO_STRUCT(state
->orig
.out
.result
);
12072 state
->out_mem_ctx
= talloc_named_const(state
, 0,
12073 "rpccli_spoolss_EnumPrinterDataEx_out_memory");
12074 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
12075 return tevent_req_post(req
, ev
);
12078 /* make a temporary copy, that we pass to the dispatch function */
12079 state
->tmp
= state
->orig
;
12081 subreq
= cli
->dispatch_send(state
, ev
, cli
,
12082 &ndr_table_spoolss
,
12083 NDR_SPOOLSS_ENUMPRINTERDATAEX
,
12085 if (tevent_req_nomem(subreq
, req
)) {
12086 return tevent_req_post(req
, ev
);
12088 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumPrinterDataEx_done
, req
);
12092 static void rpccli_spoolss_EnumPrinterDataEx_done(struct tevent_req
*subreq
)
12094 struct tevent_req
*req
= tevent_req_callback_data(
12095 subreq
, struct tevent_req
);
12096 struct rpccli_spoolss_EnumPrinterDataEx_state
*state
= tevent_req_data(
12097 req
, struct rpccli_spoolss_EnumPrinterDataEx_state
);
12099 TALLOC_CTX
*mem_ctx
;
12101 if (state
->out_mem_ctx
) {
12102 mem_ctx
= state
->out_mem_ctx
;
12107 status
= state
->dispatch_recv(subreq
, mem_ctx
);
12108 TALLOC_FREE(subreq
);
12109 if (!NT_STATUS_IS_OK(status
)) {
12110 tevent_req_nterror(req
, status
);
12114 /* Copy out parameters */
12115 *state
->orig
.out
.count
= *state
->tmp
.out
.count
;
12116 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
12117 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
12120 state
->orig
.out
.result
= state
->tmp
.out
.result
;
12122 /* Reset temporary structure */
12123 ZERO_STRUCT(state
->tmp
);
12125 tevent_req_done(req
);
12128 NTSTATUS
rpccli_spoolss_EnumPrinterDataEx_recv(struct tevent_req
*req
,
12129 TALLOC_CTX
*mem_ctx
,
12132 struct rpccli_spoolss_EnumPrinterDataEx_state
*state
= tevent_req_data(
12133 req
, struct rpccli_spoolss_EnumPrinterDataEx_state
);
12136 if (tevent_req_is_nterror(req
, &status
)) {
12137 tevent_req_received(req
);
12141 /* Steal possbile out parameters to the callers context */
12142 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
12144 /* Return result */
12145 *result
= state
->orig
.out
.result
;
12147 tevent_req_received(req
);
12148 return NT_STATUS_OK
;
12151 NTSTATUS
rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client
*cli
,
12152 TALLOC_CTX
*mem_ctx
,
12153 struct policy_handle
*handle
/* [in] [ref] */,
12154 const char *key_name
/* [in] [charset(UTF16)] */,
12155 uint32_t offered
/* [in] */,
12156 uint32_t *count
/* [out] [ref] */,
12157 struct spoolss_PrinterEnumValues
**info
/* [out] [ref,size_is(,*count)] */,
12158 uint32_t *needed
/* [out] [ref] */,
12161 struct spoolss_EnumPrinterDataEx r
;
12164 /* In parameters */
12165 r
.in
.handle
= handle
;
12166 r
.in
.key_name
= key_name
;
12167 r
.in
.offered
= offered
;
12169 status
= cli
->dispatch(cli
,
12171 &ndr_table_spoolss
,
12172 NDR_SPOOLSS_ENUMPRINTERDATAEX
,
12175 if (!NT_STATUS_IS_OK(status
)) {
12179 if (NT_STATUS_IS_ERR(status
)) {
12183 /* Return variables */
12184 *count
= *r
.out
.count
;
12185 *info
= *r
.out
.info
;
12186 *needed
= *r
.out
.needed
;
12188 /* Return result */
12190 *werror
= r
.out
.result
;
12193 return werror_to_ntstatus(r
.out
.result
);
12196 struct rpccli_spoolss_EnumPrinterKey_state
{
12197 struct spoolss_EnumPrinterKey orig
;
12198 struct spoolss_EnumPrinterKey tmp
;
12199 TALLOC_CTX
*out_mem_ctx
;
12200 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
12203 static void rpccli_spoolss_EnumPrinterKey_done(struct tevent_req
*subreq
);
12205 struct tevent_req
*rpccli_spoolss_EnumPrinterKey_send(TALLOC_CTX
*mem_ctx
,
12206 struct tevent_context
*ev
,
12207 struct rpc_pipe_client
*cli
,
12208 struct policy_handle
*_handle
/* [in] [ref] */,
12209 const char *_key_name
/* [in] [charset(UTF16)] */,
12210 uint16_t *_key_buffer
/* [out] [ref,size_is(offered/2)] */,
12211 uint32_t _offered
/* [in] */,
12212 uint32_t *_needed
/* [out] [ref] */)
12214 struct tevent_req
*req
;
12215 struct rpccli_spoolss_EnumPrinterKey_state
*state
;
12216 struct tevent_req
*subreq
;
12218 req
= tevent_req_create(mem_ctx
, &state
,
12219 struct rpccli_spoolss_EnumPrinterKey_state
);
12223 state
->out_mem_ctx
= NULL
;
12224 state
->dispatch_recv
= cli
->dispatch_recv
;
12226 /* In parameters */
12227 state
->orig
.in
.handle
= _handle
;
12228 state
->orig
.in
.key_name
= _key_name
;
12229 state
->orig
.in
.offered
= _offered
;
12231 /* Out parameters */
12232 state
->orig
.out
.key_buffer
= _key_buffer
;
12233 state
->orig
.out
.needed
= _needed
;
12236 ZERO_STRUCT(state
->orig
.out
.result
);
12238 state
->out_mem_ctx
= talloc_named_const(state
, 0,
12239 "rpccli_spoolss_EnumPrinterKey_out_memory");
12240 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
12241 return tevent_req_post(req
, ev
);
12244 /* make a temporary copy, that we pass to the dispatch function */
12245 state
->tmp
= state
->orig
;
12247 subreq
= cli
->dispatch_send(state
, ev
, cli
,
12248 &ndr_table_spoolss
,
12249 NDR_SPOOLSS_ENUMPRINTERKEY
,
12251 if (tevent_req_nomem(subreq
, req
)) {
12252 return tevent_req_post(req
, ev
);
12254 tevent_req_set_callback(subreq
, rpccli_spoolss_EnumPrinterKey_done
, req
);
12258 static void rpccli_spoolss_EnumPrinterKey_done(struct tevent_req
*subreq
)
12260 struct tevent_req
*req
= tevent_req_callback_data(
12261 subreq
, struct tevent_req
);
12262 struct rpccli_spoolss_EnumPrinterKey_state
*state
= tevent_req_data(
12263 req
, struct rpccli_spoolss_EnumPrinterKey_state
);
12265 TALLOC_CTX
*mem_ctx
;
12267 if (state
->out_mem_ctx
) {
12268 mem_ctx
= state
->out_mem_ctx
;
12273 status
= state
->dispatch_recv(subreq
, mem_ctx
);
12274 TALLOC_FREE(subreq
);
12275 if (!NT_STATUS_IS_OK(status
)) {
12276 tevent_req_nterror(req
, status
);
12280 /* Copy out parameters */
12281 memcpy(state
->orig
.out
.key_buffer
, state
->tmp
.out
.key_buffer
, (state
->tmp
.in
.offered
/ 2) * sizeof(*state
->orig
.out
.key_buffer
));
12282 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
12285 state
->orig
.out
.result
= state
->tmp
.out
.result
;
12287 /* Reset temporary structure */
12288 ZERO_STRUCT(state
->tmp
);
12290 tevent_req_done(req
);
12293 NTSTATUS
rpccli_spoolss_EnumPrinterKey_recv(struct tevent_req
*req
,
12294 TALLOC_CTX
*mem_ctx
,
12297 struct rpccli_spoolss_EnumPrinterKey_state
*state
= tevent_req_data(
12298 req
, struct rpccli_spoolss_EnumPrinterKey_state
);
12301 if (tevent_req_is_nterror(req
, &status
)) {
12302 tevent_req_received(req
);
12306 /* Steal possbile out parameters to the callers context */
12307 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
12309 /* Return result */
12310 *result
= state
->orig
.out
.result
;
12312 tevent_req_received(req
);
12313 return NT_STATUS_OK
;
12316 NTSTATUS
rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client
*cli
,
12317 TALLOC_CTX
*mem_ctx
,
12318 struct policy_handle
*handle
/* [in] [ref] */,
12319 const char *key_name
/* [in] [charset(UTF16)] */,
12320 uint16_t *key_buffer
/* [out] [ref,size_is(offered/2)] */,
12321 uint32_t offered
/* [in] */,
12322 uint32_t *needed
/* [out] [ref] */,
12325 struct spoolss_EnumPrinterKey r
;
12328 /* In parameters */
12329 r
.in
.handle
= handle
;
12330 r
.in
.key_name
= key_name
;
12331 r
.in
.offered
= offered
;
12333 status
= cli
->dispatch(cli
,
12335 &ndr_table_spoolss
,
12336 NDR_SPOOLSS_ENUMPRINTERKEY
,
12339 if (!NT_STATUS_IS_OK(status
)) {
12343 if (NT_STATUS_IS_ERR(status
)) {
12347 /* Return variables */
12348 memcpy(key_buffer
, r
.out
.key_buffer
, (r
.in
.offered
/ 2) * sizeof(*key_buffer
));
12349 *needed
= *r
.out
.needed
;
12351 /* Return result */
12353 *werror
= r
.out
.result
;
12356 return werror_to_ntstatus(r
.out
.result
);
12359 struct rpccli_spoolss_DeletePrinterDataEx_state
{
12360 struct spoolss_DeletePrinterDataEx orig
;
12361 struct spoolss_DeletePrinterDataEx tmp
;
12362 TALLOC_CTX
*out_mem_ctx
;
12363 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
12366 static void rpccli_spoolss_DeletePrinterDataEx_done(struct tevent_req
*subreq
);
12368 struct tevent_req
*rpccli_spoolss_DeletePrinterDataEx_send(TALLOC_CTX
*mem_ctx
,
12369 struct tevent_context
*ev
,
12370 struct rpc_pipe_client
*cli
,
12371 struct policy_handle
*_handle
/* [in] [ref] */,
12372 const char *_key_name
/* [in] [charset(UTF16)] */,
12373 const char *_value_name
/* [in] [charset(UTF16)] */)
12375 struct tevent_req
*req
;
12376 struct rpccli_spoolss_DeletePrinterDataEx_state
*state
;
12377 struct tevent_req
*subreq
;
12379 req
= tevent_req_create(mem_ctx
, &state
,
12380 struct rpccli_spoolss_DeletePrinterDataEx_state
);
12384 state
->out_mem_ctx
= NULL
;
12385 state
->dispatch_recv
= cli
->dispatch_recv
;
12387 /* In parameters */
12388 state
->orig
.in
.handle
= _handle
;
12389 state
->orig
.in
.key_name
= _key_name
;
12390 state
->orig
.in
.value_name
= _value_name
;
12392 /* Out parameters */
12395 ZERO_STRUCT(state
->orig
.out
.result
);
12397 /* make a temporary copy, that we pass to the dispatch function */
12398 state
->tmp
= state
->orig
;
12400 subreq
= cli
->dispatch_send(state
, ev
, cli
,
12401 &ndr_table_spoolss
,
12402 NDR_SPOOLSS_DELETEPRINTERDATAEX
,
12404 if (tevent_req_nomem(subreq
, req
)) {
12405 return tevent_req_post(req
, ev
);
12407 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePrinterDataEx_done
, req
);
12411 static void rpccli_spoolss_DeletePrinterDataEx_done(struct tevent_req
*subreq
)
12413 struct tevent_req
*req
= tevent_req_callback_data(
12414 subreq
, struct tevent_req
);
12415 struct rpccli_spoolss_DeletePrinterDataEx_state
*state
= tevent_req_data(
12416 req
, struct rpccli_spoolss_DeletePrinterDataEx_state
);
12418 TALLOC_CTX
*mem_ctx
;
12420 if (state
->out_mem_ctx
) {
12421 mem_ctx
= state
->out_mem_ctx
;
12426 status
= state
->dispatch_recv(subreq
, mem_ctx
);
12427 TALLOC_FREE(subreq
);
12428 if (!NT_STATUS_IS_OK(status
)) {
12429 tevent_req_nterror(req
, status
);
12433 /* Copy out parameters */
12436 state
->orig
.out
.result
= state
->tmp
.out
.result
;
12438 /* Reset temporary structure */
12439 ZERO_STRUCT(state
->tmp
);
12441 tevent_req_done(req
);
12444 NTSTATUS
rpccli_spoolss_DeletePrinterDataEx_recv(struct tevent_req
*req
,
12445 TALLOC_CTX
*mem_ctx
,
12448 struct rpccli_spoolss_DeletePrinterDataEx_state
*state
= tevent_req_data(
12449 req
, struct rpccli_spoolss_DeletePrinterDataEx_state
);
12452 if (tevent_req_is_nterror(req
, &status
)) {
12453 tevent_req_received(req
);
12457 /* Steal possbile out parameters to the callers context */
12458 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
12460 /* Return result */
12461 *result
= state
->orig
.out
.result
;
12463 tevent_req_received(req
);
12464 return NT_STATUS_OK
;
12467 NTSTATUS
rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client
*cli
,
12468 TALLOC_CTX
*mem_ctx
,
12469 struct policy_handle
*handle
/* [in] [ref] */,
12470 const char *key_name
/* [in] [charset(UTF16)] */,
12471 const char *value_name
/* [in] [charset(UTF16)] */,
12474 struct spoolss_DeletePrinterDataEx r
;
12477 /* In parameters */
12478 r
.in
.handle
= handle
;
12479 r
.in
.key_name
= key_name
;
12480 r
.in
.value_name
= value_name
;
12482 status
= cli
->dispatch(cli
,
12484 &ndr_table_spoolss
,
12485 NDR_SPOOLSS_DELETEPRINTERDATAEX
,
12488 if (!NT_STATUS_IS_OK(status
)) {
12492 if (NT_STATUS_IS_ERR(status
)) {
12496 /* Return variables */
12498 /* Return result */
12500 *werror
= r
.out
.result
;
12503 return werror_to_ntstatus(r
.out
.result
);
12506 struct rpccli_spoolss_DeletePrinterKey_state
{
12507 struct spoolss_DeletePrinterKey orig
;
12508 struct spoolss_DeletePrinterKey tmp
;
12509 TALLOC_CTX
*out_mem_ctx
;
12510 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
12513 static void rpccli_spoolss_DeletePrinterKey_done(struct tevent_req
*subreq
);
12515 struct tevent_req
*rpccli_spoolss_DeletePrinterKey_send(TALLOC_CTX
*mem_ctx
,
12516 struct tevent_context
*ev
,
12517 struct rpc_pipe_client
*cli
,
12518 struct policy_handle
*_handle
/* [in] [ref] */,
12519 const char *_key_name
/* [in] [charset(UTF16)] */)
12521 struct tevent_req
*req
;
12522 struct rpccli_spoolss_DeletePrinterKey_state
*state
;
12523 struct tevent_req
*subreq
;
12525 req
= tevent_req_create(mem_ctx
, &state
,
12526 struct rpccli_spoolss_DeletePrinterKey_state
);
12530 state
->out_mem_ctx
= NULL
;
12531 state
->dispatch_recv
= cli
->dispatch_recv
;
12533 /* In parameters */
12534 state
->orig
.in
.handle
= _handle
;
12535 state
->orig
.in
.key_name
= _key_name
;
12537 /* Out parameters */
12540 ZERO_STRUCT(state
->orig
.out
.result
);
12542 /* make a temporary copy, that we pass to the dispatch function */
12543 state
->tmp
= state
->orig
;
12545 subreq
= cli
->dispatch_send(state
, ev
, cli
,
12546 &ndr_table_spoolss
,
12547 NDR_SPOOLSS_DELETEPRINTERKEY
,
12549 if (tevent_req_nomem(subreq
, req
)) {
12550 return tevent_req_post(req
, ev
);
12552 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePrinterKey_done
, req
);
12556 static void rpccli_spoolss_DeletePrinterKey_done(struct tevent_req
*subreq
)
12558 struct tevent_req
*req
= tevent_req_callback_data(
12559 subreq
, struct tevent_req
);
12560 struct rpccli_spoolss_DeletePrinterKey_state
*state
= tevent_req_data(
12561 req
, struct rpccli_spoolss_DeletePrinterKey_state
);
12563 TALLOC_CTX
*mem_ctx
;
12565 if (state
->out_mem_ctx
) {
12566 mem_ctx
= state
->out_mem_ctx
;
12571 status
= state
->dispatch_recv(subreq
, mem_ctx
);
12572 TALLOC_FREE(subreq
);
12573 if (!NT_STATUS_IS_OK(status
)) {
12574 tevent_req_nterror(req
, status
);
12578 /* Copy out parameters */
12581 state
->orig
.out
.result
= state
->tmp
.out
.result
;
12583 /* Reset temporary structure */
12584 ZERO_STRUCT(state
->tmp
);
12586 tevent_req_done(req
);
12589 NTSTATUS
rpccli_spoolss_DeletePrinterKey_recv(struct tevent_req
*req
,
12590 TALLOC_CTX
*mem_ctx
,
12593 struct rpccli_spoolss_DeletePrinterKey_state
*state
= tevent_req_data(
12594 req
, struct rpccli_spoolss_DeletePrinterKey_state
);
12597 if (tevent_req_is_nterror(req
, &status
)) {
12598 tevent_req_received(req
);
12602 /* Steal possbile out parameters to the callers context */
12603 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
12605 /* Return result */
12606 *result
= state
->orig
.out
.result
;
12608 tevent_req_received(req
);
12609 return NT_STATUS_OK
;
12612 NTSTATUS
rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client
*cli
,
12613 TALLOC_CTX
*mem_ctx
,
12614 struct policy_handle
*handle
/* [in] [ref] */,
12615 const char *key_name
/* [in] [charset(UTF16)] */,
12618 struct spoolss_DeletePrinterKey r
;
12621 /* In parameters */
12622 r
.in
.handle
= handle
;
12623 r
.in
.key_name
= key_name
;
12625 status
= cli
->dispatch(cli
,
12627 &ndr_table_spoolss
,
12628 NDR_SPOOLSS_DELETEPRINTERKEY
,
12631 if (!NT_STATUS_IS_OK(status
)) {
12635 if (NT_STATUS_IS_ERR(status
)) {
12639 /* Return variables */
12641 /* Return result */
12643 *werror
= r
.out
.result
;
12646 return werror_to_ntstatus(r
.out
.result
);
12649 struct rpccli_spoolss_53_state
{
12650 struct spoolss_53 orig
;
12651 struct spoolss_53 tmp
;
12652 TALLOC_CTX
*out_mem_ctx
;
12653 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
12656 static void rpccli_spoolss_53_done(struct tevent_req
*subreq
);
12658 struct tevent_req
*rpccli_spoolss_53_send(TALLOC_CTX
*mem_ctx
,
12659 struct tevent_context
*ev
,
12660 struct rpc_pipe_client
*cli
)
12662 struct tevent_req
*req
;
12663 struct rpccli_spoolss_53_state
*state
;
12664 struct tevent_req
*subreq
;
12666 req
= tevent_req_create(mem_ctx
, &state
,
12667 struct rpccli_spoolss_53_state
);
12671 state
->out_mem_ctx
= NULL
;
12672 state
->dispatch_recv
= cli
->dispatch_recv
;
12674 /* In parameters */
12676 /* Out parameters */
12679 ZERO_STRUCT(state
->orig
.out
.result
);
12681 /* make a temporary copy, that we pass to the dispatch function */
12682 state
->tmp
= state
->orig
;
12684 subreq
= cli
->dispatch_send(state
, ev
, cli
,
12685 &ndr_table_spoolss
,
12688 if (tevent_req_nomem(subreq
, req
)) {
12689 return tevent_req_post(req
, ev
);
12691 tevent_req_set_callback(subreq
, rpccli_spoolss_53_done
, req
);
12695 static void rpccli_spoolss_53_done(struct tevent_req
*subreq
)
12697 struct tevent_req
*req
= tevent_req_callback_data(
12698 subreq
, struct tevent_req
);
12699 struct rpccli_spoolss_53_state
*state
= tevent_req_data(
12700 req
, struct rpccli_spoolss_53_state
);
12702 TALLOC_CTX
*mem_ctx
;
12704 if (state
->out_mem_ctx
) {
12705 mem_ctx
= state
->out_mem_ctx
;
12710 status
= state
->dispatch_recv(subreq
, mem_ctx
);
12711 TALLOC_FREE(subreq
);
12712 if (!NT_STATUS_IS_OK(status
)) {
12713 tevent_req_nterror(req
, status
);
12717 /* Copy out parameters */
12720 state
->orig
.out
.result
= state
->tmp
.out
.result
;
12722 /* Reset temporary structure */
12723 ZERO_STRUCT(state
->tmp
);
12725 tevent_req_done(req
);
12728 NTSTATUS
rpccli_spoolss_53_recv(struct tevent_req
*req
,
12729 TALLOC_CTX
*mem_ctx
,
12732 struct rpccli_spoolss_53_state
*state
= tevent_req_data(
12733 req
, struct rpccli_spoolss_53_state
);
12736 if (tevent_req_is_nterror(req
, &status
)) {
12737 tevent_req_received(req
);
12741 /* Steal possbile out parameters to the callers context */
12742 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
12744 /* Return result */
12745 *result
= state
->orig
.out
.result
;
12747 tevent_req_received(req
);
12748 return NT_STATUS_OK
;
12751 NTSTATUS
rpccli_spoolss_53(struct rpc_pipe_client
*cli
,
12752 TALLOC_CTX
*mem_ctx
,
12755 struct spoolss_53 r
;
12758 /* In parameters */
12760 status
= cli
->dispatch(cli
,
12762 &ndr_table_spoolss
,
12766 if (!NT_STATUS_IS_OK(status
)) {
12770 if (NT_STATUS_IS_ERR(status
)) {
12774 /* Return variables */
12776 /* Return result */
12778 *werror
= r
.out
.result
;
12781 return werror_to_ntstatus(r
.out
.result
);
12784 struct rpccli_spoolss_DeletePrinterDriverEx_state
{
12785 struct spoolss_DeletePrinterDriverEx orig
;
12786 struct spoolss_DeletePrinterDriverEx tmp
;
12787 TALLOC_CTX
*out_mem_ctx
;
12788 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
12791 static void rpccli_spoolss_DeletePrinterDriverEx_done(struct tevent_req
*subreq
);
12793 struct tevent_req
*rpccli_spoolss_DeletePrinterDriverEx_send(TALLOC_CTX
*mem_ctx
,
12794 struct tevent_context
*ev
,
12795 struct rpc_pipe_client
*cli
,
12796 const char *_server
/* [in] [unique,charset(UTF16)] */,
12797 const char *_architecture
/* [in] [charset(UTF16)] */,
12798 const char *_driver
/* [in] [charset(UTF16)] */,
12799 uint32_t _delete_flags
/* [in] */,
12800 uint32_t _version
/* [in] */)
12802 struct tevent_req
*req
;
12803 struct rpccli_spoolss_DeletePrinterDriverEx_state
*state
;
12804 struct tevent_req
*subreq
;
12806 req
= tevent_req_create(mem_ctx
, &state
,
12807 struct rpccli_spoolss_DeletePrinterDriverEx_state
);
12811 state
->out_mem_ctx
= NULL
;
12812 state
->dispatch_recv
= cli
->dispatch_recv
;
12814 /* In parameters */
12815 state
->orig
.in
.server
= _server
;
12816 state
->orig
.in
.architecture
= _architecture
;
12817 state
->orig
.in
.driver
= _driver
;
12818 state
->orig
.in
.delete_flags
= _delete_flags
;
12819 state
->orig
.in
.version
= _version
;
12821 /* Out parameters */
12824 ZERO_STRUCT(state
->orig
.out
.result
);
12826 /* make a temporary copy, that we pass to the dispatch function */
12827 state
->tmp
= state
->orig
;
12829 subreq
= cli
->dispatch_send(state
, ev
, cli
,
12830 &ndr_table_spoolss
,
12831 NDR_SPOOLSS_DELETEPRINTERDRIVEREX
,
12833 if (tevent_req_nomem(subreq
, req
)) {
12834 return tevent_req_post(req
, ev
);
12836 tevent_req_set_callback(subreq
, rpccli_spoolss_DeletePrinterDriverEx_done
, req
);
12840 static void rpccli_spoolss_DeletePrinterDriverEx_done(struct tevent_req
*subreq
)
12842 struct tevent_req
*req
= tevent_req_callback_data(
12843 subreq
, struct tevent_req
);
12844 struct rpccli_spoolss_DeletePrinterDriverEx_state
*state
= tevent_req_data(
12845 req
, struct rpccli_spoolss_DeletePrinterDriverEx_state
);
12847 TALLOC_CTX
*mem_ctx
;
12849 if (state
->out_mem_ctx
) {
12850 mem_ctx
= state
->out_mem_ctx
;
12855 status
= state
->dispatch_recv(subreq
, mem_ctx
);
12856 TALLOC_FREE(subreq
);
12857 if (!NT_STATUS_IS_OK(status
)) {
12858 tevent_req_nterror(req
, status
);
12862 /* Copy out parameters */
12865 state
->orig
.out
.result
= state
->tmp
.out
.result
;
12867 /* Reset temporary structure */
12868 ZERO_STRUCT(state
->tmp
);
12870 tevent_req_done(req
);
12873 NTSTATUS
rpccli_spoolss_DeletePrinterDriverEx_recv(struct tevent_req
*req
,
12874 TALLOC_CTX
*mem_ctx
,
12877 struct rpccli_spoolss_DeletePrinterDriverEx_state
*state
= tevent_req_data(
12878 req
, struct rpccli_spoolss_DeletePrinterDriverEx_state
);
12881 if (tevent_req_is_nterror(req
, &status
)) {
12882 tevent_req_received(req
);
12886 /* Steal possbile out parameters to the callers context */
12887 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
12889 /* Return result */
12890 *result
= state
->orig
.out
.result
;
12892 tevent_req_received(req
);
12893 return NT_STATUS_OK
;
12896 NTSTATUS
rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client
*cli
,
12897 TALLOC_CTX
*mem_ctx
,
12898 const char *server
/* [in] [unique,charset(UTF16)] */,
12899 const char *architecture
/* [in] [charset(UTF16)] */,
12900 const char *driver
/* [in] [charset(UTF16)] */,
12901 uint32_t delete_flags
/* [in] */,
12902 uint32_t version
/* [in] */,
12905 struct spoolss_DeletePrinterDriverEx r
;
12908 /* In parameters */
12909 r
.in
.server
= server
;
12910 r
.in
.architecture
= architecture
;
12911 r
.in
.driver
= driver
;
12912 r
.in
.delete_flags
= delete_flags
;
12913 r
.in
.version
= version
;
12915 status
= cli
->dispatch(cli
,
12917 &ndr_table_spoolss
,
12918 NDR_SPOOLSS_DELETEPRINTERDRIVEREX
,
12921 if (!NT_STATUS_IS_OK(status
)) {
12925 if (NT_STATUS_IS_ERR(status
)) {
12929 /* Return variables */
12931 /* Return result */
12933 *werror
= r
.out
.result
;
12936 return werror_to_ntstatus(r
.out
.result
);
12939 struct rpccli_spoolss_55_state
{
12940 struct spoolss_55 orig
;
12941 struct spoolss_55 tmp
;
12942 TALLOC_CTX
*out_mem_ctx
;
12943 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
12946 static void rpccli_spoolss_55_done(struct tevent_req
*subreq
);
12948 struct tevent_req
*rpccli_spoolss_55_send(TALLOC_CTX
*mem_ctx
,
12949 struct tevent_context
*ev
,
12950 struct rpc_pipe_client
*cli
)
12952 struct tevent_req
*req
;
12953 struct rpccli_spoolss_55_state
*state
;
12954 struct tevent_req
*subreq
;
12956 req
= tevent_req_create(mem_ctx
, &state
,
12957 struct rpccli_spoolss_55_state
);
12961 state
->out_mem_ctx
= NULL
;
12962 state
->dispatch_recv
= cli
->dispatch_recv
;
12964 /* In parameters */
12966 /* Out parameters */
12969 ZERO_STRUCT(state
->orig
.out
.result
);
12971 /* make a temporary copy, that we pass to the dispatch function */
12972 state
->tmp
= state
->orig
;
12974 subreq
= cli
->dispatch_send(state
, ev
, cli
,
12975 &ndr_table_spoolss
,
12978 if (tevent_req_nomem(subreq
, req
)) {
12979 return tevent_req_post(req
, ev
);
12981 tevent_req_set_callback(subreq
, rpccli_spoolss_55_done
, req
);
12985 static void rpccli_spoolss_55_done(struct tevent_req
*subreq
)
12987 struct tevent_req
*req
= tevent_req_callback_data(
12988 subreq
, struct tevent_req
);
12989 struct rpccli_spoolss_55_state
*state
= tevent_req_data(
12990 req
, struct rpccli_spoolss_55_state
);
12992 TALLOC_CTX
*mem_ctx
;
12994 if (state
->out_mem_ctx
) {
12995 mem_ctx
= state
->out_mem_ctx
;
13000 status
= state
->dispatch_recv(subreq
, mem_ctx
);
13001 TALLOC_FREE(subreq
);
13002 if (!NT_STATUS_IS_OK(status
)) {
13003 tevent_req_nterror(req
, status
);
13007 /* Copy out parameters */
13010 state
->orig
.out
.result
= state
->tmp
.out
.result
;
13012 /* Reset temporary structure */
13013 ZERO_STRUCT(state
->tmp
);
13015 tevent_req_done(req
);
13018 NTSTATUS
rpccli_spoolss_55_recv(struct tevent_req
*req
,
13019 TALLOC_CTX
*mem_ctx
,
13022 struct rpccli_spoolss_55_state
*state
= tevent_req_data(
13023 req
, struct rpccli_spoolss_55_state
);
13026 if (tevent_req_is_nterror(req
, &status
)) {
13027 tevent_req_received(req
);
13031 /* Steal possbile out parameters to the callers context */
13032 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
13034 /* Return result */
13035 *result
= state
->orig
.out
.result
;
13037 tevent_req_received(req
);
13038 return NT_STATUS_OK
;
13041 NTSTATUS
rpccli_spoolss_55(struct rpc_pipe_client
*cli
,
13042 TALLOC_CTX
*mem_ctx
,
13045 struct spoolss_55 r
;
13048 /* In parameters */
13050 status
= cli
->dispatch(cli
,
13052 &ndr_table_spoolss
,
13056 if (!NT_STATUS_IS_OK(status
)) {
13060 if (NT_STATUS_IS_ERR(status
)) {
13064 /* Return variables */
13066 /* Return result */
13068 *werror
= r
.out
.result
;
13071 return werror_to_ntstatus(r
.out
.result
);
13074 struct rpccli_spoolss_56_state
{
13075 struct spoolss_56 orig
;
13076 struct spoolss_56 tmp
;
13077 TALLOC_CTX
*out_mem_ctx
;
13078 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
13081 static void rpccli_spoolss_56_done(struct tevent_req
*subreq
);
13083 struct tevent_req
*rpccli_spoolss_56_send(TALLOC_CTX
*mem_ctx
,
13084 struct tevent_context
*ev
,
13085 struct rpc_pipe_client
*cli
)
13087 struct tevent_req
*req
;
13088 struct rpccli_spoolss_56_state
*state
;
13089 struct tevent_req
*subreq
;
13091 req
= tevent_req_create(mem_ctx
, &state
,
13092 struct rpccli_spoolss_56_state
);
13096 state
->out_mem_ctx
= NULL
;
13097 state
->dispatch_recv
= cli
->dispatch_recv
;
13099 /* In parameters */
13101 /* Out parameters */
13104 ZERO_STRUCT(state
->orig
.out
.result
);
13106 /* make a temporary copy, that we pass to the dispatch function */
13107 state
->tmp
= state
->orig
;
13109 subreq
= cli
->dispatch_send(state
, ev
, cli
,
13110 &ndr_table_spoolss
,
13113 if (tevent_req_nomem(subreq
, req
)) {
13114 return tevent_req_post(req
, ev
);
13116 tevent_req_set_callback(subreq
, rpccli_spoolss_56_done
, req
);
13120 static void rpccli_spoolss_56_done(struct tevent_req
*subreq
)
13122 struct tevent_req
*req
= tevent_req_callback_data(
13123 subreq
, struct tevent_req
);
13124 struct rpccli_spoolss_56_state
*state
= tevent_req_data(
13125 req
, struct rpccli_spoolss_56_state
);
13127 TALLOC_CTX
*mem_ctx
;
13129 if (state
->out_mem_ctx
) {
13130 mem_ctx
= state
->out_mem_ctx
;
13135 status
= state
->dispatch_recv(subreq
, mem_ctx
);
13136 TALLOC_FREE(subreq
);
13137 if (!NT_STATUS_IS_OK(status
)) {
13138 tevent_req_nterror(req
, status
);
13142 /* Copy out parameters */
13145 state
->orig
.out
.result
= state
->tmp
.out
.result
;
13147 /* Reset temporary structure */
13148 ZERO_STRUCT(state
->tmp
);
13150 tevent_req_done(req
);
13153 NTSTATUS
rpccli_spoolss_56_recv(struct tevent_req
*req
,
13154 TALLOC_CTX
*mem_ctx
,
13157 struct rpccli_spoolss_56_state
*state
= tevent_req_data(
13158 req
, struct rpccli_spoolss_56_state
);
13161 if (tevent_req_is_nterror(req
, &status
)) {
13162 tevent_req_received(req
);
13166 /* Steal possbile out parameters to the callers context */
13167 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
13169 /* Return result */
13170 *result
= state
->orig
.out
.result
;
13172 tevent_req_received(req
);
13173 return NT_STATUS_OK
;
13176 NTSTATUS
rpccli_spoolss_56(struct rpc_pipe_client
*cli
,
13177 TALLOC_CTX
*mem_ctx
,
13180 struct spoolss_56 r
;
13183 /* In parameters */
13185 status
= cli
->dispatch(cli
,
13187 &ndr_table_spoolss
,
13191 if (!NT_STATUS_IS_OK(status
)) {
13195 if (NT_STATUS_IS_ERR(status
)) {
13199 /* Return variables */
13201 /* Return result */
13203 *werror
= r
.out
.result
;
13206 return werror_to_ntstatus(r
.out
.result
);
13209 struct rpccli_spoolss_57_state
{
13210 struct spoolss_57 orig
;
13211 struct spoolss_57 tmp
;
13212 TALLOC_CTX
*out_mem_ctx
;
13213 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
13216 static void rpccli_spoolss_57_done(struct tevent_req
*subreq
);
13218 struct tevent_req
*rpccli_spoolss_57_send(TALLOC_CTX
*mem_ctx
,
13219 struct tevent_context
*ev
,
13220 struct rpc_pipe_client
*cli
)
13222 struct tevent_req
*req
;
13223 struct rpccli_spoolss_57_state
*state
;
13224 struct tevent_req
*subreq
;
13226 req
= tevent_req_create(mem_ctx
, &state
,
13227 struct rpccli_spoolss_57_state
);
13231 state
->out_mem_ctx
= NULL
;
13232 state
->dispatch_recv
= cli
->dispatch_recv
;
13234 /* In parameters */
13236 /* Out parameters */
13239 ZERO_STRUCT(state
->orig
.out
.result
);
13241 /* make a temporary copy, that we pass to the dispatch function */
13242 state
->tmp
= state
->orig
;
13244 subreq
= cli
->dispatch_send(state
, ev
, cli
,
13245 &ndr_table_spoolss
,
13248 if (tevent_req_nomem(subreq
, req
)) {
13249 return tevent_req_post(req
, ev
);
13251 tevent_req_set_callback(subreq
, rpccli_spoolss_57_done
, req
);
13255 static void rpccli_spoolss_57_done(struct tevent_req
*subreq
)
13257 struct tevent_req
*req
= tevent_req_callback_data(
13258 subreq
, struct tevent_req
);
13259 struct rpccli_spoolss_57_state
*state
= tevent_req_data(
13260 req
, struct rpccli_spoolss_57_state
);
13262 TALLOC_CTX
*mem_ctx
;
13264 if (state
->out_mem_ctx
) {
13265 mem_ctx
= state
->out_mem_ctx
;
13270 status
= state
->dispatch_recv(subreq
, mem_ctx
);
13271 TALLOC_FREE(subreq
);
13272 if (!NT_STATUS_IS_OK(status
)) {
13273 tevent_req_nterror(req
, status
);
13277 /* Copy out parameters */
13280 state
->orig
.out
.result
= state
->tmp
.out
.result
;
13282 /* Reset temporary structure */
13283 ZERO_STRUCT(state
->tmp
);
13285 tevent_req_done(req
);
13288 NTSTATUS
rpccli_spoolss_57_recv(struct tevent_req
*req
,
13289 TALLOC_CTX
*mem_ctx
,
13292 struct rpccli_spoolss_57_state
*state
= tevent_req_data(
13293 req
, struct rpccli_spoolss_57_state
);
13296 if (tevent_req_is_nterror(req
, &status
)) {
13297 tevent_req_received(req
);
13301 /* Steal possbile out parameters to the callers context */
13302 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
13304 /* Return result */
13305 *result
= state
->orig
.out
.result
;
13307 tevent_req_received(req
);
13308 return NT_STATUS_OK
;
13311 NTSTATUS
rpccli_spoolss_57(struct rpc_pipe_client
*cli
,
13312 TALLOC_CTX
*mem_ctx
,
13315 struct spoolss_57 r
;
13318 /* In parameters */
13320 status
= cli
->dispatch(cli
,
13322 &ndr_table_spoolss
,
13326 if (!NT_STATUS_IS_OK(status
)) {
13330 if (NT_STATUS_IS_ERR(status
)) {
13334 /* Return variables */
13336 /* Return result */
13338 *werror
= r
.out
.result
;
13341 return werror_to_ntstatus(r
.out
.result
);
13344 struct rpccli_spoolss_XcvData_state
{
13345 struct spoolss_XcvData orig
;
13346 struct spoolss_XcvData tmp
;
13347 TALLOC_CTX
*out_mem_ctx
;
13348 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
13351 static void rpccli_spoolss_XcvData_done(struct tevent_req
*subreq
);
13353 struct tevent_req
*rpccli_spoolss_XcvData_send(TALLOC_CTX
*mem_ctx
,
13354 struct tevent_context
*ev
,
13355 struct rpc_pipe_client
*cli
,
13356 struct policy_handle
*_handle
/* [in] [ref] */,
13357 const char *_function_name
/* [in] [charset(UTF16)] */,
13358 DATA_BLOB _in_data
/* [in] */,
13359 uint32_t __in_data_length
/* [in] [value(r->in.in_data.length)] */,
13360 uint8_t *_out_data
/* [out] [ref,size_is(out_data_size)] */,
13361 uint32_t _out_data_size
/* [in] */,
13362 uint32_t *_needed
/* [out] [ref] */,
13363 uint32_t *_status_code
/* [in,out] [ref] */)
13365 struct tevent_req
*req
;
13366 struct rpccli_spoolss_XcvData_state
*state
;
13367 struct tevent_req
*subreq
;
13369 req
= tevent_req_create(mem_ctx
, &state
,
13370 struct rpccli_spoolss_XcvData_state
);
13374 state
->out_mem_ctx
= NULL
;
13375 state
->dispatch_recv
= cli
->dispatch_recv
;
13377 /* In parameters */
13378 state
->orig
.in
.handle
= _handle
;
13379 state
->orig
.in
.function_name
= _function_name
;
13380 state
->orig
.in
.in_data
= _in_data
;
13381 state
->orig
.in
._in_data_length
= __in_data_length
;
13382 state
->orig
.in
.out_data_size
= _out_data_size
;
13383 state
->orig
.in
.status_code
= _status_code
;
13385 /* Out parameters */
13386 state
->orig
.out
.out_data
= _out_data
;
13387 state
->orig
.out
.needed
= _needed
;
13388 state
->orig
.out
.status_code
= _status_code
;
13391 ZERO_STRUCT(state
->orig
.out
.result
);
13393 state
->out_mem_ctx
= talloc_named_const(state
, 0,
13394 "rpccli_spoolss_XcvData_out_memory");
13395 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
13396 return tevent_req_post(req
, ev
);
13399 /* make a temporary copy, that we pass to the dispatch function */
13400 state
->tmp
= state
->orig
;
13402 subreq
= cli
->dispatch_send(state
, ev
, cli
,
13403 &ndr_table_spoolss
,
13404 NDR_SPOOLSS_XCVDATA
,
13406 if (tevent_req_nomem(subreq
, req
)) {
13407 return tevent_req_post(req
, ev
);
13409 tevent_req_set_callback(subreq
, rpccli_spoolss_XcvData_done
, req
);
13413 static void rpccli_spoolss_XcvData_done(struct tevent_req
*subreq
)
13415 struct tevent_req
*req
= tevent_req_callback_data(
13416 subreq
, struct tevent_req
);
13417 struct rpccli_spoolss_XcvData_state
*state
= tevent_req_data(
13418 req
, struct rpccli_spoolss_XcvData_state
);
13420 TALLOC_CTX
*mem_ctx
;
13422 if (state
->out_mem_ctx
) {
13423 mem_ctx
= state
->out_mem_ctx
;
13428 status
= state
->dispatch_recv(subreq
, mem_ctx
);
13429 TALLOC_FREE(subreq
);
13430 if (!NT_STATUS_IS_OK(status
)) {
13431 tevent_req_nterror(req
, status
);
13435 /* Copy out parameters */
13436 memcpy(state
->orig
.out
.out_data
, state
->tmp
.out
.out_data
, (state
->tmp
.in
.out_data_size
) * sizeof(*state
->orig
.out
.out_data
));
13437 *state
->orig
.out
.needed
= *state
->tmp
.out
.needed
;
13438 *state
->orig
.out
.status_code
= *state
->tmp
.out
.status_code
;
13441 state
->orig
.out
.result
= state
->tmp
.out
.result
;
13443 /* Reset temporary structure */
13444 ZERO_STRUCT(state
->tmp
);
13446 tevent_req_done(req
);
13449 NTSTATUS
rpccli_spoolss_XcvData_recv(struct tevent_req
*req
,
13450 TALLOC_CTX
*mem_ctx
,
13453 struct rpccli_spoolss_XcvData_state
*state
= tevent_req_data(
13454 req
, struct rpccli_spoolss_XcvData_state
);
13457 if (tevent_req_is_nterror(req
, &status
)) {
13458 tevent_req_received(req
);
13462 /* Steal possbile out parameters to the callers context */
13463 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
13465 /* Return result */
13466 *result
= state
->orig
.out
.result
;
13468 tevent_req_received(req
);
13469 return NT_STATUS_OK
;
13472 NTSTATUS
rpccli_spoolss_XcvData(struct rpc_pipe_client
*cli
,
13473 TALLOC_CTX
*mem_ctx
,
13474 struct policy_handle
*handle
/* [in] [ref] */,
13475 const char *function_name
/* [in] [charset(UTF16)] */,
13476 DATA_BLOB in_data
/* [in] */,
13477 uint32_t _in_data_length
/* [in] [value(r->in.in_data.length)] */,
13478 uint8_t *out_data
/* [out] [ref,size_is(out_data_size)] */,
13479 uint32_t out_data_size
/* [in] */,
13480 uint32_t *needed
/* [out] [ref] */,
13481 uint32_t *status_code
/* [in,out] [ref] */,
13484 struct spoolss_XcvData r
;
13487 /* In parameters */
13488 r
.in
.handle
= handle
;
13489 r
.in
.function_name
= function_name
;
13490 r
.in
.in_data
= in_data
;
13491 r
.in
._in_data_length
= _in_data_length
;
13492 r
.in
.out_data_size
= out_data_size
;
13493 r
.in
.status_code
= status_code
;
13495 status
= cli
->dispatch(cli
,
13497 &ndr_table_spoolss
,
13498 NDR_SPOOLSS_XCVDATA
,
13501 if (!NT_STATUS_IS_OK(status
)) {
13505 if (NT_STATUS_IS_ERR(status
)) {
13509 /* Return variables */
13510 memcpy(out_data
, r
.out
.out_data
, (r
.in
.out_data_size
) * sizeof(*out_data
));
13511 *needed
= *r
.out
.needed
;
13512 *status_code
= *r
.out
.status_code
;
13514 /* Return result */
13516 *werror
= r
.out
.result
;
13519 return werror_to_ntstatus(r
.out
.result
);
13522 struct rpccli_spoolss_AddPrinterDriverEx_state
{
13523 struct spoolss_AddPrinterDriverEx orig
;
13524 struct spoolss_AddPrinterDriverEx tmp
;
13525 TALLOC_CTX
*out_mem_ctx
;
13526 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
13529 static void rpccli_spoolss_AddPrinterDriverEx_done(struct tevent_req
*subreq
);
13531 struct tevent_req
*rpccli_spoolss_AddPrinterDriverEx_send(TALLOC_CTX
*mem_ctx
,
13532 struct tevent_context
*ev
,
13533 struct rpc_pipe_client
*cli
,
13534 const char *_servername
/* [in] [unique,charset(UTF16)] */,
13535 struct spoolss_AddDriverInfoCtr
*_info_ctr
/* [in] [ref] */,
13536 uint32_t _flags
/* [in] */)
13538 struct tevent_req
*req
;
13539 struct rpccli_spoolss_AddPrinterDriverEx_state
*state
;
13540 struct tevent_req
*subreq
;
13542 req
= tevent_req_create(mem_ctx
, &state
,
13543 struct rpccli_spoolss_AddPrinterDriverEx_state
);
13547 state
->out_mem_ctx
= NULL
;
13548 state
->dispatch_recv
= cli
->dispatch_recv
;
13550 /* In parameters */
13551 state
->orig
.in
.servername
= _servername
;
13552 state
->orig
.in
.info_ctr
= _info_ctr
;
13553 state
->orig
.in
.flags
= _flags
;
13555 /* Out parameters */
13558 ZERO_STRUCT(state
->orig
.out
.result
);
13560 /* make a temporary copy, that we pass to the dispatch function */
13561 state
->tmp
= state
->orig
;
13563 subreq
= cli
->dispatch_send(state
, ev
, cli
,
13564 &ndr_table_spoolss
,
13565 NDR_SPOOLSS_ADDPRINTERDRIVEREX
,
13567 if (tevent_req_nomem(subreq
, req
)) {
13568 return tevent_req_post(req
, ev
);
13570 tevent_req_set_callback(subreq
, rpccli_spoolss_AddPrinterDriverEx_done
, req
);
13574 static void rpccli_spoolss_AddPrinterDriverEx_done(struct tevent_req
*subreq
)
13576 struct tevent_req
*req
= tevent_req_callback_data(
13577 subreq
, struct tevent_req
);
13578 struct rpccli_spoolss_AddPrinterDriverEx_state
*state
= tevent_req_data(
13579 req
, struct rpccli_spoolss_AddPrinterDriverEx_state
);
13581 TALLOC_CTX
*mem_ctx
;
13583 if (state
->out_mem_ctx
) {
13584 mem_ctx
= state
->out_mem_ctx
;
13589 status
= state
->dispatch_recv(subreq
, mem_ctx
);
13590 TALLOC_FREE(subreq
);
13591 if (!NT_STATUS_IS_OK(status
)) {
13592 tevent_req_nterror(req
, status
);
13596 /* Copy out parameters */
13599 state
->orig
.out
.result
= state
->tmp
.out
.result
;
13601 /* Reset temporary structure */
13602 ZERO_STRUCT(state
->tmp
);
13604 tevent_req_done(req
);
13607 NTSTATUS
rpccli_spoolss_AddPrinterDriverEx_recv(struct tevent_req
*req
,
13608 TALLOC_CTX
*mem_ctx
,
13611 struct rpccli_spoolss_AddPrinterDriverEx_state
*state
= tevent_req_data(
13612 req
, struct rpccli_spoolss_AddPrinterDriverEx_state
);
13615 if (tevent_req_is_nterror(req
, &status
)) {
13616 tevent_req_received(req
);
13620 /* Steal possbile out parameters to the callers context */
13621 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
13623 /* Return result */
13624 *result
= state
->orig
.out
.result
;
13626 tevent_req_received(req
);
13627 return NT_STATUS_OK
;
13630 NTSTATUS
rpccli_spoolss_AddPrinterDriverEx(struct rpc_pipe_client
*cli
,
13631 TALLOC_CTX
*mem_ctx
,
13632 const char *servername
/* [in] [unique,charset(UTF16)] */,
13633 struct spoolss_AddDriverInfoCtr
*info_ctr
/* [in] [ref] */,
13634 uint32_t flags
/* [in] */,
13637 struct spoolss_AddPrinterDriverEx r
;
13640 /* In parameters */
13641 r
.in
.servername
= servername
;
13642 r
.in
.info_ctr
= info_ctr
;
13643 r
.in
.flags
= flags
;
13645 status
= cli
->dispatch(cli
,
13647 &ndr_table_spoolss
,
13648 NDR_SPOOLSS_ADDPRINTERDRIVEREX
,
13651 if (!NT_STATUS_IS_OK(status
)) {
13655 if (NT_STATUS_IS_ERR(status
)) {
13659 /* Return variables */
13661 /* Return result */
13663 *werror
= r
.out
.result
;
13666 return werror_to_ntstatus(r
.out
.result
);
13669 struct rpccli_spoolss_5a_state
{
13670 struct spoolss_5a orig
;
13671 struct spoolss_5a tmp
;
13672 TALLOC_CTX
*out_mem_ctx
;
13673 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
13676 static void rpccli_spoolss_5a_done(struct tevent_req
*subreq
);
13678 struct tevent_req
*rpccli_spoolss_5a_send(TALLOC_CTX
*mem_ctx
,
13679 struct tevent_context
*ev
,
13680 struct rpc_pipe_client
*cli
)
13682 struct tevent_req
*req
;
13683 struct rpccli_spoolss_5a_state
*state
;
13684 struct tevent_req
*subreq
;
13686 req
= tevent_req_create(mem_ctx
, &state
,
13687 struct rpccli_spoolss_5a_state
);
13691 state
->out_mem_ctx
= NULL
;
13692 state
->dispatch_recv
= cli
->dispatch_recv
;
13694 /* In parameters */
13696 /* Out parameters */
13699 ZERO_STRUCT(state
->orig
.out
.result
);
13701 /* make a temporary copy, that we pass to the dispatch function */
13702 state
->tmp
= state
->orig
;
13704 subreq
= cli
->dispatch_send(state
, ev
, cli
,
13705 &ndr_table_spoolss
,
13708 if (tevent_req_nomem(subreq
, req
)) {
13709 return tevent_req_post(req
, ev
);
13711 tevent_req_set_callback(subreq
, rpccli_spoolss_5a_done
, req
);
13715 static void rpccli_spoolss_5a_done(struct tevent_req
*subreq
)
13717 struct tevent_req
*req
= tevent_req_callback_data(
13718 subreq
, struct tevent_req
);
13719 struct rpccli_spoolss_5a_state
*state
= tevent_req_data(
13720 req
, struct rpccli_spoolss_5a_state
);
13722 TALLOC_CTX
*mem_ctx
;
13724 if (state
->out_mem_ctx
) {
13725 mem_ctx
= state
->out_mem_ctx
;
13730 status
= state
->dispatch_recv(subreq
, mem_ctx
);
13731 TALLOC_FREE(subreq
);
13732 if (!NT_STATUS_IS_OK(status
)) {
13733 tevent_req_nterror(req
, status
);
13737 /* Copy out parameters */
13740 state
->orig
.out
.result
= state
->tmp
.out
.result
;
13742 /* Reset temporary structure */
13743 ZERO_STRUCT(state
->tmp
);
13745 tevent_req_done(req
);
13748 NTSTATUS
rpccli_spoolss_5a_recv(struct tevent_req
*req
,
13749 TALLOC_CTX
*mem_ctx
,
13752 struct rpccli_spoolss_5a_state
*state
= tevent_req_data(
13753 req
, struct rpccli_spoolss_5a_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_5a(struct rpc_pipe_client
*cli
,
13772 TALLOC_CTX
*mem_ctx
,
13775 struct spoolss_5a r
;
13778 /* In parameters */
13780 status
= cli
->dispatch(cli
,
13782 &ndr_table_spoolss
,
13786 if (!NT_STATUS_IS_OK(status
)) {
13790 if (NT_STATUS_IS_ERR(status
)) {
13794 /* Return variables */
13796 /* Return result */
13798 *werror
= r
.out
.result
;
13801 return werror_to_ntstatus(r
.out
.result
);
13804 struct rpccli_spoolss_5b_state
{
13805 struct spoolss_5b orig
;
13806 struct spoolss_5b tmp
;
13807 TALLOC_CTX
*out_mem_ctx
;
13808 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
13811 static void rpccli_spoolss_5b_done(struct tevent_req
*subreq
);
13813 struct tevent_req
*rpccli_spoolss_5b_send(TALLOC_CTX
*mem_ctx
,
13814 struct tevent_context
*ev
,
13815 struct rpc_pipe_client
*cli
)
13817 struct tevent_req
*req
;
13818 struct rpccli_spoolss_5b_state
*state
;
13819 struct tevent_req
*subreq
;
13821 req
= tevent_req_create(mem_ctx
, &state
,
13822 struct rpccli_spoolss_5b_state
);
13826 state
->out_mem_ctx
= NULL
;
13827 state
->dispatch_recv
= cli
->dispatch_recv
;
13829 /* In parameters */
13831 /* Out parameters */
13834 ZERO_STRUCT(state
->orig
.out
.result
);
13836 /* make a temporary copy, that we pass to the dispatch function */
13837 state
->tmp
= state
->orig
;
13839 subreq
= cli
->dispatch_send(state
, ev
, cli
,
13840 &ndr_table_spoolss
,
13843 if (tevent_req_nomem(subreq
, req
)) {
13844 return tevent_req_post(req
, ev
);
13846 tevent_req_set_callback(subreq
, rpccli_spoolss_5b_done
, req
);
13850 static void rpccli_spoolss_5b_done(struct tevent_req
*subreq
)
13852 struct tevent_req
*req
= tevent_req_callback_data(
13853 subreq
, struct tevent_req
);
13854 struct rpccli_spoolss_5b_state
*state
= tevent_req_data(
13855 req
, struct rpccli_spoolss_5b_state
);
13857 TALLOC_CTX
*mem_ctx
;
13859 if (state
->out_mem_ctx
) {
13860 mem_ctx
= state
->out_mem_ctx
;
13865 status
= state
->dispatch_recv(subreq
, mem_ctx
);
13866 TALLOC_FREE(subreq
);
13867 if (!NT_STATUS_IS_OK(status
)) {
13868 tevent_req_nterror(req
, status
);
13872 /* Copy out parameters */
13875 state
->orig
.out
.result
= state
->tmp
.out
.result
;
13877 /* Reset temporary structure */
13878 ZERO_STRUCT(state
->tmp
);
13880 tevent_req_done(req
);
13883 NTSTATUS
rpccli_spoolss_5b_recv(struct tevent_req
*req
,
13884 TALLOC_CTX
*mem_ctx
,
13887 struct rpccli_spoolss_5b_state
*state
= tevent_req_data(
13888 req
, struct rpccli_spoolss_5b_state
);
13891 if (tevent_req_is_nterror(req
, &status
)) {
13892 tevent_req_received(req
);
13896 /* Steal possbile out parameters to the callers context */
13897 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
13899 /* Return result */
13900 *result
= state
->orig
.out
.result
;
13902 tevent_req_received(req
);
13903 return NT_STATUS_OK
;
13906 NTSTATUS
rpccli_spoolss_5b(struct rpc_pipe_client
*cli
,
13907 TALLOC_CTX
*mem_ctx
,
13910 struct spoolss_5b r
;
13913 /* In parameters */
13915 status
= cli
->dispatch(cli
,
13917 &ndr_table_spoolss
,
13921 if (!NT_STATUS_IS_OK(status
)) {
13925 if (NT_STATUS_IS_ERR(status
)) {
13929 /* Return variables */
13931 /* Return result */
13933 *werror
= r
.out
.result
;
13936 return werror_to_ntstatus(r
.out
.result
);
13939 struct rpccli_spoolss_5c_state
{
13940 struct spoolss_5c orig
;
13941 struct spoolss_5c tmp
;
13942 TALLOC_CTX
*out_mem_ctx
;
13943 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
13946 static void rpccli_spoolss_5c_done(struct tevent_req
*subreq
);
13948 struct tevent_req
*rpccli_spoolss_5c_send(TALLOC_CTX
*mem_ctx
,
13949 struct tevent_context
*ev
,
13950 struct rpc_pipe_client
*cli
)
13952 struct tevent_req
*req
;
13953 struct rpccli_spoolss_5c_state
*state
;
13954 struct tevent_req
*subreq
;
13956 req
= tevent_req_create(mem_ctx
, &state
,
13957 struct rpccli_spoolss_5c_state
);
13961 state
->out_mem_ctx
= NULL
;
13962 state
->dispatch_recv
= cli
->dispatch_recv
;
13964 /* In parameters */
13966 /* Out parameters */
13969 ZERO_STRUCT(state
->orig
.out
.result
);
13971 /* make a temporary copy, that we pass to the dispatch function */
13972 state
->tmp
= state
->orig
;
13974 subreq
= cli
->dispatch_send(state
, ev
, cli
,
13975 &ndr_table_spoolss
,
13978 if (tevent_req_nomem(subreq
, req
)) {
13979 return tevent_req_post(req
, ev
);
13981 tevent_req_set_callback(subreq
, rpccli_spoolss_5c_done
, req
);
13985 static void rpccli_spoolss_5c_done(struct tevent_req
*subreq
)
13987 struct tevent_req
*req
= tevent_req_callback_data(
13988 subreq
, struct tevent_req
);
13989 struct rpccli_spoolss_5c_state
*state
= tevent_req_data(
13990 req
, struct rpccli_spoolss_5c_state
);
13992 TALLOC_CTX
*mem_ctx
;
13994 if (state
->out_mem_ctx
) {
13995 mem_ctx
= state
->out_mem_ctx
;
14000 status
= state
->dispatch_recv(subreq
, mem_ctx
);
14001 TALLOC_FREE(subreq
);
14002 if (!NT_STATUS_IS_OK(status
)) {
14003 tevent_req_nterror(req
, status
);
14007 /* Copy out parameters */
14010 state
->orig
.out
.result
= state
->tmp
.out
.result
;
14012 /* Reset temporary structure */
14013 ZERO_STRUCT(state
->tmp
);
14015 tevent_req_done(req
);
14018 NTSTATUS
rpccli_spoolss_5c_recv(struct tevent_req
*req
,
14019 TALLOC_CTX
*mem_ctx
,
14022 struct rpccli_spoolss_5c_state
*state
= tevent_req_data(
14023 req
, struct rpccli_spoolss_5c_state
);
14026 if (tevent_req_is_nterror(req
, &status
)) {
14027 tevent_req_received(req
);
14031 /* Steal possbile out parameters to the callers context */
14032 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
14034 /* Return result */
14035 *result
= state
->orig
.out
.result
;
14037 tevent_req_received(req
);
14038 return NT_STATUS_OK
;
14041 NTSTATUS
rpccli_spoolss_5c(struct rpc_pipe_client
*cli
,
14042 TALLOC_CTX
*mem_ctx
,
14045 struct spoolss_5c r
;
14048 /* In parameters */
14050 status
= cli
->dispatch(cli
,
14052 &ndr_table_spoolss
,
14056 if (!NT_STATUS_IS_OK(status
)) {
14060 if (NT_STATUS_IS_ERR(status
)) {
14064 /* Return variables */
14066 /* Return result */
14068 *werror
= r
.out
.result
;
14071 return werror_to_ntstatus(r
.out
.result
);
14074 struct rpccli_spoolss_5d_state
{
14075 struct spoolss_5d orig
;
14076 struct spoolss_5d tmp
;
14077 TALLOC_CTX
*out_mem_ctx
;
14078 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
14081 static void rpccli_spoolss_5d_done(struct tevent_req
*subreq
);
14083 struct tevent_req
*rpccli_spoolss_5d_send(TALLOC_CTX
*mem_ctx
,
14084 struct tevent_context
*ev
,
14085 struct rpc_pipe_client
*cli
)
14087 struct tevent_req
*req
;
14088 struct rpccli_spoolss_5d_state
*state
;
14089 struct tevent_req
*subreq
;
14091 req
= tevent_req_create(mem_ctx
, &state
,
14092 struct rpccli_spoolss_5d_state
);
14096 state
->out_mem_ctx
= NULL
;
14097 state
->dispatch_recv
= cli
->dispatch_recv
;
14099 /* In parameters */
14101 /* Out parameters */
14104 ZERO_STRUCT(state
->orig
.out
.result
);
14106 /* make a temporary copy, that we pass to the dispatch function */
14107 state
->tmp
= state
->orig
;
14109 subreq
= cli
->dispatch_send(state
, ev
, cli
,
14110 &ndr_table_spoolss
,
14113 if (tevent_req_nomem(subreq
, req
)) {
14114 return tevent_req_post(req
, ev
);
14116 tevent_req_set_callback(subreq
, rpccli_spoolss_5d_done
, req
);
14120 static void rpccli_spoolss_5d_done(struct tevent_req
*subreq
)
14122 struct tevent_req
*req
= tevent_req_callback_data(
14123 subreq
, struct tevent_req
);
14124 struct rpccli_spoolss_5d_state
*state
= tevent_req_data(
14125 req
, struct rpccli_spoolss_5d_state
);
14127 TALLOC_CTX
*mem_ctx
;
14129 if (state
->out_mem_ctx
) {
14130 mem_ctx
= state
->out_mem_ctx
;
14135 status
= state
->dispatch_recv(subreq
, mem_ctx
);
14136 TALLOC_FREE(subreq
);
14137 if (!NT_STATUS_IS_OK(status
)) {
14138 tevent_req_nterror(req
, status
);
14142 /* Copy out parameters */
14145 state
->orig
.out
.result
= state
->tmp
.out
.result
;
14147 /* Reset temporary structure */
14148 ZERO_STRUCT(state
->tmp
);
14150 tevent_req_done(req
);
14153 NTSTATUS
rpccli_spoolss_5d_recv(struct tevent_req
*req
,
14154 TALLOC_CTX
*mem_ctx
,
14157 struct rpccli_spoolss_5d_state
*state
= tevent_req_data(
14158 req
, struct rpccli_spoolss_5d_state
);
14161 if (tevent_req_is_nterror(req
, &status
)) {
14162 tevent_req_received(req
);
14166 /* Steal possbile out parameters to the callers context */
14167 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
14169 /* Return result */
14170 *result
= state
->orig
.out
.result
;
14172 tevent_req_received(req
);
14173 return NT_STATUS_OK
;
14176 NTSTATUS
rpccli_spoolss_5d(struct rpc_pipe_client
*cli
,
14177 TALLOC_CTX
*mem_ctx
,
14180 struct spoolss_5d r
;
14183 /* In parameters */
14185 status
= cli
->dispatch(cli
,
14187 &ndr_table_spoolss
,
14191 if (!NT_STATUS_IS_OK(status
)) {
14195 if (NT_STATUS_IS_ERR(status
)) {
14199 /* Return variables */
14201 /* Return result */
14203 *werror
= r
.out
.result
;
14206 return werror_to_ntstatus(r
.out
.result
);
14209 struct rpccli_spoolss_5e_state
{
14210 struct spoolss_5e orig
;
14211 struct spoolss_5e tmp
;
14212 TALLOC_CTX
*out_mem_ctx
;
14213 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
14216 static void rpccli_spoolss_5e_done(struct tevent_req
*subreq
);
14218 struct tevent_req
*rpccli_spoolss_5e_send(TALLOC_CTX
*mem_ctx
,
14219 struct tevent_context
*ev
,
14220 struct rpc_pipe_client
*cli
)
14222 struct tevent_req
*req
;
14223 struct rpccli_spoolss_5e_state
*state
;
14224 struct tevent_req
*subreq
;
14226 req
= tevent_req_create(mem_ctx
, &state
,
14227 struct rpccli_spoolss_5e_state
);
14231 state
->out_mem_ctx
= NULL
;
14232 state
->dispatch_recv
= cli
->dispatch_recv
;
14234 /* In parameters */
14236 /* Out parameters */
14239 ZERO_STRUCT(state
->orig
.out
.result
);
14241 /* make a temporary copy, that we pass to the dispatch function */
14242 state
->tmp
= state
->orig
;
14244 subreq
= cli
->dispatch_send(state
, ev
, cli
,
14245 &ndr_table_spoolss
,
14248 if (tevent_req_nomem(subreq
, req
)) {
14249 return tevent_req_post(req
, ev
);
14251 tevent_req_set_callback(subreq
, rpccli_spoolss_5e_done
, req
);
14255 static void rpccli_spoolss_5e_done(struct tevent_req
*subreq
)
14257 struct tevent_req
*req
= tevent_req_callback_data(
14258 subreq
, struct tevent_req
);
14259 struct rpccli_spoolss_5e_state
*state
= tevent_req_data(
14260 req
, struct rpccli_spoolss_5e_state
);
14262 TALLOC_CTX
*mem_ctx
;
14264 if (state
->out_mem_ctx
) {
14265 mem_ctx
= state
->out_mem_ctx
;
14270 status
= state
->dispatch_recv(subreq
, mem_ctx
);
14271 TALLOC_FREE(subreq
);
14272 if (!NT_STATUS_IS_OK(status
)) {
14273 tevent_req_nterror(req
, status
);
14277 /* Copy out parameters */
14280 state
->orig
.out
.result
= state
->tmp
.out
.result
;
14282 /* Reset temporary structure */
14283 ZERO_STRUCT(state
->tmp
);
14285 tevent_req_done(req
);
14288 NTSTATUS
rpccli_spoolss_5e_recv(struct tevent_req
*req
,
14289 TALLOC_CTX
*mem_ctx
,
14292 struct rpccli_spoolss_5e_state
*state
= tevent_req_data(
14293 req
, struct rpccli_spoolss_5e_state
);
14296 if (tevent_req_is_nterror(req
, &status
)) {
14297 tevent_req_received(req
);
14301 /* Steal possbile out parameters to the callers context */
14302 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
14304 /* Return result */
14305 *result
= state
->orig
.out
.result
;
14307 tevent_req_received(req
);
14308 return NT_STATUS_OK
;
14311 NTSTATUS
rpccli_spoolss_5e(struct rpc_pipe_client
*cli
,
14312 TALLOC_CTX
*mem_ctx
,
14315 struct spoolss_5e r
;
14318 /* In parameters */
14320 status
= cli
->dispatch(cli
,
14322 &ndr_table_spoolss
,
14326 if (!NT_STATUS_IS_OK(status
)) {
14330 if (NT_STATUS_IS_ERR(status
)) {
14334 /* Return variables */
14336 /* Return result */
14338 *werror
= r
.out
.result
;
14341 return werror_to_ntstatus(r
.out
.result
);
14344 struct rpccli_spoolss_5f_state
{
14345 struct spoolss_5f orig
;
14346 struct spoolss_5f tmp
;
14347 TALLOC_CTX
*out_mem_ctx
;
14348 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
14351 static void rpccli_spoolss_5f_done(struct tevent_req
*subreq
);
14353 struct tevent_req
*rpccli_spoolss_5f_send(TALLOC_CTX
*mem_ctx
,
14354 struct tevent_context
*ev
,
14355 struct rpc_pipe_client
*cli
)
14357 struct tevent_req
*req
;
14358 struct rpccli_spoolss_5f_state
*state
;
14359 struct tevent_req
*subreq
;
14361 req
= tevent_req_create(mem_ctx
, &state
,
14362 struct rpccli_spoolss_5f_state
);
14366 state
->out_mem_ctx
= NULL
;
14367 state
->dispatch_recv
= cli
->dispatch_recv
;
14369 /* In parameters */
14371 /* Out parameters */
14374 ZERO_STRUCT(state
->orig
.out
.result
);
14376 /* make a temporary copy, that we pass to the dispatch function */
14377 state
->tmp
= state
->orig
;
14379 subreq
= cli
->dispatch_send(state
, ev
, cli
,
14380 &ndr_table_spoolss
,
14383 if (tevent_req_nomem(subreq
, req
)) {
14384 return tevent_req_post(req
, ev
);
14386 tevent_req_set_callback(subreq
, rpccli_spoolss_5f_done
, req
);
14390 static void rpccli_spoolss_5f_done(struct tevent_req
*subreq
)
14392 struct tevent_req
*req
= tevent_req_callback_data(
14393 subreq
, struct tevent_req
);
14394 struct rpccli_spoolss_5f_state
*state
= tevent_req_data(
14395 req
, struct rpccli_spoolss_5f_state
);
14397 TALLOC_CTX
*mem_ctx
;
14399 if (state
->out_mem_ctx
) {
14400 mem_ctx
= state
->out_mem_ctx
;
14405 status
= state
->dispatch_recv(subreq
, mem_ctx
);
14406 TALLOC_FREE(subreq
);
14407 if (!NT_STATUS_IS_OK(status
)) {
14408 tevent_req_nterror(req
, status
);
14412 /* Copy out parameters */
14415 state
->orig
.out
.result
= state
->tmp
.out
.result
;
14417 /* Reset temporary structure */
14418 ZERO_STRUCT(state
->tmp
);
14420 tevent_req_done(req
);
14423 NTSTATUS
rpccli_spoolss_5f_recv(struct tevent_req
*req
,
14424 TALLOC_CTX
*mem_ctx
,
14427 struct rpccli_spoolss_5f_state
*state
= tevent_req_data(
14428 req
, struct rpccli_spoolss_5f_state
);
14431 if (tevent_req_is_nterror(req
, &status
)) {
14432 tevent_req_received(req
);
14436 /* Steal possbile out parameters to the callers context */
14437 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
14439 /* Return result */
14440 *result
= state
->orig
.out
.result
;
14442 tevent_req_received(req
);
14443 return NT_STATUS_OK
;
14446 NTSTATUS
rpccli_spoolss_5f(struct rpc_pipe_client
*cli
,
14447 TALLOC_CTX
*mem_ctx
,
14450 struct spoolss_5f r
;
14453 /* In parameters */
14455 status
= cli
->dispatch(cli
,
14457 &ndr_table_spoolss
,
14461 if (!NT_STATUS_IS_OK(status
)) {
14465 if (NT_STATUS_IS_ERR(status
)) {
14469 /* Return variables */
14471 /* Return result */
14473 *werror
= r
.out
.result
;
14476 return werror_to_ntstatus(r
.out
.result
);
14479 struct rpccli_spoolss_60_state
{
14480 struct spoolss_60 orig
;
14481 struct spoolss_60 tmp
;
14482 TALLOC_CTX
*out_mem_ctx
;
14483 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
14486 static void rpccli_spoolss_60_done(struct tevent_req
*subreq
);
14488 struct tevent_req
*rpccli_spoolss_60_send(TALLOC_CTX
*mem_ctx
,
14489 struct tevent_context
*ev
,
14490 struct rpc_pipe_client
*cli
)
14492 struct tevent_req
*req
;
14493 struct rpccli_spoolss_60_state
*state
;
14494 struct tevent_req
*subreq
;
14496 req
= tevent_req_create(mem_ctx
, &state
,
14497 struct rpccli_spoolss_60_state
);
14501 state
->out_mem_ctx
= NULL
;
14502 state
->dispatch_recv
= cli
->dispatch_recv
;
14504 /* In parameters */
14506 /* Out parameters */
14509 ZERO_STRUCT(state
->orig
.out
.result
);
14511 /* make a temporary copy, that we pass to the dispatch function */
14512 state
->tmp
= state
->orig
;
14514 subreq
= cli
->dispatch_send(state
, ev
, cli
,
14515 &ndr_table_spoolss
,
14518 if (tevent_req_nomem(subreq
, req
)) {
14519 return tevent_req_post(req
, ev
);
14521 tevent_req_set_callback(subreq
, rpccli_spoolss_60_done
, req
);
14525 static void rpccli_spoolss_60_done(struct tevent_req
*subreq
)
14527 struct tevent_req
*req
= tevent_req_callback_data(
14528 subreq
, struct tevent_req
);
14529 struct rpccli_spoolss_60_state
*state
= tevent_req_data(
14530 req
, struct rpccli_spoolss_60_state
);
14532 TALLOC_CTX
*mem_ctx
;
14534 if (state
->out_mem_ctx
) {
14535 mem_ctx
= state
->out_mem_ctx
;
14540 status
= state
->dispatch_recv(subreq
, mem_ctx
);
14541 TALLOC_FREE(subreq
);
14542 if (!NT_STATUS_IS_OK(status
)) {
14543 tevent_req_nterror(req
, status
);
14547 /* Copy out parameters */
14550 state
->orig
.out
.result
= state
->tmp
.out
.result
;
14552 /* Reset temporary structure */
14553 ZERO_STRUCT(state
->tmp
);
14555 tevent_req_done(req
);
14558 NTSTATUS
rpccli_spoolss_60_recv(struct tevent_req
*req
,
14559 TALLOC_CTX
*mem_ctx
,
14562 struct rpccli_spoolss_60_state
*state
= tevent_req_data(
14563 req
, struct rpccli_spoolss_60_state
);
14566 if (tevent_req_is_nterror(req
, &status
)) {
14567 tevent_req_received(req
);
14571 /* Steal possbile out parameters to the callers context */
14572 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
14574 /* Return result */
14575 *result
= state
->orig
.out
.result
;
14577 tevent_req_received(req
);
14578 return NT_STATUS_OK
;
14581 NTSTATUS
rpccli_spoolss_60(struct rpc_pipe_client
*cli
,
14582 TALLOC_CTX
*mem_ctx
,
14585 struct spoolss_60 r
;
14588 /* In parameters */
14590 status
= cli
->dispatch(cli
,
14592 &ndr_table_spoolss
,
14596 if (!NT_STATUS_IS_OK(status
)) {
14600 if (NT_STATUS_IS_ERR(status
)) {
14604 /* Return variables */
14606 /* Return result */
14608 *werror
= r
.out
.result
;
14611 return werror_to_ntstatus(r
.out
.result
);
14614 struct rpccli_spoolss_61_state
{
14615 struct spoolss_61 orig
;
14616 struct spoolss_61 tmp
;
14617 TALLOC_CTX
*out_mem_ctx
;
14618 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
14621 static void rpccli_spoolss_61_done(struct tevent_req
*subreq
);
14623 struct tevent_req
*rpccli_spoolss_61_send(TALLOC_CTX
*mem_ctx
,
14624 struct tevent_context
*ev
,
14625 struct rpc_pipe_client
*cli
)
14627 struct tevent_req
*req
;
14628 struct rpccli_spoolss_61_state
*state
;
14629 struct tevent_req
*subreq
;
14631 req
= tevent_req_create(mem_ctx
, &state
,
14632 struct rpccli_spoolss_61_state
);
14636 state
->out_mem_ctx
= NULL
;
14637 state
->dispatch_recv
= cli
->dispatch_recv
;
14639 /* In parameters */
14641 /* Out parameters */
14644 ZERO_STRUCT(state
->orig
.out
.result
);
14646 /* make a temporary copy, that we pass to the dispatch function */
14647 state
->tmp
= state
->orig
;
14649 subreq
= cli
->dispatch_send(state
, ev
, cli
,
14650 &ndr_table_spoolss
,
14653 if (tevent_req_nomem(subreq
, req
)) {
14654 return tevent_req_post(req
, ev
);
14656 tevent_req_set_callback(subreq
, rpccli_spoolss_61_done
, req
);
14660 static void rpccli_spoolss_61_done(struct tevent_req
*subreq
)
14662 struct tevent_req
*req
= tevent_req_callback_data(
14663 subreq
, struct tevent_req
);
14664 struct rpccli_spoolss_61_state
*state
= tevent_req_data(
14665 req
, struct rpccli_spoolss_61_state
);
14667 TALLOC_CTX
*mem_ctx
;
14669 if (state
->out_mem_ctx
) {
14670 mem_ctx
= state
->out_mem_ctx
;
14675 status
= state
->dispatch_recv(subreq
, mem_ctx
);
14676 TALLOC_FREE(subreq
);
14677 if (!NT_STATUS_IS_OK(status
)) {
14678 tevent_req_nterror(req
, status
);
14682 /* Copy out parameters */
14685 state
->orig
.out
.result
= state
->tmp
.out
.result
;
14687 /* Reset temporary structure */
14688 ZERO_STRUCT(state
->tmp
);
14690 tevent_req_done(req
);
14693 NTSTATUS
rpccli_spoolss_61_recv(struct tevent_req
*req
,
14694 TALLOC_CTX
*mem_ctx
,
14697 struct rpccli_spoolss_61_state
*state
= tevent_req_data(
14698 req
, struct rpccli_spoolss_61_state
);
14701 if (tevent_req_is_nterror(req
, &status
)) {
14702 tevent_req_received(req
);
14706 /* Steal possbile out parameters to the callers context */
14707 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
14709 /* Return result */
14710 *result
= state
->orig
.out
.result
;
14712 tevent_req_received(req
);
14713 return NT_STATUS_OK
;
14716 NTSTATUS
rpccli_spoolss_61(struct rpc_pipe_client
*cli
,
14717 TALLOC_CTX
*mem_ctx
,
14720 struct spoolss_61 r
;
14723 /* In parameters */
14725 status
= cli
->dispatch(cli
,
14727 &ndr_table_spoolss
,
14731 if (!NT_STATUS_IS_OK(status
)) {
14735 if (NT_STATUS_IS_ERR(status
)) {
14739 /* Return variables */
14741 /* Return result */
14743 *werror
= r
.out
.result
;
14746 return werror_to_ntstatus(r
.out
.result
);
14749 struct rpccli_spoolss_62_state
{
14750 struct spoolss_62 orig
;
14751 struct spoolss_62 tmp
;
14752 TALLOC_CTX
*out_mem_ctx
;
14753 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
14756 static void rpccli_spoolss_62_done(struct tevent_req
*subreq
);
14758 struct tevent_req
*rpccli_spoolss_62_send(TALLOC_CTX
*mem_ctx
,
14759 struct tevent_context
*ev
,
14760 struct rpc_pipe_client
*cli
)
14762 struct tevent_req
*req
;
14763 struct rpccli_spoolss_62_state
*state
;
14764 struct tevent_req
*subreq
;
14766 req
= tevent_req_create(mem_ctx
, &state
,
14767 struct rpccli_spoolss_62_state
);
14771 state
->out_mem_ctx
= NULL
;
14772 state
->dispatch_recv
= cli
->dispatch_recv
;
14774 /* In parameters */
14776 /* Out parameters */
14779 ZERO_STRUCT(state
->orig
.out
.result
);
14781 /* make a temporary copy, that we pass to the dispatch function */
14782 state
->tmp
= state
->orig
;
14784 subreq
= cli
->dispatch_send(state
, ev
, cli
,
14785 &ndr_table_spoolss
,
14788 if (tevent_req_nomem(subreq
, req
)) {
14789 return tevent_req_post(req
, ev
);
14791 tevent_req_set_callback(subreq
, rpccli_spoolss_62_done
, req
);
14795 static void rpccli_spoolss_62_done(struct tevent_req
*subreq
)
14797 struct tevent_req
*req
= tevent_req_callback_data(
14798 subreq
, struct tevent_req
);
14799 struct rpccli_spoolss_62_state
*state
= tevent_req_data(
14800 req
, struct rpccli_spoolss_62_state
);
14802 TALLOC_CTX
*mem_ctx
;
14804 if (state
->out_mem_ctx
) {
14805 mem_ctx
= state
->out_mem_ctx
;
14810 status
= state
->dispatch_recv(subreq
, mem_ctx
);
14811 TALLOC_FREE(subreq
);
14812 if (!NT_STATUS_IS_OK(status
)) {
14813 tevent_req_nterror(req
, status
);
14817 /* Copy out parameters */
14820 state
->orig
.out
.result
= state
->tmp
.out
.result
;
14822 /* Reset temporary structure */
14823 ZERO_STRUCT(state
->tmp
);
14825 tevent_req_done(req
);
14828 NTSTATUS
rpccli_spoolss_62_recv(struct tevent_req
*req
,
14829 TALLOC_CTX
*mem_ctx
,
14832 struct rpccli_spoolss_62_state
*state
= tevent_req_data(
14833 req
, struct rpccli_spoolss_62_state
);
14836 if (tevent_req_is_nterror(req
, &status
)) {
14837 tevent_req_received(req
);
14841 /* Steal possbile out parameters to the callers context */
14842 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
14844 /* Return result */
14845 *result
= state
->orig
.out
.result
;
14847 tevent_req_received(req
);
14848 return NT_STATUS_OK
;
14851 NTSTATUS
rpccli_spoolss_62(struct rpc_pipe_client
*cli
,
14852 TALLOC_CTX
*mem_ctx
,
14855 struct spoolss_62 r
;
14858 /* In parameters */
14860 status
= cli
->dispatch(cli
,
14862 &ndr_table_spoolss
,
14866 if (!NT_STATUS_IS_OK(status
)) {
14870 if (NT_STATUS_IS_ERR(status
)) {
14874 /* Return variables */
14876 /* Return result */
14878 *werror
= r
.out
.result
;
14881 return werror_to_ntstatus(r
.out
.result
);
14884 struct rpccli_spoolss_63_state
{
14885 struct spoolss_63 orig
;
14886 struct spoolss_63 tmp
;
14887 TALLOC_CTX
*out_mem_ctx
;
14888 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
14891 static void rpccli_spoolss_63_done(struct tevent_req
*subreq
);
14893 struct tevent_req
*rpccli_spoolss_63_send(TALLOC_CTX
*mem_ctx
,
14894 struct tevent_context
*ev
,
14895 struct rpc_pipe_client
*cli
)
14897 struct tevent_req
*req
;
14898 struct rpccli_spoolss_63_state
*state
;
14899 struct tevent_req
*subreq
;
14901 req
= tevent_req_create(mem_ctx
, &state
,
14902 struct rpccli_spoolss_63_state
);
14906 state
->out_mem_ctx
= NULL
;
14907 state
->dispatch_recv
= cli
->dispatch_recv
;
14909 /* In parameters */
14911 /* Out parameters */
14914 ZERO_STRUCT(state
->orig
.out
.result
);
14916 /* make a temporary copy, that we pass to the dispatch function */
14917 state
->tmp
= state
->orig
;
14919 subreq
= cli
->dispatch_send(state
, ev
, cli
,
14920 &ndr_table_spoolss
,
14923 if (tevent_req_nomem(subreq
, req
)) {
14924 return tevent_req_post(req
, ev
);
14926 tevent_req_set_callback(subreq
, rpccli_spoolss_63_done
, req
);
14930 static void rpccli_spoolss_63_done(struct tevent_req
*subreq
)
14932 struct tevent_req
*req
= tevent_req_callback_data(
14933 subreq
, struct tevent_req
);
14934 struct rpccli_spoolss_63_state
*state
= tevent_req_data(
14935 req
, struct rpccli_spoolss_63_state
);
14937 TALLOC_CTX
*mem_ctx
;
14939 if (state
->out_mem_ctx
) {
14940 mem_ctx
= state
->out_mem_ctx
;
14945 status
= state
->dispatch_recv(subreq
, mem_ctx
);
14946 TALLOC_FREE(subreq
);
14947 if (!NT_STATUS_IS_OK(status
)) {
14948 tevent_req_nterror(req
, status
);
14952 /* Copy out parameters */
14955 state
->orig
.out
.result
= state
->tmp
.out
.result
;
14957 /* Reset temporary structure */
14958 ZERO_STRUCT(state
->tmp
);
14960 tevent_req_done(req
);
14963 NTSTATUS
rpccli_spoolss_63_recv(struct tevent_req
*req
,
14964 TALLOC_CTX
*mem_ctx
,
14967 struct rpccli_spoolss_63_state
*state
= tevent_req_data(
14968 req
, struct rpccli_spoolss_63_state
);
14971 if (tevent_req_is_nterror(req
, &status
)) {
14972 tevent_req_received(req
);
14976 /* Steal possbile out parameters to the callers context */
14977 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
14979 /* Return result */
14980 *result
= state
->orig
.out
.result
;
14982 tevent_req_received(req
);
14983 return NT_STATUS_OK
;
14986 NTSTATUS
rpccli_spoolss_63(struct rpc_pipe_client
*cli
,
14987 TALLOC_CTX
*mem_ctx
,
14990 struct spoolss_63 r
;
14993 /* In parameters */
14995 status
= cli
->dispatch(cli
,
14997 &ndr_table_spoolss
,
15001 if (!NT_STATUS_IS_OK(status
)) {
15005 if (NT_STATUS_IS_ERR(status
)) {
15009 /* Return variables */
15011 /* Return result */
15013 *werror
= r
.out
.result
;
15016 return werror_to_ntstatus(r
.out
.result
);
15019 struct rpccli_spoolss_64_state
{
15020 struct spoolss_64 orig
;
15021 struct spoolss_64 tmp
;
15022 TALLOC_CTX
*out_mem_ctx
;
15023 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
15026 static void rpccli_spoolss_64_done(struct tevent_req
*subreq
);
15028 struct tevent_req
*rpccli_spoolss_64_send(TALLOC_CTX
*mem_ctx
,
15029 struct tevent_context
*ev
,
15030 struct rpc_pipe_client
*cli
)
15032 struct tevent_req
*req
;
15033 struct rpccli_spoolss_64_state
*state
;
15034 struct tevent_req
*subreq
;
15036 req
= tevent_req_create(mem_ctx
, &state
,
15037 struct rpccli_spoolss_64_state
);
15041 state
->out_mem_ctx
= NULL
;
15042 state
->dispatch_recv
= cli
->dispatch_recv
;
15044 /* In parameters */
15046 /* Out parameters */
15049 ZERO_STRUCT(state
->orig
.out
.result
);
15051 /* make a temporary copy, that we pass to the dispatch function */
15052 state
->tmp
= state
->orig
;
15054 subreq
= cli
->dispatch_send(state
, ev
, cli
,
15055 &ndr_table_spoolss
,
15058 if (tevent_req_nomem(subreq
, req
)) {
15059 return tevent_req_post(req
, ev
);
15061 tevent_req_set_callback(subreq
, rpccli_spoolss_64_done
, req
);
15065 static void rpccli_spoolss_64_done(struct tevent_req
*subreq
)
15067 struct tevent_req
*req
= tevent_req_callback_data(
15068 subreq
, struct tevent_req
);
15069 struct rpccli_spoolss_64_state
*state
= tevent_req_data(
15070 req
, struct rpccli_spoolss_64_state
);
15072 TALLOC_CTX
*mem_ctx
;
15074 if (state
->out_mem_ctx
) {
15075 mem_ctx
= state
->out_mem_ctx
;
15080 status
= state
->dispatch_recv(subreq
, mem_ctx
);
15081 TALLOC_FREE(subreq
);
15082 if (!NT_STATUS_IS_OK(status
)) {
15083 tevent_req_nterror(req
, status
);
15087 /* Copy out parameters */
15090 state
->orig
.out
.result
= state
->tmp
.out
.result
;
15092 /* Reset temporary structure */
15093 ZERO_STRUCT(state
->tmp
);
15095 tevent_req_done(req
);
15098 NTSTATUS
rpccli_spoolss_64_recv(struct tevent_req
*req
,
15099 TALLOC_CTX
*mem_ctx
,
15102 struct rpccli_spoolss_64_state
*state
= tevent_req_data(
15103 req
, struct rpccli_spoolss_64_state
);
15106 if (tevent_req_is_nterror(req
, &status
)) {
15107 tevent_req_received(req
);
15111 /* Steal possbile out parameters to the callers context */
15112 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
15114 /* Return result */
15115 *result
= state
->orig
.out
.result
;
15117 tevent_req_received(req
);
15118 return NT_STATUS_OK
;
15121 NTSTATUS
rpccli_spoolss_64(struct rpc_pipe_client
*cli
,
15122 TALLOC_CTX
*mem_ctx
,
15125 struct spoolss_64 r
;
15128 /* In parameters */
15130 status
= cli
->dispatch(cli
,
15132 &ndr_table_spoolss
,
15136 if (!NT_STATUS_IS_OK(status
)) {
15140 if (NT_STATUS_IS_ERR(status
)) {
15144 /* Return variables */
15146 /* Return result */
15148 *werror
= r
.out
.result
;
15151 return werror_to_ntstatus(r
.out
.result
);
15154 struct rpccli_spoolss_65_state
{
15155 struct spoolss_65 orig
;
15156 struct spoolss_65 tmp
;
15157 TALLOC_CTX
*out_mem_ctx
;
15158 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
15161 static void rpccli_spoolss_65_done(struct tevent_req
*subreq
);
15163 struct tevent_req
*rpccli_spoolss_65_send(TALLOC_CTX
*mem_ctx
,
15164 struct tevent_context
*ev
,
15165 struct rpc_pipe_client
*cli
)
15167 struct tevent_req
*req
;
15168 struct rpccli_spoolss_65_state
*state
;
15169 struct tevent_req
*subreq
;
15171 req
= tevent_req_create(mem_ctx
, &state
,
15172 struct rpccli_spoolss_65_state
);
15176 state
->out_mem_ctx
= NULL
;
15177 state
->dispatch_recv
= cli
->dispatch_recv
;
15179 /* In parameters */
15181 /* Out parameters */
15184 ZERO_STRUCT(state
->orig
.out
.result
);
15186 /* make a temporary copy, that we pass to the dispatch function */
15187 state
->tmp
= state
->orig
;
15189 subreq
= cli
->dispatch_send(state
, ev
, cli
,
15190 &ndr_table_spoolss
,
15193 if (tevent_req_nomem(subreq
, req
)) {
15194 return tevent_req_post(req
, ev
);
15196 tevent_req_set_callback(subreq
, rpccli_spoolss_65_done
, req
);
15200 static void rpccli_spoolss_65_done(struct tevent_req
*subreq
)
15202 struct tevent_req
*req
= tevent_req_callback_data(
15203 subreq
, struct tevent_req
);
15204 struct rpccli_spoolss_65_state
*state
= tevent_req_data(
15205 req
, struct rpccli_spoolss_65_state
);
15207 TALLOC_CTX
*mem_ctx
;
15209 if (state
->out_mem_ctx
) {
15210 mem_ctx
= state
->out_mem_ctx
;
15215 status
= state
->dispatch_recv(subreq
, mem_ctx
);
15216 TALLOC_FREE(subreq
);
15217 if (!NT_STATUS_IS_OK(status
)) {
15218 tevent_req_nterror(req
, status
);
15222 /* Copy out parameters */
15225 state
->orig
.out
.result
= state
->tmp
.out
.result
;
15227 /* Reset temporary structure */
15228 ZERO_STRUCT(state
->tmp
);
15230 tevent_req_done(req
);
15233 NTSTATUS
rpccli_spoolss_65_recv(struct tevent_req
*req
,
15234 TALLOC_CTX
*mem_ctx
,
15237 struct rpccli_spoolss_65_state
*state
= tevent_req_data(
15238 req
, struct rpccli_spoolss_65_state
);
15241 if (tevent_req_is_nterror(req
, &status
)) {
15242 tevent_req_received(req
);
15246 /* Steal possbile out parameters to the callers context */
15247 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
15249 /* Return result */
15250 *result
= state
->orig
.out
.result
;
15252 tevent_req_received(req
);
15253 return NT_STATUS_OK
;
15256 NTSTATUS
rpccli_spoolss_65(struct rpc_pipe_client
*cli
,
15257 TALLOC_CTX
*mem_ctx
,
15260 struct spoolss_65 r
;
15263 /* In parameters */
15265 status
= cli
->dispatch(cli
,
15267 &ndr_table_spoolss
,
15271 if (!NT_STATUS_IS_OK(status
)) {
15275 if (NT_STATUS_IS_ERR(status
)) {
15279 /* Return variables */
15281 /* Return result */
15283 *werror
= r
.out
.result
;
15286 return werror_to_ntstatus(r
.out
.result
);
15289 struct rpccli_spoolss_GetCorePrinterDrivers_state
{
15290 struct spoolss_GetCorePrinterDrivers orig
;
15291 struct spoolss_GetCorePrinterDrivers tmp
;
15292 TALLOC_CTX
*out_mem_ctx
;
15293 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
15296 static void rpccli_spoolss_GetCorePrinterDrivers_done(struct tevent_req
*subreq
);
15298 struct tevent_req
*rpccli_spoolss_GetCorePrinterDrivers_send(TALLOC_CTX
*mem_ctx
,
15299 struct tevent_context
*ev
,
15300 struct rpc_pipe_client
*cli
,
15301 const char *_servername
/* [in] [unique,charset(UTF16)] */,
15302 const char *_architecture
/* [in] [ref,charset(UTF16)] */,
15303 uint32_t _core_driver_size
/* [in] */,
15304 const char *_core_driver_dependencies
/* [in] [ref,charset(UTF16),size_is(core_driver_size)] */,
15305 uint32_t _core_printer_driver_count
/* [in] */,
15306 struct spoolss_CorePrinterDriver
*_core_printer_drivers
/* [out] [ref,size_is(core_printer_driver_count)] */)
15308 struct tevent_req
*req
;
15309 struct rpccli_spoolss_GetCorePrinterDrivers_state
*state
;
15310 struct tevent_req
*subreq
;
15312 req
= tevent_req_create(mem_ctx
, &state
,
15313 struct rpccli_spoolss_GetCorePrinterDrivers_state
);
15317 state
->out_mem_ctx
= NULL
;
15318 state
->dispatch_recv
= cli
->dispatch_recv
;
15320 /* In parameters */
15321 state
->orig
.in
.servername
= _servername
;
15322 state
->orig
.in
.architecture
= _architecture
;
15323 state
->orig
.in
.core_driver_size
= _core_driver_size
;
15324 state
->orig
.in
.core_driver_dependencies
= _core_driver_dependencies
;
15325 state
->orig
.in
.core_printer_driver_count
= _core_printer_driver_count
;
15327 /* Out parameters */
15328 state
->orig
.out
.core_printer_drivers
= _core_printer_drivers
;
15331 ZERO_STRUCT(state
->orig
.out
.result
);
15333 state
->out_mem_ctx
= talloc_named_const(state
, 0,
15334 "rpccli_spoolss_GetCorePrinterDrivers_out_memory");
15335 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
15336 return tevent_req_post(req
, ev
);
15339 /* make a temporary copy, that we pass to the dispatch function */
15340 state
->tmp
= state
->orig
;
15342 subreq
= cli
->dispatch_send(state
, ev
, cli
,
15343 &ndr_table_spoolss
,
15344 NDR_SPOOLSS_GETCOREPRINTERDRIVERS
,
15346 if (tevent_req_nomem(subreq
, req
)) {
15347 return tevent_req_post(req
, ev
);
15349 tevent_req_set_callback(subreq
, rpccli_spoolss_GetCorePrinterDrivers_done
, req
);
15353 static void rpccli_spoolss_GetCorePrinterDrivers_done(struct tevent_req
*subreq
)
15355 struct tevent_req
*req
= tevent_req_callback_data(
15356 subreq
, struct tevent_req
);
15357 struct rpccli_spoolss_GetCorePrinterDrivers_state
*state
= tevent_req_data(
15358 req
, struct rpccli_spoolss_GetCorePrinterDrivers_state
);
15360 TALLOC_CTX
*mem_ctx
;
15362 if (state
->out_mem_ctx
) {
15363 mem_ctx
= state
->out_mem_ctx
;
15368 status
= state
->dispatch_recv(subreq
, mem_ctx
);
15369 TALLOC_FREE(subreq
);
15370 if (!NT_STATUS_IS_OK(status
)) {
15371 tevent_req_nterror(req
, status
);
15375 /* Copy out parameters */
15376 memcpy(state
->orig
.out
.core_printer_drivers
, state
->tmp
.out
.core_printer_drivers
, (state
->tmp
.in
.core_printer_driver_count
) * sizeof(*state
->orig
.out
.core_printer_drivers
));
15379 state
->orig
.out
.result
= state
->tmp
.out
.result
;
15381 /* Reset temporary structure */
15382 ZERO_STRUCT(state
->tmp
);
15384 tevent_req_done(req
);
15387 NTSTATUS
rpccli_spoolss_GetCorePrinterDrivers_recv(struct tevent_req
*req
,
15388 TALLOC_CTX
*mem_ctx
,
15391 struct rpccli_spoolss_GetCorePrinterDrivers_state
*state
= tevent_req_data(
15392 req
, struct rpccli_spoolss_GetCorePrinterDrivers_state
);
15395 if (tevent_req_is_nterror(req
, &status
)) {
15396 tevent_req_received(req
);
15400 /* Steal possbile out parameters to the callers context */
15401 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
15403 /* Return result */
15404 *result
= state
->orig
.out
.result
;
15406 tevent_req_received(req
);
15407 return NT_STATUS_OK
;
15410 NTSTATUS
rpccli_spoolss_GetCorePrinterDrivers(struct rpc_pipe_client
*cli
,
15411 TALLOC_CTX
*mem_ctx
,
15412 const char *servername
/* [in] [unique,charset(UTF16)] */,
15413 const char *architecture
/* [in] [ref,charset(UTF16)] */,
15414 uint32_t core_driver_size
/* [in] */,
15415 const char *core_driver_dependencies
/* [in] [ref,charset(UTF16),size_is(core_driver_size)] */,
15416 uint32_t core_printer_driver_count
/* [in] */,
15417 struct spoolss_CorePrinterDriver
*core_printer_drivers
/* [out] [ref,size_is(core_printer_driver_count)] */,
15420 struct spoolss_GetCorePrinterDrivers r
;
15423 /* In parameters */
15424 r
.in
.servername
= servername
;
15425 r
.in
.architecture
= architecture
;
15426 r
.in
.core_driver_size
= core_driver_size
;
15427 r
.in
.core_driver_dependencies
= core_driver_dependencies
;
15428 r
.in
.core_printer_driver_count
= core_printer_driver_count
;
15430 status
= cli
->dispatch(cli
,
15432 &ndr_table_spoolss
,
15433 NDR_SPOOLSS_GETCOREPRINTERDRIVERS
,
15436 if (!NT_STATUS_IS_OK(status
)) {
15440 if (NT_STATUS_IS_ERR(status
)) {
15444 /* Return variables */
15445 memcpy(core_printer_drivers
, r
.out
.core_printer_drivers
, (r
.in
.core_printer_driver_count
) * sizeof(*core_printer_drivers
));
15447 /* Return result */
15449 *werror
= r
.out
.result
;
15452 return werror_to_ntstatus(r
.out
.result
);
15455 struct rpccli_spoolss_67_state
{
15456 struct spoolss_67 orig
;
15457 struct spoolss_67 tmp
;
15458 TALLOC_CTX
*out_mem_ctx
;
15459 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
15462 static void rpccli_spoolss_67_done(struct tevent_req
*subreq
);
15464 struct tevent_req
*rpccli_spoolss_67_send(TALLOC_CTX
*mem_ctx
,
15465 struct tevent_context
*ev
,
15466 struct rpc_pipe_client
*cli
)
15468 struct tevent_req
*req
;
15469 struct rpccli_spoolss_67_state
*state
;
15470 struct tevent_req
*subreq
;
15472 req
= tevent_req_create(mem_ctx
, &state
,
15473 struct rpccli_spoolss_67_state
);
15477 state
->out_mem_ctx
= NULL
;
15478 state
->dispatch_recv
= cli
->dispatch_recv
;
15480 /* In parameters */
15482 /* Out parameters */
15485 ZERO_STRUCT(state
->orig
.out
.result
);
15487 /* make a temporary copy, that we pass to the dispatch function */
15488 state
->tmp
= state
->orig
;
15490 subreq
= cli
->dispatch_send(state
, ev
, cli
,
15491 &ndr_table_spoolss
,
15494 if (tevent_req_nomem(subreq
, req
)) {
15495 return tevent_req_post(req
, ev
);
15497 tevent_req_set_callback(subreq
, rpccli_spoolss_67_done
, req
);
15501 static void rpccli_spoolss_67_done(struct tevent_req
*subreq
)
15503 struct tevent_req
*req
= tevent_req_callback_data(
15504 subreq
, struct tevent_req
);
15505 struct rpccli_spoolss_67_state
*state
= tevent_req_data(
15506 req
, struct rpccli_spoolss_67_state
);
15508 TALLOC_CTX
*mem_ctx
;
15510 if (state
->out_mem_ctx
) {
15511 mem_ctx
= state
->out_mem_ctx
;
15516 status
= state
->dispatch_recv(subreq
, mem_ctx
);
15517 TALLOC_FREE(subreq
);
15518 if (!NT_STATUS_IS_OK(status
)) {
15519 tevent_req_nterror(req
, status
);
15523 /* Copy out parameters */
15526 state
->orig
.out
.result
= state
->tmp
.out
.result
;
15528 /* Reset temporary structure */
15529 ZERO_STRUCT(state
->tmp
);
15531 tevent_req_done(req
);
15534 NTSTATUS
rpccli_spoolss_67_recv(struct tevent_req
*req
,
15535 TALLOC_CTX
*mem_ctx
,
15538 struct rpccli_spoolss_67_state
*state
= tevent_req_data(
15539 req
, struct rpccli_spoolss_67_state
);
15542 if (tevent_req_is_nterror(req
, &status
)) {
15543 tevent_req_received(req
);
15547 /* Steal possbile out parameters to the callers context */
15548 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
15550 /* Return result */
15551 *result
= state
->orig
.out
.result
;
15553 tevent_req_received(req
);
15554 return NT_STATUS_OK
;
15557 NTSTATUS
rpccli_spoolss_67(struct rpc_pipe_client
*cli
,
15558 TALLOC_CTX
*mem_ctx
,
15561 struct spoolss_67 r
;
15564 /* In parameters */
15566 status
= cli
->dispatch(cli
,
15568 &ndr_table_spoolss
,
15572 if (!NT_STATUS_IS_OK(status
)) {
15576 if (NT_STATUS_IS_ERR(status
)) {
15580 /* Return variables */
15582 /* Return result */
15584 *werror
= r
.out
.result
;
15587 return werror_to_ntstatus(r
.out
.result
);
15590 struct rpccli_spoolss_GetPrinterDriverPackagePath_state
{
15591 struct spoolss_GetPrinterDriverPackagePath orig
;
15592 struct spoolss_GetPrinterDriverPackagePath tmp
;
15593 TALLOC_CTX
*out_mem_ctx
;
15594 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
15597 static void rpccli_spoolss_GetPrinterDriverPackagePath_done(struct tevent_req
*subreq
);
15599 struct tevent_req
*rpccli_spoolss_GetPrinterDriverPackagePath_send(TALLOC_CTX
*mem_ctx
,
15600 struct tevent_context
*ev
,
15601 struct rpc_pipe_client
*cli
,
15602 const char *_servername
/* [in] [unique,charset(UTF16)] */,
15603 const char *_architecture
/* [in] [ref,charset(UTF16)] */,
15604 const char *_language
/* [in] [unique,charset(UTF16)] */,
15605 const char *_package_id
/* [in] [ref,charset(UTF16)] */,
15606 const char *_driver_package_cab
/* [in,out] [unique,charset(UTF16),size_is(driver_package_cab_size)] */,
15607 uint32_t _driver_package_cab_size
/* [in] */,
15608 uint32_t *_required
/* [out] [ref] */)
15610 struct tevent_req
*req
;
15611 struct rpccli_spoolss_GetPrinterDriverPackagePath_state
*state
;
15612 struct tevent_req
*subreq
;
15614 req
= tevent_req_create(mem_ctx
, &state
,
15615 struct rpccli_spoolss_GetPrinterDriverPackagePath_state
);
15619 state
->out_mem_ctx
= NULL
;
15620 state
->dispatch_recv
= cli
->dispatch_recv
;
15622 /* In parameters */
15623 state
->orig
.in
.servername
= _servername
;
15624 state
->orig
.in
.architecture
= _architecture
;
15625 state
->orig
.in
.language
= _language
;
15626 state
->orig
.in
.package_id
= _package_id
;
15627 state
->orig
.in
.driver_package_cab
= _driver_package_cab
;
15628 state
->orig
.in
.driver_package_cab_size
= _driver_package_cab_size
;
15630 /* Out parameters */
15631 state
->orig
.out
.driver_package_cab
= _driver_package_cab
;
15632 state
->orig
.out
.required
= _required
;
15635 ZERO_STRUCT(state
->orig
.out
.result
);
15637 state
->out_mem_ctx
= talloc_named_const(state
, 0,
15638 "rpccli_spoolss_GetPrinterDriverPackagePath_out_memory");
15639 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
15640 return tevent_req_post(req
, ev
);
15643 /* make a temporary copy, that we pass to the dispatch function */
15644 state
->tmp
= state
->orig
;
15646 subreq
= cli
->dispatch_send(state
, ev
, cli
,
15647 &ndr_table_spoolss
,
15648 NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH
,
15650 if (tevent_req_nomem(subreq
, req
)) {
15651 return tevent_req_post(req
, ev
);
15653 tevent_req_set_callback(subreq
, rpccli_spoolss_GetPrinterDriverPackagePath_done
, req
);
15657 static void rpccli_spoolss_GetPrinterDriverPackagePath_done(struct tevent_req
*subreq
)
15659 struct tevent_req
*req
= tevent_req_callback_data(
15660 subreq
, struct tevent_req
);
15661 struct rpccli_spoolss_GetPrinterDriverPackagePath_state
*state
= tevent_req_data(
15662 req
, struct rpccli_spoolss_GetPrinterDriverPackagePath_state
);
15664 TALLOC_CTX
*mem_ctx
;
15666 if (state
->out_mem_ctx
) {
15667 mem_ctx
= state
->out_mem_ctx
;
15672 status
= state
->dispatch_recv(subreq
, mem_ctx
);
15673 TALLOC_FREE(subreq
);
15674 if (!NT_STATUS_IS_OK(status
)) {
15675 tevent_req_nterror(req
, status
);
15679 /* Copy out parameters */
15680 if (state
->orig
.out
.driver_package_cab
&& state
->tmp
.out
.driver_package_cab
) {
15681 memcpy(discard_const_p(uint8_t *, state
->orig
.out
.driver_package_cab
), state
->tmp
.out
.driver_package_cab
, (state
->tmp
.in
.driver_package_cab_size
) * sizeof(*state
->orig
.out
.driver_package_cab
));
15683 *state
->orig
.out
.required
= *state
->tmp
.out
.required
;
15686 state
->orig
.out
.result
= state
->tmp
.out
.result
;
15688 /* Reset temporary structure */
15689 ZERO_STRUCT(state
->tmp
);
15691 tevent_req_done(req
);
15694 NTSTATUS
rpccli_spoolss_GetPrinterDriverPackagePath_recv(struct tevent_req
*req
,
15695 TALLOC_CTX
*mem_ctx
,
15698 struct rpccli_spoolss_GetPrinterDriverPackagePath_state
*state
= tevent_req_data(
15699 req
, struct rpccli_spoolss_GetPrinterDriverPackagePath_state
);
15702 if (tevent_req_is_nterror(req
, &status
)) {
15703 tevent_req_received(req
);
15707 /* Steal possbile out parameters to the callers context */
15708 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
15710 /* Return result */
15711 *result
= state
->orig
.out
.result
;
15713 tevent_req_received(req
);
15714 return NT_STATUS_OK
;
15717 NTSTATUS
rpccli_spoolss_GetPrinterDriverPackagePath(struct rpc_pipe_client
*cli
,
15718 TALLOC_CTX
*mem_ctx
,
15719 const char *servername
/* [in] [unique,charset(UTF16)] */,
15720 const char *architecture
/* [in] [ref,charset(UTF16)] */,
15721 const char *language
/* [in] [unique,charset(UTF16)] */,
15722 const char *package_id
/* [in] [ref,charset(UTF16)] */,
15723 const char *driver_package_cab
/* [in,out] [unique,charset(UTF16),size_is(driver_package_cab_size)] */,
15724 uint32_t driver_package_cab_size
/* [in] */,
15725 uint32_t *required
/* [out] [ref] */,
15728 struct spoolss_GetPrinterDriverPackagePath r
;
15731 /* In parameters */
15732 r
.in
.servername
= servername
;
15733 r
.in
.architecture
= architecture
;
15734 r
.in
.language
= language
;
15735 r
.in
.package_id
= package_id
;
15736 r
.in
.driver_package_cab
= driver_package_cab
;
15737 r
.in
.driver_package_cab_size
= driver_package_cab_size
;
15739 status
= cli
->dispatch(cli
,
15741 &ndr_table_spoolss
,
15742 NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH
,
15745 if (!NT_STATUS_IS_OK(status
)) {
15749 if (NT_STATUS_IS_ERR(status
)) {
15753 /* Return variables */
15754 if (driver_package_cab
&& r
.out
.driver_package_cab
) {
15755 memcpy(discard_const_p(uint8_t *, driver_package_cab
), r
.out
.driver_package_cab
, (r
.in
.driver_package_cab_size
) * sizeof(*driver_package_cab
));
15757 *required
= *r
.out
.required
;
15759 /* Return result */
15761 *werror
= r
.out
.result
;
15764 return werror_to_ntstatus(r
.out
.result
);
15767 struct rpccli_spoolss_69_state
{
15768 struct spoolss_69 orig
;
15769 struct spoolss_69 tmp
;
15770 TALLOC_CTX
*out_mem_ctx
;
15771 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
15774 static void rpccli_spoolss_69_done(struct tevent_req
*subreq
);
15776 struct tevent_req
*rpccli_spoolss_69_send(TALLOC_CTX
*mem_ctx
,
15777 struct tevent_context
*ev
,
15778 struct rpc_pipe_client
*cli
)
15780 struct tevent_req
*req
;
15781 struct rpccli_spoolss_69_state
*state
;
15782 struct tevent_req
*subreq
;
15784 req
= tevent_req_create(mem_ctx
, &state
,
15785 struct rpccli_spoolss_69_state
);
15789 state
->out_mem_ctx
= NULL
;
15790 state
->dispatch_recv
= cli
->dispatch_recv
;
15792 /* In parameters */
15794 /* Out parameters */
15797 ZERO_STRUCT(state
->orig
.out
.result
);
15799 /* make a temporary copy, that we pass to the dispatch function */
15800 state
->tmp
= state
->orig
;
15802 subreq
= cli
->dispatch_send(state
, ev
, cli
,
15803 &ndr_table_spoolss
,
15806 if (tevent_req_nomem(subreq
, req
)) {
15807 return tevent_req_post(req
, ev
);
15809 tevent_req_set_callback(subreq
, rpccli_spoolss_69_done
, req
);
15813 static void rpccli_spoolss_69_done(struct tevent_req
*subreq
)
15815 struct tevent_req
*req
= tevent_req_callback_data(
15816 subreq
, struct tevent_req
);
15817 struct rpccli_spoolss_69_state
*state
= tevent_req_data(
15818 req
, struct rpccli_spoolss_69_state
);
15820 TALLOC_CTX
*mem_ctx
;
15822 if (state
->out_mem_ctx
) {
15823 mem_ctx
= state
->out_mem_ctx
;
15828 status
= state
->dispatch_recv(subreq
, mem_ctx
);
15829 TALLOC_FREE(subreq
);
15830 if (!NT_STATUS_IS_OK(status
)) {
15831 tevent_req_nterror(req
, status
);
15835 /* Copy out parameters */
15838 state
->orig
.out
.result
= state
->tmp
.out
.result
;
15840 /* Reset temporary structure */
15841 ZERO_STRUCT(state
->tmp
);
15843 tevent_req_done(req
);
15846 NTSTATUS
rpccli_spoolss_69_recv(struct tevent_req
*req
,
15847 TALLOC_CTX
*mem_ctx
,
15850 struct rpccli_spoolss_69_state
*state
= tevent_req_data(
15851 req
, struct rpccli_spoolss_69_state
);
15854 if (tevent_req_is_nterror(req
, &status
)) {
15855 tevent_req_received(req
);
15859 /* Steal possbile out parameters to the callers context */
15860 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
15862 /* Return result */
15863 *result
= state
->orig
.out
.result
;
15865 tevent_req_received(req
);
15866 return NT_STATUS_OK
;
15869 NTSTATUS
rpccli_spoolss_69(struct rpc_pipe_client
*cli
,
15870 TALLOC_CTX
*mem_ctx
,
15873 struct spoolss_69 r
;
15876 /* In parameters */
15878 status
= cli
->dispatch(cli
,
15880 &ndr_table_spoolss
,
15884 if (!NT_STATUS_IS_OK(status
)) {
15888 if (NT_STATUS_IS_ERR(status
)) {
15892 /* Return variables */
15894 /* Return result */
15896 *werror
= r
.out
.result
;
15899 return werror_to_ntstatus(r
.out
.result
);
15902 struct rpccli_spoolss_6a_state
{
15903 struct spoolss_6a orig
;
15904 struct spoolss_6a tmp
;
15905 TALLOC_CTX
*out_mem_ctx
;
15906 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
15909 static void rpccli_spoolss_6a_done(struct tevent_req
*subreq
);
15911 struct tevent_req
*rpccli_spoolss_6a_send(TALLOC_CTX
*mem_ctx
,
15912 struct tevent_context
*ev
,
15913 struct rpc_pipe_client
*cli
)
15915 struct tevent_req
*req
;
15916 struct rpccli_spoolss_6a_state
*state
;
15917 struct tevent_req
*subreq
;
15919 req
= tevent_req_create(mem_ctx
, &state
,
15920 struct rpccli_spoolss_6a_state
);
15924 state
->out_mem_ctx
= NULL
;
15925 state
->dispatch_recv
= cli
->dispatch_recv
;
15927 /* In parameters */
15929 /* Out parameters */
15932 ZERO_STRUCT(state
->orig
.out
.result
);
15934 /* make a temporary copy, that we pass to the dispatch function */
15935 state
->tmp
= state
->orig
;
15937 subreq
= cli
->dispatch_send(state
, ev
, cli
,
15938 &ndr_table_spoolss
,
15941 if (tevent_req_nomem(subreq
, req
)) {
15942 return tevent_req_post(req
, ev
);
15944 tevent_req_set_callback(subreq
, rpccli_spoolss_6a_done
, req
);
15948 static void rpccli_spoolss_6a_done(struct tevent_req
*subreq
)
15950 struct tevent_req
*req
= tevent_req_callback_data(
15951 subreq
, struct tevent_req
);
15952 struct rpccli_spoolss_6a_state
*state
= tevent_req_data(
15953 req
, struct rpccli_spoolss_6a_state
);
15955 TALLOC_CTX
*mem_ctx
;
15957 if (state
->out_mem_ctx
) {
15958 mem_ctx
= state
->out_mem_ctx
;
15963 status
= state
->dispatch_recv(subreq
, mem_ctx
);
15964 TALLOC_FREE(subreq
);
15965 if (!NT_STATUS_IS_OK(status
)) {
15966 tevent_req_nterror(req
, status
);
15970 /* Copy out parameters */
15973 state
->orig
.out
.result
= state
->tmp
.out
.result
;
15975 /* Reset temporary structure */
15976 ZERO_STRUCT(state
->tmp
);
15978 tevent_req_done(req
);
15981 NTSTATUS
rpccli_spoolss_6a_recv(struct tevent_req
*req
,
15982 TALLOC_CTX
*mem_ctx
,
15985 struct rpccli_spoolss_6a_state
*state
= tevent_req_data(
15986 req
, struct rpccli_spoolss_6a_state
);
15989 if (tevent_req_is_nterror(req
, &status
)) {
15990 tevent_req_received(req
);
15994 /* Steal possbile out parameters to the callers context */
15995 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
15997 /* Return result */
15998 *result
= state
->orig
.out
.result
;
16000 tevent_req_received(req
);
16001 return NT_STATUS_OK
;
16004 NTSTATUS
rpccli_spoolss_6a(struct rpc_pipe_client
*cli
,
16005 TALLOC_CTX
*mem_ctx
,
16008 struct spoolss_6a r
;
16011 /* In parameters */
16013 status
= cli
->dispatch(cli
,
16015 &ndr_table_spoolss
,
16019 if (!NT_STATUS_IS_OK(status
)) {
16023 if (NT_STATUS_IS_ERR(status
)) {
16027 /* Return variables */
16029 /* Return result */
16031 *werror
= r
.out
.result
;
16034 return werror_to_ntstatus(r
.out
.result
);
16037 struct rpccli_spoolss_6b_state
{
16038 struct spoolss_6b orig
;
16039 struct spoolss_6b tmp
;
16040 TALLOC_CTX
*out_mem_ctx
;
16041 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
16044 static void rpccli_spoolss_6b_done(struct tevent_req
*subreq
);
16046 struct tevent_req
*rpccli_spoolss_6b_send(TALLOC_CTX
*mem_ctx
,
16047 struct tevent_context
*ev
,
16048 struct rpc_pipe_client
*cli
)
16050 struct tevent_req
*req
;
16051 struct rpccli_spoolss_6b_state
*state
;
16052 struct tevent_req
*subreq
;
16054 req
= tevent_req_create(mem_ctx
, &state
,
16055 struct rpccli_spoolss_6b_state
);
16059 state
->out_mem_ctx
= NULL
;
16060 state
->dispatch_recv
= cli
->dispatch_recv
;
16062 /* In parameters */
16064 /* Out parameters */
16067 ZERO_STRUCT(state
->orig
.out
.result
);
16069 /* make a temporary copy, that we pass to the dispatch function */
16070 state
->tmp
= state
->orig
;
16072 subreq
= cli
->dispatch_send(state
, ev
, cli
,
16073 &ndr_table_spoolss
,
16076 if (tevent_req_nomem(subreq
, req
)) {
16077 return tevent_req_post(req
, ev
);
16079 tevent_req_set_callback(subreq
, rpccli_spoolss_6b_done
, req
);
16083 static void rpccli_spoolss_6b_done(struct tevent_req
*subreq
)
16085 struct tevent_req
*req
= tevent_req_callback_data(
16086 subreq
, struct tevent_req
);
16087 struct rpccli_spoolss_6b_state
*state
= tevent_req_data(
16088 req
, struct rpccli_spoolss_6b_state
);
16090 TALLOC_CTX
*mem_ctx
;
16092 if (state
->out_mem_ctx
) {
16093 mem_ctx
= state
->out_mem_ctx
;
16098 status
= state
->dispatch_recv(subreq
, mem_ctx
);
16099 TALLOC_FREE(subreq
);
16100 if (!NT_STATUS_IS_OK(status
)) {
16101 tevent_req_nterror(req
, status
);
16105 /* Copy out parameters */
16108 state
->orig
.out
.result
= state
->tmp
.out
.result
;
16110 /* Reset temporary structure */
16111 ZERO_STRUCT(state
->tmp
);
16113 tevent_req_done(req
);
16116 NTSTATUS
rpccli_spoolss_6b_recv(struct tevent_req
*req
,
16117 TALLOC_CTX
*mem_ctx
,
16120 struct rpccli_spoolss_6b_state
*state
= tevent_req_data(
16121 req
, struct rpccli_spoolss_6b_state
);
16124 if (tevent_req_is_nterror(req
, &status
)) {
16125 tevent_req_received(req
);
16129 /* Steal possbile out parameters to the callers context */
16130 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
16132 /* Return result */
16133 *result
= state
->orig
.out
.result
;
16135 tevent_req_received(req
);
16136 return NT_STATUS_OK
;
16139 NTSTATUS
rpccli_spoolss_6b(struct rpc_pipe_client
*cli
,
16140 TALLOC_CTX
*mem_ctx
,
16143 struct spoolss_6b r
;
16146 /* In parameters */
16148 status
= cli
->dispatch(cli
,
16150 &ndr_table_spoolss
,
16154 if (!NT_STATUS_IS_OK(status
)) {
16158 if (NT_STATUS_IS_ERR(status
)) {
16162 /* Return variables */
16164 /* Return result */
16166 *werror
= r
.out
.result
;
16169 return werror_to_ntstatus(r
.out
.result
);
16172 struct rpccli_spoolss_6c_state
{
16173 struct spoolss_6c orig
;
16174 struct spoolss_6c tmp
;
16175 TALLOC_CTX
*out_mem_ctx
;
16176 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
16179 static void rpccli_spoolss_6c_done(struct tevent_req
*subreq
);
16181 struct tevent_req
*rpccli_spoolss_6c_send(TALLOC_CTX
*mem_ctx
,
16182 struct tevent_context
*ev
,
16183 struct rpc_pipe_client
*cli
)
16185 struct tevent_req
*req
;
16186 struct rpccli_spoolss_6c_state
*state
;
16187 struct tevent_req
*subreq
;
16189 req
= tevent_req_create(mem_ctx
, &state
,
16190 struct rpccli_spoolss_6c_state
);
16194 state
->out_mem_ctx
= NULL
;
16195 state
->dispatch_recv
= cli
->dispatch_recv
;
16197 /* In parameters */
16199 /* Out parameters */
16202 ZERO_STRUCT(state
->orig
.out
.result
);
16204 /* make a temporary copy, that we pass to the dispatch function */
16205 state
->tmp
= state
->orig
;
16207 subreq
= cli
->dispatch_send(state
, ev
, cli
,
16208 &ndr_table_spoolss
,
16211 if (tevent_req_nomem(subreq
, req
)) {
16212 return tevent_req_post(req
, ev
);
16214 tevent_req_set_callback(subreq
, rpccli_spoolss_6c_done
, req
);
16218 static void rpccli_spoolss_6c_done(struct tevent_req
*subreq
)
16220 struct tevent_req
*req
= tevent_req_callback_data(
16221 subreq
, struct tevent_req
);
16222 struct rpccli_spoolss_6c_state
*state
= tevent_req_data(
16223 req
, struct rpccli_spoolss_6c_state
);
16225 TALLOC_CTX
*mem_ctx
;
16227 if (state
->out_mem_ctx
) {
16228 mem_ctx
= state
->out_mem_ctx
;
16233 status
= state
->dispatch_recv(subreq
, mem_ctx
);
16234 TALLOC_FREE(subreq
);
16235 if (!NT_STATUS_IS_OK(status
)) {
16236 tevent_req_nterror(req
, status
);
16240 /* Copy out parameters */
16243 state
->orig
.out
.result
= state
->tmp
.out
.result
;
16245 /* Reset temporary structure */
16246 ZERO_STRUCT(state
->tmp
);
16248 tevent_req_done(req
);
16251 NTSTATUS
rpccli_spoolss_6c_recv(struct tevent_req
*req
,
16252 TALLOC_CTX
*mem_ctx
,
16255 struct rpccli_spoolss_6c_state
*state
= tevent_req_data(
16256 req
, struct rpccli_spoolss_6c_state
);
16259 if (tevent_req_is_nterror(req
, &status
)) {
16260 tevent_req_received(req
);
16264 /* Steal possbile out parameters to the callers context */
16265 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
16267 /* Return result */
16268 *result
= state
->orig
.out
.result
;
16270 tevent_req_received(req
);
16271 return NT_STATUS_OK
;
16274 NTSTATUS
rpccli_spoolss_6c(struct rpc_pipe_client
*cli
,
16275 TALLOC_CTX
*mem_ctx
,
16278 struct spoolss_6c r
;
16281 /* In parameters */
16283 status
= cli
->dispatch(cli
,
16285 &ndr_table_spoolss
,
16289 if (!NT_STATUS_IS_OK(status
)) {
16293 if (NT_STATUS_IS_ERR(status
)) {
16297 /* Return variables */
16299 /* Return result */
16301 *werror
= r
.out
.result
;
16304 return werror_to_ntstatus(r
.out
.result
);
16307 struct rpccli_spoolss_6d_state
{
16308 struct spoolss_6d orig
;
16309 struct spoolss_6d tmp
;
16310 TALLOC_CTX
*out_mem_ctx
;
16311 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
16314 static void rpccli_spoolss_6d_done(struct tevent_req
*subreq
);
16316 struct tevent_req
*rpccli_spoolss_6d_send(TALLOC_CTX
*mem_ctx
,
16317 struct tevent_context
*ev
,
16318 struct rpc_pipe_client
*cli
)
16320 struct tevent_req
*req
;
16321 struct rpccli_spoolss_6d_state
*state
;
16322 struct tevent_req
*subreq
;
16324 req
= tevent_req_create(mem_ctx
, &state
,
16325 struct rpccli_spoolss_6d_state
);
16329 state
->out_mem_ctx
= NULL
;
16330 state
->dispatch_recv
= cli
->dispatch_recv
;
16332 /* In parameters */
16334 /* Out parameters */
16337 ZERO_STRUCT(state
->orig
.out
.result
);
16339 /* make a temporary copy, that we pass to the dispatch function */
16340 state
->tmp
= state
->orig
;
16342 subreq
= cli
->dispatch_send(state
, ev
, cli
,
16343 &ndr_table_spoolss
,
16346 if (tevent_req_nomem(subreq
, req
)) {
16347 return tevent_req_post(req
, ev
);
16349 tevent_req_set_callback(subreq
, rpccli_spoolss_6d_done
, req
);
16353 static void rpccli_spoolss_6d_done(struct tevent_req
*subreq
)
16355 struct tevent_req
*req
= tevent_req_callback_data(
16356 subreq
, struct tevent_req
);
16357 struct rpccli_spoolss_6d_state
*state
= tevent_req_data(
16358 req
, struct rpccli_spoolss_6d_state
);
16360 TALLOC_CTX
*mem_ctx
;
16362 if (state
->out_mem_ctx
) {
16363 mem_ctx
= state
->out_mem_ctx
;
16368 status
= state
->dispatch_recv(subreq
, mem_ctx
);
16369 TALLOC_FREE(subreq
);
16370 if (!NT_STATUS_IS_OK(status
)) {
16371 tevent_req_nterror(req
, status
);
16375 /* Copy out parameters */
16378 state
->orig
.out
.result
= state
->tmp
.out
.result
;
16380 /* Reset temporary structure */
16381 ZERO_STRUCT(state
->tmp
);
16383 tevent_req_done(req
);
16386 NTSTATUS
rpccli_spoolss_6d_recv(struct tevent_req
*req
,
16387 TALLOC_CTX
*mem_ctx
,
16390 struct rpccli_spoolss_6d_state
*state
= tevent_req_data(
16391 req
, struct rpccli_spoolss_6d_state
);
16394 if (tevent_req_is_nterror(req
, &status
)) {
16395 tevent_req_received(req
);
16399 /* Steal possbile out parameters to the callers context */
16400 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
16402 /* Return result */
16403 *result
= state
->orig
.out
.result
;
16405 tevent_req_received(req
);
16406 return NT_STATUS_OK
;
16409 NTSTATUS
rpccli_spoolss_6d(struct rpc_pipe_client
*cli
,
16410 TALLOC_CTX
*mem_ctx
,
16413 struct spoolss_6d r
;
16416 /* In parameters */
16418 status
= cli
->dispatch(cli
,
16420 &ndr_table_spoolss
,
16424 if (!NT_STATUS_IS_OK(status
)) {
16428 if (NT_STATUS_IS_ERR(status
)) {
16432 /* Return variables */
16434 /* Return result */
16436 *werror
= r
.out
.result
;
16439 return werror_to_ntstatus(r
.out
.result
);