1 /* client functions auto-generated by pidl */
5 #include "lib/util/tevent_ntstatus.h"
6 #include "bin/default/librpc/gen_ndr/ndr_spoolss.h"
7 #include "bin/default/librpc/gen_ndr/ndr_spoolss_c.h"
9 /* spoolss - client functions generated by pidl */
11 struct dcerpc_spoolss_EnumPrinters_r_state {
12 TALLOC_CTX *out_mem_ctx;
15 static void dcerpc_spoolss_EnumPrinters_r_done(struct tevent_req *subreq);
17 struct tevent_req *dcerpc_spoolss_EnumPrinters_r_send(TALLOC_CTX *mem_ctx,
18 struct tevent_context *ev,
19 struct dcerpc_binding_handle *h,
20 struct spoolss_EnumPrinters *r)
22 struct tevent_req *req;
23 struct dcerpc_spoolss_EnumPrinters_r_state *state;
24 struct tevent_req *subreq;
26 req = tevent_req_create(mem_ctx, &state,
27 struct dcerpc_spoolss_EnumPrinters_r_state);
32 state->out_mem_ctx = talloc_new(state);
33 if (tevent_req_nomem(state->out_mem_ctx, req)) {
34 return tevent_req_post(req, ev);
37 subreq = dcerpc_binding_handle_call_send(state, ev, h,
38 NULL, &ndr_table_spoolss,
39 NDR_SPOOLSS_ENUMPRINTERS, state->out_mem_ctx, r);
40 if (tevent_req_nomem(subreq, req)) {
41 return tevent_req_post(req, ev);
43 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinters_r_done, req);
48 static void dcerpc_spoolss_EnumPrinters_r_done(struct tevent_req *subreq)
50 struct tevent_req *req =
51 tevent_req_callback_data(subreq,
55 status = dcerpc_binding_handle_call_recv(subreq);
57 if (tevent_req_nterror(req, status)) {
64 NTSTATUS dcerpc_spoolss_EnumPrinters_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
66 struct dcerpc_spoolss_EnumPrinters_r_state *state =
68 struct dcerpc_spoolss_EnumPrinters_r_state);
71 if (tevent_req_is_nterror(req, &status)) {
72 tevent_req_received(req);
76 talloc_steal(mem_ctx, state->out_mem_ctx);
78 tevent_req_received(req);
82 NTSTATUS dcerpc_spoolss_EnumPrinters_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrinters *r)
86 status = dcerpc_binding_handle_call(h,
87 NULL, &ndr_table_spoolss,
88 NDR_SPOOLSS_ENUMPRINTERS, mem_ctx, r);
93 struct dcerpc_spoolss_EnumPrinters_state {
94 struct spoolss_EnumPrinters orig;
95 struct spoolss_EnumPrinters tmp;
96 TALLOC_CTX *out_mem_ctx;
99 static void dcerpc_spoolss_EnumPrinters_done(struct tevent_req *subreq);
101 struct tevent_req *dcerpc_spoolss_EnumPrinters_send(TALLOC_CTX *mem_ctx,
102 struct tevent_context *ev,
103 struct dcerpc_binding_handle *h,
104 uint32_t _flags /* [in] */,
105 const char *_server /* [in] [unique,charset(UTF16)] */,
106 uint32_t _level /* [in] */,
107 DATA_BLOB *_buffer /* [in] [unique] */,
108 uint32_t _offered /* [in] */,
109 uint32_t *_count /* [out] [ref] */,
110 union spoolss_PrinterInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
111 uint32_t *_needed /* [out] [ref] */)
113 struct tevent_req *req;
114 struct dcerpc_spoolss_EnumPrinters_state *state;
115 struct tevent_req *subreq;
117 req = tevent_req_create(mem_ctx, &state,
118 struct dcerpc_spoolss_EnumPrinters_state);
122 state->out_mem_ctx = NULL;
125 state->orig.in.flags = _flags;
126 state->orig.in.server = _server;
127 state->orig.in.level = _level;
128 state->orig.in.buffer = _buffer;
129 state->orig.in.offered = _offered;
132 state->orig.out.count = _count;
133 state->orig.out.info = _info;
134 state->orig.out.needed = _needed;
137 ZERO_STRUCT(state->orig.out.result);
139 state->out_mem_ctx = talloc_named_const(state, 0,
140 "dcerpc_spoolss_EnumPrinters_out_memory");
141 if (tevent_req_nomem(state->out_mem_ctx, req)) {
142 return tevent_req_post(req, ev);
145 /* make a temporary copy, that we pass to the dispatch function */
146 state->tmp = state->orig;
148 subreq = dcerpc_spoolss_EnumPrinters_r_send(state, ev, h, &state->tmp);
149 if (tevent_req_nomem(subreq, req)) {
150 return tevent_req_post(req, ev);
152 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinters_done, req);
156 static void dcerpc_spoolss_EnumPrinters_done(struct tevent_req *subreq)
158 struct tevent_req *req = tevent_req_callback_data(
159 subreq, struct tevent_req);
160 struct dcerpc_spoolss_EnumPrinters_state *state = tevent_req_data(
161 req, struct dcerpc_spoolss_EnumPrinters_state);
165 if (state->out_mem_ctx) {
166 mem_ctx = state->out_mem_ctx;
171 status = dcerpc_spoolss_EnumPrinters_r_recv(subreq, mem_ctx);
173 if (tevent_req_nterror(req, status)) {
177 /* Copy out parameters */
178 *state->orig.out.count = *state->tmp.out.count;
179 *state->orig.out.info = *state->tmp.out.info;
180 *state->orig.out.needed = *state->tmp.out.needed;
183 state->orig.out.result = state->tmp.out.result;
185 /* Reset temporary structure */
186 ZERO_STRUCT(state->tmp);
188 tevent_req_done(req);
191 NTSTATUS dcerpc_spoolss_EnumPrinters_recv(struct tevent_req *req,
195 struct dcerpc_spoolss_EnumPrinters_state *state = tevent_req_data(
196 req, struct dcerpc_spoolss_EnumPrinters_state);
199 if (tevent_req_is_nterror(req, &status)) {
200 tevent_req_received(req);
204 /* Steal possible out parameters to the callers context */
205 talloc_steal(mem_ctx, state->out_mem_ctx);
208 *result = state->orig.out.result;
210 tevent_req_received(req);
214 NTSTATUS dcerpc_spoolss_EnumPrinters(struct dcerpc_binding_handle *h,
216 uint32_t _flags /* [in] */,
217 const char *_server /* [in] [unique,charset(UTF16)] */,
218 uint32_t _level /* [in] */,
219 DATA_BLOB *_buffer /* [in] [unique] */,
220 uint32_t _offered /* [in] */,
221 uint32_t *_count /* [out] [ref] */,
222 union spoolss_PrinterInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
223 uint32_t *_needed /* [out] [ref] */,
226 struct spoolss_EnumPrinters r;
231 r.in.server = _server;
233 r.in.buffer = _buffer;
234 r.in.offered = _offered;
236 status = dcerpc_spoolss_EnumPrinters_r(h, mem_ctx, &r);
237 if (!NT_STATUS_IS_OK(status)) {
241 /* Return variables */
242 *_count = *r.out.count;
243 *_info = *r.out.info;
244 *_needed = *r.out.needed;
247 *result = r.out.result;
252 struct dcerpc_spoolss_OpenPrinter_r_state {
253 TALLOC_CTX *out_mem_ctx;
256 static void dcerpc_spoolss_OpenPrinter_r_done(struct tevent_req *subreq);
258 struct tevent_req *dcerpc_spoolss_OpenPrinter_r_send(TALLOC_CTX *mem_ctx,
259 struct tevent_context *ev,
260 struct dcerpc_binding_handle *h,
261 struct spoolss_OpenPrinter *r)
263 struct tevent_req *req;
264 struct dcerpc_spoolss_OpenPrinter_r_state *state;
265 struct tevent_req *subreq;
267 req = tevent_req_create(mem_ctx, &state,
268 struct dcerpc_spoolss_OpenPrinter_r_state);
273 state->out_mem_ctx = talloc_new(state);
274 if (tevent_req_nomem(state->out_mem_ctx, req)) {
275 return tevent_req_post(req, ev);
278 subreq = dcerpc_binding_handle_call_send(state, ev, h,
279 NULL, &ndr_table_spoolss,
280 NDR_SPOOLSS_OPENPRINTER, state->out_mem_ctx, r);
281 if (tevent_req_nomem(subreq, req)) {
282 return tevent_req_post(req, ev);
284 tevent_req_set_callback(subreq, dcerpc_spoolss_OpenPrinter_r_done, req);
289 static void dcerpc_spoolss_OpenPrinter_r_done(struct tevent_req *subreq)
291 struct tevent_req *req =
292 tevent_req_callback_data(subreq,
296 status = dcerpc_binding_handle_call_recv(subreq);
298 if (tevent_req_nterror(req, status)) {
302 tevent_req_done(req);
305 NTSTATUS dcerpc_spoolss_OpenPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
307 struct dcerpc_spoolss_OpenPrinter_r_state *state =
309 struct dcerpc_spoolss_OpenPrinter_r_state);
312 if (tevent_req_is_nterror(req, &status)) {
313 tevent_req_received(req);
317 talloc_steal(mem_ctx, state->out_mem_ctx);
319 tevent_req_received(req);
323 NTSTATUS dcerpc_spoolss_OpenPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_OpenPrinter *r)
327 status = dcerpc_binding_handle_call(h,
328 NULL, &ndr_table_spoolss,
329 NDR_SPOOLSS_OPENPRINTER, mem_ctx, r);
334 struct dcerpc_spoolss_OpenPrinter_state {
335 struct spoolss_OpenPrinter orig;
336 struct spoolss_OpenPrinter tmp;
337 TALLOC_CTX *out_mem_ctx;
340 static void dcerpc_spoolss_OpenPrinter_done(struct tevent_req *subreq);
342 struct tevent_req *dcerpc_spoolss_OpenPrinter_send(TALLOC_CTX *mem_ctx,
343 struct tevent_context *ev,
344 struct dcerpc_binding_handle *h,
345 const char *_printername /* [in] [unique,charset(UTF16)] */,
346 const char *_datatype /* [in] [unique,charset(UTF16)] */,
347 struct spoolss_DevmodeContainer _devmode_ctr /* [in] */,
348 uint32_t _access_mask /* [in] */,
349 struct policy_handle *_handle /* [out] [ref] */)
351 struct tevent_req *req;
352 struct dcerpc_spoolss_OpenPrinter_state *state;
353 struct tevent_req *subreq;
355 req = tevent_req_create(mem_ctx, &state,
356 struct dcerpc_spoolss_OpenPrinter_state);
360 state->out_mem_ctx = NULL;
363 state->orig.in.printername = _printername;
364 state->orig.in.datatype = _datatype;
365 state->orig.in.devmode_ctr = _devmode_ctr;
366 state->orig.in.access_mask = _access_mask;
369 state->orig.out.handle = _handle;
372 ZERO_STRUCT(state->orig.out.result);
374 state->out_mem_ctx = talloc_named_const(state, 0,
375 "dcerpc_spoolss_OpenPrinter_out_memory");
376 if (tevent_req_nomem(state->out_mem_ctx, req)) {
377 return tevent_req_post(req, ev);
380 /* make a temporary copy, that we pass to the dispatch function */
381 state->tmp = state->orig;
383 subreq = dcerpc_spoolss_OpenPrinter_r_send(state, ev, h, &state->tmp);
384 if (tevent_req_nomem(subreq, req)) {
385 return tevent_req_post(req, ev);
387 tevent_req_set_callback(subreq, dcerpc_spoolss_OpenPrinter_done, req);
391 static void dcerpc_spoolss_OpenPrinter_done(struct tevent_req *subreq)
393 struct tevent_req *req = tevent_req_callback_data(
394 subreq, struct tevent_req);
395 struct dcerpc_spoolss_OpenPrinter_state *state = tevent_req_data(
396 req, struct dcerpc_spoolss_OpenPrinter_state);
400 if (state->out_mem_ctx) {
401 mem_ctx = state->out_mem_ctx;
406 status = dcerpc_spoolss_OpenPrinter_r_recv(subreq, mem_ctx);
408 if (tevent_req_nterror(req, status)) {
412 /* Copy out parameters */
413 *state->orig.out.handle = *state->tmp.out.handle;
416 state->orig.out.result = state->tmp.out.result;
418 /* Reset temporary structure */
419 ZERO_STRUCT(state->tmp);
421 tevent_req_done(req);
424 NTSTATUS dcerpc_spoolss_OpenPrinter_recv(struct tevent_req *req,
428 struct dcerpc_spoolss_OpenPrinter_state *state = tevent_req_data(
429 req, struct dcerpc_spoolss_OpenPrinter_state);
432 if (tevent_req_is_nterror(req, &status)) {
433 tevent_req_received(req);
437 /* Steal possible out parameters to the callers context */
438 talloc_steal(mem_ctx, state->out_mem_ctx);
441 *result = state->orig.out.result;
443 tevent_req_received(req);
447 NTSTATUS dcerpc_spoolss_OpenPrinter(struct dcerpc_binding_handle *h,
449 const char *_printername /* [in] [unique,charset(UTF16)] */,
450 const char *_datatype /* [in] [unique,charset(UTF16)] */,
451 struct spoolss_DevmodeContainer _devmode_ctr /* [in] */,
452 uint32_t _access_mask /* [in] */,
453 struct policy_handle *_handle /* [out] [ref] */,
456 struct spoolss_OpenPrinter r;
460 r.in.printername = _printername;
461 r.in.datatype = _datatype;
462 r.in.devmode_ctr = _devmode_ctr;
463 r.in.access_mask = _access_mask;
465 status = dcerpc_spoolss_OpenPrinter_r(h, mem_ctx, &r);
466 if (!NT_STATUS_IS_OK(status)) {
470 /* Return variables */
471 *_handle = *r.out.handle;
474 *result = r.out.result;
479 struct dcerpc_spoolss_SetJob_r_state {
480 TALLOC_CTX *out_mem_ctx;
483 static void dcerpc_spoolss_SetJob_r_done(struct tevent_req *subreq);
485 struct tevent_req *dcerpc_spoolss_SetJob_r_send(TALLOC_CTX *mem_ctx,
486 struct tevent_context *ev,
487 struct dcerpc_binding_handle *h,
488 struct spoolss_SetJob *r)
490 struct tevent_req *req;
491 struct dcerpc_spoolss_SetJob_r_state *state;
492 struct tevent_req *subreq;
494 req = tevent_req_create(mem_ctx, &state,
495 struct dcerpc_spoolss_SetJob_r_state);
500 state->out_mem_ctx = NULL;
502 subreq = dcerpc_binding_handle_call_send(state, ev, h,
503 NULL, &ndr_table_spoolss,
504 NDR_SPOOLSS_SETJOB, state, r);
505 if (tevent_req_nomem(subreq, req)) {
506 return tevent_req_post(req, ev);
508 tevent_req_set_callback(subreq, dcerpc_spoolss_SetJob_r_done, req);
513 static void dcerpc_spoolss_SetJob_r_done(struct tevent_req *subreq)
515 struct tevent_req *req =
516 tevent_req_callback_data(subreq,
520 status = dcerpc_binding_handle_call_recv(subreq);
522 if (tevent_req_nterror(req, status)) {
526 tevent_req_done(req);
529 NTSTATUS dcerpc_spoolss_SetJob_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
531 struct dcerpc_spoolss_SetJob_r_state *state =
533 struct dcerpc_spoolss_SetJob_r_state);
536 if (tevent_req_is_nterror(req, &status)) {
537 tevent_req_received(req);
541 talloc_steal(mem_ctx, state->out_mem_ctx);
543 tevent_req_received(req);
547 NTSTATUS dcerpc_spoolss_SetJob_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_SetJob *r)
551 status = dcerpc_binding_handle_call(h,
552 NULL, &ndr_table_spoolss,
553 NDR_SPOOLSS_SETJOB, mem_ctx, r);
558 struct dcerpc_spoolss_SetJob_state {
559 struct spoolss_SetJob orig;
560 struct spoolss_SetJob tmp;
561 TALLOC_CTX *out_mem_ctx;
564 static void dcerpc_spoolss_SetJob_done(struct tevent_req *subreq);
566 struct tevent_req *dcerpc_spoolss_SetJob_send(TALLOC_CTX *mem_ctx,
567 struct tevent_context *ev,
568 struct dcerpc_binding_handle *h,
569 struct policy_handle *_handle /* [in] [ref] */,
570 uint32_t _job_id /* [in] */,
571 struct spoolss_JobInfoContainer *_ctr /* [in] [unique] */,
572 enum spoolss_JobControl _command /* [in] */)
574 struct tevent_req *req;
575 struct dcerpc_spoolss_SetJob_state *state;
576 struct tevent_req *subreq;
578 req = tevent_req_create(mem_ctx, &state,
579 struct dcerpc_spoolss_SetJob_state);
583 state->out_mem_ctx = NULL;
586 state->orig.in.handle = _handle;
587 state->orig.in.job_id = _job_id;
588 state->orig.in.ctr = _ctr;
589 state->orig.in.command = _command;
594 ZERO_STRUCT(state->orig.out.result);
596 /* make a temporary copy, that we pass to the dispatch function */
597 state->tmp = state->orig;
599 subreq = dcerpc_spoolss_SetJob_r_send(state, ev, h, &state->tmp);
600 if (tevent_req_nomem(subreq, req)) {
601 return tevent_req_post(req, ev);
603 tevent_req_set_callback(subreq, dcerpc_spoolss_SetJob_done, req);
607 static void dcerpc_spoolss_SetJob_done(struct tevent_req *subreq)
609 struct tevent_req *req = tevent_req_callback_data(
610 subreq, struct tevent_req);
611 struct dcerpc_spoolss_SetJob_state *state = tevent_req_data(
612 req, struct dcerpc_spoolss_SetJob_state);
616 if (state->out_mem_ctx) {
617 mem_ctx = state->out_mem_ctx;
622 status = dcerpc_spoolss_SetJob_r_recv(subreq, mem_ctx);
624 if (tevent_req_nterror(req, status)) {
628 /* Copy out parameters */
631 state->orig.out.result = state->tmp.out.result;
633 /* Reset temporary structure */
634 ZERO_STRUCT(state->tmp);
636 tevent_req_done(req);
639 NTSTATUS dcerpc_spoolss_SetJob_recv(struct tevent_req *req,
643 struct dcerpc_spoolss_SetJob_state *state = tevent_req_data(
644 req, struct dcerpc_spoolss_SetJob_state);
647 if (tevent_req_is_nterror(req, &status)) {
648 tevent_req_received(req);
652 /* Steal possible out parameters to the callers context */
653 talloc_steal(mem_ctx, state->out_mem_ctx);
656 *result = state->orig.out.result;
658 tevent_req_received(req);
662 NTSTATUS dcerpc_spoolss_SetJob(struct dcerpc_binding_handle *h,
664 struct policy_handle *_handle /* [in] [ref] */,
665 uint32_t _job_id /* [in] */,
666 struct spoolss_JobInfoContainer *_ctr /* [in] [unique] */,
667 enum spoolss_JobControl _command /* [in] */,
670 struct spoolss_SetJob r;
674 r.in.handle = _handle;
675 r.in.job_id = _job_id;
677 r.in.command = _command;
679 status = dcerpc_spoolss_SetJob_r(h, mem_ctx, &r);
680 if (!NT_STATUS_IS_OK(status)) {
684 /* Return variables */
687 *result = r.out.result;
692 struct dcerpc_spoolss_GetJob_r_state {
693 TALLOC_CTX *out_mem_ctx;
696 static void dcerpc_spoolss_GetJob_r_done(struct tevent_req *subreq);
698 struct tevent_req *dcerpc_spoolss_GetJob_r_send(TALLOC_CTX *mem_ctx,
699 struct tevent_context *ev,
700 struct dcerpc_binding_handle *h,
701 struct spoolss_GetJob *r)
703 struct tevent_req *req;
704 struct dcerpc_spoolss_GetJob_r_state *state;
705 struct tevent_req *subreq;
707 req = tevent_req_create(mem_ctx, &state,
708 struct dcerpc_spoolss_GetJob_r_state);
713 state->out_mem_ctx = talloc_new(state);
714 if (tevent_req_nomem(state->out_mem_ctx, req)) {
715 return tevent_req_post(req, ev);
718 subreq = dcerpc_binding_handle_call_send(state, ev, h,
719 NULL, &ndr_table_spoolss,
720 NDR_SPOOLSS_GETJOB, state->out_mem_ctx, r);
721 if (tevent_req_nomem(subreq, req)) {
722 return tevent_req_post(req, ev);
724 tevent_req_set_callback(subreq, dcerpc_spoolss_GetJob_r_done, req);
729 static void dcerpc_spoolss_GetJob_r_done(struct tevent_req *subreq)
731 struct tevent_req *req =
732 tevent_req_callback_data(subreq,
736 status = dcerpc_binding_handle_call_recv(subreq);
738 if (tevent_req_nterror(req, status)) {
742 tevent_req_done(req);
745 NTSTATUS dcerpc_spoolss_GetJob_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
747 struct dcerpc_spoolss_GetJob_r_state *state =
749 struct dcerpc_spoolss_GetJob_r_state);
752 if (tevent_req_is_nterror(req, &status)) {
753 tevent_req_received(req);
757 talloc_steal(mem_ctx, state->out_mem_ctx);
759 tevent_req_received(req);
763 NTSTATUS dcerpc_spoolss_GetJob_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetJob *r)
767 status = dcerpc_binding_handle_call(h,
768 NULL, &ndr_table_spoolss,
769 NDR_SPOOLSS_GETJOB, mem_ctx, r);
774 struct dcerpc_spoolss_GetJob_state {
775 struct spoolss_GetJob orig;
776 struct spoolss_GetJob tmp;
777 TALLOC_CTX *out_mem_ctx;
780 static void dcerpc_spoolss_GetJob_done(struct tevent_req *subreq);
782 struct tevent_req *dcerpc_spoolss_GetJob_send(TALLOC_CTX *mem_ctx,
783 struct tevent_context *ev,
784 struct dcerpc_binding_handle *h,
785 struct policy_handle *_handle /* [in] [ref] */,
786 uint32_t _job_id /* [in] */,
787 uint32_t _level /* [in] */,
788 DATA_BLOB *_buffer /* [in] [unique] */,
789 uint32_t _offered /* [in] */,
790 union spoolss_JobInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
791 uint32_t *_needed /* [out] [ref] */)
793 struct tevent_req *req;
794 struct dcerpc_spoolss_GetJob_state *state;
795 struct tevent_req *subreq;
797 req = tevent_req_create(mem_ctx, &state,
798 struct dcerpc_spoolss_GetJob_state);
802 state->out_mem_ctx = NULL;
805 state->orig.in.handle = _handle;
806 state->orig.in.job_id = _job_id;
807 state->orig.in.level = _level;
808 state->orig.in.buffer = _buffer;
809 state->orig.in.offered = _offered;
812 state->orig.out.info = _info;
813 state->orig.out.needed = _needed;
816 ZERO_STRUCT(state->orig.out.result);
818 state->out_mem_ctx = talloc_named_const(state, 0,
819 "dcerpc_spoolss_GetJob_out_memory");
820 if (tevent_req_nomem(state->out_mem_ctx, req)) {
821 return tevent_req_post(req, ev);
824 /* make a temporary copy, that we pass to the dispatch function */
825 state->tmp = state->orig;
827 subreq = dcerpc_spoolss_GetJob_r_send(state, ev, h, &state->tmp);
828 if (tevent_req_nomem(subreq, req)) {
829 return tevent_req_post(req, ev);
831 tevent_req_set_callback(subreq, dcerpc_spoolss_GetJob_done, req);
835 static void dcerpc_spoolss_GetJob_done(struct tevent_req *subreq)
837 struct tevent_req *req = tevent_req_callback_data(
838 subreq, struct tevent_req);
839 struct dcerpc_spoolss_GetJob_state *state = tevent_req_data(
840 req, struct dcerpc_spoolss_GetJob_state);
844 if (state->out_mem_ctx) {
845 mem_ctx = state->out_mem_ctx;
850 status = dcerpc_spoolss_GetJob_r_recv(subreq, mem_ctx);
852 if (tevent_req_nterror(req, status)) {
856 /* Copy out parameters */
857 if (state->orig.out.info && state->tmp.out.info) {
858 *state->orig.out.info = *state->tmp.out.info;
860 *state->orig.out.needed = *state->tmp.out.needed;
863 state->orig.out.result = state->tmp.out.result;
865 /* Reset temporary structure */
866 ZERO_STRUCT(state->tmp);
868 tevent_req_done(req);
871 NTSTATUS dcerpc_spoolss_GetJob_recv(struct tevent_req *req,
875 struct dcerpc_spoolss_GetJob_state *state = tevent_req_data(
876 req, struct dcerpc_spoolss_GetJob_state);
879 if (tevent_req_is_nterror(req, &status)) {
880 tevent_req_received(req);
884 /* Steal possible out parameters to the callers context */
885 talloc_steal(mem_ctx, state->out_mem_ctx);
888 *result = state->orig.out.result;
890 tevent_req_received(req);
894 NTSTATUS dcerpc_spoolss_GetJob(struct dcerpc_binding_handle *h,
896 struct policy_handle *_handle /* [in] [ref] */,
897 uint32_t _job_id /* [in] */,
898 uint32_t _level /* [in] */,
899 DATA_BLOB *_buffer /* [in] [unique] */,
900 uint32_t _offered /* [in] */,
901 union spoolss_JobInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
902 uint32_t *_needed /* [out] [ref] */,
905 struct spoolss_GetJob r;
909 r.in.handle = _handle;
910 r.in.job_id = _job_id;
912 r.in.buffer = _buffer;
913 r.in.offered = _offered;
915 status = dcerpc_spoolss_GetJob_r(h, mem_ctx, &r);
916 if (!NT_STATUS_IS_OK(status)) {
920 /* Return variables */
921 if (_info && r.out.info) {
922 *_info = *r.out.info;
924 *_needed = *r.out.needed;
927 *result = r.out.result;
932 struct dcerpc_spoolss_EnumJobs_r_state {
933 TALLOC_CTX *out_mem_ctx;
936 static void dcerpc_spoolss_EnumJobs_r_done(struct tevent_req *subreq);
938 struct tevent_req *dcerpc_spoolss_EnumJobs_r_send(TALLOC_CTX *mem_ctx,
939 struct tevent_context *ev,
940 struct dcerpc_binding_handle *h,
941 struct spoolss_EnumJobs *r)
943 struct tevent_req *req;
944 struct dcerpc_spoolss_EnumJobs_r_state *state;
945 struct tevent_req *subreq;
947 req = tevent_req_create(mem_ctx, &state,
948 struct dcerpc_spoolss_EnumJobs_r_state);
953 state->out_mem_ctx = talloc_new(state);
954 if (tevent_req_nomem(state->out_mem_ctx, req)) {
955 return tevent_req_post(req, ev);
958 subreq = dcerpc_binding_handle_call_send(state, ev, h,
959 NULL, &ndr_table_spoolss,
960 NDR_SPOOLSS_ENUMJOBS, state->out_mem_ctx, r);
961 if (tevent_req_nomem(subreq, req)) {
962 return tevent_req_post(req, ev);
964 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumJobs_r_done, req);
969 static void dcerpc_spoolss_EnumJobs_r_done(struct tevent_req *subreq)
971 struct tevent_req *req =
972 tevent_req_callback_data(subreq,
976 status = dcerpc_binding_handle_call_recv(subreq);
978 if (tevent_req_nterror(req, status)) {
982 tevent_req_done(req);
985 NTSTATUS dcerpc_spoolss_EnumJobs_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
987 struct dcerpc_spoolss_EnumJobs_r_state *state =
989 struct dcerpc_spoolss_EnumJobs_r_state);
992 if (tevent_req_is_nterror(req, &status)) {
993 tevent_req_received(req);
997 talloc_steal(mem_ctx, state->out_mem_ctx);
999 tevent_req_received(req);
1000 return NT_STATUS_OK;
1003 NTSTATUS dcerpc_spoolss_EnumJobs_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumJobs *r)
1007 status = dcerpc_binding_handle_call(h,
1008 NULL, &ndr_table_spoolss,
1009 NDR_SPOOLSS_ENUMJOBS, mem_ctx, r);
1014 struct dcerpc_spoolss_EnumJobs_state {
1015 struct spoolss_EnumJobs orig;
1016 struct spoolss_EnumJobs tmp;
1017 TALLOC_CTX *out_mem_ctx;
1020 static void dcerpc_spoolss_EnumJobs_done(struct tevent_req *subreq);
1022 struct tevent_req *dcerpc_spoolss_EnumJobs_send(TALLOC_CTX *mem_ctx,
1023 struct tevent_context *ev,
1024 struct dcerpc_binding_handle *h,
1025 struct policy_handle *_handle /* [in] [ref] */,
1026 uint32_t _firstjob /* [in] */,
1027 uint32_t _numjobs /* [in] */,
1028 uint32_t _level /* [in] */,
1029 DATA_BLOB *_buffer /* [in] [unique] */,
1030 uint32_t _offered /* [in] */,
1031 uint32_t *_count /* [out] [ref] */,
1032 union spoolss_JobInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
1033 uint32_t *_needed /* [out] [ref] */)
1035 struct tevent_req *req;
1036 struct dcerpc_spoolss_EnumJobs_state *state;
1037 struct tevent_req *subreq;
1039 req = tevent_req_create(mem_ctx, &state,
1040 struct dcerpc_spoolss_EnumJobs_state);
1044 state->out_mem_ctx = NULL;
1047 state->orig.in.handle = _handle;
1048 state->orig.in.firstjob = _firstjob;
1049 state->orig.in.numjobs = _numjobs;
1050 state->orig.in.level = _level;
1051 state->orig.in.buffer = _buffer;
1052 state->orig.in.offered = _offered;
1054 /* Out parameters */
1055 state->orig.out.count = _count;
1056 state->orig.out.info = _info;
1057 state->orig.out.needed = _needed;
1060 ZERO_STRUCT(state->orig.out.result);
1062 state->out_mem_ctx = talloc_named_const(state, 0,
1063 "dcerpc_spoolss_EnumJobs_out_memory");
1064 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1065 return tevent_req_post(req, ev);
1068 /* make a temporary copy, that we pass to the dispatch function */
1069 state->tmp = state->orig;
1071 subreq = dcerpc_spoolss_EnumJobs_r_send(state, ev, h, &state->tmp);
1072 if (tevent_req_nomem(subreq, req)) {
1073 return tevent_req_post(req, ev);
1075 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumJobs_done, req);
1079 static void dcerpc_spoolss_EnumJobs_done(struct tevent_req *subreq)
1081 struct tevent_req *req = tevent_req_callback_data(
1082 subreq, struct tevent_req);
1083 struct dcerpc_spoolss_EnumJobs_state *state = tevent_req_data(
1084 req, struct dcerpc_spoolss_EnumJobs_state);
1086 TALLOC_CTX *mem_ctx;
1088 if (state->out_mem_ctx) {
1089 mem_ctx = state->out_mem_ctx;
1094 status = dcerpc_spoolss_EnumJobs_r_recv(subreq, mem_ctx);
1095 TALLOC_FREE(subreq);
1096 if (tevent_req_nterror(req, status)) {
1100 /* Copy out parameters */
1101 *state->orig.out.count = *state->tmp.out.count;
1102 *state->orig.out.info = *state->tmp.out.info;
1103 *state->orig.out.needed = *state->tmp.out.needed;
1106 state->orig.out.result = state->tmp.out.result;
1108 /* Reset temporary structure */
1109 ZERO_STRUCT(state->tmp);
1111 tevent_req_done(req);
1114 NTSTATUS dcerpc_spoolss_EnumJobs_recv(struct tevent_req *req,
1115 TALLOC_CTX *mem_ctx,
1118 struct dcerpc_spoolss_EnumJobs_state *state = tevent_req_data(
1119 req, struct dcerpc_spoolss_EnumJobs_state);
1122 if (tevent_req_is_nterror(req, &status)) {
1123 tevent_req_received(req);
1127 /* Steal possible out parameters to the callers context */
1128 talloc_steal(mem_ctx, state->out_mem_ctx);
1131 *result = state->orig.out.result;
1133 tevent_req_received(req);
1134 return NT_STATUS_OK;
1137 NTSTATUS dcerpc_spoolss_EnumJobs(struct dcerpc_binding_handle *h,
1138 TALLOC_CTX *mem_ctx,
1139 struct policy_handle *_handle /* [in] [ref] */,
1140 uint32_t _firstjob /* [in] */,
1141 uint32_t _numjobs /* [in] */,
1142 uint32_t _level /* [in] */,
1143 DATA_BLOB *_buffer /* [in] [unique] */,
1144 uint32_t _offered /* [in] */,
1145 uint32_t *_count /* [out] [ref] */,
1146 union spoolss_JobInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
1147 uint32_t *_needed /* [out] [ref] */,
1150 struct spoolss_EnumJobs r;
1154 r.in.handle = _handle;
1155 r.in.firstjob = _firstjob;
1156 r.in.numjobs = _numjobs;
1157 r.in.level = _level;
1158 r.in.buffer = _buffer;
1159 r.in.offered = _offered;
1161 status = dcerpc_spoolss_EnumJobs_r(h, mem_ctx, &r);
1162 if (!NT_STATUS_IS_OK(status)) {
1166 /* Return variables */
1167 *_count = *r.out.count;
1168 *_info = *r.out.info;
1169 *_needed = *r.out.needed;
1172 *result = r.out.result;
1174 return NT_STATUS_OK;
1177 struct dcerpc_spoolss_AddPrinter_r_state {
1178 TALLOC_CTX *out_mem_ctx;
1181 static void dcerpc_spoolss_AddPrinter_r_done(struct tevent_req *subreq);
1183 struct tevent_req *dcerpc_spoolss_AddPrinter_r_send(TALLOC_CTX *mem_ctx,
1184 struct tevent_context *ev,
1185 struct dcerpc_binding_handle *h,
1186 struct spoolss_AddPrinter *r)
1188 struct tevent_req *req;
1189 struct dcerpc_spoolss_AddPrinter_r_state *state;
1190 struct tevent_req *subreq;
1192 req = tevent_req_create(mem_ctx, &state,
1193 struct dcerpc_spoolss_AddPrinter_r_state);
1198 state->out_mem_ctx = talloc_new(state);
1199 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1200 return tevent_req_post(req, ev);
1203 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1204 NULL, &ndr_table_spoolss,
1205 NDR_SPOOLSS_ADDPRINTER, state->out_mem_ctx, r);
1206 if (tevent_req_nomem(subreq, req)) {
1207 return tevent_req_post(req, ev);
1209 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinter_r_done, req);
1214 static void dcerpc_spoolss_AddPrinter_r_done(struct tevent_req *subreq)
1216 struct tevent_req *req =
1217 tevent_req_callback_data(subreq,
1221 status = dcerpc_binding_handle_call_recv(subreq);
1222 TALLOC_FREE(subreq);
1223 if (tevent_req_nterror(req, status)) {
1227 tevent_req_done(req);
1230 NTSTATUS dcerpc_spoolss_AddPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1232 struct dcerpc_spoolss_AddPrinter_r_state *state =
1233 tevent_req_data(req,
1234 struct dcerpc_spoolss_AddPrinter_r_state);
1237 if (tevent_req_is_nterror(req, &status)) {
1238 tevent_req_received(req);
1242 talloc_steal(mem_ctx, state->out_mem_ctx);
1244 tevent_req_received(req);
1245 return NT_STATUS_OK;
1248 NTSTATUS dcerpc_spoolss_AddPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPrinter *r)
1252 status = dcerpc_binding_handle_call(h,
1253 NULL, &ndr_table_spoolss,
1254 NDR_SPOOLSS_ADDPRINTER, mem_ctx, r);
1259 struct dcerpc_spoolss_AddPrinter_state {
1260 struct spoolss_AddPrinter orig;
1261 struct spoolss_AddPrinter tmp;
1262 TALLOC_CTX *out_mem_ctx;
1265 static void dcerpc_spoolss_AddPrinter_done(struct tevent_req *subreq);
1267 struct tevent_req *dcerpc_spoolss_AddPrinter_send(TALLOC_CTX *mem_ctx,
1268 struct tevent_context *ev,
1269 struct dcerpc_binding_handle *h,
1270 const char *_server /* [in] [unique,charset(UTF16)] */,
1271 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
1272 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
1273 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
1274 struct policy_handle *_handle /* [out] [ref] */)
1276 struct tevent_req *req;
1277 struct dcerpc_spoolss_AddPrinter_state *state;
1278 struct tevent_req *subreq;
1280 req = tevent_req_create(mem_ctx, &state,
1281 struct dcerpc_spoolss_AddPrinter_state);
1285 state->out_mem_ctx = NULL;
1288 state->orig.in.server = _server;
1289 state->orig.in.info_ctr = _info_ctr;
1290 state->orig.in.devmode_ctr = _devmode_ctr;
1291 state->orig.in.secdesc_ctr = _secdesc_ctr;
1293 /* Out parameters */
1294 state->orig.out.handle = _handle;
1297 ZERO_STRUCT(state->orig.out.result);
1299 state->out_mem_ctx = talloc_named_const(state, 0,
1300 "dcerpc_spoolss_AddPrinter_out_memory");
1301 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1302 return tevent_req_post(req, ev);
1305 /* make a temporary copy, that we pass to the dispatch function */
1306 state->tmp = state->orig;
1308 subreq = dcerpc_spoolss_AddPrinter_r_send(state, ev, h, &state->tmp);
1309 if (tevent_req_nomem(subreq, req)) {
1310 return tevent_req_post(req, ev);
1312 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinter_done, req);
1316 static void dcerpc_spoolss_AddPrinter_done(struct tevent_req *subreq)
1318 struct tevent_req *req = tevent_req_callback_data(
1319 subreq, struct tevent_req);
1320 struct dcerpc_spoolss_AddPrinter_state *state = tevent_req_data(
1321 req, struct dcerpc_spoolss_AddPrinter_state);
1323 TALLOC_CTX *mem_ctx;
1325 if (state->out_mem_ctx) {
1326 mem_ctx = state->out_mem_ctx;
1331 status = dcerpc_spoolss_AddPrinter_r_recv(subreq, mem_ctx);
1332 TALLOC_FREE(subreq);
1333 if (tevent_req_nterror(req, status)) {
1337 /* Copy out parameters */
1338 *state->orig.out.handle = *state->tmp.out.handle;
1341 state->orig.out.result = state->tmp.out.result;
1343 /* Reset temporary structure */
1344 ZERO_STRUCT(state->tmp);
1346 tevent_req_done(req);
1349 NTSTATUS dcerpc_spoolss_AddPrinter_recv(struct tevent_req *req,
1350 TALLOC_CTX *mem_ctx,
1353 struct dcerpc_spoolss_AddPrinter_state *state = tevent_req_data(
1354 req, struct dcerpc_spoolss_AddPrinter_state);
1357 if (tevent_req_is_nterror(req, &status)) {
1358 tevent_req_received(req);
1362 /* Steal possible out parameters to the callers context */
1363 talloc_steal(mem_ctx, state->out_mem_ctx);
1366 *result = state->orig.out.result;
1368 tevent_req_received(req);
1369 return NT_STATUS_OK;
1372 NTSTATUS dcerpc_spoolss_AddPrinter(struct dcerpc_binding_handle *h,
1373 TALLOC_CTX *mem_ctx,
1374 const char *_server /* [in] [unique,charset(UTF16)] */,
1375 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
1376 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
1377 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
1378 struct policy_handle *_handle /* [out] [ref] */,
1381 struct spoolss_AddPrinter r;
1385 r.in.server = _server;
1386 r.in.info_ctr = _info_ctr;
1387 r.in.devmode_ctr = _devmode_ctr;
1388 r.in.secdesc_ctr = _secdesc_ctr;
1390 status = dcerpc_spoolss_AddPrinter_r(h, mem_ctx, &r);
1391 if (!NT_STATUS_IS_OK(status)) {
1395 /* Return variables */
1396 *_handle = *r.out.handle;
1399 *result = r.out.result;
1401 return NT_STATUS_OK;
1404 struct dcerpc_spoolss_DeletePrinter_r_state {
1405 TALLOC_CTX *out_mem_ctx;
1408 static void dcerpc_spoolss_DeletePrinter_r_done(struct tevent_req *subreq);
1410 struct tevent_req *dcerpc_spoolss_DeletePrinter_r_send(TALLOC_CTX *mem_ctx,
1411 struct tevent_context *ev,
1412 struct dcerpc_binding_handle *h,
1413 struct spoolss_DeletePrinter *r)
1415 struct tevent_req *req;
1416 struct dcerpc_spoolss_DeletePrinter_r_state *state;
1417 struct tevent_req *subreq;
1419 req = tevent_req_create(mem_ctx, &state,
1420 struct dcerpc_spoolss_DeletePrinter_r_state);
1425 state->out_mem_ctx = NULL;
1427 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1428 NULL, &ndr_table_spoolss,
1429 NDR_SPOOLSS_DELETEPRINTER, state, r);
1430 if (tevent_req_nomem(subreq, req)) {
1431 return tevent_req_post(req, ev);
1433 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinter_r_done, req);
1438 static void dcerpc_spoolss_DeletePrinter_r_done(struct tevent_req *subreq)
1440 struct tevent_req *req =
1441 tevent_req_callback_data(subreq,
1445 status = dcerpc_binding_handle_call_recv(subreq);
1446 TALLOC_FREE(subreq);
1447 if (tevent_req_nterror(req, status)) {
1451 tevent_req_done(req);
1454 NTSTATUS dcerpc_spoolss_DeletePrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1456 struct dcerpc_spoolss_DeletePrinter_r_state *state =
1457 tevent_req_data(req,
1458 struct dcerpc_spoolss_DeletePrinter_r_state);
1461 if (tevent_req_is_nterror(req, &status)) {
1462 tevent_req_received(req);
1466 talloc_steal(mem_ctx, state->out_mem_ctx);
1468 tevent_req_received(req);
1469 return NT_STATUS_OK;
1472 NTSTATUS dcerpc_spoolss_DeletePrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinter *r)
1476 status = dcerpc_binding_handle_call(h,
1477 NULL, &ndr_table_spoolss,
1478 NDR_SPOOLSS_DELETEPRINTER, mem_ctx, r);
1483 struct dcerpc_spoolss_DeletePrinter_state {
1484 struct spoolss_DeletePrinter orig;
1485 struct spoolss_DeletePrinter tmp;
1486 TALLOC_CTX *out_mem_ctx;
1489 static void dcerpc_spoolss_DeletePrinter_done(struct tevent_req *subreq);
1491 struct tevent_req *dcerpc_spoolss_DeletePrinter_send(TALLOC_CTX *mem_ctx,
1492 struct tevent_context *ev,
1493 struct dcerpc_binding_handle *h,
1494 struct policy_handle *_handle /* [in] [ref] */)
1496 struct tevent_req *req;
1497 struct dcerpc_spoolss_DeletePrinter_state *state;
1498 struct tevent_req *subreq;
1500 req = tevent_req_create(mem_ctx, &state,
1501 struct dcerpc_spoolss_DeletePrinter_state);
1505 state->out_mem_ctx = NULL;
1508 state->orig.in.handle = _handle;
1510 /* Out parameters */
1513 ZERO_STRUCT(state->orig.out.result);
1515 /* make a temporary copy, that we pass to the dispatch function */
1516 state->tmp = state->orig;
1518 subreq = dcerpc_spoolss_DeletePrinter_r_send(state, ev, h, &state->tmp);
1519 if (tevent_req_nomem(subreq, req)) {
1520 return tevent_req_post(req, ev);
1522 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinter_done, req);
1526 static void dcerpc_spoolss_DeletePrinter_done(struct tevent_req *subreq)
1528 struct tevent_req *req = tevent_req_callback_data(
1529 subreq, struct tevent_req);
1530 struct dcerpc_spoolss_DeletePrinter_state *state = tevent_req_data(
1531 req, struct dcerpc_spoolss_DeletePrinter_state);
1533 TALLOC_CTX *mem_ctx;
1535 if (state->out_mem_ctx) {
1536 mem_ctx = state->out_mem_ctx;
1541 status = dcerpc_spoolss_DeletePrinter_r_recv(subreq, mem_ctx);
1542 TALLOC_FREE(subreq);
1543 if (tevent_req_nterror(req, status)) {
1547 /* Copy out parameters */
1550 state->orig.out.result = state->tmp.out.result;
1552 /* Reset temporary structure */
1553 ZERO_STRUCT(state->tmp);
1555 tevent_req_done(req);
1558 NTSTATUS dcerpc_spoolss_DeletePrinter_recv(struct tevent_req *req,
1559 TALLOC_CTX *mem_ctx,
1562 struct dcerpc_spoolss_DeletePrinter_state *state = tevent_req_data(
1563 req, struct dcerpc_spoolss_DeletePrinter_state);
1566 if (tevent_req_is_nterror(req, &status)) {
1567 tevent_req_received(req);
1571 /* Steal possible out parameters to the callers context */
1572 talloc_steal(mem_ctx, state->out_mem_ctx);
1575 *result = state->orig.out.result;
1577 tevent_req_received(req);
1578 return NT_STATUS_OK;
1581 NTSTATUS dcerpc_spoolss_DeletePrinter(struct dcerpc_binding_handle *h,
1582 TALLOC_CTX *mem_ctx,
1583 struct policy_handle *_handle /* [in] [ref] */,
1586 struct spoolss_DeletePrinter r;
1590 r.in.handle = _handle;
1592 status = dcerpc_spoolss_DeletePrinter_r(h, mem_ctx, &r);
1593 if (!NT_STATUS_IS_OK(status)) {
1597 /* Return variables */
1600 *result = r.out.result;
1602 return NT_STATUS_OK;
1605 struct dcerpc_spoolss_SetPrinter_r_state {
1606 TALLOC_CTX *out_mem_ctx;
1609 static void dcerpc_spoolss_SetPrinter_r_done(struct tevent_req *subreq);
1611 struct tevent_req *dcerpc_spoolss_SetPrinter_r_send(TALLOC_CTX *mem_ctx,
1612 struct tevent_context *ev,
1613 struct dcerpc_binding_handle *h,
1614 struct spoolss_SetPrinter *r)
1616 struct tevent_req *req;
1617 struct dcerpc_spoolss_SetPrinter_r_state *state;
1618 struct tevent_req *subreq;
1620 req = tevent_req_create(mem_ctx, &state,
1621 struct dcerpc_spoolss_SetPrinter_r_state);
1626 state->out_mem_ctx = NULL;
1628 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1629 NULL, &ndr_table_spoolss,
1630 NDR_SPOOLSS_SETPRINTER, state, r);
1631 if (tevent_req_nomem(subreq, req)) {
1632 return tevent_req_post(req, ev);
1634 tevent_req_set_callback(subreq, dcerpc_spoolss_SetPrinter_r_done, req);
1639 static void dcerpc_spoolss_SetPrinter_r_done(struct tevent_req *subreq)
1641 struct tevent_req *req =
1642 tevent_req_callback_data(subreq,
1646 status = dcerpc_binding_handle_call_recv(subreq);
1647 TALLOC_FREE(subreq);
1648 if (tevent_req_nterror(req, status)) {
1652 tevent_req_done(req);
1655 NTSTATUS dcerpc_spoolss_SetPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1657 struct dcerpc_spoolss_SetPrinter_r_state *state =
1658 tevent_req_data(req,
1659 struct dcerpc_spoolss_SetPrinter_r_state);
1662 if (tevent_req_is_nterror(req, &status)) {
1663 tevent_req_received(req);
1667 talloc_steal(mem_ctx, state->out_mem_ctx);
1669 tevent_req_received(req);
1670 return NT_STATUS_OK;
1673 NTSTATUS dcerpc_spoolss_SetPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_SetPrinter *r)
1677 status = dcerpc_binding_handle_call(h,
1678 NULL, &ndr_table_spoolss,
1679 NDR_SPOOLSS_SETPRINTER, mem_ctx, r);
1684 struct dcerpc_spoolss_SetPrinter_state {
1685 struct spoolss_SetPrinter orig;
1686 struct spoolss_SetPrinter tmp;
1687 TALLOC_CTX *out_mem_ctx;
1690 static void dcerpc_spoolss_SetPrinter_done(struct tevent_req *subreq);
1692 struct tevent_req *dcerpc_spoolss_SetPrinter_send(TALLOC_CTX *mem_ctx,
1693 struct tevent_context *ev,
1694 struct dcerpc_binding_handle *h,
1695 struct policy_handle *_handle /* [in] [ref] */,
1696 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
1697 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
1698 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
1699 enum spoolss_PrinterControl _command /* [in] */)
1701 struct tevent_req *req;
1702 struct dcerpc_spoolss_SetPrinter_state *state;
1703 struct tevent_req *subreq;
1705 req = tevent_req_create(mem_ctx, &state,
1706 struct dcerpc_spoolss_SetPrinter_state);
1710 state->out_mem_ctx = NULL;
1713 state->orig.in.handle = _handle;
1714 state->orig.in.info_ctr = _info_ctr;
1715 state->orig.in.devmode_ctr = _devmode_ctr;
1716 state->orig.in.secdesc_ctr = _secdesc_ctr;
1717 state->orig.in.command = _command;
1719 /* Out parameters */
1722 ZERO_STRUCT(state->orig.out.result);
1724 /* make a temporary copy, that we pass to the dispatch function */
1725 state->tmp = state->orig;
1727 subreq = dcerpc_spoolss_SetPrinter_r_send(state, ev, h, &state->tmp);
1728 if (tevent_req_nomem(subreq, req)) {
1729 return tevent_req_post(req, ev);
1731 tevent_req_set_callback(subreq, dcerpc_spoolss_SetPrinter_done, req);
1735 static void dcerpc_spoolss_SetPrinter_done(struct tevent_req *subreq)
1737 struct tevent_req *req = tevent_req_callback_data(
1738 subreq, struct tevent_req);
1739 struct dcerpc_spoolss_SetPrinter_state *state = tevent_req_data(
1740 req, struct dcerpc_spoolss_SetPrinter_state);
1742 TALLOC_CTX *mem_ctx;
1744 if (state->out_mem_ctx) {
1745 mem_ctx = state->out_mem_ctx;
1750 status = dcerpc_spoolss_SetPrinter_r_recv(subreq, mem_ctx);
1751 TALLOC_FREE(subreq);
1752 if (tevent_req_nterror(req, status)) {
1756 /* Copy out parameters */
1759 state->orig.out.result = state->tmp.out.result;
1761 /* Reset temporary structure */
1762 ZERO_STRUCT(state->tmp);
1764 tevent_req_done(req);
1767 NTSTATUS dcerpc_spoolss_SetPrinter_recv(struct tevent_req *req,
1768 TALLOC_CTX *mem_ctx,
1771 struct dcerpc_spoolss_SetPrinter_state *state = tevent_req_data(
1772 req, struct dcerpc_spoolss_SetPrinter_state);
1775 if (tevent_req_is_nterror(req, &status)) {
1776 tevent_req_received(req);
1780 /* Steal possible out parameters to the callers context */
1781 talloc_steal(mem_ctx, state->out_mem_ctx);
1784 *result = state->orig.out.result;
1786 tevent_req_received(req);
1787 return NT_STATUS_OK;
1790 NTSTATUS dcerpc_spoolss_SetPrinter(struct dcerpc_binding_handle *h,
1791 TALLOC_CTX *mem_ctx,
1792 struct policy_handle *_handle /* [in] [ref] */,
1793 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
1794 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
1795 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
1796 enum spoolss_PrinterControl _command /* [in] */,
1799 struct spoolss_SetPrinter r;
1803 r.in.handle = _handle;
1804 r.in.info_ctr = _info_ctr;
1805 r.in.devmode_ctr = _devmode_ctr;
1806 r.in.secdesc_ctr = _secdesc_ctr;
1807 r.in.command = _command;
1809 status = dcerpc_spoolss_SetPrinter_r(h, mem_ctx, &r);
1810 if (!NT_STATUS_IS_OK(status)) {
1814 /* Return variables */
1817 *result = r.out.result;
1819 return NT_STATUS_OK;
1822 struct dcerpc_spoolss_GetPrinter_r_state {
1823 TALLOC_CTX *out_mem_ctx;
1826 static void dcerpc_spoolss_GetPrinter_r_done(struct tevent_req *subreq);
1828 struct tevent_req *dcerpc_spoolss_GetPrinter_r_send(TALLOC_CTX *mem_ctx,
1829 struct tevent_context *ev,
1830 struct dcerpc_binding_handle *h,
1831 struct spoolss_GetPrinter *r)
1833 struct tevent_req *req;
1834 struct dcerpc_spoolss_GetPrinter_r_state *state;
1835 struct tevent_req *subreq;
1837 req = tevent_req_create(mem_ctx, &state,
1838 struct dcerpc_spoolss_GetPrinter_r_state);
1843 state->out_mem_ctx = talloc_new(state);
1844 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1845 return tevent_req_post(req, ev);
1848 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1849 NULL, &ndr_table_spoolss,
1850 NDR_SPOOLSS_GETPRINTER, state->out_mem_ctx, r);
1851 if (tevent_req_nomem(subreq, req)) {
1852 return tevent_req_post(req, ev);
1854 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinter_r_done, req);
1859 static void dcerpc_spoolss_GetPrinter_r_done(struct tevent_req *subreq)
1861 struct tevent_req *req =
1862 tevent_req_callback_data(subreq,
1866 status = dcerpc_binding_handle_call_recv(subreq);
1867 TALLOC_FREE(subreq);
1868 if (tevent_req_nterror(req, status)) {
1872 tevent_req_done(req);
1875 NTSTATUS dcerpc_spoolss_GetPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1877 struct dcerpc_spoolss_GetPrinter_r_state *state =
1878 tevent_req_data(req,
1879 struct dcerpc_spoolss_GetPrinter_r_state);
1882 if (tevent_req_is_nterror(req, &status)) {
1883 tevent_req_received(req);
1887 talloc_steal(mem_ctx, state->out_mem_ctx);
1889 tevent_req_received(req);
1890 return NT_STATUS_OK;
1893 NTSTATUS dcerpc_spoolss_GetPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetPrinter *r)
1897 status = dcerpc_binding_handle_call(h,
1898 NULL, &ndr_table_spoolss,
1899 NDR_SPOOLSS_GETPRINTER, mem_ctx, r);
1904 struct dcerpc_spoolss_GetPrinter_state {
1905 struct spoolss_GetPrinter orig;
1906 struct spoolss_GetPrinter tmp;
1907 TALLOC_CTX *out_mem_ctx;
1910 static void dcerpc_spoolss_GetPrinter_done(struct tevent_req *subreq);
1912 struct tevent_req *dcerpc_spoolss_GetPrinter_send(TALLOC_CTX *mem_ctx,
1913 struct tevent_context *ev,
1914 struct dcerpc_binding_handle *h,
1915 struct policy_handle *_handle /* [in] [ref] */,
1916 uint32_t _level /* [in] */,
1917 DATA_BLOB *_buffer /* [in] [unique] */,
1918 uint32_t _offered /* [in] */,
1919 union spoolss_PrinterInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1920 uint32_t *_needed /* [out] [ref] */)
1922 struct tevent_req *req;
1923 struct dcerpc_spoolss_GetPrinter_state *state;
1924 struct tevent_req *subreq;
1926 req = tevent_req_create(mem_ctx, &state,
1927 struct dcerpc_spoolss_GetPrinter_state);
1931 state->out_mem_ctx = NULL;
1934 state->orig.in.handle = _handle;
1935 state->orig.in.level = _level;
1936 state->orig.in.buffer = _buffer;
1937 state->orig.in.offered = _offered;
1939 /* Out parameters */
1940 state->orig.out.info = _info;
1941 state->orig.out.needed = _needed;
1944 ZERO_STRUCT(state->orig.out.result);
1946 state->out_mem_ctx = talloc_named_const(state, 0,
1947 "dcerpc_spoolss_GetPrinter_out_memory");
1948 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1949 return tevent_req_post(req, ev);
1952 /* make a temporary copy, that we pass to the dispatch function */
1953 state->tmp = state->orig;
1955 subreq = dcerpc_spoolss_GetPrinter_r_send(state, ev, h, &state->tmp);
1956 if (tevent_req_nomem(subreq, req)) {
1957 return tevent_req_post(req, ev);
1959 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinter_done, req);
1963 static void dcerpc_spoolss_GetPrinter_done(struct tevent_req *subreq)
1965 struct tevent_req *req = tevent_req_callback_data(
1966 subreq, struct tevent_req);
1967 struct dcerpc_spoolss_GetPrinter_state *state = tevent_req_data(
1968 req, struct dcerpc_spoolss_GetPrinter_state);
1970 TALLOC_CTX *mem_ctx;
1972 if (state->out_mem_ctx) {
1973 mem_ctx = state->out_mem_ctx;
1978 status = dcerpc_spoolss_GetPrinter_r_recv(subreq, mem_ctx);
1979 TALLOC_FREE(subreq);
1980 if (tevent_req_nterror(req, status)) {
1984 /* Copy out parameters */
1985 if (state->orig.out.info && state->tmp.out.info) {
1986 *state->orig.out.info = *state->tmp.out.info;
1988 *state->orig.out.needed = *state->tmp.out.needed;
1991 state->orig.out.result = state->tmp.out.result;
1993 /* Reset temporary structure */
1994 ZERO_STRUCT(state->tmp);
1996 tevent_req_done(req);
1999 NTSTATUS dcerpc_spoolss_GetPrinter_recv(struct tevent_req *req,
2000 TALLOC_CTX *mem_ctx,
2003 struct dcerpc_spoolss_GetPrinter_state *state = tevent_req_data(
2004 req, struct dcerpc_spoolss_GetPrinter_state);
2007 if (tevent_req_is_nterror(req, &status)) {
2008 tevent_req_received(req);
2012 /* Steal possible out parameters to the callers context */
2013 talloc_steal(mem_ctx, state->out_mem_ctx);
2016 *result = state->orig.out.result;
2018 tevent_req_received(req);
2019 return NT_STATUS_OK;
2022 NTSTATUS dcerpc_spoolss_GetPrinter(struct dcerpc_binding_handle *h,
2023 TALLOC_CTX *mem_ctx,
2024 struct policy_handle *_handle /* [in] [ref] */,
2025 uint32_t _level /* [in] */,
2026 DATA_BLOB *_buffer /* [in] [unique] */,
2027 uint32_t _offered /* [in] */,
2028 union spoolss_PrinterInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2029 uint32_t *_needed /* [out] [ref] */,
2032 struct spoolss_GetPrinter r;
2036 r.in.handle = _handle;
2037 r.in.level = _level;
2038 r.in.buffer = _buffer;
2039 r.in.offered = _offered;
2041 status = dcerpc_spoolss_GetPrinter_r(h, mem_ctx, &r);
2042 if (!NT_STATUS_IS_OK(status)) {
2046 /* Return variables */
2047 if (_info && r.out.info) {
2048 *_info = *r.out.info;
2050 *_needed = *r.out.needed;
2053 *result = r.out.result;
2055 return NT_STATUS_OK;
2058 struct dcerpc_spoolss_AddPrinterDriver_r_state {
2059 TALLOC_CTX *out_mem_ctx;
2062 static void dcerpc_spoolss_AddPrinterDriver_r_done(struct tevent_req *subreq);
2064 struct tevent_req *dcerpc_spoolss_AddPrinterDriver_r_send(TALLOC_CTX *mem_ctx,
2065 struct tevent_context *ev,
2066 struct dcerpc_binding_handle *h,
2067 struct spoolss_AddPrinterDriver *r)
2069 struct tevent_req *req;
2070 struct dcerpc_spoolss_AddPrinterDriver_r_state *state;
2071 struct tevent_req *subreq;
2073 req = tevent_req_create(mem_ctx, &state,
2074 struct dcerpc_spoolss_AddPrinterDriver_r_state);
2079 state->out_mem_ctx = NULL;
2081 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2082 NULL, &ndr_table_spoolss,
2083 NDR_SPOOLSS_ADDPRINTERDRIVER, state, r);
2084 if (tevent_req_nomem(subreq, req)) {
2085 return tevent_req_post(req, ev);
2087 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinterDriver_r_done, req);
2092 static void dcerpc_spoolss_AddPrinterDriver_r_done(struct tevent_req *subreq)
2094 struct tevent_req *req =
2095 tevent_req_callback_data(subreq,
2099 status = dcerpc_binding_handle_call_recv(subreq);
2100 TALLOC_FREE(subreq);
2101 if (tevent_req_nterror(req, status)) {
2105 tevent_req_done(req);
2108 NTSTATUS dcerpc_spoolss_AddPrinterDriver_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2110 struct dcerpc_spoolss_AddPrinterDriver_r_state *state =
2111 tevent_req_data(req,
2112 struct dcerpc_spoolss_AddPrinterDriver_r_state);
2115 if (tevent_req_is_nterror(req, &status)) {
2116 tevent_req_received(req);
2120 talloc_steal(mem_ctx, state->out_mem_ctx);
2122 tevent_req_received(req);
2123 return NT_STATUS_OK;
2126 NTSTATUS dcerpc_spoolss_AddPrinterDriver_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPrinterDriver *r)
2130 status = dcerpc_binding_handle_call(h,
2131 NULL, &ndr_table_spoolss,
2132 NDR_SPOOLSS_ADDPRINTERDRIVER, mem_ctx, r);
2137 struct dcerpc_spoolss_AddPrinterDriver_state {
2138 struct spoolss_AddPrinterDriver orig;
2139 struct spoolss_AddPrinterDriver tmp;
2140 TALLOC_CTX *out_mem_ctx;
2143 static void dcerpc_spoolss_AddPrinterDriver_done(struct tevent_req *subreq);
2145 struct tevent_req *dcerpc_spoolss_AddPrinterDriver_send(TALLOC_CTX *mem_ctx,
2146 struct tevent_context *ev,
2147 struct dcerpc_binding_handle *h,
2148 const char *_servername /* [in] [unique,charset(UTF16)] */,
2149 struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */)
2151 struct tevent_req *req;
2152 struct dcerpc_spoolss_AddPrinterDriver_state *state;
2153 struct tevent_req *subreq;
2155 req = tevent_req_create(mem_ctx, &state,
2156 struct dcerpc_spoolss_AddPrinterDriver_state);
2160 state->out_mem_ctx = NULL;
2163 state->orig.in.servername = _servername;
2164 state->orig.in.info_ctr = _info_ctr;
2166 /* Out parameters */
2169 ZERO_STRUCT(state->orig.out.result);
2171 /* make a temporary copy, that we pass to the dispatch function */
2172 state->tmp = state->orig;
2174 subreq = dcerpc_spoolss_AddPrinterDriver_r_send(state, ev, h, &state->tmp);
2175 if (tevent_req_nomem(subreq, req)) {
2176 return tevent_req_post(req, ev);
2178 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinterDriver_done, req);
2182 static void dcerpc_spoolss_AddPrinterDriver_done(struct tevent_req *subreq)
2184 struct tevent_req *req = tevent_req_callback_data(
2185 subreq, struct tevent_req);
2186 struct dcerpc_spoolss_AddPrinterDriver_state *state = tevent_req_data(
2187 req, struct dcerpc_spoolss_AddPrinterDriver_state);
2189 TALLOC_CTX *mem_ctx;
2191 if (state->out_mem_ctx) {
2192 mem_ctx = state->out_mem_ctx;
2197 status = dcerpc_spoolss_AddPrinterDriver_r_recv(subreq, mem_ctx);
2198 TALLOC_FREE(subreq);
2199 if (tevent_req_nterror(req, status)) {
2203 /* Copy out parameters */
2206 state->orig.out.result = state->tmp.out.result;
2208 /* Reset temporary structure */
2209 ZERO_STRUCT(state->tmp);
2211 tevent_req_done(req);
2214 NTSTATUS dcerpc_spoolss_AddPrinterDriver_recv(struct tevent_req *req,
2215 TALLOC_CTX *mem_ctx,
2218 struct dcerpc_spoolss_AddPrinterDriver_state *state = tevent_req_data(
2219 req, struct dcerpc_spoolss_AddPrinterDriver_state);
2222 if (tevent_req_is_nterror(req, &status)) {
2223 tevent_req_received(req);
2227 /* Steal possible out parameters to the callers context */
2228 talloc_steal(mem_ctx, state->out_mem_ctx);
2231 *result = state->orig.out.result;
2233 tevent_req_received(req);
2234 return NT_STATUS_OK;
2237 NTSTATUS dcerpc_spoolss_AddPrinterDriver(struct dcerpc_binding_handle *h,
2238 TALLOC_CTX *mem_ctx,
2239 const char *_servername /* [in] [unique,charset(UTF16)] */,
2240 struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */,
2243 struct spoolss_AddPrinterDriver r;
2247 r.in.servername = _servername;
2248 r.in.info_ctr = _info_ctr;
2250 status = dcerpc_spoolss_AddPrinterDriver_r(h, mem_ctx, &r);
2251 if (!NT_STATUS_IS_OK(status)) {
2255 /* Return variables */
2258 *result = r.out.result;
2260 return NT_STATUS_OK;
2263 struct dcerpc_spoolss_EnumPrinterDrivers_r_state {
2264 TALLOC_CTX *out_mem_ctx;
2267 static void dcerpc_spoolss_EnumPrinterDrivers_r_done(struct tevent_req *subreq);
2269 struct tevent_req *dcerpc_spoolss_EnumPrinterDrivers_r_send(TALLOC_CTX *mem_ctx,
2270 struct tevent_context *ev,
2271 struct dcerpc_binding_handle *h,
2272 struct spoolss_EnumPrinterDrivers *r)
2274 struct tevent_req *req;
2275 struct dcerpc_spoolss_EnumPrinterDrivers_r_state *state;
2276 struct tevent_req *subreq;
2278 req = tevent_req_create(mem_ctx, &state,
2279 struct dcerpc_spoolss_EnumPrinterDrivers_r_state);
2284 state->out_mem_ctx = talloc_new(state);
2285 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2286 return tevent_req_post(req, ev);
2289 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2290 NULL, &ndr_table_spoolss,
2291 NDR_SPOOLSS_ENUMPRINTERDRIVERS, state->out_mem_ctx, r);
2292 if (tevent_req_nomem(subreq, req)) {
2293 return tevent_req_post(req, ev);
2295 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterDrivers_r_done, req);
2300 static void dcerpc_spoolss_EnumPrinterDrivers_r_done(struct tevent_req *subreq)
2302 struct tevent_req *req =
2303 tevent_req_callback_data(subreq,
2307 status = dcerpc_binding_handle_call_recv(subreq);
2308 TALLOC_FREE(subreq);
2309 if (tevent_req_nterror(req, status)) {
2313 tevent_req_done(req);
2316 NTSTATUS dcerpc_spoolss_EnumPrinterDrivers_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2318 struct dcerpc_spoolss_EnumPrinterDrivers_r_state *state =
2319 tevent_req_data(req,
2320 struct dcerpc_spoolss_EnumPrinterDrivers_r_state);
2323 if (tevent_req_is_nterror(req, &status)) {
2324 tevent_req_received(req);
2328 talloc_steal(mem_ctx, state->out_mem_ctx);
2330 tevent_req_received(req);
2331 return NT_STATUS_OK;
2334 NTSTATUS dcerpc_spoolss_EnumPrinterDrivers_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrinterDrivers *r)
2338 status = dcerpc_binding_handle_call(h,
2339 NULL, &ndr_table_spoolss,
2340 NDR_SPOOLSS_ENUMPRINTERDRIVERS, mem_ctx, r);
2345 struct dcerpc_spoolss_EnumPrinterDrivers_state {
2346 struct spoolss_EnumPrinterDrivers orig;
2347 struct spoolss_EnumPrinterDrivers tmp;
2348 TALLOC_CTX *out_mem_ctx;
2351 static void dcerpc_spoolss_EnumPrinterDrivers_done(struct tevent_req *subreq);
2353 struct tevent_req *dcerpc_spoolss_EnumPrinterDrivers_send(TALLOC_CTX *mem_ctx,
2354 struct tevent_context *ev,
2355 struct dcerpc_binding_handle *h,
2356 const char *_server /* [in] [unique,charset(UTF16)] */,
2357 const char *_environment /* [in] [unique,charset(UTF16)] */,
2358 uint32_t _level /* [in] */,
2359 DATA_BLOB *_buffer /* [in] [unique] */,
2360 uint32_t _offered /* [in] */,
2361 uint32_t *_count /* [out] [ref] */,
2362 union spoolss_DriverInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
2363 uint32_t *_needed /* [out] [ref] */)
2365 struct tevent_req *req;
2366 struct dcerpc_spoolss_EnumPrinterDrivers_state *state;
2367 struct tevent_req *subreq;
2369 req = tevent_req_create(mem_ctx, &state,
2370 struct dcerpc_spoolss_EnumPrinterDrivers_state);
2374 state->out_mem_ctx = NULL;
2377 state->orig.in.server = _server;
2378 state->orig.in.environment = _environment;
2379 state->orig.in.level = _level;
2380 state->orig.in.buffer = _buffer;
2381 state->orig.in.offered = _offered;
2383 /* Out parameters */
2384 state->orig.out.count = _count;
2385 state->orig.out.info = _info;
2386 state->orig.out.needed = _needed;
2389 ZERO_STRUCT(state->orig.out.result);
2391 state->out_mem_ctx = talloc_named_const(state, 0,
2392 "dcerpc_spoolss_EnumPrinterDrivers_out_memory");
2393 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2394 return tevent_req_post(req, ev);
2397 /* make a temporary copy, that we pass to the dispatch function */
2398 state->tmp = state->orig;
2400 subreq = dcerpc_spoolss_EnumPrinterDrivers_r_send(state, ev, h, &state->tmp);
2401 if (tevent_req_nomem(subreq, req)) {
2402 return tevent_req_post(req, ev);
2404 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterDrivers_done, req);
2408 static void dcerpc_spoolss_EnumPrinterDrivers_done(struct tevent_req *subreq)
2410 struct tevent_req *req = tevent_req_callback_data(
2411 subreq, struct tevent_req);
2412 struct dcerpc_spoolss_EnumPrinterDrivers_state *state = tevent_req_data(
2413 req, struct dcerpc_spoolss_EnumPrinterDrivers_state);
2415 TALLOC_CTX *mem_ctx;
2417 if (state->out_mem_ctx) {
2418 mem_ctx = state->out_mem_ctx;
2423 status = dcerpc_spoolss_EnumPrinterDrivers_r_recv(subreq, mem_ctx);
2424 TALLOC_FREE(subreq);
2425 if (tevent_req_nterror(req, status)) {
2429 /* Copy out parameters */
2430 *state->orig.out.count = *state->tmp.out.count;
2431 *state->orig.out.info = *state->tmp.out.info;
2432 *state->orig.out.needed = *state->tmp.out.needed;
2435 state->orig.out.result = state->tmp.out.result;
2437 /* Reset temporary structure */
2438 ZERO_STRUCT(state->tmp);
2440 tevent_req_done(req);
2443 NTSTATUS dcerpc_spoolss_EnumPrinterDrivers_recv(struct tevent_req *req,
2444 TALLOC_CTX *mem_ctx,
2447 struct dcerpc_spoolss_EnumPrinterDrivers_state *state = tevent_req_data(
2448 req, struct dcerpc_spoolss_EnumPrinterDrivers_state);
2451 if (tevent_req_is_nterror(req, &status)) {
2452 tevent_req_received(req);
2456 /* Steal possible out parameters to the callers context */
2457 talloc_steal(mem_ctx, state->out_mem_ctx);
2460 *result = state->orig.out.result;
2462 tevent_req_received(req);
2463 return NT_STATUS_OK;
2466 NTSTATUS dcerpc_spoolss_EnumPrinterDrivers(struct dcerpc_binding_handle *h,
2467 TALLOC_CTX *mem_ctx,
2468 const char *_server /* [in] [unique,charset(UTF16)] */,
2469 const char *_environment /* [in] [unique,charset(UTF16)] */,
2470 uint32_t _level /* [in] */,
2471 DATA_BLOB *_buffer /* [in] [unique] */,
2472 uint32_t _offered /* [in] */,
2473 uint32_t *_count /* [out] [ref] */,
2474 union spoolss_DriverInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
2475 uint32_t *_needed /* [out] [ref] */,
2478 struct spoolss_EnumPrinterDrivers r;
2482 r.in.server = _server;
2483 r.in.environment = _environment;
2484 r.in.level = _level;
2485 r.in.buffer = _buffer;
2486 r.in.offered = _offered;
2488 status = dcerpc_spoolss_EnumPrinterDrivers_r(h, mem_ctx, &r);
2489 if (!NT_STATUS_IS_OK(status)) {
2493 /* Return variables */
2494 *_count = *r.out.count;
2495 *_info = *r.out.info;
2496 *_needed = *r.out.needed;
2499 *result = r.out.result;
2501 return NT_STATUS_OK;
2504 struct dcerpc_spoolss_GetPrinterDriver_r_state {
2505 TALLOC_CTX *out_mem_ctx;
2508 static void dcerpc_spoolss_GetPrinterDriver_r_done(struct tevent_req *subreq);
2510 struct tevent_req *dcerpc_spoolss_GetPrinterDriver_r_send(TALLOC_CTX *mem_ctx,
2511 struct tevent_context *ev,
2512 struct dcerpc_binding_handle *h,
2513 struct spoolss_GetPrinterDriver *r)
2515 struct tevent_req *req;
2516 struct dcerpc_spoolss_GetPrinterDriver_r_state *state;
2517 struct tevent_req *subreq;
2519 req = tevent_req_create(mem_ctx, &state,
2520 struct dcerpc_spoolss_GetPrinterDriver_r_state);
2525 state->out_mem_ctx = talloc_new(state);
2526 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2527 return tevent_req_post(req, ev);
2530 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2531 NULL, &ndr_table_spoolss,
2532 NDR_SPOOLSS_GETPRINTERDRIVER, state->out_mem_ctx, r);
2533 if (tevent_req_nomem(subreq, req)) {
2534 return tevent_req_post(req, ev);
2536 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDriver_r_done, req);
2541 static void dcerpc_spoolss_GetPrinterDriver_r_done(struct tevent_req *subreq)
2543 struct tevent_req *req =
2544 tevent_req_callback_data(subreq,
2548 status = dcerpc_binding_handle_call_recv(subreq);
2549 TALLOC_FREE(subreq);
2550 if (tevent_req_nterror(req, status)) {
2554 tevent_req_done(req);
2557 NTSTATUS dcerpc_spoolss_GetPrinterDriver_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2559 struct dcerpc_spoolss_GetPrinterDriver_r_state *state =
2560 tevent_req_data(req,
2561 struct dcerpc_spoolss_GetPrinterDriver_r_state);
2564 if (tevent_req_is_nterror(req, &status)) {
2565 tevent_req_received(req);
2569 talloc_steal(mem_ctx, state->out_mem_ctx);
2571 tevent_req_received(req);
2572 return NT_STATUS_OK;
2575 NTSTATUS dcerpc_spoolss_GetPrinterDriver_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetPrinterDriver *r)
2579 status = dcerpc_binding_handle_call(h,
2580 NULL, &ndr_table_spoolss,
2581 NDR_SPOOLSS_GETPRINTERDRIVER, mem_ctx, r);
2586 struct dcerpc_spoolss_GetPrinterDriver_state {
2587 struct spoolss_GetPrinterDriver orig;
2588 struct spoolss_GetPrinterDriver tmp;
2589 TALLOC_CTX *out_mem_ctx;
2592 static void dcerpc_spoolss_GetPrinterDriver_done(struct tevent_req *subreq);
2594 struct tevent_req *dcerpc_spoolss_GetPrinterDriver_send(TALLOC_CTX *mem_ctx,
2595 struct tevent_context *ev,
2596 struct dcerpc_binding_handle *h,
2597 struct policy_handle *_handle /* [in] [ref] */,
2598 const char *_architecture /* [in] [unique,charset(UTF16)] */,
2599 uint32_t _level /* [in] */,
2600 DATA_BLOB *_buffer /* [in] [unique] */,
2601 uint32_t _offered /* [in] */,
2602 union spoolss_DriverInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2603 uint32_t *_needed /* [out] [ref] */)
2605 struct tevent_req *req;
2606 struct dcerpc_spoolss_GetPrinterDriver_state *state;
2607 struct tevent_req *subreq;
2609 req = tevent_req_create(mem_ctx, &state,
2610 struct dcerpc_spoolss_GetPrinterDriver_state);
2614 state->out_mem_ctx = NULL;
2617 state->orig.in.handle = _handle;
2618 state->orig.in.architecture = _architecture;
2619 state->orig.in.level = _level;
2620 state->orig.in.buffer = _buffer;
2621 state->orig.in.offered = _offered;
2623 /* Out parameters */
2624 state->orig.out.info = _info;
2625 state->orig.out.needed = _needed;
2628 ZERO_STRUCT(state->orig.out.result);
2630 state->out_mem_ctx = talloc_named_const(state, 0,
2631 "dcerpc_spoolss_GetPrinterDriver_out_memory");
2632 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2633 return tevent_req_post(req, ev);
2636 /* make a temporary copy, that we pass to the dispatch function */
2637 state->tmp = state->orig;
2639 subreq = dcerpc_spoolss_GetPrinterDriver_r_send(state, ev, h, &state->tmp);
2640 if (tevent_req_nomem(subreq, req)) {
2641 return tevent_req_post(req, ev);
2643 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDriver_done, req);
2647 static void dcerpc_spoolss_GetPrinterDriver_done(struct tevent_req *subreq)
2649 struct tevent_req *req = tevent_req_callback_data(
2650 subreq, struct tevent_req);
2651 struct dcerpc_spoolss_GetPrinterDriver_state *state = tevent_req_data(
2652 req, struct dcerpc_spoolss_GetPrinterDriver_state);
2654 TALLOC_CTX *mem_ctx;
2656 if (state->out_mem_ctx) {
2657 mem_ctx = state->out_mem_ctx;
2662 status = dcerpc_spoolss_GetPrinterDriver_r_recv(subreq, mem_ctx);
2663 TALLOC_FREE(subreq);
2664 if (tevent_req_nterror(req, status)) {
2668 /* Copy out parameters */
2669 if (state->orig.out.info && state->tmp.out.info) {
2670 *state->orig.out.info = *state->tmp.out.info;
2672 *state->orig.out.needed = *state->tmp.out.needed;
2675 state->orig.out.result = state->tmp.out.result;
2677 /* Reset temporary structure */
2678 ZERO_STRUCT(state->tmp);
2680 tevent_req_done(req);
2683 NTSTATUS dcerpc_spoolss_GetPrinterDriver_recv(struct tevent_req *req,
2684 TALLOC_CTX *mem_ctx,
2687 struct dcerpc_spoolss_GetPrinterDriver_state *state = tevent_req_data(
2688 req, struct dcerpc_spoolss_GetPrinterDriver_state);
2691 if (tevent_req_is_nterror(req, &status)) {
2692 tevent_req_received(req);
2696 /* Steal possible out parameters to the callers context */
2697 talloc_steal(mem_ctx, state->out_mem_ctx);
2700 *result = state->orig.out.result;
2702 tevent_req_received(req);
2703 return NT_STATUS_OK;
2706 NTSTATUS dcerpc_spoolss_GetPrinterDriver(struct dcerpc_binding_handle *h,
2707 TALLOC_CTX *mem_ctx,
2708 struct policy_handle *_handle /* [in] [ref] */,
2709 const char *_architecture /* [in] [unique,charset(UTF16)] */,
2710 uint32_t _level /* [in] */,
2711 DATA_BLOB *_buffer /* [in] [unique] */,
2712 uint32_t _offered /* [in] */,
2713 union spoolss_DriverInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2714 uint32_t *_needed /* [out] [ref] */,
2717 struct spoolss_GetPrinterDriver r;
2721 r.in.handle = _handle;
2722 r.in.architecture = _architecture;
2723 r.in.level = _level;
2724 r.in.buffer = _buffer;
2725 r.in.offered = _offered;
2727 status = dcerpc_spoolss_GetPrinterDriver_r(h, mem_ctx, &r);
2728 if (!NT_STATUS_IS_OK(status)) {
2732 /* Return variables */
2733 if (_info && r.out.info) {
2734 *_info = *r.out.info;
2736 *_needed = *r.out.needed;
2739 *result = r.out.result;
2741 return NT_STATUS_OK;
2744 struct dcerpc_spoolss_GetPrinterDriverDirectory_r_state {
2745 TALLOC_CTX *out_mem_ctx;
2748 static void dcerpc_spoolss_GetPrinterDriverDirectory_r_done(struct tevent_req *subreq);
2750 struct tevent_req *dcerpc_spoolss_GetPrinterDriverDirectory_r_send(TALLOC_CTX *mem_ctx,
2751 struct tevent_context *ev,
2752 struct dcerpc_binding_handle *h,
2753 struct spoolss_GetPrinterDriverDirectory *r)
2755 struct tevent_req *req;
2756 struct dcerpc_spoolss_GetPrinterDriverDirectory_r_state *state;
2757 struct tevent_req *subreq;
2759 req = tevent_req_create(mem_ctx, &state,
2760 struct dcerpc_spoolss_GetPrinterDriverDirectory_r_state);
2765 state->out_mem_ctx = talloc_new(state);
2766 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2767 return tevent_req_post(req, ev);
2770 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2771 NULL, &ndr_table_spoolss,
2772 NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY, state->out_mem_ctx, r);
2773 if (tevent_req_nomem(subreq, req)) {
2774 return tevent_req_post(req, ev);
2776 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDriverDirectory_r_done, req);
2781 static void dcerpc_spoolss_GetPrinterDriverDirectory_r_done(struct tevent_req *subreq)
2783 struct tevent_req *req =
2784 tevent_req_callback_data(subreq,
2788 status = dcerpc_binding_handle_call_recv(subreq);
2789 TALLOC_FREE(subreq);
2790 if (tevent_req_nterror(req, status)) {
2794 tevent_req_done(req);
2797 NTSTATUS dcerpc_spoolss_GetPrinterDriverDirectory_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2799 struct dcerpc_spoolss_GetPrinterDriverDirectory_r_state *state =
2800 tevent_req_data(req,
2801 struct dcerpc_spoolss_GetPrinterDriverDirectory_r_state);
2804 if (tevent_req_is_nterror(req, &status)) {
2805 tevent_req_received(req);
2809 talloc_steal(mem_ctx, state->out_mem_ctx);
2811 tevent_req_received(req);
2812 return NT_STATUS_OK;
2815 NTSTATUS dcerpc_spoolss_GetPrinterDriverDirectory_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetPrinterDriverDirectory *r)
2819 status = dcerpc_binding_handle_call(h,
2820 NULL, &ndr_table_spoolss,
2821 NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY, mem_ctx, r);
2826 struct dcerpc_spoolss_GetPrinterDriverDirectory_state {
2827 struct spoolss_GetPrinterDriverDirectory orig;
2828 struct spoolss_GetPrinterDriverDirectory tmp;
2829 TALLOC_CTX *out_mem_ctx;
2832 static void dcerpc_spoolss_GetPrinterDriverDirectory_done(struct tevent_req *subreq);
2834 struct tevent_req *dcerpc_spoolss_GetPrinterDriverDirectory_send(TALLOC_CTX *mem_ctx,
2835 struct tevent_context *ev,
2836 struct dcerpc_binding_handle *h,
2837 const char *_server /* [in] [unique,charset(UTF16)] */,
2838 const char *_environment /* [in] [unique,charset(UTF16)] */,
2839 uint32_t _level /* [in] */,
2840 DATA_BLOB *_buffer /* [in] [unique] */,
2841 uint32_t _offered /* [in] */,
2842 union spoolss_DriverDirectoryInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2843 uint32_t *_needed /* [out] [ref] */)
2845 struct tevent_req *req;
2846 struct dcerpc_spoolss_GetPrinterDriverDirectory_state *state;
2847 struct tevent_req *subreq;
2849 req = tevent_req_create(mem_ctx, &state,
2850 struct dcerpc_spoolss_GetPrinterDriverDirectory_state);
2854 state->out_mem_ctx = NULL;
2857 state->orig.in.server = _server;
2858 state->orig.in.environment = _environment;
2859 state->orig.in.level = _level;
2860 state->orig.in.buffer = _buffer;
2861 state->orig.in.offered = _offered;
2863 /* Out parameters */
2864 state->orig.out.info = _info;
2865 state->orig.out.needed = _needed;
2868 ZERO_STRUCT(state->orig.out.result);
2870 state->out_mem_ctx = talloc_named_const(state, 0,
2871 "dcerpc_spoolss_GetPrinterDriverDirectory_out_memory");
2872 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2873 return tevent_req_post(req, ev);
2876 /* make a temporary copy, that we pass to the dispatch function */
2877 state->tmp = state->orig;
2879 subreq = dcerpc_spoolss_GetPrinterDriverDirectory_r_send(state, ev, h, &state->tmp);
2880 if (tevent_req_nomem(subreq, req)) {
2881 return tevent_req_post(req, ev);
2883 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDriverDirectory_done, req);
2887 static void dcerpc_spoolss_GetPrinterDriverDirectory_done(struct tevent_req *subreq)
2889 struct tevent_req *req = tevent_req_callback_data(
2890 subreq, struct tevent_req);
2891 struct dcerpc_spoolss_GetPrinterDriverDirectory_state *state = tevent_req_data(
2892 req, struct dcerpc_spoolss_GetPrinterDriverDirectory_state);
2894 TALLOC_CTX *mem_ctx;
2896 if (state->out_mem_ctx) {
2897 mem_ctx = state->out_mem_ctx;
2902 status = dcerpc_spoolss_GetPrinterDriverDirectory_r_recv(subreq, mem_ctx);
2903 TALLOC_FREE(subreq);
2904 if (tevent_req_nterror(req, status)) {
2908 /* Copy out parameters */
2909 if (state->orig.out.info && state->tmp.out.info) {
2910 *state->orig.out.info = *state->tmp.out.info;
2912 *state->orig.out.needed = *state->tmp.out.needed;
2915 state->orig.out.result = state->tmp.out.result;
2917 /* Reset temporary structure */
2918 ZERO_STRUCT(state->tmp);
2920 tevent_req_done(req);
2923 NTSTATUS dcerpc_spoolss_GetPrinterDriverDirectory_recv(struct tevent_req *req,
2924 TALLOC_CTX *mem_ctx,
2927 struct dcerpc_spoolss_GetPrinterDriverDirectory_state *state = tevent_req_data(
2928 req, struct dcerpc_spoolss_GetPrinterDriverDirectory_state);
2931 if (tevent_req_is_nterror(req, &status)) {
2932 tevent_req_received(req);
2936 /* Steal possible out parameters to the callers context */
2937 talloc_steal(mem_ctx, state->out_mem_ctx);
2940 *result = state->orig.out.result;
2942 tevent_req_received(req);
2943 return NT_STATUS_OK;
2946 NTSTATUS dcerpc_spoolss_GetPrinterDriverDirectory(struct dcerpc_binding_handle *h,
2947 TALLOC_CTX *mem_ctx,
2948 const char *_server /* [in] [unique,charset(UTF16)] */,
2949 const char *_environment /* [in] [unique,charset(UTF16)] */,
2950 uint32_t _level /* [in] */,
2951 DATA_BLOB *_buffer /* [in] [unique] */,
2952 uint32_t _offered /* [in] */,
2953 union spoolss_DriverDirectoryInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
2954 uint32_t *_needed /* [out] [ref] */,
2957 struct spoolss_GetPrinterDriverDirectory r;
2961 r.in.server = _server;
2962 r.in.environment = _environment;
2963 r.in.level = _level;
2964 r.in.buffer = _buffer;
2965 r.in.offered = _offered;
2967 status = dcerpc_spoolss_GetPrinterDriverDirectory_r(h, mem_ctx, &r);
2968 if (!NT_STATUS_IS_OK(status)) {
2972 /* Return variables */
2973 if (_info && r.out.info) {
2974 *_info = *r.out.info;
2976 *_needed = *r.out.needed;
2979 *result = r.out.result;
2981 return NT_STATUS_OK;
2984 struct dcerpc_spoolss_DeletePrinterDriver_r_state {
2985 TALLOC_CTX *out_mem_ctx;
2988 static void dcerpc_spoolss_DeletePrinterDriver_r_done(struct tevent_req *subreq);
2990 struct tevent_req *dcerpc_spoolss_DeletePrinterDriver_r_send(TALLOC_CTX *mem_ctx,
2991 struct tevent_context *ev,
2992 struct dcerpc_binding_handle *h,
2993 struct spoolss_DeletePrinterDriver *r)
2995 struct tevent_req *req;
2996 struct dcerpc_spoolss_DeletePrinterDriver_r_state *state;
2997 struct tevent_req *subreq;
2999 req = tevent_req_create(mem_ctx, &state,
3000 struct dcerpc_spoolss_DeletePrinterDriver_r_state);
3005 state->out_mem_ctx = NULL;
3007 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3008 NULL, &ndr_table_spoolss,
3009 NDR_SPOOLSS_DELETEPRINTERDRIVER, state, r);
3010 if (tevent_req_nomem(subreq, req)) {
3011 return tevent_req_post(req, ev);
3013 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterDriver_r_done, req);
3018 static void dcerpc_spoolss_DeletePrinterDriver_r_done(struct tevent_req *subreq)
3020 struct tevent_req *req =
3021 tevent_req_callback_data(subreq,
3025 status = dcerpc_binding_handle_call_recv(subreq);
3026 TALLOC_FREE(subreq);
3027 if (tevent_req_nterror(req, status)) {
3031 tevent_req_done(req);
3034 NTSTATUS dcerpc_spoolss_DeletePrinterDriver_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3036 struct dcerpc_spoolss_DeletePrinterDriver_r_state *state =
3037 tevent_req_data(req,
3038 struct dcerpc_spoolss_DeletePrinterDriver_r_state);
3041 if (tevent_req_is_nterror(req, &status)) {
3042 tevent_req_received(req);
3046 talloc_steal(mem_ctx, state->out_mem_ctx);
3048 tevent_req_received(req);
3049 return NT_STATUS_OK;
3052 NTSTATUS dcerpc_spoolss_DeletePrinterDriver_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinterDriver *r)
3056 status = dcerpc_binding_handle_call(h,
3057 NULL, &ndr_table_spoolss,
3058 NDR_SPOOLSS_DELETEPRINTERDRIVER, mem_ctx, r);
3063 struct dcerpc_spoolss_DeletePrinterDriver_state {
3064 struct spoolss_DeletePrinterDriver orig;
3065 struct spoolss_DeletePrinterDriver tmp;
3066 TALLOC_CTX *out_mem_ctx;
3069 static void dcerpc_spoolss_DeletePrinterDriver_done(struct tevent_req *subreq);
3071 struct tevent_req *dcerpc_spoolss_DeletePrinterDriver_send(TALLOC_CTX *mem_ctx,
3072 struct tevent_context *ev,
3073 struct dcerpc_binding_handle *h,
3074 const char *_server /* [in] [unique,charset(UTF16)] */,
3075 const char *_architecture /* [in] [charset(UTF16)] */,
3076 const char *_driver /* [in] [charset(UTF16)] */)
3078 struct tevent_req *req;
3079 struct dcerpc_spoolss_DeletePrinterDriver_state *state;
3080 struct tevent_req *subreq;
3082 req = tevent_req_create(mem_ctx, &state,
3083 struct dcerpc_spoolss_DeletePrinterDriver_state);
3087 state->out_mem_ctx = NULL;
3090 state->orig.in.server = _server;
3091 state->orig.in.architecture = _architecture;
3092 state->orig.in.driver = _driver;
3094 /* Out parameters */
3097 ZERO_STRUCT(state->orig.out.result);
3099 /* make a temporary copy, that we pass to the dispatch function */
3100 state->tmp = state->orig;
3102 subreq = dcerpc_spoolss_DeletePrinterDriver_r_send(state, ev, h, &state->tmp);
3103 if (tevent_req_nomem(subreq, req)) {
3104 return tevent_req_post(req, ev);
3106 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterDriver_done, req);
3110 static void dcerpc_spoolss_DeletePrinterDriver_done(struct tevent_req *subreq)
3112 struct tevent_req *req = tevent_req_callback_data(
3113 subreq, struct tevent_req);
3114 struct dcerpc_spoolss_DeletePrinterDriver_state *state = tevent_req_data(
3115 req, struct dcerpc_spoolss_DeletePrinterDriver_state);
3117 TALLOC_CTX *mem_ctx;
3119 if (state->out_mem_ctx) {
3120 mem_ctx = state->out_mem_ctx;
3125 status = dcerpc_spoolss_DeletePrinterDriver_r_recv(subreq, mem_ctx);
3126 TALLOC_FREE(subreq);
3127 if (tevent_req_nterror(req, status)) {
3131 /* Copy out parameters */
3134 state->orig.out.result = state->tmp.out.result;
3136 /* Reset temporary structure */
3137 ZERO_STRUCT(state->tmp);
3139 tevent_req_done(req);
3142 NTSTATUS dcerpc_spoolss_DeletePrinterDriver_recv(struct tevent_req *req,
3143 TALLOC_CTX *mem_ctx,
3146 struct dcerpc_spoolss_DeletePrinterDriver_state *state = tevent_req_data(
3147 req, struct dcerpc_spoolss_DeletePrinterDriver_state);
3150 if (tevent_req_is_nterror(req, &status)) {
3151 tevent_req_received(req);
3155 /* Steal possible out parameters to the callers context */
3156 talloc_steal(mem_ctx, state->out_mem_ctx);
3159 *result = state->orig.out.result;
3161 tevent_req_received(req);
3162 return NT_STATUS_OK;
3165 NTSTATUS dcerpc_spoolss_DeletePrinterDriver(struct dcerpc_binding_handle *h,
3166 TALLOC_CTX *mem_ctx,
3167 const char *_server /* [in] [unique,charset(UTF16)] */,
3168 const char *_architecture /* [in] [charset(UTF16)] */,
3169 const char *_driver /* [in] [charset(UTF16)] */,
3172 struct spoolss_DeletePrinterDriver r;
3176 r.in.server = _server;
3177 r.in.architecture = _architecture;
3178 r.in.driver = _driver;
3180 status = dcerpc_spoolss_DeletePrinterDriver_r(h, mem_ctx, &r);
3181 if (!NT_STATUS_IS_OK(status)) {
3185 /* Return variables */
3188 *result = r.out.result;
3190 return NT_STATUS_OK;
3193 struct dcerpc_spoolss_AddPrintProcessor_r_state {
3194 TALLOC_CTX *out_mem_ctx;
3197 static void dcerpc_spoolss_AddPrintProcessor_r_done(struct tevent_req *subreq);
3199 struct tevent_req *dcerpc_spoolss_AddPrintProcessor_r_send(TALLOC_CTX *mem_ctx,
3200 struct tevent_context *ev,
3201 struct dcerpc_binding_handle *h,
3202 struct spoolss_AddPrintProcessor *r)
3204 struct tevent_req *req;
3205 struct dcerpc_spoolss_AddPrintProcessor_r_state *state;
3206 struct tevent_req *subreq;
3208 req = tevent_req_create(mem_ctx, &state,
3209 struct dcerpc_spoolss_AddPrintProcessor_r_state);
3214 state->out_mem_ctx = NULL;
3216 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3217 NULL, &ndr_table_spoolss,
3218 NDR_SPOOLSS_ADDPRINTPROCESSOR, state, r);
3219 if (tevent_req_nomem(subreq, req)) {
3220 return tevent_req_post(req, ev);
3222 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrintProcessor_r_done, req);
3227 static void dcerpc_spoolss_AddPrintProcessor_r_done(struct tevent_req *subreq)
3229 struct tevent_req *req =
3230 tevent_req_callback_data(subreq,
3234 status = dcerpc_binding_handle_call_recv(subreq);
3235 TALLOC_FREE(subreq);
3236 if (tevent_req_nterror(req, status)) {
3240 tevent_req_done(req);
3243 NTSTATUS dcerpc_spoolss_AddPrintProcessor_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3245 struct dcerpc_spoolss_AddPrintProcessor_r_state *state =
3246 tevent_req_data(req,
3247 struct dcerpc_spoolss_AddPrintProcessor_r_state);
3250 if (tevent_req_is_nterror(req, &status)) {
3251 tevent_req_received(req);
3255 talloc_steal(mem_ctx, state->out_mem_ctx);
3257 tevent_req_received(req);
3258 return NT_STATUS_OK;
3261 NTSTATUS dcerpc_spoolss_AddPrintProcessor_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPrintProcessor *r)
3265 status = dcerpc_binding_handle_call(h,
3266 NULL, &ndr_table_spoolss,
3267 NDR_SPOOLSS_ADDPRINTPROCESSOR, mem_ctx, r);
3272 struct dcerpc_spoolss_AddPrintProcessor_state {
3273 struct spoolss_AddPrintProcessor orig;
3274 struct spoolss_AddPrintProcessor tmp;
3275 TALLOC_CTX *out_mem_ctx;
3278 static void dcerpc_spoolss_AddPrintProcessor_done(struct tevent_req *subreq);
3280 struct tevent_req *dcerpc_spoolss_AddPrintProcessor_send(TALLOC_CTX *mem_ctx,
3281 struct tevent_context *ev,
3282 struct dcerpc_binding_handle *h,
3283 const char *_server /* [in] [unique,charset(UTF16)] */,
3284 const char *_architecture /* [in] [charset(UTF16)] */,
3285 const char *_path_name /* [in] [charset(UTF16)] */,
3286 const char *_print_processor_name /* [in] [charset(UTF16)] */)
3288 struct tevent_req *req;
3289 struct dcerpc_spoolss_AddPrintProcessor_state *state;
3290 struct tevent_req *subreq;
3292 req = tevent_req_create(mem_ctx, &state,
3293 struct dcerpc_spoolss_AddPrintProcessor_state);
3297 state->out_mem_ctx = NULL;
3300 state->orig.in.server = _server;
3301 state->orig.in.architecture = _architecture;
3302 state->orig.in.path_name = _path_name;
3303 state->orig.in.print_processor_name = _print_processor_name;
3305 /* Out parameters */
3308 ZERO_STRUCT(state->orig.out.result);
3310 /* make a temporary copy, that we pass to the dispatch function */
3311 state->tmp = state->orig;
3313 subreq = dcerpc_spoolss_AddPrintProcessor_r_send(state, ev, h, &state->tmp);
3314 if (tevent_req_nomem(subreq, req)) {
3315 return tevent_req_post(req, ev);
3317 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrintProcessor_done, req);
3321 static void dcerpc_spoolss_AddPrintProcessor_done(struct tevent_req *subreq)
3323 struct tevent_req *req = tevent_req_callback_data(
3324 subreq, struct tevent_req);
3325 struct dcerpc_spoolss_AddPrintProcessor_state *state = tevent_req_data(
3326 req, struct dcerpc_spoolss_AddPrintProcessor_state);
3328 TALLOC_CTX *mem_ctx;
3330 if (state->out_mem_ctx) {
3331 mem_ctx = state->out_mem_ctx;
3336 status = dcerpc_spoolss_AddPrintProcessor_r_recv(subreq, mem_ctx);
3337 TALLOC_FREE(subreq);
3338 if (tevent_req_nterror(req, status)) {
3342 /* Copy out parameters */
3345 state->orig.out.result = state->tmp.out.result;
3347 /* Reset temporary structure */
3348 ZERO_STRUCT(state->tmp);
3350 tevent_req_done(req);
3353 NTSTATUS dcerpc_spoolss_AddPrintProcessor_recv(struct tevent_req *req,
3354 TALLOC_CTX *mem_ctx,
3357 struct dcerpc_spoolss_AddPrintProcessor_state *state = tevent_req_data(
3358 req, struct dcerpc_spoolss_AddPrintProcessor_state);
3361 if (tevent_req_is_nterror(req, &status)) {
3362 tevent_req_received(req);
3366 /* Steal possible out parameters to the callers context */
3367 talloc_steal(mem_ctx, state->out_mem_ctx);
3370 *result = state->orig.out.result;
3372 tevent_req_received(req);
3373 return NT_STATUS_OK;
3376 NTSTATUS dcerpc_spoolss_AddPrintProcessor(struct dcerpc_binding_handle *h,
3377 TALLOC_CTX *mem_ctx,
3378 const char *_server /* [in] [unique,charset(UTF16)] */,
3379 const char *_architecture /* [in] [charset(UTF16)] */,
3380 const char *_path_name /* [in] [charset(UTF16)] */,
3381 const char *_print_processor_name /* [in] [charset(UTF16)] */,
3384 struct spoolss_AddPrintProcessor r;
3388 r.in.server = _server;
3389 r.in.architecture = _architecture;
3390 r.in.path_name = _path_name;
3391 r.in.print_processor_name = _print_processor_name;
3393 status = dcerpc_spoolss_AddPrintProcessor_r(h, mem_ctx, &r);
3394 if (!NT_STATUS_IS_OK(status)) {
3398 /* Return variables */
3401 *result = r.out.result;
3403 return NT_STATUS_OK;
3406 struct dcerpc_spoolss_EnumPrintProcessors_r_state {
3407 TALLOC_CTX *out_mem_ctx;
3410 static void dcerpc_spoolss_EnumPrintProcessors_r_done(struct tevent_req *subreq);
3412 struct tevent_req *dcerpc_spoolss_EnumPrintProcessors_r_send(TALLOC_CTX *mem_ctx,
3413 struct tevent_context *ev,
3414 struct dcerpc_binding_handle *h,
3415 struct spoolss_EnumPrintProcessors *r)
3417 struct tevent_req *req;
3418 struct dcerpc_spoolss_EnumPrintProcessors_r_state *state;
3419 struct tevent_req *subreq;
3421 req = tevent_req_create(mem_ctx, &state,
3422 struct dcerpc_spoolss_EnumPrintProcessors_r_state);
3427 state->out_mem_ctx = talloc_new(state);
3428 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3429 return tevent_req_post(req, ev);
3432 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3433 NULL, &ndr_table_spoolss,
3434 NDR_SPOOLSS_ENUMPRINTPROCESSORS, state->out_mem_ctx, r);
3435 if (tevent_req_nomem(subreq, req)) {
3436 return tevent_req_post(req, ev);
3438 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrintProcessors_r_done, req);
3443 static void dcerpc_spoolss_EnumPrintProcessors_r_done(struct tevent_req *subreq)
3445 struct tevent_req *req =
3446 tevent_req_callback_data(subreq,
3450 status = dcerpc_binding_handle_call_recv(subreq);
3451 TALLOC_FREE(subreq);
3452 if (tevent_req_nterror(req, status)) {
3456 tevent_req_done(req);
3459 NTSTATUS dcerpc_spoolss_EnumPrintProcessors_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3461 struct dcerpc_spoolss_EnumPrintProcessors_r_state *state =
3462 tevent_req_data(req,
3463 struct dcerpc_spoolss_EnumPrintProcessors_r_state);
3466 if (tevent_req_is_nterror(req, &status)) {
3467 tevent_req_received(req);
3471 talloc_steal(mem_ctx, state->out_mem_ctx);
3473 tevent_req_received(req);
3474 return NT_STATUS_OK;
3477 NTSTATUS dcerpc_spoolss_EnumPrintProcessors_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrintProcessors *r)
3481 status = dcerpc_binding_handle_call(h,
3482 NULL, &ndr_table_spoolss,
3483 NDR_SPOOLSS_ENUMPRINTPROCESSORS, mem_ctx, r);
3488 struct dcerpc_spoolss_EnumPrintProcessors_state {
3489 struct spoolss_EnumPrintProcessors orig;
3490 struct spoolss_EnumPrintProcessors tmp;
3491 TALLOC_CTX *out_mem_ctx;
3494 static void dcerpc_spoolss_EnumPrintProcessors_done(struct tevent_req *subreq);
3496 struct tevent_req *dcerpc_spoolss_EnumPrintProcessors_send(TALLOC_CTX *mem_ctx,
3497 struct tevent_context *ev,
3498 struct dcerpc_binding_handle *h,
3499 const char *_servername /* [in] [unique,charset(UTF16)] */,
3500 const char *_environment /* [in] [unique,charset(UTF16)] */,
3501 uint32_t _level /* [in] */,
3502 DATA_BLOB *_buffer /* [in] [unique] */,
3503 uint32_t _offered /* [in] */,
3504 uint32_t *_count /* [out] [ref] */,
3505 union spoolss_PrintProcessorInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
3506 uint32_t *_needed /* [out] [ref] */)
3508 struct tevent_req *req;
3509 struct dcerpc_spoolss_EnumPrintProcessors_state *state;
3510 struct tevent_req *subreq;
3512 req = tevent_req_create(mem_ctx, &state,
3513 struct dcerpc_spoolss_EnumPrintProcessors_state);
3517 state->out_mem_ctx = NULL;
3520 state->orig.in.servername = _servername;
3521 state->orig.in.environment = _environment;
3522 state->orig.in.level = _level;
3523 state->orig.in.buffer = _buffer;
3524 state->orig.in.offered = _offered;
3526 /* Out parameters */
3527 state->orig.out.count = _count;
3528 state->orig.out.info = _info;
3529 state->orig.out.needed = _needed;
3532 ZERO_STRUCT(state->orig.out.result);
3534 state->out_mem_ctx = talloc_named_const(state, 0,
3535 "dcerpc_spoolss_EnumPrintProcessors_out_memory");
3536 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3537 return tevent_req_post(req, ev);
3540 /* make a temporary copy, that we pass to the dispatch function */
3541 state->tmp = state->orig;
3543 subreq = dcerpc_spoolss_EnumPrintProcessors_r_send(state, ev, h, &state->tmp);
3544 if (tevent_req_nomem(subreq, req)) {
3545 return tevent_req_post(req, ev);
3547 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrintProcessors_done, req);
3551 static void dcerpc_spoolss_EnumPrintProcessors_done(struct tevent_req *subreq)
3553 struct tevent_req *req = tevent_req_callback_data(
3554 subreq, struct tevent_req);
3555 struct dcerpc_spoolss_EnumPrintProcessors_state *state = tevent_req_data(
3556 req, struct dcerpc_spoolss_EnumPrintProcessors_state);
3558 TALLOC_CTX *mem_ctx;
3560 if (state->out_mem_ctx) {
3561 mem_ctx = state->out_mem_ctx;
3566 status = dcerpc_spoolss_EnumPrintProcessors_r_recv(subreq, mem_ctx);
3567 TALLOC_FREE(subreq);
3568 if (tevent_req_nterror(req, status)) {
3572 /* Copy out parameters */
3573 *state->orig.out.count = *state->tmp.out.count;
3574 *state->orig.out.info = *state->tmp.out.info;
3575 *state->orig.out.needed = *state->tmp.out.needed;
3578 state->orig.out.result = state->tmp.out.result;
3580 /* Reset temporary structure */
3581 ZERO_STRUCT(state->tmp);
3583 tevent_req_done(req);
3586 NTSTATUS dcerpc_spoolss_EnumPrintProcessors_recv(struct tevent_req *req,
3587 TALLOC_CTX *mem_ctx,
3590 struct dcerpc_spoolss_EnumPrintProcessors_state *state = tevent_req_data(
3591 req, struct dcerpc_spoolss_EnumPrintProcessors_state);
3594 if (tevent_req_is_nterror(req, &status)) {
3595 tevent_req_received(req);
3599 /* Steal possible out parameters to the callers context */
3600 talloc_steal(mem_ctx, state->out_mem_ctx);
3603 *result = state->orig.out.result;
3605 tevent_req_received(req);
3606 return NT_STATUS_OK;
3609 NTSTATUS dcerpc_spoolss_EnumPrintProcessors(struct dcerpc_binding_handle *h,
3610 TALLOC_CTX *mem_ctx,
3611 const char *_servername /* [in] [unique,charset(UTF16)] */,
3612 const char *_environment /* [in] [unique,charset(UTF16)] */,
3613 uint32_t _level /* [in] */,
3614 DATA_BLOB *_buffer /* [in] [unique] */,
3615 uint32_t _offered /* [in] */,
3616 uint32_t *_count /* [out] [ref] */,
3617 union spoolss_PrintProcessorInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
3618 uint32_t *_needed /* [out] [ref] */,
3621 struct spoolss_EnumPrintProcessors r;
3625 r.in.servername = _servername;
3626 r.in.environment = _environment;
3627 r.in.level = _level;
3628 r.in.buffer = _buffer;
3629 r.in.offered = _offered;
3631 status = dcerpc_spoolss_EnumPrintProcessors_r(h, mem_ctx, &r);
3632 if (!NT_STATUS_IS_OK(status)) {
3636 /* Return variables */
3637 *_count = *r.out.count;
3638 *_info = *r.out.info;
3639 *_needed = *r.out.needed;
3642 *result = r.out.result;
3644 return NT_STATUS_OK;
3647 struct dcerpc_spoolss_GetPrintProcessorDirectory_r_state {
3648 TALLOC_CTX *out_mem_ctx;
3651 static void dcerpc_spoolss_GetPrintProcessorDirectory_r_done(struct tevent_req *subreq);
3653 struct tevent_req *dcerpc_spoolss_GetPrintProcessorDirectory_r_send(TALLOC_CTX *mem_ctx,
3654 struct tevent_context *ev,
3655 struct dcerpc_binding_handle *h,
3656 struct spoolss_GetPrintProcessorDirectory *r)
3658 struct tevent_req *req;
3659 struct dcerpc_spoolss_GetPrintProcessorDirectory_r_state *state;
3660 struct tevent_req *subreq;
3662 req = tevent_req_create(mem_ctx, &state,
3663 struct dcerpc_spoolss_GetPrintProcessorDirectory_r_state);
3668 state->out_mem_ctx = talloc_new(state);
3669 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3670 return tevent_req_post(req, ev);
3673 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3674 NULL, &ndr_table_spoolss,
3675 NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY, state->out_mem_ctx, r);
3676 if (tevent_req_nomem(subreq, req)) {
3677 return tevent_req_post(req, ev);
3679 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrintProcessorDirectory_r_done, req);
3684 static void dcerpc_spoolss_GetPrintProcessorDirectory_r_done(struct tevent_req *subreq)
3686 struct tevent_req *req =
3687 tevent_req_callback_data(subreq,
3691 status = dcerpc_binding_handle_call_recv(subreq);
3692 TALLOC_FREE(subreq);
3693 if (tevent_req_nterror(req, status)) {
3697 tevent_req_done(req);
3700 NTSTATUS dcerpc_spoolss_GetPrintProcessorDirectory_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3702 struct dcerpc_spoolss_GetPrintProcessorDirectory_r_state *state =
3703 tevent_req_data(req,
3704 struct dcerpc_spoolss_GetPrintProcessorDirectory_r_state);
3707 if (tevent_req_is_nterror(req, &status)) {
3708 tevent_req_received(req);
3712 talloc_steal(mem_ctx, state->out_mem_ctx);
3714 tevent_req_received(req);
3715 return NT_STATUS_OK;
3718 NTSTATUS dcerpc_spoolss_GetPrintProcessorDirectory_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetPrintProcessorDirectory *r)
3722 status = dcerpc_binding_handle_call(h,
3723 NULL, &ndr_table_spoolss,
3724 NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY, mem_ctx, r);
3729 struct dcerpc_spoolss_GetPrintProcessorDirectory_state {
3730 struct spoolss_GetPrintProcessorDirectory orig;
3731 struct spoolss_GetPrintProcessorDirectory tmp;
3732 TALLOC_CTX *out_mem_ctx;
3735 static void dcerpc_spoolss_GetPrintProcessorDirectory_done(struct tevent_req *subreq);
3737 struct tevent_req *dcerpc_spoolss_GetPrintProcessorDirectory_send(TALLOC_CTX *mem_ctx,
3738 struct tevent_context *ev,
3739 struct dcerpc_binding_handle *h,
3740 const char *_server /* [in] [unique,charset(UTF16)] */,
3741 const char *_environment /* [in] [unique,charset(UTF16)] */,
3742 uint32_t _level /* [in] */,
3743 DATA_BLOB *_buffer /* [in] [unique] */,
3744 uint32_t _offered /* [in] */,
3745 union spoolss_PrintProcessorDirectoryInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
3746 uint32_t *_needed /* [out] [ref] */)
3748 struct tevent_req *req;
3749 struct dcerpc_spoolss_GetPrintProcessorDirectory_state *state;
3750 struct tevent_req *subreq;
3752 req = tevent_req_create(mem_ctx, &state,
3753 struct dcerpc_spoolss_GetPrintProcessorDirectory_state);
3757 state->out_mem_ctx = NULL;
3760 state->orig.in.server = _server;
3761 state->orig.in.environment = _environment;
3762 state->orig.in.level = _level;
3763 state->orig.in.buffer = _buffer;
3764 state->orig.in.offered = _offered;
3766 /* Out parameters */
3767 state->orig.out.info = _info;
3768 state->orig.out.needed = _needed;
3771 ZERO_STRUCT(state->orig.out.result);
3773 state->out_mem_ctx = talloc_named_const(state, 0,
3774 "dcerpc_spoolss_GetPrintProcessorDirectory_out_memory");
3775 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3776 return tevent_req_post(req, ev);
3779 /* make a temporary copy, that we pass to the dispatch function */
3780 state->tmp = state->orig;
3782 subreq = dcerpc_spoolss_GetPrintProcessorDirectory_r_send(state, ev, h, &state->tmp);
3783 if (tevent_req_nomem(subreq, req)) {
3784 return tevent_req_post(req, ev);
3786 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrintProcessorDirectory_done, req);
3790 static void dcerpc_spoolss_GetPrintProcessorDirectory_done(struct tevent_req *subreq)
3792 struct tevent_req *req = tevent_req_callback_data(
3793 subreq, struct tevent_req);
3794 struct dcerpc_spoolss_GetPrintProcessorDirectory_state *state = tevent_req_data(
3795 req, struct dcerpc_spoolss_GetPrintProcessorDirectory_state);
3797 TALLOC_CTX *mem_ctx;
3799 if (state->out_mem_ctx) {
3800 mem_ctx = state->out_mem_ctx;
3805 status = dcerpc_spoolss_GetPrintProcessorDirectory_r_recv(subreq, mem_ctx);
3806 TALLOC_FREE(subreq);
3807 if (tevent_req_nterror(req, status)) {
3811 /* Copy out parameters */
3812 if (state->orig.out.info && state->tmp.out.info) {
3813 *state->orig.out.info = *state->tmp.out.info;
3815 *state->orig.out.needed = *state->tmp.out.needed;
3818 state->orig.out.result = state->tmp.out.result;
3820 /* Reset temporary structure */
3821 ZERO_STRUCT(state->tmp);
3823 tevent_req_done(req);
3826 NTSTATUS dcerpc_spoolss_GetPrintProcessorDirectory_recv(struct tevent_req *req,
3827 TALLOC_CTX *mem_ctx,
3830 struct dcerpc_spoolss_GetPrintProcessorDirectory_state *state = tevent_req_data(
3831 req, struct dcerpc_spoolss_GetPrintProcessorDirectory_state);
3834 if (tevent_req_is_nterror(req, &status)) {
3835 tevent_req_received(req);
3839 /* Steal possible out parameters to the callers context */
3840 talloc_steal(mem_ctx, state->out_mem_ctx);
3843 *result = state->orig.out.result;
3845 tevent_req_received(req);
3846 return NT_STATUS_OK;
3849 NTSTATUS dcerpc_spoolss_GetPrintProcessorDirectory(struct dcerpc_binding_handle *h,
3850 TALLOC_CTX *mem_ctx,
3851 const char *_server /* [in] [unique,charset(UTF16)] */,
3852 const char *_environment /* [in] [unique,charset(UTF16)] */,
3853 uint32_t _level /* [in] */,
3854 DATA_BLOB *_buffer /* [in] [unique] */,
3855 uint32_t _offered /* [in] */,
3856 union spoolss_PrintProcessorDirectoryInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
3857 uint32_t *_needed /* [out] [ref] */,
3860 struct spoolss_GetPrintProcessorDirectory r;
3864 r.in.server = _server;
3865 r.in.environment = _environment;
3866 r.in.level = _level;
3867 r.in.buffer = _buffer;
3868 r.in.offered = _offered;
3870 status = dcerpc_spoolss_GetPrintProcessorDirectory_r(h, mem_ctx, &r);
3871 if (!NT_STATUS_IS_OK(status)) {
3875 /* Return variables */
3876 if (_info && r.out.info) {
3877 *_info = *r.out.info;
3879 *_needed = *r.out.needed;
3882 *result = r.out.result;
3884 return NT_STATUS_OK;
3887 struct dcerpc_spoolss_StartDocPrinter_r_state {
3888 TALLOC_CTX *out_mem_ctx;
3891 static void dcerpc_spoolss_StartDocPrinter_r_done(struct tevent_req *subreq);
3893 struct tevent_req *dcerpc_spoolss_StartDocPrinter_r_send(TALLOC_CTX *mem_ctx,
3894 struct tevent_context *ev,
3895 struct dcerpc_binding_handle *h,
3896 struct spoolss_StartDocPrinter *r)
3898 struct tevent_req *req;
3899 struct dcerpc_spoolss_StartDocPrinter_r_state *state;
3900 struct tevent_req *subreq;
3902 req = tevent_req_create(mem_ctx, &state,
3903 struct dcerpc_spoolss_StartDocPrinter_r_state);
3908 state->out_mem_ctx = talloc_new(state);
3909 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3910 return tevent_req_post(req, ev);
3913 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3914 NULL, &ndr_table_spoolss,
3915 NDR_SPOOLSS_STARTDOCPRINTER, state->out_mem_ctx, r);
3916 if (tevent_req_nomem(subreq, req)) {
3917 return tevent_req_post(req, ev);
3919 tevent_req_set_callback(subreq, dcerpc_spoolss_StartDocPrinter_r_done, req);
3924 static void dcerpc_spoolss_StartDocPrinter_r_done(struct tevent_req *subreq)
3926 struct tevent_req *req =
3927 tevent_req_callback_data(subreq,
3931 status = dcerpc_binding_handle_call_recv(subreq);
3932 TALLOC_FREE(subreq);
3933 if (tevent_req_nterror(req, status)) {
3937 tevent_req_done(req);
3940 NTSTATUS dcerpc_spoolss_StartDocPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3942 struct dcerpc_spoolss_StartDocPrinter_r_state *state =
3943 tevent_req_data(req,
3944 struct dcerpc_spoolss_StartDocPrinter_r_state);
3947 if (tevent_req_is_nterror(req, &status)) {
3948 tevent_req_received(req);
3952 talloc_steal(mem_ctx, state->out_mem_ctx);
3954 tevent_req_received(req);
3955 return NT_STATUS_OK;
3958 NTSTATUS dcerpc_spoolss_StartDocPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_StartDocPrinter *r)
3962 status = dcerpc_binding_handle_call(h,
3963 NULL, &ndr_table_spoolss,
3964 NDR_SPOOLSS_STARTDOCPRINTER, mem_ctx, r);
3969 struct dcerpc_spoolss_StartDocPrinter_state {
3970 struct spoolss_StartDocPrinter orig;
3971 struct spoolss_StartDocPrinter tmp;
3972 TALLOC_CTX *out_mem_ctx;
3975 static void dcerpc_spoolss_StartDocPrinter_done(struct tevent_req *subreq);
3977 struct tevent_req *dcerpc_spoolss_StartDocPrinter_send(TALLOC_CTX *mem_ctx,
3978 struct tevent_context *ev,
3979 struct dcerpc_binding_handle *h,
3980 struct policy_handle *_handle /* [in] [ref] */,
3981 struct spoolss_DocumentInfoCtr *_info_ctr /* [in] [ref] */,
3982 uint32_t *_job_id /* [out] [ref] */)
3984 struct tevent_req *req;
3985 struct dcerpc_spoolss_StartDocPrinter_state *state;
3986 struct tevent_req *subreq;
3988 req = tevent_req_create(mem_ctx, &state,
3989 struct dcerpc_spoolss_StartDocPrinter_state);
3993 state->out_mem_ctx = NULL;
3996 state->orig.in.handle = _handle;
3997 state->orig.in.info_ctr = _info_ctr;
3999 /* Out parameters */
4000 state->orig.out.job_id = _job_id;
4003 ZERO_STRUCT(state->orig.out.result);
4005 state->out_mem_ctx = talloc_named_const(state, 0,
4006 "dcerpc_spoolss_StartDocPrinter_out_memory");
4007 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4008 return tevent_req_post(req, ev);
4011 /* make a temporary copy, that we pass to the dispatch function */
4012 state->tmp = state->orig;
4014 subreq = dcerpc_spoolss_StartDocPrinter_r_send(state, ev, h, &state->tmp);
4015 if (tevent_req_nomem(subreq, req)) {
4016 return tevent_req_post(req, ev);
4018 tevent_req_set_callback(subreq, dcerpc_spoolss_StartDocPrinter_done, req);
4022 static void dcerpc_spoolss_StartDocPrinter_done(struct tevent_req *subreq)
4024 struct tevent_req *req = tevent_req_callback_data(
4025 subreq, struct tevent_req);
4026 struct dcerpc_spoolss_StartDocPrinter_state *state = tevent_req_data(
4027 req, struct dcerpc_spoolss_StartDocPrinter_state);
4029 TALLOC_CTX *mem_ctx;
4031 if (state->out_mem_ctx) {
4032 mem_ctx = state->out_mem_ctx;
4037 status = dcerpc_spoolss_StartDocPrinter_r_recv(subreq, mem_ctx);
4038 TALLOC_FREE(subreq);
4039 if (tevent_req_nterror(req, status)) {
4043 /* Copy out parameters */
4044 *state->orig.out.job_id = *state->tmp.out.job_id;
4047 state->orig.out.result = state->tmp.out.result;
4049 /* Reset temporary structure */
4050 ZERO_STRUCT(state->tmp);
4052 tevent_req_done(req);
4055 NTSTATUS dcerpc_spoolss_StartDocPrinter_recv(struct tevent_req *req,
4056 TALLOC_CTX *mem_ctx,
4059 struct dcerpc_spoolss_StartDocPrinter_state *state = tevent_req_data(
4060 req, struct dcerpc_spoolss_StartDocPrinter_state);
4063 if (tevent_req_is_nterror(req, &status)) {
4064 tevent_req_received(req);
4068 /* Steal possible out parameters to the callers context */
4069 talloc_steal(mem_ctx, state->out_mem_ctx);
4072 *result = state->orig.out.result;
4074 tevent_req_received(req);
4075 return NT_STATUS_OK;
4078 NTSTATUS dcerpc_spoolss_StartDocPrinter(struct dcerpc_binding_handle *h,
4079 TALLOC_CTX *mem_ctx,
4080 struct policy_handle *_handle /* [in] [ref] */,
4081 struct spoolss_DocumentInfoCtr *_info_ctr /* [in] [ref] */,
4082 uint32_t *_job_id /* [out] [ref] */,
4085 struct spoolss_StartDocPrinter r;
4089 r.in.handle = _handle;
4090 r.in.info_ctr = _info_ctr;
4092 status = dcerpc_spoolss_StartDocPrinter_r(h, mem_ctx, &r);
4093 if (!NT_STATUS_IS_OK(status)) {
4097 /* Return variables */
4098 *_job_id = *r.out.job_id;
4101 *result = r.out.result;
4103 return NT_STATUS_OK;
4106 struct dcerpc_spoolss_StartPagePrinter_r_state {
4107 TALLOC_CTX *out_mem_ctx;
4110 static void dcerpc_spoolss_StartPagePrinter_r_done(struct tevent_req *subreq);
4112 struct tevent_req *dcerpc_spoolss_StartPagePrinter_r_send(TALLOC_CTX *mem_ctx,
4113 struct tevent_context *ev,
4114 struct dcerpc_binding_handle *h,
4115 struct spoolss_StartPagePrinter *r)
4117 struct tevent_req *req;
4118 struct dcerpc_spoolss_StartPagePrinter_r_state *state;
4119 struct tevent_req *subreq;
4121 req = tevent_req_create(mem_ctx, &state,
4122 struct dcerpc_spoolss_StartPagePrinter_r_state);
4127 state->out_mem_ctx = NULL;
4129 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4130 NULL, &ndr_table_spoolss,
4131 NDR_SPOOLSS_STARTPAGEPRINTER, state, r);
4132 if (tevent_req_nomem(subreq, req)) {
4133 return tevent_req_post(req, ev);
4135 tevent_req_set_callback(subreq, dcerpc_spoolss_StartPagePrinter_r_done, req);
4140 static void dcerpc_spoolss_StartPagePrinter_r_done(struct tevent_req *subreq)
4142 struct tevent_req *req =
4143 tevent_req_callback_data(subreq,
4147 status = dcerpc_binding_handle_call_recv(subreq);
4148 TALLOC_FREE(subreq);
4149 if (tevent_req_nterror(req, status)) {
4153 tevent_req_done(req);
4156 NTSTATUS dcerpc_spoolss_StartPagePrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4158 struct dcerpc_spoolss_StartPagePrinter_r_state *state =
4159 tevent_req_data(req,
4160 struct dcerpc_spoolss_StartPagePrinter_r_state);
4163 if (tevent_req_is_nterror(req, &status)) {
4164 tevent_req_received(req);
4168 talloc_steal(mem_ctx, state->out_mem_ctx);
4170 tevent_req_received(req);
4171 return NT_STATUS_OK;
4174 NTSTATUS dcerpc_spoolss_StartPagePrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_StartPagePrinter *r)
4178 status = dcerpc_binding_handle_call(h,
4179 NULL, &ndr_table_spoolss,
4180 NDR_SPOOLSS_STARTPAGEPRINTER, mem_ctx, r);
4185 struct dcerpc_spoolss_StartPagePrinter_state {
4186 struct spoolss_StartPagePrinter orig;
4187 struct spoolss_StartPagePrinter tmp;
4188 TALLOC_CTX *out_mem_ctx;
4191 static void dcerpc_spoolss_StartPagePrinter_done(struct tevent_req *subreq);
4193 struct tevent_req *dcerpc_spoolss_StartPagePrinter_send(TALLOC_CTX *mem_ctx,
4194 struct tevent_context *ev,
4195 struct dcerpc_binding_handle *h,
4196 struct policy_handle *_handle /* [in] [ref] */)
4198 struct tevent_req *req;
4199 struct dcerpc_spoolss_StartPagePrinter_state *state;
4200 struct tevent_req *subreq;
4202 req = tevent_req_create(mem_ctx, &state,
4203 struct dcerpc_spoolss_StartPagePrinter_state);
4207 state->out_mem_ctx = NULL;
4210 state->orig.in.handle = _handle;
4212 /* Out parameters */
4215 ZERO_STRUCT(state->orig.out.result);
4217 /* make a temporary copy, that we pass to the dispatch function */
4218 state->tmp = state->orig;
4220 subreq = dcerpc_spoolss_StartPagePrinter_r_send(state, ev, h, &state->tmp);
4221 if (tevent_req_nomem(subreq, req)) {
4222 return tevent_req_post(req, ev);
4224 tevent_req_set_callback(subreq, dcerpc_spoolss_StartPagePrinter_done, req);
4228 static void dcerpc_spoolss_StartPagePrinter_done(struct tevent_req *subreq)
4230 struct tevent_req *req = tevent_req_callback_data(
4231 subreq, struct tevent_req);
4232 struct dcerpc_spoolss_StartPagePrinter_state *state = tevent_req_data(
4233 req, struct dcerpc_spoolss_StartPagePrinter_state);
4235 TALLOC_CTX *mem_ctx;
4237 if (state->out_mem_ctx) {
4238 mem_ctx = state->out_mem_ctx;
4243 status = dcerpc_spoolss_StartPagePrinter_r_recv(subreq, mem_ctx);
4244 TALLOC_FREE(subreq);
4245 if (tevent_req_nterror(req, status)) {
4249 /* Copy out parameters */
4252 state->orig.out.result = state->tmp.out.result;
4254 /* Reset temporary structure */
4255 ZERO_STRUCT(state->tmp);
4257 tevent_req_done(req);
4260 NTSTATUS dcerpc_spoolss_StartPagePrinter_recv(struct tevent_req *req,
4261 TALLOC_CTX *mem_ctx,
4264 struct dcerpc_spoolss_StartPagePrinter_state *state = tevent_req_data(
4265 req, struct dcerpc_spoolss_StartPagePrinter_state);
4268 if (tevent_req_is_nterror(req, &status)) {
4269 tevent_req_received(req);
4273 /* Steal possible out parameters to the callers context */
4274 talloc_steal(mem_ctx, state->out_mem_ctx);
4277 *result = state->orig.out.result;
4279 tevent_req_received(req);
4280 return NT_STATUS_OK;
4283 NTSTATUS dcerpc_spoolss_StartPagePrinter(struct dcerpc_binding_handle *h,
4284 TALLOC_CTX *mem_ctx,
4285 struct policy_handle *_handle /* [in] [ref] */,
4288 struct spoolss_StartPagePrinter r;
4292 r.in.handle = _handle;
4294 status = dcerpc_spoolss_StartPagePrinter_r(h, mem_ctx, &r);
4295 if (!NT_STATUS_IS_OK(status)) {
4299 /* Return variables */
4302 *result = r.out.result;
4304 return NT_STATUS_OK;
4307 struct dcerpc_spoolss_WritePrinter_r_state {
4308 TALLOC_CTX *out_mem_ctx;
4311 static void dcerpc_spoolss_WritePrinter_r_done(struct tevent_req *subreq);
4313 struct tevent_req *dcerpc_spoolss_WritePrinter_r_send(TALLOC_CTX *mem_ctx,
4314 struct tevent_context *ev,
4315 struct dcerpc_binding_handle *h,
4316 struct spoolss_WritePrinter *r)
4318 struct tevent_req *req;
4319 struct dcerpc_spoolss_WritePrinter_r_state *state;
4320 struct tevent_req *subreq;
4322 req = tevent_req_create(mem_ctx, &state,
4323 struct dcerpc_spoolss_WritePrinter_r_state);
4328 state->out_mem_ctx = talloc_new(state);
4329 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4330 return tevent_req_post(req, ev);
4333 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4334 NULL, &ndr_table_spoolss,
4335 NDR_SPOOLSS_WRITEPRINTER, state->out_mem_ctx, r);
4336 if (tevent_req_nomem(subreq, req)) {
4337 return tevent_req_post(req, ev);
4339 tevent_req_set_callback(subreq, dcerpc_spoolss_WritePrinter_r_done, req);
4344 static void dcerpc_spoolss_WritePrinter_r_done(struct tevent_req *subreq)
4346 struct tevent_req *req =
4347 tevent_req_callback_data(subreq,
4351 status = dcerpc_binding_handle_call_recv(subreq);
4352 TALLOC_FREE(subreq);
4353 if (tevent_req_nterror(req, status)) {
4357 tevent_req_done(req);
4360 NTSTATUS dcerpc_spoolss_WritePrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4362 struct dcerpc_spoolss_WritePrinter_r_state *state =
4363 tevent_req_data(req,
4364 struct dcerpc_spoolss_WritePrinter_r_state);
4367 if (tevent_req_is_nterror(req, &status)) {
4368 tevent_req_received(req);
4372 talloc_steal(mem_ctx, state->out_mem_ctx);
4374 tevent_req_received(req);
4375 return NT_STATUS_OK;
4378 NTSTATUS dcerpc_spoolss_WritePrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_WritePrinter *r)
4382 status = dcerpc_binding_handle_call(h,
4383 NULL, &ndr_table_spoolss,
4384 NDR_SPOOLSS_WRITEPRINTER, mem_ctx, r);
4389 struct dcerpc_spoolss_WritePrinter_state {
4390 struct spoolss_WritePrinter orig;
4391 struct spoolss_WritePrinter tmp;
4392 TALLOC_CTX *out_mem_ctx;
4395 static void dcerpc_spoolss_WritePrinter_done(struct tevent_req *subreq);
4397 struct tevent_req *dcerpc_spoolss_WritePrinter_send(TALLOC_CTX *mem_ctx,
4398 struct tevent_context *ev,
4399 struct dcerpc_binding_handle *h,
4400 struct policy_handle *_handle /* [in] [ref] */,
4401 DATA_BLOB _data /* [in] */,
4402 uint32_t __data_size /* [in] [value(r->in.data.length)] */,
4403 uint32_t *_num_written /* [out] [ref] */)
4405 struct tevent_req *req;
4406 struct dcerpc_spoolss_WritePrinter_state *state;
4407 struct tevent_req *subreq;
4409 req = tevent_req_create(mem_ctx, &state,
4410 struct dcerpc_spoolss_WritePrinter_state);
4414 state->out_mem_ctx = NULL;
4417 state->orig.in.handle = _handle;
4418 state->orig.in.data = _data;
4419 state->orig.in._data_size = __data_size;
4421 /* Out parameters */
4422 state->orig.out.num_written = _num_written;
4425 ZERO_STRUCT(state->orig.out.result);
4427 state->out_mem_ctx = talloc_named_const(state, 0,
4428 "dcerpc_spoolss_WritePrinter_out_memory");
4429 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4430 return tevent_req_post(req, ev);
4433 /* make a temporary copy, that we pass to the dispatch function */
4434 state->tmp = state->orig;
4436 subreq = dcerpc_spoolss_WritePrinter_r_send(state, ev, h, &state->tmp);
4437 if (tevent_req_nomem(subreq, req)) {
4438 return tevent_req_post(req, ev);
4440 tevent_req_set_callback(subreq, dcerpc_spoolss_WritePrinter_done, req);
4444 static void dcerpc_spoolss_WritePrinter_done(struct tevent_req *subreq)
4446 struct tevent_req *req = tevent_req_callback_data(
4447 subreq, struct tevent_req);
4448 struct dcerpc_spoolss_WritePrinter_state *state = tevent_req_data(
4449 req, struct dcerpc_spoolss_WritePrinter_state);
4451 TALLOC_CTX *mem_ctx;
4453 if (state->out_mem_ctx) {
4454 mem_ctx = state->out_mem_ctx;
4459 status = dcerpc_spoolss_WritePrinter_r_recv(subreq, mem_ctx);
4460 TALLOC_FREE(subreq);
4461 if (tevent_req_nterror(req, status)) {
4465 /* Copy out parameters */
4466 *state->orig.out.num_written = *state->tmp.out.num_written;
4469 state->orig.out.result = state->tmp.out.result;
4471 /* Reset temporary structure */
4472 ZERO_STRUCT(state->tmp);
4474 tevent_req_done(req);
4477 NTSTATUS dcerpc_spoolss_WritePrinter_recv(struct tevent_req *req,
4478 TALLOC_CTX *mem_ctx,
4481 struct dcerpc_spoolss_WritePrinter_state *state = tevent_req_data(
4482 req, struct dcerpc_spoolss_WritePrinter_state);
4485 if (tevent_req_is_nterror(req, &status)) {
4486 tevent_req_received(req);
4490 /* Steal possible out parameters to the callers context */
4491 talloc_steal(mem_ctx, state->out_mem_ctx);
4494 *result = state->orig.out.result;
4496 tevent_req_received(req);
4497 return NT_STATUS_OK;
4500 NTSTATUS dcerpc_spoolss_WritePrinter(struct dcerpc_binding_handle *h,
4501 TALLOC_CTX *mem_ctx,
4502 struct policy_handle *_handle /* [in] [ref] */,
4503 DATA_BLOB _data /* [in] */,
4504 uint32_t __data_size /* [in] [value(r->in.data.length)] */,
4505 uint32_t *_num_written /* [out] [ref] */,
4508 struct spoolss_WritePrinter r;
4512 r.in.handle = _handle;
4514 r.in._data_size = __data_size;
4516 status = dcerpc_spoolss_WritePrinter_r(h, mem_ctx, &r);
4517 if (!NT_STATUS_IS_OK(status)) {
4521 /* Return variables */
4522 *_num_written = *r.out.num_written;
4525 *result = r.out.result;
4527 return NT_STATUS_OK;
4530 struct dcerpc_spoolss_EndPagePrinter_r_state {
4531 TALLOC_CTX *out_mem_ctx;
4534 static void dcerpc_spoolss_EndPagePrinter_r_done(struct tevent_req *subreq);
4536 struct tevent_req *dcerpc_spoolss_EndPagePrinter_r_send(TALLOC_CTX *mem_ctx,
4537 struct tevent_context *ev,
4538 struct dcerpc_binding_handle *h,
4539 struct spoolss_EndPagePrinter *r)
4541 struct tevent_req *req;
4542 struct dcerpc_spoolss_EndPagePrinter_r_state *state;
4543 struct tevent_req *subreq;
4545 req = tevent_req_create(mem_ctx, &state,
4546 struct dcerpc_spoolss_EndPagePrinter_r_state);
4551 state->out_mem_ctx = NULL;
4553 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4554 NULL, &ndr_table_spoolss,
4555 NDR_SPOOLSS_ENDPAGEPRINTER, state, r);
4556 if (tevent_req_nomem(subreq, req)) {
4557 return tevent_req_post(req, ev);
4559 tevent_req_set_callback(subreq, dcerpc_spoolss_EndPagePrinter_r_done, req);
4564 static void dcerpc_spoolss_EndPagePrinter_r_done(struct tevent_req *subreq)
4566 struct tevent_req *req =
4567 tevent_req_callback_data(subreq,
4571 status = dcerpc_binding_handle_call_recv(subreq);
4572 TALLOC_FREE(subreq);
4573 if (tevent_req_nterror(req, status)) {
4577 tevent_req_done(req);
4580 NTSTATUS dcerpc_spoolss_EndPagePrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4582 struct dcerpc_spoolss_EndPagePrinter_r_state *state =
4583 tevent_req_data(req,
4584 struct dcerpc_spoolss_EndPagePrinter_r_state);
4587 if (tevent_req_is_nterror(req, &status)) {
4588 tevent_req_received(req);
4592 talloc_steal(mem_ctx, state->out_mem_ctx);
4594 tevent_req_received(req);
4595 return NT_STATUS_OK;
4598 NTSTATUS dcerpc_spoolss_EndPagePrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EndPagePrinter *r)
4602 status = dcerpc_binding_handle_call(h,
4603 NULL, &ndr_table_spoolss,
4604 NDR_SPOOLSS_ENDPAGEPRINTER, mem_ctx, r);
4609 struct dcerpc_spoolss_EndPagePrinter_state {
4610 struct spoolss_EndPagePrinter orig;
4611 struct spoolss_EndPagePrinter tmp;
4612 TALLOC_CTX *out_mem_ctx;
4615 static void dcerpc_spoolss_EndPagePrinter_done(struct tevent_req *subreq);
4617 struct tevent_req *dcerpc_spoolss_EndPagePrinter_send(TALLOC_CTX *mem_ctx,
4618 struct tevent_context *ev,
4619 struct dcerpc_binding_handle *h,
4620 struct policy_handle *_handle /* [in] [ref] */)
4622 struct tevent_req *req;
4623 struct dcerpc_spoolss_EndPagePrinter_state *state;
4624 struct tevent_req *subreq;
4626 req = tevent_req_create(mem_ctx, &state,
4627 struct dcerpc_spoolss_EndPagePrinter_state);
4631 state->out_mem_ctx = NULL;
4634 state->orig.in.handle = _handle;
4636 /* Out parameters */
4639 ZERO_STRUCT(state->orig.out.result);
4641 /* make a temporary copy, that we pass to the dispatch function */
4642 state->tmp = state->orig;
4644 subreq = dcerpc_spoolss_EndPagePrinter_r_send(state, ev, h, &state->tmp);
4645 if (tevent_req_nomem(subreq, req)) {
4646 return tevent_req_post(req, ev);
4648 tevent_req_set_callback(subreq, dcerpc_spoolss_EndPagePrinter_done, req);
4652 static void dcerpc_spoolss_EndPagePrinter_done(struct tevent_req *subreq)
4654 struct tevent_req *req = tevent_req_callback_data(
4655 subreq, struct tevent_req);
4656 struct dcerpc_spoolss_EndPagePrinter_state *state = tevent_req_data(
4657 req, struct dcerpc_spoolss_EndPagePrinter_state);
4659 TALLOC_CTX *mem_ctx;
4661 if (state->out_mem_ctx) {
4662 mem_ctx = state->out_mem_ctx;
4667 status = dcerpc_spoolss_EndPagePrinter_r_recv(subreq, mem_ctx);
4668 TALLOC_FREE(subreq);
4669 if (tevent_req_nterror(req, status)) {
4673 /* Copy out parameters */
4676 state->orig.out.result = state->tmp.out.result;
4678 /* Reset temporary structure */
4679 ZERO_STRUCT(state->tmp);
4681 tevent_req_done(req);
4684 NTSTATUS dcerpc_spoolss_EndPagePrinter_recv(struct tevent_req *req,
4685 TALLOC_CTX *mem_ctx,
4688 struct dcerpc_spoolss_EndPagePrinter_state *state = tevent_req_data(
4689 req, struct dcerpc_spoolss_EndPagePrinter_state);
4692 if (tevent_req_is_nterror(req, &status)) {
4693 tevent_req_received(req);
4697 /* Steal possible out parameters to the callers context */
4698 talloc_steal(mem_ctx, state->out_mem_ctx);
4701 *result = state->orig.out.result;
4703 tevent_req_received(req);
4704 return NT_STATUS_OK;
4707 NTSTATUS dcerpc_spoolss_EndPagePrinter(struct dcerpc_binding_handle *h,
4708 TALLOC_CTX *mem_ctx,
4709 struct policy_handle *_handle /* [in] [ref] */,
4712 struct spoolss_EndPagePrinter r;
4716 r.in.handle = _handle;
4718 status = dcerpc_spoolss_EndPagePrinter_r(h, mem_ctx, &r);
4719 if (!NT_STATUS_IS_OK(status)) {
4723 /* Return variables */
4726 *result = r.out.result;
4728 return NT_STATUS_OK;
4731 struct dcerpc_spoolss_AbortPrinter_r_state {
4732 TALLOC_CTX *out_mem_ctx;
4735 static void dcerpc_spoolss_AbortPrinter_r_done(struct tevent_req *subreq);
4737 struct tevent_req *dcerpc_spoolss_AbortPrinter_r_send(TALLOC_CTX *mem_ctx,
4738 struct tevent_context *ev,
4739 struct dcerpc_binding_handle *h,
4740 struct spoolss_AbortPrinter *r)
4742 struct tevent_req *req;
4743 struct dcerpc_spoolss_AbortPrinter_r_state *state;
4744 struct tevent_req *subreq;
4746 req = tevent_req_create(mem_ctx, &state,
4747 struct dcerpc_spoolss_AbortPrinter_r_state);
4752 state->out_mem_ctx = NULL;
4754 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4755 NULL, &ndr_table_spoolss,
4756 NDR_SPOOLSS_ABORTPRINTER, state, r);
4757 if (tevent_req_nomem(subreq, req)) {
4758 return tevent_req_post(req, ev);
4760 tevent_req_set_callback(subreq, dcerpc_spoolss_AbortPrinter_r_done, req);
4765 static void dcerpc_spoolss_AbortPrinter_r_done(struct tevent_req *subreq)
4767 struct tevent_req *req =
4768 tevent_req_callback_data(subreq,
4772 status = dcerpc_binding_handle_call_recv(subreq);
4773 TALLOC_FREE(subreq);
4774 if (tevent_req_nterror(req, status)) {
4778 tevent_req_done(req);
4781 NTSTATUS dcerpc_spoolss_AbortPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4783 struct dcerpc_spoolss_AbortPrinter_r_state *state =
4784 tevent_req_data(req,
4785 struct dcerpc_spoolss_AbortPrinter_r_state);
4788 if (tevent_req_is_nterror(req, &status)) {
4789 tevent_req_received(req);
4793 talloc_steal(mem_ctx, state->out_mem_ctx);
4795 tevent_req_received(req);
4796 return NT_STATUS_OK;
4799 NTSTATUS dcerpc_spoolss_AbortPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AbortPrinter *r)
4803 status = dcerpc_binding_handle_call(h,
4804 NULL, &ndr_table_spoolss,
4805 NDR_SPOOLSS_ABORTPRINTER, mem_ctx, r);
4810 struct dcerpc_spoolss_AbortPrinter_state {
4811 struct spoolss_AbortPrinter orig;
4812 struct spoolss_AbortPrinter tmp;
4813 TALLOC_CTX *out_mem_ctx;
4816 static void dcerpc_spoolss_AbortPrinter_done(struct tevent_req *subreq);
4818 struct tevent_req *dcerpc_spoolss_AbortPrinter_send(TALLOC_CTX *mem_ctx,
4819 struct tevent_context *ev,
4820 struct dcerpc_binding_handle *h,
4821 struct policy_handle *_handle /* [in] [ref] */)
4823 struct tevent_req *req;
4824 struct dcerpc_spoolss_AbortPrinter_state *state;
4825 struct tevent_req *subreq;
4827 req = tevent_req_create(mem_ctx, &state,
4828 struct dcerpc_spoolss_AbortPrinter_state);
4832 state->out_mem_ctx = NULL;
4835 state->orig.in.handle = _handle;
4837 /* Out parameters */
4840 ZERO_STRUCT(state->orig.out.result);
4842 /* make a temporary copy, that we pass to the dispatch function */
4843 state->tmp = state->orig;
4845 subreq = dcerpc_spoolss_AbortPrinter_r_send(state, ev, h, &state->tmp);
4846 if (tevent_req_nomem(subreq, req)) {
4847 return tevent_req_post(req, ev);
4849 tevent_req_set_callback(subreq, dcerpc_spoolss_AbortPrinter_done, req);
4853 static void dcerpc_spoolss_AbortPrinter_done(struct tevent_req *subreq)
4855 struct tevent_req *req = tevent_req_callback_data(
4856 subreq, struct tevent_req);
4857 struct dcerpc_spoolss_AbortPrinter_state *state = tevent_req_data(
4858 req, struct dcerpc_spoolss_AbortPrinter_state);
4860 TALLOC_CTX *mem_ctx;
4862 if (state->out_mem_ctx) {
4863 mem_ctx = state->out_mem_ctx;
4868 status = dcerpc_spoolss_AbortPrinter_r_recv(subreq, mem_ctx);
4869 TALLOC_FREE(subreq);
4870 if (tevent_req_nterror(req, status)) {
4874 /* Copy out parameters */
4877 state->orig.out.result = state->tmp.out.result;
4879 /* Reset temporary structure */
4880 ZERO_STRUCT(state->tmp);
4882 tevent_req_done(req);
4885 NTSTATUS dcerpc_spoolss_AbortPrinter_recv(struct tevent_req *req,
4886 TALLOC_CTX *mem_ctx,
4889 struct dcerpc_spoolss_AbortPrinter_state *state = tevent_req_data(
4890 req, struct dcerpc_spoolss_AbortPrinter_state);
4893 if (tevent_req_is_nterror(req, &status)) {
4894 tevent_req_received(req);
4898 /* Steal possible out parameters to the callers context */
4899 talloc_steal(mem_ctx, state->out_mem_ctx);
4902 *result = state->orig.out.result;
4904 tevent_req_received(req);
4905 return NT_STATUS_OK;
4908 NTSTATUS dcerpc_spoolss_AbortPrinter(struct dcerpc_binding_handle *h,
4909 TALLOC_CTX *mem_ctx,
4910 struct policy_handle *_handle /* [in] [ref] */,
4913 struct spoolss_AbortPrinter r;
4917 r.in.handle = _handle;
4919 status = dcerpc_spoolss_AbortPrinter_r(h, mem_ctx, &r);
4920 if (!NT_STATUS_IS_OK(status)) {
4924 /* Return variables */
4927 *result = r.out.result;
4929 return NT_STATUS_OK;
4932 struct dcerpc_spoolss_ReadPrinter_r_state {
4933 TALLOC_CTX *out_mem_ctx;
4936 static void dcerpc_spoolss_ReadPrinter_r_done(struct tevent_req *subreq);
4938 struct tevent_req *dcerpc_spoolss_ReadPrinter_r_send(TALLOC_CTX *mem_ctx,
4939 struct tevent_context *ev,
4940 struct dcerpc_binding_handle *h,
4941 struct spoolss_ReadPrinter *r)
4943 struct tevent_req *req;
4944 struct dcerpc_spoolss_ReadPrinter_r_state *state;
4945 struct tevent_req *subreq;
4947 req = tevent_req_create(mem_ctx, &state,
4948 struct dcerpc_spoolss_ReadPrinter_r_state);
4953 state->out_mem_ctx = talloc_new(state);
4954 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4955 return tevent_req_post(req, ev);
4958 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4959 NULL, &ndr_table_spoolss,
4960 NDR_SPOOLSS_READPRINTER, state->out_mem_ctx, r);
4961 if (tevent_req_nomem(subreq, req)) {
4962 return tevent_req_post(req, ev);
4964 tevent_req_set_callback(subreq, dcerpc_spoolss_ReadPrinter_r_done, req);
4969 static void dcerpc_spoolss_ReadPrinter_r_done(struct tevent_req *subreq)
4971 struct tevent_req *req =
4972 tevent_req_callback_data(subreq,
4976 status = dcerpc_binding_handle_call_recv(subreq);
4977 TALLOC_FREE(subreq);
4978 if (tevent_req_nterror(req, status)) {
4982 tevent_req_done(req);
4985 NTSTATUS dcerpc_spoolss_ReadPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4987 struct dcerpc_spoolss_ReadPrinter_r_state *state =
4988 tevent_req_data(req,
4989 struct dcerpc_spoolss_ReadPrinter_r_state);
4992 if (tevent_req_is_nterror(req, &status)) {
4993 tevent_req_received(req);
4997 talloc_steal(mem_ctx, state->out_mem_ctx);
4999 tevent_req_received(req);
5000 return NT_STATUS_OK;
5003 NTSTATUS dcerpc_spoolss_ReadPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_ReadPrinter *r)
5007 status = dcerpc_binding_handle_call(h,
5008 NULL, &ndr_table_spoolss,
5009 NDR_SPOOLSS_READPRINTER, mem_ctx, r);
5014 struct dcerpc_spoolss_ReadPrinter_state {
5015 struct spoolss_ReadPrinter orig;
5016 struct spoolss_ReadPrinter tmp;
5017 TALLOC_CTX *out_mem_ctx;
5020 static void dcerpc_spoolss_ReadPrinter_done(struct tevent_req *subreq);
5022 struct tevent_req *dcerpc_spoolss_ReadPrinter_send(TALLOC_CTX *mem_ctx,
5023 struct tevent_context *ev,
5024 struct dcerpc_binding_handle *h,
5025 struct policy_handle *_handle /* [in] [ref] */,
5026 uint8_t *_data /* [out] [ref,size_is(data_size)] */,
5027 uint32_t _data_size /* [in] */,
5028 uint32_t *__data_size /* [out] [ref] */)
5030 struct tevent_req *req;
5031 struct dcerpc_spoolss_ReadPrinter_state *state;
5032 struct tevent_req *subreq;
5034 req = tevent_req_create(mem_ctx, &state,
5035 struct dcerpc_spoolss_ReadPrinter_state);
5039 state->out_mem_ctx = NULL;
5042 state->orig.in.handle = _handle;
5043 state->orig.in.data_size = _data_size;
5045 /* Out parameters */
5046 state->orig.out.data = _data;
5047 state->orig.out._data_size = __data_size;
5050 ZERO_STRUCT(state->orig.out.result);
5052 state->out_mem_ctx = talloc_named_const(state, 0,
5053 "dcerpc_spoolss_ReadPrinter_out_memory");
5054 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5055 return tevent_req_post(req, ev);
5058 /* make a temporary copy, that we pass to the dispatch function */
5059 state->tmp = state->orig;
5061 subreq = dcerpc_spoolss_ReadPrinter_r_send(state, ev, h, &state->tmp);
5062 if (tevent_req_nomem(subreq, req)) {
5063 return tevent_req_post(req, ev);
5065 tevent_req_set_callback(subreq, dcerpc_spoolss_ReadPrinter_done, req);
5069 static void dcerpc_spoolss_ReadPrinter_done(struct tevent_req *subreq)
5071 struct tevent_req *req = tevent_req_callback_data(
5072 subreq, struct tevent_req);
5073 struct dcerpc_spoolss_ReadPrinter_state *state = tevent_req_data(
5074 req, struct dcerpc_spoolss_ReadPrinter_state);
5076 TALLOC_CTX *mem_ctx;
5078 if (state->out_mem_ctx) {
5079 mem_ctx = state->out_mem_ctx;
5084 status = dcerpc_spoolss_ReadPrinter_r_recv(subreq, mem_ctx);
5085 TALLOC_FREE(subreq);
5086 if (tevent_req_nterror(req, status)) {
5090 /* Copy out parameters */
5092 size_t _copy_len_data;
5093 _copy_len_data = state->tmp.in.data_size;
5094 memcpy(state->orig.out.data, state->tmp.out.data, _copy_len_data * sizeof(*state->orig.out.data));
5096 *state->orig.out._data_size = *state->tmp.out._data_size;
5099 state->orig.out.result = state->tmp.out.result;
5101 /* Reset temporary structure */
5102 ZERO_STRUCT(state->tmp);
5104 tevent_req_done(req);
5107 NTSTATUS dcerpc_spoolss_ReadPrinter_recv(struct tevent_req *req,
5108 TALLOC_CTX *mem_ctx,
5111 struct dcerpc_spoolss_ReadPrinter_state *state = tevent_req_data(
5112 req, struct dcerpc_spoolss_ReadPrinter_state);
5115 if (tevent_req_is_nterror(req, &status)) {
5116 tevent_req_received(req);
5120 /* Steal possible out parameters to the callers context */
5121 talloc_steal(mem_ctx, state->out_mem_ctx);
5124 *result = state->orig.out.result;
5126 tevent_req_received(req);
5127 return NT_STATUS_OK;
5130 NTSTATUS dcerpc_spoolss_ReadPrinter(struct dcerpc_binding_handle *h,
5131 TALLOC_CTX *mem_ctx,
5132 struct policy_handle *_handle /* [in] [ref] */,
5133 uint8_t *_data /* [out] [ref,size_is(data_size)] */,
5134 uint32_t _data_size /* [in] */,
5135 uint32_t *__data_size /* [out] [ref] */,
5138 struct spoolss_ReadPrinter r;
5142 r.in.handle = _handle;
5143 r.in.data_size = _data_size;
5145 status = dcerpc_spoolss_ReadPrinter_r(h, mem_ctx, &r);
5146 if (!NT_STATUS_IS_OK(status)) {
5150 /* Return variables */
5152 size_t _copy_len_data;
5153 _copy_len_data = r.in.data_size;
5154 memcpy(_data, r.out.data, _copy_len_data * sizeof(*_data));
5156 *__data_size = *r.out._data_size;
5159 *result = r.out.result;
5161 return NT_STATUS_OK;
5164 struct dcerpc_spoolss_EndDocPrinter_r_state {
5165 TALLOC_CTX *out_mem_ctx;
5168 static void dcerpc_spoolss_EndDocPrinter_r_done(struct tevent_req *subreq);
5170 struct tevent_req *dcerpc_spoolss_EndDocPrinter_r_send(TALLOC_CTX *mem_ctx,
5171 struct tevent_context *ev,
5172 struct dcerpc_binding_handle *h,
5173 struct spoolss_EndDocPrinter *r)
5175 struct tevent_req *req;
5176 struct dcerpc_spoolss_EndDocPrinter_r_state *state;
5177 struct tevent_req *subreq;
5179 req = tevent_req_create(mem_ctx, &state,
5180 struct dcerpc_spoolss_EndDocPrinter_r_state);
5185 state->out_mem_ctx = NULL;
5187 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5188 NULL, &ndr_table_spoolss,
5189 NDR_SPOOLSS_ENDDOCPRINTER, state, r);
5190 if (tevent_req_nomem(subreq, req)) {
5191 return tevent_req_post(req, ev);
5193 tevent_req_set_callback(subreq, dcerpc_spoolss_EndDocPrinter_r_done, req);
5198 static void dcerpc_spoolss_EndDocPrinter_r_done(struct tevent_req *subreq)
5200 struct tevent_req *req =
5201 tevent_req_callback_data(subreq,
5205 status = dcerpc_binding_handle_call_recv(subreq);
5206 TALLOC_FREE(subreq);
5207 if (tevent_req_nterror(req, status)) {
5211 tevent_req_done(req);
5214 NTSTATUS dcerpc_spoolss_EndDocPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5216 struct dcerpc_spoolss_EndDocPrinter_r_state *state =
5217 tevent_req_data(req,
5218 struct dcerpc_spoolss_EndDocPrinter_r_state);
5221 if (tevent_req_is_nterror(req, &status)) {
5222 tevent_req_received(req);
5226 talloc_steal(mem_ctx, state->out_mem_ctx);
5228 tevent_req_received(req);
5229 return NT_STATUS_OK;
5232 NTSTATUS dcerpc_spoolss_EndDocPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EndDocPrinter *r)
5236 status = dcerpc_binding_handle_call(h,
5237 NULL, &ndr_table_spoolss,
5238 NDR_SPOOLSS_ENDDOCPRINTER, mem_ctx, r);
5243 struct dcerpc_spoolss_EndDocPrinter_state {
5244 struct spoolss_EndDocPrinter orig;
5245 struct spoolss_EndDocPrinter tmp;
5246 TALLOC_CTX *out_mem_ctx;
5249 static void dcerpc_spoolss_EndDocPrinter_done(struct tevent_req *subreq);
5251 struct tevent_req *dcerpc_spoolss_EndDocPrinter_send(TALLOC_CTX *mem_ctx,
5252 struct tevent_context *ev,
5253 struct dcerpc_binding_handle *h,
5254 struct policy_handle *_handle /* [in] [ref] */)
5256 struct tevent_req *req;
5257 struct dcerpc_spoolss_EndDocPrinter_state *state;
5258 struct tevent_req *subreq;
5260 req = tevent_req_create(mem_ctx, &state,
5261 struct dcerpc_spoolss_EndDocPrinter_state);
5265 state->out_mem_ctx = NULL;
5268 state->orig.in.handle = _handle;
5270 /* Out parameters */
5273 ZERO_STRUCT(state->orig.out.result);
5275 /* make a temporary copy, that we pass to the dispatch function */
5276 state->tmp = state->orig;
5278 subreq = dcerpc_spoolss_EndDocPrinter_r_send(state, ev, h, &state->tmp);
5279 if (tevent_req_nomem(subreq, req)) {
5280 return tevent_req_post(req, ev);
5282 tevent_req_set_callback(subreq, dcerpc_spoolss_EndDocPrinter_done, req);
5286 static void dcerpc_spoolss_EndDocPrinter_done(struct tevent_req *subreq)
5288 struct tevent_req *req = tevent_req_callback_data(
5289 subreq, struct tevent_req);
5290 struct dcerpc_spoolss_EndDocPrinter_state *state = tevent_req_data(
5291 req, struct dcerpc_spoolss_EndDocPrinter_state);
5293 TALLOC_CTX *mem_ctx;
5295 if (state->out_mem_ctx) {
5296 mem_ctx = state->out_mem_ctx;
5301 status = dcerpc_spoolss_EndDocPrinter_r_recv(subreq, mem_ctx);
5302 TALLOC_FREE(subreq);
5303 if (tevent_req_nterror(req, status)) {
5307 /* Copy out parameters */
5310 state->orig.out.result = state->tmp.out.result;
5312 /* Reset temporary structure */
5313 ZERO_STRUCT(state->tmp);
5315 tevent_req_done(req);
5318 NTSTATUS dcerpc_spoolss_EndDocPrinter_recv(struct tevent_req *req,
5319 TALLOC_CTX *mem_ctx,
5322 struct dcerpc_spoolss_EndDocPrinter_state *state = tevent_req_data(
5323 req, struct dcerpc_spoolss_EndDocPrinter_state);
5326 if (tevent_req_is_nterror(req, &status)) {
5327 tevent_req_received(req);
5331 /* Steal possible out parameters to the callers context */
5332 talloc_steal(mem_ctx, state->out_mem_ctx);
5335 *result = state->orig.out.result;
5337 tevent_req_received(req);
5338 return NT_STATUS_OK;
5341 NTSTATUS dcerpc_spoolss_EndDocPrinter(struct dcerpc_binding_handle *h,
5342 TALLOC_CTX *mem_ctx,
5343 struct policy_handle *_handle /* [in] [ref] */,
5346 struct spoolss_EndDocPrinter r;
5350 r.in.handle = _handle;
5352 status = dcerpc_spoolss_EndDocPrinter_r(h, mem_ctx, &r);
5353 if (!NT_STATUS_IS_OK(status)) {
5357 /* Return variables */
5360 *result = r.out.result;
5362 return NT_STATUS_OK;
5365 struct dcerpc_spoolss_AddJob_r_state {
5366 TALLOC_CTX *out_mem_ctx;
5369 static void dcerpc_spoolss_AddJob_r_done(struct tevent_req *subreq);
5371 struct tevent_req *dcerpc_spoolss_AddJob_r_send(TALLOC_CTX *mem_ctx,
5372 struct tevent_context *ev,
5373 struct dcerpc_binding_handle *h,
5374 struct spoolss_AddJob *r)
5376 struct tevent_req *req;
5377 struct dcerpc_spoolss_AddJob_r_state *state;
5378 struct tevent_req *subreq;
5380 req = tevent_req_create(mem_ctx, &state,
5381 struct dcerpc_spoolss_AddJob_r_state);
5386 state->out_mem_ctx = talloc_new(state);
5387 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5388 return tevent_req_post(req, ev);
5391 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5392 NULL, &ndr_table_spoolss,
5393 NDR_SPOOLSS_ADDJOB, state->out_mem_ctx, r);
5394 if (tevent_req_nomem(subreq, req)) {
5395 return tevent_req_post(req, ev);
5397 tevent_req_set_callback(subreq, dcerpc_spoolss_AddJob_r_done, req);
5402 static void dcerpc_spoolss_AddJob_r_done(struct tevent_req *subreq)
5404 struct tevent_req *req =
5405 tevent_req_callback_data(subreq,
5409 status = dcerpc_binding_handle_call_recv(subreq);
5410 TALLOC_FREE(subreq);
5411 if (tevent_req_nterror(req, status)) {
5415 tevent_req_done(req);
5418 NTSTATUS dcerpc_spoolss_AddJob_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5420 struct dcerpc_spoolss_AddJob_r_state *state =
5421 tevent_req_data(req,
5422 struct dcerpc_spoolss_AddJob_r_state);
5425 if (tevent_req_is_nterror(req, &status)) {
5426 tevent_req_received(req);
5430 talloc_steal(mem_ctx, state->out_mem_ctx);
5432 tevent_req_received(req);
5433 return NT_STATUS_OK;
5436 NTSTATUS dcerpc_spoolss_AddJob_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddJob *r)
5440 status = dcerpc_binding_handle_call(h,
5441 NULL, &ndr_table_spoolss,
5442 NDR_SPOOLSS_ADDJOB, mem_ctx, r);
5447 struct dcerpc_spoolss_AddJob_state {
5448 struct spoolss_AddJob orig;
5449 struct spoolss_AddJob tmp;
5450 TALLOC_CTX *out_mem_ctx;
5453 static void dcerpc_spoolss_AddJob_done(struct tevent_req *subreq);
5455 struct tevent_req *dcerpc_spoolss_AddJob_send(TALLOC_CTX *mem_ctx,
5456 struct tevent_context *ev,
5457 struct dcerpc_binding_handle *h,
5458 struct policy_handle *_handle /* [in] [ref] */,
5459 uint32_t _level /* [in] */,
5460 uint8_t *_buffer /* [in,out] [unique,size_is(offered)] */,
5461 uint32_t _offered /* [in] */,
5462 uint32_t *_needed /* [out] [ref] */)
5464 struct tevent_req *req;
5465 struct dcerpc_spoolss_AddJob_state *state;
5466 struct tevent_req *subreq;
5468 req = tevent_req_create(mem_ctx, &state,
5469 struct dcerpc_spoolss_AddJob_state);
5473 state->out_mem_ctx = NULL;
5476 state->orig.in.handle = _handle;
5477 state->orig.in.level = _level;
5478 state->orig.in.buffer = _buffer;
5479 state->orig.in.offered = _offered;
5481 /* Out parameters */
5482 state->orig.out.buffer = _buffer;
5483 state->orig.out.needed = _needed;
5486 ZERO_STRUCT(state->orig.out.result);
5488 state->out_mem_ctx = talloc_named_const(state, 0,
5489 "dcerpc_spoolss_AddJob_out_memory");
5490 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5491 return tevent_req_post(req, ev);
5494 /* make a temporary copy, that we pass to the dispatch function */
5495 state->tmp = state->orig;
5497 subreq = dcerpc_spoolss_AddJob_r_send(state, ev, h, &state->tmp);
5498 if (tevent_req_nomem(subreq, req)) {
5499 return tevent_req_post(req, ev);
5501 tevent_req_set_callback(subreq, dcerpc_spoolss_AddJob_done, req);
5505 static void dcerpc_spoolss_AddJob_done(struct tevent_req *subreq)
5507 struct tevent_req *req = tevent_req_callback_data(
5508 subreq, struct tevent_req);
5509 struct dcerpc_spoolss_AddJob_state *state = tevent_req_data(
5510 req, struct dcerpc_spoolss_AddJob_state);
5512 TALLOC_CTX *mem_ctx;
5514 if (state->out_mem_ctx) {
5515 mem_ctx = state->out_mem_ctx;
5520 status = dcerpc_spoolss_AddJob_r_recv(subreq, mem_ctx);
5521 TALLOC_FREE(subreq);
5522 if (tevent_req_nterror(req, status)) {
5526 /* Copy out parameters */
5527 if (state->orig.out.buffer && state->tmp.out.buffer) {
5529 size_t _copy_len_buffer;
5530 _copy_len_buffer = state->tmp.in.offered;
5531 memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
5534 *state->orig.out.needed = *state->tmp.out.needed;
5537 state->orig.out.result = state->tmp.out.result;
5539 /* Reset temporary structure */
5540 ZERO_STRUCT(state->tmp);
5542 tevent_req_done(req);
5545 NTSTATUS dcerpc_spoolss_AddJob_recv(struct tevent_req *req,
5546 TALLOC_CTX *mem_ctx,
5549 struct dcerpc_spoolss_AddJob_state *state = tevent_req_data(
5550 req, struct dcerpc_spoolss_AddJob_state);
5553 if (tevent_req_is_nterror(req, &status)) {
5554 tevent_req_received(req);
5558 /* Steal possible out parameters to the callers context */
5559 talloc_steal(mem_ctx, state->out_mem_ctx);
5562 *result = state->orig.out.result;
5564 tevent_req_received(req);
5565 return NT_STATUS_OK;
5568 NTSTATUS dcerpc_spoolss_AddJob(struct dcerpc_binding_handle *h,
5569 TALLOC_CTX *mem_ctx,
5570 struct policy_handle *_handle /* [in] [ref] */,
5571 uint32_t _level /* [in] */,
5572 uint8_t *_buffer /* [in,out] [unique,size_is(offered)] */,
5573 uint32_t _offered /* [in] */,
5574 uint32_t *_needed /* [out] [ref] */,
5577 struct spoolss_AddJob r;
5581 r.in.handle = _handle;
5582 r.in.level = _level;
5583 r.in.buffer = _buffer;
5584 r.in.offered = _offered;
5586 status = dcerpc_spoolss_AddJob_r(h, mem_ctx, &r);
5587 if (!NT_STATUS_IS_OK(status)) {
5591 /* Return variables */
5592 if (_buffer && r.out.buffer) {
5594 size_t _copy_len_buffer;
5595 _copy_len_buffer = r.in.offered;
5596 memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
5599 *_needed = *r.out.needed;
5602 *result = r.out.result;
5604 return NT_STATUS_OK;
5607 struct dcerpc_spoolss_ScheduleJob_r_state {
5608 TALLOC_CTX *out_mem_ctx;
5611 static void dcerpc_spoolss_ScheduleJob_r_done(struct tevent_req *subreq);
5613 struct tevent_req *dcerpc_spoolss_ScheduleJob_r_send(TALLOC_CTX *mem_ctx,
5614 struct tevent_context *ev,
5615 struct dcerpc_binding_handle *h,
5616 struct spoolss_ScheduleJob *r)
5618 struct tevent_req *req;
5619 struct dcerpc_spoolss_ScheduleJob_r_state *state;
5620 struct tevent_req *subreq;
5622 req = tevent_req_create(mem_ctx, &state,
5623 struct dcerpc_spoolss_ScheduleJob_r_state);
5628 state->out_mem_ctx = NULL;
5630 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5631 NULL, &ndr_table_spoolss,
5632 NDR_SPOOLSS_SCHEDULEJOB, state, r);
5633 if (tevent_req_nomem(subreq, req)) {
5634 return tevent_req_post(req, ev);
5636 tevent_req_set_callback(subreq, dcerpc_spoolss_ScheduleJob_r_done, req);
5641 static void dcerpc_spoolss_ScheduleJob_r_done(struct tevent_req *subreq)
5643 struct tevent_req *req =
5644 tevent_req_callback_data(subreq,
5648 status = dcerpc_binding_handle_call_recv(subreq);
5649 TALLOC_FREE(subreq);
5650 if (tevent_req_nterror(req, status)) {
5654 tevent_req_done(req);
5657 NTSTATUS dcerpc_spoolss_ScheduleJob_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5659 struct dcerpc_spoolss_ScheduleJob_r_state *state =
5660 tevent_req_data(req,
5661 struct dcerpc_spoolss_ScheduleJob_r_state);
5664 if (tevent_req_is_nterror(req, &status)) {
5665 tevent_req_received(req);
5669 talloc_steal(mem_ctx, state->out_mem_ctx);
5671 tevent_req_received(req);
5672 return NT_STATUS_OK;
5675 NTSTATUS dcerpc_spoolss_ScheduleJob_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_ScheduleJob *r)
5679 status = dcerpc_binding_handle_call(h,
5680 NULL, &ndr_table_spoolss,
5681 NDR_SPOOLSS_SCHEDULEJOB, mem_ctx, r);
5686 struct dcerpc_spoolss_ScheduleJob_state {
5687 struct spoolss_ScheduleJob orig;
5688 struct spoolss_ScheduleJob tmp;
5689 TALLOC_CTX *out_mem_ctx;
5692 static void dcerpc_spoolss_ScheduleJob_done(struct tevent_req *subreq);
5694 struct tevent_req *dcerpc_spoolss_ScheduleJob_send(TALLOC_CTX *mem_ctx,
5695 struct tevent_context *ev,
5696 struct dcerpc_binding_handle *h,
5697 struct policy_handle *_handle /* [in] [ref] */,
5698 uint32_t _jobid /* [in] */)
5700 struct tevent_req *req;
5701 struct dcerpc_spoolss_ScheduleJob_state *state;
5702 struct tevent_req *subreq;
5704 req = tevent_req_create(mem_ctx, &state,
5705 struct dcerpc_spoolss_ScheduleJob_state);
5709 state->out_mem_ctx = NULL;
5712 state->orig.in.handle = _handle;
5713 state->orig.in.jobid = _jobid;
5715 /* Out parameters */
5718 ZERO_STRUCT(state->orig.out.result);
5720 /* make a temporary copy, that we pass to the dispatch function */
5721 state->tmp = state->orig;
5723 subreq = dcerpc_spoolss_ScheduleJob_r_send(state, ev, h, &state->tmp);
5724 if (tevent_req_nomem(subreq, req)) {
5725 return tevent_req_post(req, ev);
5727 tevent_req_set_callback(subreq, dcerpc_spoolss_ScheduleJob_done, req);
5731 static void dcerpc_spoolss_ScheduleJob_done(struct tevent_req *subreq)
5733 struct tevent_req *req = tevent_req_callback_data(
5734 subreq, struct tevent_req);
5735 struct dcerpc_spoolss_ScheduleJob_state *state = tevent_req_data(
5736 req, struct dcerpc_spoolss_ScheduleJob_state);
5738 TALLOC_CTX *mem_ctx;
5740 if (state->out_mem_ctx) {
5741 mem_ctx = state->out_mem_ctx;
5746 status = dcerpc_spoolss_ScheduleJob_r_recv(subreq, mem_ctx);
5747 TALLOC_FREE(subreq);
5748 if (tevent_req_nterror(req, status)) {
5752 /* Copy out parameters */
5755 state->orig.out.result = state->tmp.out.result;
5757 /* Reset temporary structure */
5758 ZERO_STRUCT(state->tmp);
5760 tevent_req_done(req);
5763 NTSTATUS dcerpc_spoolss_ScheduleJob_recv(struct tevent_req *req,
5764 TALLOC_CTX *mem_ctx,
5767 struct dcerpc_spoolss_ScheduleJob_state *state = tevent_req_data(
5768 req, struct dcerpc_spoolss_ScheduleJob_state);
5771 if (tevent_req_is_nterror(req, &status)) {
5772 tevent_req_received(req);
5776 /* Steal possible out parameters to the callers context */
5777 talloc_steal(mem_ctx, state->out_mem_ctx);
5780 *result = state->orig.out.result;
5782 tevent_req_received(req);
5783 return NT_STATUS_OK;
5786 NTSTATUS dcerpc_spoolss_ScheduleJob(struct dcerpc_binding_handle *h,
5787 TALLOC_CTX *mem_ctx,
5788 struct policy_handle *_handle /* [in] [ref] */,
5789 uint32_t _jobid /* [in] */,
5792 struct spoolss_ScheduleJob r;
5796 r.in.handle = _handle;
5797 r.in.jobid = _jobid;
5799 status = dcerpc_spoolss_ScheduleJob_r(h, mem_ctx, &r);
5800 if (!NT_STATUS_IS_OK(status)) {
5804 /* Return variables */
5807 *result = r.out.result;
5809 return NT_STATUS_OK;
5812 struct dcerpc_spoolss_GetPrinterData_r_state {
5813 TALLOC_CTX *out_mem_ctx;
5816 static void dcerpc_spoolss_GetPrinterData_r_done(struct tevent_req *subreq);
5818 struct tevent_req *dcerpc_spoolss_GetPrinterData_r_send(TALLOC_CTX *mem_ctx,
5819 struct tevent_context *ev,
5820 struct dcerpc_binding_handle *h,
5821 struct spoolss_GetPrinterData *r)
5823 struct tevent_req *req;
5824 struct dcerpc_spoolss_GetPrinterData_r_state *state;
5825 struct tevent_req *subreq;
5827 req = tevent_req_create(mem_ctx, &state,
5828 struct dcerpc_spoolss_GetPrinterData_r_state);
5833 state->out_mem_ctx = talloc_new(state);
5834 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5835 return tevent_req_post(req, ev);
5838 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5839 NULL, &ndr_table_spoolss,
5840 NDR_SPOOLSS_GETPRINTERDATA, state->out_mem_ctx, r);
5841 if (tevent_req_nomem(subreq, req)) {
5842 return tevent_req_post(req, ev);
5844 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterData_r_done, req);
5849 static void dcerpc_spoolss_GetPrinterData_r_done(struct tevent_req *subreq)
5851 struct tevent_req *req =
5852 tevent_req_callback_data(subreq,
5856 status = dcerpc_binding_handle_call_recv(subreq);
5857 TALLOC_FREE(subreq);
5858 if (tevent_req_nterror(req, status)) {
5862 tevent_req_done(req);
5865 NTSTATUS dcerpc_spoolss_GetPrinterData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5867 struct dcerpc_spoolss_GetPrinterData_r_state *state =
5868 tevent_req_data(req,
5869 struct dcerpc_spoolss_GetPrinterData_r_state);
5872 if (tevent_req_is_nterror(req, &status)) {
5873 tevent_req_received(req);
5877 talloc_steal(mem_ctx, state->out_mem_ctx);
5879 tevent_req_received(req);
5880 return NT_STATUS_OK;
5883 NTSTATUS dcerpc_spoolss_GetPrinterData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetPrinterData *r)
5887 status = dcerpc_binding_handle_call(h,
5888 NULL, &ndr_table_spoolss,
5889 NDR_SPOOLSS_GETPRINTERDATA, mem_ctx, r);
5894 struct dcerpc_spoolss_GetPrinterData_state {
5895 struct spoolss_GetPrinterData orig;
5896 struct spoolss_GetPrinterData tmp;
5897 TALLOC_CTX *out_mem_ctx;
5900 static void dcerpc_spoolss_GetPrinterData_done(struct tevent_req *subreq);
5902 struct tevent_req *dcerpc_spoolss_GetPrinterData_send(TALLOC_CTX *mem_ctx,
5903 struct tevent_context *ev,
5904 struct dcerpc_binding_handle *h,
5905 struct policy_handle *_handle /* [in] [ref] */,
5906 const char *_value_name /* [in] [charset(UTF16)] */,
5907 enum winreg_Type *_type /* [out] [ref] */,
5908 uint8_t *_data /* [out] [ref,size_is(offered)] */,
5909 uint32_t _offered /* [in] */,
5910 uint32_t *_needed /* [out] [ref] */)
5912 struct tevent_req *req;
5913 struct dcerpc_spoolss_GetPrinterData_state *state;
5914 struct tevent_req *subreq;
5916 req = tevent_req_create(mem_ctx, &state,
5917 struct dcerpc_spoolss_GetPrinterData_state);
5921 state->out_mem_ctx = NULL;
5924 state->orig.in.handle = _handle;
5925 state->orig.in.value_name = _value_name;
5926 state->orig.in.offered = _offered;
5928 /* Out parameters */
5929 state->orig.out.type = _type;
5930 state->orig.out.data = _data;
5931 state->orig.out.needed = _needed;
5934 ZERO_STRUCT(state->orig.out.result);
5936 state->out_mem_ctx = talloc_named_const(state, 0,
5937 "dcerpc_spoolss_GetPrinterData_out_memory");
5938 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5939 return tevent_req_post(req, ev);
5942 /* make a temporary copy, that we pass to the dispatch function */
5943 state->tmp = state->orig;
5945 subreq = dcerpc_spoolss_GetPrinterData_r_send(state, ev, h, &state->tmp);
5946 if (tevent_req_nomem(subreq, req)) {
5947 return tevent_req_post(req, ev);
5949 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterData_done, req);
5953 static void dcerpc_spoolss_GetPrinterData_done(struct tevent_req *subreq)
5955 struct tevent_req *req = tevent_req_callback_data(
5956 subreq, struct tevent_req);
5957 struct dcerpc_spoolss_GetPrinterData_state *state = tevent_req_data(
5958 req, struct dcerpc_spoolss_GetPrinterData_state);
5960 TALLOC_CTX *mem_ctx;
5962 if (state->out_mem_ctx) {
5963 mem_ctx = state->out_mem_ctx;
5968 status = dcerpc_spoolss_GetPrinterData_r_recv(subreq, mem_ctx);
5969 TALLOC_FREE(subreq);
5970 if (tevent_req_nterror(req, status)) {
5974 /* Copy out parameters */
5975 *state->orig.out.type = *state->tmp.out.type;
5977 size_t _copy_len_data;
5978 _copy_len_data = state->tmp.in.offered;
5979 memcpy(state->orig.out.data, state->tmp.out.data, _copy_len_data * sizeof(*state->orig.out.data));
5981 *state->orig.out.needed = *state->tmp.out.needed;
5984 state->orig.out.result = state->tmp.out.result;
5986 /* Reset temporary structure */
5987 ZERO_STRUCT(state->tmp);
5989 tevent_req_done(req);
5992 NTSTATUS dcerpc_spoolss_GetPrinterData_recv(struct tevent_req *req,
5993 TALLOC_CTX *mem_ctx,
5996 struct dcerpc_spoolss_GetPrinterData_state *state = tevent_req_data(
5997 req, struct dcerpc_spoolss_GetPrinterData_state);
6000 if (tevent_req_is_nterror(req, &status)) {
6001 tevent_req_received(req);
6005 /* Steal possible out parameters to the callers context */
6006 talloc_steal(mem_ctx, state->out_mem_ctx);
6009 *result = state->orig.out.result;
6011 tevent_req_received(req);
6012 return NT_STATUS_OK;
6015 NTSTATUS dcerpc_spoolss_GetPrinterData(struct dcerpc_binding_handle *h,
6016 TALLOC_CTX *mem_ctx,
6017 struct policy_handle *_handle /* [in] [ref] */,
6018 const char *_value_name /* [in] [charset(UTF16)] */,
6019 enum winreg_Type *_type /* [out] [ref] */,
6020 uint8_t *_data /* [out] [ref,size_is(offered)] */,
6021 uint32_t _offered /* [in] */,
6022 uint32_t *_needed /* [out] [ref] */,
6025 struct spoolss_GetPrinterData r;
6029 r.in.handle = _handle;
6030 r.in.value_name = _value_name;
6031 r.in.offered = _offered;
6033 status = dcerpc_spoolss_GetPrinterData_r(h, mem_ctx, &r);
6034 if (!NT_STATUS_IS_OK(status)) {
6038 /* Return variables */
6039 *_type = *r.out.type;
6041 size_t _copy_len_data;
6042 _copy_len_data = r.in.offered;
6043 memcpy(_data, r.out.data, _copy_len_data * sizeof(*_data));
6045 *_needed = *r.out.needed;
6048 *result = r.out.result;
6050 return NT_STATUS_OK;
6053 struct dcerpc_spoolss_SetPrinterData_r_state {
6054 TALLOC_CTX *out_mem_ctx;
6057 static void dcerpc_spoolss_SetPrinterData_r_done(struct tevent_req *subreq);
6059 struct tevent_req *dcerpc_spoolss_SetPrinterData_r_send(TALLOC_CTX *mem_ctx,
6060 struct tevent_context *ev,
6061 struct dcerpc_binding_handle *h,
6062 struct spoolss_SetPrinterData *r)
6064 struct tevent_req *req;
6065 struct dcerpc_spoolss_SetPrinterData_r_state *state;
6066 struct tevent_req *subreq;
6068 req = tevent_req_create(mem_ctx, &state,
6069 struct dcerpc_spoolss_SetPrinterData_r_state);
6074 state->out_mem_ctx = NULL;
6076 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6077 NULL, &ndr_table_spoolss,
6078 NDR_SPOOLSS_SETPRINTERDATA, state, r);
6079 if (tevent_req_nomem(subreq, req)) {
6080 return tevent_req_post(req, ev);
6082 tevent_req_set_callback(subreq, dcerpc_spoolss_SetPrinterData_r_done, req);
6087 static void dcerpc_spoolss_SetPrinterData_r_done(struct tevent_req *subreq)
6089 struct tevent_req *req =
6090 tevent_req_callback_data(subreq,
6094 status = dcerpc_binding_handle_call_recv(subreq);
6095 TALLOC_FREE(subreq);
6096 if (tevent_req_nterror(req, status)) {
6100 tevent_req_done(req);
6103 NTSTATUS dcerpc_spoolss_SetPrinterData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6105 struct dcerpc_spoolss_SetPrinterData_r_state *state =
6106 tevent_req_data(req,
6107 struct dcerpc_spoolss_SetPrinterData_r_state);
6110 if (tevent_req_is_nterror(req, &status)) {
6111 tevent_req_received(req);
6115 talloc_steal(mem_ctx, state->out_mem_ctx);
6117 tevent_req_received(req);
6118 return NT_STATUS_OK;
6121 NTSTATUS dcerpc_spoolss_SetPrinterData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_SetPrinterData *r)
6125 status = dcerpc_binding_handle_call(h,
6126 NULL, &ndr_table_spoolss,
6127 NDR_SPOOLSS_SETPRINTERDATA, mem_ctx, r);
6132 struct dcerpc_spoolss_SetPrinterData_state {
6133 struct spoolss_SetPrinterData orig;
6134 struct spoolss_SetPrinterData tmp;
6135 TALLOC_CTX *out_mem_ctx;
6138 static void dcerpc_spoolss_SetPrinterData_done(struct tevent_req *subreq);
6140 struct tevent_req *dcerpc_spoolss_SetPrinterData_send(TALLOC_CTX *mem_ctx,
6141 struct tevent_context *ev,
6142 struct dcerpc_binding_handle *h,
6143 struct policy_handle *_handle /* [in] [ref] */,
6144 const char *_value_name /* [in] [charset(UTF16)] */,
6145 enum winreg_Type _type /* [in] */,
6146 uint8_t *_data /* [in] [ref,size_is(offered)] */,
6147 uint32_t _offered /* [in] */)
6149 struct tevent_req *req;
6150 struct dcerpc_spoolss_SetPrinterData_state *state;
6151 struct tevent_req *subreq;
6153 req = tevent_req_create(mem_ctx, &state,
6154 struct dcerpc_spoolss_SetPrinterData_state);
6158 state->out_mem_ctx = NULL;
6161 state->orig.in.handle = _handle;
6162 state->orig.in.value_name = _value_name;
6163 state->orig.in.type = _type;
6164 state->orig.in.data = _data;
6165 state->orig.in.offered = _offered;
6167 /* Out parameters */
6170 ZERO_STRUCT(state->orig.out.result);
6172 /* make a temporary copy, that we pass to the dispatch function */
6173 state->tmp = state->orig;
6175 subreq = dcerpc_spoolss_SetPrinterData_r_send(state, ev, h, &state->tmp);
6176 if (tevent_req_nomem(subreq, req)) {
6177 return tevent_req_post(req, ev);
6179 tevent_req_set_callback(subreq, dcerpc_spoolss_SetPrinterData_done, req);
6183 static void dcerpc_spoolss_SetPrinterData_done(struct tevent_req *subreq)
6185 struct tevent_req *req = tevent_req_callback_data(
6186 subreq, struct tevent_req);
6187 struct dcerpc_spoolss_SetPrinterData_state *state = tevent_req_data(
6188 req, struct dcerpc_spoolss_SetPrinterData_state);
6190 TALLOC_CTX *mem_ctx;
6192 if (state->out_mem_ctx) {
6193 mem_ctx = state->out_mem_ctx;
6198 status = dcerpc_spoolss_SetPrinterData_r_recv(subreq, mem_ctx);
6199 TALLOC_FREE(subreq);
6200 if (tevent_req_nterror(req, status)) {
6204 /* Copy out parameters */
6207 state->orig.out.result = state->tmp.out.result;
6209 /* Reset temporary structure */
6210 ZERO_STRUCT(state->tmp);
6212 tevent_req_done(req);
6215 NTSTATUS dcerpc_spoolss_SetPrinterData_recv(struct tevent_req *req,
6216 TALLOC_CTX *mem_ctx,
6219 struct dcerpc_spoolss_SetPrinterData_state *state = tevent_req_data(
6220 req, struct dcerpc_spoolss_SetPrinterData_state);
6223 if (tevent_req_is_nterror(req, &status)) {
6224 tevent_req_received(req);
6228 /* Steal possible out parameters to the callers context */
6229 talloc_steal(mem_ctx, state->out_mem_ctx);
6232 *result = state->orig.out.result;
6234 tevent_req_received(req);
6235 return NT_STATUS_OK;
6238 NTSTATUS dcerpc_spoolss_SetPrinterData(struct dcerpc_binding_handle *h,
6239 TALLOC_CTX *mem_ctx,
6240 struct policy_handle *_handle /* [in] [ref] */,
6241 const char *_value_name /* [in] [charset(UTF16)] */,
6242 enum winreg_Type _type /* [in] */,
6243 uint8_t *_data /* [in] [ref,size_is(offered)] */,
6244 uint32_t _offered /* [in] */,
6247 struct spoolss_SetPrinterData r;
6251 r.in.handle = _handle;
6252 r.in.value_name = _value_name;
6255 r.in.offered = _offered;
6257 status = dcerpc_spoolss_SetPrinterData_r(h, mem_ctx, &r);
6258 if (!NT_STATUS_IS_OK(status)) {
6262 /* Return variables */
6265 *result = r.out.result;
6267 return NT_STATUS_OK;
6270 struct dcerpc_spoolss_ClosePrinter_r_state {
6271 TALLOC_CTX *out_mem_ctx;
6274 static void dcerpc_spoolss_ClosePrinter_r_done(struct tevent_req *subreq);
6276 struct tevent_req *dcerpc_spoolss_ClosePrinter_r_send(TALLOC_CTX *mem_ctx,
6277 struct tevent_context *ev,
6278 struct dcerpc_binding_handle *h,
6279 struct spoolss_ClosePrinter *r)
6281 struct tevent_req *req;
6282 struct dcerpc_spoolss_ClosePrinter_r_state *state;
6283 struct tevent_req *subreq;
6285 req = tevent_req_create(mem_ctx, &state,
6286 struct dcerpc_spoolss_ClosePrinter_r_state);
6291 state->out_mem_ctx = talloc_new(state);
6292 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6293 return tevent_req_post(req, ev);
6296 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6297 NULL, &ndr_table_spoolss,
6298 NDR_SPOOLSS_CLOSEPRINTER, state->out_mem_ctx, r);
6299 if (tevent_req_nomem(subreq, req)) {
6300 return tevent_req_post(req, ev);
6302 tevent_req_set_callback(subreq, dcerpc_spoolss_ClosePrinter_r_done, req);
6307 static void dcerpc_spoolss_ClosePrinter_r_done(struct tevent_req *subreq)
6309 struct tevent_req *req =
6310 tevent_req_callback_data(subreq,
6314 status = dcerpc_binding_handle_call_recv(subreq);
6315 TALLOC_FREE(subreq);
6316 if (tevent_req_nterror(req, status)) {
6320 tevent_req_done(req);
6323 NTSTATUS dcerpc_spoolss_ClosePrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6325 struct dcerpc_spoolss_ClosePrinter_r_state *state =
6326 tevent_req_data(req,
6327 struct dcerpc_spoolss_ClosePrinter_r_state);
6330 if (tevent_req_is_nterror(req, &status)) {
6331 tevent_req_received(req);
6335 talloc_steal(mem_ctx, state->out_mem_ctx);
6337 tevent_req_received(req);
6338 return NT_STATUS_OK;
6341 NTSTATUS dcerpc_spoolss_ClosePrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_ClosePrinter *r)
6345 status = dcerpc_binding_handle_call(h,
6346 NULL, &ndr_table_spoolss,
6347 NDR_SPOOLSS_CLOSEPRINTER, mem_ctx, r);
6352 struct dcerpc_spoolss_ClosePrinter_state {
6353 struct spoolss_ClosePrinter orig;
6354 struct spoolss_ClosePrinter tmp;
6355 TALLOC_CTX *out_mem_ctx;
6358 static void dcerpc_spoolss_ClosePrinter_done(struct tevent_req *subreq);
6360 struct tevent_req *dcerpc_spoolss_ClosePrinter_send(TALLOC_CTX *mem_ctx,
6361 struct tevent_context *ev,
6362 struct dcerpc_binding_handle *h,
6363 struct policy_handle *_handle /* [in,out] [ref] */)
6365 struct tevent_req *req;
6366 struct dcerpc_spoolss_ClosePrinter_state *state;
6367 struct tevent_req *subreq;
6369 req = tevent_req_create(mem_ctx, &state,
6370 struct dcerpc_spoolss_ClosePrinter_state);
6374 state->out_mem_ctx = NULL;
6377 state->orig.in.handle = _handle;
6379 /* Out parameters */
6380 state->orig.out.handle = _handle;
6383 ZERO_STRUCT(state->orig.out.result);
6385 state->out_mem_ctx = talloc_named_const(state, 0,
6386 "dcerpc_spoolss_ClosePrinter_out_memory");
6387 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6388 return tevent_req_post(req, ev);
6391 /* make a temporary copy, that we pass to the dispatch function */
6392 state->tmp = state->orig;
6394 subreq = dcerpc_spoolss_ClosePrinter_r_send(state, ev, h, &state->tmp);
6395 if (tevent_req_nomem(subreq, req)) {
6396 return tevent_req_post(req, ev);
6398 tevent_req_set_callback(subreq, dcerpc_spoolss_ClosePrinter_done, req);
6402 static void dcerpc_spoolss_ClosePrinter_done(struct tevent_req *subreq)
6404 struct tevent_req *req = tevent_req_callback_data(
6405 subreq, struct tevent_req);
6406 struct dcerpc_spoolss_ClosePrinter_state *state = tevent_req_data(
6407 req, struct dcerpc_spoolss_ClosePrinter_state);
6409 TALLOC_CTX *mem_ctx;
6411 if (state->out_mem_ctx) {
6412 mem_ctx = state->out_mem_ctx;
6417 status = dcerpc_spoolss_ClosePrinter_r_recv(subreq, mem_ctx);
6418 TALLOC_FREE(subreq);
6419 if (tevent_req_nterror(req, status)) {
6423 /* Copy out parameters */
6424 *state->orig.out.handle = *state->tmp.out.handle;
6427 state->orig.out.result = state->tmp.out.result;
6429 /* Reset temporary structure */
6430 ZERO_STRUCT(state->tmp);
6432 tevent_req_done(req);
6435 NTSTATUS dcerpc_spoolss_ClosePrinter_recv(struct tevent_req *req,
6436 TALLOC_CTX *mem_ctx,
6439 struct dcerpc_spoolss_ClosePrinter_state *state = tevent_req_data(
6440 req, struct dcerpc_spoolss_ClosePrinter_state);
6443 if (tevent_req_is_nterror(req, &status)) {
6444 tevent_req_received(req);
6448 /* Steal possible out parameters to the callers context */
6449 talloc_steal(mem_ctx, state->out_mem_ctx);
6452 *result = state->orig.out.result;
6454 tevent_req_received(req);
6455 return NT_STATUS_OK;
6458 NTSTATUS dcerpc_spoolss_ClosePrinter(struct dcerpc_binding_handle *h,
6459 TALLOC_CTX *mem_ctx,
6460 struct policy_handle *_handle /* [in,out] [ref] */,
6463 struct spoolss_ClosePrinter r;
6467 r.in.handle = _handle;
6469 status = dcerpc_spoolss_ClosePrinter_r(h, mem_ctx, &r);
6470 if (!NT_STATUS_IS_OK(status)) {
6474 /* Return variables */
6475 *_handle = *r.out.handle;
6478 *result = r.out.result;
6480 return NT_STATUS_OK;
6483 struct dcerpc_spoolss_AddForm_r_state {
6484 TALLOC_CTX *out_mem_ctx;
6487 static void dcerpc_spoolss_AddForm_r_done(struct tevent_req *subreq);
6489 struct tevent_req *dcerpc_spoolss_AddForm_r_send(TALLOC_CTX *mem_ctx,
6490 struct tevent_context *ev,
6491 struct dcerpc_binding_handle *h,
6492 struct spoolss_AddForm *r)
6494 struct tevent_req *req;
6495 struct dcerpc_spoolss_AddForm_r_state *state;
6496 struct tevent_req *subreq;
6498 req = tevent_req_create(mem_ctx, &state,
6499 struct dcerpc_spoolss_AddForm_r_state);
6504 state->out_mem_ctx = NULL;
6506 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6507 NULL, &ndr_table_spoolss,
6508 NDR_SPOOLSS_ADDFORM, state, r);
6509 if (tevent_req_nomem(subreq, req)) {
6510 return tevent_req_post(req, ev);
6512 tevent_req_set_callback(subreq, dcerpc_spoolss_AddForm_r_done, req);
6517 static void dcerpc_spoolss_AddForm_r_done(struct tevent_req *subreq)
6519 struct tevent_req *req =
6520 tevent_req_callback_data(subreq,
6524 status = dcerpc_binding_handle_call_recv(subreq);
6525 TALLOC_FREE(subreq);
6526 if (tevent_req_nterror(req, status)) {
6530 tevent_req_done(req);
6533 NTSTATUS dcerpc_spoolss_AddForm_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6535 struct dcerpc_spoolss_AddForm_r_state *state =
6536 tevent_req_data(req,
6537 struct dcerpc_spoolss_AddForm_r_state);
6540 if (tevent_req_is_nterror(req, &status)) {
6541 tevent_req_received(req);
6545 talloc_steal(mem_ctx, state->out_mem_ctx);
6547 tevent_req_received(req);
6548 return NT_STATUS_OK;
6551 NTSTATUS dcerpc_spoolss_AddForm_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddForm *r)
6555 status = dcerpc_binding_handle_call(h,
6556 NULL, &ndr_table_spoolss,
6557 NDR_SPOOLSS_ADDFORM, mem_ctx, r);
6562 struct dcerpc_spoolss_AddForm_state {
6563 struct spoolss_AddForm orig;
6564 struct spoolss_AddForm tmp;
6565 TALLOC_CTX *out_mem_ctx;
6568 static void dcerpc_spoolss_AddForm_done(struct tevent_req *subreq);
6570 struct tevent_req *dcerpc_spoolss_AddForm_send(TALLOC_CTX *mem_ctx,
6571 struct tevent_context *ev,
6572 struct dcerpc_binding_handle *h,
6573 struct policy_handle *_handle /* [in] [ref] */,
6574 struct spoolss_AddFormInfoCtr *_info_ctr /* [in] [ref] */)
6576 struct tevent_req *req;
6577 struct dcerpc_spoolss_AddForm_state *state;
6578 struct tevent_req *subreq;
6580 req = tevent_req_create(mem_ctx, &state,
6581 struct dcerpc_spoolss_AddForm_state);
6585 state->out_mem_ctx = NULL;
6588 state->orig.in.handle = _handle;
6589 state->orig.in.info_ctr = _info_ctr;
6591 /* Out parameters */
6594 ZERO_STRUCT(state->orig.out.result);
6596 /* make a temporary copy, that we pass to the dispatch function */
6597 state->tmp = state->orig;
6599 subreq = dcerpc_spoolss_AddForm_r_send(state, ev, h, &state->tmp);
6600 if (tevent_req_nomem(subreq, req)) {
6601 return tevent_req_post(req, ev);
6603 tevent_req_set_callback(subreq, dcerpc_spoolss_AddForm_done, req);
6607 static void dcerpc_spoolss_AddForm_done(struct tevent_req *subreq)
6609 struct tevent_req *req = tevent_req_callback_data(
6610 subreq, struct tevent_req);
6611 struct dcerpc_spoolss_AddForm_state *state = tevent_req_data(
6612 req, struct dcerpc_spoolss_AddForm_state);
6614 TALLOC_CTX *mem_ctx;
6616 if (state->out_mem_ctx) {
6617 mem_ctx = state->out_mem_ctx;
6622 status = dcerpc_spoolss_AddForm_r_recv(subreq, mem_ctx);
6623 TALLOC_FREE(subreq);
6624 if (tevent_req_nterror(req, status)) {
6628 /* Copy out parameters */
6631 state->orig.out.result = state->tmp.out.result;
6633 /* Reset temporary structure */
6634 ZERO_STRUCT(state->tmp);
6636 tevent_req_done(req);
6639 NTSTATUS dcerpc_spoolss_AddForm_recv(struct tevent_req *req,
6640 TALLOC_CTX *mem_ctx,
6643 struct dcerpc_spoolss_AddForm_state *state = tevent_req_data(
6644 req, struct dcerpc_spoolss_AddForm_state);
6647 if (tevent_req_is_nterror(req, &status)) {
6648 tevent_req_received(req);
6652 /* Steal possible out parameters to the callers context */
6653 talloc_steal(mem_ctx, state->out_mem_ctx);
6656 *result = state->orig.out.result;
6658 tevent_req_received(req);
6659 return NT_STATUS_OK;
6662 NTSTATUS dcerpc_spoolss_AddForm(struct dcerpc_binding_handle *h,
6663 TALLOC_CTX *mem_ctx,
6664 struct policy_handle *_handle /* [in] [ref] */,
6665 struct spoolss_AddFormInfoCtr *_info_ctr /* [in] [ref] */,
6668 struct spoolss_AddForm r;
6672 r.in.handle = _handle;
6673 r.in.info_ctr = _info_ctr;
6675 status = dcerpc_spoolss_AddForm_r(h, mem_ctx, &r);
6676 if (!NT_STATUS_IS_OK(status)) {
6680 /* Return variables */
6683 *result = r.out.result;
6685 return NT_STATUS_OK;
6688 struct dcerpc_spoolss_DeleteForm_r_state {
6689 TALLOC_CTX *out_mem_ctx;
6692 static void dcerpc_spoolss_DeleteForm_r_done(struct tevent_req *subreq);
6694 struct tevent_req *dcerpc_spoolss_DeleteForm_r_send(TALLOC_CTX *mem_ctx,
6695 struct tevent_context *ev,
6696 struct dcerpc_binding_handle *h,
6697 struct spoolss_DeleteForm *r)
6699 struct tevent_req *req;
6700 struct dcerpc_spoolss_DeleteForm_r_state *state;
6701 struct tevent_req *subreq;
6703 req = tevent_req_create(mem_ctx, &state,
6704 struct dcerpc_spoolss_DeleteForm_r_state);
6709 state->out_mem_ctx = NULL;
6711 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6712 NULL, &ndr_table_spoolss,
6713 NDR_SPOOLSS_DELETEFORM, state, r);
6714 if (tevent_req_nomem(subreq, req)) {
6715 return tevent_req_post(req, ev);
6717 tevent_req_set_callback(subreq, dcerpc_spoolss_DeleteForm_r_done, req);
6722 static void dcerpc_spoolss_DeleteForm_r_done(struct tevent_req *subreq)
6724 struct tevent_req *req =
6725 tevent_req_callback_data(subreq,
6729 status = dcerpc_binding_handle_call_recv(subreq);
6730 TALLOC_FREE(subreq);
6731 if (tevent_req_nterror(req, status)) {
6735 tevent_req_done(req);
6738 NTSTATUS dcerpc_spoolss_DeleteForm_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6740 struct dcerpc_spoolss_DeleteForm_r_state *state =
6741 tevent_req_data(req,
6742 struct dcerpc_spoolss_DeleteForm_r_state);
6745 if (tevent_req_is_nterror(req, &status)) {
6746 tevent_req_received(req);
6750 talloc_steal(mem_ctx, state->out_mem_ctx);
6752 tevent_req_received(req);
6753 return NT_STATUS_OK;
6756 NTSTATUS dcerpc_spoolss_DeleteForm_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeleteForm *r)
6760 status = dcerpc_binding_handle_call(h,
6761 NULL, &ndr_table_spoolss,
6762 NDR_SPOOLSS_DELETEFORM, mem_ctx, r);
6767 struct dcerpc_spoolss_DeleteForm_state {
6768 struct spoolss_DeleteForm orig;
6769 struct spoolss_DeleteForm tmp;
6770 TALLOC_CTX *out_mem_ctx;
6773 static void dcerpc_spoolss_DeleteForm_done(struct tevent_req *subreq);
6775 struct tevent_req *dcerpc_spoolss_DeleteForm_send(TALLOC_CTX *mem_ctx,
6776 struct tevent_context *ev,
6777 struct dcerpc_binding_handle *h,
6778 struct policy_handle *_handle /* [in] [ref] */,
6779 const char *_form_name /* [in] [charset(UTF16)] */)
6781 struct tevent_req *req;
6782 struct dcerpc_spoolss_DeleteForm_state *state;
6783 struct tevent_req *subreq;
6785 req = tevent_req_create(mem_ctx, &state,
6786 struct dcerpc_spoolss_DeleteForm_state);
6790 state->out_mem_ctx = NULL;
6793 state->orig.in.handle = _handle;
6794 state->orig.in.form_name = _form_name;
6796 /* Out parameters */
6799 ZERO_STRUCT(state->orig.out.result);
6801 /* make a temporary copy, that we pass to the dispatch function */
6802 state->tmp = state->orig;
6804 subreq = dcerpc_spoolss_DeleteForm_r_send(state, ev, h, &state->tmp);
6805 if (tevent_req_nomem(subreq, req)) {
6806 return tevent_req_post(req, ev);
6808 tevent_req_set_callback(subreq, dcerpc_spoolss_DeleteForm_done, req);
6812 static void dcerpc_spoolss_DeleteForm_done(struct tevent_req *subreq)
6814 struct tevent_req *req = tevent_req_callback_data(
6815 subreq, struct tevent_req);
6816 struct dcerpc_spoolss_DeleteForm_state *state = tevent_req_data(
6817 req, struct dcerpc_spoolss_DeleteForm_state);
6819 TALLOC_CTX *mem_ctx;
6821 if (state->out_mem_ctx) {
6822 mem_ctx = state->out_mem_ctx;
6827 status = dcerpc_spoolss_DeleteForm_r_recv(subreq, mem_ctx);
6828 TALLOC_FREE(subreq);
6829 if (tevent_req_nterror(req, status)) {
6833 /* Copy out parameters */
6836 state->orig.out.result = state->tmp.out.result;
6838 /* Reset temporary structure */
6839 ZERO_STRUCT(state->tmp);
6841 tevent_req_done(req);
6844 NTSTATUS dcerpc_spoolss_DeleteForm_recv(struct tevent_req *req,
6845 TALLOC_CTX *mem_ctx,
6848 struct dcerpc_spoolss_DeleteForm_state *state = tevent_req_data(
6849 req, struct dcerpc_spoolss_DeleteForm_state);
6852 if (tevent_req_is_nterror(req, &status)) {
6853 tevent_req_received(req);
6857 /* Steal possible out parameters to the callers context */
6858 talloc_steal(mem_ctx, state->out_mem_ctx);
6861 *result = state->orig.out.result;
6863 tevent_req_received(req);
6864 return NT_STATUS_OK;
6867 NTSTATUS dcerpc_spoolss_DeleteForm(struct dcerpc_binding_handle *h,
6868 TALLOC_CTX *mem_ctx,
6869 struct policy_handle *_handle /* [in] [ref] */,
6870 const char *_form_name /* [in] [charset(UTF16)] */,
6873 struct spoolss_DeleteForm r;
6877 r.in.handle = _handle;
6878 r.in.form_name = _form_name;
6880 status = dcerpc_spoolss_DeleteForm_r(h, mem_ctx, &r);
6881 if (!NT_STATUS_IS_OK(status)) {
6885 /* Return variables */
6888 *result = r.out.result;
6890 return NT_STATUS_OK;
6893 struct dcerpc_spoolss_GetForm_r_state {
6894 TALLOC_CTX *out_mem_ctx;
6897 static void dcerpc_spoolss_GetForm_r_done(struct tevent_req *subreq);
6899 struct tevent_req *dcerpc_spoolss_GetForm_r_send(TALLOC_CTX *mem_ctx,
6900 struct tevent_context *ev,
6901 struct dcerpc_binding_handle *h,
6902 struct spoolss_GetForm *r)
6904 struct tevent_req *req;
6905 struct dcerpc_spoolss_GetForm_r_state *state;
6906 struct tevent_req *subreq;
6908 req = tevent_req_create(mem_ctx, &state,
6909 struct dcerpc_spoolss_GetForm_r_state);
6914 state->out_mem_ctx = talloc_new(state);
6915 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6916 return tevent_req_post(req, ev);
6919 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6920 NULL, &ndr_table_spoolss,
6921 NDR_SPOOLSS_GETFORM, state->out_mem_ctx, r);
6922 if (tevent_req_nomem(subreq, req)) {
6923 return tevent_req_post(req, ev);
6925 tevent_req_set_callback(subreq, dcerpc_spoolss_GetForm_r_done, req);
6930 static void dcerpc_spoolss_GetForm_r_done(struct tevent_req *subreq)
6932 struct tevent_req *req =
6933 tevent_req_callback_data(subreq,
6937 status = dcerpc_binding_handle_call_recv(subreq);
6938 TALLOC_FREE(subreq);
6939 if (tevent_req_nterror(req, status)) {
6943 tevent_req_done(req);
6946 NTSTATUS dcerpc_spoolss_GetForm_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6948 struct dcerpc_spoolss_GetForm_r_state *state =
6949 tevent_req_data(req,
6950 struct dcerpc_spoolss_GetForm_r_state);
6953 if (tevent_req_is_nterror(req, &status)) {
6954 tevent_req_received(req);
6958 talloc_steal(mem_ctx, state->out_mem_ctx);
6960 tevent_req_received(req);
6961 return NT_STATUS_OK;
6964 NTSTATUS dcerpc_spoolss_GetForm_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetForm *r)
6968 status = dcerpc_binding_handle_call(h,
6969 NULL, &ndr_table_spoolss,
6970 NDR_SPOOLSS_GETFORM, mem_ctx, r);
6975 struct dcerpc_spoolss_GetForm_state {
6976 struct spoolss_GetForm orig;
6977 struct spoolss_GetForm tmp;
6978 TALLOC_CTX *out_mem_ctx;
6981 static void dcerpc_spoolss_GetForm_done(struct tevent_req *subreq);
6983 struct tevent_req *dcerpc_spoolss_GetForm_send(TALLOC_CTX *mem_ctx,
6984 struct tevent_context *ev,
6985 struct dcerpc_binding_handle *h,
6986 struct policy_handle *_handle /* [in] [ref] */,
6987 const char *_form_name /* [in] [charset(UTF16)] */,
6988 uint32_t _level /* [in] */,
6989 DATA_BLOB *_buffer /* [in] [unique] */,
6990 uint32_t _offered /* [in] */,
6991 union spoolss_FormInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
6992 uint32_t *_needed /* [out] [ref] */)
6994 struct tevent_req *req;
6995 struct dcerpc_spoolss_GetForm_state *state;
6996 struct tevent_req *subreq;
6998 req = tevent_req_create(mem_ctx, &state,
6999 struct dcerpc_spoolss_GetForm_state);
7003 state->out_mem_ctx = NULL;
7006 state->orig.in.handle = _handle;
7007 state->orig.in.form_name = _form_name;
7008 state->orig.in.level = _level;
7009 state->orig.in.buffer = _buffer;
7010 state->orig.in.offered = _offered;
7012 /* Out parameters */
7013 state->orig.out.info = _info;
7014 state->orig.out.needed = _needed;
7017 ZERO_STRUCT(state->orig.out.result);
7019 state->out_mem_ctx = talloc_named_const(state, 0,
7020 "dcerpc_spoolss_GetForm_out_memory");
7021 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7022 return tevent_req_post(req, ev);
7025 /* make a temporary copy, that we pass to the dispatch function */
7026 state->tmp = state->orig;
7028 subreq = dcerpc_spoolss_GetForm_r_send(state, ev, h, &state->tmp);
7029 if (tevent_req_nomem(subreq, req)) {
7030 return tevent_req_post(req, ev);
7032 tevent_req_set_callback(subreq, dcerpc_spoolss_GetForm_done, req);
7036 static void dcerpc_spoolss_GetForm_done(struct tevent_req *subreq)
7038 struct tevent_req *req = tevent_req_callback_data(
7039 subreq, struct tevent_req);
7040 struct dcerpc_spoolss_GetForm_state *state = tevent_req_data(
7041 req, struct dcerpc_spoolss_GetForm_state);
7043 TALLOC_CTX *mem_ctx;
7045 if (state->out_mem_ctx) {
7046 mem_ctx = state->out_mem_ctx;
7051 status = dcerpc_spoolss_GetForm_r_recv(subreq, mem_ctx);
7052 TALLOC_FREE(subreq);
7053 if (tevent_req_nterror(req, status)) {
7057 /* Copy out parameters */
7058 if (state->orig.out.info && state->tmp.out.info) {
7059 *state->orig.out.info = *state->tmp.out.info;
7061 *state->orig.out.needed = *state->tmp.out.needed;
7064 state->orig.out.result = state->tmp.out.result;
7066 /* Reset temporary structure */
7067 ZERO_STRUCT(state->tmp);
7069 tevent_req_done(req);
7072 NTSTATUS dcerpc_spoolss_GetForm_recv(struct tevent_req *req,
7073 TALLOC_CTX *mem_ctx,
7076 struct dcerpc_spoolss_GetForm_state *state = tevent_req_data(
7077 req, struct dcerpc_spoolss_GetForm_state);
7080 if (tevent_req_is_nterror(req, &status)) {
7081 tevent_req_received(req);
7085 /* Steal possible out parameters to the callers context */
7086 talloc_steal(mem_ctx, state->out_mem_ctx);
7089 *result = state->orig.out.result;
7091 tevent_req_received(req);
7092 return NT_STATUS_OK;
7095 NTSTATUS dcerpc_spoolss_GetForm(struct dcerpc_binding_handle *h,
7096 TALLOC_CTX *mem_ctx,
7097 struct policy_handle *_handle /* [in] [ref] */,
7098 const char *_form_name /* [in] [charset(UTF16)] */,
7099 uint32_t _level /* [in] */,
7100 DATA_BLOB *_buffer /* [in] [unique] */,
7101 uint32_t _offered /* [in] */,
7102 union spoolss_FormInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
7103 uint32_t *_needed /* [out] [ref] */,
7106 struct spoolss_GetForm r;
7110 r.in.handle = _handle;
7111 r.in.form_name = _form_name;
7112 r.in.level = _level;
7113 r.in.buffer = _buffer;
7114 r.in.offered = _offered;
7116 status = dcerpc_spoolss_GetForm_r(h, mem_ctx, &r);
7117 if (!NT_STATUS_IS_OK(status)) {
7121 /* Return variables */
7122 if (_info && r.out.info) {
7123 *_info = *r.out.info;
7125 *_needed = *r.out.needed;
7128 *result = r.out.result;
7130 return NT_STATUS_OK;
7133 struct dcerpc_spoolss_SetForm_r_state {
7134 TALLOC_CTX *out_mem_ctx;
7137 static void dcerpc_spoolss_SetForm_r_done(struct tevent_req *subreq);
7139 struct tevent_req *dcerpc_spoolss_SetForm_r_send(TALLOC_CTX *mem_ctx,
7140 struct tevent_context *ev,
7141 struct dcerpc_binding_handle *h,
7142 struct spoolss_SetForm *r)
7144 struct tevent_req *req;
7145 struct dcerpc_spoolss_SetForm_r_state *state;
7146 struct tevent_req *subreq;
7148 req = tevent_req_create(mem_ctx, &state,
7149 struct dcerpc_spoolss_SetForm_r_state);
7154 state->out_mem_ctx = NULL;
7156 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7157 NULL, &ndr_table_spoolss,
7158 NDR_SPOOLSS_SETFORM, state, r);
7159 if (tevent_req_nomem(subreq, req)) {
7160 return tevent_req_post(req, ev);
7162 tevent_req_set_callback(subreq, dcerpc_spoolss_SetForm_r_done, req);
7167 static void dcerpc_spoolss_SetForm_r_done(struct tevent_req *subreq)
7169 struct tevent_req *req =
7170 tevent_req_callback_data(subreq,
7174 status = dcerpc_binding_handle_call_recv(subreq);
7175 TALLOC_FREE(subreq);
7176 if (tevent_req_nterror(req, status)) {
7180 tevent_req_done(req);
7183 NTSTATUS dcerpc_spoolss_SetForm_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7185 struct dcerpc_spoolss_SetForm_r_state *state =
7186 tevent_req_data(req,
7187 struct dcerpc_spoolss_SetForm_r_state);
7190 if (tevent_req_is_nterror(req, &status)) {
7191 tevent_req_received(req);
7195 talloc_steal(mem_ctx, state->out_mem_ctx);
7197 tevent_req_received(req);
7198 return NT_STATUS_OK;
7201 NTSTATUS dcerpc_spoolss_SetForm_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_SetForm *r)
7205 status = dcerpc_binding_handle_call(h,
7206 NULL, &ndr_table_spoolss,
7207 NDR_SPOOLSS_SETFORM, mem_ctx, r);
7212 struct dcerpc_spoolss_SetForm_state {
7213 struct spoolss_SetForm orig;
7214 struct spoolss_SetForm tmp;
7215 TALLOC_CTX *out_mem_ctx;
7218 static void dcerpc_spoolss_SetForm_done(struct tevent_req *subreq);
7220 struct tevent_req *dcerpc_spoolss_SetForm_send(TALLOC_CTX *mem_ctx,
7221 struct tevent_context *ev,
7222 struct dcerpc_binding_handle *h,
7223 struct policy_handle *_handle /* [in] [ref] */,
7224 const char *_form_name /* [in] [charset(UTF16)] */,
7225 struct spoolss_AddFormInfoCtr *_info_ctr /* [in] [ref] */)
7227 struct tevent_req *req;
7228 struct dcerpc_spoolss_SetForm_state *state;
7229 struct tevent_req *subreq;
7231 req = tevent_req_create(mem_ctx, &state,
7232 struct dcerpc_spoolss_SetForm_state);
7236 state->out_mem_ctx = NULL;
7239 state->orig.in.handle = _handle;
7240 state->orig.in.form_name = _form_name;
7241 state->orig.in.info_ctr = _info_ctr;
7243 /* Out parameters */
7246 ZERO_STRUCT(state->orig.out.result);
7248 /* make a temporary copy, that we pass to the dispatch function */
7249 state->tmp = state->orig;
7251 subreq = dcerpc_spoolss_SetForm_r_send(state, ev, h, &state->tmp);
7252 if (tevent_req_nomem(subreq, req)) {
7253 return tevent_req_post(req, ev);
7255 tevent_req_set_callback(subreq, dcerpc_spoolss_SetForm_done, req);
7259 static void dcerpc_spoolss_SetForm_done(struct tevent_req *subreq)
7261 struct tevent_req *req = tevent_req_callback_data(
7262 subreq, struct tevent_req);
7263 struct dcerpc_spoolss_SetForm_state *state = tevent_req_data(
7264 req, struct dcerpc_spoolss_SetForm_state);
7266 TALLOC_CTX *mem_ctx;
7268 if (state->out_mem_ctx) {
7269 mem_ctx = state->out_mem_ctx;
7274 status = dcerpc_spoolss_SetForm_r_recv(subreq, mem_ctx);
7275 TALLOC_FREE(subreq);
7276 if (tevent_req_nterror(req, status)) {
7280 /* Copy out parameters */
7283 state->orig.out.result = state->tmp.out.result;
7285 /* Reset temporary structure */
7286 ZERO_STRUCT(state->tmp);
7288 tevent_req_done(req);
7291 NTSTATUS dcerpc_spoolss_SetForm_recv(struct tevent_req *req,
7292 TALLOC_CTX *mem_ctx,
7295 struct dcerpc_spoolss_SetForm_state *state = tevent_req_data(
7296 req, struct dcerpc_spoolss_SetForm_state);
7299 if (tevent_req_is_nterror(req, &status)) {
7300 tevent_req_received(req);
7304 /* Steal possible out parameters to the callers context */
7305 talloc_steal(mem_ctx, state->out_mem_ctx);
7308 *result = state->orig.out.result;
7310 tevent_req_received(req);
7311 return NT_STATUS_OK;
7314 NTSTATUS dcerpc_spoolss_SetForm(struct dcerpc_binding_handle *h,
7315 TALLOC_CTX *mem_ctx,
7316 struct policy_handle *_handle /* [in] [ref] */,
7317 const char *_form_name /* [in] [charset(UTF16)] */,
7318 struct spoolss_AddFormInfoCtr *_info_ctr /* [in] [ref] */,
7321 struct spoolss_SetForm r;
7325 r.in.handle = _handle;
7326 r.in.form_name = _form_name;
7327 r.in.info_ctr = _info_ctr;
7329 status = dcerpc_spoolss_SetForm_r(h, mem_ctx, &r);
7330 if (!NT_STATUS_IS_OK(status)) {
7334 /* Return variables */
7337 *result = r.out.result;
7339 return NT_STATUS_OK;
7342 struct dcerpc_spoolss_EnumForms_r_state {
7343 TALLOC_CTX *out_mem_ctx;
7346 static void dcerpc_spoolss_EnumForms_r_done(struct tevent_req *subreq);
7348 struct tevent_req *dcerpc_spoolss_EnumForms_r_send(TALLOC_CTX *mem_ctx,
7349 struct tevent_context *ev,
7350 struct dcerpc_binding_handle *h,
7351 struct spoolss_EnumForms *r)
7353 struct tevent_req *req;
7354 struct dcerpc_spoolss_EnumForms_r_state *state;
7355 struct tevent_req *subreq;
7357 req = tevent_req_create(mem_ctx, &state,
7358 struct dcerpc_spoolss_EnumForms_r_state);
7363 state->out_mem_ctx = talloc_new(state);
7364 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7365 return tevent_req_post(req, ev);
7368 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7369 NULL, &ndr_table_spoolss,
7370 NDR_SPOOLSS_ENUMFORMS, state->out_mem_ctx, r);
7371 if (tevent_req_nomem(subreq, req)) {
7372 return tevent_req_post(req, ev);
7374 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumForms_r_done, req);
7379 static void dcerpc_spoolss_EnumForms_r_done(struct tevent_req *subreq)
7381 struct tevent_req *req =
7382 tevent_req_callback_data(subreq,
7386 status = dcerpc_binding_handle_call_recv(subreq);
7387 TALLOC_FREE(subreq);
7388 if (tevent_req_nterror(req, status)) {
7392 tevent_req_done(req);
7395 NTSTATUS dcerpc_spoolss_EnumForms_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7397 struct dcerpc_spoolss_EnumForms_r_state *state =
7398 tevent_req_data(req,
7399 struct dcerpc_spoolss_EnumForms_r_state);
7402 if (tevent_req_is_nterror(req, &status)) {
7403 tevent_req_received(req);
7407 talloc_steal(mem_ctx, state->out_mem_ctx);
7409 tevent_req_received(req);
7410 return NT_STATUS_OK;
7413 NTSTATUS dcerpc_spoolss_EnumForms_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumForms *r)
7417 status = dcerpc_binding_handle_call(h,
7418 NULL, &ndr_table_spoolss,
7419 NDR_SPOOLSS_ENUMFORMS, mem_ctx, r);
7424 struct dcerpc_spoolss_EnumForms_state {
7425 struct spoolss_EnumForms orig;
7426 struct spoolss_EnumForms tmp;
7427 TALLOC_CTX *out_mem_ctx;
7430 static void dcerpc_spoolss_EnumForms_done(struct tevent_req *subreq);
7432 struct tevent_req *dcerpc_spoolss_EnumForms_send(TALLOC_CTX *mem_ctx,
7433 struct tevent_context *ev,
7434 struct dcerpc_binding_handle *h,
7435 struct policy_handle *_handle /* [in] [ref] */,
7436 uint32_t _level /* [in] */,
7437 DATA_BLOB *_buffer /* [in] [unique] */,
7438 uint32_t _offered /* [in] */,
7439 uint32_t *_count /* [out] [ref] */,
7440 union spoolss_FormInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
7441 uint32_t *_needed /* [out] [ref] */)
7443 struct tevent_req *req;
7444 struct dcerpc_spoolss_EnumForms_state *state;
7445 struct tevent_req *subreq;
7447 req = tevent_req_create(mem_ctx, &state,
7448 struct dcerpc_spoolss_EnumForms_state);
7452 state->out_mem_ctx = NULL;
7455 state->orig.in.handle = _handle;
7456 state->orig.in.level = _level;
7457 state->orig.in.buffer = _buffer;
7458 state->orig.in.offered = _offered;
7460 /* Out parameters */
7461 state->orig.out.count = _count;
7462 state->orig.out.info = _info;
7463 state->orig.out.needed = _needed;
7466 ZERO_STRUCT(state->orig.out.result);
7468 state->out_mem_ctx = talloc_named_const(state, 0,
7469 "dcerpc_spoolss_EnumForms_out_memory");
7470 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7471 return tevent_req_post(req, ev);
7474 /* make a temporary copy, that we pass to the dispatch function */
7475 state->tmp = state->orig;
7477 subreq = dcerpc_spoolss_EnumForms_r_send(state, ev, h, &state->tmp);
7478 if (tevent_req_nomem(subreq, req)) {
7479 return tevent_req_post(req, ev);
7481 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumForms_done, req);
7485 static void dcerpc_spoolss_EnumForms_done(struct tevent_req *subreq)
7487 struct tevent_req *req = tevent_req_callback_data(
7488 subreq, struct tevent_req);
7489 struct dcerpc_spoolss_EnumForms_state *state = tevent_req_data(
7490 req, struct dcerpc_spoolss_EnumForms_state);
7492 TALLOC_CTX *mem_ctx;
7494 if (state->out_mem_ctx) {
7495 mem_ctx = state->out_mem_ctx;
7500 status = dcerpc_spoolss_EnumForms_r_recv(subreq, mem_ctx);
7501 TALLOC_FREE(subreq);
7502 if (tevent_req_nterror(req, status)) {
7506 /* Copy out parameters */
7507 *state->orig.out.count = *state->tmp.out.count;
7508 *state->orig.out.info = *state->tmp.out.info;
7509 *state->orig.out.needed = *state->tmp.out.needed;
7512 state->orig.out.result = state->tmp.out.result;
7514 /* Reset temporary structure */
7515 ZERO_STRUCT(state->tmp);
7517 tevent_req_done(req);
7520 NTSTATUS dcerpc_spoolss_EnumForms_recv(struct tevent_req *req,
7521 TALLOC_CTX *mem_ctx,
7524 struct dcerpc_spoolss_EnumForms_state *state = tevent_req_data(
7525 req, struct dcerpc_spoolss_EnumForms_state);
7528 if (tevent_req_is_nterror(req, &status)) {
7529 tevent_req_received(req);
7533 /* Steal possible out parameters to the callers context */
7534 talloc_steal(mem_ctx, state->out_mem_ctx);
7537 *result = state->orig.out.result;
7539 tevent_req_received(req);
7540 return NT_STATUS_OK;
7543 NTSTATUS dcerpc_spoolss_EnumForms(struct dcerpc_binding_handle *h,
7544 TALLOC_CTX *mem_ctx,
7545 struct policy_handle *_handle /* [in] [ref] */,
7546 uint32_t _level /* [in] */,
7547 DATA_BLOB *_buffer /* [in] [unique] */,
7548 uint32_t _offered /* [in] */,
7549 uint32_t *_count /* [out] [ref] */,
7550 union spoolss_FormInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
7551 uint32_t *_needed /* [out] [ref] */,
7554 struct spoolss_EnumForms r;
7558 r.in.handle = _handle;
7559 r.in.level = _level;
7560 r.in.buffer = _buffer;
7561 r.in.offered = _offered;
7563 status = dcerpc_spoolss_EnumForms_r(h, mem_ctx, &r);
7564 if (!NT_STATUS_IS_OK(status)) {
7568 /* Return variables */
7569 *_count = *r.out.count;
7570 *_info = *r.out.info;
7571 *_needed = *r.out.needed;
7574 *result = r.out.result;
7576 return NT_STATUS_OK;
7579 struct dcerpc_spoolss_EnumPorts_r_state {
7580 TALLOC_CTX *out_mem_ctx;
7583 static void dcerpc_spoolss_EnumPorts_r_done(struct tevent_req *subreq);
7585 struct tevent_req *dcerpc_spoolss_EnumPorts_r_send(TALLOC_CTX *mem_ctx,
7586 struct tevent_context *ev,
7587 struct dcerpc_binding_handle *h,
7588 struct spoolss_EnumPorts *r)
7590 struct tevent_req *req;
7591 struct dcerpc_spoolss_EnumPorts_r_state *state;
7592 struct tevent_req *subreq;
7594 req = tevent_req_create(mem_ctx, &state,
7595 struct dcerpc_spoolss_EnumPorts_r_state);
7600 state->out_mem_ctx = talloc_new(state);
7601 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7602 return tevent_req_post(req, ev);
7605 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7606 NULL, &ndr_table_spoolss,
7607 NDR_SPOOLSS_ENUMPORTS, state->out_mem_ctx, r);
7608 if (tevent_req_nomem(subreq, req)) {
7609 return tevent_req_post(req, ev);
7611 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPorts_r_done, req);
7616 static void dcerpc_spoolss_EnumPorts_r_done(struct tevent_req *subreq)
7618 struct tevent_req *req =
7619 tevent_req_callback_data(subreq,
7623 status = dcerpc_binding_handle_call_recv(subreq);
7624 TALLOC_FREE(subreq);
7625 if (tevent_req_nterror(req, status)) {
7629 tevent_req_done(req);
7632 NTSTATUS dcerpc_spoolss_EnumPorts_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7634 struct dcerpc_spoolss_EnumPorts_r_state *state =
7635 tevent_req_data(req,
7636 struct dcerpc_spoolss_EnumPorts_r_state);
7639 if (tevent_req_is_nterror(req, &status)) {
7640 tevent_req_received(req);
7644 talloc_steal(mem_ctx, state->out_mem_ctx);
7646 tevent_req_received(req);
7647 return NT_STATUS_OK;
7650 NTSTATUS dcerpc_spoolss_EnumPorts_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPorts *r)
7654 status = dcerpc_binding_handle_call(h,
7655 NULL, &ndr_table_spoolss,
7656 NDR_SPOOLSS_ENUMPORTS, mem_ctx, r);
7661 struct dcerpc_spoolss_EnumPorts_state {
7662 struct spoolss_EnumPorts orig;
7663 struct spoolss_EnumPorts tmp;
7664 TALLOC_CTX *out_mem_ctx;
7667 static void dcerpc_spoolss_EnumPorts_done(struct tevent_req *subreq);
7669 struct tevent_req *dcerpc_spoolss_EnumPorts_send(TALLOC_CTX *mem_ctx,
7670 struct tevent_context *ev,
7671 struct dcerpc_binding_handle *h,
7672 const char *_servername /* [in] [unique,charset(UTF16)] */,
7673 uint32_t _level /* [in] */,
7674 DATA_BLOB *_buffer /* [in] [unique] */,
7675 uint32_t _offered /* [in] */,
7676 uint32_t *_count /* [out] [ref] */,
7677 union spoolss_PortInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
7678 uint32_t *_needed /* [out] [ref] */)
7680 struct tevent_req *req;
7681 struct dcerpc_spoolss_EnumPorts_state *state;
7682 struct tevent_req *subreq;
7684 req = tevent_req_create(mem_ctx, &state,
7685 struct dcerpc_spoolss_EnumPorts_state);
7689 state->out_mem_ctx = NULL;
7692 state->orig.in.servername = _servername;
7693 state->orig.in.level = _level;
7694 state->orig.in.buffer = _buffer;
7695 state->orig.in.offered = _offered;
7697 /* Out parameters */
7698 state->orig.out.count = _count;
7699 state->orig.out.info = _info;
7700 state->orig.out.needed = _needed;
7703 ZERO_STRUCT(state->orig.out.result);
7705 state->out_mem_ctx = talloc_named_const(state, 0,
7706 "dcerpc_spoolss_EnumPorts_out_memory");
7707 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7708 return tevent_req_post(req, ev);
7711 /* make a temporary copy, that we pass to the dispatch function */
7712 state->tmp = state->orig;
7714 subreq = dcerpc_spoolss_EnumPorts_r_send(state, ev, h, &state->tmp);
7715 if (tevent_req_nomem(subreq, req)) {
7716 return tevent_req_post(req, ev);
7718 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPorts_done, req);
7722 static void dcerpc_spoolss_EnumPorts_done(struct tevent_req *subreq)
7724 struct tevent_req *req = tevent_req_callback_data(
7725 subreq, struct tevent_req);
7726 struct dcerpc_spoolss_EnumPorts_state *state = tevent_req_data(
7727 req, struct dcerpc_spoolss_EnumPorts_state);
7729 TALLOC_CTX *mem_ctx;
7731 if (state->out_mem_ctx) {
7732 mem_ctx = state->out_mem_ctx;
7737 status = dcerpc_spoolss_EnumPorts_r_recv(subreq, mem_ctx);
7738 TALLOC_FREE(subreq);
7739 if (tevent_req_nterror(req, status)) {
7743 /* Copy out parameters */
7744 *state->orig.out.count = *state->tmp.out.count;
7745 *state->orig.out.info = *state->tmp.out.info;
7746 *state->orig.out.needed = *state->tmp.out.needed;
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 dcerpc_spoolss_EnumPorts_recv(struct tevent_req *req,
7758 TALLOC_CTX *mem_ctx,
7761 struct dcerpc_spoolss_EnumPorts_state *state = tevent_req_data(
7762 req, struct dcerpc_spoolss_EnumPorts_state);
7765 if (tevent_req_is_nterror(req, &status)) {
7766 tevent_req_received(req);
7770 /* Steal possible 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 dcerpc_spoolss_EnumPorts(struct dcerpc_binding_handle *h,
7781 TALLOC_CTX *mem_ctx,
7782 const char *_servername /* [in] [unique,charset(UTF16)] */,
7783 uint32_t _level /* [in] */,
7784 DATA_BLOB *_buffer /* [in] [unique] */,
7785 uint32_t _offered /* [in] */,
7786 uint32_t *_count /* [out] [ref] */,
7787 union spoolss_PortInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
7788 uint32_t *_needed /* [out] [ref] */,
7791 struct spoolss_EnumPorts r;
7795 r.in.servername = _servername;
7796 r.in.level = _level;
7797 r.in.buffer = _buffer;
7798 r.in.offered = _offered;
7800 status = dcerpc_spoolss_EnumPorts_r(h, mem_ctx, &r);
7801 if (!NT_STATUS_IS_OK(status)) {
7805 /* Return variables */
7806 *_count = *r.out.count;
7807 *_info = *r.out.info;
7808 *_needed = *r.out.needed;
7811 *result = r.out.result;
7813 return NT_STATUS_OK;
7816 struct dcerpc_spoolss_EnumMonitors_r_state {
7817 TALLOC_CTX *out_mem_ctx;
7820 static void dcerpc_spoolss_EnumMonitors_r_done(struct tevent_req *subreq);
7822 struct tevent_req *dcerpc_spoolss_EnumMonitors_r_send(TALLOC_CTX *mem_ctx,
7823 struct tevent_context *ev,
7824 struct dcerpc_binding_handle *h,
7825 struct spoolss_EnumMonitors *r)
7827 struct tevent_req *req;
7828 struct dcerpc_spoolss_EnumMonitors_r_state *state;
7829 struct tevent_req *subreq;
7831 req = tevent_req_create(mem_ctx, &state,
7832 struct dcerpc_spoolss_EnumMonitors_r_state);
7837 state->out_mem_ctx = talloc_new(state);
7838 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7839 return tevent_req_post(req, ev);
7842 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7843 NULL, &ndr_table_spoolss,
7844 NDR_SPOOLSS_ENUMMONITORS, state->out_mem_ctx, r);
7845 if (tevent_req_nomem(subreq, req)) {
7846 return tevent_req_post(req, ev);
7848 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumMonitors_r_done, req);
7853 static void dcerpc_spoolss_EnumMonitors_r_done(struct tevent_req *subreq)
7855 struct tevent_req *req =
7856 tevent_req_callback_data(subreq,
7860 status = dcerpc_binding_handle_call_recv(subreq);
7861 TALLOC_FREE(subreq);
7862 if (tevent_req_nterror(req, status)) {
7866 tevent_req_done(req);
7869 NTSTATUS dcerpc_spoolss_EnumMonitors_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7871 struct dcerpc_spoolss_EnumMonitors_r_state *state =
7872 tevent_req_data(req,
7873 struct dcerpc_spoolss_EnumMonitors_r_state);
7876 if (tevent_req_is_nterror(req, &status)) {
7877 tevent_req_received(req);
7881 talloc_steal(mem_ctx, state->out_mem_ctx);
7883 tevent_req_received(req);
7884 return NT_STATUS_OK;
7887 NTSTATUS dcerpc_spoolss_EnumMonitors_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumMonitors *r)
7891 status = dcerpc_binding_handle_call(h,
7892 NULL, &ndr_table_spoolss,
7893 NDR_SPOOLSS_ENUMMONITORS, mem_ctx, r);
7898 struct dcerpc_spoolss_EnumMonitors_state {
7899 struct spoolss_EnumMonitors orig;
7900 struct spoolss_EnumMonitors tmp;
7901 TALLOC_CTX *out_mem_ctx;
7904 static void dcerpc_spoolss_EnumMonitors_done(struct tevent_req *subreq);
7906 struct tevent_req *dcerpc_spoolss_EnumMonitors_send(TALLOC_CTX *mem_ctx,
7907 struct tevent_context *ev,
7908 struct dcerpc_binding_handle *h,
7909 const char *_servername /* [in] [unique,charset(UTF16)] */,
7910 uint32_t _level /* [in] */,
7911 DATA_BLOB *_buffer /* [in] [unique] */,
7912 uint32_t _offered /* [in] */,
7913 uint32_t *_count /* [out] [ref] */,
7914 union spoolss_MonitorInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
7915 uint32_t *_needed /* [out] [ref] */)
7917 struct tevent_req *req;
7918 struct dcerpc_spoolss_EnumMonitors_state *state;
7919 struct tevent_req *subreq;
7921 req = tevent_req_create(mem_ctx, &state,
7922 struct dcerpc_spoolss_EnumMonitors_state);
7926 state->out_mem_ctx = NULL;
7929 state->orig.in.servername = _servername;
7930 state->orig.in.level = _level;
7931 state->orig.in.buffer = _buffer;
7932 state->orig.in.offered = _offered;
7934 /* Out parameters */
7935 state->orig.out.count = _count;
7936 state->orig.out.info = _info;
7937 state->orig.out.needed = _needed;
7940 ZERO_STRUCT(state->orig.out.result);
7942 state->out_mem_ctx = talloc_named_const(state, 0,
7943 "dcerpc_spoolss_EnumMonitors_out_memory");
7944 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7945 return tevent_req_post(req, ev);
7948 /* make a temporary copy, that we pass to the dispatch function */
7949 state->tmp = state->orig;
7951 subreq = dcerpc_spoolss_EnumMonitors_r_send(state, ev, h, &state->tmp);
7952 if (tevent_req_nomem(subreq, req)) {
7953 return tevent_req_post(req, ev);
7955 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumMonitors_done, req);
7959 static void dcerpc_spoolss_EnumMonitors_done(struct tevent_req *subreq)
7961 struct tevent_req *req = tevent_req_callback_data(
7962 subreq, struct tevent_req);
7963 struct dcerpc_spoolss_EnumMonitors_state *state = tevent_req_data(
7964 req, struct dcerpc_spoolss_EnumMonitors_state);
7966 TALLOC_CTX *mem_ctx;
7968 if (state->out_mem_ctx) {
7969 mem_ctx = state->out_mem_ctx;
7974 status = dcerpc_spoolss_EnumMonitors_r_recv(subreq, mem_ctx);
7975 TALLOC_FREE(subreq);
7976 if (tevent_req_nterror(req, status)) {
7980 /* Copy out parameters */
7981 *state->orig.out.count = *state->tmp.out.count;
7982 *state->orig.out.info = *state->tmp.out.info;
7983 *state->orig.out.needed = *state->tmp.out.needed;
7986 state->orig.out.result = state->tmp.out.result;
7988 /* Reset temporary structure */
7989 ZERO_STRUCT(state->tmp);
7991 tevent_req_done(req);
7994 NTSTATUS dcerpc_spoolss_EnumMonitors_recv(struct tevent_req *req,
7995 TALLOC_CTX *mem_ctx,
7998 struct dcerpc_spoolss_EnumMonitors_state *state = tevent_req_data(
7999 req, struct dcerpc_spoolss_EnumMonitors_state);
8002 if (tevent_req_is_nterror(req, &status)) {
8003 tevent_req_received(req);
8007 /* Steal possible out parameters to the callers context */
8008 talloc_steal(mem_ctx, state->out_mem_ctx);
8011 *result = state->orig.out.result;
8013 tevent_req_received(req);
8014 return NT_STATUS_OK;
8017 NTSTATUS dcerpc_spoolss_EnumMonitors(struct dcerpc_binding_handle *h,
8018 TALLOC_CTX *mem_ctx,
8019 const char *_servername /* [in] [unique,charset(UTF16)] */,
8020 uint32_t _level /* [in] */,
8021 DATA_BLOB *_buffer /* [in] [unique] */,
8022 uint32_t _offered /* [in] */,
8023 uint32_t *_count /* [out] [ref] */,
8024 union spoolss_MonitorInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
8025 uint32_t *_needed /* [out] [ref] */,
8028 struct spoolss_EnumMonitors r;
8032 r.in.servername = _servername;
8033 r.in.level = _level;
8034 r.in.buffer = _buffer;
8035 r.in.offered = _offered;
8037 status = dcerpc_spoolss_EnumMonitors_r(h, mem_ctx, &r);
8038 if (!NT_STATUS_IS_OK(status)) {
8042 /* Return variables */
8043 *_count = *r.out.count;
8044 *_info = *r.out.info;
8045 *_needed = *r.out.needed;
8048 *result = r.out.result;
8050 return NT_STATUS_OK;
8053 struct dcerpc_spoolss_AddPort_r_state {
8054 TALLOC_CTX *out_mem_ctx;
8057 static void dcerpc_spoolss_AddPort_r_done(struct tevent_req *subreq);
8059 struct tevent_req *dcerpc_spoolss_AddPort_r_send(TALLOC_CTX *mem_ctx,
8060 struct tevent_context *ev,
8061 struct dcerpc_binding_handle *h,
8062 struct spoolss_AddPort *r)
8064 struct tevent_req *req;
8065 struct dcerpc_spoolss_AddPort_r_state *state;
8066 struct tevent_req *subreq;
8068 req = tevent_req_create(mem_ctx, &state,
8069 struct dcerpc_spoolss_AddPort_r_state);
8074 state->out_mem_ctx = NULL;
8076 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8077 NULL, &ndr_table_spoolss,
8078 NDR_SPOOLSS_ADDPORT, state, r);
8079 if (tevent_req_nomem(subreq, req)) {
8080 return tevent_req_post(req, ev);
8082 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPort_r_done, req);
8087 static void dcerpc_spoolss_AddPort_r_done(struct tevent_req *subreq)
8089 struct tevent_req *req =
8090 tevent_req_callback_data(subreq,
8094 status = dcerpc_binding_handle_call_recv(subreq);
8095 TALLOC_FREE(subreq);
8096 if (tevent_req_nterror(req, status)) {
8100 tevent_req_done(req);
8103 NTSTATUS dcerpc_spoolss_AddPort_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8105 struct dcerpc_spoolss_AddPort_r_state *state =
8106 tevent_req_data(req,
8107 struct dcerpc_spoolss_AddPort_r_state);
8110 if (tevent_req_is_nterror(req, &status)) {
8111 tevent_req_received(req);
8115 talloc_steal(mem_ctx, state->out_mem_ctx);
8117 tevent_req_received(req);
8118 return NT_STATUS_OK;
8121 NTSTATUS dcerpc_spoolss_AddPort_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPort *r)
8125 status = dcerpc_binding_handle_call(h,
8126 NULL, &ndr_table_spoolss,
8127 NDR_SPOOLSS_ADDPORT, mem_ctx, r);
8132 struct dcerpc_spoolss_AddPort_state {
8133 struct spoolss_AddPort orig;
8134 struct spoolss_AddPort tmp;
8135 TALLOC_CTX *out_mem_ctx;
8138 static void dcerpc_spoolss_AddPort_done(struct tevent_req *subreq);
8140 struct tevent_req *dcerpc_spoolss_AddPort_send(TALLOC_CTX *mem_ctx,
8141 struct tevent_context *ev,
8142 struct dcerpc_binding_handle *h,
8143 const char *_server_name /* [in] [unique,charset(UTF16)] */,
8144 uint32_t _unknown /* [in] */,
8145 const char *_monitor_name /* [in] [charset(UTF16)] */)
8147 struct tevent_req *req;
8148 struct dcerpc_spoolss_AddPort_state *state;
8149 struct tevent_req *subreq;
8151 req = tevent_req_create(mem_ctx, &state,
8152 struct dcerpc_spoolss_AddPort_state);
8156 state->out_mem_ctx = NULL;
8159 state->orig.in.server_name = _server_name;
8160 state->orig.in.unknown = _unknown;
8161 state->orig.in.monitor_name = _monitor_name;
8163 /* Out parameters */
8166 ZERO_STRUCT(state->orig.out.result);
8168 /* make a temporary copy, that we pass to the dispatch function */
8169 state->tmp = state->orig;
8171 subreq = dcerpc_spoolss_AddPort_r_send(state, ev, h, &state->tmp);
8172 if (tevent_req_nomem(subreq, req)) {
8173 return tevent_req_post(req, ev);
8175 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPort_done, req);
8179 static void dcerpc_spoolss_AddPort_done(struct tevent_req *subreq)
8181 struct tevent_req *req = tevent_req_callback_data(
8182 subreq, struct tevent_req);
8183 struct dcerpc_spoolss_AddPort_state *state = tevent_req_data(
8184 req, struct dcerpc_spoolss_AddPort_state);
8186 TALLOC_CTX *mem_ctx;
8188 if (state->out_mem_ctx) {
8189 mem_ctx = state->out_mem_ctx;
8194 status = dcerpc_spoolss_AddPort_r_recv(subreq, mem_ctx);
8195 TALLOC_FREE(subreq);
8196 if (tevent_req_nterror(req, status)) {
8200 /* Copy out parameters */
8203 state->orig.out.result = state->tmp.out.result;
8205 /* Reset temporary structure */
8206 ZERO_STRUCT(state->tmp);
8208 tevent_req_done(req);
8211 NTSTATUS dcerpc_spoolss_AddPort_recv(struct tevent_req *req,
8212 TALLOC_CTX *mem_ctx,
8215 struct dcerpc_spoolss_AddPort_state *state = tevent_req_data(
8216 req, struct dcerpc_spoolss_AddPort_state);
8219 if (tevent_req_is_nterror(req, &status)) {
8220 tevent_req_received(req);
8224 /* Steal possible out parameters to the callers context */
8225 talloc_steal(mem_ctx, state->out_mem_ctx);
8228 *result = state->orig.out.result;
8230 tevent_req_received(req);
8231 return NT_STATUS_OK;
8234 NTSTATUS dcerpc_spoolss_AddPort(struct dcerpc_binding_handle *h,
8235 TALLOC_CTX *mem_ctx,
8236 const char *_server_name /* [in] [unique,charset(UTF16)] */,
8237 uint32_t _unknown /* [in] */,
8238 const char *_monitor_name /* [in] [charset(UTF16)] */,
8241 struct spoolss_AddPort r;
8245 r.in.server_name = _server_name;
8246 r.in.unknown = _unknown;
8247 r.in.monitor_name = _monitor_name;
8249 status = dcerpc_spoolss_AddPort_r(h, mem_ctx, &r);
8250 if (!NT_STATUS_IS_OK(status)) {
8254 /* Return variables */
8257 *result = r.out.result;
8259 return NT_STATUS_OK;
8262 struct dcerpc_spoolss_DeletePort_r_state {
8263 TALLOC_CTX *out_mem_ctx;
8266 static void dcerpc_spoolss_DeletePort_r_done(struct tevent_req *subreq);
8268 struct tevent_req *dcerpc_spoolss_DeletePort_r_send(TALLOC_CTX *mem_ctx,
8269 struct tevent_context *ev,
8270 struct dcerpc_binding_handle *h,
8271 struct spoolss_DeletePort *r)
8273 struct tevent_req *req;
8274 struct dcerpc_spoolss_DeletePort_r_state *state;
8275 struct tevent_req *subreq;
8277 req = tevent_req_create(mem_ctx, &state,
8278 struct dcerpc_spoolss_DeletePort_r_state);
8283 state->out_mem_ctx = NULL;
8285 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8286 NULL, &ndr_table_spoolss,
8287 NDR_SPOOLSS_DELETEPORT, state, r);
8288 if (tevent_req_nomem(subreq, req)) {
8289 return tevent_req_post(req, ev);
8291 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePort_r_done, req);
8296 static void dcerpc_spoolss_DeletePort_r_done(struct tevent_req *subreq)
8298 struct tevent_req *req =
8299 tevent_req_callback_data(subreq,
8303 status = dcerpc_binding_handle_call_recv(subreq);
8304 TALLOC_FREE(subreq);
8305 if (tevent_req_nterror(req, status)) {
8309 tevent_req_done(req);
8312 NTSTATUS dcerpc_spoolss_DeletePort_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8314 struct dcerpc_spoolss_DeletePort_r_state *state =
8315 tevent_req_data(req,
8316 struct dcerpc_spoolss_DeletePort_r_state);
8319 if (tevent_req_is_nterror(req, &status)) {
8320 tevent_req_received(req);
8324 talloc_steal(mem_ctx, state->out_mem_ctx);
8326 tevent_req_received(req);
8327 return NT_STATUS_OK;
8330 NTSTATUS dcerpc_spoolss_DeletePort_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePort *r)
8334 status = dcerpc_binding_handle_call(h,
8335 NULL, &ndr_table_spoolss,
8336 NDR_SPOOLSS_DELETEPORT, mem_ctx, r);
8341 struct dcerpc_spoolss_DeletePort_state {
8342 struct spoolss_DeletePort orig;
8343 struct spoolss_DeletePort tmp;
8344 TALLOC_CTX *out_mem_ctx;
8347 static void dcerpc_spoolss_DeletePort_done(struct tevent_req *subreq);
8349 struct tevent_req *dcerpc_spoolss_DeletePort_send(TALLOC_CTX *mem_ctx,
8350 struct tevent_context *ev,
8351 struct dcerpc_binding_handle *h,
8352 const char *_server_name /* [in] [unique,charset(UTF16)] */,
8353 uint32_t _ptr /* [in] */,
8354 const char *_port_name /* [in] [ref,charset(UTF16)] */)
8356 struct tevent_req *req;
8357 struct dcerpc_spoolss_DeletePort_state *state;
8358 struct tevent_req *subreq;
8360 req = tevent_req_create(mem_ctx, &state,
8361 struct dcerpc_spoolss_DeletePort_state);
8365 state->out_mem_ctx = NULL;
8368 state->orig.in.server_name = _server_name;
8369 state->orig.in.ptr = _ptr;
8370 state->orig.in.port_name = _port_name;
8372 /* Out parameters */
8375 ZERO_STRUCT(state->orig.out.result);
8377 /* make a temporary copy, that we pass to the dispatch function */
8378 state->tmp = state->orig;
8380 subreq = dcerpc_spoolss_DeletePort_r_send(state, ev, h, &state->tmp);
8381 if (tevent_req_nomem(subreq, req)) {
8382 return tevent_req_post(req, ev);
8384 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePort_done, req);
8388 static void dcerpc_spoolss_DeletePort_done(struct tevent_req *subreq)
8390 struct tevent_req *req = tevent_req_callback_data(
8391 subreq, struct tevent_req);
8392 struct dcerpc_spoolss_DeletePort_state *state = tevent_req_data(
8393 req, struct dcerpc_spoolss_DeletePort_state);
8395 TALLOC_CTX *mem_ctx;
8397 if (state->out_mem_ctx) {
8398 mem_ctx = state->out_mem_ctx;
8403 status = dcerpc_spoolss_DeletePort_r_recv(subreq, mem_ctx);
8404 TALLOC_FREE(subreq);
8405 if (tevent_req_nterror(req, status)) {
8409 /* Copy out parameters */
8412 state->orig.out.result = state->tmp.out.result;
8414 /* Reset temporary structure */
8415 ZERO_STRUCT(state->tmp);
8417 tevent_req_done(req);
8420 NTSTATUS dcerpc_spoolss_DeletePort_recv(struct tevent_req *req,
8421 TALLOC_CTX *mem_ctx,
8424 struct dcerpc_spoolss_DeletePort_state *state = tevent_req_data(
8425 req, struct dcerpc_spoolss_DeletePort_state);
8428 if (tevent_req_is_nterror(req, &status)) {
8429 tevent_req_received(req);
8433 /* Steal possible out parameters to the callers context */
8434 talloc_steal(mem_ctx, state->out_mem_ctx);
8437 *result = state->orig.out.result;
8439 tevent_req_received(req);
8440 return NT_STATUS_OK;
8443 NTSTATUS dcerpc_spoolss_DeletePort(struct dcerpc_binding_handle *h,
8444 TALLOC_CTX *mem_ctx,
8445 const char *_server_name /* [in] [unique,charset(UTF16)] */,
8446 uint32_t _ptr /* [in] */,
8447 const char *_port_name /* [in] [ref,charset(UTF16)] */,
8450 struct spoolss_DeletePort r;
8454 r.in.server_name = _server_name;
8456 r.in.port_name = _port_name;
8458 status = dcerpc_spoolss_DeletePort_r(h, mem_ctx, &r);
8459 if (!NT_STATUS_IS_OK(status)) {
8463 /* Return variables */
8466 *result = r.out.result;
8468 return NT_STATUS_OK;
8471 struct dcerpc_spoolss_CreatePrinterIC_r_state {
8472 TALLOC_CTX *out_mem_ctx;
8475 static void dcerpc_spoolss_CreatePrinterIC_r_done(struct tevent_req *subreq);
8477 struct tevent_req *dcerpc_spoolss_CreatePrinterIC_r_send(TALLOC_CTX *mem_ctx,
8478 struct tevent_context *ev,
8479 struct dcerpc_binding_handle *h,
8480 struct spoolss_CreatePrinterIC *r)
8482 struct tevent_req *req;
8483 struct dcerpc_spoolss_CreatePrinterIC_r_state *state;
8484 struct tevent_req *subreq;
8486 req = tevent_req_create(mem_ctx, &state,
8487 struct dcerpc_spoolss_CreatePrinterIC_r_state);
8492 state->out_mem_ctx = talloc_new(state);
8493 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8494 return tevent_req_post(req, ev);
8497 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8498 NULL, &ndr_table_spoolss,
8499 NDR_SPOOLSS_CREATEPRINTERIC, state->out_mem_ctx, r);
8500 if (tevent_req_nomem(subreq, req)) {
8501 return tevent_req_post(req, ev);
8503 tevent_req_set_callback(subreq, dcerpc_spoolss_CreatePrinterIC_r_done, req);
8508 static void dcerpc_spoolss_CreatePrinterIC_r_done(struct tevent_req *subreq)
8510 struct tevent_req *req =
8511 tevent_req_callback_data(subreq,
8515 status = dcerpc_binding_handle_call_recv(subreq);
8516 TALLOC_FREE(subreq);
8517 if (tevent_req_nterror(req, status)) {
8521 tevent_req_done(req);
8524 NTSTATUS dcerpc_spoolss_CreatePrinterIC_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8526 struct dcerpc_spoolss_CreatePrinterIC_r_state *state =
8527 tevent_req_data(req,
8528 struct dcerpc_spoolss_CreatePrinterIC_r_state);
8531 if (tevent_req_is_nterror(req, &status)) {
8532 tevent_req_received(req);
8536 talloc_steal(mem_ctx, state->out_mem_ctx);
8538 tevent_req_received(req);
8539 return NT_STATUS_OK;
8542 NTSTATUS dcerpc_spoolss_CreatePrinterIC_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_CreatePrinterIC *r)
8546 status = dcerpc_binding_handle_call(h,
8547 NULL, &ndr_table_spoolss,
8548 NDR_SPOOLSS_CREATEPRINTERIC, mem_ctx, r);
8553 struct dcerpc_spoolss_CreatePrinterIC_state {
8554 struct spoolss_CreatePrinterIC orig;
8555 struct spoolss_CreatePrinterIC tmp;
8556 TALLOC_CTX *out_mem_ctx;
8559 static void dcerpc_spoolss_CreatePrinterIC_done(struct tevent_req *subreq);
8561 struct tevent_req *dcerpc_spoolss_CreatePrinterIC_send(TALLOC_CTX *mem_ctx,
8562 struct tevent_context *ev,
8563 struct dcerpc_binding_handle *h,
8564 struct policy_handle *_handle /* [in] [ref] */,
8565 struct policy_handle *_gdi_handle /* [out] [ref] */,
8566 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */)
8568 struct tevent_req *req;
8569 struct dcerpc_spoolss_CreatePrinterIC_state *state;
8570 struct tevent_req *subreq;
8572 req = tevent_req_create(mem_ctx, &state,
8573 struct dcerpc_spoolss_CreatePrinterIC_state);
8577 state->out_mem_ctx = NULL;
8580 state->orig.in.handle = _handle;
8581 state->orig.in.devmode_ctr = _devmode_ctr;
8583 /* Out parameters */
8584 state->orig.out.gdi_handle = _gdi_handle;
8587 ZERO_STRUCT(state->orig.out.result);
8589 state->out_mem_ctx = talloc_named_const(state, 0,
8590 "dcerpc_spoolss_CreatePrinterIC_out_memory");
8591 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8592 return tevent_req_post(req, ev);
8595 /* make a temporary copy, that we pass to the dispatch function */
8596 state->tmp = state->orig;
8598 subreq = dcerpc_spoolss_CreatePrinterIC_r_send(state, ev, h, &state->tmp);
8599 if (tevent_req_nomem(subreq, req)) {
8600 return tevent_req_post(req, ev);
8602 tevent_req_set_callback(subreq, dcerpc_spoolss_CreatePrinterIC_done, req);
8606 static void dcerpc_spoolss_CreatePrinterIC_done(struct tevent_req *subreq)
8608 struct tevent_req *req = tevent_req_callback_data(
8609 subreq, struct tevent_req);
8610 struct dcerpc_spoolss_CreatePrinterIC_state *state = tevent_req_data(
8611 req, struct dcerpc_spoolss_CreatePrinterIC_state);
8613 TALLOC_CTX *mem_ctx;
8615 if (state->out_mem_ctx) {
8616 mem_ctx = state->out_mem_ctx;
8621 status = dcerpc_spoolss_CreatePrinterIC_r_recv(subreq, mem_ctx);
8622 TALLOC_FREE(subreq);
8623 if (tevent_req_nterror(req, status)) {
8627 /* Copy out parameters */
8628 *state->orig.out.gdi_handle = *state->tmp.out.gdi_handle;
8631 state->orig.out.result = state->tmp.out.result;
8633 /* Reset temporary structure */
8634 ZERO_STRUCT(state->tmp);
8636 tevent_req_done(req);
8639 NTSTATUS dcerpc_spoolss_CreatePrinterIC_recv(struct tevent_req *req,
8640 TALLOC_CTX *mem_ctx,
8643 struct dcerpc_spoolss_CreatePrinterIC_state *state = tevent_req_data(
8644 req, struct dcerpc_spoolss_CreatePrinterIC_state);
8647 if (tevent_req_is_nterror(req, &status)) {
8648 tevent_req_received(req);
8652 /* Steal possible out parameters to the callers context */
8653 talloc_steal(mem_ctx, state->out_mem_ctx);
8656 *result = state->orig.out.result;
8658 tevent_req_received(req);
8659 return NT_STATUS_OK;
8662 NTSTATUS dcerpc_spoolss_CreatePrinterIC(struct dcerpc_binding_handle *h,
8663 TALLOC_CTX *mem_ctx,
8664 struct policy_handle *_handle /* [in] [ref] */,
8665 struct policy_handle *_gdi_handle /* [out] [ref] */,
8666 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
8669 struct spoolss_CreatePrinterIC r;
8673 r.in.handle = _handle;
8674 r.in.devmode_ctr = _devmode_ctr;
8676 status = dcerpc_spoolss_CreatePrinterIC_r(h, mem_ctx, &r);
8677 if (!NT_STATUS_IS_OK(status)) {
8681 /* Return variables */
8682 *_gdi_handle = *r.out.gdi_handle;
8685 *result = r.out.result;
8687 return NT_STATUS_OK;
8690 struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_state {
8691 TALLOC_CTX *out_mem_ctx;
8694 static void dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_done(struct tevent_req *subreq);
8696 struct tevent_req *dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_send(TALLOC_CTX *mem_ctx,
8697 struct tevent_context *ev,
8698 struct dcerpc_binding_handle *h,
8699 struct spoolss_PlayGDIScriptOnPrinterIC *r)
8701 struct tevent_req *req;
8702 struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_state *state;
8703 struct tevent_req *subreq;
8705 req = tevent_req_create(mem_ctx, &state,
8706 struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_state);
8711 state->out_mem_ctx = talloc_new(state);
8712 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8713 return tevent_req_post(req, ev);
8716 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8717 NULL, &ndr_table_spoolss,
8718 NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC, state->out_mem_ctx, r);
8719 if (tevent_req_nomem(subreq, req)) {
8720 return tevent_req_post(req, ev);
8722 tevent_req_set_callback(subreq, dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_done, req);
8727 static void dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_done(struct tevent_req *subreq)
8729 struct tevent_req *req =
8730 tevent_req_callback_data(subreq,
8734 status = dcerpc_binding_handle_call_recv(subreq);
8735 TALLOC_FREE(subreq);
8736 if (tevent_req_nterror(req, status)) {
8740 tevent_req_done(req);
8743 NTSTATUS dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8745 struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_state *state =
8746 tevent_req_data(req,
8747 struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_state);
8750 if (tevent_req_is_nterror(req, &status)) {
8751 tevent_req_received(req);
8755 talloc_steal(mem_ctx, state->out_mem_ctx);
8757 tevent_req_received(req);
8758 return NT_STATUS_OK;
8761 NTSTATUS dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_PlayGDIScriptOnPrinterIC *r)
8765 status = dcerpc_binding_handle_call(h,
8766 NULL, &ndr_table_spoolss,
8767 NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC, mem_ctx, r);
8772 struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_state {
8773 struct spoolss_PlayGDIScriptOnPrinterIC orig;
8774 struct spoolss_PlayGDIScriptOnPrinterIC tmp;
8775 TALLOC_CTX *out_mem_ctx;
8778 static void dcerpc_spoolss_PlayGDIScriptOnPrinterIC_done(struct tevent_req *subreq);
8780 struct tevent_req *dcerpc_spoolss_PlayGDIScriptOnPrinterIC_send(TALLOC_CTX *mem_ctx,
8781 struct tevent_context *ev,
8782 struct dcerpc_binding_handle *h,
8783 struct policy_handle *_gdi_handle /* [in] [ref] */,
8784 uint8_t *_pIn /* [in] [ref,size_is(cIn)] */,
8785 uint32_t _cIn /* [in] */,
8786 uint8_t *_pOut /* [out] [ref,size_is(cOut)] */,
8787 uint32_t _cOut /* [in] */,
8788 uint32_t _ul /* [in] */)
8790 struct tevent_req *req;
8791 struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_state *state;
8792 struct tevent_req *subreq;
8794 req = tevent_req_create(mem_ctx, &state,
8795 struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_state);
8799 state->out_mem_ctx = NULL;
8802 state->orig.in.gdi_handle = _gdi_handle;
8803 state->orig.in.pIn = _pIn;
8804 state->orig.in.cIn = _cIn;
8805 state->orig.in.cOut = _cOut;
8806 state->orig.in.ul = _ul;
8808 /* Out parameters */
8809 state->orig.out.pOut = _pOut;
8812 ZERO_STRUCT(state->orig.out.result);
8814 state->out_mem_ctx = talloc_named_const(state, 0,
8815 "dcerpc_spoolss_PlayGDIScriptOnPrinterIC_out_memory");
8816 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8817 return tevent_req_post(req, ev);
8820 /* make a temporary copy, that we pass to the dispatch function */
8821 state->tmp = state->orig;
8823 subreq = dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_send(state, ev, h, &state->tmp);
8824 if (tevent_req_nomem(subreq, req)) {
8825 return tevent_req_post(req, ev);
8827 tevent_req_set_callback(subreq, dcerpc_spoolss_PlayGDIScriptOnPrinterIC_done, req);
8831 static void dcerpc_spoolss_PlayGDIScriptOnPrinterIC_done(struct tevent_req *subreq)
8833 struct tevent_req *req = tevent_req_callback_data(
8834 subreq, struct tevent_req);
8835 struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_state *state = tevent_req_data(
8836 req, struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_state);
8838 TALLOC_CTX *mem_ctx;
8840 if (state->out_mem_ctx) {
8841 mem_ctx = state->out_mem_ctx;
8846 status = dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r_recv(subreq, mem_ctx);
8847 TALLOC_FREE(subreq);
8848 if (tevent_req_nterror(req, status)) {
8852 /* Copy out parameters */
8854 size_t _copy_len_pOut;
8855 _copy_len_pOut = state->tmp.in.cOut;
8856 memcpy(state->orig.out.pOut, state->tmp.out.pOut, _copy_len_pOut * sizeof(*state->orig.out.pOut));
8860 state->orig.out.result = state->tmp.out.result;
8862 /* Reset temporary structure */
8863 ZERO_STRUCT(state->tmp);
8865 tevent_req_done(req);
8868 NTSTATUS dcerpc_spoolss_PlayGDIScriptOnPrinterIC_recv(struct tevent_req *req,
8869 TALLOC_CTX *mem_ctx,
8872 struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_state *state = tevent_req_data(
8873 req, struct dcerpc_spoolss_PlayGDIScriptOnPrinterIC_state);
8876 if (tevent_req_is_nterror(req, &status)) {
8877 tevent_req_received(req);
8881 /* Steal possible out parameters to the callers context */
8882 talloc_steal(mem_ctx, state->out_mem_ctx);
8885 *result = state->orig.out.result;
8887 tevent_req_received(req);
8888 return NT_STATUS_OK;
8891 NTSTATUS dcerpc_spoolss_PlayGDIScriptOnPrinterIC(struct dcerpc_binding_handle *h,
8892 TALLOC_CTX *mem_ctx,
8893 struct policy_handle *_gdi_handle /* [in] [ref] */,
8894 uint8_t *_pIn /* [in] [ref,size_is(cIn)] */,
8895 uint32_t _cIn /* [in] */,
8896 uint8_t *_pOut /* [out] [ref,size_is(cOut)] */,
8897 uint32_t _cOut /* [in] */,
8898 uint32_t _ul /* [in] */,
8901 struct spoolss_PlayGDIScriptOnPrinterIC r;
8905 r.in.gdi_handle = _gdi_handle;
8911 status = dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r(h, mem_ctx, &r);
8912 if (!NT_STATUS_IS_OK(status)) {
8916 /* Return variables */
8918 size_t _copy_len_pOut;
8919 _copy_len_pOut = r.in.cOut;
8920 memcpy(_pOut, r.out.pOut, _copy_len_pOut * sizeof(*_pOut));
8924 *result = r.out.result;
8926 return NT_STATUS_OK;
8929 struct dcerpc_spoolss_DeletePrinterIC_r_state {
8930 TALLOC_CTX *out_mem_ctx;
8933 static void dcerpc_spoolss_DeletePrinterIC_r_done(struct tevent_req *subreq);
8935 struct tevent_req *dcerpc_spoolss_DeletePrinterIC_r_send(TALLOC_CTX *mem_ctx,
8936 struct tevent_context *ev,
8937 struct dcerpc_binding_handle *h,
8938 struct spoolss_DeletePrinterIC *r)
8940 struct tevent_req *req;
8941 struct dcerpc_spoolss_DeletePrinterIC_r_state *state;
8942 struct tevent_req *subreq;
8944 req = tevent_req_create(mem_ctx, &state,
8945 struct dcerpc_spoolss_DeletePrinterIC_r_state);
8950 state->out_mem_ctx = talloc_new(state);
8951 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8952 return tevent_req_post(req, ev);
8955 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8956 NULL, &ndr_table_spoolss,
8957 NDR_SPOOLSS_DELETEPRINTERIC, state->out_mem_ctx, r);
8958 if (tevent_req_nomem(subreq, req)) {
8959 return tevent_req_post(req, ev);
8961 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterIC_r_done, req);
8966 static void dcerpc_spoolss_DeletePrinterIC_r_done(struct tevent_req *subreq)
8968 struct tevent_req *req =
8969 tevent_req_callback_data(subreq,
8973 status = dcerpc_binding_handle_call_recv(subreq);
8974 TALLOC_FREE(subreq);
8975 if (tevent_req_nterror(req, status)) {
8979 tevent_req_done(req);
8982 NTSTATUS dcerpc_spoolss_DeletePrinterIC_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8984 struct dcerpc_spoolss_DeletePrinterIC_r_state *state =
8985 tevent_req_data(req,
8986 struct dcerpc_spoolss_DeletePrinterIC_r_state);
8989 if (tevent_req_is_nterror(req, &status)) {
8990 tevent_req_received(req);
8994 talloc_steal(mem_ctx, state->out_mem_ctx);
8996 tevent_req_received(req);
8997 return NT_STATUS_OK;
9000 NTSTATUS dcerpc_spoolss_DeletePrinterIC_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinterIC *r)
9004 status = dcerpc_binding_handle_call(h,
9005 NULL, &ndr_table_spoolss,
9006 NDR_SPOOLSS_DELETEPRINTERIC, mem_ctx, r);
9011 struct dcerpc_spoolss_DeletePrinterIC_state {
9012 struct spoolss_DeletePrinterIC orig;
9013 struct spoolss_DeletePrinterIC tmp;
9014 TALLOC_CTX *out_mem_ctx;
9017 static void dcerpc_spoolss_DeletePrinterIC_done(struct tevent_req *subreq);
9019 struct tevent_req *dcerpc_spoolss_DeletePrinterIC_send(TALLOC_CTX *mem_ctx,
9020 struct tevent_context *ev,
9021 struct dcerpc_binding_handle *h,
9022 struct policy_handle *_gdi_handle /* [in,out] [ref] */)
9024 struct tevent_req *req;
9025 struct dcerpc_spoolss_DeletePrinterIC_state *state;
9026 struct tevent_req *subreq;
9028 req = tevent_req_create(mem_ctx, &state,
9029 struct dcerpc_spoolss_DeletePrinterIC_state);
9033 state->out_mem_ctx = NULL;
9036 state->orig.in.gdi_handle = _gdi_handle;
9038 /* Out parameters */
9039 state->orig.out.gdi_handle = _gdi_handle;
9042 ZERO_STRUCT(state->orig.out.result);
9044 state->out_mem_ctx = talloc_named_const(state, 0,
9045 "dcerpc_spoolss_DeletePrinterIC_out_memory");
9046 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9047 return tevent_req_post(req, ev);
9050 /* make a temporary copy, that we pass to the dispatch function */
9051 state->tmp = state->orig;
9053 subreq = dcerpc_spoolss_DeletePrinterIC_r_send(state, ev, h, &state->tmp);
9054 if (tevent_req_nomem(subreq, req)) {
9055 return tevent_req_post(req, ev);
9057 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterIC_done, req);
9061 static void dcerpc_spoolss_DeletePrinterIC_done(struct tevent_req *subreq)
9063 struct tevent_req *req = tevent_req_callback_data(
9064 subreq, struct tevent_req);
9065 struct dcerpc_spoolss_DeletePrinterIC_state *state = tevent_req_data(
9066 req, struct dcerpc_spoolss_DeletePrinterIC_state);
9068 TALLOC_CTX *mem_ctx;
9070 if (state->out_mem_ctx) {
9071 mem_ctx = state->out_mem_ctx;
9076 status = dcerpc_spoolss_DeletePrinterIC_r_recv(subreq, mem_ctx);
9077 TALLOC_FREE(subreq);
9078 if (tevent_req_nterror(req, status)) {
9082 /* Copy out parameters */
9083 *state->orig.out.gdi_handle = *state->tmp.out.gdi_handle;
9086 state->orig.out.result = state->tmp.out.result;
9088 /* Reset temporary structure */
9089 ZERO_STRUCT(state->tmp);
9091 tevent_req_done(req);
9094 NTSTATUS dcerpc_spoolss_DeletePrinterIC_recv(struct tevent_req *req,
9095 TALLOC_CTX *mem_ctx,
9098 struct dcerpc_spoolss_DeletePrinterIC_state *state = tevent_req_data(
9099 req, struct dcerpc_spoolss_DeletePrinterIC_state);
9102 if (tevent_req_is_nterror(req, &status)) {
9103 tevent_req_received(req);
9107 /* Steal possible out parameters to the callers context */
9108 talloc_steal(mem_ctx, state->out_mem_ctx);
9111 *result = state->orig.out.result;
9113 tevent_req_received(req);
9114 return NT_STATUS_OK;
9117 NTSTATUS dcerpc_spoolss_DeletePrinterIC(struct dcerpc_binding_handle *h,
9118 TALLOC_CTX *mem_ctx,
9119 struct policy_handle *_gdi_handle /* [in,out] [ref] */,
9122 struct spoolss_DeletePrinterIC r;
9126 r.in.gdi_handle = _gdi_handle;
9128 status = dcerpc_spoolss_DeletePrinterIC_r(h, mem_ctx, &r);
9129 if (!NT_STATUS_IS_OK(status)) {
9133 /* Return variables */
9134 *_gdi_handle = *r.out.gdi_handle;
9137 *result = r.out.result;
9139 return NT_STATUS_OK;
9142 struct dcerpc_spoolss_DeletePrintProcessor_r_state {
9143 TALLOC_CTX *out_mem_ctx;
9146 static void dcerpc_spoolss_DeletePrintProcessor_r_done(struct tevent_req *subreq);
9148 struct tevent_req *dcerpc_spoolss_DeletePrintProcessor_r_send(TALLOC_CTX *mem_ctx,
9149 struct tevent_context *ev,
9150 struct dcerpc_binding_handle *h,
9151 struct spoolss_DeletePrintProcessor *r)
9153 struct tevent_req *req;
9154 struct dcerpc_spoolss_DeletePrintProcessor_r_state *state;
9155 struct tevent_req *subreq;
9157 req = tevent_req_create(mem_ctx, &state,
9158 struct dcerpc_spoolss_DeletePrintProcessor_r_state);
9163 state->out_mem_ctx = NULL;
9165 subreq = dcerpc_binding_handle_call_send(state, ev, h,
9166 NULL, &ndr_table_spoolss,
9167 NDR_SPOOLSS_DELETEPRINTPROCESSOR, state, r);
9168 if (tevent_req_nomem(subreq, req)) {
9169 return tevent_req_post(req, ev);
9171 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrintProcessor_r_done, req);
9176 static void dcerpc_spoolss_DeletePrintProcessor_r_done(struct tevent_req *subreq)
9178 struct tevent_req *req =
9179 tevent_req_callback_data(subreq,
9183 status = dcerpc_binding_handle_call_recv(subreq);
9184 TALLOC_FREE(subreq);
9185 if (tevent_req_nterror(req, status)) {
9189 tevent_req_done(req);
9192 NTSTATUS dcerpc_spoolss_DeletePrintProcessor_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
9194 struct dcerpc_spoolss_DeletePrintProcessor_r_state *state =
9195 tevent_req_data(req,
9196 struct dcerpc_spoolss_DeletePrintProcessor_r_state);
9199 if (tevent_req_is_nterror(req, &status)) {
9200 tevent_req_received(req);
9204 talloc_steal(mem_ctx, state->out_mem_ctx);
9206 tevent_req_received(req);
9207 return NT_STATUS_OK;
9210 NTSTATUS dcerpc_spoolss_DeletePrintProcessor_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrintProcessor *r)
9214 status = dcerpc_binding_handle_call(h,
9215 NULL, &ndr_table_spoolss,
9216 NDR_SPOOLSS_DELETEPRINTPROCESSOR, mem_ctx, r);
9221 struct dcerpc_spoolss_DeletePrintProcessor_state {
9222 struct spoolss_DeletePrintProcessor orig;
9223 struct spoolss_DeletePrintProcessor tmp;
9224 TALLOC_CTX *out_mem_ctx;
9227 static void dcerpc_spoolss_DeletePrintProcessor_done(struct tevent_req *subreq);
9229 struct tevent_req *dcerpc_spoolss_DeletePrintProcessor_send(TALLOC_CTX *mem_ctx,
9230 struct tevent_context *ev,
9231 struct dcerpc_binding_handle *h,
9232 const char *_server /* [in] [unique,charset(UTF16)] */,
9233 const char *_architecture /* [in] [unique,charset(UTF16)] */,
9234 const char *_print_processor_name /* [in] [charset(UTF16)] */)
9236 struct tevent_req *req;
9237 struct dcerpc_spoolss_DeletePrintProcessor_state *state;
9238 struct tevent_req *subreq;
9240 req = tevent_req_create(mem_ctx, &state,
9241 struct dcerpc_spoolss_DeletePrintProcessor_state);
9245 state->out_mem_ctx = NULL;
9248 state->orig.in.server = _server;
9249 state->orig.in.architecture = _architecture;
9250 state->orig.in.print_processor_name = _print_processor_name;
9252 /* Out parameters */
9255 ZERO_STRUCT(state->orig.out.result);
9257 /* make a temporary copy, that we pass to the dispatch function */
9258 state->tmp = state->orig;
9260 subreq = dcerpc_spoolss_DeletePrintProcessor_r_send(state, ev, h, &state->tmp);
9261 if (tevent_req_nomem(subreq, req)) {
9262 return tevent_req_post(req, ev);
9264 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrintProcessor_done, req);
9268 static void dcerpc_spoolss_DeletePrintProcessor_done(struct tevent_req *subreq)
9270 struct tevent_req *req = tevent_req_callback_data(
9271 subreq, struct tevent_req);
9272 struct dcerpc_spoolss_DeletePrintProcessor_state *state = tevent_req_data(
9273 req, struct dcerpc_spoolss_DeletePrintProcessor_state);
9275 TALLOC_CTX *mem_ctx;
9277 if (state->out_mem_ctx) {
9278 mem_ctx = state->out_mem_ctx;
9283 status = dcerpc_spoolss_DeletePrintProcessor_r_recv(subreq, mem_ctx);
9284 TALLOC_FREE(subreq);
9285 if (tevent_req_nterror(req, status)) {
9289 /* Copy out parameters */
9292 state->orig.out.result = state->tmp.out.result;
9294 /* Reset temporary structure */
9295 ZERO_STRUCT(state->tmp);
9297 tevent_req_done(req);
9300 NTSTATUS dcerpc_spoolss_DeletePrintProcessor_recv(struct tevent_req *req,
9301 TALLOC_CTX *mem_ctx,
9304 struct dcerpc_spoolss_DeletePrintProcessor_state *state = tevent_req_data(
9305 req, struct dcerpc_spoolss_DeletePrintProcessor_state);
9308 if (tevent_req_is_nterror(req, &status)) {
9309 tevent_req_received(req);
9313 /* Steal possible out parameters to the callers context */
9314 talloc_steal(mem_ctx, state->out_mem_ctx);
9317 *result = state->orig.out.result;
9319 tevent_req_received(req);
9320 return NT_STATUS_OK;
9323 NTSTATUS dcerpc_spoolss_DeletePrintProcessor(struct dcerpc_binding_handle *h,
9324 TALLOC_CTX *mem_ctx,
9325 const char *_server /* [in] [unique,charset(UTF16)] */,
9326 const char *_architecture /* [in] [unique,charset(UTF16)] */,
9327 const char *_print_processor_name /* [in] [charset(UTF16)] */,
9330 struct spoolss_DeletePrintProcessor r;
9334 r.in.server = _server;
9335 r.in.architecture = _architecture;
9336 r.in.print_processor_name = _print_processor_name;
9338 status = dcerpc_spoolss_DeletePrintProcessor_r(h, mem_ctx, &r);
9339 if (!NT_STATUS_IS_OK(status)) {
9343 /* Return variables */
9346 *result = r.out.result;
9348 return NT_STATUS_OK;
9351 struct dcerpc_spoolss_EnumPrintProcDataTypes_r_state {
9352 TALLOC_CTX *out_mem_ctx;
9355 static void dcerpc_spoolss_EnumPrintProcDataTypes_r_done(struct tevent_req *subreq);
9357 struct tevent_req *dcerpc_spoolss_EnumPrintProcDataTypes_r_send(TALLOC_CTX *mem_ctx,
9358 struct tevent_context *ev,
9359 struct dcerpc_binding_handle *h,
9360 struct spoolss_EnumPrintProcDataTypes *r)
9362 struct tevent_req *req;
9363 struct dcerpc_spoolss_EnumPrintProcDataTypes_r_state *state;
9364 struct tevent_req *subreq;
9366 req = tevent_req_create(mem_ctx, &state,
9367 struct dcerpc_spoolss_EnumPrintProcDataTypes_r_state);
9372 state->out_mem_ctx = talloc_new(state);
9373 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9374 return tevent_req_post(req, ev);
9377 subreq = dcerpc_binding_handle_call_send(state, ev, h,
9378 NULL, &ndr_table_spoolss,
9379 NDR_SPOOLSS_ENUMPRINTPROCDATATYPES, state->out_mem_ctx, r);
9380 if (tevent_req_nomem(subreq, req)) {
9381 return tevent_req_post(req, ev);
9383 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrintProcDataTypes_r_done, req);
9388 static void dcerpc_spoolss_EnumPrintProcDataTypes_r_done(struct tevent_req *subreq)
9390 struct tevent_req *req =
9391 tevent_req_callback_data(subreq,
9395 status = dcerpc_binding_handle_call_recv(subreq);
9396 TALLOC_FREE(subreq);
9397 if (tevent_req_nterror(req, status)) {
9401 tevent_req_done(req);
9404 NTSTATUS dcerpc_spoolss_EnumPrintProcDataTypes_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
9406 struct dcerpc_spoolss_EnumPrintProcDataTypes_r_state *state =
9407 tevent_req_data(req,
9408 struct dcerpc_spoolss_EnumPrintProcDataTypes_r_state);
9411 if (tevent_req_is_nterror(req, &status)) {
9412 tevent_req_received(req);
9416 talloc_steal(mem_ctx, state->out_mem_ctx);
9418 tevent_req_received(req);
9419 return NT_STATUS_OK;
9422 NTSTATUS dcerpc_spoolss_EnumPrintProcDataTypes_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrintProcDataTypes *r)
9426 status = dcerpc_binding_handle_call(h,
9427 NULL, &ndr_table_spoolss,
9428 NDR_SPOOLSS_ENUMPRINTPROCDATATYPES, mem_ctx, r);
9433 struct dcerpc_spoolss_EnumPrintProcDataTypes_state {
9434 struct spoolss_EnumPrintProcDataTypes orig;
9435 struct spoolss_EnumPrintProcDataTypes tmp;
9436 TALLOC_CTX *out_mem_ctx;
9439 static void dcerpc_spoolss_EnumPrintProcDataTypes_done(struct tevent_req *subreq);
9441 struct tevent_req *dcerpc_spoolss_EnumPrintProcDataTypes_send(TALLOC_CTX *mem_ctx,
9442 struct tevent_context *ev,
9443 struct dcerpc_binding_handle *h,
9444 const char *_servername /* [in] [unique,charset(UTF16)] */,
9445 const char *_print_processor_name /* [in] [unique,charset(UTF16)] */,
9446 uint32_t _level /* [in] */,
9447 DATA_BLOB *_buffer /* [in] [unique] */,
9448 uint32_t _offered /* [in] */,
9449 uint32_t *_count /* [out] [ref] */,
9450 union spoolss_PrintProcDataTypesInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
9451 uint32_t *_needed /* [out] [ref] */)
9453 struct tevent_req *req;
9454 struct dcerpc_spoolss_EnumPrintProcDataTypes_state *state;
9455 struct tevent_req *subreq;
9457 req = tevent_req_create(mem_ctx, &state,
9458 struct dcerpc_spoolss_EnumPrintProcDataTypes_state);
9462 state->out_mem_ctx = NULL;
9465 state->orig.in.servername = _servername;
9466 state->orig.in.print_processor_name = _print_processor_name;
9467 state->orig.in.level = _level;
9468 state->orig.in.buffer = _buffer;
9469 state->orig.in.offered = _offered;
9471 /* Out parameters */
9472 state->orig.out.count = _count;
9473 state->orig.out.info = _info;
9474 state->orig.out.needed = _needed;
9477 ZERO_STRUCT(state->orig.out.result);
9479 state->out_mem_ctx = talloc_named_const(state, 0,
9480 "dcerpc_spoolss_EnumPrintProcDataTypes_out_memory");
9481 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9482 return tevent_req_post(req, ev);
9485 /* make a temporary copy, that we pass to the dispatch function */
9486 state->tmp = state->orig;
9488 subreq = dcerpc_spoolss_EnumPrintProcDataTypes_r_send(state, ev, h, &state->tmp);
9489 if (tevent_req_nomem(subreq, req)) {
9490 return tevent_req_post(req, ev);
9492 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrintProcDataTypes_done, req);
9496 static void dcerpc_spoolss_EnumPrintProcDataTypes_done(struct tevent_req *subreq)
9498 struct tevent_req *req = tevent_req_callback_data(
9499 subreq, struct tevent_req);
9500 struct dcerpc_spoolss_EnumPrintProcDataTypes_state *state = tevent_req_data(
9501 req, struct dcerpc_spoolss_EnumPrintProcDataTypes_state);
9503 TALLOC_CTX *mem_ctx;
9505 if (state->out_mem_ctx) {
9506 mem_ctx = state->out_mem_ctx;
9511 status = dcerpc_spoolss_EnumPrintProcDataTypes_r_recv(subreq, mem_ctx);
9512 TALLOC_FREE(subreq);
9513 if (tevent_req_nterror(req, status)) {
9517 /* Copy out parameters */
9518 *state->orig.out.count = *state->tmp.out.count;
9519 *state->orig.out.info = *state->tmp.out.info;
9520 *state->orig.out.needed = *state->tmp.out.needed;
9523 state->orig.out.result = state->tmp.out.result;
9525 /* Reset temporary structure */
9526 ZERO_STRUCT(state->tmp);
9528 tevent_req_done(req);
9531 NTSTATUS dcerpc_spoolss_EnumPrintProcDataTypes_recv(struct tevent_req *req,
9532 TALLOC_CTX *mem_ctx,
9535 struct dcerpc_spoolss_EnumPrintProcDataTypes_state *state = tevent_req_data(
9536 req, struct dcerpc_spoolss_EnumPrintProcDataTypes_state);
9539 if (tevent_req_is_nterror(req, &status)) {
9540 tevent_req_received(req);
9544 /* Steal possible out parameters to the callers context */
9545 talloc_steal(mem_ctx, state->out_mem_ctx);
9548 *result = state->orig.out.result;
9550 tevent_req_received(req);
9551 return NT_STATUS_OK;
9554 NTSTATUS dcerpc_spoolss_EnumPrintProcDataTypes(struct dcerpc_binding_handle *h,
9555 TALLOC_CTX *mem_ctx,
9556 const char *_servername /* [in] [unique,charset(UTF16)] */,
9557 const char *_print_processor_name /* [in] [unique,charset(UTF16)] */,
9558 uint32_t _level /* [in] */,
9559 DATA_BLOB *_buffer /* [in] [unique] */,
9560 uint32_t _offered /* [in] */,
9561 uint32_t *_count /* [out] [ref] */,
9562 union spoolss_PrintProcDataTypesInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
9563 uint32_t *_needed /* [out] [ref] */,
9566 struct spoolss_EnumPrintProcDataTypes r;
9570 r.in.servername = _servername;
9571 r.in.print_processor_name = _print_processor_name;
9572 r.in.level = _level;
9573 r.in.buffer = _buffer;
9574 r.in.offered = _offered;
9576 status = dcerpc_spoolss_EnumPrintProcDataTypes_r(h, mem_ctx, &r);
9577 if (!NT_STATUS_IS_OK(status)) {
9581 /* Return variables */
9582 *_count = *r.out.count;
9583 *_info = *r.out.info;
9584 *_needed = *r.out.needed;
9587 *result = r.out.result;
9589 return NT_STATUS_OK;
9592 struct dcerpc_spoolss_ResetPrinter_r_state {
9593 TALLOC_CTX *out_mem_ctx;
9596 static void dcerpc_spoolss_ResetPrinter_r_done(struct tevent_req *subreq);
9598 struct tevent_req *dcerpc_spoolss_ResetPrinter_r_send(TALLOC_CTX *mem_ctx,
9599 struct tevent_context *ev,
9600 struct dcerpc_binding_handle *h,
9601 struct spoolss_ResetPrinter *r)
9603 struct tevent_req *req;
9604 struct dcerpc_spoolss_ResetPrinter_r_state *state;
9605 struct tevent_req *subreq;
9607 req = tevent_req_create(mem_ctx, &state,
9608 struct dcerpc_spoolss_ResetPrinter_r_state);
9613 state->out_mem_ctx = NULL;
9615 subreq = dcerpc_binding_handle_call_send(state, ev, h,
9616 NULL, &ndr_table_spoolss,
9617 NDR_SPOOLSS_RESETPRINTER, state, r);
9618 if (tevent_req_nomem(subreq, req)) {
9619 return tevent_req_post(req, ev);
9621 tevent_req_set_callback(subreq, dcerpc_spoolss_ResetPrinter_r_done, req);
9626 static void dcerpc_spoolss_ResetPrinter_r_done(struct tevent_req *subreq)
9628 struct tevent_req *req =
9629 tevent_req_callback_data(subreq,
9633 status = dcerpc_binding_handle_call_recv(subreq);
9634 TALLOC_FREE(subreq);
9635 if (tevent_req_nterror(req, status)) {
9639 tevent_req_done(req);
9642 NTSTATUS dcerpc_spoolss_ResetPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
9644 struct dcerpc_spoolss_ResetPrinter_r_state *state =
9645 tevent_req_data(req,
9646 struct dcerpc_spoolss_ResetPrinter_r_state);
9649 if (tevent_req_is_nterror(req, &status)) {
9650 tevent_req_received(req);
9654 talloc_steal(mem_ctx, state->out_mem_ctx);
9656 tevent_req_received(req);
9657 return NT_STATUS_OK;
9660 NTSTATUS dcerpc_spoolss_ResetPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_ResetPrinter *r)
9664 status = dcerpc_binding_handle_call(h,
9665 NULL, &ndr_table_spoolss,
9666 NDR_SPOOLSS_RESETPRINTER, mem_ctx, r);
9671 struct dcerpc_spoolss_ResetPrinter_state {
9672 struct spoolss_ResetPrinter orig;
9673 struct spoolss_ResetPrinter tmp;
9674 TALLOC_CTX *out_mem_ctx;
9677 static void dcerpc_spoolss_ResetPrinter_done(struct tevent_req *subreq);
9679 struct tevent_req *dcerpc_spoolss_ResetPrinter_send(TALLOC_CTX *mem_ctx,
9680 struct tevent_context *ev,
9681 struct dcerpc_binding_handle *h,
9682 struct policy_handle *_handle /* [in] [ref] */,
9683 const char *_data_type /* [in] [unique,charset(UTF16)] */,
9684 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */)
9686 struct tevent_req *req;
9687 struct dcerpc_spoolss_ResetPrinter_state *state;
9688 struct tevent_req *subreq;
9690 req = tevent_req_create(mem_ctx, &state,
9691 struct dcerpc_spoolss_ResetPrinter_state);
9695 state->out_mem_ctx = NULL;
9698 state->orig.in.handle = _handle;
9699 state->orig.in.data_type = _data_type;
9700 state->orig.in.devmode_ctr = _devmode_ctr;
9702 /* Out parameters */
9705 ZERO_STRUCT(state->orig.out.result);
9707 /* make a temporary copy, that we pass to the dispatch function */
9708 state->tmp = state->orig;
9710 subreq = dcerpc_spoolss_ResetPrinter_r_send(state, ev, h, &state->tmp);
9711 if (tevent_req_nomem(subreq, req)) {
9712 return tevent_req_post(req, ev);
9714 tevent_req_set_callback(subreq, dcerpc_spoolss_ResetPrinter_done, req);
9718 static void dcerpc_spoolss_ResetPrinter_done(struct tevent_req *subreq)
9720 struct tevent_req *req = tevent_req_callback_data(
9721 subreq, struct tevent_req);
9722 struct dcerpc_spoolss_ResetPrinter_state *state = tevent_req_data(
9723 req, struct dcerpc_spoolss_ResetPrinter_state);
9725 TALLOC_CTX *mem_ctx;
9727 if (state->out_mem_ctx) {
9728 mem_ctx = state->out_mem_ctx;
9733 status = dcerpc_spoolss_ResetPrinter_r_recv(subreq, mem_ctx);
9734 TALLOC_FREE(subreq);
9735 if (tevent_req_nterror(req, status)) {
9739 /* Copy out parameters */
9742 state->orig.out.result = state->tmp.out.result;
9744 /* Reset temporary structure */
9745 ZERO_STRUCT(state->tmp);
9747 tevent_req_done(req);
9750 NTSTATUS dcerpc_spoolss_ResetPrinter_recv(struct tevent_req *req,
9751 TALLOC_CTX *mem_ctx,
9754 struct dcerpc_spoolss_ResetPrinter_state *state = tevent_req_data(
9755 req, struct dcerpc_spoolss_ResetPrinter_state);
9758 if (tevent_req_is_nterror(req, &status)) {
9759 tevent_req_received(req);
9763 /* Steal possible out parameters to the callers context */
9764 talloc_steal(mem_ctx, state->out_mem_ctx);
9767 *result = state->orig.out.result;
9769 tevent_req_received(req);
9770 return NT_STATUS_OK;
9773 NTSTATUS dcerpc_spoolss_ResetPrinter(struct dcerpc_binding_handle *h,
9774 TALLOC_CTX *mem_ctx,
9775 struct policy_handle *_handle /* [in] [ref] */,
9776 const char *_data_type /* [in] [unique,charset(UTF16)] */,
9777 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
9780 struct spoolss_ResetPrinter r;
9784 r.in.handle = _handle;
9785 r.in.data_type = _data_type;
9786 r.in.devmode_ctr = _devmode_ctr;
9788 status = dcerpc_spoolss_ResetPrinter_r(h, mem_ctx, &r);
9789 if (!NT_STATUS_IS_OK(status)) {
9793 /* Return variables */
9796 *result = r.out.result;
9798 return NT_STATUS_OK;
9801 struct dcerpc_spoolss_GetPrinterDriver2_r_state {
9802 TALLOC_CTX *out_mem_ctx;
9805 static void dcerpc_spoolss_GetPrinterDriver2_r_done(struct tevent_req *subreq);
9807 struct tevent_req *dcerpc_spoolss_GetPrinterDriver2_r_send(TALLOC_CTX *mem_ctx,
9808 struct tevent_context *ev,
9809 struct dcerpc_binding_handle *h,
9810 struct spoolss_GetPrinterDriver2 *r)
9812 struct tevent_req *req;
9813 struct dcerpc_spoolss_GetPrinterDriver2_r_state *state;
9814 struct tevent_req *subreq;
9816 req = tevent_req_create(mem_ctx, &state,
9817 struct dcerpc_spoolss_GetPrinterDriver2_r_state);
9822 state->out_mem_ctx = talloc_new(state);
9823 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9824 return tevent_req_post(req, ev);
9827 subreq = dcerpc_binding_handle_call_send(state, ev, h,
9828 NULL, &ndr_table_spoolss,
9829 NDR_SPOOLSS_GETPRINTERDRIVER2, state->out_mem_ctx, r);
9830 if (tevent_req_nomem(subreq, req)) {
9831 return tevent_req_post(req, ev);
9833 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDriver2_r_done, req);
9838 static void dcerpc_spoolss_GetPrinterDriver2_r_done(struct tevent_req *subreq)
9840 struct tevent_req *req =
9841 tevent_req_callback_data(subreq,
9845 status = dcerpc_binding_handle_call_recv(subreq);
9846 TALLOC_FREE(subreq);
9847 if (tevent_req_nterror(req, status)) {
9851 tevent_req_done(req);
9854 NTSTATUS dcerpc_spoolss_GetPrinterDriver2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
9856 struct dcerpc_spoolss_GetPrinterDriver2_r_state *state =
9857 tevent_req_data(req,
9858 struct dcerpc_spoolss_GetPrinterDriver2_r_state);
9861 if (tevent_req_is_nterror(req, &status)) {
9862 tevent_req_received(req);
9866 talloc_steal(mem_ctx, state->out_mem_ctx);
9868 tevent_req_received(req);
9869 return NT_STATUS_OK;
9872 NTSTATUS dcerpc_spoolss_GetPrinterDriver2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetPrinterDriver2 *r)
9876 status = dcerpc_binding_handle_call(h,
9877 NULL, &ndr_table_spoolss,
9878 NDR_SPOOLSS_GETPRINTERDRIVER2, mem_ctx, r);
9883 struct dcerpc_spoolss_GetPrinterDriver2_state {
9884 struct spoolss_GetPrinterDriver2 orig;
9885 struct spoolss_GetPrinterDriver2 tmp;
9886 TALLOC_CTX *out_mem_ctx;
9889 static void dcerpc_spoolss_GetPrinterDriver2_done(struct tevent_req *subreq);
9891 struct tevent_req *dcerpc_spoolss_GetPrinterDriver2_send(TALLOC_CTX *mem_ctx,
9892 struct tevent_context *ev,
9893 struct dcerpc_binding_handle *h,
9894 struct policy_handle *_handle /* [in] [ref] */,
9895 const char *_architecture /* [in] [unique,charset(UTF16)] */,
9896 uint32_t _level /* [in] */,
9897 DATA_BLOB *_buffer /* [in] [unique] */,
9898 uint32_t _offered /* [in] */,
9899 uint32_t _client_major_version /* [in] */,
9900 uint32_t _client_minor_version /* [in] */,
9901 union spoolss_DriverInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
9902 uint32_t *_needed /* [out] [ref] */,
9903 uint32_t *_server_major_version /* [out] [ref] */,
9904 uint32_t *_server_minor_version /* [out] [ref] */)
9906 struct tevent_req *req;
9907 struct dcerpc_spoolss_GetPrinterDriver2_state *state;
9908 struct tevent_req *subreq;
9910 req = tevent_req_create(mem_ctx, &state,
9911 struct dcerpc_spoolss_GetPrinterDriver2_state);
9915 state->out_mem_ctx = NULL;
9918 state->orig.in.handle = _handle;
9919 state->orig.in.architecture = _architecture;
9920 state->orig.in.level = _level;
9921 state->orig.in.buffer = _buffer;
9922 state->orig.in.offered = _offered;
9923 state->orig.in.client_major_version = _client_major_version;
9924 state->orig.in.client_minor_version = _client_minor_version;
9926 /* Out parameters */
9927 state->orig.out.info = _info;
9928 state->orig.out.needed = _needed;
9929 state->orig.out.server_major_version = _server_major_version;
9930 state->orig.out.server_minor_version = _server_minor_version;
9933 ZERO_STRUCT(state->orig.out.result);
9935 state->out_mem_ctx = talloc_named_const(state, 0,
9936 "dcerpc_spoolss_GetPrinterDriver2_out_memory");
9937 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9938 return tevent_req_post(req, ev);
9941 /* make a temporary copy, that we pass to the dispatch function */
9942 state->tmp = state->orig;
9944 subreq = dcerpc_spoolss_GetPrinterDriver2_r_send(state, ev, h, &state->tmp);
9945 if (tevent_req_nomem(subreq, req)) {
9946 return tevent_req_post(req, ev);
9948 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDriver2_done, req);
9952 static void dcerpc_spoolss_GetPrinterDriver2_done(struct tevent_req *subreq)
9954 struct tevent_req *req = tevent_req_callback_data(
9955 subreq, struct tevent_req);
9956 struct dcerpc_spoolss_GetPrinterDriver2_state *state = tevent_req_data(
9957 req, struct dcerpc_spoolss_GetPrinterDriver2_state);
9959 TALLOC_CTX *mem_ctx;
9961 if (state->out_mem_ctx) {
9962 mem_ctx = state->out_mem_ctx;
9967 status = dcerpc_spoolss_GetPrinterDriver2_r_recv(subreq, mem_ctx);
9968 TALLOC_FREE(subreq);
9969 if (tevent_req_nterror(req, status)) {
9973 /* Copy out parameters */
9974 if (state->orig.out.info && state->tmp.out.info) {
9975 *state->orig.out.info = *state->tmp.out.info;
9977 *state->orig.out.needed = *state->tmp.out.needed;
9978 *state->orig.out.server_major_version = *state->tmp.out.server_major_version;
9979 *state->orig.out.server_minor_version = *state->tmp.out.server_minor_version;
9982 state->orig.out.result = state->tmp.out.result;
9984 /* Reset temporary structure */
9985 ZERO_STRUCT(state->tmp);
9987 tevent_req_done(req);
9990 NTSTATUS dcerpc_spoolss_GetPrinterDriver2_recv(struct tevent_req *req,
9991 TALLOC_CTX *mem_ctx,
9994 struct dcerpc_spoolss_GetPrinterDriver2_state *state = tevent_req_data(
9995 req, struct dcerpc_spoolss_GetPrinterDriver2_state);
9998 if (tevent_req_is_nterror(req, &status)) {
9999 tevent_req_received(req);
10003 /* Steal possible out parameters to the callers context */
10004 talloc_steal(mem_ctx, state->out_mem_ctx);
10006 /* Return result */
10007 *result = state->orig.out.result;
10009 tevent_req_received(req);
10010 return NT_STATUS_OK;
10013 NTSTATUS dcerpc_spoolss_GetPrinterDriver2(struct dcerpc_binding_handle *h,
10014 TALLOC_CTX *mem_ctx,
10015 struct policy_handle *_handle /* [in] [ref] */,
10016 const char *_architecture /* [in] [unique,charset(UTF16)] */,
10017 uint32_t _level /* [in] */,
10018 DATA_BLOB *_buffer /* [in] [unique] */,
10019 uint32_t _offered /* [in] */,
10020 uint32_t _client_major_version /* [in] */,
10021 uint32_t _client_minor_version /* [in] */,
10022 union spoolss_DriverInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
10023 uint32_t *_needed /* [out] [ref] */,
10024 uint32_t *_server_major_version /* [out] [ref] */,
10025 uint32_t *_server_minor_version /* [out] [ref] */,
10028 struct spoolss_GetPrinterDriver2 r;
10031 /* In parameters */
10032 r.in.handle = _handle;
10033 r.in.architecture = _architecture;
10034 r.in.level = _level;
10035 r.in.buffer = _buffer;
10036 r.in.offered = _offered;
10037 r.in.client_major_version = _client_major_version;
10038 r.in.client_minor_version = _client_minor_version;
10040 status = dcerpc_spoolss_GetPrinterDriver2_r(h, mem_ctx, &r);
10041 if (!NT_STATUS_IS_OK(status)) {
10045 /* Return variables */
10046 if (_info && r.out.info) {
10047 *_info = *r.out.info;
10049 *_needed = *r.out.needed;
10050 *_server_major_version = *r.out.server_major_version;
10051 *_server_minor_version = *r.out.server_minor_version;
10053 /* Return result */
10054 *result = r.out.result;
10056 return NT_STATUS_OK;
10059 struct dcerpc_spoolss_FindClosePrinterNotify_r_state {
10060 TALLOC_CTX *out_mem_ctx;
10063 static void dcerpc_spoolss_FindClosePrinterNotify_r_done(struct tevent_req *subreq);
10065 struct tevent_req *dcerpc_spoolss_FindClosePrinterNotify_r_send(TALLOC_CTX *mem_ctx,
10066 struct tevent_context *ev,
10067 struct dcerpc_binding_handle *h,
10068 struct spoolss_FindClosePrinterNotify *r)
10070 struct tevent_req *req;
10071 struct dcerpc_spoolss_FindClosePrinterNotify_r_state *state;
10072 struct tevent_req *subreq;
10074 req = tevent_req_create(mem_ctx, &state,
10075 struct dcerpc_spoolss_FindClosePrinterNotify_r_state);
10080 state->out_mem_ctx = NULL;
10082 subreq = dcerpc_binding_handle_call_send(state, ev, h,
10083 NULL, &ndr_table_spoolss,
10084 NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY, state, r);
10085 if (tevent_req_nomem(subreq, req)) {
10086 return tevent_req_post(req, ev);
10088 tevent_req_set_callback(subreq, dcerpc_spoolss_FindClosePrinterNotify_r_done, req);
10093 static void dcerpc_spoolss_FindClosePrinterNotify_r_done(struct tevent_req *subreq)
10095 struct tevent_req *req =
10096 tevent_req_callback_data(subreq,
10097 struct tevent_req);
10100 status = dcerpc_binding_handle_call_recv(subreq);
10101 TALLOC_FREE(subreq);
10102 if (tevent_req_nterror(req, status)) {
10106 tevent_req_done(req);
10109 NTSTATUS dcerpc_spoolss_FindClosePrinterNotify_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
10111 struct dcerpc_spoolss_FindClosePrinterNotify_r_state *state =
10112 tevent_req_data(req,
10113 struct dcerpc_spoolss_FindClosePrinterNotify_r_state);
10116 if (tevent_req_is_nterror(req, &status)) {
10117 tevent_req_received(req);
10121 talloc_steal(mem_ctx, state->out_mem_ctx);
10123 tevent_req_received(req);
10124 return NT_STATUS_OK;
10127 NTSTATUS dcerpc_spoolss_FindClosePrinterNotify_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_FindClosePrinterNotify *r)
10131 status = dcerpc_binding_handle_call(h,
10132 NULL, &ndr_table_spoolss,
10133 NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY, mem_ctx, r);
10138 struct dcerpc_spoolss_FindClosePrinterNotify_state {
10139 struct spoolss_FindClosePrinterNotify orig;
10140 struct spoolss_FindClosePrinterNotify tmp;
10141 TALLOC_CTX *out_mem_ctx;
10144 static void dcerpc_spoolss_FindClosePrinterNotify_done(struct tevent_req *subreq);
10146 struct tevent_req *dcerpc_spoolss_FindClosePrinterNotify_send(TALLOC_CTX *mem_ctx,
10147 struct tevent_context *ev,
10148 struct dcerpc_binding_handle *h,
10149 struct policy_handle *_handle /* [in] [ref] */)
10151 struct tevent_req *req;
10152 struct dcerpc_spoolss_FindClosePrinterNotify_state *state;
10153 struct tevent_req *subreq;
10155 req = tevent_req_create(mem_ctx, &state,
10156 struct dcerpc_spoolss_FindClosePrinterNotify_state);
10160 state->out_mem_ctx = NULL;
10162 /* In parameters */
10163 state->orig.in.handle = _handle;
10165 /* Out parameters */
10168 ZERO_STRUCT(state->orig.out.result);
10170 /* make a temporary copy, that we pass to the dispatch function */
10171 state->tmp = state->orig;
10173 subreq = dcerpc_spoolss_FindClosePrinterNotify_r_send(state, ev, h, &state->tmp);
10174 if (tevent_req_nomem(subreq, req)) {
10175 return tevent_req_post(req, ev);
10177 tevent_req_set_callback(subreq, dcerpc_spoolss_FindClosePrinterNotify_done, req);
10181 static void dcerpc_spoolss_FindClosePrinterNotify_done(struct tevent_req *subreq)
10183 struct tevent_req *req = tevent_req_callback_data(
10184 subreq, struct tevent_req);
10185 struct dcerpc_spoolss_FindClosePrinterNotify_state *state = tevent_req_data(
10186 req, struct dcerpc_spoolss_FindClosePrinterNotify_state);
10188 TALLOC_CTX *mem_ctx;
10190 if (state->out_mem_ctx) {
10191 mem_ctx = state->out_mem_ctx;
10196 status = dcerpc_spoolss_FindClosePrinterNotify_r_recv(subreq, mem_ctx);
10197 TALLOC_FREE(subreq);
10198 if (tevent_req_nterror(req, status)) {
10202 /* Copy out parameters */
10205 state->orig.out.result = state->tmp.out.result;
10207 /* Reset temporary structure */
10208 ZERO_STRUCT(state->tmp);
10210 tevent_req_done(req);
10213 NTSTATUS dcerpc_spoolss_FindClosePrinterNotify_recv(struct tevent_req *req,
10214 TALLOC_CTX *mem_ctx,
10217 struct dcerpc_spoolss_FindClosePrinterNotify_state *state = tevent_req_data(
10218 req, struct dcerpc_spoolss_FindClosePrinterNotify_state);
10221 if (tevent_req_is_nterror(req, &status)) {
10222 tevent_req_received(req);
10226 /* Steal possible out parameters to the callers context */
10227 talloc_steal(mem_ctx, state->out_mem_ctx);
10229 /* Return result */
10230 *result = state->orig.out.result;
10232 tevent_req_received(req);
10233 return NT_STATUS_OK;
10236 NTSTATUS dcerpc_spoolss_FindClosePrinterNotify(struct dcerpc_binding_handle *h,
10237 TALLOC_CTX *mem_ctx,
10238 struct policy_handle *_handle /* [in] [ref] */,
10241 struct spoolss_FindClosePrinterNotify r;
10244 /* In parameters */
10245 r.in.handle = _handle;
10247 status = dcerpc_spoolss_FindClosePrinterNotify_r(h, mem_ctx, &r);
10248 if (!NT_STATUS_IS_OK(status)) {
10252 /* Return variables */
10254 /* Return result */
10255 *result = r.out.result;
10257 return NT_STATUS_OK;
10260 struct dcerpc_spoolss_ReplyOpenPrinter_r_state {
10261 TALLOC_CTX *out_mem_ctx;
10264 static void dcerpc_spoolss_ReplyOpenPrinter_r_done(struct tevent_req *subreq);
10266 struct tevent_req *dcerpc_spoolss_ReplyOpenPrinter_r_send(TALLOC_CTX *mem_ctx,
10267 struct tevent_context *ev,
10268 struct dcerpc_binding_handle *h,
10269 struct spoolss_ReplyOpenPrinter *r)
10271 struct tevent_req *req;
10272 struct dcerpc_spoolss_ReplyOpenPrinter_r_state *state;
10273 struct tevent_req *subreq;
10275 req = tevent_req_create(mem_ctx, &state,
10276 struct dcerpc_spoolss_ReplyOpenPrinter_r_state);
10281 state->out_mem_ctx = talloc_new(state);
10282 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10283 return tevent_req_post(req, ev);
10286 subreq = dcerpc_binding_handle_call_send(state, ev, h,
10287 NULL, &ndr_table_spoolss,
10288 NDR_SPOOLSS_REPLYOPENPRINTER, state->out_mem_ctx, r);
10289 if (tevent_req_nomem(subreq, req)) {
10290 return tevent_req_post(req, ev);
10292 tevent_req_set_callback(subreq, dcerpc_spoolss_ReplyOpenPrinter_r_done, req);
10297 static void dcerpc_spoolss_ReplyOpenPrinter_r_done(struct tevent_req *subreq)
10299 struct tevent_req *req =
10300 tevent_req_callback_data(subreq,
10301 struct tevent_req);
10304 status = dcerpc_binding_handle_call_recv(subreq);
10305 TALLOC_FREE(subreq);
10306 if (tevent_req_nterror(req, status)) {
10310 tevent_req_done(req);
10313 NTSTATUS dcerpc_spoolss_ReplyOpenPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
10315 struct dcerpc_spoolss_ReplyOpenPrinter_r_state *state =
10316 tevent_req_data(req,
10317 struct dcerpc_spoolss_ReplyOpenPrinter_r_state);
10320 if (tevent_req_is_nterror(req, &status)) {
10321 tevent_req_received(req);
10325 talloc_steal(mem_ctx, state->out_mem_ctx);
10327 tevent_req_received(req);
10328 return NT_STATUS_OK;
10331 NTSTATUS dcerpc_spoolss_ReplyOpenPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_ReplyOpenPrinter *r)
10335 status = dcerpc_binding_handle_call(h,
10336 NULL, &ndr_table_spoolss,
10337 NDR_SPOOLSS_REPLYOPENPRINTER, mem_ctx, r);
10342 struct dcerpc_spoolss_ReplyOpenPrinter_state {
10343 struct spoolss_ReplyOpenPrinter orig;
10344 struct spoolss_ReplyOpenPrinter tmp;
10345 TALLOC_CTX *out_mem_ctx;
10348 static void dcerpc_spoolss_ReplyOpenPrinter_done(struct tevent_req *subreq);
10350 struct tevent_req *dcerpc_spoolss_ReplyOpenPrinter_send(TALLOC_CTX *mem_ctx,
10351 struct tevent_context *ev,
10352 struct dcerpc_binding_handle *h,
10353 const char *_server_name /* [in] [charset(UTF16)] */,
10354 uint32_t _printer_local /* [in] */,
10355 enum winreg_Type _type /* [in] */,
10356 uint32_t _bufsize /* [in] [range(0,512)] */,
10357 uint8_t *_buffer /* [in] [unique,size_is(bufsize)] */,
10358 struct policy_handle *_handle /* [out] [ref] */)
10360 struct tevent_req *req;
10361 struct dcerpc_spoolss_ReplyOpenPrinter_state *state;
10362 struct tevent_req *subreq;
10364 req = tevent_req_create(mem_ctx, &state,
10365 struct dcerpc_spoolss_ReplyOpenPrinter_state);
10369 state->out_mem_ctx = NULL;
10371 /* In parameters */
10372 state->orig.in.server_name = _server_name;
10373 state->orig.in.printer_local = _printer_local;
10374 state->orig.in.type = _type;
10375 state->orig.in.bufsize = _bufsize;
10376 state->orig.in.buffer = _buffer;
10378 /* Out parameters */
10379 state->orig.out.handle = _handle;
10382 ZERO_STRUCT(state->orig.out.result);
10384 state->out_mem_ctx = talloc_named_const(state, 0,
10385 "dcerpc_spoolss_ReplyOpenPrinter_out_memory");
10386 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10387 return tevent_req_post(req, ev);
10390 /* make a temporary copy, that we pass to the dispatch function */
10391 state->tmp = state->orig;
10393 subreq = dcerpc_spoolss_ReplyOpenPrinter_r_send(state, ev, h, &state->tmp);
10394 if (tevent_req_nomem(subreq, req)) {
10395 return tevent_req_post(req, ev);
10397 tevent_req_set_callback(subreq, dcerpc_spoolss_ReplyOpenPrinter_done, req);
10401 static void dcerpc_spoolss_ReplyOpenPrinter_done(struct tevent_req *subreq)
10403 struct tevent_req *req = tevent_req_callback_data(
10404 subreq, struct tevent_req);
10405 struct dcerpc_spoolss_ReplyOpenPrinter_state *state = tevent_req_data(
10406 req, struct dcerpc_spoolss_ReplyOpenPrinter_state);
10408 TALLOC_CTX *mem_ctx;
10410 if (state->out_mem_ctx) {
10411 mem_ctx = state->out_mem_ctx;
10416 status = dcerpc_spoolss_ReplyOpenPrinter_r_recv(subreq, mem_ctx);
10417 TALLOC_FREE(subreq);
10418 if (tevent_req_nterror(req, status)) {
10422 /* Copy out parameters */
10423 *state->orig.out.handle = *state->tmp.out.handle;
10426 state->orig.out.result = state->tmp.out.result;
10428 /* Reset temporary structure */
10429 ZERO_STRUCT(state->tmp);
10431 tevent_req_done(req);
10434 NTSTATUS dcerpc_spoolss_ReplyOpenPrinter_recv(struct tevent_req *req,
10435 TALLOC_CTX *mem_ctx,
10438 struct dcerpc_spoolss_ReplyOpenPrinter_state *state = tevent_req_data(
10439 req, struct dcerpc_spoolss_ReplyOpenPrinter_state);
10442 if (tevent_req_is_nterror(req, &status)) {
10443 tevent_req_received(req);
10447 /* Steal possible out parameters to the callers context */
10448 talloc_steal(mem_ctx, state->out_mem_ctx);
10450 /* Return result */
10451 *result = state->orig.out.result;
10453 tevent_req_received(req);
10454 return NT_STATUS_OK;
10457 NTSTATUS dcerpc_spoolss_ReplyOpenPrinter(struct dcerpc_binding_handle *h,
10458 TALLOC_CTX *mem_ctx,
10459 const char *_server_name /* [in] [charset(UTF16)] */,
10460 uint32_t _printer_local /* [in] */,
10461 enum winreg_Type _type /* [in] */,
10462 uint32_t _bufsize /* [in] [range(0,512)] */,
10463 uint8_t *_buffer /* [in] [unique,size_is(bufsize)] */,
10464 struct policy_handle *_handle /* [out] [ref] */,
10467 struct spoolss_ReplyOpenPrinter r;
10470 /* In parameters */
10471 r.in.server_name = _server_name;
10472 r.in.printer_local = _printer_local;
10474 r.in.bufsize = _bufsize;
10475 r.in.buffer = _buffer;
10477 status = dcerpc_spoolss_ReplyOpenPrinter_r(h, mem_ctx, &r);
10478 if (!NT_STATUS_IS_OK(status)) {
10482 /* Return variables */
10483 *_handle = *r.out.handle;
10485 /* Return result */
10486 *result = r.out.result;
10488 return NT_STATUS_OK;
10491 struct dcerpc_spoolss_RouterReplyPrinter_r_state {
10492 TALLOC_CTX *out_mem_ctx;
10495 static void dcerpc_spoolss_RouterReplyPrinter_r_done(struct tevent_req *subreq);
10497 struct tevent_req *dcerpc_spoolss_RouterReplyPrinter_r_send(TALLOC_CTX *mem_ctx,
10498 struct tevent_context *ev,
10499 struct dcerpc_binding_handle *h,
10500 struct spoolss_RouterReplyPrinter *r)
10502 struct tevent_req *req;
10503 struct dcerpc_spoolss_RouterReplyPrinter_r_state *state;
10504 struct tevent_req *subreq;
10506 req = tevent_req_create(mem_ctx, &state,
10507 struct dcerpc_spoolss_RouterReplyPrinter_r_state);
10512 state->out_mem_ctx = NULL;
10514 subreq = dcerpc_binding_handle_call_send(state, ev, h,
10515 NULL, &ndr_table_spoolss,
10516 NDR_SPOOLSS_ROUTERREPLYPRINTER, state, r);
10517 if (tevent_req_nomem(subreq, req)) {
10518 return tevent_req_post(req, ev);
10520 tevent_req_set_callback(subreq, dcerpc_spoolss_RouterReplyPrinter_r_done, req);
10525 static void dcerpc_spoolss_RouterReplyPrinter_r_done(struct tevent_req *subreq)
10527 struct tevent_req *req =
10528 tevent_req_callback_data(subreq,
10529 struct tevent_req);
10532 status = dcerpc_binding_handle_call_recv(subreq);
10533 TALLOC_FREE(subreq);
10534 if (tevent_req_nterror(req, status)) {
10538 tevent_req_done(req);
10541 NTSTATUS dcerpc_spoolss_RouterReplyPrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
10543 struct dcerpc_spoolss_RouterReplyPrinter_r_state *state =
10544 tevent_req_data(req,
10545 struct dcerpc_spoolss_RouterReplyPrinter_r_state);
10548 if (tevent_req_is_nterror(req, &status)) {
10549 tevent_req_received(req);
10553 talloc_steal(mem_ctx, state->out_mem_ctx);
10555 tevent_req_received(req);
10556 return NT_STATUS_OK;
10559 NTSTATUS dcerpc_spoolss_RouterReplyPrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RouterReplyPrinter *r)
10563 status = dcerpc_binding_handle_call(h,
10564 NULL, &ndr_table_spoolss,
10565 NDR_SPOOLSS_ROUTERREPLYPRINTER, mem_ctx, r);
10570 struct dcerpc_spoolss_RouterReplyPrinter_state {
10571 struct spoolss_RouterReplyPrinter orig;
10572 struct spoolss_RouterReplyPrinter tmp;
10573 TALLOC_CTX *out_mem_ctx;
10576 static void dcerpc_spoolss_RouterReplyPrinter_done(struct tevent_req *subreq);
10578 struct tevent_req *dcerpc_spoolss_RouterReplyPrinter_send(TALLOC_CTX *mem_ctx,
10579 struct tevent_context *ev,
10580 struct dcerpc_binding_handle *h,
10581 struct policy_handle *_handle /* [in] [ref] */,
10582 uint32_t _flags /* [in] */,
10583 uint32_t _bufsize /* [in] [range(0,512)] */,
10584 uint8_t *_buffer /* [in] [unique,size_is(bufsize)] */)
10586 struct tevent_req *req;
10587 struct dcerpc_spoolss_RouterReplyPrinter_state *state;
10588 struct tevent_req *subreq;
10590 req = tevent_req_create(mem_ctx, &state,
10591 struct dcerpc_spoolss_RouterReplyPrinter_state);
10595 state->out_mem_ctx = NULL;
10597 /* In parameters */
10598 state->orig.in.handle = _handle;
10599 state->orig.in.flags = _flags;
10600 state->orig.in.bufsize = _bufsize;
10601 state->orig.in.buffer = _buffer;
10603 /* Out parameters */
10606 ZERO_STRUCT(state->orig.out.result);
10608 /* make a temporary copy, that we pass to the dispatch function */
10609 state->tmp = state->orig;
10611 subreq = dcerpc_spoolss_RouterReplyPrinter_r_send(state, ev, h, &state->tmp);
10612 if (tevent_req_nomem(subreq, req)) {
10613 return tevent_req_post(req, ev);
10615 tevent_req_set_callback(subreq, dcerpc_spoolss_RouterReplyPrinter_done, req);
10619 static void dcerpc_spoolss_RouterReplyPrinter_done(struct tevent_req *subreq)
10621 struct tevent_req *req = tevent_req_callback_data(
10622 subreq, struct tevent_req);
10623 struct dcerpc_spoolss_RouterReplyPrinter_state *state = tevent_req_data(
10624 req, struct dcerpc_spoolss_RouterReplyPrinter_state);
10626 TALLOC_CTX *mem_ctx;
10628 if (state->out_mem_ctx) {
10629 mem_ctx = state->out_mem_ctx;
10634 status = dcerpc_spoolss_RouterReplyPrinter_r_recv(subreq, mem_ctx);
10635 TALLOC_FREE(subreq);
10636 if (tevent_req_nterror(req, status)) {
10640 /* Copy out parameters */
10643 state->orig.out.result = state->tmp.out.result;
10645 /* Reset temporary structure */
10646 ZERO_STRUCT(state->tmp);
10648 tevent_req_done(req);
10651 NTSTATUS dcerpc_spoolss_RouterReplyPrinter_recv(struct tevent_req *req,
10652 TALLOC_CTX *mem_ctx,
10655 struct dcerpc_spoolss_RouterReplyPrinter_state *state = tevent_req_data(
10656 req, struct dcerpc_spoolss_RouterReplyPrinter_state);
10659 if (tevent_req_is_nterror(req, &status)) {
10660 tevent_req_received(req);
10664 /* Steal possible out parameters to the callers context */
10665 talloc_steal(mem_ctx, state->out_mem_ctx);
10667 /* Return result */
10668 *result = state->orig.out.result;
10670 tevent_req_received(req);
10671 return NT_STATUS_OK;
10674 NTSTATUS dcerpc_spoolss_RouterReplyPrinter(struct dcerpc_binding_handle *h,
10675 TALLOC_CTX *mem_ctx,
10676 struct policy_handle *_handle /* [in] [ref] */,
10677 uint32_t _flags /* [in] */,
10678 uint32_t _bufsize /* [in] [range(0,512)] */,
10679 uint8_t *_buffer /* [in] [unique,size_is(bufsize)] */,
10682 struct spoolss_RouterReplyPrinter r;
10685 /* In parameters */
10686 r.in.handle = _handle;
10687 r.in.flags = _flags;
10688 r.in.bufsize = _bufsize;
10689 r.in.buffer = _buffer;
10691 status = dcerpc_spoolss_RouterReplyPrinter_r(h, mem_ctx, &r);
10692 if (!NT_STATUS_IS_OK(status)) {
10696 /* Return variables */
10698 /* Return result */
10699 *result = r.out.result;
10701 return NT_STATUS_OK;
10704 struct dcerpc_spoolss_ReplyClosePrinter_r_state {
10705 TALLOC_CTX *out_mem_ctx;
10708 static void dcerpc_spoolss_ReplyClosePrinter_r_done(struct tevent_req *subreq);
10710 struct tevent_req *dcerpc_spoolss_ReplyClosePrinter_r_send(TALLOC_CTX *mem_ctx,
10711 struct tevent_context *ev,
10712 struct dcerpc_binding_handle *h,
10713 struct spoolss_ReplyClosePrinter *r)
10715 struct tevent_req *req;
10716 struct dcerpc_spoolss_ReplyClosePrinter_r_state *state;
10717 struct tevent_req *subreq;
10719 req = tevent_req_create(mem_ctx, &state,
10720 struct dcerpc_spoolss_ReplyClosePrinter_r_state);
10725 state->out_mem_ctx = talloc_new(state);
10726 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10727 return tevent_req_post(req, ev);
10730 subreq = dcerpc_binding_handle_call_send(state, ev, h,
10731 NULL, &ndr_table_spoolss,
10732 NDR_SPOOLSS_REPLYCLOSEPRINTER, state->out_mem_ctx, r);
10733 if (tevent_req_nomem(subreq, req)) {
10734 return tevent_req_post(req, ev);
10736 tevent_req_set_callback(subreq, dcerpc_spoolss_ReplyClosePrinter_r_done, req);
10741 static void dcerpc_spoolss_ReplyClosePrinter_r_done(struct tevent_req *subreq)
10743 struct tevent_req *req =
10744 tevent_req_callback_data(subreq,
10745 struct tevent_req);
10748 status = dcerpc_binding_handle_call_recv(subreq);
10749 TALLOC_FREE(subreq);
10750 if (tevent_req_nterror(req, status)) {
10754 tevent_req_done(req);
10757 NTSTATUS dcerpc_spoolss_ReplyClosePrinter_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
10759 struct dcerpc_spoolss_ReplyClosePrinter_r_state *state =
10760 tevent_req_data(req,
10761 struct dcerpc_spoolss_ReplyClosePrinter_r_state);
10764 if (tevent_req_is_nterror(req, &status)) {
10765 tevent_req_received(req);
10769 talloc_steal(mem_ctx, state->out_mem_ctx);
10771 tevent_req_received(req);
10772 return NT_STATUS_OK;
10775 NTSTATUS dcerpc_spoolss_ReplyClosePrinter_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_ReplyClosePrinter *r)
10779 status = dcerpc_binding_handle_call(h,
10780 NULL, &ndr_table_spoolss,
10781 NDR_SPOOLSS_REPLYCLOSEPRINTER, mem_ctx, r);
10786 struct dcerpc_spoolss_ReplyClosePrinter_state {
10787 struct spoolss_ReplyClosePrinter orig;
10788 struct spoolss_ReplyClosePrinter tmp;
10789 TALLOC_CTX *out_mem_ctx;
10792 static void dcerpc_spoolss_ReplyClosePrinter_done(struct tevent_req *subreq);
10794 struct tevent_req *dcerpc_spoolss_ReplyClosePrinter_send(TALLOC_CTX *mem_ctx,
10795 struct tevent_context *ev,
10796 struct dcerpc_binding_handle *h,
10797 struct policy_handle *_handle /* [in,out] [ref] */)
10799 struct tevent_req *req;
10800 struct dcerpc_spoolss_ReplyClosePrinter_state *state;
10801 struct tevent_req *subreq;
10803 req = tevent_req_create(mem_ctx, &state,
10804 struct dcerpc_spoolss_ReplyClosePrinter_state);
10808 state->out_mem_ctx = NULL;
10810 /* In parameters */
10811 state->orig.in.handle = _handle;
10813 /* Out parameters */
10814 state->orig.out.handle = _handle;
10817 ZERO_STRUCT(state->orig.out.result);
10819 state->out_mem_ctx = talloc_named_const(state, 0,
10820 "dcerpc_spoolss_ReplyClosePrinter_out_memory");
10821 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10822 return tevent_req_post(req, ev);
10825 /* make a temporary copy, that we pass to the dispatch function */
10826 state->tmp = state->orig;
10828 subreq = dcerpc_spoolss_ReplyClosePrinter_r_send(state, ev, h, &state->tmp);
10829 if (tevent_req_nomem(subreq, req)) {
10830 return tevent_req_post(req, ev);
10832 tevent_req_set_callback(subreq, dcerpc_spoolss_ReplyClosePrinter_done, req);
10836 static void dcerpc_spoolss_ReplyClosePrinter_done(struct tevent_req *subreq)
10838 struct tevent_req *req = tevent_req_callback_data(
10839 subreq, struct tevent_req);
10840 struct dcerpc_spoolss_ReplyClosePrinter_state *state = tevent_req_data(
10841 req, struct dcerpc_spoolss_ReplyClosePrinter_state);
10843 TALLOC_CTX *mem_ctx;
10845 if (state->out_mem_ctx) {
10846 mem_ctx = state->out_mem_ctx;
10851 status = dcerpc_spoolss_ReplyClosePrinter_r_recv(subreq, mem_ctx);
10852 TALLOC_FREE(subreq);
10853 if (tevent_req_nterror(req, status)) {
10857 /* Copy out parameters */
10858 *state->orig.out.handle = *state->tmp.out.handle;
10861 state->orig.out.result = state->tmp.out.result;
10863 /* Reset temporary structure */
10864 ZERO_STRUCT(state->tmp);
10866 tevent_req_done(req);
10869 NTSTATUS dcerpc_spoolss_ReplyClosePrinter_recv(struct tevent_req *req,
10870 TALLOC_CTX *mem_ctx,
10873 struct dcerpc_spoolss_ReplyClosePrinter_state *state = tevent_req_data(
10874 req, struct dcerpc_spoolss_ReplyClosePrinter_state);
10877 if (tevent_req_is_nterror(req, &status)) {
10878 tevent_req_received(req);
10882 /* Steal possible out parameters to the callers context */
10883 talloc_steal(mem_ctx, state->out_mem_ctx);
10885 /* Return result */
10886 *result = state->orig.out.result;
10888 tevent_req_received(req);
10889 return NT_STATUS_OK;
10892 NTSTATUS dcerpc_spoolss_ReplyClosePrinter(struct dcerpc_binding_handle *h,
10893 TALLOC_CTX *mem_ctx,
10894 struct policy_handle *_handle /* [in,out] [ref] */,
10897 struct spoolss_ReplyClosePrinter r;
10900 /* In parameters */
10901 r.in.handle = _handle;
10903 status = dcerpc_spoolss_ReplyClosePrinter_r(h, mem_ctx, &r);
10904 if (!NT_STATUS_IS_OK(status)) {
10908 /* Return variables */
10909 *_handle = *r.out.handle;
10911 /* Return result */
10912 *result = r.out.result;
10914 return NT_STATUS_OK;
10917 struct dcerpc_spoolss_AddPortEx_r_state {
10918 TALLOC_CTX *out_mem_ctx;
10921 static void dcerpc_spoolss_AddPortEx_r_done(struct tevent_req *subreq);
10923 struct tevent_req *dcerpc_spoolss_AddPortEx_r_send(TALLOC_CTX *mem_ctx,
10924 struct tevent_context *ev,
10925 struct dcerpc_binding_handle *h,
10926 struct spoolss_AddPortEx *r)
10928 struct tevent_req *req;
10929 struct dcerpc_spoolss_AddPortEx_r_state *state;
10930 struct tevent_req *subreq;
10932 req = tevent_req_create(mem_ctx, &state,
10933 struct dcerpc_spoolss_AddPortEx_r_state);
10938 state->out_mem_ctx = NULL;
10940 subreq = dcerpc_binding_handle_call_send(state, ev, h,
10941 NULL, &ndr_table_spoolss,
10942 NDR_SPOOLSS_ADDPORTEX, state, r);
10943 if (tevent_req_nomem(subreq, req)) {
10944 return tevent_req_post(req, ev);
10946 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPortEx_r_done, req);
10951 static void dcerpc_spoolss_AddPortEx_r_done(struct tevent_req *subreq)
10953 struct tevent_req *req =
10954 tevent_req_callback_data(subreq,
10955 struct tevent_req);
10958 status = dcerpc_binding_handle_call_recv(subreq);
10959 TALLOC_FREE(subreq);
10960 if (tevent_req_nterror(req, status)) {
10964 tevent_req_done(req);
10967 NTSTATUS dcerpc_spoolss_AddPortEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
10969 struct dcerpc_spoolss_AddPortEx_r_state *state =
10970 tevent_req_data(req,
10971 struct dcerpc_spoolss_AddPortEx_r_state);
10974 if (tevent_req_is_nterror(req, &status)) {
10975 tevent_req_received(req);
10979 talloc_steal(mem_ctx, state->out_mem_ctx);
10981 tevent_req_received(req);
10982 return NT_STATUS_OK;
10985 NTSTATUS dcerpc_spoolss_AddPortEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPortEx *r)
10989 status = dcerpc_binding_handle_call(h,
10990 NULL, &ndr_table_spoolss,
10991 NDR_SPOOLSS_ADDPORTEX, mem_ctx, r);
10996 struct dcerpc_spoolss_AddPortEx_state {
10997 struct spoolss_AddPortEx orig;
10998 struct spoolss_AddPortEx tmp;
10999 TALLOC_CTX *out_mem_ctx;
11002 static void dcerpc_spoolss_AddPortEx_done(struct tevent_req *subreq);
11004 struct tevent_req *dcerpc_spoolss_AddPortEx_send(TALLOC_CTX *mem_ctx,
11005 struct tevent_context *ev,
11006 struct dcerpc_binding_handle *h,
11007 const char *_servername /* [in] [unique,charset(UTF16)] */,
11008 struct spoolss_SetPortInfoContainer *_port_ctr /* [in] [ref] */,
11009 struct spoolss_PortVarContainer *_port_var_ctr /* [in] [ref] */,
11010 const char *_monitor_name /* [in] [unique,charset(UTF16)] */)
11012 struct tevent_req *req;
11013 struct dcerpc_spoolss_AddPortEx_state *state;
11014 struct tevent_req *subreq;
11016 req = tevent_req_create(mem_ctx, &state,
11017 struct dcerpc_spoolss_AddPortEx_state);
11021 state->out_mem_ctx = NULL;
11023 /* In parameters */
11024 state->orig.in.servername = _servername;
11025 state->orig.in.port_ctr = _port_ctr;
11026 state->orig.in.port_var_ctr = _port_var_ctr;
11027 state->orig.in.monitor_name = _monitor_name;
11029 /* Out parameters */
11032 ZERO_STRUCT(state->orig.out.result);
11034 /* make a temporary copy, that we pass to the dispatch function */
11035 state->tmp = state->orig;
11037 subreq = dcerpc_spoolss_AddPortEx_r_send(state, ev, h, &state->tmp);
11038 if (tevent_req_nomem(subreq, req)) {
11039 return tevent_req_post(req, ev);
11041 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPortEx_done, req);
11045 static void dcerpc_spoolss_AddPortEx_done(struct tevent_req *subreq)
11047 struct tevent_req *req = tevent_req_callback_data(
11048 subreq, struct tevent_req);
11049 struct dcerpc_spoolss_AddPortEx_state *state = tevent_req_data(
11050 req, struct dcerpc_spoolss_AddPortEx_state);
11052 TALLOC_CTX *mem_ctx;
11054 if (state->out_mem_ctx) {
11055 mem_ctx = state->out_mem_ctx;
11060 status = dcerpc_spoolss_AddPortEx_r_recv(subreq, mem_ctx);
11061 TALLOC_FREE(subreq);
11062 if (tevent_req_nterror(req, status)) {
11066 /* Copy out parameters */
11069 state->orig.out.result = state->tmp.out.result;
11071 /* Reset temporary structure */
11072 ZERO_STRUCT(state->tmp);
11074 tevent_req_done(req);
11077 NTSTATUS dcerpc_spoolss_AddPortEx_recv(struct tevent_req *req,
11078 TALLOC_CTX *mem_ctx,
11081 struct dcerpc_spoolss_AddPortEx_state *state = tevent_req_data(
11082 req, struct dcerpc_spoolss_AddPortEx_state);
11085 if (tevent_req_is_nterror(req, &status)) {
11086 tevent_req_received(req);
11090 /* Steal possible out parameters to the callers context */
11091 talloc_steal(mem_ctx, state->out_mem_ctx);
11093 /* Return result */
11094 *result = state->orig.out.result;
11096 tevent_req_received(req);
11097 return NT_STATUS_OK;
11100 NTSTATUS dcerpc_spoolss_AddPortEx(struct dcerpc_binding_handle *h,
11101 TALLOC_CTX *mem_ctx,
11102 const char *_servername /* [in] [unique,charset(UTF16)] */,
11103 struct spoolss_SetPortInfoContainer *_port_ctr /* [in] [ref] */,
11104 struct spoolss_PortVarContainer *_port_var_ctr /* [in] [ref] */,
11105 const char *_monitor_name /* [in] [unique,charset(UTF16)] */,
11108 struct spoolss_AddPortEx r;
11111 /* In parameters */
11112 r.in.servername = _servername;
11113 r.in.port_ctr = _port_ctr;
11114 r.in.port_var_ctr = _port_var_ctr;
11115 r.in.monitor_name = _monitor_name;
11117 status = dcerpc_spoolss_AddPortEx_r(h, mem_ctx, &r);
11118 if (!NT_STATUS_IS_OK(status)) {
11122 /* Return variables */
11124 /* Return result */
11125 *result = r.out.result;
11127 return NT_STATUS_OK;
11130 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_state {
11131 TALLOC_CTX *out_mem_ctx;
11134 static void dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_done(struct tevent_req *subreq);
11136 struct tevent_req *dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_send(TALLOC_CTX *mem_ctx,
11137 struct tevent_context *ev,
11138 struct dcerpc_binding_handle *h,
11139 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r)
11141 struct tevent_req *req;
11142 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_state *state;
11143 struct tevent_req *subreq;
11145 req = tevent_req_create(mem_ctx, &state,
11146 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_state);
11151 state->out_mem_ctx = NULL;
11153 subreq = dcerpc_binding_handle_call_send(state, ev, h,
11154 NULL, &ndr_table_spoolss,
11155 NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX, state, r);
11156 if (tevent_req_nomem(subreq, req)) {
11157 return tevent_req_post(req, ev);
11159 tevent_req_set_callback(subreq, dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_done, req);
11164 static void dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_done(struct tevent_req *subreq)
11166 struct tevent_req *req =
11167 tevent_req_callback_data(subreq,
11168 struct tevent_req);
11171 status = dcerpc_binding_handle_call_recv(subreq);
11172 TALLOC_FREE(subreq);
11173 if (tevent_req_nterror(req, status)) {
11177 tevent_req_done(req);
11180 NTSTATUS dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
11182 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_state *state =
11183 tevent_req_data(req,
11184 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_state);
11187 if (tevent_req_is_nterror(req, &status)) {
11188 tevent_req_received(req);
11192 talloc_steal(mem_ctx, state->out_mem_ctx);
11194 tevent_req_received(req);
11195 return NT_STATUS_OK;
11198 NTSTATUS dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r)
11202 status = dcerpc_binding_handle_call(h,
11203 NULL, &ndr_table_spoolss,
11204 NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX, mem_ctx, r);
11209 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state {
11210 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx orig;
11211 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx tmp;
11212 TALLOC_CTX *out_mem_ctx;
11215 static void dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done(struct tevent_req *subreq);
11217 struct tevent_req *dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_send(TALLOC_CTX *mem_ctx,
11218 struct tevent_context *ev,
11219 struct dcerpc_binding_handle *h,
11220 struct policy_handle *_handle /* [in] [ref] */,
11221 uint32_t _flags /* [in] */,
11222 uint32_t _options /* [in] */,
11223 const char *_local_machine /* [in] [unique,charset(UTF16)] */,
11224 uint32_t _printer_local /* [in] */,
11225 struct spoolss_NotifyOption *_notify_options /* [in] [unique] */)
11227 struct tevent_req *req;
11228 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state;
11229 struct tevent_req *subreq;
11231 req = tevent_req_create(mem_ctx, &state,
11232 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
11236 state->out_mem_ctx = NULL;
11238 /* In parameters */
11239 state->orig.in.handle = _handle;
11240 state->orig.in.flags = _flags;
11241 state->orig.in.options = _options;
11242 state->orig.in.local_machine = _local_machine;
11243 state->orig.in.printer_local = _printer_local;
11244 state->orig.in.notify_options = _notify_options;
11246 /* Out parameters */
11249 ZERO_STRUCT(state->orig.out.result);
11251 /* make a temporary copy, that we pass to the dispatch function */
11252 state->tmp = state->orig;
11254 subreq = dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_send(state, ev, h, &state->tmp);
11255 if (tevent_req_nomem(subreq, req)) {
11256 return tevent_req_post(req, ev);
11258 tevent_req_set_callback(subreq, dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done, req);
11262 static void dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done(struct tevent_req *subreq)
11264 struct tevent_req *req = tevent_req_callback_data(
11265 subreq, struct tevent_req);
11266 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state = tevent_req_data(
11267 req, struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
11269 TALLOC_CTX *mem_ctx;
11271 if (state->out_mem_ctx) {
11272 mem_ctx = state->out_mem_ctx;
11277 status = dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r_recv(subreq, mem_ctx);
11278 TALLOC_FREE(subreq);
11279 if (tevent_req_nterror(req, status)) {
11283 /* Copy out parameters */
11286 state->orig.out.result = state->tmp.out.result;
11288 /* Reset temporary structure */
11289 ZERO_STRUCT(state->tmp);
11291 tevent_req_done(req);
11294 NTSTATUS dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_recv(struct tevent_req *req,
11295 TALLOC_CTX *mem_ctx,
11298 struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state = tevent_req_data(
11299 req, struct dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
11302 if (tevent_req_is_nterror(req, &status)) {
11303 tevent_req_received(req);
11307 /* Steal possible out parameters to the callers context */
11308 talloc_steal(mem_ctx, state->out_mem_ctx);
11310 /* Return result */
11311 *result = state->orig.out.result;
11313 tevent_req_received(req);
11314 return NT_STATUS_OK;
11317 NTSTATUS dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct dcerpc_binding_handle *h,
11318 TALLOC_CTX *mem_ctx,
11319 struct policy_handle *_handle /* [in] [ref] */,
11320 uint32_t _flags /* [in] */,
11321 uint32_t _options /* [in] */,
11322 const char *_local_machine /* [in] [unique,charset(UTF16)] */,
11323 uint32_t _printer_local /* [in] */,
11324 struct spoolss_NotifyOption *_notify_options /* [in] [unique] */,
11327 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
11330 /* In parameters */
11331 r.in.handle = _handle;
11332 r.in.flags = _flags;
11333 r.in.options = _options;
11334 r.in.local_machine = _local_machine;
11335 r.in.printer_local = _printer_local;
11336 r.in.notify_options = _notify_options;
11338 status = dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r(h, mem_ctx, &r);
11339 if (!NT_STATUS_IS_OK(status)) {
11343 /* Return variables */
11345 /* Return result */
11346 *result = r.out.result;
11348 return NT_STATUS_OK;
11351 struct dcerpc_spoolss_RouterReplyPrinterEx_r_state {
11352 TALLOC_CTX *out_mem_ctx;
11355 static void dcerpc_spoolss_RouterReplyPrinterEx_r_done(struct tevent_req *subreq);
11357 struct tevent_req *dcerpc_spoolss_RouterReplyPrinterEx_r_send(TALLOC_CTX *mem_ctx,
11358 struct tevent_context *ev,
11359 struct dcerpc_binding_handle *h,
11360 struct spoolss_RouterReplyPrinterEx *r)
11362 struct tevent_req *req;
11363 struct dcerpc_spoolss_RouterReplyPrinterEx_r_state *state;
11364 struct tevent_req *subreq;
11366 req = tevent_req_create(mem_ctx, &state,
11367 struct dcerpc_spoolss_RouterReplyPrinterEx_r_state);
11372 state->out_mem_ctx = talloc_new(state);
11373 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11374 return tevent_req_post(req, ev);
11377 subreq = dcerpc_binding_handle_call_send(state, ev, h,
11378 NULL, &ndr_table_spoolss,
11379 NDR_SPOOLSS_ROUTERREPLYPRINTEREX, state->out_mem_ctx, r);
11380 if (tevent_req_nomem(subreq, req)) {
11381 return tevent_req_post(req, ev);
11383 tevent_req_set_callback(subreq, dcerpc_spoolss_RouterReplyPrinterEx_r_done, req);
11388 static void dcerpc_spoolss_RouterReplyPrinterEx_r_done(struct tevent_req *subreq)
11390 struct tevent_req *req =
11391 tevent_req_callback_data(subreq,
11392 struct tevent_req);
11395 status = dcerpc_binding_handle_call_recv(subreq);
11396 TALLOC_FREE(subreq);
11397 if (tevent_req_nterror(req, status)) {
11401 tevent_req_done(req);
11404 NTSTATUS dcerpc_spoolss_RouterReplyPrinterEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
11406 struct dcerpc_spoolss_RouterReplyPrinterEx_r_state *state =
11407 tevent_req_data(req,
11408 struct dcerpc_spoolss_RouterReplyPrinterEx_r_state);
11411 if (tevent_req_is_nterror(req, &status)) {
11412 tevent_req_received(req);
11416 talloc_steal(mem_ctx, state->out_mem_ctx);
11418 tevent_req_received(req);
11419 return NT_STATUS_OK;
11422 NTSTATUS dcerpc_spoolss_RouterReplyPrinterEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RouterReplyPrinterEx *r)
11426 status = dcerpc_binding_handle_call(h,
11427 NULL, &ndr_table_spoolss,
11428 NDR_SPOOLSS_ROUTERREPLYPRINTEREX, mem_ctx, r);
11433 struct dcerpc_spoolss_RouterReplyPrinterEx_state {
11434 struct spoolss_RouterReplyPrinterEx orig;
11435 struct spoolss_RouterReplyPrinterEx tmp;
11436 TALLOC_CTX *out_mem_ctx;
11439 static void dcerpc_spoolss_RouterReplyPrinterEx_done(struct tevent_req *subreq);
11441 struct tevent_req *dcerpc_spoolss_RouterReplyPrinterEx_send(TALLOC_CTX *mem_ctx,
11442 struct tevent_context *ev,
11443 struct dcerpc_binding_handle *h,
11444 struct policy_handle *_handle /* [in] [ref] */,
11445 uint32_t _color /* [in] */,
11446 uint32_t _flags /* [in] */,
11447 uint32_t *_reply_result /* [out] [ref] */,
11448 uint32_t _reply_type /* [in] */,
11449 union spoolss_ReplyPrinterInfo _info /* [in] [switch_is(reply_type)] */)
11451 struct tevent_req *req;
11452 struct dcerpc_spoolss_RouterReplyPrinterEx_state *state;
11453 struct tevent_req *subreq;
11455 req = tevent_req_create(mem_ctx, &state,
11456 struct dcerpc_spoolss_RouterReplyPrinterEx_state);
11460 state->out_mem_ctx = NULL;
11462 /* In parameters */
11463 state->orig.in.handle = _handle;
11464 state->orig.in.color = _color;
11465 state->orig.in.flags = _flags;
11466 state->orig.in.reply_type = _reply_type;
11467 state->orig.in.info = _info;
11469 /* Out parameters */
11470 state->orig.out.reply_result = _reply_result;
11473 ZERO_STRUCT(state->orig.out.result);
11475 state->out_mem_ctx = talloc_named_const(state, 0,
11476 "dcerpc_spoolss_RouterReplyPrinterEx_out_memory");
11477 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11478 return tevent_req_post(req, ev);
11481 /* make a temporary copy, that we pass to the dispatch function */
11482 state->tmp = state->orig;
11484 subreq = dcerpc_spoolss_RouterReplyPrinterEx_r_send(state, ev, h, &state->tmp);
11485 if (tevent_req_nomem(subreq, req)) {
11486 return tevent_req_post(req, ev);
11488 tevent_req_set_callback(subreq, dcerpc_spoolss_RouterReplyPrinterEx_done, req);
11492 static void dcerpc_spoolss_RouterReplyPrinterEx_done(struct tevent_req *subreq)
11494 struct tevent_req *req = tevent_req_callback_data(
11495 subreq, struct tevent_req);
11496 struct dcerpc_spoolss_RouterReplyPrinterEx_state *state = tevent_req_data(
11497 req, struct dcerpc_spoolss_RouterReplyPrinterEx_state);
11499 TALLOC_CTX *mem_ctx;
11501 if (state->out_mem_ctx) {
11502 mem_ctx = state->out_mem_ctx;
11507 status = dcerpc_spoolss_RouterReplyPrinterEx_r_recv(subreq, mem_ctx);
11508 TALLOC_FREE(subreq);
11509 if (tevent_req_nterror(req, status)) {
11513 /* Copy out parameters */
11514 *state->orig.out.reply_result = *state->tmp.out.reply_result;
11517 state->orig.out.result = state->tmp.out.result;
11519 /* Reset temporary structure */
11520 ZERO_STRUCT(state->tmp);
11522 tevent_req_done(req);
11525 NTSTATUS dcerpc_spoolss_RouterReplyPrinterEx_recv(struct tevent_req *req,
11526 TALLOC_CTX *mem_ctx,
11529 struct dcerpc_spoolss_RouterReplyPrinterEx_state *state = tevent_req_data(
11530 req, struct dcerpc_spoolss_RouterReplyPrinterEx_state);
11533 if (tevent_req_is_nterror(req, &status)) {
11534 tevent_req_received(req);
11538 /* Steal possible out parameters to the callers context */
11539 talloc_steal(mem_ctx, state->out_mem_ctx);
11541 /* Return result */
11542 *result = state->orig.out.result;
11544 tevent_req_received(req);
11545 return NT_STATUS_OK;
11548 NTSTATUS dcerpc_spoolss_RouterReplyPrinterEx(struct dcerpc_binding_handle *h,
11549 TALLOC_CTX *mem_ctx,
11550 struct policy_handle *_handle /* [in] [ref] */,
11551 uint32_t _color /* [in] */,
11552 uint32_t _flags /* [in] */,
11553 uint32_t *_reply_result /* [out] [ref] */,
11554 uint32_t _reply_type /* [in] */,
11555 union spoolss_ReplyPrinterInfo _info /* [in] [switch_is(reply_type)] */,
11558 struct spoolss_RouterReplyPrinterEx r;
11561 /* In parameters */
11562 r.in.handle = _handle;
11563 r.in.color = _color;
11564 r.in.flags = _flags;
11565 r.in.reply_type = _reply_type;
11568 status = dcerpc_spoolss_RouterReplyPrinterEx_r(h, mem_ctx, &r);
11569 if (!NT_STATUS_IS_OK(status)) {
11573 /* Return variables */
11574 *_reply_result = *r.out.reply_result;
11576 /* Return result */
11577 *result = r.out.result;
11579 return NT_STATUS_OK;
11582 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_state {
11583 TALLOC_CTX *out_mem_ctx;
11586 static void dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_done(struct tevent_req *subreq);
11588 struct tevent_req *dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_send(TALLOC_CTX *mem_ctx,
11589 struct tevent_context *ev,
11590 struct dcerpc_binding_handle *h,
11591 struct spoolss_RouterRefreshPrinterChangeNotify *r)
11593 struct tevent_req *req;
11594 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_state *state;
11595 struct tevent_req *subreq;
11597 req = tevent_req_create(mem_ctx, &state,
11598 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_state);
11603 state->out_mem_ctx = talloc_new(state);
11604 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11605 return tevent_req_post(req, ev);
11608 subreq = dcerpc_binding_handle_call_send(state, ev, h,
11609 NULL, &ndr_table_spoolss,
11610 NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY, state->out_mem_ctx, r);
11611 if (tevent_req_nomem(subreq, req)) {
11612 return tevent_req_post(req, ev);
11614 tevent_req_set_callback(subreq, dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_done, req);
11619 static void dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_done(struct tevent_req *subreq)
11621 struct tevent_req *req =
11622 tevent_req_callback_data(subreq,
11623 struct tevent_req);
11626 status = dcerpc_binding_handle_call_recv(subreq);
11627 TALLOC_FREE(subreq);
11628 if (tevent_req_nterror(req, status)) {
11632 tevent_req_done(req);
11635 NTSTATUS dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
11637 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_state *state =
11638 tevent_req_data(req,
11639 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_state);
11642 if (tevent_req_is_nterror(req, &status)) {
11643 tevent_req_received(req);
11647 talloc_steal(mem_ctx, state->out_mem_ctx);
11649 tevent_req_received(req);
11650 return NT_STATUS_OK;
11653 NTSTATUS dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RouterRefreshPrinterChangeNotify *r)
11657 status = dcerpc_binding_handle_call(h,
11658 NULL, &ndr_table_spoolss,
11659 NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY, mem_ctx, r);
11664 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state {
11665 struct spoolss_RouterRefreshPrinterChangeNotify orig;
11666 struct spoolss_RouterRefreshPrinterChangeNotify tmp;
11667 TALLOC_CTX *out_mem_ctx;
11670 static void dcerpc_spoolss_RouterRefreshPrinterChangeNotify_done(struct tevent_req *subreq);
11672 struct tevent_req *dcerpc_spoolss_RouterRefreshPrinterChangeNotify_send(TALLOC_CTX *mem_ctx,
11673 struct tevent_context *ev,
11674 struct dcerpc_binding_handle *h,
11675 struct policy_handle *_handle /* [in] [ref] */,
11676 uint32_t _change_low /* [in] */,
11677 struct spoolss_NotifyOption *_options /* [in] [unique] */,
11678 struct spoolss_NotifyInfo **_info /* [out] [ref] */)
11680 struct tevent_req *req;
11681 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state *state;
11682 struct tevent_req *subreq;
11684 req = tevent_req_create(mem_ctx, &state,
11685 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state);
11689 state->out_mem_ctx = NULL;
11691 /* In parameters */
11692 state->orig.in.handle = _handle;
11693 state->orig.in.change_low = _change_low;
11694 state->orig.in.options = _options;
11696 /* Out parameters */
11697 state->orig.out.info = _info;
11700 ZERO_STRUCT(state->orig.out.result);
11702 state->out_mem_ctx = talloc_named_const(state, 0,
11703 "dcerpc_spoolss_RouterRefreshPrinterChangeNotify_out_memory");
11704 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11705 return tevent_req_post(req, ev);
11708 /* make a temporary copy, that we pass to the dispatch function */
11709 state->tmp = state->orig;
11711 subreq = dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_send(state, ev, h, &state->tmp);
11712 if (tevent_req_nomem(subreq, req)) {
11713 return tevent_req_post(req, ev);
11715 tevent_req_set_callback(subreq, dcerpc_spoolss_RouterRefreshPrinterChangeNotify_done, req);
11719 static void dcerpc_spoolss_RouterRefreshPrinterChangeNotify_done(struct tevent_req *subreq)
11721 struct tevent_req *req = tevent_req_callback_data(
11722 subreq, struct tevent_req);
11723 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state *state = tevent_req_data(
11724 req, struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state);
11726 TALLOC_CTX *mem_ctx;
11728 if (state->out_mem_ctx) {
11729 mem_ctx = state->out_mem_ctx;
11734 status = dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r_recv(subreq, mem_ctx);
11735 TALLOC_FREE(subreq);
11736 if (tevent_req_nterror(req, status)) {
11740 /* Copy out parameters */
11741 *state->orig.out.info = *state->tmp.out.info;
11744 state->orig.out.result = state->tmp.out.result;
11746 /* Reset temporary structure */
11747 ZERO_STRUCT(state->tmp);
11749 tevent_req_done(req);
11752 NTSTATUS dcerpc_spoolss_RouterRefreshPrinterChangeNotify_recv(struct tevent_req *req,
11753 TALLOC_CTX *mem_ctx,
11756 struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state *state = tevent_req_data(
11757 req, struct dcerpc_spoolss_RouterRefreshPrinterChangeNotify_state);
11760 if (tevent_req_is_nterror(req, &status)) {
11761 tevent_req_received(req);
11765 /* Steal possible out parameters to the callers context */
11766 talloc_steal(mem_ctx, state->out_mem_ctx);
11768 /* Return result */
11769 *result = state->orig.out.result;
11771 tevent_req_received(req);
11772 return NT_STATUS_OK;
11775 NTSTATUS dcerpc_spoolss_RouterRefreshPrinterChangeNotify(struct dcerpc_binding_handle *h,
11776 TALLOC_CTX *mem_ctx,
11777 struct policy_handle *_handle /* [in] [ref] */,
11778 uint32_t _change_low /* [in] */,
11779 struct spoolss_NotifyOption *_options /* [in] [unique] */,
11780 struct spoolss_NotifyInfo **_info /* [out] [ref] */,
11783 struct spoolss_RouterRefreshPrinterChangeNotify r;
11786 /* In parameters */
11787 r.in.handle = _handle;
11788 r.in.change_low = _change_low;
11789 r.in.options = _options;
11791 status = dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r(h, mem_ctx, &r);
11792 if (!NT_STATUS_IS_OK(status)) {
11796 /* Return variables */
11797 *_info = *r.out.info;
11799 /* Return result */
11800 *result = r.out.result;
11802 return NT_STATUS_OK;
11805 struct dcerpc_spoolss_OpenPrinterEx_r_state {
11806 TALLOC_CTX *out_mem_ctx;
11809 static void dcerpc_spoolss_OpenPrinterEx_r_done(struct tevent_req *subreq);
11811 struct tevent_req *dcerpc_spoolss_OpenPrinterEx_r_send(TALLOC_CTX *mem_ctx,
11812 struct tevent_context *ev,
11813 struct dcerpc_binding_handle *h,
11814 struct spoolss_OpenPrinterEx *r)
11816 struct tevent_req *req;
11817 struct dcerpc_spoolss_OpenPrinterEx_r_state *state;
11818 struct tevent_req *subreq;
11820 req = tevent_req_create(mem_ctx, &state,
11821 struct dcerpc_spoolss_OpenPrinterEx_r_state);
11826 state->out_mem_ctx = talloc_new(state);
11827 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11828 return tevent_req_post(req, ev);
11831 subreq = dcerpc_binding_handle_call_send(state, ev, h,
11832 NULL, &ndr_table_spoolss,
11833 NDR_SPOOLSS_OPENPRINTEREX, state->out_mem_ctx, r);
11834 if (tevent_req_nomem(subreq, req)) {
11835 return tevent_req_post(req, ev);
11837 tevent_req_set_callback(subreq, dcerpc_spoolss_OpenPrinterEx_r_done, req);
11842 static void dcerpc_spoolss_OpenPrinterEx_r_done(struct tevent_req *subreq)
11844 struct tevent_req *req =
11845 tevent_req_callback_data(subreq,
11846 struct tevent_req);
11849 status = dcerpc_binding_handle_call_recv(subreq);
11850 TALLOC_FREE(subreq);
11851 if (tevent_req_nterror(req, status)) {
11855 tevent_req_done(req);
11858 NTSTATUS dcerpc_spoolss_OpenPrinterEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
11860 struct dcerpc_spoolss_OpenPrinterEx_r_state *state =
11861 tevent_req_data(req,
11862 struct dcerpc_spoolss_OpenPrinterEx_r_state);
11865 if (tevent_req_is_nterror(req, &status)) {
11866 tevent_req_received(req);
11870 talloc_steal(mem_ctx, state->out_mem_ctx);
11872 tevent_req_received(req);
11873 return NT_STATUS_OK;
11876 NTSTATUS dcerpc_spoolss_OpenPrinterEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_OpenPrinterEx *r)
11880 status = dcerpc_binding_handle_call(h,
11881 NULL, &ndr_table_spoolss,
11882 NDR_SPOOLSS_OPENPRINTEREX, mem_ctx, r);
11887 struct dcerpc_spoolss_OpenPrinterEx_state {
11888 struct spoolss_OpenPrinterEx orig;
11889 struct spoolss_OpenPrinterEx tmp;
11890 TALLOC_CTX *out_mem_ctx;
11893 static void dcerpc_spoolss_OpenPrinterEx_done(struct tevent_req *subreq);
11895 struct tevent_req *dcerpc_spoolss_OpenPrinterEx_send(TALLOC_CTX *mem_ctx,
11896 struct tevent_context *ev,
11897 struct dcerpc_binding_handle *h,
11898 const char *_printername /* [in] [unique,charset(UTF16)] */,
11899 const char *_datatype /* [in] [unique,charset(UTF16)] */,
11900 struct spoolss_DevmodeContainer _devmode_ctr /* [in] */,
11901 uint32_t _access_mask /* [in] */,
11902 struct spoolss_UserLevelCtr _userlevel_ctr /* [in] */,
11903 struct policy_handle *_handle /* [out] [ref] */)
11905 struct tevent_req *req;
11906 struct dcerpc_spoolss_OpenPrinterEx_state *state;
11907 struct tevent_req *subreq;
11909 req = tevent_req_create(mem_ctx, &state,
11910 struct dcerpc_spoolss_OpenPrinterEx_state);
11914 state->out_mem_ctx = NULL;
11916 /* In parameters */
11917 state->orig.in.printername = _printername;
11918 state->orig.in.datatype = _datatype;
11919 state->orig.in.devmode_ctr = _devmode_ctr;
11920 state->orig.in.access_mask = _access_mask;
11921 state->orig.in.userlevel_ctr = _userlevel_ctr;
11923 /* Out parameters */
11924 state->orig.out.handle = _handle;
11927 ZERO_STRUCT(state->orig.out.result);
11929 state->out_mem_ctx = talloc_named_const(state, 0,
11930 "dcerpc_spoolss_OpenPrinterEx_out_memory");
11931 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11932 return tevent_req_post(req, ev);
11935 /* make a temporary copy, that we pass to the dispatch function */
11936 state->tmp = state->orig;
11938 subreq = dcerpc_spoolss_OpenPrinterEx_r_send(state, ev, h, &state->tmp);
11939 if (tevent_req_nomem(subreq, req)) {
11940 return tevent_req_post(req, ev);
11942 tevent_req_set_callback(subreq, dcerpc_spoolss_OpenPrinterEx_done, req);
11946 static void dcerpc_spoolss_OpenPrinterEx_done(struct tevent_req *subreq)
11948 struct tevent_req *req = tevent_req_callback_data(
11949 subreq, struct tevent_req);
11950 struct dcerpc_spoolss_OpenPrinterEx_state *state = tevent_req_data(
11951 req, struct dcerpc_spoolss_OpenPrinterEx_state);
11953 TALLOC_CTX *mem_ctx;
11955 if (state->out_mem_ctx) {
11956 mem_ctx = state->out_mem_ctx;
11961 status = dcerpc_spoolss_OpenPrinterEx_r_recv(subreq, mem_ctx);
11962 TALLOC_FREE(subreq);
11963 if (tevent_req_nterror(req, status)) {
11967 /* Copy out parameters */
11968 *state->orig.out.handle = *state->tmp.out.handle;
11971 state->orig.out.result = state->tmp.out.result;
11973 /* Reset temporary structure */
11974 ZERO_STRUCT(state->tmp);
11976 tevent_req_done(req);
11979 NTSTATUS dcerpc_spoolss_OpenPrinterEx_recv(struct tevent_req *req,
11980 TALLOC_CTX *mem_ctx,
11983 struct dcerpc_spoolss_OpenPrinterEx_state *state = tevent_req_data(
11984 req, struct dcerpc_spoolss_OpenPrinterEx_state);
11987 if (tevent_req_is_nterror(req, &status)) {
11988 tevent_req_received(req);
11992 /* Steal possible out parameters to the callers context */
11993 talloc_steal(mem_ctx, state->out_mem_ctx);
11995 /* Return result */
11996 *result = state->orig.out.result;
11998 tevent_req_received(req);
11999 return NT_STATUS_OK;
12002 NTSTATUS dcerpc_spoolss_OpenPrinterEx(struct dcerpc_binding_handle *h,
12003 TALLOC_CTX *mem_ctx,
12004 const char *_printername /* [in] [unique,charset(UTF16)] */,
12005 const char *_datatype /* [in] [unique,charset(UTF16)] */,
12006 struct spoolss_DevmodeContainer _devmode_ctr /* [in] */,
12007 uint32_t _access_mask /* [in] */,
12008 struct spoolss_UserLevelCtr _userlevel_ctr /* [in] */,
12009 struct policy_handle *_handle /* [out] [ref] */,
12012 struct spoolss_OpenPrinterEx r;
12015 /* In parameters */
12016 r.in.printername = _printername;
12017 r.in.datatype = _datatype;
12018 r.in.devmode_ctr = _devmode_ctr;
12019 r.in.access_mask = _access_mask;
12020 r.in.userlevel_ctr = _userlevel_ctr;
12022 status = dcerpc_spoolss_OpenPrinterEx_r(h, mem_ctx, &r);
12023 if (!NT_STATUS_IS_OK(status)) {
12027 /* Return variables */
12028 *_handle = *r.out.handle;
12030 /* Return result */
12031 *result = r.out.result;
12033 return NT_STATUS_OK;
12036 struct dcerpc_spoolss_AddPrinterEx_r_state {
12037 TALLOC_CTX *out_mem_ctx;
12040 static void dcerpc_spoolss_AddPrinterEx_r_done(struct tevent_req *subreq);
12042 struct tevent_req *dcerpc_spoolss_AddPrinterEx_r_send(TALLOC_CTX *mem_ctx,
12043 struct tevent_context *ev,
12044 struct dcerpc_binding_handle *h,
12045 struct spoolss_AddPrinterEx *r)
12047 struct tevent_req *req;
12048 struct dcerpc_spoolss_AddPrinterEx_r_state *state;
12049 struct tevent_req *subreq;
12051 req = tevent_req_create(mem_ctx, &state,
12052 struct dcerpc_spoolss_AddPrinterEx_r_state);
12057 state->out_mem_ctx = talloc_new(state);
12058 if (tevent_req_nomem(state->out_mem_ctx, req)) {
12059 return tevent_req_post(req, ev);
12062 subreq = dcerpc_binding_handle_call_send(state, ev, h,
12063 NULL, &ndr_table_spoolss,
12064 NDR_SPOOLSS_ADDPRINTEREX, state->out_mem_ctx, r);
12065 if (tevent_req_nomem(subreq, req)) {
12066 return tevent_req_post(req, ev);
12068 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinterEx_r_done, req);
12073 static void dcerpc_spoolss_AddPrinterEx_r_done(struct tevent_req *subreq)
12075 struct tevent_req *req =
12076 tevent_req_callback_data(subreq,
12077 struct tevent_req);
12080 status = dcerpc_binding_handle_call_recv(subreq);
12081 TALLOC_FREE(subreq);
12082 if (tevent_req_nterror(req, status)) {
12086 tevent_req_done(req);
12089 NTSTATUS dcerpc_spoolss_AddPrinterEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
12091 struct dcerpc_spoolss_AddPrinterEx_r_state *state =
12092 tevent_req_data(req,
12093 struct dcerpc_spoolss_AddPrinterEx_r_state);
12096 if (tevent_req_is_nterror(req, &status)) {
12097 tevent_req_received(req);
12101 talloc_steal(mem_ctx, state->out_mem_ctx);
12103 tevent_req_received(req);
12104 return NT_STATUS_OK;
12107 NTSTATUS dcerpc_spoolss_AddPrinterEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPrinterEx *r)
12111 status = dcerpc_binding_handle_call(h,
12112 NULL, &ndr_table_spoolss,
12113 NDR_SPOOLSS_ADDPRINTEREX, mem_ctx, r);
12118 struct dcerpc_spoolss_AddPrinterEx_state {
12119 struct spoolss_AddPrinterEx orig;
12120 struct spoolss_AddPrinterEx tmp;
12121 TALLOC_CTX *out_mem_ctx;
12124 static void dcerpc_spoolss_AddPrinterEx_done(struct tevent_req *subreq);
12126 struct tevent_req *dcerpc_spoolss_AddPrinterEx_send(TALLOC_CTX *mem_ctx,
12127 struct tevent_context *ev,
12128 struct dcerpc_binding_handle *h,
12129 const char *_server /* [in] [unique,charset(UTF16)] */,
12130 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
12131 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
12132 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
12133 struct spoolss_UserLevelCtr *_userlevel_ctr /* [in] [ref] */,
12134 struct policy_handle *_handle /* [out] [ref] */)
12136 struct tevent_req *req;
12137 struct dcerpc_spoolss_AddPrinterEx_state *state;
12138 struct tevent_req *subreq;
12140 req = tevent_req_create(mem_ctx, &state,
12141 struct dcerpc_spoolss_AddPrinterEx_state);
12145 state->out_mem_ctx = NULL;
12147 /* In parameters */
12148 state->orig.in.server = _server;
12149 state->orig.in.info_ctr = _info_ctr;
12150 state->orig.in.devmode_ctr = _devmode_ctr;
12151 state->orig.in.secdesc_ctr = _secdesc_ctr;
12152 state->orig.in.userlevel_ctr = _userlevel_ctr;
12154 /* Out parameters */
12155 state->orig.out.handle = _handle;
12158 ZERO_STRUCT(state->orig.out.result);
12160 state->out_mem_ctx = talloc_named_const(state, 0,
12161 "dcerpc_spoolss_AddPrinterEx_out_memory");
12162 if (tevent_req_nomem(state->out_mem_ctx, req)) {
12163 return tevent_req_post(req, ev);
12166 /* make a temporary copy, that we pass to the dispatch function */
12167 state->tmp = state->orig;
12169 subreq = dcerpc_spoolss_AddPrinterEx_r_send(state, ev, h, &state->tmp);
12170 if (tevent_req_nomem(subreq, req)) {
12171 return tevent_req_post(req, ev);
12173 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinterEx_done, req);
12177 static void dcerpc_spoolss_AddPrinterEx_done(struct tevent_req *subreq)
12179 struct tevent_req *req = tevent_req_callback_data(
12180 subreq, struct tevent_req);
12181 struct dcerpc_spoolss_AddPrinterEx_state *state = tevent_req_data(
12182 req, struct dcerpc_spoolss_AddPrinterEx_state);
12184 TALLOC_CTX *mem_ctx;
12186 if (state->out_mem_ctx) {
12187 mem_ctx = state->out_mem_ctx;
12192 status = dcerpc_spoolss_AddPrinterEx_r_recv(subreq, mem_ctx);
12193 TALLOC_FREE(subreq);
12194 if (tevent_req_nterror(req, status)) {
12198 /* Copy out parameters */
12199 *state->orig.out.handle = *state->tmp.out.handle;
12202 state->orig.out.result = state->tmp.out.result;
12204 /* Reset temporary structure */
12205 ZERO_STRUCT(state->tmp);
12207 tevent_req_done(req);
12210 NTSTATUS dcerpc_spoolss_AddPrinterEx_recv(struct tevent_req *req,
12211 TALLOC_CTX *mem_ctx,
12214 struct dcerpc_spoolss_AddPrinterEx_state *state = tevent_req_data(
12215 req, struct dcerpc_spoolss_AddPrinterEx_state);
12218 if (tevent_req_is_nterror(req, &status)) {
12219 tevent_req_received(req);
12223 /* Steal possible out parameters to the callers context */
12224 talloc_steal(mem_ctx, state->out_mem_ctx);
12226 /* Return result */
12227 *result = state->orig.out.result;
12229 tevent_req_received(req);
12230 return NT_STATUS_OK;
12233 NTSTATUS dcerpc_spoolss_AddPrinterEx(struct dcerpc_binding_handle *h,
12234 TALLOC_CTX *mem_ctx,
12235 const char *_server /* [in] [unique,charset(UTF16)] */,
12236 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
12237 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
12238 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
12239 struct spoolss_UserLevelCtr *_userlevel_ctr /* [in] [ref] */,
12240 struct policy_handle *_handle /* [out] [ref] */,
12243 struct spoolss_AddPrinterEx r;
12246 /* In parameters */
12247 r.in.server = _server;
12248 r.in.info_ctr = _info_ctr;
12249 r.in.devmode_ctr = _devmode_ctr;
12250 r.in.secdesc_ctr = _secdesc_ctr;
12251 r.in.userlevel_ctr = _userlevel_ctr;
12253 status = dcerpc_spoolss_AddPrinterEx_r(h, mem_ctx, &r);
12254 if (!NT_STATUS_IS_OK(status)) {
12258 /* Return variables */
12259 *_handle = *r.out.handle;
12261 /* Return result */
12262 *result = r.out.result;
12264 return NT_STATUS_OK;
12267 struct dcerpc_spoolss_SetPort_r_state {
12268 TALLOC_CTX *out_mem_ctx;
12271 static void dcerpc_spoolss_SetPort_r_done(struct tevent_req *subreq);
12273 struct tevent_req *dcerpc_spoolss_SetPort_r_send(TALLOC_CTX *mem_ctx,
12274 struct tevent_context *ev,
12275 struct dcerpc_binding_handle *h,
12276 struct spoolss_SetPort *r)
12278 struct tevent_req *req;
12279 struct dcerpc_spoolss_SetPort_r_state *state;
12280 struct tevent_req *subreq;
12282 req = tevent_req_create(mem_ctx, &state,
12283 struct dcerpc_spoolss_SetPort_r_state);
12288 state->out_mem_ctx = NULL;
12290 subreq = dcerpc_binding_handle_call_send(state, ev, h,
12291 NULL, &ndr_table_spoolss,
12292 NDR_SPOOLSS_SETPORT, state, r);
12293 if (tevent_req_nomem(subreq, req)) {
12294 return tevent_req_post(req, ev);
12296 tevent_req_set_callback(subreq, dcerpc_spoolss_SetPort_r_done, req);
12301 static void dcerpc_spoolss_SetPort_r_done(struct tevent_req *subreq)
12303 struct tevent_req *req =
12304 tevent_req_callback_data(subreq,
12305 struct tevent_req);
12308 status = dcerpc_binding_handle_call_recv(subreq);
12309 TALLOC_FREE(subreq);
12310 if (tevent_req_nterror(req, status)) {
12314 tevent_req_done(req);
12317 NTSTATUS dcerpc_spoolss_SetPort_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
12319 struct dcerpc_spoolss_SetPort_r_state *state =
12320 tevent_req_data(req,
12321 struct dcerpc_spoolss_SetPort_r_state);
12324 if (tevent_req_is_nterror(req, &status)) {
12325 tevent_req_received(req);
12329 talloc_steal(mem_ctx, state->out_mem_ctx);
12331 tevent_req_received(req);
12332 return NT_STATUS_OK;
12335 NTSTATUS dcerpc_spoolss_SetPort_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_SetPort *r)
12339 status = dcerpc_binding_handle_call(h,
12340 NULL, &ndr_table_spoolss,
12341 NDR_SPOOLSS_SETPORT, mem_ctx, r);
12346 struct dcerpc_spoolss_SetPort_state {
12347 struct spoolss_SetPort orig;
12348 struct spoolss_SetPort tmp;
12349 TALLOC_CTX *out_mem_ctx;
12352 static void dcerpc_spoolss_SetPort_done(struct tevent_req *subreq);
12354 struct tevent_req *dcerpc_spoolss_SetPort_send(TALLOC_CTX *mem_ctx,
12355 struct tevent_context *ev,
12356 struct dcerpc_binding_handle *h,
12357 const char *_servername /* [in] [unique,charset(UTF16)] */,
12358 const char *_port_name /* [in] [unique,charset(UTF16)] */,
12359 struct spoolss_SetPortInfoContainer *_port_ctr /* [in] [ref] */)
12361 struct tevent_req *req;
12362 struct dcerpc_spoolss_SetPort_state *state;
12363 struct tevent_req *subreq;
12365 req = tevent_req_create(mem_ctx, &state,
12366 struct dcerpc_spoolss_SetPort_state);
12370 state->out_mem_ctx = NULL;
12372 /* In parameters */
12373 state->orig.in.servername = _servername;
12374 state->orig.in.port_name = _port_name;
12375 state->orig.in.port_ctr = _port_ctr;
12377 /* Out parameters */
12380 ZERO_STRUCT(state->orig.out.result);
12382 /* make a temporary copy, that we pass to the dispatch function */
12383 state->tmp = state->orig;
12385 subreq = dcerpc_spoolss_SetPort_r_send(state, ev, h, &state->tmp);
12386 if (tevent_req_nomem(subreq, req)) {
12387 return tevent_req_post(req, ev);
12389 tevent_req_set_callback(subreq, dcerpc_spoolss_SetPort_done, req);
12393 static void dcerpc_spoolss_SetPort_done(struct tevent_req *subreq)
12395 struct tevent_req *req = tevent_req_callback_data(
12396 subreq, struct tevent_req);
12397 struct dcerpc_spoolss_SetPort_state *state = tevent_req_data(
12398 req, struct dcerpc_spoolss_SetPort_state);
12400 TALLOC_CTX *mem_ctx;
12402 if (state->out_mem_ctx) {
12403 mem_ctx = state->out_mem_ctx;
12408 status = dcerpc_spoolss_SetPort_r_recv(subreq, mem_ctx);
12409 TALLOC_FREE(subreq);
12410 if (tevent_req_nterror(req, status)) {
12414 /* Copy out parameters */
12417 state->orig.out.result = state->tmp.out.result;
12419 /* Reset temporary structure */
12420 ZERO_STRUCT(state->tmp);
12422 tevent_req_done(req);
12425 NTSTATUS dcerpc_spoolss_SetPort_recv(struct tevent_req *req,
12426 TALLOC_CTX *mem_ctx,
12429 struct dcerpc_spoolss_SetPort_state *state = tevent_req_data(
12430 req, struct dcerpc_spoolss_SetPort_state);
12433 if (tevent_req_is_nterror(req, &status)) {
12434 tevent_req_received(req);
12438 /* Steal possible out parameters to the callers context */
12439 talloc_steal(mem_ctx, state->out_mem_ctx);
12441 /* Return result */
12442 *result = state->orig.out.result;
12444 tevent_req_received(req);
12445 return NT_STATUS_OK;
12448 NTSTATUS dcerpc_spoolss_SetPort(struct dcerpc_binding_handle *h,
12449 TALLOC_CTX *mem_ctx,
12450 const char *_servername /* [in] [unique,charset(UTF16)] */,
12451 const char *_port_name /* [in] [unique,charset(UTF16)] */,
12452 struct spoolss_SetPortInfoContainer *_port_ctr /* [in] [ref] */,
12455 struct spoolss_SetPort r;
12458 /* In parameters */
12459 r.in.servername = _servername;
12460 r.in.port_name = _port_name;
12461 r.in.port_ctr = _port_ctr;
12463 status = dcerpc_spoolss_SetPort_r(h, mem_ctx, &r);
12464 if (!NT_STATUS_IS_OK(status)) {
12468 /* Return variables */
12470 /* Return result */
12471 *result = r.out.result;
12473 return NT_STATUS_OK;
12476 struct dcerpc_spoolss_EnumPrinterData_r_state {
12477 TALLOC_CTX *out_mem_ctx;
12480 static void dcerpc_spoolss_EnumPrinterData_r_done(struct tevent_req *subreq);
12482 struct tevent_req *dcerpc_spoolss_EnumPrinterData_r_send(TALLOC_CTX *mem_ctx,
12483 struct tevent_context *ev,
12484 struct dcerpc_binding_handle *h,
12485 struct spoolss_EnumPrinterData *r)
12487 struct tevent_req *req;
12488 struct dcerpc_spoolss_EnumPrinterData_r_state *state;
12489 struct tevent_req *subreq;
12491 req = tevent_req_create(mem_ctx, &state,
12492 struct dcerpc_spoolss_EnumPrinterData_r_state);
12497 state->out_mem_ctx = talloc_new(state);
12498 if (tevent_req_nomem(state->out_mem_ctx, req)) {
12499 return tevent_req_post(req, ev);
12502 subreq = dcerpc_binding_handle_call_send(state, ev, h,
12503 NULL, &ndr_table_spoolss,
12504 NDR_SPOOLSS_ENUMPRINTERDATA, state->out_mem_ctx, r);
12505 if (tevent_req_nomem(subreq, req)) {
12506 return tevent_req_post(req, ev);
12508 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterData_r_done, req);
12513 static void dcerpc_spoolss_EnumPrinterData_r_done(struct tevent_req *subreq)
12515 struct tevent_req *req =
12516 tevent_req_callback_data(subreq,
12517 struct tevent_req);
12520 status = dcerpc_binding_handle_call_recv(subreq);
12521 TALLOC_FREE(subreq);
12522 if (tevent_req_nterror(req, status)) {
12526 tevent_req_done(req);
12529 NTSTATUS dcerpc_spoolss_EnumPrinterData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
12531 struct dcerpc_spoolss_EnumPrinterData_r_state *state =
12532 tevent_req_data(req,
12533 struct dcerpc_spoolss_EnumPrinterData_r_state);
12536 if (tevent_req_is_nterror(req, &status)) {
12537 tevent_req_received(req);
12541 talloc_steal(mem_ctx, state->out_mem_ctx);
12543 tevent_req_received(req);
12544 return NT_STATUS_OK;
12547 NTSTATUS dcerpc_spoolss_EnumPrinterData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrinterData *r)
12551 status = dcerpc_binding_handle_call(h,
12552 NULL, &ndr_table_spoolss,
12553 NDR_SPOOLSS_ENUMPRINTERDATA, mem_ctx, r);
12558 struct dcerpc_spoolss_EnumPrinterData_state {
12559 struct spoolss_EnumPrinterData orig;
12560 struct spoolss_EnumPrinterData tmp;
12561 TALLOC_CTX *out_mem_ctx;
12564 static void dcerpc_spoolss_EnumPrinterData_done(struct tevent_req *subreq);
12566 struct tevent_req *dcerpc_spoolss_EnumPrinterData_send(TALLOC_CTX *mem_ctx,
12567 struct tevent_context *ev,
12568 struct dcerpc_binding_handle *h,
12569 struct policy_handle *_handle /* [in] [ref] */,
12570 uint32_t _enum_index /* [in] */,
12571 const char *_value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
12572 uint32_t _value_offered /* [in] */,
12573 uint32_t *_value_needed /* [out] [ref] */,
12574 enum winreg_Type *_type /* [out] [ref] */,
12575 uint8_t *_data /* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */,
12576 uint32_t _data_offered /* [in] */,
12577 uint32_t *_data_needed /* [out] [ref] */)
12579 struct tevent_req *req;
12580 struct dcerpc_spoolss_EnumPrinterData_state *state;
12581 struct tevent_req *subreq;
12583 req = tevent_req_create(mem_ctx, &state,
12584 struct dcerpc_spoolss_EnumPrinterData_state);
12588 state->out_mem_ctx = NULL;
12590 /* In parameters */
12591 state->orig.in.handle = _handle;
12592 state->orig.in.enum_index = _enum_index;
12593 state->orig.in.value_offered = _value_offered;
12594 state->orig.in.data_offered = _data_offered;
12596 /* Out parameters */
12597 state->orig.out.value_name = _value_name;
12598 state->orig.out.value_needed = _value_needed;
12599 state->orig.out.type = _type;
12600 state->orig.out.data = _data;
12601 state->orig.out.data_needed = _data_needed;
12604 ZERO_STRUCT(state->orig.out.result);
12606 state->out_mem_ctx = talloc_named_const(state, 0,
12607 "dcerpc_spoolss_EnumPrinterData_out_memory");
12608 if (tevent_req_nomem(state->out_mem_ctx, req)) {
12609 return tevent_req_post(req, ev);
12612 /* make a temporary copy, that we pass to the dispatch function */
12613 state->tmp = state->orig;
12615 subreq = dcerpc_spoolss_EnumPrinterData_r_send(state, ev, h, &state->tmp);
12616 if (tevent_req_nomem(subreq, req)) {
12617 return tevent_req_post(req, ev);
12619 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterData_done, req);
12623 static void dcerpc_spoolss_EnumPrinterData_done(struct tevent_req *subreq)
12625 struct tevent_req *req = tevent_req_callback_data(
12626 subreq, struct tevent_req);
12627 struct dcerpc_spoolss_EnumPrinterData_state *state = tevent_req_data(
12628 req, struct dcerpc_spoolss_EnumPrinterData_state);
12630 TALLOC_CTX *mem_ctx;
12632 if (state->out_mem_ctx) {
12633 mem_ctx = state->out_mem_ctx;
12638 status = dcerpc_spoolss_EnumPrinterData_r_recv(subreq, mem_ctx);
12639 TALLOC_FREE(subreq);
12640 if (tevent_req_nterror(req, status)) {
12644 /* Copy out parameters */
12646 size_t _copy_len_value_name;
12647 _copy_len_value_name = ndr_charset_length(state->tmp.out.value_name, CH_UNIX);
12648 if (_copy_len_value_name > state->tmp.in.value_offered / 2) {
12649 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
12652 memcpy(discard_const_p(uint8_t *, state->orig.out.value_name), state->tmp.out.value_name, _copy_len_value_name * sizeof(*state->orig.out.value_name));
12654 *state->orig.out.value_needed = *state->tmp.out.value_needed;
12655 *state->orig.out.type = *state->tmp.out.type;
12657 size_t _copy_len_data;
12658 _copy_len_data = state->tmp.in.data_offered;
12659 memcpy(state->orig.out.data, state->tmp.out.data, _copy_len_data * sizeof(*state->orig.out.data));
12661 *state->orig.out.data_needed = *state->tmp.out.data_needed;
12664 state->orig.out.result = state->tmp.out.result;
12666 /* Reset temporary structure */
12667 ZERO_STRUCT(state->tmp);
12669 tevent_req_done(req);
12672 NTSTATUS dcerpc_spoolss_EnumPrinterData_recv(struct tevent_req *req,
12673 TALLOC_CTX *mem_ctx,
12676 struct dcerpc_spoolss_EnumPrinterData_state *state = tevent_req_data(
12677 req, struct dcerpc_spoolss_EnumPrinterData_state);
12680 if (tevent_req_is_nterror(req, &status)) {
12681 tevent_req_received(req);
12685 /* Steal possible out parameters to the callers context */
12686 talloc_steal(mem_ctx, state->out_mem_ctx);
12688 /* Return result */
12689 *result = state->orig.out.result;
12691 tevent_req_received(req);
12692 return NT_STATUS_OK;
12695 NTSTATUS dcerpc_spoolss_EnumPrinterData(struct dcerpc_binding_handle *h,
12696 TALLOC_CTX *mem_ctx,
12697 struct policy_handle *_handle /* [in] [ref] */,
12698 uint32_t _enum_index /* [in] */,
12699 const char *_value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
12700 uint32_t _value_offered /* [in] */,
12701 uint32_t *_value_needed /* [out] [ref] */,
12702 enum winreg_Type *_type /* [out] [ref] */,
12703 uint8_t *_data /* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */,
12704 uint32_t _data_offered /* [in] */,
12705 uint32_t *_data_needed /* [out] [ref] */,
12708 struct spoolss_EnumPrinterData r;
12711 /* In parameters */
12712 r.in.handle = _handle;
12713 r.in.enum_index = _enum_index;
12714 r.in.value_offered = _value_offered;
12715 r.in.data_offered = _data_offered;
12717 status = dcerpc_spoolss_EnumPrinterData_r(h, mem_ctx, &r);
12718 if (!NT_STATUS_IS_OK(status)) {
12722 /* Return variables */
12724 size_t _copy_len_value_name;
12725 _copy_len_value_name = ndr_charset_length(r.out.value_name, CH_UNIX);
12726 if (_copy_len_value_name > r.in.value_offered / 2) {
12727 return NT_STATUS_INVALID_NETWORK_RESPONSE;
12729 memcpy(discard_const_p(uint8_t *, _value_name), r.out.value_name, _copy_len_value_name * sizeof(*_value_name));
12731 *_value_needed = *r.out.value_needed;
12732 *_type = *r.out.type;
12734 size_t _copy_len_data;
12735 _copy_len_data = r.in.data_offered;
12736 memcpy(_data, r.out.data, _copy_len_data * sizeof(*_data));
12738 *_data_needed = *r.out.data_needed;
12740 /* Return result */
12741 *result = r.out.result;
12743 return NT_STATUS_OK;
12746 struct dcerpc_spoolss_DeletePrinterData_r_state {
12747 TALLOC_CTX *out_mem_ctx;
12750 static void dcerpc_spoolss_DeletePrinterData_r_done(struct tevent_req *subreq);
12752 struct tevent_req *dcerpc_spoolss_DeletePrinterData_r_send(TALLOC_CTX *mem_ctx,
12753 struct tevent_context *ev,
12754 struct dcerpc_binding_handle *h,
12755 struct spoolss_DeletePrinterData *r)
12757 struct tevent_req *req;
12758 struct dcerpc_spoolss_DeletePrinterData_r_state *state;
12759 struct tevent_req *subreq;
12761 req = tevent_req_create(mem_ctx, &state,
12762 struct dcerpc_spoolss_DeletePrinterData_r_state);
12767 state->out_mem_ctx = NULL;
12769 subreq = dcerpc_binding_handle_call_send(state, ev, h,
12770 NULL, &ndr_table_spoolss,
12771 NDR_SPOOLSS_DELETEPRINTERDATA, state, r);
12772 if (tevent_req_nomem(subreq, req)) {
12773 return tevent_req_post(req, ev);
12775 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterData_r_done, req);
12780 static void dcerpc_spoolss_DeletePrinterData_r_done(struct tevent_req *subreq)
12782 struct tevent_req *req =
12783 tevent_req_callback_data(subreq,
12784 struct tevent_req);
12787 status = dcerpc_binding_handle_call_recv(subreq);
12788 TALLOC_FREE(subreq);
12789 if (tevent_req_nterror(req, status)) {
12793 tevent_req_done(req);
12796 NTSTATUS dcerpc_spoolss_DeletePrinterData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
12798 struct dcerpc_spoolss_DeletePrinterData_r_state *state =
12799 tevent_req_data(req,
12800 struct dcerpc_spoolss_DeletePrinterData_r_state);
12803 if (tevent_req_is_nterror(req, &status)) {
12804 tevent_req_received(req);
12808 talloc_steal(mem_ctx, state->out_mem_ctx);
12810 tevent_req_received(req);
12811 return NT_STATUS_OK;
12814 NTSTATUS dcerpc_spoolss_DeletePrinterData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinterData *r)
12818 status = dcerpc_binding_handle_call(h,
12819 NULL, &ndr_table_spoolss,
12820 NDR_SPOOLSS_DELETEPRINTERDATA, mem_ctx, r);
12825 struct dcerpc_spoolss_DeletePrinterData_state {
12826 struct spoolss_DeletePrinterData orig;
12827 struct spoolss_DeletePrinterData tmp;
12828 TALLOC_CTX *out_mem_ctx;
12831 static void dcerpc_spoolss_DeletePrinterData_done(struct tevent_req *subreq);
12833 struct tevent_req *dcerpc_spoolss_DeletePrinterData_send(TALLOC_CTX *mem_ctx,
12834 struct tevent_context *ev,
12835 struct dcerpc_binding_handle *h,
12836 struct policy_handle *_handle /* [in] [ref] */,
12837 const char *_value_name /* [in] [charset(UTF16)] */)
12839 struct tevent_req *req;
12840 struct dcerpc_spoolss_DeletePrinterData_state *state;
12841 struct tevent_req *subreq;
12843 req = tevent_req_create(mem_ctx, &state,
12844 struct dcerpc_spoolss_DeletePrinterData_state);
12848 state->out_mem_ctx = NULL;
12850 /* In parameters */
12851 state->orig.in.handle = _handle;
12852 state->orig.in.value_name = _value_name;
12854 /* Out parameters */
12857 ZERO_STRUCT(state->orig.out.result);
12859 /* make a temporary copy, that we pass to the dispatch function */
12860 state->tmp = state->orig;
12862 subreq = dcerpc_spoolss_DeletePrinterData_r_send(state, ev, h, &state->tmp);
12863 if (tevent_req_nomem(subreq, req)) {
12864 return tevent_req_post(req, ev);
12866 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterData_done, req);
12870 static void dcerpc_spoolss_DeletePrinterData_done(struct tevent_req *subreq)
12872 struct tevent_req *req = tevent_req_callback_data(
12873 subreq, struct tevent_req);
12874 struct dcerpc_spoolss_DeletePrinterData_state *state = tevent_req_data(
12875 req, struct dcerpc_spoolss_DeletePrinterData_state);
12877 TALLOC_CTX *mem_ctx;
12879 if (state->out_mem_ctx) {
12880 mem_ctx = state->out_mem_ctx;
12885 status = dcerpc_spoolss_DeletePrinterData_r_recv(subreq, mem_ctx);
12886 TALLOC_FREE(subreq);
12887 if (tevent_req_nterror(req, status)) {
12891 /* Copy out parameters */
12894 state->orig.out.result = state->tmp.out.result;
12896 /* Reset temporary structure */
12897 ZERO_STRUCT(state->tmp);
12899 tevent_req_done(req);
12902 NTSTATUS dcerpc_spoolss_DeletePrinterData_recv(struct tevent_req *req,
12903 TALLOC_CTX *mem_ctx,
12906 struct dcerpc_spoolss_DeletePrinterData_state *state = tevent_req_data(
12907 req, struct dcerpc_spoolss_DeletePrinterData_state);
12910 if (tevent_req_is_nterror(req, &status)) {
12911 tevent_req_received(req);
12915 /* Steal possible out parameters to the callers context */
12916 talloc_steal(mem_ctx, state->out_mem_ctx);
12918 /* Return result */
12919 *result = state->orig.out.result;
12921 tevent_req_received(req);
12922 return NT_STATUS_OK;
12925 NTSTATUS dcerpc_spoolss_DeletePrinterData(struct dcerpc_binding_handle *h,
12926 TALLOC_CTX *mem_ctx,
12927 struct policy_handle *_handle /* [in] [ref] */,
12928 const char *_value_name /* [in] [charset(UTF16)] */,
12931 struct spoolss_DeletePrinterData r;
12934 /* In parameters */
12935 r.in.handle = _handle;
12936 r.in.value_name = _value_name;
12938 status = dcerpc_spoolss_DeletePrinterData_r(h, mem_ctx, &r);
12939 if (!NT_STATUS_IS_OK(status)) {
12943 /* Return variables */
12945 /* Return result */
12946 *result = r.out.result;
12948 return NT_STATUS_OK;
12951 struct dcerpc_spoolss_SetPrinterDataEx_r_state {
12952 TALLOC_CTX *out_mem_ctx;
12955 static void dcerpc_spoolss_SetPrinterDataEx_r_done(struct tevent_req *subreq);
12957 struct tevent_req *dcerpc_spoolss_SetPrinterDataEx_r_send(TALLOC_CTX *mem_ctx,
12958 struct tevent_context *ev,
12959 struct dcerpc_binding_handle *h,
12960 struct spoolss_SetPrinterDataEx *r)
12962 struct tevent_req *req;
12963 struct dcerpc_spoolss_SetPrinterDataEx_r_state *state;
12964 struct tevent_req *subreq;
12966 req = tevent_req_create(mem_ctx, &state,
12967 struct dcerpc_spoolss_SetPrinterDataEx_r_state);
12972 state->out_mem_ctx = NULL;
12974 subreq = dcerpc_binding_handle_call_send(state, ev, h,
12975 NULL, &ndr_table_spoolss,
12976 NDR_SPOOLSS_SETPRINTERDATAEX, state, r);
12977 if (tevent_req_nomem(subreq, req)) {
12978 return tevent_req_post(req, ev);
12980 tevent_req_set_callback(subreq, dcerpc_spoolss_SetPrinterDataEx_r_done, req);
12985 static void dcerpc_spoolss_SetPrinterDataEx_r_done(struct tevent_req *subreq)
12987 struct tevent_req *req =
12988 tevent_req_callback_data(subreq,
12989 struct tevent_req);
12992 status = dcerpc_binding_handle_call_recv(subreq);
12993 TALLOC_FREE(subreq);
12994 if (tevent_req_nterror(req, status)) {
12998 tevent_req_done(req);
13001 NTSTATUS dcerpc_spoolss_SetPrinterDataEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
13003 struct dcerpc_spoolss_SetPrinterDataEx_r_state *state =
13004 tevent_req_data(req,
13005 struct dcerpc_spoolss_SetPrinterDataEx_r_state);
13008 if (tevent_req_is_nterror(req, &status)) {
13009 tevent_req_received(req);
13013 talloc_steal(mem_ctx, state->out_mem_ctx);
13015 tevent_req_received(req);
13016 return NT_STATUS_OK;
13019 NTSTATUS dcerpc_spoolss_SetPrinterDataEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_SetPrinterDataEx *r)
13023 status = dcerpc_binding_handle_call(h,
13024 NULL, &ndr_table_spoolss,
13025 NDR_SPOOLSS_SETPRINTERDATAEX, mem_ctx, r);
13030 struct dcerpc_spoolss_SetPrinterDataEx_state {
13031 struct spoolss_SetPrinterDataEx orig;
13032 struct spoolss_SetPrinterDataEx tmp;
13033 TALLOC_CTX *out_mem_ctx;
13036 static void dcerpc_spoolss_SetPrinterDataEx_done(struct tevent_req *subreq);
13038 struct tevent_req *dcerpc_spoolss_SetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
13039 struct tevent_context *ev,
13040 struct dcerpc_binding_handle *h,
13041 struct policy_handle *_handle /* [in] [ref] */,
13042 const char *_key_name /* [in] [charset(UTF16)] */,
13043 const char *_value_name /* [in] [charset(UTF16)] */,
13044 enum winreg_Type _type /* [in] */,
13045 uint8_t *_data /* [in] [ref,size_is(offered)] */,
13046 uint32_t _offered /* [in] */)
13048 struct tevent_req *req;
13049 struct dcerpc_spoolss_SetPrinterDataEx_state *state;
13050 struct tevent_req *subreq;
13052 req = tevent_req_create(mem_ctx, &state,
13053 struct dcerpc_spoolss_SetPrinterDataEx_state);
13057 state->out_mem_ctx = NULL;
13059 /* In parameters */
13060 state->orig.in.handle = _handle;
13061 state->orig.in.key_name = _key_name;
13062 state->orig.in.value_name = _value_name;
13063 state->orig.in.type = _type;
13064 state->orig.in.data = _data;
13065 state->orig.in.offered = _offered;
13067 /* Out parameters */
13070 ZERO_STRUCT(state->orig.out.result);
13072 /* make a temporary copy, that we pass to the dispatch function */
13073 state->tmp = state->orig;
13075 subreq = dcerpc_spoolss_SetPrinterDataEx_r_send(state, ev, h, &state->tmp);
13076 if (tevent_req_nomem(subreq, req)) {
13077 return tevent_req_post(req, ev);
13079 tevent_req_set_callback(subreq, dcerpc_spoolss_SetPrinterDataEx_done, req);
13083 static void dcerpc_spoolss_SetPrinterDataEx_done(struct tevent_req *subreq)
13085 struct tevent_req *req = tevent_req_callback_data(
13086 subreq, struct tevent_req);
13087 struct dcerpc_spoolss_SetPrinterDataEx_state *state = tevent_req_data(
13088 req, struct dcerpc_spoolss_SetPrinterDataEx_state);
13090 TALLOC_CTX *mem_ctx;
13092 if (state->out_mem_ctx) {
13093 mem_ctx = state->out_mem_ctx;
13098 status = dcerpc_spoolss_SetPrinterDataEx_r_recv(subreq, mem_ctx);
13099 TALLOC_FREE(subreq);
13100 if (tevent_req_nterror(req, status)) {
13104 /* Copy out parameters */
13107 state->orig.out.result = state->tmp.out.result;
13109 /* Reset temporary structure */
13110 ZERO_STRUCT(state->tmp);
13112 tevent_req_done(req);
13115 NTSTATUS dcerpc_spoolss_SetPrinterDataEx_recv(struct tevent_req *req,
13116 TALLOC_CTX *mem_ctx,
13119 struct dcerpc_spoolss_SetPrinterDataEx_state *state = tevent_req_data(
13120 req, struct dcerpc_spoolss_SetPrinterDataEx_state);
13123 if (tevent_req_is_nterror(req, &status)) {
13124 tevent_req_received(req);
13128 /* Steal possible out parameters to the callers context */
13129 talloc_steal(mem_ctx, state->out_mem_ctx);
13131 /* Return result */
13132 *result = state->orig.out.result;
13134 tevent_req_received(req);
13135 return NT_STATUS_OK;
13138 NTSTATUS dcerpc_spoolss_SetPrinterDataEx(struct dcerpc_binding_handle *h,
13139 TALLOC_CTX *mem_ctx,
13140 struct policy_handle *_handle /* [in] [ref] */,
13141 const char *_key_name /* [in] [charset(UTF16)] */,
13142 const char *_value_name /* [in] [charset(UTF16)] */,
13143 enum winreg_Type _type /* [in] */,
13144 uint8_t *_data /* [in] [ref,size_is(offered)] */,
13145 uint32_t _offered /* [in] */,
13148 struct spoolss_SetPrinterDataEx r;
13151 /* In parameters */
13152 r.in.handle = _handle;
13153 r.in.key_name = _key_name;
13154 r.in.value_name = _value_name;
13157 r.in.offered = _offered;
13159 status = dcerpc_spoolss_SetPrinterDataEx_r(h, mem_ctx, &r);
13160 if (!NT_STATUS_IS_OK(status)) {
13164 /* Return variables */
13166 /* Return result */
13167 *result = r.out.result;
13169 return NT_STATUS_OK;
13172 struct dcerpc_spoolss_GetPrinterDataEx_r_state {
13173 TALLOC_CTX *out_mem_ctx;
13176 static void dcerpc_spoolss_GetPrinterDataEx_r_done(struct tevent_req *subreq);
13178 struct tevent_req *dcerpc_spoolss_GetPrinterDataEx_r_send(TALLOC_CTX *mem_ctx,
13179 struct tevent_context *ev,
13180 struct dcerpc_binding_handle *h,
13181 struct spoolss_GetPrinterDataEx *r)
13183 struct tevent_req *req;
13184 struct dcerpc_spoolss_GetPrinterDataEx_r_state *state;
13185 struct tevent_req *subreq;
13187 req = tevent_req_create(mem_ctx, &state,
13188 struct dcerpc_spoolss_GetPrinterDataEx_r_state);
13193 state->out_mem_ctx = talloc_new(state);
13194 if (tevent_req_nomem(state->out_mem_ctx, req)) {
13195 return tevent_req_post(req, ev);
13198 subreq = dcerpc_binding_handle_call_send(state, ev, h,
13199 NULL, &ndr_table_spoolss,
13200 NDR_SPOOLSS_GETPRINTERDATAEX, state->out_mem_ctx, r);
13201 if (tevent_req_nomem(subreq, req)) {
13202 return tevent_req_post(req, ev);
13204 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDataEx_r_done, req);
13209 static void dcerpc_spoolss_GetPrinterDataEx_r_done(struct tevent_req *subreq)
13211 struct tevent_req *req =
13212 tevent_req_callback_data(subreq,
13213 struct tevent_req);
13216 status = dcerpc_binding_handle_call_recv(subreq);
13217 TALLOC_FREE(subreq);
13218 if (tevent_req_nterror(req, status)) {
13222 tevent_req_done(req);
13225 NTSTATUS dcerpc_spoolss_GetPrinterDataEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
13227 struct dcerpc_spoolss_GetPrinterDataEx_r_state *state =
13228 tevent_req_data(req,
13229 struct dcerpc_spoolss_GetPrinterDataEx_r_state);
13232 if (tevent_req_is_nterror(req, &status)) {
13233 tevent_req_received(req);
13237 talloc_steal(mem_ctx, state->out_mem_ctx);
13239 tevent_req_received(req);
13240 return NT_STATUS_OK;
13243 NTSTATUS dcerpc_spoolss_GetPrinterDataEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetPrinterDataEx *r)
13247 status = dcerpc_binding_handle_call(h,
13248 NULL, &ndr_table_spoolss,
13249 NDR_SPOOLSS_GETPRINTERDATAEX, mem_ctx, r);
13254 struct dcerpc_spoolss_GetPrinterDataEx_state {
13255 struct spoolss_GetPrinterDataEx orig;
13256 struct spoolss_GetPrinterDataEx tmp;
13257 TALLOC_CTX *out_mem_ctx;
13260 static void dcerpc_spoolss_GetPrinterDataEx_done(struct tevent_req *subreq);
13262 struct tevent_req *dcerpc_spoolss_GetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
13263 struct tevent_context *ev,
13264 struct dcerpc_binding_handle *h,
13265 struct policy_handle *_handle /* [in] [ref] */,
13266 const char *_key_name /* [in] [charset(UTF16)] */,
13267 const char *_value_name /* [in] [charset(UTF16)] */,
13268 enum winreg_Type *_type /* [out] [ref] */,
13269 uint8_t *_data /* [out] [ref,size_is(offered)] */,
13270 uint32_t _offered /* [in] */,
13271 uint32_t *_needed /* [out] [ref] */)
13273 struct tevent_req *req;
13274 struct dcerpc_spoolss_GetPrinterDataEx_state *state;
13275 struct tevent_req *subreq;
13277 req = tevent_req_create(mem_ctx, &state,
13278 struct dcerpc_spoolss_GetPrinterDataEx_state);
13282 state->out_mem_ctx = NULL;
13284 /* In parameters */
13285 state->orig.in.handle = _handle;
13286 state->orig.in.key_name = _key_name;
13287 state->orig.in.value_name = _value_name;
13288 state->orig.in.offered = _offered;
13290 /* Out parameters */
13291 state->orig.out.type = _type;
13292 state->orig.out.data = _data;
13293 state->orig.out.needed = _needed;
13296 ZERO_STRUCT(state->orig.out.result);
13298 state->out_mem_ctx = talloc_named_const(state, 0,
13299 "dcerpc_spoolss_GetPrinterDataEx_out_memory");
13300 if (tevent_req_nomem(state->out_mem_ctx, req)) {
13301 return tevent_req_post(req, ev);
13304 /* make a temporary copy, that we pass to the dispatch function */
13305 state->tmp = state->orig;
13307 subreq = dcerpc_spoolss_GetPrinterDataEx_r_send(state, ev, h, &state->tmp);
13308 if (tevent_req_nomem(subreq, req)) {
13309 return tevent_req_post(req, ev);
13311 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDataEx_done, req);
13315 static void dcerpc_spoolss_GetPrinterDataEx_done(struct tevent_req *subreq)
13317 struct tevent_req *req = tevent_req_callback_data(
13318 subreq, struct tevent_req);
13319 struct dcerpc_spoolss_GetPrinterDataEx_state *state = tevent_req_data(
13320 req, struct dcerpc_spoolss_GetPrinterDataEx_state);
13322 TALLOC_CTX *mem_ctx;
13324 if (state->out_mem_ctx) {
13325 mem_ctx = state->out_mem_ctx;
13330 status = dcerpc_spoolss_GetPrinterDataEx_r_recv(subreq, mem_ctx);
13331 TALLOC_FREE(subreq);
13332 if (tevent_req_nterror(req, status)) {
13336 /* Copy out parameters */
13337 *state->orig.out.type = *state->tmp.out.type;
13339 size_t _copy_len_data;
13340 _copy_len_data = state->tmp.in.offered;
13341 memcpy(state->orig.out.data, state->tmp.out.data, _copy_len_data * sizeof(*state->orig.out.data));
13343 *state->orig.out.needed = *state->tmp.out.needed;
13346 state->orig.out.result = state->tmp.out.result;
13348 /* Reset temporary structure */
13349 ZERO_STRUCT(state->tmp);
13351 tevent_req_done(req);
13354 NTSTATUS dcerpc_spoolss_GetPrinterDataEx_recv(struct tevent_req *req,
13355 TALLOC_CTX *mem_ctx,
13358 struct dcerpc_spoolss_GetPrinterDataEx_state *state = tevent_req_data(
13359 req, struct dcerpc_spoolss_GetPrinterDataEx_state);
13362 if (tevent_req_is_nterror(req, &status)) {
13363 tevent_req_received(req);
13367 /* Steal possible out parameters to the callers context */
13368 talloc_steal(mem_ctx, state->out_mem_ctx);
13370 /* Return result */
13371 *result = state->orig.out.result;
13373 tevent_req_received(req);
13374 return NT_STATUS_OK;
13377 NTSTATUS dcerpc_spoolss_GetPrinterDataEx(struct dcerpc_binding_handle *h,
13378 TALLOC_CTX *mem_ctx,
13379 struct policy_handle *_handle /* [in] [ref] */,
13380 const char *_key_name /* [in] [charset(UTF16)] */,
13381 const char *_value_name /* [in] [charset(UTF16)] */,
13382 enum winreg_Type *_type /* [out] [ref] */,
13383 uint8_t *_data /* [out] [ref,size_is(offered)] */,
13384 uint32_t _offered /* [in] */,
13385 uint32_t *_needed /* [out] [ref] */,
13388 struct spoolss_GetPrinterDataEx r;
13391 /* In parameters */
13392 r.in.handle = _handle;
13393 r.in.key_name = _key_name;
13394 r.in.value_name = _value_name;
13395 r.in.offered = _offered;
13397 status = dcerpc_spoolss_GetPrinterDataEx_r(h, mem_ctx, &r);
13398 if (!NT_STATUS_IS_OK(status)) {
13402 /* Return variables */
13403 *_type = *r.out.type;
13405 size_t _copy_len_data;
13406 _copy_len_data = r.in.offered;
13407 memcpy(_data, r.out.data, _copy_len_data * sizeof(*_data));
13409 *_needed = *r.out.needed;
13411 /* Return result */
13412 *result = r.out.result;
13414 return NT_STATUS_OK;
13417 struct dcerpc_spoolss_EnumPrinterDataEx_r_state {
13418 TALLOC_CTX *out_mem_ctx;
13421 static void dcerpc_spoolss_EnumPrinterDataEx_r_done(struct tevent_req *subreq);
13423 struct tevent_req *dcerpc_spoolss_EnumPrinterDataEx_r_send(TALLOC_CTX *mem_ctx,
13424 struct tevent_context *ev,
13425 struct dcerpc_binding_handle *h,
13426 struct spoolss_EnumPrinterDataEx *r)
13428 struct tevent_req *req;
13429 struct dcerpc_spoolss_EnumPrinterDataEx_r_state *state;
13430 struct tevent_req *subreq;
13432 req = tevent_req_create(mem_ctx, &state,
13433 struct dcerpc_spoolss_EnumPrinterDataEx_r_state);
13438 state->out_mem_ctx = talloc_new(state);
13439 if (tevent_req_nomem(state->out_mem_ctx, req)) {
13440 return tevent_req_post(req, ev);
13443 subreq = dcerpc_binding_handle_call_send(state, ev, h,
13444 NULL, &ndr_table_spoolss,
13445 NDR_SPOOLSS_ENUMPRINTERDATAEX, state->out_mem_ctx, r);
13446 if (tevent_req_nomem(subreq, req)) {
13447 return tevent_req_post(req, ev);
13449 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterDataEx_r_done, req);
13454 static void dcerpc_spoolss_EnumPrinterDataEx_r_done(struct tevent_req *subreq)
13456 struct tevent_req *req =
13457 tevent_req_callback_data(subreq,
13458 struct tevent_req);
13461 status = dcerpc_binding_handle_call_recv(subreq);
13462 TALLOC_FREE(subreq);
13463 if (tevent_req_nterror(req, status)) {
13467 tevent_req_done(req);
13470 NTSTATUS dcerpc_spoolss_EnumPrinterDataEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
13472 struct dcerpc_spoolss_EnumPrinterDataEx_r_state *state =
13473 tevent_req_data(req,
13474 struct dcerpc_spoolss_EnumPrinterDataEx_r_state);
13477 if (tevent_req_is_nterror(req, &status)) {
13478 tevent_req_received(req);
13482 talloc_steal(mem_ctx, state->out_mem_ctx);
13484 tevent_req_received(req);
13485 return NT_STATUS_OK;
13488 NTSTATUS dcerpc_spoolss_EnumPrinterDataEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrinterDataEx *r)
13492 status = dcerpc_binding_handle_call(h,
13493 NULL, &ndr_table_spoolss,
13494 NDR_SPOOLSS_ENUMPRINTERDATAEX, mem_ctx, r);
13499 struct dcerpc_spoolss_EnumPrinterDataEx_state {
13500 struct spoolss_EnumPrinterDataEx orig;
13501 struct spoolss_EnumPrinterDataEx tmp;
13502 TALLOC_CTX *out_mem_ctx;
13505 static void dcerpc_spoolss_EnumPrinterDataEx_done(struct tevent_req *subreq);
13507 struct tevent_req *dcerpc_spoolss_EnumPrinterDataEx_send(TALLOC_CTX *mem_ctx,
13508 struct tevent_context *ev,
13509 struct dcerpc_binding_handle *h,
13510 struct policy_handle *_handle /* [in] [ref] */,
13511 const char *_key_name /* [in] [charset(UTF16)] */,
13512 uint32_t _offered /* [in] */,
13513 uint32_t *_count /* [out] [ref] */,
13514 struct spoolss_PrinterEnumValues **_info /* [out] [ref,size_is(,*count)] */,
13515 uint32_t *_needed /* [out] [ref] */)
13517 struct tevent_req *req;
13518 struct dcerpc_spoolss_EnumPrinterDataEx_state *state;
13519 struct tevent_req *subreq;
13521 req = tevent_req_create(mem_ctx, &state,
13522 struct dcerpc_spoolss_EnumPrinterDataEx_state);
13526 state->out_mem_ctx = NULL;
13528 /* In parameters */
13529 state->orig.in.handle = _handle;
13530 state->orig.in.key_name = _key_name;
13531 state->orig.in.offered = _offered;
13533 /* Out parameters */
13534 state->orig.out.count = _count;
13535 state->orig.out.info = _info;
13536 state->orig.out.needed = _needed;
13539 ZERO_STRUCT(state->orig.out.result);
13541 state->out_mem_ctx = talloc_named_const(state, 0,
13542 "dcerpc_spoolss_EnumPrinterDataEx_out_memory");
13543 if (tevent_req_nomem(state->out_mem_ctx, req)) {
13544 return tevent_req_post(req, ev);
13547 /* make a temporary copy, that we pass to the dispatch function */
13548 state->tmp = state->orig;
13550 subreq = dcerpc_spoolss_EnumPrinterDataEx_r_send(state, ev, h, &state->tmp);
13551 if (tevent_req_nomem(subreq, req)) {
13552 return tevent_req_post(req, ev);
13554 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterDataEx_done, req);
13558 static void dcerpc_spoolss_EnumPrinterDataEx_done(struct tevent_req *subreq)
13560 struct tevent_req *req = tevent_req_callback_data(
13561 subreq, struct tevent_req);
13562 struct dcerpc_spoolss_EnumPrinterDataEx_state *state = tevent_req_data(
13563 req, struct dcerpc_spoolss_EnumPrinterDataEx_state);
13565 TALLOC_CTX *mem_ctx;
13567 if (state->out_mem_ctx) {
13568 mem_ctx = state->out_mem_ctx;
13573 status = dcerpc_spoolss_EnumPrinterDataEx_r_recv(subreq, mem_ctx);
13574 TALLOC_FREE(subreq);
13575 if (tevent_req_nterror(req, status)) {
13579 /* Copy out parameters */
13580 *state->orig.out.count = *state->tmp.out.count;
13581 *state->orig.out.info = *state->tmp.out.info;
13582 *state->orig.out.needed = *state->tmp.out.needed;
13585 state->orig.out.result = state->tmp.out.result;
13587 /* Reset temporary structure */
13588 ZERO_STRUCT(state->tmp);
13590 tevent_req_done(req);
13593 NTSTATUS dcerpc_spoolss_EnumPrinterDataEx_recv(struct tevent_req *req,
13594 TALLOC_CTX *mem_ctx,
13597 struct dcerpc_spoolss_EnumPrinterDataEx_state *state = tevent_req_data(
13598 req, struct dcerpc_spoolss_EnumPrinterDataEx_state);
13601 if (tevent_req_is_nterror(req, &status)) {
13602 tevent_req_received(req);
13606 /* Steal possible out parameters to the callers context */
13607 talloc_steal(mem_ctx, state->out_mem_ctx);
13609 /* Return result */
13610 *result = state->orig.out.result;
13612 tevent_req_received(req);
13613 return NT_STATUS_OK;
13616 NTSTATUS dcerpc_spoolss_EnumPrinterDataEx(struct dcerpc_binding_handle *h,
13617 TALLOC_CTX *mem_ctx,
13618 struct policy_handle *_handle /* [in] [ref] */,
13619 const char *_key_name /* [in] [charset(UTF16)] */,
13620 uint32_t _offered /* [in] */,
13621 uint32_t *_count /* [out] [ref] */,
13622 struct spoolss_PrinterEnumValues **_info /* [out] [ref,size_is(,*count)] */,
13623 uint32_t *_needed /* [out] [ref] */,
13626 struct spoolss_EnumPrinterDataEx r;
13629 /* In parameters */
13630 r.in.handle = _handle;
13631 r.in.key_name = _key_name;
13632 r.in.offered = _offered;
13634 status = dcerpc_spoolss_EnumPrinterDataEx_r(h, mem_ctx, &r);
13635 if (!NT_STATUS_IS_OK(status)) {
13639 /* Return variables */
13640 *_count = *r.out.count;
13641 *_info = *r.out.info;
13642 *_needed = *r.out.needed;
13644 /* Return result */
13645 *result = r.out.result;
13647 return NT_STATUS_OK;
13650 struct dcerpc_spoolss_EnumPrinterKey_r_state {
13651 TALLOC_CTX *out_mem_ctx;
13654 static void dcerpc_spoolss_EnumPrinterKey_r_done(struct tevent_req *subreq);
13656 struct tevent_req *dcerpc_spoolss_EnumPrinterKey_r_send(TALLOC_CTX *mem_ctx,
13657 struct tevent_context *ev,
13658 struct dcerpc_binding_handle *h,
13659 struct spoolss_EnumPrinterKey *r)
13661 struct tevent_req *req;
13662 struct dcerpc_spoolss_EnumPrinterKey_r_state *state;
13663 struct tevent_req *subreq;
13665 req = tevent_req_create(mem_ctx, &state,
13666 struct dcerpc_spoolss_EnumPrinterKey_r_state);
13671 state->out_mem_ctx = talloc_new(state);
13672 if (tevent_req_nomem(state->out_mem_ctx, req)) {
13673 return tevent_req_post(req, ev);
13676 subreq = dcerpc_binding_handle_call_send(state, ev, h,
13677 NULL, &ndr_table_spoolss,
13678 NDR_SPOOLSS_ENUMPRINTERKEY, state->out_mem_ctx, r);
13679 if (tevent_req_nomem(subreq, req)) {
13680 return tevent_req_post(req, ev);
13682 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterKey_r_done, req);
13687 static void dcerpc_spoolss_EnumPrinterKey_r_done(struct tevent_req *subreq)
13689 struct tevent_req *req =
13690 tevent_req_callback_data(subreq,
13691 struct tevent_req);
13694 status = dcerpc_binding_handle_call_recv(subreq);
13695 TALLOC_FREE(subreq);
13696 if (tevent_req_nterror(req, status)) {
13700 tevent_req_done(req);
13703 NTSTATUS dcerpc_spoolss_EnumPrinterKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
13705 struct dcerpc_spoolss_EnumPrinterKey_r_state *state =
13706 tevent_req_data(req,
13707 struct dcerpc_spoolss_EnumPrinterKey_r_state);
13710 if (tevent_req_is_nterror(req, &status)) {
13711 tevent_req_received(req);
13715 talloc_steal(mem_ctx, state->out_mem_ctx);
13717 tevent_req_received(req);
13718 return NT_STATUS_OK;
13721 NTSTATUS dcerpc_spoolss_EnumPrinterKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_EnumPrinterKey *r)
13725 status = dcerpc_binding_handle_call(h,
13726 NULL, &ndr_table_spoolss,
13727 NDR_SPOOLSS_ENUMPRINTERKEY, mem_ctx, r);
13732 struct dcerpc_spoolss_EnumPrinterKey_state {
13733 struct spoolss_EnumPrinterKey orig;
13734 struct spoolss_EnumPrinterKey tmp;
13735 TALLOC_CTX *out_mem_ctx;
13738 static void dcerpc_spoolss_EnumPrinterKey_done(struct tevent_req *subreq);
13740 struct tevent_req *dcerpc_spoolss_EnumPrinterKey_send(TALLOC_CTX *mem_ctx,
13741 struct tevent_context *ev,
13742 struct dcerpc_binding_handle *h,
13743 struct policy_handle *_handle /* [in] [ref] */,
13744 const char *_key_name /* [in] [charset(UTF16)] */,
13745 uint32_t *__ndr_size /* [out] [ref] */,
13746 union spoolss_KeyNames *_key_buffer /* [out] [subcontext_size(*_ndr_size*2),ref,subcontext(0),switch_is(*_ndr_size)] */,
13747 uint32_t _offered /* [in] */,
13748 uint32_t *_needed /* [out] [ref] */)
13750 struct tevent_req *req;
13751 struct dcerpc_spoolss_EnumPrinterKey_state *state;
13752 struct tevent_req *subreq;
13754 req = tevent_req_create(mem_ctx, &state,
13755 struct dcerpc_spoolss_EnumPrinterKey_state);
13759 state->out_mem_ctx = NULL;
13761 /* In parameters */
13762 state->orig.in.handle = _handle;
13763 state->orig.in.key_name = _key_name;
13764 state->orig.in.offered = _offered;
13766 /* Out parameters */
13767 state->orig.out._ndr_size = __ndr_size;
13768 state->orig.out.key_buffer = _key_buffer;
13769 state->orig.out.needed = _needed;
13772 ZERO_STRUCT(state->orig.out.result);
13774 state->out_mem_ctx = talloc_named_const(state, 0,
13775 "dcerpc_spoolss_EnumPrinterKey_out_memory");
13776 if (tevent_req_nomem(state->out_mem_ctx, req)) {
13777 return tevent_req_post(req, ev);
13780 /* make a temporary copy, that we pass to the dispatch function */
13781 state->tmp = state->orig;
13783 subreq = dcerpc_spoolss_EnumPrinterKey_r_send(state, ev, h, &state->tmp);
13784 if (tevent_req_nomem(subreq, req)) {
13785 return tevent_req_post(req, ev);
13787 tevent_req_set_callback(subreq, dcerpc_spoolss_EnumPrinterKey_done, req);
13791 static void dcerpc_spoolss_EnumPrinterKey_done(struct tevent_req *subreq)
13793 struct tevent_req *req = tevent_req_callback_data(
13794 subreq, struct tevent_req);
13795 struct dcerpc_spoolss_EnumPrinterKey_state *state = tevent_req_data(
13796 req, struct dcerpc_spoolss_EnumPrinterKey_state);
13798 TALLOC_CTX *mem_ctx;
13800 if (state->out_mem_ctx) {
13801 mem_ctx = state->out_mem_ctx;
13806 status = dcerpc_spoolss_EnumPrinterKey_r_recv(subreq, mem_ctx);
13807 TALLOC_FREE(subreq);
13808 if (tevent_req_nterror(req, status)) {
13812 /* Copy out parameters */
13813 *state->orig.out._ndr_size = *state->tmp.out._ndr_size;
13814 *state->orig.out.key_buffer = *state->tmp.out.key_buffer;
13815 *state->orig.out.needed = *state->tmp.out.needed;
13818 state->orig.out.result = state->tmp.out.result;
13820 /* Reset temporary structure */
13821 ZERO_STRUCT(state->tmp);
13823 tevent_req_done(req);
13826 NTSTATUS dcerpc_spoolss_EnumPrinterKey_recv(struct tevent_req *req,
13827 TALLOC_CTX *mem_ctx,
13830 struct dcerpc_spoolss_EnumPrinterKey_state *state = tevent_req_data(
13831 req, struct dcerpc_spoolss_EnumPrinterKey_state);
13834 if (tevent_req_is_nterror(req, &status)) {
13835 tevent_req_received(req);
13839 /* Steal possible out parameters to the callers context */
13840 talloc_steal(mem_ctx, state->out_mem_ctx);
13842 /* Return result */
13843 *result = state->orig.out.result;
13845 tevent_req_received(req);
13846 return NT_STATUS_OK;
13849 NTSTATUS dcerpc_spoolss_EnumPrinterKey(struct dcerpc_binding_handle *h,
13850 TALLOC_CTX *mem_ctx,
13851 struct policy_handle *_handle /* [in] [ref] */,
13852 const char *_key_name /* [in] [charset(UTF16)] */,
13853 uint32_t *__ndr_size /* [out] [ref] */,
13854 union spoolss_KeyNames *_key_buffer /* [out] [subcontext_size(*_ndr_size*2),ref,subcontext(0),switch_is(*_ndr_size)] */,
13855 uint32_t _offered /* [in] */,
13856 uint32_t *_needed /* [out] [ref] */,
13859 struct spoolss_EnumPrinterKey r;
13862 /* In parameters */
13863 r.in.handle = _handle;
13864 r.in.key_name = _key_name;
13865 r.in.offered = _offered;
13867 status = dcerpc_spoolss_EnumPrinterKey_r(h, mem_ctx, &r);
13868 if (!NT_STATUS_IS_OK(status)) {
13872 /* Return variables */
13873 *__ndr_size = *r.out._ndr_size;
13874 *_key_buffer = *r.out.key_buffer;
13875 *_needed = *r.out.needed;
13877 /* Return result */
13878 *result = r.out.result;
13880 return NT_STATUS_OK;
13883 struct dcerpc_spoolss_DeletePrinterDataEx_r_state {
13884 TALLOC_CTX *out_mem_ctx;
13887 static void dcerpc_spoolss_DeletePrinterDataEx_r_done(struct tevent_req *subreq);
13889 struct tevent_req *dcerpc_spoolss_DeletePrinterDataEx_r_send(TALLOC_CTX *mem_ctx,
13890 struct tevent_context *ev,
13891 struct dcerpc_binding_handle *h,
13892 struct spoolss_DeletePrinterDataEx *r)
13894 struct tevent_req *req;
13895 struct dcerpc_spoolss_DeletePrinterDataEx_r_state *state;
13896 struct tevent_req *subreq;
13898 req = tevent_req_create(mem_ctx, &state,
13899 struct dcerpc_spoolss_DeletePrinterDataEx_r_state);
13904 state->out_mem_ctx = NULL;
13906 subreq = dcerpc_binding_handle_call_send(state, ev, h,
13907 NULL, &ndr_table_spoolss,
13908 NDR_SPOOLSS_DELETEPRINTERDATAEX, state, r);
13909 if (tevent_req_nomem(subreq, req)) {
13910 return tevent_req_post(req, ev);
13912 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterDataEx_r_done, req);
13917 static void dcerpc_spoolss_DeletePrinterDataEx_r_done(struct tevent_req *subreq)
13919 struct tevent_req *req =
13920 tevent_req_callback_data(subreq,
13921 struct tevent_req);
13924 status = dcerpc_binding_handle_call_recv(subreq);
13925 TALLOC_FREE(subreq);
13926 if (tevent_req_nterror(req, status)) {
13930 tevent_req_done(req);
13933 NTSTATUS dcerpc_spoolss_DeletePrinterDataEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
13935 struct dcerpc_spoolss_DeletePrinterDataEx_r_state *state =
13936 tevent_req_data(req,
13937 struct dcerpc_spoolss_DeletePrinterDataEx_r_state);
13940 if (tevent_req_is_nterror(req, &status)) {
13941 tevent_req_received(req);
13945 talloc_steal(mem_ctx, state->out_mem_ctx);
13947 tevent_req_received(req);
13948 return NT_STATUS_OK;
13951 NTSTATUS dcerpc_spoolss_DeletePrinterDataEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinterDataEx *r)
13955 status = dcerpc_binding_handle_call(h,
13956 NULL, &ndr_table_spoolss,
13957 NDR_SPOOLSS_DELETEPRINTERDATAEX, mem_ctx, r);
13962 struct dcerpc_spoolss_DeletePrinterDataEx_state {
13963 struct spoolss_DeletePrinterDataEx orig;
13964 struct spoolss_DeletePrinterDataEx tmp;
13965 TALLOC_CTX *out_mem_ctx;
13968 static void dcerpc_spoolss_DeletePrinterDataEx_done(struct tevent_req *subreq);
13970 struct tevent_req *dcerpc_spoolss_DeletePrinterDataEx_send(TALLOC_CTX *mem_ctx,
13971 struct tevent_context *ev,
13972 struct dcerpc_binding_handle *h,
13973 struct policy_handle *_handle /* [in] [ref] */,
13974 const char *_key_name /* [in] [charset(UTF16)] */,
13975 const char *_value_name /* [in] [charset(UTF16)] */)
13977 struct tevent_req *req;
13978 struct dcerpc_spoolss_DeletePrinterDataEx_state *state;
13979 struct tevent_req *subreq;
13981 req = tevent_req_create(mem_ctx, &state,
13982 struct dcerpc_spoolss_DeletePrinterDataEx_state);
13986 state->out_mem_ctx = NULL;
13988 /* In parameters */
13989 state->orig.in.handle = _handle;
13990 state->orig.in.key_name = _key_name;
13991 state->orig.in.value_name = _value_name;
13993 /* Out parameters */
13996 ZERO_STRUCT(state->orig.out.result);
13998 /* make a temporary copy, that we pass to the dispatch function */
13999 state->tmp = state->orig;
14001 subreq = dcerpc_spoolss_DeletePrinterDataEx_r_send(state, ev, h, &state->tmp);
14002 if (tevent_req_nomem(subreq, req)) {
14003 return tevent_req_post(req, ev);
14005 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterDataEx_done, req);
14009 static void dcerpc_spoolss_DeletePrinterDataEx_done(struct tevent_req *subreq)
14011 struct tevent_req *req = tevent_req_callback_data(
14012 subreq, struct tevent_req);
14013 struct dcerpc_spoolss_DeletePrinterDataEx_state *state = tevent_req_data(
14014 req, struct dcerpc_spoolss_DeletePrinterDataEx_state);
14016 TALLOC_CTX *mem_ctx;
14018 if (state->out_mem_ctx) {
14019 mem_ctx = state->out_mem_ctx;
14024 status = dcerpc_spoolss_DeletePrinterDataEx_r_recv(subreq, mem_ctx);
14025 TALLOC_FREE(subreq);
14026 if (tevent_req_nterror(req, status)) {
14030 /* Copy out parameters */
14033 state->orig.out.result = state->tmp.out.result;
14035 /* Reset temporary structure */
14036 ZERO_STRUCT(state->tmp);
14038 tevent_req_done(req);
14041 NTSTATUS dcerpc_spoolss_DeletePrinterDataEx_recv(struct tevent_req *req,
14042 TALLOC_CTX *mem_ctx,
14045 struct dcerpc_spoolss_DeletePrinterDataEx_state *state = tevent_req_data(
14046 req, struct dcerpc_spoolss_DeletePrinterDataEx_state);
14049 if (tevent_req_is_nterror(req, &status)) {
14050 tevent_req_received(req);
14054 /* Steal possible out parameters to the callers context */
14055 talloc_steal(mem_ctx, state->out_mem_ctx);
14057 /* Return result */
14058 *result = state->orig.out.result;
14060 tevent_req_received(req);
14061 return NT_STATUS_OK;
14064 NTSTATUS dcerpc_spoolss_DeletePrinterDataEx(struct dcerpc_binding_handle *h,
14065 TALLOC_CTX *mem_ctx,
14066 struct policy_handle *_handle /* [in] [ref] */,
14067 const char *_key_name /* [in] [charset(UTF16)] */,
14068 const char *_value_name /* [in] [charset(UTF16)] */,
14071 struct spoolss_DeletePrinterDataEx r;
14074 /* In parameters */
14075 r.in.handle = _handle;
14076 r.in.key_name = _key_name;
14077 r.in.value_name = _value_name;
14079 status = dcerpc_spoolss_DeletePrinterDataEx_r(h, mem_ctx, &r);
14080 if (!NT_STATUS_IS_OK(status)) {
14084 /* Return variables */
14086 /* Return result */
14087 *result = r.out.result;
14089 return NT_STATUS_OK;
14092 struct dcerpc_spoolss_DeletePrinterKey_r_state {
14093 TALLOC_CTX *out_mem_ctx;
14096 static void dcerpc_spoolss_DeletePrinterKey_r_done(struct tevent_req *subreq);
14098 struct tevent_req *dcerpc_spoolss_DeletePrinterKey_r_send(TALLOC_CTX *mem_ctx,
14099 struct tevent_context *ev,
14100 struct dcerpc_binding_handle *h,
14101 struct spoolss_DeletePrinterKey *r)
14103 struct tevent_req *req;
14104 struct dcerpc_spoolss_DeletePrinterKey_r_state *state;
14105 struct tevent_req *subreq;
14107 req = tevent_req_create(mem_ctx, &state,
14108 struct dcerpc_spoolss_DeletePrinterKey_r_state);
14113 state->out_mem_ctx = NULL;
14115 subreq = dcerpc_binding_handle_call_send(state, ev, h,
14116 NULL, &ndr_table_spoolss,
14117 NDR_SPOOLSS_DELETEPRINTERKEY, state, r);
14118 if (tevent_req_nomem(subreq, req)) {
14119 return tevent_req_post(req, ev);
14121 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterKey_r_done, req);
14126 static void dcerpc_spoolss_DeletePrinterKey_r_done(struct tevent_req *subreq)
14128 struct tevent_req *req =
14129 tevent_req_callback_data(subreq,
14130 struct tevent_req);
14133 status = dcerpc_binding_handle_call_recv(subreq);
14134 TALLOC_FREE(subreq);
14135 if (tevent_req_nterror(req, status)) {
14139 tevent_req_done(req);
14142 NTSTATUS dcerpc_spoolss_DeletePrinterKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
14144 struct dcerpc_spoolss_DeletePrinterKey_r_state *state =
14145 tevent_req_data(req,
14146 struct dcerpc_spoolss_DeletePrinterKey_r_state);
14149 if (tevent_req_is_nterror(req, &status)) {
14150 tevent_req_received(req);
14154 talloc_steal(mem_ctx, state->out_mem_ctx);
14156 tevent_req_received(req);
14157 return NT_STATUS_OK;
14160 NTSTATUS dcerpc_spoolss_DeletePrinterKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinterKey *r)
14164 status = dcerpc_binding_handle_call(h,
14165 NULL, &ndr_table_spoolss,
14166 NDR_SPOOLSS_DELETEPRINTERKEY, mem_ctx, r);
14171 struct dcerpc_spoolss_DeletePrinterKey_state {
14172 struct spoolss_DeletePrinterKey orig;
14173 struct spoolss_DeletePrinterKey tmp;
14174 TALLOC_CTX *out_mem_ctx;
14177 static void dcerpc_spoolss_DeletePrinterKey_done(struct tevent_req *subreq);
14179 struct tevent_req *dcerpc_spoolss_DeletePrinterKey_send(TALLOC_CTX *mem_ctx,
14180 struct tevent_context *ev,
14181 struct dcerpc_binding_handle *h,
14182 struct policy_handle *_handle /* [in] [ref] */,
14183 const char *_key_name /* [in] [charset(UTF16)] */)
14185 struct tevent_req *req;
14186 struct dcerpc_spoolss_DeletePrinterKey_state *state;
14187 struct tevent_req *subreq;
14189 req = tevent_req_create(mem_ctx, &state,
14190 struct dcerpc_spoolss_DeletePrinterKey_state);
14194 state->out_mem_ctx = NULL;
14196 /* In parameters */
14197 state->orig.in.handle = _handle;
14198 state->orig.in.key_name = _key_name;
14200 /* Out parameters */
14203 ZERO_STRUCT(state->orig.out.result);
14205 /* make a temporary copy, that we pass to the dispatch function */
14206 state->tmp = state->orig;
14208 subreq = dcerpc_spoolss_DeletePrinterKey_r_send(state, ev, h, &state->tmp);
14209 if (tevent_req_nomem(subreq, req)) {
14210 return tevent_req_post(req, ev);
14212 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterKey_done, req);
14216 static void dcerpc_spoolss_DeletePrinterKey_done(struct tevent_req *subreq)
14218 struct tevent_req *req = tevent_req_callback_data(
14219 subreq, struct tevent_req);
14220 struct dcerpc_spoolss_DeletePrinterKey_state *state = tevent_req_data(
14221 req, struct dcerpc_spoolss_DeletePrinterKey_state);
14223 TALLOC_CTX *mem_ctx;
14225 if (state->out_mem_ctx) {
14226 mem_ctx = state->out_mem_ctx;
14231 status = dcerpc_spoolss_DeletePrinterKey_r_recv(subreq, mem_ctx);
14232 TALLOC_FREE(subreq);
14233 if (tevent_req_nterror(req, status)) {
14237 /* Copy out parameters */
14240 state->orig.out.result = state->tmp.out.result;
14242 /* Reset temporary structure */
14243 ZERO_STRUCT(state->tmp);
14245 tevent_req_done(req);
14248 NTSTATUS dcerpc_spoolss_DeletePrinterKey_recv(struct tevent_req *req,
14249 TALLOC_CTX *mem_ctx,
14252 struct dcerpc_spoolss_DeletePrinterKey_state *state = tevent_req_data(
14253 req, struct dcerpc_spoolss_DeletePrinterKey_state);
14256 if (tevent_req_is_nterror(req, &status)) {
14257 tevent_req_received(req);
14261 /* Steal possible out parameters to the callers context */
14262 talloc_steal(mem_ctx, state->out_mem_ctx);
14264 /* Return result */
14265 *result = state->orig.out.result;
14267 tevent_req_received(req);
14268 return NT_STATUS_OK;
14271 NTSTATUS dcerpc_spoolss_DeletePrinterKey(struct dcerpc_binding_handle *h,
14272 TALLOC_CTX *mem_ctx,
14273 struct policy_handle *_handle /* [in] [ref] */,
14274 const char *_key_name /* [in] [charset(UTF16)] */,
14277 struct spoolss_DeletePrinterKey r;
14280 /* In parameters */
14281 r.in.handle = _handle;
14282 r.in.key_name = _key_name;
14284 status = dcerpc_spoolss_DeletePrinterKey_r(h, mem_ctx, &r);
14285 if (!NT_STATUS_IS_OK(status)) {
14289 /* Return variables */
14291 /* Return result */
14292 *result = r.out.result;
14294 return NT_STATUS_OK;
14297 struct dcerpc_spoolss_DeletePrinterDriverEx_r_state {
14298 TALLOC_CTX *out_mem_ctx;
14301 static void dcerpc_spoolss_DeletePrinterDriverEx_r_done(struct tevent_req *subreq);
14303 struct tevent_req *dcerpc_spoolss_DeletePrinterDriverEx_r_send(TALLOC_CTX *mem_ctx,
14304 struct tevent_context *ev,
14305 struct dcerpc_binding_handle *h,
14306 struct spoolss_DeletePrinterDriverEx *r)
14308 struct tevent_req *req;
14309 struct dcerpc_spoolss_DeletePrinterDriverEx_r_state *state;
14310 struct tevent_req *subreq;
14312 req = tevent_req_create(mem_ctx, &state,
14313 struct dcerpc_spoolss_DeletePrinterDriverEx_r_state);
14318 state->out_mem_ctx = NULL;
14320 subreq = dcerpc_binding_handle_call_send(state, ev, h,
14321 NULL, &ndr_table_spoolss,
14322 NDR_SPOOLSS_DELETEPRINTERDRIVEREX, state, r);
14323 if (tevent_req_nomem(subreq, req)) {
14324 return tevent_req_post(req, ev);
14326 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterDriverEx_r_done, req);
14331 static void dcerpc_spoolss_DeletePrinterDriverEx_r_done(struct tevent_req *subreq)
14333 struct tevent_req *req =
14334 tevent_req_callback_data(subreq,
14335 struct tevent_req);
14338 status = dcerpc_binding_handle_call_recv(subreq);
14339 TALLOC_FREE(subreq);
14340 if (tevent_req_nterror(req, status)) {
14344 tevent_req_done(req);
14347 NTSTATUS dcerpc_spoolss_DeletePrinterDriverEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
14349 struct dcerpc_spoolss_DeletePrinterDriverEx_r_state *state =
14350 tevent_req_data(req,
14351 struct dcerpc_spoolss_DeletePrinterDriverEx_r_state);
14354 if (tevent_req_is_nterror(req, &status)) {
14355 tevent_req_received(req);
14359 talloc_steal(mem_ctx, state->out_mem_ctx);
14361 tevent_req_received(req);
14362 return NT_STATUS_OK;
14365 NTSTATUS dcerpc_spoolss_DeletePrinterDriverEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePrinterDriverEx *r)
14369 status = dcerpc_binding_handle_call(h,
14370 NULL, &ndr_table_spoolss,
14371 NDR_SPOOLSS_DELETEPRINTERDRIVEREX, mem_ctx, r);
14376 struct dcerpc_spoolss_DeletePrinterDriverEx_state {
14377 struct spoolss_DeletePrinterDriverEx orig;
14378 struct spoolss_DeletePrinterDriverEx tmp;
14379 TALLOC_CTX *out_mem_ctx;
14382 static void dcerpc_spoolss_DeletePrinterDriverEx_done(struct tevent_req *subreq);
14384 struct tevent_req *dcerpc_spoolss_DeletePrinterDriverEx_send(TALLOC_CTX *mem_ctx,
14385 struct tevent_context *ev,
14386 struct dcerpc_binding_handle *h,
14387 const char *_server /* [in] [unique,charset(UTF16)] */,
14388 const char *_architecture /* [in] [charset(UTF16)] */,
14389 const char *_driver /* [in] [charset(UTF16)] */,
14390 uint32_t _delete_flags /* [in] */,
14391 uint32_t _version /* [in] */)
14393 struct tevent_req *req;
14394 struct dcerpc_spoolss_DeletePrinterDriverEx_state *state;
14395 struct tevent_req *subreq;
14397 req = tevent_req_create(mem_ctx, &state,
14398 struct dcerpc_spoolss_DeletePrinterDriverEx_state);
14402 state->out_mem_ctx = NULL;
14404 /* In parameters */
14405 state->orig.in.server = _server;
14406 state->orig.in.architecture = _architecture;
14407 state->orig.in.driver = _driver;
14408 state->orig.in.delete_flags = _delete_flags;
14409 state->orig.in.version = _version;
14411 /* Out parameters */
14414 ZERO_STRUCT(state->orig.out.result);
14416 /* make a temporary copy, that we pass to the dispatch function */
14417 state->tmp = state->orig;
14419 subreq = dcerpc_spoolss_DeletePrinterDriverEx_r_send(state, ev, h, &state->tmp);
14420 if (tevent_req_nomem(subreq, req)) {
14421 return tevent_req_post(req, ev);
14423 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePrinterDriverEx_done, req);
14427 static void dcerpc_spoolss_DeletePrinterDriverEx_done(struct tevent_req *subreq)
14429 struct tevent_req *req = tevent_req_callback_data(
14430 subreq, struct tevent_req);
14431 struct dcerpc_spoolss_DeletePrinterDriverEx_state *state = tevent_req_data(
14432 req, struct dcerpc_spoolss_DeletePrinterDriverEx_state);
14434 TALLOC_CTX *mem_ctx;
14436 if (state->out_mem_ctx) {
14437 mem_ctx = state->out_mem_ctx;
14442 status = dcerpc_spoolss_DeletePrinterDriverEx_r_recv(subreq, mem_ctx);
14443 TALLOC_FREE(subreq);
14444 if (tevent_req_nterror(req, status)) {
14448 /* Copy out parameters */
14451 state->orig.out.result = state->tmp.out.result;
14453 /* Reset temporary structure */
14454 ZERO_STRUCT(state->tmp);
14456 tevent_req_done(req);
14459 NTSTATUS dcerpc_spoolss_DeletePrinterDriverEx_recv(struct tevent_req *req,
14460 TALLOC_CTX *mem_ctx,
14463 struct dcerpc_spoolss_DeletePrinterDriverEx_state *state = tevent_req_data(
14464 req, struct dcerpc_spoolss_DeletePrinterDriverEx_state);
14467 if (tevent_req_is_nterror(req, &status)) {
14468 tevent_req_received(req);
14472 /* Steal possible out parameters to the callers context */
14473 talloc_steal(mem_ctx, state->out_mem_ctx);
14475 /* Return result */
14476 *result = state->orig.out.result;
14478 tevent_req_received(req);
14479 return NT_STATUS_OK;
14482 NTSTATUS dcerpc_spoolss_DeletePrinterDriverEx(struct dcerpc_binding_handle *h,
14483 TALLOC_CTX *mem_ctx,
14484 const char *_server /* [in] [unique,charset(UTF16)] */,
14485 const char *_architecture /* [in] [charset(UTF16)] */,
14486 const char *_driver /* [in] [charset(UTF16)] */,
14487 uint32_t _delete_flags /* [in] */,
14488 uint32_t _version /* [in] */,
14491 struct spoolss_DeletePrinterDriverEx r;
14494 /* In parameters */
14495 r.in.server = _server;
14496 r.in.architecture = _architecture;
14497 r.in.driver = _driver;
14498 r.in.delete_flags = _delete_flags;
14499 r.in.version = _version;
14501 status = dcerpc_spoolss_DeletePrinterDriverEx_r(h, mem_ctx, &r);
14502 if (!NT_STATUS_IS_OK(status)) {
14506 /* Return variables */
14508 /* Return result */
14509 *result = r.out.result;
14511 return NT_STATUS_OK;
14514 struct dcerpc_spoolss_AddPerMachineConnection_r_state {
14515 TALLOC_CTX *out_mem_ctx;
14518 static void dcerpc_spoolss_AddPerMachineConnection_r_done(struct tevent_req *subreq);
14520 struct tevent_req *dcerpc_spoolss_AddPerMachineConnection_r_send(TALLOC_CTX *mem_ctx,
14521 struct tevent_context *ev,
14522 struct dcerpc_binding_handle *h,
14523 struct spoolss_AddPerMachineConnection *r)
14525 struct tevent_req *req;
14526 struct dcerpc_spoolss_AddPerMachineConnection_r_state *state;
14527 struct tevent_req *subreq;
14529 req = tevent_req_create(mem_ctx, &state,
14530 struct dcerpc_spoolss_AddPerMachineConnection_r_state);
14535 state->out_mem_ctx = NULL;
14537 subreq = dcerpc_binding_handle_call_send(state, ev, h,
14538 NULL, &ndr_table_spoolss,
14539 NDR_SPOOLSS_ADDPERMACHINECONNECTION, state, r);
14540 if (tevent_req_nomem(subreq, req)) {
14541 return tevent_req_post(req, ev);
14543 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPerMachineConnection_r_done, req);
14548 static void dcerpc_spoolss_AddPerMachineConnection_r_done(struct tevent_req *subreq)
14550 struct tevent_req *req =
14551 tevent_req_callback_data(subreq,
14552 struct tevent_req);
14555 status = dcerpc_binding_handle_call_recv(subreq);
14556 TALLOC_FREE(subreq);
14557 if (tevent_req_nterror(req, status)) {
14561 tevent_req_done(req);
14564 NTSTATUS dcerpc_spoolss_AddPerMachineConnection_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
14566 struct dcerpc_spoolss_AddPerMachineConnection_r_state *state =
14567 tevent_req_data(req,
14568 struct dcerpc_spoolss_AddPerMachineConnection_r_state);
14571 if (tevent_req_is_nterror(req, &status)) {
14572 tevent_req_received(req);
14576 talloc_steal(mem_ctx, state->out_mem_ctx);
14578 tevent_req_received(req);
14579 return NT_STATUS_OK;
14582 NTSTATUS dcerpc_spoolss_AddPerMachineConnection_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPerMachineConnection *r)
14586 status = dcerpc_binding_handle_call(h,
14587 NULL, &ndr_table_spoolss,
14588 NDR_SPOOLSS_ADDPERMACHINECONNECTION, mem_ctx, r);
14593 struct dcerpc_spoolss_AddPerMachineConnection_state {
14594 struct spoolss_AddPerMachineConnection orig;
14595 struct spoolss_AddPerMachineConnection tmp;
14596 TALLOC_CTX *out_mem_ctx;
14599 static void dcerpc_spoolss_AddPerMachineConnection_done(struct tevent_req *subreq);
14601 struct tevent_req *dcerpc_spoolss_AddPerMachineConnection_send(TALLOC_CTX *mem_ctx,
14602 struct tevent_context *ev,
14603 struct dcerpc_binding_handle *h,
14604 const char *_server /* [in] [unique,charset(UTF16)] */,
14605 const char *_printername /* [in] [ref,charset(UTF16)] */,
14606 const char *_printserver /* [in] [ref,charset(UTF16)] */,
14607 const char *_provider /* [in] [ref,charset(UTF16)] */)
14609 struct tevent_req *req;
14610 struct dcerpc_spoolss_AddPerMachineConnection_state *state;
14611 struct tevent_req *subreq;
14613 req = tevent_req_create(mem_ctx, &state,
14614 struct dcerpc_spoolss_AddPerMachineConnection_state);
14618 state->out_mem_ctx = NULL;
14620 /* In parameters */
14621 state->orig.in.server = _server;
14622 state->orig.in.printername = _printername;
14623 state->orig.in.printserver = _printserver;
14624 state->orig.in.provider = _provider;
14626 /* Out parameters */
14629 ZERO_STRUCT(state->orig.out.result);
14631 /* make a temporary copy, that we pass to the dispatch function */
14632 state->tmp = state->orig;
14634 subreq = dcerpc_spoolss_AddPerMachineConnection_r_send(state, ev, h, &state->tmp);
14635 if (tevent_req_nomem(subreq, req)) {
14636 return tevent_req_post(req, ev);
14638 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPerMachineConnection_done, req);
14642 static void dcerpc_spoolss_AddPerMachineConnection_done(struct tevent_req *subreq)
14644 struct tevent_req *req = tevent_req_callback_data(
14645 subreq, struct tevent_req);
14646 struct dcerpc_spoolss_AddPerMachineConnection_state *state = tevent_req_data(
14647 req, struct dcerpc_spoolss_AddPerMachineConnection_state);
14649 TALLOC_CTX *mem_ctx;
14651 if (state->out_mem_ctx) {
14652 mem_ctx = state->out_mem_ctx;
14657 status = dcerpc_spoolss_AddPerMachineConnection_r_recv(subreq, mem_ctx);
14658 TALLOC_FREE(subreq);
14659 if (tevent_req_nterror(req, status)) {
14663 /* Copy out parameters */
14666 state->orig.out.result = state->tmp.out.result;
14668 /* Reset temporary structure */
14669 ZERO_STRUCT(state->tmp);
14671 tevent_req_done(req);
14674 NTSTATUS dcerpc_spoolss_AddPerMachineConnection_recv(struct tevent_req *req,
14675 TALLOC_CTX *mem_ctx,
14678 struct dcerpc_spoolss_AddPerMachineConnection_state *state = tevent_req_data(
14679 req, struct dcerpc_spoolss_AddPerMachineConnection_state);
14682 if (tevent_req_is_nterror(req, &status)) {
14683 tevent_req_received(req);
14687 /* Steal possible out parameters to the callers context */
14688 talloc_steal(mem_ctx, state->out_mem_ctx);
14690 /* Return result */
14691 *result = state->orig.out.result;
14693 tevent_req_received(req);
14694 return NT_STATUS_OK;
14697 NTSTATUS dcerpc_spoolss_AddPerMachineConnection(struct dcerpc_binding_handle *h,
14698 TALLOC_CTX *mem_ctx,
14699 const char *_server /* [in] [unique,charset(UTF16)] */,
14700 const char *_printername /* [in] [ref,charset(UTF16)] */,
14701 const char *_printserver /* [in] [ref,charset(UTF16)] */,
14702 const char *_provider /* [in] [ref,charset(UTF16)] */,
14705 struct spoolss_AddPerMachineConnection r;
14708 /* In parameters */
14709 r.in.server = _server;
14710 r.in.printername = _printername;
14711 r.in.printserver = _printserver;
14712 r.in.provider = _provider;
14714 status = dcerpc_spoolss_AddPerMachineConnection_r(h, mem_ctx, &r);
14715 if (!NT_STATUS_IS_OK(status)) {
14719 /* Return variables */
14721 /* Return result */
14722 *result = r.out.result;
14724 return NT_STATUS_OK;
14727 struct dcerpc_spoolss_DeletePerMachineConnection_r_state {
14728 TALLOC_CTX *out_mem_ctx;
14731 static void dcerpc_spoolss_DeletePerMachineConnection_r_done(struct tevent_req *subreq);
14733 struct tevent_req *dcerpc_spoolss_DeletePerMachineConnection_r_send(TALLOC_CTX *mem_ctx,
14734 struct tevent_context *ev,
14735 struct dcerpc_binding_handle *h,
14736 struct spoolss_DeletePerMachineConnection *r)
14738 struct tevent_req *req;
14739 struct dcerpc_spoolss_DeletePerMachineConnection_r_state *state;
14740 struct tevent_req *subreq;
14742 req = tevent_req_create(mem_ctx, &state,
14743 struct dcerpc_spoolss_DeletePerMachineConnection_r_state);
14748 state->out_mem_ctx = NULL;
14750 subreq = dcerpc_binding_handle_call_send(state, ev, h,
14751 NULL, &ndr_table_spoolss,
14752 NDR_SPOOLSS_DELETEPERMACHINECONNECTION, state, r);
14753 if (tevent_req_nomem(subreq, req)) {
14754 return tevent_req_post(req, ev);
14756 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePerMachineConnection_r_done, req);
14761 static void dcerpc_spoolss_DeletePerMachineConnection_r_done(struct tevent_req *subreq)
14763 struct tevent_req *req =
14764 tevent_req_callback_data(subreq,
14765 struct tevent_req);
14768 status = dcerpc_binding_handle_call_recv(subreq);
14769 TALLOC_FREE(subreq);
14770 if (tevent_req_nterror(req, status)) {
14774 tevent_req_done(req);
14777 NTSTATUS dcerpc_spoolss_DeletePerMachineConnection_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
14779 struct dcerpc_spoolss_DeletePerMachineConnection_r_state *state =
14780 tevent_req_data(req,
14781 struct dcerpc_spoolss_DeletePerMachineConnection_r_state);
14784 if (tevent_req_is_nterror(req, &status)) {
14785 tevent_req_received(req);
14789 talloc_steal(mem_ctx, state->out_mem_ctx);
14791 tevent_req_received(req);
14792 return NT_STATUS_OK;
14795 NTSTATUS dcerpc_spoolss_DeletePerMachineConnection_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_DeletePerMachineConnection *r)
14799 status = dcerpc_binding_handle_call(h,
14800 NULL, &ndr_table_spoolss,
14801 NDR_SPOOLSS_DELETEPERMACHINECONNECTION, mem_ctx, r);
14806 struct dcerpc_spoolss_DeletePerMachineConnection_state {
14807 struct spoolss_DeletePerMachineConnection orig;
14808 struct spoolss_DeletePerMachineConnection tmp;
14809 TALLOC_CTX *out_mem_ctx;
14812 static void dcerpc_spoolss_DeletePerMachineConnection_done(struct tevent_req *subreq);
14814 struct tevent_req *dcerpc_spoolss_DeletePerMachineConnection_send(TALLOC_CTX *mem_ctx,
14815 struct tevent_context *ev,
14816 struct dcerpc_binding_handle *h,
14817 const char *_server /* [in] [unique,charset(UTF16)] */,
14818 const char *_printername /* [in] [ref,charset(UTF16)] */)
14820 struct tevent_req *req;
14821 struct dcerpc_spoolss_DeletePerMachineConnection_state *state;
14822 struct tevent_req *subreq;
14824 req = tevent_req_create(mem_ctx, &state,
14825 struct dcerpc_spoolss_DeletePerMachineConnection_state);
14829 state->out_mem_ctx = NULL;
14831 /* In parameters */
14832 state->orig.in.server = _server;
14833 state->orig.in.printername = _printername;
14835 /* Out parameters */
14838 ZERO_STRUCT(state->orig.out.result);
14840 /* make a temporary copy, that we pass to the dispatch function */
14841 state->tmp = state->orig;
14843 subreq = dcerpc_spoolss_DeletePerMachineConnection_r_send(state, ev, h, &state->tmp);
14844 if (tevent_req_nomem(subreq, req)) {
14845 return tevent_req_post(req, ev);
14847 tevent_req_set_callback(subreq, dcerpc_spoolss_DeletePerMachineConnection_done, req);
14851 static void dcerpc_spoolss_DeletePerMachineConnection_done(struct tevent_req *subreq)
14853 struct tevent_req *req = tevent_req_callback_data(
14854 subreq, struct tevent_req);
14855 struct dcerpc_spoolss_DeletePerMachineConnection_state *state = tevent_req_data(
14856 req, struct dcerpc_spoolss_DeletePerMachineConnection_state);
14858 TALLOC_CTX *mem_ctx;
14860 if (state->out_mem_ctx) {
14861 mem_ctx = state->out_mem_ctx;
14866 status = dcerpc_spoolss_DeletePerMachineConnection_r_recv(subreq, mem_ctx);
14867 TALLOC_FREE(subreq);
14868 if (tevent_req_nterror(req, status)) {
14872 /* Copy out parameters */
14875 state->orig.out.result = state->tmp.out.result;
14877 /* Reset temporary structure */
14878 ZERO_STRUCT(state->tmp);
14880 tevent_req_done(req);
14883 NTSTATUS dcerpc_spoolss_DeletePerMachineConnection_recv(struct tevent_req *req,
14884 TALLOC_CTX *mem_ctx,
14887 struct dcerpc_spoolss_DeletePerMachineConnection_state *state = tevent_req_data(
14888 req, struct dcerpc_spoolss_DeletePerMachineConnection_state);
14891 if (tevent_req_is_nterror(req, &status)) {
14892 tevent_req_received(req);
14896 /* Steal possible out parameters to the callers context */
14897 talloc_steal(mem_ctx, state->out_mem_ctx);
14899 /* Return result */
14900 *result = state->orig.out.result;
14902 tevent_req_received(req);
14903 return NT_STATUS_OK;
14906 NTSTATUS dcerpc_spoolss_DeletePerMachineConnection(struct dcerpc_binding_handle *h,
14907 TALLOC_CTX *mem_ctx,
14908 const char *_server /* [in] [unique,charset(UTF16)] */,
14909 const char *_printername /* [in] [ref,charset(UTF16)] */,
14912 struct spoolss_DeletePerMachineConnection r;
14915 /* In parameters */
14916 r.in.server = _server;
14917 r.in.printername = _printername;
14919 status = dcerpc_spoolss_DeletePerMachineConnection_r(h, mem_ctx, &r);
14920 if (!NT_STATUS_IS_OK(status)) {
14924 /* Return variables */
14926 /* Return result */
14927 *result = r.out.result;
14929 return NT_STATUS_OK;
14932 struct dcerpc_spoolss_XcvData_r_state {
14933 TALLOC_CTX *out_mem_ctx;
14936 static void dcerpc_spoolss_XcvData_r_done(struct tevent_req *subreq);
14938 struct tevent_req *dcerpc_spoolss_XcvData_r_send(TALLOC_CTX *mem_ctx,
14939 struct tevent_context *ev,
14940 struct dcerpc_binding_handle *h,
14941 struct spoolss_XcvData *r)
14943 struct tevent_req *req;
14944 struct dcerpc_spoolss_XcvData_r_state *state;
14945 struct tevent_req *subreq;
14947 req = tevent_req_create(mem_ctx, &state,
14948 struct dcerpc_spoolss_XcvData_r_state);
14953 state->out_mem_ctx = talloc_new(state);
14954 if (tevent_req_nomem(state->out_mem_ctx, req)) {
14955 return tevent_req_post(req, ev);
14958 subreq = dcerpc_binding_handle_call_send(state, ev, h,
14959 NULL, &ndr_table_spoolss,
14960 NDR_SPOOLSS_XCVDATA, state->out_mem_ctx, r);
14961 if (tevent_req_nomem(subreq, req)) {
14962 return tevent_req_post(req, ev);
14964 tevent_req_set_callback(subreq, dcerpc_spoolss_XcvData_r_done, req);
14969 static void dcerpc_spoolss_XcvData_r_done(struct tevent_req *subreq)
14971 struct tevent_req *req =
14972 tevent_req_callback_data(subreq,
14973 struct tevent_req);
14976 status = dcerpc_binding_handle_call_recv(subreq);
14977 TALLOC_FREE(subreq);
14978 if (tevent_req_nterror(req, status)) {
14982 tevent_req_done(req);
14985 NTSTATUS dcerpc_spoolss_XcvData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
14987 struct dcerpc_spoolss_XcvData_r_state *state =
14988 tevent_req_data(req,
14989 struct dcerpc_spoolss_XcvData_r_state);
14992 if (tevent_req_is_nterror(req, &status)) {
14993 tevent_req_received(req);
14997 talloc_steal(mem_ctx, state->out_mem_ctx);
14999 tevent_req_received(req);
15000 return NT_STATUS_OK;
15003 NTSTATUS dcerpc_spoolss_XcvData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_XcvData *r)
15007 status = dcerpc_binding_handle_call(h,
15008 NULL, &ndr_table_spoolss,
15009 NDR_SPOOLSS_XCVDATA, mem_ctx, r);
15014 struct dcerpc_spoolss_XcvData_state {
15015 struct spoolss_XcvData orig;
15016 struct spoolss_XcvData tmp;
15017 TALLOC_CTX *out_mem_ctx;
15020 static void dcerpc_spoolss_XcvData_done(struct tevent_req *subreq);
15022 struct tevent_req *dcerpc_spoolss_XcvData_send(TALLOC_CTX *mem_ctx,
15023 struct tevent_context *ev,
15024 struct dcerpc_binding_handle *h,
15025 struct policy_handle *_handle /* [in] [ref] */,
15026 const char *_function_name /* [in] [charset(UTF16)] */,
15027 DATA_BLOB _in_data /* [in] */,
15028 uint32_t __in_data_length /* [in] [value(r->in.in_data.length)] */,
15029 uint8_t *_out_data /* [out] [ref,size_is(out_data_size)] */,
15030 uint32_t _out_data_size /* [in] */,
15031 uint32_t *_needed /* [out] [ref] */,
15032 uint32_t *_status_code /* [in,out] [ref] */)
15034 struct tevent_req *req;
15035 struct dcerpc_spoolss_XcvData_state *state;
15036 struct tevent_req *subreq;
15038 req = tevent_req_create(mem_ctx, &state,
15039 struct dcerpc_spoolss_XcvData_state);
15043 state->out_mem_ctx = NULL;
15045 /* In parameters */
15046 state->orig.in.handle = _handle;
15047 state->orig.in.function_name = _function_name;
15048 state->orig.in.in_data = _in_data;
15049 state->orig.in._in_data_length = __in_data_length;
15050 state->orig.in.out_data_size = _out_data_size;
15051 state->orig.in.status_code = _status_code;
15053 /* Out parameters */
15054 state->orig.out.out_data = _out_data;
15055 state->orig.out.needed = _needed;
15056 state->orig.out.status_code = _status_code;
15059 ZERO_STRUCT(state->orig.out.result);
15061 state->out_mem_ctx = talloc_named_const(state, 0,
15062 "dcerpc_spoolss_XcvData_out_memory");
15063 if (tevent_req_nomem(state->out_mem_ctx, req)) {
15064 return tevent_req_post(req, ev);
15067 /* make a temporary copy, that we pass to the dispatch function */
15068 state->tmp = state->orig;
15070 subreq = dcerpc_spoolss_XcvData_r_send(state, ev, h, &state->tmp);
15071 if (tevent_req_nomem(subreq, req)) {
15072 return tevent_req_post(req, ev);
15074 tevent_req_set_callback(subreq, dcerpc_spoolss_XcvData_done, req);
15078 static void dcerpc_spoolss_XcvData_done(struct tevent_req *subreq)
15080 struct tevent_req *req = tevent_req_callback_data(
15081 subreq, struct tevent_req);
15082 struct dcerpc_spoolss_XcvData_state *state = tevent_req_data(
15083 req, struct dcerpc_spoolss_XcvData_state);
15085 TALLOC_CTX *mem_ctx;
15087 if (state->out_mem_ctx) {
15088 mem_ctx = state->out_mem_ctx;
15093 status = dcerpc_spoolss_XcvData_r_recv(subreq, mem_ctx);
15094 TALLOC_FREE(subreq);
15095 if (tevent_req_nterror(req, status)) {
15099 /* Copy out parameters */
15101 size_t _copy_len_out_data;
15102 _copy_len_out_data = state->tmp.in.out_data_size;
15103 memcpy(state->orig.out.out_data, state->tmp.out.out_data, _copy_len_out_data * sizeof(*state->orig.out.out_data));
15105 *state->orig.out.needed = *state->tmp.out.needed;
15106 *state->orig.out.status_code = *state->tmp.out.status_code;
15109 state->orig.out.result = state->tmp.out.result;
15111 /* Reset temporary structure */
15112 ZERO_STRUCT(state->tmp);
15114 tevent_req_done(req);
15117 NTSTATUS dcerpc_spoolss_XcvData_recv(struct tevent_req *req,
15118 TALLOC_CTX *mem_ctx,
15121 struct dcerpc_spoolss_XcvData_state *state = tevent_req_data(
15122 req, struct dcerpc_spoolss_XcvData_state);
15125 if (tevent_req_is_nterror(req, &status)) {
15126 tevent_req_received(req);
15130 /* Steal possible out parameters to the callers context */
15131 talloc_steal(mem_ctx, state->out_mem_ctx);
15133 /* Return result */
15134 *result = state->orig.out.result;
15136 tevent_req_received(req);
15137 return NT_STATUS_OK;
15140 NTSTATUS dcerpc_spoolss_XcvData(struct dcerpc_binding_handle *h,
15141 TALLOC_CTX *mem_ctx,
15142 struct policy_handle *_handle /* [in] [ref] */,
15143 const char *_function_name /* [in] [charset(UTF16)] */,
15144 DATA_BLOB _in_data /* [in] */,
15145 uint32_t __in_data_length /* [in] [value(r->in.in_data.length)] */,
15146 uint8_t *_out_data /* [out] [ref,size_is(out_data_size)] */,
15147 uint32_t _out_data_size /* [in] */,
15148 uint32_t *_needed /* [out] [ref] */,
15149 uint32_t *_status_code /* [in,out] [ref] */,
15152 struct spoolss_XcvData r;
15155 /* In parameters */
15156 r.in.handle = _handle;
15157 r.in.function_name = _function_name;
15158 r.in.in_data = _in_data;
15159 r.in._in_data_length = __in_data_length;
15160 r.in.out_data_size = _out_data_size;
15161 r.in.status_code = _status_code;
15163 status = dcerpc_spoolss_XcvData_r(h, mem_ctx, &r);
15164 if (!NT_STATUS_IS_OK(status)) {
15168 /* Return variables */
15170 size_t _copy_len_out_data;
15171 _copy_len_out_data = r.in.out_data_size;
15172 memcpy(_out_data, r.out.out_data, _copy_len_out_data * sizeof(*_out_data));
15174 *_needed = *r.out.needed;
15175 *_status_code = *r.out.status_code;
15177 /* Return result */
15178 *result = r.out.result;
15180 return NT_STATUS_OK;
15183 struct dcerpc_spoolss_AddPrinterDriverEx_r_state {
15184 TALLOC_CTX *out_mem_ctx;
15187 static void dcerpc_spoolss_AddPrinterDriverEx_r_done(struct tevent_req *subreq);
15189 struct tevent_req *dcerpc_spoolss_AddPrinterDriverEx_r_send(TALLOC_CTX *mem_ctx,
15190 struct tevent_context *ev,
15191 struct dcerpc_binding_handle *h,
15192 struct spoolss_AddPrinterDriverEx *r)
15194 struct tevent_req *req;
15195 struct dcerpc_spoolss_AddPrinterDriverEx_r_state *state;
15196 struct tevent_req *subreq;
15198 req = tevent_req_create(mem_ctx, &state,
15199 struct dcerpc_spoolss_AddPrinterDriverEx_r_state);
15204 state->out_mem_ctx = NULL;
15206 subreq = dcerpc_binding_handle_call_send(state, ev, h,
15207 NULL, &ndr_table_spoolss,
15208 NDR_SPOOLSS_ADDPRINTERDRIVEREX, state, r);
15209 if (tevent_req_nomem(subreq, req)) {
15210 return tevent_req_post(req, ev);
15212 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinterDriverEx_r_done, req);
15217 static void dcerpc_spoolss_AddPrinterDriverEx_r_done(struct tevent_req *subreq)
15219 struct tevent_req *req =
15220 tevent_req_callback_data(subreq,
15221 struct tevent_req);
15224 status = dcerpc_binding_handle_call_recv(subreq);
15225 TALLOC_FREE(subreq);
15226 if (tevent_req_nterror(req, status)) {
15230 tevent_req_done(req);
15233 NTSTATUS dcerpc_spoolss_AddPrinterDriverEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
15235 struct dcerpc_spoolss_AddPrinterDriverEx_r_state *state =
15236 tevent_req_data(req,
15237 struct dcerpc_spoolss_AddPrinterDriverEx_r_state);
15240 if (tevent_req_is_nterror(req, &status)) {
15241 tevent_req_received(req);
15245 talloc_steal(mem_ctx, state->out_mem_ctx);
15247 tevent_req_received(req);
15248 return NT_STATUS_OK;
15251 NTSTATUS dcerpc_spoolss_AddPrinterDriverEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_AddPrinterDriverEx *r)
15255 status = dcerpc_binding_handle_call(h,
15256 NULL, &ndr_table_spoolss,
15257 NDR_SPOOLSS_ADDPRINTERDRIVEREX, mem_ctx, r);
15262 struct dcerpc_spoolss_AddPrinterDriverEx_state {
15263 struct spoolss_AddPrinterDriverEx orig;
15264 struct spoolss_AddPrinterDriverEx tmp;
15265 TALLOC_CTX *out_mem_ctx;
15268 static void dcerpc_spoolss_AddPrinterDriverEx_done(struct tevent_req *subreq);
15270 struct tevent_req *dcerpc_spoolss_AddPrinterDriverEx_send(TALLOC_CTX *mem_ctx,
15271 struct tevent_context *ev,
15272 struct dcerpc_binding_handle *h,
15273 const char *_servername /* [in] [unique,charset(UTF16)] */,
15274 struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */,
15275 uint32_t _flags /* [in] */)
15277 struct tevent_req *req;
15278 struct dcerpc_spoolss_AddPrinterDriverEx_state *state;
15279 struct tevent_req *subreq;
15281 req = tevent_req_create(mem_ctx, &state,
15282 struct dcerpc_spoolss_AddPrinterDriverEx_state);
15286 state->out_mem_ctx = NULL;
15288 /* In parameters */
15289 state->orig.in.servername = _servername;
15290 state->orig.in.info_ctr = _info_ctr;
15291 state->orig.in.flags = _flags;
15293 /* Out parameters */
15296 ZERO_STRUCT(state->orig.out.result);
15298 /* make a temporary copy, that we pass to the dispatch function */
15299 state->tmp = state->orig;
15301 subreq = dcerpc_spoolss_AddPrinterDriverEx_r_send(state, ev, h, &state->tmp);
15302 if (tevent_req_nomem(subreq, req)) {
15303 return tevent_req_post(req, ev);
15305 tevent_req_set_callback(subreq, dcerpc_spoolss_AddPrinterDriverEx_done, req);
15309 static void dcerpc_spoolss_AddPrinterDriverEx_done(struct tevent_req *subreq)
15311 struct tevent_req *req = tevent_req_callback_data(
15312 subreq, struct tevent_req);
15313 struct dcerpc_spoolss_AddPrinterDriverEx_state *state = tevent_req_data(
15314 req, struct dcerpc_spoolss_AddPrinterDriverEx_state);
15316 TALLOC_CTX *mem_ctx;
15318 if (state->out_mem_ctx) {
15319 mem_ctx = state->out_mem_ctx;
15324 status = dcerpc_spoolss_AddPrinterDriverEx_r_recv(subreq, mem_ctx);
15325 TALLOC_FREE(subreq);
15326 if (tevent_req_nterror(req, status)) {
15330 /* Copy out parameters */
15333 state->orig.out.result = state->tmp.out.result;
15335 /* Reset temporary structure */
15336 ZERO_STRUCT(state->tmp);
15338 tevent_req_done(req);
15341 NTSTATUS dcerpc_spoolss_AddPrinterDriverEx_recv(struct tevent_req *req,
15342 TALLOC_CTX *mem_ctx,
15345 struct dcerpc_spoolss_AddPrinterDriverEx_state *state = tevent_req_data(
15346 req, struct dcerpc_spoolss_AddPrinterDriverEx_state);
15349 if (tevent_req_is_nterror(req, &status)) {
15350 tevent_req_received(req);
15354 /* Steal possible out parameters to the callers context */
15355 talloc_steal(mem_ctx, state->out_mem_ctx);
15357 /* Return result */
15358 *result = state->orig.out.result;
15360 tevent_req_received(req);
15361 return NT_STATUS_OK;
15364 NTSTATUS dcerpc_spoolss_AddPrinterDriverEx(struct dcerpc_binding_handle *h,
15365 TALLOC_CTX *mem_ctx,
15366 const char *_servername /* [in] [unique,charset(UTF16)] */,
15367 struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */,
15368 uint32_t _flags /* [in] */,
15371 struct spoolss_AddPrinterDriverEx r;
15374 /* In parameters */
15375 r.in.servername = _servername;
15376 r.in.info_ctr = _info_ctr;
15377 r.in.flags = _flags;
15379 status = dcerpc_spoolss_AddPrinterDriverEx_r(h, mem_ctx, &r);
15380 if (!NT_STATUS_IS_OK(status)) {
15384 /* Return variables */
15386 /* Return result */
15387 *result = r.out.result;
15389 return NT_STATUS_OK;
15392 struct dcerpc_spoolss_RpcSendRecvBidiData_r_state {
15393 TALLOC_CTX *out_mem_ctx;
15396 static void dcerpc_spoolss_RpcSendRecvBidiData_r_done(struct tevent_req *subreq);
15398 struct tevent_req *dcerpc_spoolss_RpcSendRecvBidiData_r_send(TALLOC_CTX *mem_ctx,
15399 struct tevent_context *ev,
15400 struct dcerpc_binding_handle *h,
15401 struct spoolss_RpcSendRecvBidiData *r)
15403 struct tevent_req *req;
15404 struct dcerpc_spoolss_RpcSendRecvBidiData_r_state *state;
15405 struct tevent_req *subreq;
15407 req = tevent_req_create(mem_ctx, &state,
15408 struct dcerpc_spoolss_RpcSendRecvBidiData_r_state);
15413 state->out_mem_ctx = talloc_new(state);
15414 if (tevent_req_nomem(state->out_mem_ctx, req)) {
15415 return tevent_req_post(req, ev);
15418 subreq = dcerpc_binding_handle_call_send(state, ev, h,
15419 NULL, &ndr_table_spoolss,
15420 NDR_SPOOLSS_RPCSENDRECVBIDIDATA, state->out_mem_ctx, r);
15421 if (tevent_req_nomem(subreq, req)) {
15422 return tevent_req_post(req, ev);
15424 tevent_req_set_callback(subreq, dcerpc_spoolss_RpcSendRecvBidiData_r_done, req);
15429 static void dcerpc_spoolss_RpcSendRecvBidiData_r_done(struct tevent_req *subreq)
15431 struct tevent_req *req =
15432 tevent_req_callback_data(subreq,
15433 struct tevent_req);
15436 status = dcerpc_binding_handle_call_recv(subreq);
15437 TALLOC_FREE(subreq);
15438 if (tevent_req_nterror(req, status)) {
15442 tevent_req_done(req);
15445 NTSTATUS dcerpc_spoolss_RpcSendRecvBidiData_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
15447 struct dcerpc_spoolss_RpcSendRecvBidiData_r_state *state =
15448 tevent_req_data(req,
15449 struct dcerpc_spoolss_RpcSendRecvBidiData_r_state);
15452 if (tevent_req_is_nterror(req, &status)) {
15453 tevent_req_received(req);
15457 talloc_steal(mem_ctx, state->out_mem_ctx);
15459 tevent_req_received(req);
15460 return NT_STATUS_OK;
15463 NTSTATUS dcerpc_spoolss_RpcSendRecvBidiData_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RpcSendRecvBidiData *r)
15467 status = dcerpc_binding_handle_call(h,
15468 NULL, &ndr_table_spoolss,
15469 NDR_SPOOLSS_RPCSENDRECVBIDIDATA, mem_ctx, r);
15474 struct dcerpc_spoolss_RpcSendRecvBidiData_state {
15475 struct spoolss_RpcSendRecvBidiData orig;
15476 struct spoolss_RpcSendRecvBidiData tmp;
15477 TALLOC_CTX *out_mem_ctx;
15480 static void dcerpc_spoolss_RpcSendRecvBidiData_done(struct tevent_req *subreq);
15482 struct tevent_req *dcerpc_spoolss_RpcSendRecvBidiData_send(TALLOC_CTX *mem_ctx,
15483 struct tevent_context *ev,
15484 struct dcerpc_binding_handle *h,
15485 struct policy_handle _hPrinter /* [in] */,
15486 const char *_pAction /* [in] [unique,charset(UTF16)] */,
15487 struct RPC_BIDI_REQUEST_CONTAINER *_pReqData /* [in] [ref] */,
15488 struct RPC_BIDI_RESPONSE_CONTAINER **_ppRespData /* [out] [ref] */)
15490 struct tevent_req *req;
15491 struct dcerpc_spoolss_RpcSendRecvBidiData_state *state;
15492 struct tevent_req *subreq;
15494 req = tevent_req_create(mem_ctx, &state,
15495 struct dcerpc_spoolss_RpcSendRecvBidiData_state);
15499 state->out_mem_ctx = NULL;
15501 /* In parameters */
15502 state->orig.in.hPrinter = _hPrinter;
15503 state->orig.in.pAction = _pAction;
15504 state->orig.in.pReqData = _pReqData;
15506 /* Out parameters */
15507 state->orig.out.ppRespData = _ppRespData;
15510 ZERO_STRUCT(state->orig.out.result);
15512 state->out_mem_ctx = talloc_named_const(state, 0,
15513 "dcerpc_spoolss_RpcSendRecvBidiData_out_memory");
15514 if (tevent_req_nomem(state->out_mem_ctx, req)) {
15515 return tevent_req_post(req, ev);
15518 /* make a temporary copy, that we pass to the dispatch function */
15519 state->tmp = state->orig;
15521 subreq = dcerpc_spoolss_RpcSendRecvBidiData_r_send(state, ev, h, &state->tmp);
15522 if (tevent_req_nomem(subreq, req)) {
15523 return tevent_req_post(req, ev);
15525 tevent_req_set_callback(subreq, dcerpc_spoolss_RpcSendRecvBidiData_done, req);
15529 static void dcerpc_spoolss_RpcSendRecvBidiData_done(struct tevent_req *subreq)
15531 struct tevent_req *req = tevent_req_callback_data(
15532 subreq, struct tevent_req);
15533 struct dcerpc_spoolss_RpcSendRecvBidiData_state *state = tevent_req_data(
15534 req, struct dcerpc_spoolss_RpcSendRecvBidiData_state);
15536 TALLOC_CTX *mem_ctx;
15538 if (state->out_mem_ctx) {
15539 mem_ctx = state->out_mem_ctx;
15544 status = dcerpc_spoolss_RpcSendRecvBidiData_r_recv(subreq, mem_ctx);
15545 TALLOC_FREE(subreq);
15546 if (tevent_req_nterror(req, status)) {
15550 /* Copy out parameters */
15551 *state->orig.out.ppRespData = *state->tmp.out.ppRespData;
15554 state->orig.out.result = state->tmp.out.result;
15556 /* Reset temporary structure */
15557 ZERO_STRUCT(state->tmp);
15559 tevent_req_done(req);
15562 NTSTATUS dcerpc_spoolss_RpcSendRecvBidiData_recv(struct tevent_req *req,
15563 TALLOC_CTX *mem_ctx,
15566 struct dcerpc_spoolss_RpcSendRecvBidiData_state *state = tevent_req_data(
15567 req, struct dcerpc_spoolss_RpcSendRecvBidiData_state);
15570 if (tevent_req_is_nterror(req, &status)) {
15571 tevent_req_received(req);
15575 /* Steal possible out parameters to the callers context */
15576 talloc_steal(mem_ctx, state->out_mem_ctx);
15578 /* Return result */
15579 *result = state->orig.out.result;
15581 tevent_req_received(req);
15582 return NT_STATUS_OK;
15585 NTSTATUS dcerpc_spoolss_RpcSendRecvBidiData(struct dcerpc_binding_handle *h,
15586 TALLOC_CTX *mem_ctx,
15587 struct policy_handle _hPrinter /* [in] */,
15588 const char *_pAction /* [in] [unique,charset(UTF16)] */,
15589 struct RPC_BIDI_REQUEST_CONTAINER *_pReqData /* [in] [ref] */,
15590 struct RPC_BIDI_RESPONSE_CONTAINER **_ppRespData /* [out] [ref] */,
15593 struct spoolss_RpcSendRecvBidiData r;
15596 /* In parameters */
15597 r.in.hPrinter = _hPrinter;
15598 r.in.pAction = _pAction;
15599 r.in.pReqData = _pReqData;
15601 status = dcerpc_spoolss_RpcSendRecvBidiData_r(h, mem_ctx, &r);
15602 if (!NT_STATUS_IS_OK(status)) {
15606 /* Return variables */
15607 *_ppRespData = *r.out.ppRespData;
15609 /* Return result */
15610 *result = r.out.result;
15612 return NT_STATUS_OK;
15615 struct dcerpc_spoolss_GetCorePrinterDrivers_r_state {
15616 TALLOC_CTX *out_mem_ctx;
15619 static void dcerpc_spoolss_GetCorePrinterDrivers_r_done(struct tevent_req *subreq);
15621 struct tevent_req *dcerpc_spoolss_GetCorePrinterDrivers_r_send(TALLOC_CTX *mem_ctx,
15622 struct tevent_context *ev,
15623 struct dcerpc_binding_handle *h,
15624 struct spoolss_GetCorePrinterDrivers *r)
15626 struct tevent_req *req;
15627 struct dcerpc_spoolss_GetCorePrinterDrivers_r_state *state;
15628 struct tevent_req *subreq;
15630 req = tevent_req_create(mem_ctx, &state,
15631 struct dcerpc_spoolss_GetCorePrinterDrivers_r_state);
15636 state->out_mem_ctx = talloc_new(state);
15637 if (tevent_req_nomem(state->out_mem_ctx, req)) {
15638 return tevent_req_post(req, ev);
15641 subreq = dcerpc_binding_handle_call_send(state, ev, h,
15642 NULL, &ndr_table_spoolss,
15643 NDR_SPOOLSS_GETCOREPRINTERDRIVERS, state->out_mem_ctx, r);
15644 if (tevent_req_nomem(subreq, req)) {
15645 return tevent_req_post(req, ev);
15647 tevent_req_set_callback(subreq, dcerpc_spoolss_GetCorePrinterDrivers_r_done, req);
15652 static void dcerpc_spoolss_GetCorePrinterDrivers_r_done(struct tevent_req *subreq)
15654 struct tevent_req *req =
15655 tevent_req_callback_data(subreq,
15656 struct tevent_req);
15659 status = dcerpc_binding_handle_call_recv(subreq);
15660 TALLOC_FREE(subreq);
15661 if (tevent_req_nterror(req, status)) {
15665 tevent_req_done(req);
15668 NTSTATUS dcerpc_spoolss_GetCorePrinterDrivers_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
15670 struct dcerpc_spoolss_GetCorePrinterDrivers_r_state *state =
15671 tevent_req_data(req,
15672 struct dcerpc_spoolss_GetCorePrinterDrivers_r_state);
15675 if (tevent_req_is_nterror(req, &status)) {
15676 tevent_req_received(req);
15680 talloc_steal(mem_ctx, state->out_mem_ctx);
15682 tevent_req_received(req);
15683 return NT_STATUS_OK;
15686 NTSTATUS dcerpc_spoolss_GetCorePrinterDrivers_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetCorePrinterDrivers *r)
15690 status = dcerpc_binding_handle_call(h,
15691 NULL, &ndr_table_spoolss,
15692 NDR_SPOOLSS_GETCOREPRINTERDRIVERS, mem_ctx, r);
15697 struct dcerpc_spoolss_GetCorePrinterDrivers_state {
15698 struct spoolss_GetCorePrinterDrivers orig;
15699 struct spoolss_GetCorePrinterDrivers tmp;
15700 TALLOC_CTX *out_mem_ctx;
15703 static void dcerpc_spoolss_GetCorePrinterDrivers_done(struct tevent_req *subreq);
15705 struct tevent_req *dcerpc_spoolss_GetCorePrinterDrivers_send(TALLOC_CTX *mem_ctx,
15706 struct tevent_context *ev,
15707 struct dcerpc_binding_handle *h,
15708 const char *_servername /* [in] [unique,charset(UTF16)] */,
15709 const char *_architecture /* [in] [ref,charset(UTF16)] */,
15710 uint32_t _core_driver_size /* [in] */,
15711 const char *_core_driver_dependencies /* [in] [ref,charset(UTF16),size_is(core_driver_size)] */,
15712 uint32_t _core_printer_driver_count /* [in] */,
15713 struct spoolss_CorePrinterDriver *_core_printer_drivers /* [out] [ref,size_is(core_printer_driver_count)] */)
15715 struct tevent_req *req;
15716 struct dcerpc_spoolss_GetCorePrinterDrivers_state *state;
15717 struct tevent_req *subreq;
15719 req = tevent_req_create(mem_ctx, &state,
15720 struct dcerpc_spoolss_GetCorePrinterDrivers_state);
15724 state->out_mem_ctx = NULL;
15726 /* In parameters */
15727 state->orig.in.servername = _servername;
15728 state->orig.in.architecture = _architecture;
15729 state->orig.in.core_driver_size = _core_driver_size;
15730 state->orig.in.core_driver_dependencies = _core_driver_dependencies;
15731 state->orig.in.core_printer_driver_count = _core_printer_driver_count;
15733 /* Out parameters */
15734 state->orig.out.core_printer_drivers = _core_printer_drivers;
15737 ZERO_STRUCT(state->orig.out.result);
15739 state->out_mem_ctx = talloc_named_const(state, 0,
15740 "dcerpc_spoolss_GetCorePrinterDrivers_out_memory");
15741 if (tevent_req_nomem(state->out_mem_ctx, req)) {
15742 return tevent_req_post(req, ev);
15745 /* make a temporary copy, that we pass to the dispatch function */
15746 state->tmp = state->orig;
15748 subreq = dcerpc_spoolss_GetCorePrinterDrivers_r_send(state, ev, h, &state->tmp);
15749 if (tevent_req_nomem(subreq, req)) {
15750 return tevent_req_post(req, ev);
15752 tevent_req_set_callback(subreq, dcerpc_spoolss_GetCorePrinterDrivers_done, req);
15756 static void dcerpc_spoolss_GetCorePrinterDrivers_done(struct tevent_req *subreq)
15758 struct tevent_req *req = tevent_req_callback_data(
15759 subreq, struct tevent_req);
15760 struct dcerpc_spoolss_GetCorePrinterDrivers_state *state = tevent_req_data(
15761 req, struct dcerpc_spoolss_GetCorePrinterDrivers_state);
15763 TALLOC_CTX *mem_ctx;
15765 if (state->out_mem_ctx) {
15766 mem_ctx = state->out_mem_ctx;
15771 status = dcerpc_spoolss_GetCorePrinterDrivers_r_recv(subreq, mem_ctx);
15772 TALLOC_FREE(subreq);
15773 if (tevent_req_nterror(req, status)) {
15777 /* Copy out parameters */
15779 size_t _copy_len_core_printer_drivers;
15780 _copy_len_core_printer_drivers = state->tmp.in.core_printer_driver_count;
15781 memcpy(state->orig.out.core_printer_drivers, state->tmp.out.core_printer_drivers, _copy_len_core_printer_drivers * sizeof(*state->orig.out.core_printer_drivers));
15785 state->orig.out.result = state->tmp.out.result;
15787 /* Reset temporary structure */
15788 ZERO_STRUCT(state->tmp);
15790 tevent_req_done(req);
15793 NTSTATUS dcerpc_spoolss_GetCorePrinterDrivers_recv(struct tevent_req *req,
15794 TALLOC_CTX *mem_ctx,
15797 struct dcerpc_spoolss_GetCorePrinterDrivers_state *state = tevent_req_data(
15798 req, struct dcerpc_spoolss_GetCorePrinterDrivers_state);
15801 if (tevent_req_is_nterror(req, &status)) {
15802 tevent_req_received(req);
15806 /* Steal possible out parameters to the callers context */
15807 talloc_steal(mem_ctx, state->out_mem_ctx);
15809 /* Return result */
15810 *result = state->orig.out.result;
15812 tevent_req_received(req);
15813 return NT_STATUS_OK;
15816 NTSTATUS dcerpc_spoolss_GetCorePrinterDrivers(struct dcerpc_binding_handle *h,
15817 TALLOC_CTX *mem_ctx,
15818 const char *_servername /* [in] [unique,charset(UTF16)] */,
15819 const char *_architecture /* [in] [ref,charset(UTF16)] */,
15820 uint32_t _core_driver_size /* [in] */,
15821 const char *_core_driver_dependencies /* [in] [ref,charset(UTF16),size_is(core_driver_size)] */,
15822 uint32_t _core_printer_driver_count /* [in] */,
15823 struct spoolss_CorePrinterDriver *_core_printer_drivers /* [out] [ref,size_is(core_printer_driver_count)] */,
15826 struct spoolss_GetCorePrinterDrivers r;
15829 /* In parameters */
15830 r.in.servername = _servername;
15831 r.in.architecture = _architecture;
15832 r.in.core_driver_size = _core_driver_size;
15833 r.in.core_driver_dependencies = _core_driver_dependencies;
15834 r.in.core_printer_driver_count = _core_printer_driver_count;
15836 status = dcerpc_spoolss_GetCorePrinterDrivers_r(h, mem_ctx, &r);
15837 if (!NT_STATUS_IS_OK(status)) {
15841 /* Return variables */
15843 size_t _copy_len_core_printer_drivers;
15844 _copy_len_core_printer_drivers = r.in.core_printer_driver_count;
15845 memcpy(_core_printer_drivers, r.out.core_printer_drivers, _copy_len_core_printer_drivers * sizeof(*_core_printer_drivers));
15848 /* Return result */
15849 *result = r.out.result;
15851 return NT_STATUS_OK;
15854 struct dcerpc_spoolss_GetPrinterDriverPackagePath_r_state {
15855 TALLOC_CTX *out_mem_ctx;
15858 static void dcerpc_spoolss_GetPrinterDriverPackagePath_r_done(struct tevent_req *subreq);
15860 struct tevent_req *dcerpc_spoolss_GetPrinterDriverPackagePath_r_send(TALLOC_CTX *mem_ctx,
15861 struct tevent_context *ev,
15862 struct dcerpc_binding_handle *h,
15863 struct spoolss_GetPrinterDriverPackagePath *r)
15865 struct tevent_req *req;
15866 struct dcerpc_spoolss_GetPrinterDriverPackagePath_r_state *state;
15867 struct tevent_req *subreq;
15869 req = tevent_req_create(mem_ctx, &state,
15870 struct dcerpc_spoolss_GetPrinterDriverPackagePath_r_state);
15875 state->out_mem_ctx = talloc_new(state);
15876 if (tevent_req_nomem(state->out_mem_ctx, req)) {
15877 return tevent_req_post(req, ev);
15880 subreq = dcerpc_binding_handle_call_send(state, ev, h,
15881 NULL, &ndr_table_spoolss,
15882 NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH, state->out_mem_ctx, r);
15883 if (tevent_req_nomem(subreq, req)) {
15884 return tevent_req_post(req, ev);
15886 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDriverPackagePath_r_done, req);
15891 static void dcerpc_spoolss_GetPrinterDriverPackagePath_r_done(struct tevent_req *subreq)
15893 struct tevent_req *req =
15894 tevent_req_callback_data(subreq,
15895 struct tevent_req);
15898 status = dcerpc_binding_handle_call_recv(subreq);
15899 TALLOC_FREE(subreq);
15900 if (tevent_req_nterror(req, status)) {
15904 tevent_req_done(req);
15907 NTSTATUS dcerpc_spoolss_GetPrinterDriverPackagePath_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
15909 struct dcerpc_spoolss_GetPrinterDriverPackagePath_r_state *state =
15910 tevent_req_data(req,
15911 struct dcerpc_spoolss_GetPrinterDriverPackagePath_r_state);
15914 if (tevent_req_is_nterror(req, &status)) {
15915 tevent_req_received(req);
15919 talloc_steal(mem_ctx, state->out_mem_ctx);
15921 tevent_req_received(req);
15922 return NT_STATUS_OK;
15925 NTSTATUS dcerpc_spoolss_GetPrinterDriverPackagePath_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_GetPrinterDriverPackagePath *r)
15929 status = dcerpc_binding_handle_call(h,
15930 NULL, &ndr_table_spoolss,
15931 NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH, mem_ctx, r);
15936 struct dcerpc_spoolss_GetPrinterDriverPackagePath_state {
15937 struct spoolss_GetPrinterDriverPackagePath orig;
15938 struct spoolss_GetPrinterDriverPackagePath tmp;
15939 TALLOC_CTX *out_mem_ctx;
15942 static void dcerpc_spoolss_GetPrinterDriverPackagePath_done(struct tevent_req *subreq);
15944 struct tevent_req *dcerpc_spoolss_GetPrinterDriverPackagePath_send(TALLOC_CTX *mem_ctx,
15945 struct tevent_context *ev,
15946 struct dcerpc_binding_handle *h,
15947 const char *_servername /* [in] [unique,charset(UTF16)] */,
15948 const char *_architecture /* [in] [ref,charset(UTF16)] */,
15949 const char *_language /* [in] [unique,charset(UTF16)] */,
15950 const char *_package_id /* [in] [ref,charset(UTF16)] */,
15951 const char *_driver_package_cab /* [in,out] [unique,charset(UTF16),size_is(driver_package_cab_size)] */,
15952 uint32_t _driver_package_cab_size /* [in] */,
15953 uint32_t *_required /* [out] [ref] */)
15955 struct tevent_req *req;
15956 struct dcerpc_spoolss_GetPrinterDriverPackagePath_state *state;
15957 struct tevent_req *subreq;
15959 req = tevent_req_create(mem_ctx, &state,
15960 struct dcerpc_spoolss_GetPrinterDriverPackagePath_state);
15964 state->out_mem_ctx = NULL;
15966 /* In parameters */
15967 state->orig.in.servername = _servername;
15968 state->orig.in.architecture = _architecture;
15969 state->orig.in.language = _language;
15970 state->orig.in.package_id = _package_id;
15971 state->orig.in.driver_package_cab = _driver_package_cab;
15972 state->orig.in.driver_package_cab_size = _driver_package_cab_size;
15974 /* Out parameters */
15975 state->orig.out.driver_package_cab = _driver_package_cab;
15976 state->orig.out.required = _required;
15979 ZERO_STRUCT(state->orig.out.result);
15981 state->out_mem_ctx = talloc_named_const(state, 0,
15982 "dcerpc_spoolss_GetPrinterDriverPackagePath_out_memory");
15983 if (tevent_req_nomem(state->out_mem_ctx, req)) {
15984 return tevent_req_post(req, ev);
15987 /* make a temporary copy, that we pass to the dispatch function */
15988 state->tmp = state->orig;
15990 subreq = dcerpc_spoolss_GetPrinterDriverPackagePath_r_send(state, ev, h, &state->tmp);
15991 if (tevent_req_nomem(subreq, req)) {
15992 return tevent_req_post(req, ev);
15994 tevent_req_set_callback(subreq, dcerpc_spoolss_GetPrinterDriverPackagePath_done, req);
15998 static void dcerpc_spoolss_GetPrinterDriverPackagePath_done(struct tevent_req *subreq)
16000 struct tevent_req *req = tevent_req_callback_data(
16001 subreq, struct tevent_req);
16002 struct dcerpc_spoolss_GetPrinterDriverPackagePath_state *state = tevent_req_data(
16003 req, struct dcerpc_spoolss_GetPrinterDriverPackagePath_state);
16005 TALLOC_CTX *mem_ctx;
16007 if (state->out_mem_ctx) {
16008 mem_ctx = state->out_mem_ctx;
16013 status = dcerpc_spoolss_GetPrinterDriverPackagePath_r_recv(subreq, mem_ctx);
16014 TALLOC_FREE(subreq);
16015 if (tevent_req_nterror(req, status)) {
16019 /* Copy out parameters */
16020 if (state->orig.out.driver_package_cab && state->tmp.out.driver_package_cab) {
16022 size_t _copy_len_driver_package_cab;
16023 _copy_len_driver_package_cab = ndr_charset_length(state->tmp.out.driver_package_cab, CH_UNIX);
16024 if (_copy_len_driver_package_cab > ndr_charset_length(state->tmp.in.driver_package_cab, CH_UNIX)) {
16025 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
16028 memcpy(discard_const_p(uint8_t *, state->orig.out.driver_package_cab), state->tmp.out.driver_package_cab, _copy_len_driver_package_cab * sizeof(*state->orig.out.driver_package_cab));
16031 *state->orig.out.required = *state->tmp.out.required;
16034 state->orig.out.result = state->tmp.out.result;
16036 /* Reset temporary structure */
16037 ZERO_STRUCT(state->tmp);
16039 tevent_req_done(req);
16042 NTSTATUS dcerpc_spoolss_GetPrinterDriverPackagePath_recv(struct tevent_req *req,
16043 TALLOC_CTX *mem_ctx,
16046 struct dcerpc_spoolss_GetPrinterDriverPackagePath_state *state = tevent_req_data(
16047 req, struct dcerpc_spoolss_GetPrinterDriverPackagePath_state);
16050 if (tevent_req_is_nterror(req, &status)) {
16051 tevent_req_received(req);
16055 /* Steal possible out parameters to the callers context */
16056 talloc_steal(mem_ctx, state->out_mem_ctx);
16058 /* Return result */
16059 *result = state->orig.out.result;
16061 tevent_req_received(req);
16062 return NT_STATUS_OK;
16065 NTSTATUS dcerpc_spoolss_GetPrinterDriverPackagePath(struct dcerpc_binding_handle *h,
16066 TALLOC_CTX *mem_ctx,
16067 const char *_servername /* [in] [unique,charset(UTF16)] */,
16068 const char *_architecture /* [in] [ref,charset(UTF16)] */,
16069 const char *_language /* [in] [unique,charset(UTF16)] */,
16070 const char *_package_id /* [in] [ref,charset(UTF16)] */,
16071 const char *_driver_package_cab /* [in,out] [unique,charset(UTF16),size_is(driver_package_cab_size)] */,
16072 uint32_t _driver_package_cab_size /* [in] */,
16073 uint32_t *_required /* [out] [ref] */,
16076 struct spoolss_GetPrinterDriverPackagePath r;
16079 /* In parameters */
16080 r.in.servername = _servername;
16081 r.in.architecture = _architecture;
16082 r.in.language = _language;
16083 r.in.package_id = _package_id;
16084 r.in.driver_package_cab = _driver_package_cab;
16085 r.in.driver_package_cab_size = _driver_package_cab_size;
16087 status = dcerpc_spoolss_GetPrinterDriverPackagePath_r(h, mem_ctx, &r);
16088 if (!NT_STATUS_IS_OK(status)) {
16092 /* Return variables */
16093 if (_driver_package_cab && r.out.driver_package_cab) {
16095 size_t _copy_len_driver_package_cab;
16096 _copy_len_driver_package_cab = ndr_charset_length(r.out.driver_package_cab, CH_UNIX);
16097 if (_copy_len_driver_package_cab > ndr_charset_length(r.in.driver_package_cab, CH_UNIX)) {
16098 return NT_STATUS_INVALID_NETWORK_RESPONSE;
16100 memcpy(discard_const_p(uint8_t *, _driver_package_cab), r.out.driver_package_cab, _copy_len_driver_package_cab * sizeof(*_driver_package_cab));
16103 *_required = *r.out.required;
16105 /* Return result */
16106 *result = r.out.result;
16108 return NT_STATUS_OK;
16111 struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_state {
16112 TALLOC_CTX *out_mem_ctx;
16115 static void dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_done(struct tevent_req *subreq);
16117 struct tevent_req *dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_send(TALLOC_CTX *mem_ctx,
16118 struct tevent_context *ev,
16119 struct dcerpc_binding_handle *h,
16120 struct spoolss_RpcGetJobNamedPropertyValue *r)
16122 struct tevent_req *req;
16123 struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_state *state;
16124 struct tevent_req *subreq;
16126 req = tevent_req_create(mem_ctx, &state,
16127 struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_state);
16132 state->out_mem_ctx = talloc_new(state);
16133 if (tevent_req_nomem(state->out_mem_ctx, req)) {
16134 return tevent_req_post(req, ev);
16137 subreq = dcerpc_binding_handle_call_send(state, ev, h,
16138 NULL, &ndr_table_spoolss,
16139 NDR_SPOOLSS_RPCGETJOBNAMEDPROPERTYVALUE, state->out_mem_ctx, r);
16140 if (tevent_req_nomem(subreq, req)) {
16141 return tevent_req_post(req, ev);
16143 tevent_req_set_callback(subreq, dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_done, req);
16148 static void dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_done(struct tevent_req *subreq)
16150 struct tevent_req *req =
16151 tevent_req_callback_data(subreq,
16152 struct tevent_req);
16155 status = dcerpc_binding_handle_call_recv(subreq);
16156 TALLOC_FREE(subreq);
16157 if (tevent_req_nterror(req, status)) {
16161 tevent_req_done(req);
16164 NTSTATUS dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
16166 struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_state *state =
16167 tevent_req_data(req,
16168 struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_state);
16171 if (tevent_req_is_nterror(req, &status)) {
16172 tevent_req_received(req);
16176 talloc_steal(mem_ctx, state->out_mem_ctx);
16178 tevent_req_received(req);
16179 return NT_STATUS_OK;
16182 NTSTATUS dcerpc_spoolss_RpcGetJobNamedPropertyValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RpcGetJobNamedPropertyValue *r)
16186 status = dcerpc_binding_handle_call(h,
16187 NULL, &ndr_table_spoolss,
16188 NDR_SPOOLSS_RPCGETJOBNAMEDPROPERTYVALUE, mem_ctx, r);
16193 struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_state {
16194 struct spoolss_RpcGetJobNamedPropertyValue orig;
16195 struct spoolss_RpcGetJobNamedPropertyValue tmp;
16196 TALLOC_CTX *out_mem_ctx;
16199 static void dcerpc_spoolss_RpcGetJobNamedPropertyValue_done(struct tevent_req *subreq);
16201 struct tevent_req *dcerpc_spoolss_RpcGetJobNamedPropertyValue_send(TALLOC_CTX *mem_ctx,
16202 struct tevent_context *ev,
16203 struct dcerpc_binding_handle *h,
16204 struct policy_handle *_hPrinter /* [in] [ref] */,
16205 uint32_t _JobId /* [in] */,
16206 const char *_pszName /* [in] [ref,charset(UTF16)] */,
16207 struct RPC_PrintPropertyValue *_pValue /* [out] [ref] */)
16209 struct tevent_req *req;
16210 struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_state *state;
16211 struct tevent_req *subreq;
16213 req = tevent_req_create(mem_ctx, &state,
16214 struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_state);
16218 state->out_mem_ctx = NULL;
16220 /* In parameters */
16221 state->orig.in.hPrinter = _hPrinter;
16222 state->orig.in.JobId = _JobId;
16223 state->orig.in.pszName = _pszName;
16225 /* Out parameters */
16226 state->orig.out.pValue = _pValue;
16229 ZERO_STRUCT(state->orig.out.result);
16231 state->out_mem_ctx = talloc_named_const(state, 0,
16232 "dcerpc_spoolss_RpcGetJobNamedPropertyValue_out_memory");
16233 if (tevent_req_nomem(state->out_mem_ctx, req)) {
16234 return tevent_req_post(req, ev);
16237 /* make a temporary copy, that we pass to the dispatch function */
16238 state->tmp = state->orig;
16240 subreq = dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_send(state, ev, h, &state->tmp);
16241 if (tevent_req_nomem(subreq, req)) {
16242 return tevent_req_post(req, ev);
16244 tevent_req_set_callback(subreq, dcerpc_spoolss_RpcGetJobNamedPropertyValue_done, req);
16248 static void dcerpc_spoolss_RpcGetJobNamedPropertyValue_done(struct tevent_req *subreq)
16250 struct tevent_req *req = tevent_req_callback_data(
16251 subreq, struct tevent_req);
16252 struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_state *state = tevent_req_data(
16253 req, struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_state);
16255 TALLOC_CTX *mem_ctx;
16257 if (state->out_mem_ctx) {
16258 mem_ctx = state->out_mem_ctx;
16263 status = dcerpc_spoolss_RpcGetJobNamedPropertyValue_r_recv(subreq, mem_ctx);
16264 TALLOC_FREE(subreq);
16265 if (tevent_req_nterror(req, status)) {
16269 /* Copy out parameters */
16270 *state->orig.out.pValue = *state->tmp.out.pValue;
16273 state->orig.out.result = state->tmp.out.result;
16275 /* Reset temporary structure */
16276 ZERO_STRUCT(state->tmp);
16278 tevent_req_done(req);
16281 NTSTATUS dcerpc_spoolss_RpcGetJobNamedPropertyValue_recv(struct tevent_req *req,
16282 TALLOC_CTX *mem_ctx,
16285 struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_state *state = tevent_req_data(
16286 req, struct dcerpc_spoolss_RpcGetJobNamedPropertyValue_state);
16289 if (tevent_req_is_nterror(req, &status)) {
16290 tevent_req_received(req);
16294 /* Steal possible out parameters to the callers context */
16295 talloc_steal(mem_ctx, state->out_mem_ctx);
16297 /* Return result */
16298 *result = state->orig.out.result;
16300 tevent_req_received(req);
16301 return NT_STATUS_OK;
16304 NTSTATUS dcerpc_spoolss_RpcGetJobNamedPropertyValue(struct dcerpc_binding_handle *h,
16305 TALLOC_CTX *mem_ctx,
16306 struct policy_handle *_hPrinter /* [in] [ref] */,
16307 uint32_t _JobId /* [in] */,
16308 const char *_pszName /* [in] [ref,charset(UTF16)] */,
16309 struct RPC_PrintPropertyValue *_pValue /* [out] [ref] */,
16312 struct spoolss_RpcGetJobNamedPropertyValue r;
16315 /* In parameters */
16316 r.in.hPrinter = _hPrinter;
16317 r.in.JobId = _JobId;
16318 r.in.pszName = _pszName;
16320 status = dcerpc_spoolss_RpcGetJobNamedPropertyValue_r(h, mem_ctx, &r);
16321 if (!NT_STATUS_IS_OK(status)) {
16325 /* Return variables */
16326 *_pValue = *r.out.pValue;
16328 /* Return result */
16329 *result = r.out.result;
16331 return NT_STATUS_OK;
16334 struct dcerpc_spoolss_RpcSetJobNamedProperty_r_state {
16335 TALLOC_CTX *out_mem_ctx;
16338 static void dcerpc_spoolss_RpcSetJobNamedProperty_r_done(struct tevent_req *subreq);
16340 struct tevent_req *dcerpc_spoolss_RpcSetJobNamedProperty_r_send(TALLOC_CTX *mem_ctx,
16341 struct tevent_context *ev,
16342 struct dcerpc_binding_handle *h,
16343 struct spoolss_RpcSetJobNamedProperty *r)
16345 struct tevent_req *req;
16346 struct dcerpc_spoolss_RpcSetJobNamedProperty_r_state *state;
16347 struct tevent_req *subreq;
16349 req = tevent_req_create(mem_ctx, &state,
16350 struct dcerpc_spoolss_RpcSetJobNamedProperty_r_state);
16355 state->out_mem_ctx = NULL;
16357 subreq = dcerpc_binding_handle_call_send(state, ev, h,
16358 NULL, &ndr_table_spoolss,
16359 NDR_SPOOLSS_RPCSETJOBNAMEDPROPERTY, state, r);
16360 if (tevent_req_nomem(subreq, req)) {
16361 return tevent_req_post(req, ev);
16363 tevent_req_set_callback(subreq, dcerpc_spoolss_RpcSetJobNamedProperty_r_done, req);
16368 static void dcerpc_spoolss_RpcSetJobNamedProperty_r_done(struct tevent_req *subreq)
16370 struct tevent_req *req =
16371 tevent_req_callback_data(subreq,
16372 struct tevent_req);
16375 status = dcerpc_binding_handle_call_recv(subreq);
16376 TALLOC_FREE(subreq);
16377 if (tevent_req_nterror(req, status)) {
16381 tevent_req_done(req);
16384 NTSTATUS dcerpc_spoolss_RpcSetJobNamedProperty_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
16386 struct dcerpc_spoolss_RpcSetJobNamedProperty_r_state *state =
16387 tevent_req_data(req,
16388 struct dcerpc_spoolss_RpcSetJobNamedProperty_r_state);
16391 if (tevent_req_is_nterror(req, &status)) {
16392 tevent_req_received(req);
16396 talloc_steal(mem_ctx, state->out_mem_ctx);
16398 tevent_req_received(req);
16399 return NT_STATUS_OK;
16402 NTSTATUS dcerpc_spoolss_RpcSetJobNamedProperty_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RpcSetJobNamedProperty *r)
16406 status = dcerpc_binding_handle_call(h,
16407 NULL, &ndr_table_spoolss,
16408 NDR_SPOOLSS_RPCSETJOBNAMEDPROPERTY, mem_ctx, r);
16413 struct dcerpc_spoolss_RpcSetJobNamedProperty_state {
16414 struct spoolss_RpcSetJobNamedProperty orig;
16415 struct spoolss_RpcSetJobNamedProperty tmp;
16416 TALLOC_CTX *out_mem_ctx;
16419 static void dcerpc_spoolss_RpcSetJobNamedProperty_done(struct tevent_req *subreq);
16421 struct tevent_req *dcerpc_spoolss_RpcSetJobNamedProperty_send(TALLOC_CTX *mem_ctx,
16422 struct tevent_context *ev,
16423 struct dcerpc_binding_handle *h,
16424 struct policy_handle *_hPrinter /* [in] [ref] */,
16425 uint32_t _JobId /* [in] */,
16426 struct RPC_PrintNamedProperty *_pProperty /* [in] [ref] */)
16428 struct tevent_req *req;
16429 struct dcerpc_spoolss_RpcSetJobNamedProperty_state *state;
16430 struct tevent_req *subreq;
16432 req = tevent_req_create(mem_ctx, &state,
16433 struct dcerpc_spoolss_RpcSetJobNamedProperty_state);
16437 state->out_mem_ctx = NULL;
16439 /* In parameters */
16440 state->orig.in.hPrinter = _hPrinter;
16441 state->orig.in.JobId = _JobId;
16442 state->orig.in.pProperty = _pProperty;
16444 /* Out parameters */
16447 ZERO_STRUCT(state->orig.out.result);
16449 /* make a temporary copy, that we pass to the dispatch function */
16450 state->tmp = state->orig;
16452 subreq = dcerpc_spoolss_RpcSetJobNamedProperty_r_send(state, ev, h, &state->tmp);
16453 if (tevent_req_nomem(subreq, req)) {
16454 return tevent_req_post(req, ev);
16456 tevent_req_set_callback(subreq, dcerpc_spoolss_RpcSetJobNamedProperty_done, req);
16460 static void dcerpc_spoolss_RpcSetJobNamedProperty_done(struct tevent_req *subreq)
16462 struct tevent_req *req = tevent_req_callback_data(
16463 subreq, struct tevent_req);
16464 struct dcerpc_spoolss_RpcSetJobNamedProperty_state *state = tevent_req_data(
16465 req, struct dcerpc_spoolss_RpcSetJobNamedProperty_state);
16467 TALLOC_CTX *mem_ctx;
16469 if (state->out_mem_ctx) {
16470 mem_ctx = state->out_mem_ctx;
16475 status = dcerpc_spoolss_RpcSetJobNamedProperty_r_recv(subreq, mem_ctx);
16476 TALLOC_FREE(subreq);
16477 if (tevent_req_nterror(req, status)) {
16481 /* Copy out parameters */
16484 state->orig.out.result = state->tmp.out.result;
16486 /* Reset temporary structure */
16487 ZERO_STRUCT(state->tmp);
16489 tevent_req_done(req);
16492 NTSTATUS dcerpc_spoolss_RpcSetJobNamedProperty_recv(struct tevent_req *req,
16493 TALLOC_CTX *mem_ctx,
16496 struct dcerpc_spoolss_RpcSetJobNamedProperty_state *state = tevent_req_data(
16497 req, struct dcerpc_spoolss_RpcSetJobNamedProperty_state);
16500 if (tevent_req_is_nterror(req, &status)) {
16501 tevent_req_received(req);
16505 /* Steal possible out parameters to the callers context */
16506 talloc_steal(mem_ctx, state->out_mem_ctx);
16508 /* Return result */
16509 *result = state->orig.out.result;
16511 tevent_req_received(req);
16512 return NT_STATUS_OK;
16515 NTSTATUS dcerpc_spoolss_RpcSetJobNamedProperty(struct dcerpc_binding_handle *h,
16516 TALLOC_CTX *mem_ctx,
16517 struct policy_handle *_hPrinter /* [in] [ref] */,
16518 uint32_t _JobId /* [in] */,
16519 struct RPC_PrintNamedProperty *_pProperty /* [in] [ref] */,
16522 struct spoolss_RpcSetJobNamedProperty r;
16525 /* In parameters */
16526 r.in.hPrinter = _hPrinter;
16527 r.in.JobId = _JobId;
16528 r.in.pProperty = _pProperty;
16530 status = dcerpc_spoolss_RpcSetJobNamedProperty_r(h, mem_ctx, &r);
16531 if (!NT_STATUS_IS_OK(status)) {
16535 /* Return variables */
16537 /* Return result */
16538 *result = r.out.result;
16540 return NT_STATUS_OK;
16543 struct dcerpc_spoolss_RpcDeleteJobNamedProperty_r_state {
16544 TALLOC_CTX *out_mem_ctx;
16547 static void dcerpc_spoolss_RpcDeleteJobNamedProperty_r_done(struct tevent_req *subreq);
16549 struct tevent_req *dcerpc_spoolss_RpcDeleteJobNamedProperty_r_send(TALLOC_CTX *mem_ctx,
16550 struct tevent_context *ev,
16551 struct dcerpc_binding_handle *h,
16552 struct spoolss_RpcDeleteJobNamedProperty *r)
16554 struct tevent_req *req;
16555 struct dcerpc_spoolss_RpcDeleteJobNamedProperty_r_state *state;
16556 struct tevent_req *subreq;
16558 req = tevent_req_create(mem_ctx, &state,
16559 struct dcerpc_spoolss_RpcDeleteJobNamedProperty_r_state);
16564 state->out_mem_ctx = NULL;
16566 subreq = dcerpc_binding_handle_call_send(state, ev, h,
16567 NULL, &ndr_table_spoolss,
16568 NDR_SPOOLSS_RPCDELETEJOBNAMEDPROPERTY, state, r);
16569 if (tevent_req_nomem(subreq, req)) {
16570 return tevent_req_post(req, ev);
16572 tevent_req_set_callback(subreq, dcerpc_spoolss_RpcDeleteJobNamedProperty_r_done, req);
16577 static void dcerpc_spoolss_RpcDeleteJobNamedProperty_r_done(struct tevent_req *subreq)
16579 struct tevent_req *req =
16580 tevent_req_callback_data(subreq,
16581 struct tevent_req);
16584 status = dcerpc_binding_handle_call_recv(subreq);
16585 TALLOC_FREE(subreq);
16586 if (tevent_req_nterror(req, status)) {
16590 tevent_req_done(req);
16593 NTSTATUS dcerpc_spoolss_RpcDeleteJobNamedProperty_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
16595 struct dcerpc_spoolss_RpcDeleteJobNamedProperty_r_state *state =
16596 tevent_req_data(req,
16597 struct dcerpc_spoolss_RpcDeleteJobNamedProperty_r_state);
16600 if (tevent_req_is_nterror(req, &status)) {
16601 tevent_req_received(req);
16605 talloc_steal(mem_ctx, state->out_mem_ctx);
16607 tevent_req_received(req);
16608 return NT_STATUS_OK;
16611 NTSTATUS dcerpc_spoolss_RpcDeleteJobNamedProperty_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RpcDeleteJobNamedProperty *r)
16615 status = dcerpc_binding_handle_call(h,
16616 NULL, &ndr_table_spoolss,
16617 NDR_SPOOLSS_RPCDELETEJOBNAMEDPROPERTY, mem_ctx, r);
16622 struct dcerpc_spoolss_RpcDeleteJobNamedProperty_state {
16623 struct spoolss_RpcDeleteJobNamedProperty orig;
16624 struct spoolss_RpcDeleteJobNamedProperty tmp;
16625 TALLOC_CTX *out_mem_ctx;
16628 static void dcerpc_spoolss_RpcDeleteJobNamedProperty_done(struct tevent_req *subreq);
16630 struct tevent_req *dcerpc_spoolss_RpcDeleteJobNamedProperty_send(TALLOC_CTX *mem_ctx,
16631 struct tevent_context *ev,
16632 struct dcerpc_binding_handle *h,
16633 struct policy_handle *_hPrinter /* [in] [ref] */,
16634 uint32_t _JobId /* [in] */,
16635 const char *_pszName /* [in] [ref,charset(UTF16)] */)
16637 struct tevent_req *req;
16638 struct dcerpc_spoolss_RpcDeleteJobNamedProperty_state *state;
16639 struct tevent_req *subreq;
16641 req = tevent_req_create(mem_ctx, &state,
16642 struct dcerpc_spoolss_RpcDeleteJobNamedProperty_state);
16646 state->out_mem_ctx = NULL;
16648 /* In parameters */
16649 state->orig.in.hPrinter = _hPrinter;
16650 state->orig.in.JobId = _JobId;
16651 state->orig.in.pszName = _pszName;
16653 /* Out parameters */
16656 ZERO_STRUCT(state->orig.out.result);
16658 /* make a temporary copy, that we pass to the dispatch function */
16659 state->tmp = state->orig;
16661 subreq = dcerpc_spoolss_RpcDeleteJobNamedProperty_r_send(state, ev, h, &state->tmp);
16662 if (tevent_req_nomem(subreq, req)) {
16663 return tevent_req_post(req, ev);
16665 tevent_req_set_callback(subreq, dcerpc_spoolss_RpcDeleteJobNamedProperty_done, req);
16669 static void dcerpc_spoolss_RpcDeleteJobNamedProperty_done(struct tevent_req *subreq)
16671 struct tevent_req *req = tevent_req_callback_data(
16672 subreq, struct tevent_req);
16673 struct dcerpc_spoolss_RpcDeleteJobNamedProperty_state *state = tevent_req_data(
16674 req, struct dcerpc_spoolss_RpcDeleteJobNamedProperty_state);
16676 TALLOC_CTX *mem_ctx;
16678 if (state->out_mem_ctx) {
16679 mem_ctx = state->out_mem_ctx;
16684 status = dcerpc_spoolss_RpcDeleteJobNamedProperty_r_recv(subreq, mem_ctx);
16685 TALLOC_FREE(subreq);
16686 if (tevent_req_nterror(req, status)) {
16690 /* Copy out parameters */
16693 state->orig.out.result = state->tmp.out.result;
16695 /* Reset temporary structure */
16696 ZERO_STRUCT(state->tmp);
16698 tevent_req_done(req);
16701 NTSTATUS dcerpc_spoolss_RpcDeleteJobNamedProperty_recv(struct tevent_req *req,
16702 TALLOC_CTX *mem_ctx,
16705 struct dcerpc_spoolss_RpcDeleteJobNamedProperty_state *state = tevent_req_data(
16706 req, struct dcerpc_spoolss_RpcDeleteJobNamedProperty_state);
16709 if (tevent_req_is_nterror(req, &status)) {
16710 tevent_req_received(req);
16714 /* Steal possible out parameters to the callers context */
16715 talloc_steal(mem_ctx, state->out_mem_ctx);
16717 /* Return result */
16718 *result = state->orig.out.result;
16720 tevent_req_received(req);
16721 return NT_STATUS_OK;
16724 NTSTATUS dcerpc_spoolss_RpcDeleteJobNamedProperty(struct dcerpc_binding_handle *h,
16725 TALLOC_CTX *mem_ctx,
16726 struct policy_handle *_hPrinter /* [in] [ref] */,
16727 uint32_t _JobId /* [in] */,
16728 const char *_pszName /* [in] [ref,charset(UTF16)] */,
16731 struct spoolss_RpcDeleteJobNamedProperty r;
16734 /* In parameters */
16735 r.in.hPrinter = _hPrinter;
16736 r.in.JobId = _JobId;
16737 r.in.pszName = _pszName;
16739 status = dcerpc_spoolss_RpcDeleteJobNamedProperty_r(h, mem_ctx, &r);
16740 if (!NT_STATUS_IS_OK(status)) {
16744 /* Return variables */
16746 /* Return result */
16747 *result = r.out.result;
16749 return NT_STATUS_OK;
16752 struct dcerpc_spoolss_RpcEnumJobNamedProperties_r_state {
16753 TALLOC_CTX *out_mem_ctx;
16756 static void dcerpc_spoolss_RpcEnumJobNamedProperties_r_done(struct tevent_req *subreq);
16758 struct tevent_req *dcerpc_spoolss_RpcEnumJobNamedProperties_r_send(TALLOC_CTX *mem_ctx,
16759 struct tevent_context *ev,
16760 struct dcerpc_binding_handle *h,
16761 struct spoolss_RpcEnumJobNamedProperties *r)
16763 struct tevent_req *req;
16764 struct dcerpc_spoolss_RpcEnumJobNamedProperties_r_state *state;
16765 struct tevent_req *subreq;
16767 req = tevent_req_create(mem_ctx, &state,
16768 struct dcerpc_spoolss_RpcEnumJobNamedProperties_r_state);
16773 state->out_mem_ctx = talloc_new(state);
16774 if (tevent_req_nomem(state->out_mem_ctx, req)) {
16775 return tevent_req_post(req, ev);
16778 subreq = dcerpc_binding_handle_call_send(state, ev, h,
16779 NULL, &ndr_table_spoolss,
16780 NDR_SPOOLSS_RPCENUMJOBNAMEDPROPERTIES, state->out_mem_ctx, r);
16781 if (tevent_req_nomem(subreq, req)) {
16782 return tevent_req_post(req, ev);
16784 tevent_req_set_callback(subreq, dcerpc_spoolss_RpcEnumJobNamedProperties_r_done, req);
16789 static void dcerpc_spoolss_RpcEnumJobNamedProperties_r_done(struct tevent_req *subreq)
16791 struct tevent_req *req =
16792 tevent_req_callback_data(subreq,
16793 struct tevent_req);
16796 status = dcerpc_binding_handle_call_recv(subreq);
16797 TALLOC_FREE(subreq);
16798 if (tevent_req_nterror(req, status)) {
16802 tevent_req_done(req);
16805 NTSTATUS dcerpc_spoolss_RpcEnumJobNamedProperties_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
16807 struct dcerpc_spoolss_RpcEnumJobNamedProperties_r_state *state =
16808 tevent_req_data(req,
16809 struct dcerpc_spoolss_RpcEnumJobNamedProperties_r_state);
16812 if (tevent_req_is_nterror(req, &status)) {
16813 tevent_req_received(req);
16817 talloc_steal(mem_ctx, state->out_mem_ctx);
16819 tevent_req_received(req);
16820 return NT_STATUS_OK;
16823 NTSTATUS dcerpc_spoolss_RpcEnumJobNamedProperties_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct spoolss_RpcEnumJobNamedProperties *r)
16827 status = dcerpc_binding_handle_call(h,
16828 NULL, &ndr_table_spoolss,
16829 NDR_SPOOLSS_RPCENUMJOBNAMEDPROPERTIES, mem_ctx, r);
16834 struct dcerpc_spoolss_RpcEnumJobNamedProperties_state {
16835 struct spoolss_RpcEnumJobNamedProperties orig;
16836 struct spoolss_RpcEnumJobNamedProperties tmp;
16837 TALLOC_CTX *out_mem_ctx;
16840 static void dcerpc_spoolss_RpcEnumJobNamedProperties_done(struct tevent_req *subreq);
16842 struct tevent_req *dcerpc_spoolss_RpcEnumJobNamedProperties_send(TALLOC_CTX *mem_ctx,
16843 struct tevent_context *ev,
16844 struct dcerpc_binding_handle *h,
16845 struct policy_handle *_hPrinter /* [in] [ref] */,
16846 uint32_t _JobId /* [in] */,
16847 uint32_t *_pcProperties /* [out] [ref] */,
16848 struct RPC_PrintNamedProperty **_ppProperties /* [out] [ref,size_is(,*pcProperties)] */)
16850 struct tevent_req *req;
16851 struct dcerpc_spoolss_RpcEnumJobNamedProperties_state *state;
16852 struct tevent_req *subreq;
16854 req = tevent_req_create(mem_ctx, &state,
16855 struct dcerpc_spoolss_RpcEnumJobNamedProperties_state);
16859 state->out_mem_ctx = NULL;
16861 /* In parameters */
16862 state->orig.in.hPrinter = _hPrinter;
16863 state->orig.in.JobId = _JobId;
16865 /* Out parameters */
16866 state->orig.out.pcProperties = _pcProperties;
16867 state->orig.out.ppProperties = _ppProperties;
16870 ZERO_STRUCT(state->orig.out.result);
16872 state->out_mem_ctx = talloc_named_const(state, 0,
16873 "dcerpc_spoolss_RpcEnumJobNamedProperties_out_memory");
16874 if (tevent_req_nomem(state->out_mem_ctx, req)) {
16875 return tevent_req_post(req, ev);
16878 /* make a temporary copy, that we pass to the dispatch function */
16879 state->tmp = state->orig;
16881 subreq = dcerpc_spoolss_RpcEnumJobNamedProperties_r_send(state, ev, h, &state->tmp);
16882 if (tevent_req_nomem(subreq, req)) {
16883 return tevent_req_post(req, ev);
16885 tevent_req_set_callback(subreq, dcerpc_spoolss_RpcEnumJobNamedProperties_done, req);
16889 static void dcerpc_spoolss_RpcEnumJobNamedProperties_done(struct tevent_req *subreq)
16891 struct tevent_req *req = tevent_req_callback_data(
16892 subreq, struct tevent_req);
16893 struct dcerpc_spoolss_RpcEnumJobNamedProperties_state *state = tevent_req_data(
16894 req, struct dcerpc_spoolss_RpcEnumJobNamedProperties_state);
16896 TALLOC_CTX *mem_ctx;
16898 if (state->out_mem_ctx) {
16899 mem_ctx = state->out_mem_ctx;
16904 status = dcerpc_spoolss_RpcEnumJobNamedProperties_r_recv(subreq, mem_ctx);
16905 TALLOC_FREE(subreq);
16906 if (tevent_req_nterror(req, status)) {
16910 /* Copy out parameters */
16911 *state->orig.out.pcProperties = *state->tmp.out.pcProperties;
16912 *state->orig.out.ppProperties = *state->tmp.out.ppProperties;
16915 state->orig.out.result = state->tmp.out.result;
16917 /* Reset temporary structure */
16918 ZERO_STRUCT(state->tmp);
16920 tevent_req_done(req);
16923 NTSTATUS dcerpc_spoolss_RpcEnumJobNamedProperties_recv(struct tevent_req *req,
16924 TALLOC_CTX *mem_ctx,
16927 struct dcerpc_spoolss_RpcEnumJobNamedProperties_state *state = tevent_req_data(
16928 req, struct dcerpc_spoolss_RpcEnumJobNamedProperties_state);
16931 if (tevent_req_is_nterror(req, &status)) {
16932 tevent_req_received(req);
16936 /* Steal possible out parameters to the callers context */
16937 talloc_steal(mem_ctx, state->out_mem_ctx);
16939 /* Return result */
16940 *result = state->orig.out.result;
16942 tevent_req_received(req);
16943 return NT_STATUS_OK;
16946 NTSTATUS dcerpc_spoolss_RpcEnumJobNamedProperties(struct dcerpc_binding_handle *h,
16947 TALLOC_CTX *mem_ctx,
16948 struct policy_handle *_hPrinter /* [in] [ref] */,
16949 uint32_t _JobId /* [in] */,
16950 uint32_t *_pcProperties /* [out] [ref] */,
16951 struct RPC_PrintNamedProperty **_ppProperties /* [out] [ref,size_is(,*pcProperties)] */,
16954 struct spoolss_RpcEnumJobNamedProperties r;
16957 /* In parameters */
16958 r.in.hPrinter = _hPrinter;
16959 r.in.JobId = _JobId;
16961 status = dcerpc_spoolss_RpcEnumJobNamedProperties_r(h, mem_ctx, &r);
16962 if (!NT_STATUS_IS_OK(status)) {
16966 /* Return variables */
16967 *_pcProperties = *r.out.pcProperties;
16968 *_ppProperties = *r.out.ppProperties;
16970 /* Return result */
16971 *result = r.out.result;
16973 return NT_STATUS_OK;