s3: re-run make samba3-idl.
[Samba.git] / librpc / gen_ndr / srv_spoolss.c
blob79efbb59708a1ca9d4341e31081ff0e6cd5dfd9f
1 /*
2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "../librpc/gen_ndr/srv_spoolss.h"
9 static bool api_spoolss_EnumPrinters(pipes_struct *p)
11 const struct ndr_interface_call *call;
12 struct ndr_pull *pull;
13 struct ndr_push *push;
14 enum ndr_err_code ndr_err;
15 DATA_BLOB blob;
16 struct spoolss_EnumPrinters *r;
18 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTERS];
20 r = talloc(talloc_tos(), struct spoolss_EnumPrinters);
21 if (r == NULL) {
22 return false;
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26 talloc_free(r);
27 return false;
30 pull = ndr_pull_init_blob(&blob, r, NULL);
31 if (pull == NULL) {
32 talloc_free(r);
33 return false;
36 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37 ndr_err = call->ndr_pull(pull, NDR_IN, r);
38 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
39 talloc_free(r);
40 return false;
43 if (DEBUGLEVEL >= 10) {
44 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinters, r);
47 ZERO_STRUCT(r->out);
48 r->out.count = talloc_zero(r, uint32_t);
49 if (r->out.count == NULL) {
50 talloc_free(r);
51 return false;
54 r->out.info = talloc_zero(r, union spoolss_PrinterInfo *);
55 if (r->out.info == NULL) {
56 talloc_free(r);
57 return false;
60 r->out.needed = talloc_zero(r, uint32_t);
61 if (r->out.needed == NULL) {
62 talloc_free(r);
63 return false;
66 r->out.result = _spoolss_EnumPrinters(p, r);
68 if (p->rng_fault_state) {
69 talloc_free(r);
70 /* Return true here, srv_pipe_hnd.c will take care */
71 return true;
74 if (DEBUGLEVEL >= 10) {
75 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinters, r);
78 push = ndr_push_init_ctx(r, NULL);
79 if (push == NULL) {
80 talloc_free(r);
81 return false;
84 ndr_err = call->ndr_push(push, NDR_OUT, r);
85 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
86 talloc_free(r);
87 return false;
90 blob = ndr_push_blob(push);
91 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
92 talloc_free(r);
93 return false;
96 talloc_free(r);
98 return true;
101 static bool api_spoolss_OpenPrinter(pipes_struct *p)
103 const struct ndr_interface_call *call;
104 struct ndr_pull *pull;
105 struct ndr_push *push;
106 enum ndr_err_code ndr_err;
107 DATA_BLOB blob;
108 struct spoolss_OpenPrinter *r;
110 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_OPENPRINTER];
112 r = talloc(talloc_tos(), struct spoolss_OpenPrinter);
113 if (r == NULL) {
114 return false;
117 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
118 talloc_free(r);
119 return false;
122 pull = ndr_pull_init_blob(&blob, r, NULL);
123 if (pull == NULL) {
124 talloc_free(r);
125 return false;
128 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
129 ndr_err = call->ndr_pull(pull, NDR_IN, r);
130 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
131 talloc_free(r);
132 return false;
135 if (DEBUGLEVEL >= 10) {
136 NDR_PRINT_IN_DEBUG(spoolss_OpenPrinter, r);
139 ZERO_STRUCT(r->out);
140 r->out.handle = talloc_zero(r, struct policy_handle);
141 if (r->out.handle == NULL) {
142 talloc_free(r);
143 return false;
146 r->out.result = _spoolss_OpenPrinter(p, r);
148 if (p->rng_fault_state) {
149 talloc_free(r);
150 /* Return true here, srv_pipe_hnd.c will take care */
151 return true;
154 if (DEBUGLEVEL >= 10) {
155 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinter, r);
158 push = ndr_push_init_ctx(r, NULL);
159 if (push == NULL) {
160 talloc_free(r);
161 return false;
164 ndr_err = call->ndr_push(push, NDR_OUT, r);
165 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
166 talloc_free(r);
167 return false;
170 blob = ndr_push_blob(push);
171 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
172 talloc_free(r);
173 return false;
176 talloc_free(r);
178 return true;
181 static bool api_spoolss_SetJob(pipes_struct *p)
183 const struct ndr_interface_call *call;
184 struct ndr_pull *pull;
185 struct ndr_push *push;
186 enum ndr_err_code ndr_err;
187 DATA_BLOB blob;
188 struct spoolss_SetJob *r;
190 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SETJOB];
192 r = talloc(talloc_tos(), struct spoolss_SetJob);
193 if (r == NULL) {
194 return false;
197 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
198 talloc_free(r);
199 return false;
202 pull = ndr_pull_init_blob(&blob, r, NULL);
203 if (pull == NULL) {
204 talloc_free(r);
205 return false;
208 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
209 ndr_err = call->ndr_pull(pull, NDR_IN, r);
210 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
211 talloc_free(r);
212 return false;
215 if (DEBUGLEVEL >= 10) {
216 NDR_PRINT_IN_DEBUG(spoolss_SetJob, r);
219 r->out.result = _spoolss_SetJob(p, r);
221 if (p->rng_fault_state) {
222 talloc_free(r);
223 /* Return true here, srv_pipe_hnd.c will take care */
224 return true;
227 if (DEBUGLEVEL >= 10) {
228 NDR_PRINT_OUT_DEBUG(spoolss_SetJob, r);
231 push = ndr_push_init_ctx(r, NULL);
232 if (push == NULL) {
233 talloc_free(r);
234 return false;
237 ndr_err = call->ndr_push(push, NDR_OUT, r);
238 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
239 talloc_free(r);
240 return false;
243 blob = ndr_push_blob(push);
244 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
245 talloc_free(r);
246 return false;
249 talloc_free(r);
251 return true;
254 static bool api_spoolss_GetJob(pipes_struct *p)
256 const struct ndr_interface_call *call;
257 struct ndr_pull *pull;
258 struct ndr_push *push;
259 enum ndr_err_code ndr_err;
260 DATA_BLOB blob;
261 struct spoolss_GetJob *r;
263 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETJOB];
265 r = talloc(talloc_tos(), struct spoolss_GetJob);
266 if (r == NULL) {
267 return false;
270 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
271 talloc_free(r);
272 return false;
275 pull = ndr_pull_init_blob(&blob, r, NULL);
276 if (pull == NULL) {
277 talloc_free(r);
278 return false;
281 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
282 ndr_err = call->ndr_pull(pull, NDR_IN, r);
283 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
284 talloc_free(r);
285 return false;
288 if (DEBUGLEVEL >= 10) {
289 NDR_PRINT_IN_DEBUG(spoolss_GetJob, r);
292 ZERO_STRUCT(r->out);
293 r->out.info = talloc_zero(r, union spoolss_JobInfo);
294 if (r->out.info == NULL) {
295 talloc_free(r);
296 return false;
299 r->out.needed = talloc_zero(r, uint32_t);
300 if (r->out.needed == NULL) {
301 talloc_free(r);
302 return false;
305 r->out.result = _spoolss_GetJob(p, r);
307 if (p->rng_fault_state) {
308 talloc_free(r);
309 /* Return true here, srv_pipe_hnd.c will take care */
310 return true;
313 if (DEBUGLEVEL >= 10) {
314 NDR_PRINT_OUT_DEBUG(spoolss_GetJob, r);
317 push = ndr_push_init_ctx(r, NULL);
318 if (push == NULL) {
319 talloc_free(r);
320 return false;
323 ndr_err = call->ndr_push(push, NDR_OUT, r);
324 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
325 talloc_free(r);
326 return false;
329 blob = ndr_push_blob(push);
330 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
331 talloc_free(r);
332 return false;
335 talloc_free(r);
337 return true;
340 static bool api_spoolss_EnumJobs(pipes_struct *p)
342 const struct ndr_interface_call *call;
343 struct ndr_pull *pull;
344 struct ndr_push *push;
345 enum ndr_err_code ndr_err;
346 DATA_BLOB blob;
347 struct spoolss_EnumJobs *r;
349 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMJOBS];
351 r = talloc(talloc_tos(), struct spoolss_EnumJobs);
352 if (r == NULL) {
353 return false;
356 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
357 talloc_free(r);
358 return false;
361 pull = ndr_pull_init_blob(&blob, r, NULL);
362 if (pull == NULL) {
363 talloc_free(r);
364 return false;
367 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
368 ndr_err = call->ndr_pull(pull, NDR_IN, r);
369 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
370 talloc_free(r);
371 return false;
374 if (DEBUGLEVEL >= 10) {
375 NDR_PRINT_IN_DEBUG(spoolss_EnumJobs, r);
378 ZERO_STRUCT(r->out);
379 r->out.count = talloc_zero(r, uint32_t);
380 if (r->out.count == NULL) {
381 talloc_free(r);
382 return false;
385 r->out.info = talloc_zero(r, union spoolss_JobInfo *);
386 if (r->out.info == NULL) {
387 talloc_free(r);
388 return false;
391 r->out.needed = talloc_zero(r, uint32_t);
392 if (r->out.needed == NULL) {
393 talloc_free(r);
394 return false;
397 r->out.result = _spoolss_EnumJobs(p, r);
399 if (p->rng_fault_state) {
400 talloc_free(r);
401 /* Return true here, srv_pipe_hnd.c will take care */
402 return true;
405 if (DEBUGLEVEL >= 10) {
406 NDR_PRINT_OUT_DEBUG(spoolss_EnumJobs, r);
409 push = ndr_push_init_ctx(r, NULL);
410 if (push == NULL) {
411 talloc_free(r);
412 return false;
415 ndr_err = call->ndr_push(push, NDR_OUT, r);
416 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
417 talloc_free(r);
418 return false;
421 blob = ndr_push_blob(push);
422 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
423 talloc_free(r);
424 return false;
427 talloc_free(r);
429 return true;
432 static bool api_spoolss_AddPrinter(pipes_struct *p)
434 const struct ndr_interface_call *call;
435 struct ndr_pull *pull;
436 struct ndr_push *push;
437 enum ndr_err_code ndr_err;
438 DATA_BLOB blob;
439 struct spoolss_AddPrinter *r;
441 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTER];
443 r = talloc(talloc_tos(), struct spoolss_AddPrinter);
444 if (r == NULL) {
445 return false;
448 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
449 talloc_free(r);
450 return false;
453 pull = ndr_pull_init_blob(&blob, r, NULL);
454 if (pull == NULL) {
455 talloc_free(r);
456 return false;
459 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
460 ndr_err = call->ndr_pull(pull, NDR_IN, r);
461 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
462 talloc_free(r);
463 return false;
466 if (DEBUGLEVEL >= 10) {
467 NDR_PRINT_IN_DEBUG(spoolss_AddPrinter, r);
470 r->out.result = _spoolss_AddPrinter(p, r);
472 if (p->rng_fault_state) {
473 talloc_free(r);
474 /* Return true here, srv_pipe_hnd.c will take care */
475 return true;
478 if (DEBUGLEVEL >= 10) {
479 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinter, r);
482 push = ndr_push_init_ctx(r, NULL);
483 if (push == NULL) {
484 talloc_free(r);
485 return false;
488 ndr_err = call->ndr_push(push, NDR_OUT, r);
489 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
490 talloc_free(r);
491 return false;
494 blob = ndr_push_blob(push);
495 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
496 talloc_free(r);
497 return false;
500 talloc_free(r);
502 return true;
505 static bool api_spoolss_DeletePrinter(pipes_struct *p)
507 const struct ndr_interface_call *call;
508 struct ndr_pull *pull;
509 struct ndr_push *push;
510 enum ndr_err_code ndr_err;
511 DATA_BLOB blob;
512 struct spoolss_DeletePrinter *r;
514 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTER];
516 r = talloc(talloc_tos(), struct spoolss_DeletePrinter);
517 if (r == NULL) {
518 return false;
521 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
522 talloc_free(r);
523 return false;
526 pull = ndr_pull_init_blob(&blob, r, NULL);
527 if (pull == NULL) {
528 talloc_free(r);
529 return false;
532 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
533 ndr_err = call->ndr_pull(pull, NDR_IN, r);
534 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
535 talloc_free(r);
536 return false;
539 if (DEBUGLEVEL >= 10) {
540 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinter, r);
543 r->out.result = _spoolss_DeletePrinter(p, r);
545 if (p->rng_fault_state) {
546 talloc_free(r);
547 /* Return true here, srv_pipe_hnd.c will take care */
548 return true;
551 if (DEBUGLEVEL >= 10) {
552 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinter, r);
555 push = ndr_push_init_ctx(r, NULL);
556 if (push == NULL) {
557 talloc_free(r);
558 return false;
561 ndr_err = call->ndr_push(push, NDR_OUT, r);
562 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
563 talloc_free(r);
564 return false;
567 blob = ndr_push_blob(push);
568 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
569 talloc_free(r);
570 return false;
573 talloc_free(r);
575 return true;
578 static bool api_spoolss_SetPrinter(pipes_struct *p)
580 const struct ndr_interface_call *call;
581 struct ndr_pull *pull;
582 struct ndr_push *push;
583 enum ndr_err_code ndr_err;
584 DATA_BLOB blob;
585 struct spoolss_SetPrinter *r;
587 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SETPRINTER];
589 r = talloc(talloc_tos(), struct spoolss_SetPrinter);
590 if (r == NULL) {
591 return false;
594 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
595 talloc_free(r);
596 return false;
599 pull = ndr_pull_init_blob(&blob, r, NULL);
600 if (pull == NULL) {
601 talloc_free(r);
602 return false;
605 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
606 ndr_err = call->ndr_pull(pull, NDR_IN, r);
607 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
608 talloc_free(r);
609 return false;
612 if (DEBUGLEVEL >= 10) {
613 NDR_PRINT_IN_DEBUG(spoolss_SetPrinter, r);
616 r->out.result = _spoolss_SetPrinter(p, r);
618 if (p->rng_fault_state) {
619 talloc_free(r);
620 /* Return true here, srv_pipe_hnd.c will take care */
621 return true;
624 if (DEBUGLEVEL >= 10) {
625 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinter, r);
628 push = ndr_push_init_ctx(r, NULL);
629 if (push == NULL) {
630 talloc_free(r);
631 return false;
634 ndr_err = call->ndr_push(push, NDR_OUT, r);
635 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
636 talloc_free(r);
637 return false;
640 blob = ndr_push_blob(push);
641 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
642 talloc_free(r);
643 return false;
646 talloc_free(r);
648 return true;
651 static bool api_spoolss_GetPrinter(pipes_struct *p)
653 const struct ndr_interface_call *call;
654 struct ndr_pull *pull;
655 struct ndr_push *push;
656 enum ndr_err_code ndr_err;
657 DATA_BLOB blob;
658 struct spoolss_GetPrinter *r;
660 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETPRINTER];
662 r = talloc(talloc_tos(), struct spoolss_GetPrinter);
663 if (r == NULL) {
664 return false;
667 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
668 talloc_free(r);
669 return false;
672 pull = ndr_pull_init_blob(&blob, r, NULL);
673 if (pull == NULL) {
674 talloc_free(r);
675 return false;
678 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
679 ndr_err = call->ndr_pull(pull, NDR_IN, r);
680 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
681 talloc_free(r);
682 return false;
685 if (DEBUGLEVEL >= 10) {
686 NDR_PRINT_IN_DEBUG(spoolss_GetPrinter, r);
689 ZERO_STRUCT(r->out);
690 r->out.info = talloc_zero(r, union spoolss_PrinterInfo);
691 if (r->out.info == NULL) {
692 talloc_free(r);
693 return false;
696 r->out.needed = talloc_zero(r, uint32_t);
697 if (r->out.needed == NULL) {
698 talloc_free(r);
699 return false;
702 r->out.result = _spoolss_GetPrinter(p, r);
704 if (p->rng_fault_state) {
705 talloc_free(r);
706 /* Return true here, srv_pipe_hnd.c will take care */
707 return true;
710 if (DEBUGLEVEL >= 10) {
711 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinter, r);
714 push = ndr_push_init_ctx(r, NULL);
715 if (push == NULL) {
716 talloc_free(r);
717 return false;
720 ndr_err = call->ndr_push(push, NDR_OUT, r);
721 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
722 talloc_free(r);
723 return false;
726 blob = ndr_push_blob(push);
727 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
728 talloc_free(r);
729 return false;
732 talloc_free(r);
734 return true;
737 static bool api_spoolss_AddPrinterDriver(pipes_struct *p)
739 const struct ndr_interface_call *call;
740 struct ndr_pull *pull;
741 struct ndr_push *push;
742 enum ndr_err_code ndr_err;
743 DATA_BLOB blob;
744 struct spoolss_AddPrinterDriver *r;
746 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTERDRIVER];
748 r = talloc(talloc_tos(), struct spoolss_AddPrinterDriver);
749 if (r == NULL) {
750 return false;
753 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
754 talloc_free(r);
755 return false;
758 pull = ndr_pull_init_blob(&blob, r, NULL);
759 if (pull == NULL) {
760 talloc_free(r);
761 return false;
764 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
765 ndr_err = call->ndr_pull(pull, NDR_IN, r);
766 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
767 talloc_free(r);
768 return false;
771 if (DEBUGLEVEL >= 10) {
772 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriver, r);
775 r->out.result = _spoolss_AddPrinterDriver(p, r);
777 if (p->rng_fault_state) {
778 talloc_free(r);
779 /* Return true here, srv_pipe_hnd.c will take care */
780 return true;
783 if (DEBUGLEVEL >= 10) {
784 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriver, r);
787 push = ndr_push_init_ctx(r, NULL);
788 if (push == NULL) {
789 talloc_free(r);
790 return false;
793 ndr_err = call->ndr_push(push, NDR_OUT, r);
794 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
795 talloc_free(r);
796 return false;
799 blob = ndr_push_blob(push);
800 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
801 talloc_free(r);
802 return false;
805 talloc_free(r);
807 return true;
810 static bool api_spoolss_EnumPrinterDrivers(pipes_struct *p)
812 const struct ndr_interface_call *call;
813 struct ndr_pull *pull;
814 struct ndr_push *push;
815 enum ndr_err_code ndr_err;
816 DATA_BLOB blob;
817 struct spoolss_EnumPrinterDrivers *r;
819 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTERDRIVERS];
821 r = talloc(talloc_tos(), struct spoolss_EnumPrinterDrivers);
822 if (r == NULL) {
823 return false;
826 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
827 talloc_free(r);
828 return false;
831 pull = ndr_pull_init_blob(&blob, r, NULL);
832 if (pull == NULL) {
833 talloc_free(r);
834 return false;
837 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
838 ndr_err = call->ndr_pull(pull, NDR_IN, r);
839 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
840 talloc_free(r);
841 return false;
844 if (DEBUGLEVEL >= 10) {
845 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDrivers, r);
848 ZERO_STRUCT(r->out);
849 r->out.count = talloc_zero(r, uint32_t);
850 if (r->out.count == NULL) {
851 talloc_free(r);
852 return false;
855 r->out.info = talloc_zero(r, union spoolss_DriverInfo *);
856 if (r->out.info == NULL) {
857 talloc_free(r);
858 return false;
861 r->out.needed = talloc_zero(r, uint32_t);
862 if (r->out.needed == NULL) {
863 talloc_free(r);
864 return false;
867 r->out.result = _spoolss_EnumPrinterDrivers(p, r);
869 if (p->rng_fault_state) {
870 talloc_free(r);
871 /* Return true here, srv_pipe_hnd.c will take care */
872 return true;
875 if (DEBUGLEVEL >= 10) {
876 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDrivers, r);
879 push = ndr_push_init_ctx(r, NULL);
880 if (push == NULL) {
881 talloc_free(r);
882 return false;
885 ndr_err = call->ndr_push(push, NDR_OUT, r);
886 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
887 talloc_free(r);
888 return false;
891 blob = ndr_push_blob(push);
892 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
893 talloc_free(r);
894 return false;
897 talloc_free(r);
899 return true;
902 static bool api_spoolss_GetPrinterDriver(pipes_struct *p)
904 const struct ndr_interface_call *call;
905 struct ndr_pull *pull;
906 struct ndr_push *push;
907 enum ndr_err_code ndr_err;
908 DATA_BLOB blob;
909 struct spoolss_GetPrinterDriver *r;
911 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETPRINTERDRIVER];
913 r = talloc(talloc_tos(), struct spoolss_GetPrinterDriver);
914 if (r == NULL) {
915 return false;
918 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
919 talloc_free(r);
920 return false;
923 pull = ndr_pull_init_blob(&blob, r, NULL);
924 if (pull == NULL) {
925 talloc_free(r);
926 return false;
929 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
930 ndr_err = call->ndr_pull(pull, NDR_IN, r);
931 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
932 talloc_free(r);
933 return false;
936 if (DEBUGLEVEL >= 10) {
937 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver, r);
940 r->out.result = _spoolss_GetPrinterDriver(p, r);
942 if (p->rng_fault_state) {
943 talloc_free(r);
944 /* Return true here, srv_pipe_hnd.c will take care */
945 return true;
948 if (DEBUGLEVEL >= 10) {
949 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver, r);
952 push = ndr_push_init_ctx(r, NULL);
953 if (push == NULL) {
954 talloc_free(r);
955 return false;
958 ndr_err = call->ndr_push(push, NDR_OUT, r);
959 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
960 talloc_free(r);
961 return false;
964 blob = ndr_push_blob(push);
965 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
966 talloc_free(r);
967 return false;
970 talloc_free(r);
972 return true;
975 static bool api_spoolss_GetPrinterDriverDirectory(pipes_struct *p)
977 const struct ndr_interface_call *call;
978 struct ndr_pull *pull;
979 struct ndr_push *push;
980 enum ndr_err_code ndr_err;
981 DATA_BLOB blob;
982 struct spoolss_GetPrinterDriverDirectory *r;
984 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY];
986 r = talloc(talloc_tos(), struct spoolss_GetPrinterDriverDirectory);
987 if (r == NULL) {
988 return false;
991 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
992 talloc_free(r);
993 return false;
996 pull = ndr_pull_init_blob(&blob, r, NULL);
997 if (pull == NULL) {
998 talloc_free(r);
999 return false;
1002 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1003 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1004 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1005 talloc_free(r);
1006 return false;
1009 if (DEBUGLEVEL >= 10) {
1010 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriverDirectory, r);
1013 ZERO_STRUCT(r->out);
1014 r->out.info = talloc_zero(r, union spoolss_DriverDirectoryInfo);
1015 if (r->out.info == NULL) {
1016 talloc_free(r);
1017 return false;
1020 r->out.needed = talloc_zero(r, uint32_t);
1021 if (r->out.needed == NULL) {
1022 talloc_free(r);
1023 return false;
1026 r->out.result = _spoolss_GetPrinterDriverDirectory(p, r);
1028 if (p->rng_fault_state) {
1029 talloc_free(r);
1030 /* Return true here, srv_pipe_hnd.c will take care */
1031 return true;
1034 if (DEBUGLEVEL >= 10) {
1035 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverDirectory, r);
1038 push = ndr_push_init_ctx(r, NULL);
1039 if (push == NULL) {
1040 talloc_free(r);
1041 return false;
1044 ndr_err = call->ndr_push(push, NDR_OUT, r);
1045 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1046 talloc_free(r);
1047 return false;
1050 blob = ndr_push_blob(push);
1051 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1052 talloc_free(r);
1053 return false;
1056 talloc_free(r);
1058 return true;
1061 static bool api_spoolss_DeletePrinterDriver(pipes_struct *p)
1063 const struct ndr_interface_call *call;
1064 struct ndr_pull *pull;
1065 struct ndr_push *push;
1066 enum ndr_err_code ndr_err;
1067 DATA_BLOB blob;
1068 struct spoolss_DeletePrinterDriver *r;
1070 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERDRIVER];
1072 r = talloc(talloc_tos(), struct spoolss_DeletePrinterDriver);
1073 if (r == NULL) {
1074 return false;
1077 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1078 talloc_free(r);
1079 return false;
1082 pull = ndr_pull_init_blob(&blob, r, NULL);
1083 if (pull == NULL) {
1084 talloc_free(r);
1085 return false;
1088 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1089 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1090 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1091 talloc_free(r);
1092 return false;
1095 if (DEBUGLEVEL >= 10) {
1096 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriver, r);
1099 r->out.result = _spoolss_DeletePrinterDriver(p, r);
1101 if (p->rng_fault_state) {
1102 talloc_free(r);
1103 /* Return true here, srv_pipe_hnd.c will take care */
1104 return true;
1107 if (DEBUGLEVEL >= 10) {
1108 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriver, r);
1111 push = ndr_push_init_ctx(r, NULL);
1112 if (push == NULL) {
1113 talloc_free(r);
1114 return false;
1117 ndr_err = call->ndr_push(push, NDR_OUT, r);
1118 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1119 talloc_free(r);
1120 return false;
1123 blob = ndr_push_blob(push);
1124 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1125 talloc_free(r);
1126 return false;
1129 talloc_free(r);
1131 return true;
1134 static bool api_spoolss_AddPrintProcessor(pipes_struct *p)
1136 const struct ndr_interface_call *call;
1137 struct ndr_pull *pull;
1138 struct ndr_push *push;
1139 enum ndr_err_code ndr_err;
1140 DATA_BLOB blob;
1141 struct spoolss_AddPrintProcessor *r;
1143 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTPROCESSOR];
1145 r = talloc(talloc_tos(), struct spoolss_AddPrintProcessor);
1146 if (r == NULL) {
1147 return false;
1150 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1151 talloc_free(r);
1152 return false;
1155 pull = ndr_pull_init_blob(&blob, r, NULL);
1156 if (pull == NULL) {
1157 talloc_free(r);
1158 return false;
1161 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1162 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1163 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1164 talloc_free(r);
1165 return false;
1168 if (DEBUGLEVEL >= 10) {
1169 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProcessor, r);
1172 r->out.result = _spoolss_AddPrintProcessor(p, r);
1174 if (p->rng_fault_state) {
1175 talloc_free(r);
1176 /* Return true here, srv_pipe_hnd.c will take care */
1177 return true;
1180 if (DEBUGLEVEL >= 10) {
1181 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProcessor, r);
1184 push = ndr_push_init_ctx(r, NULL);
1185 if (push == NULL) {
1186 talloc_free(r);
1187 return false;
1190 ndr_err = call->ndr_push(push, NDR_OUT, r);
1191 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1192 talloc_free(r);
1193 return false;
1196 blob = ndr_push_blob(push);
1197 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1198 talloc_free(r);
1199 return false;
1202 talloc_free(r);
1204 return true;
1207 static bool api_spoolss_EnumPrintProcessors(pipes_struct *p)
1209 const struct ndr_interface_call *call;
1210 struct ndr_pull *pull;
1211 struct ndr_push *push;
1212 enum ndr_err_code ndr_err;
1213 DATA_BLOB blob;
1214 struct spoolss_EnumPrintProcessors *r;
1216 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTPROCESSORS];
1218 r = talloc(talloc_tos(), struct spoolss_EnumPrintProcessors);
1219 if (r == NULL) {
1220 return false;
1223 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1224 talloc_free(r);
1225 return false;
1228 pull = ndr_pull_init_blob(&blob, r, NULL);
1229 if (pull == NULL) {
1230 talloc_free(r);
1231 return false;
1234 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1235 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1236 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1237 talloc_free(r);
1238 return false;
1241 if (DEBUGLEVEL >= 10) {
1242 NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcessors, r);
1245 ZERO_STRUCT(r->out);
1246 r->out.count = talloc_zero(r, uint32_t);
1247 if (r->out.count == NULL) {
1248 talloc_free(r);
1249 return false;
1252 r->out.info = talloc_zero(r, union spoolss_PrintProcessorInfo *);
1253 if (r->out.info == NULL) {
1254 talloc_free(r);
1255 return false;
1258 r->out.needed = talloc_zero(r, uint32_t);
1259 if (r->out.needed == NULL) {
1260 talloc_free(r);
1261 return false;
1264 r->out.result = _spoolss_EnumPrintProcessors(p, r);
1266 if (p->rng_fault_state) {
1267 talloc_free(r);
1268 /* Return true here, srv_pipe_hnd.c will take care */
1269 return true;
1272 if (DEBUGLEVEL >= 10) {
1273 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcessors, r);
1276 push = ndr_push_init_ctx(r, NULL);
1277 if (push == NULL) {
1278 talloc_free(r);
1279 return false;
1282 ndr_err = call->ndr_push(push, NDR_OUT, r);
1283 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1284 talloc_free(r);
1285 return false;
1288 blob = ndr_push_blob(push);
1289 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1290 talloc_free(r);
1291 return false;
1294 talloc_free(r);
1296 return true;
1299 static bool api_spoolss_GetPrintProcessorDirectory(pipes_struct *p)
1301 const struct ndr_interface_call *call;
1302 struct ndr_pull *pull;
1303 struct ndr_push *push;
1304 enum ndr_err_code ndr_err;
1305 DATA_BLOB blob;
1306 struct spoolss_GetPrintProcessorDirectory *r;
1308 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY];
1310 r = talloc(talloc_tos(), struct spoolss_GetPrintProcessorDirectory);
1311 if (r == NULL) {
1312 return false;
1315 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1316 talloc_free(r);
1317 return false;
1320 pull = ndr_pull_init_blob(&blob, r, NULL);
1321 if (pull == NULL) {
1322 talloc_free(r);
1323 return false;
1326 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1327 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1328 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1329 talloc_free(r);
1330 return false;
1333 if (DEBUGLEVEL >= 10) {
1334 NDR_PRINT_IN_DEBUG(spoolss_GetPrintProcessorDirectory, r);
1337 ZERO_STRUCT(r->out);
1338 r->out.info = talloc_zero(r, union spoolss_PrintProcessorDirectoryInfo);
1339 if (r->out.info == NULL) {
1340 talloc_free(r);
1341 return false;
1344 r->out.needed = talloc_zero(r, uint32_t);
1345 if (r->out.needed == NULL) {
1346 talloc_free(r);
1347 return false;
1350 r->out.result = _spoolss_GetPrintProcessorDirectory(p, r);
1352 if (p->rng_fault_state) {
1353 talloc_free(r);
1354 /* Return true here, srv_pipe_hnd.c will take care */
1355 return true;
1358 if (DEBUGLEVEL >= 10) {
1359 NDR_PRINT_OUT_DEBUG(spoolss_GetPrintProcessorDirectory, r);
1362 push = ndr_push_init_ctx(r, NULL);
1363 if (push == NULL) {
1364 talloc_free(r);
1365 return false;
1368 ndr_err = call->ndr_push(push, NDR_OUT, r);
1369 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1370 talloc_free(r);
1371 return false;
1374 blob = ndr_push_blob(push);
1375 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1376 talloc_free(r);
1377 return false;
1380 talloc_free(r);
1382 return true;
1385 static bool api_spoolss_StartDocPrinter(pipes_struct *p)
1387 const struct ndr_interface_call *call;
1388 struct ndr_pull *pull;
1389 struct ndr_push *push;
1390 enum ndr_err_code ndr_err;
1391 DATA_BLOB blob;
1392 struct spoolss_StartDocPrinter *r;
1394 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_STARTDOCPRINTER];
1396 r = talloc(talloc_tos(), struct spoolss_StartDocPrinter);
1397 if (r == NULL) {
1398 return false;
1401 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1402 talloc_free(r);
1403 return false;
1406 pull = ndr_pull_init_blob(&blob, r, NULL);
1407 if (pull == NULL) {
1408 talloc_free(r);
1409 return false;
1412 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1413 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1414 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1415 talloc_free(r);
1416 return false;
1419 if (DEBUGLEVEL >= 10) {
1420 NDR_PRINT_IN_DEBUG(spoolss_StartDocPrinter, r);
1423 ZERO_STRUCT(r->out);
1424 r->out.job_id = talloc_zero(r, uint32_t);
1425 if (r->out.job_id == NULL) {
1426 talloc_free(r);
1427 return false;
1430 r->out.result = _spoolss_StartDocPrinter(p, r);
1432 if (p->rng_fault_state) {
1433 talloc_free(r);
1434 /* Return true here, srv_pipe_hnd.c will take care */
1435 return true;
1438 if (DEBUGLEVEL >= 10) {
1439 NDR_PRINT_OUT_DEBUG(spoolss_StartDocPrinter, r);
1442 push = ndr_push_init_ctx(r, NULL);
1443 if (push == NULL) {
1444 talloc_free(r);
1445 return false;
1448 ndr_err = call->ndr_push(push, NDR_OUT, r);
1449 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1450 talloc_free(r);
1451 return false;
1454 blob = ndr_push_blob(push);
1455 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1456 talloc_free(r);
1457 return false;
1460 talloc_free(r);
1462 return true;
1465 static bool api_spoolss_StartPagePrinter(pipes_struct *p)
1467 const struct ndr_interface_call *call;
1468 struct ndr_pull *pull;
1469 struct ndr_push *push;
1470 enum ndr_err_code ndr_err;
1471 DATA_BLOB blob;
1472 struct spoolss_StartPagePrinter *r;
1474 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_STARTPAGEPRINTER];
1476 r = talloc(talloc_tos(), struct spoolss_StartPagePrinter);
1477 if (r == NULL) {
1478 return false;
1481 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1482 talloc_free(r);
1483 return false;
1486 pull = ndr_pull_init_blob(&blob, r, NULL);
1487 if (pull == NULL) {
1488 talloc_free(r);
1489 return false;
1492 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1493 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1494 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1495 talloc_free(r);
1496 return false;
1499 if (DEBUGLEVEL >= 10) {
1500 NDR_PRINT_IN_DEBUG(spoolss_StartPagePrinter, r);
1503 r->out.result = _spoolss_StartPagePrinter(p, r);
1505 if (p->rng_fault_state) {
1506 talloc_free(r);
1507 /* Return true here, srv_pipe_hnd.c will take care */
1508 return true;
1511 if (DEBUGLEVEL >= 10) {
1512 NDR_PRINT_OUT_DEBUG(spoolss_StartPagePrinter, r);
1515 push = ndr_push_init_ctx(r, NULL);
1516 if (push == NULL) {
1517 talloc_free(r);
1518 return false;
1521 ndr_err = call->ndr_push(push, NDR_OUT, r);
1522 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1523 talloc_free(r);
1524 return false;
1527 blob = ndr_push_blob(push);
1528 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1529 talloc_free(r);
1530 return false;
1533 talloc_free(r);
1535 return true;
1538 static bool api_spoolss_WritePrinter(pipes_struct *p)
1540 const struct ndr_interface_call *call;
1541 struct ndr_pull *pull;
1542 struct ndr_push *push;
1543 enum ndr_err_code ndr_err;
1544 DATA_BLOB blob;
1545 struct spoolss_WritePrinter *r;
1547 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_WRITEPRINTER];
1549 r = talloc(talloc_tos(), struct spoolss_WritePrinter);
1550 if (r == NULL) {
1551 return false;
1554 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1555 talloc_free(r);
1556 return false;
1559 pull = ndr_pull_init_blob(&blob, r, NULL);
1560 if (pull == NULL) {
1561 talloc_free(r);
1562 return false;
1565 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1566 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1567 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1568 talloc_free(r);
1569 return false;
1572 if (DEBUGLEVEL >= 10) {
1573 NDR_PRINT_IN_DEBUG(spoolss_WritePrinter, r);
1576 ZERO_STRUCT(r->out);
1577 r->out.num_written = talloc_zero(r, uint32_t);
1578 if (r->out.num_written == NULL) {
1579 talloc_free(r);
1580 return false;
1583 r->out.result = _spoolss_WritePrinter(p, r);
1585 if (p->rng_fault_state) {
1586 talloc_free(r);
1587 /* Return true here, srv_pipe_hnd.c will take care */
1588 return true;
1591 if (DEBUGLEVEL >= 10) {
1592 NDR_PRINT_OUT_DEBUG(spoolss_WritePrinter, r);
1595 push = ndr_push_init_ctx(r, NULL);
1596 if (push == NULL) {
1597 talloc_free(r);
1598 return false;
1601 ndr_err = call->ndr_push(push, NDR_OUT, r);
1602 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1603 talloc_free(r);
1604 return false;
1607 blob = ndr_push_blob(push);
1608 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1609 talloc_free(r);
1610 return false;
1613 talloc_free(r);
1615 return true;
1618 static bool api_spoolss_EndPagePrinter(pipes_struct *p)
1620 const struct ndr_interface_call *call;
1621 struct ndr_pull *pull;
1622 struct ndr_push *push;
1623 enum ndr_err_code ndr_err;
1624 DATA_BLOB blob;
1625 struct spoolss_EndPagePrinter *r;
1627 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENDPAGEPRINTER];
1629 r = talloc(talloc_tos(), struct spoolss_EndPagePrinter);
1630 if (r == NULL) {
1631 return false;
1634 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1635 talloc_free(r);
1636 return false;
1639 pull = ndr_pull_init_blob(&blob, r, NULL);
1640 if (pull == NULL) {
1641 talloc_free(r);
1642 return false;
1645 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1646 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1647 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1648 talloc_free(r);
1649 return false;
1652 if (DEBUGLEVEL >= 10) {
1653 NDR_PRINT_IN_DEBUG(spoolss_EndPagePrinter, r);
1656 r->out.result = _spoolss_EndPagePrinter(p, r);
1658 if (p->rng_fault_state) {
1659 talloc_free(r);
1660 /* Return true here, srv_pipe_hnd.c will take care */
1661 return true;
1664 if (DEBUGLEVEL >= 10) {
1665 NDR_PRINT_OUT_DEBUG(spoolss_EndPagePrinter, r);
1668 push = ndr_push_init_ctx(r, NULL);
1669 if (push == NULL) {
1670 talloc_free(r);
1671 return false;
1674 ndr_err = call->ndr_push(push, NDR_OUT, r);
1675 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1676 talloc_free(r);
1677 return false;
1680 blob = ndr_push_blob(push);
1681 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1682 talloc_free(r);
1683 return false;
1686 talloc_free(r);
1688 return true;
1691 static bool api_spoolss_AbortPrinter(pipes_struct *p)
1693 const struct ndr_interface_call *call;
1694 struct ndr_pull *pull;
1695 struct ndr_push *push;
1696 enum ndr_err_code ndr_err;
1697 DATA_BLOB blob;
1698 struct spoolss_AbortPrinter *r;
1700 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ABORTPRINTER];
1702 r = talloc(talloc_tos(), struct spoolss_AbortPrinter);
1703 if (r == NULL) {
1704 return false;
1707 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1708 talloc_free(r);
1709 return false;
1712 pull = ndr_pull_init_blob(&blob, r, NULL);
1713 if (pull == NULL) {
1714 talloc_free(r);
1715 return false;
1718 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1719 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1720 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1721 talloc_free(r);
1722 return false;
1725 if (DEBUGLEVEL >= 10) {
1726 NDR_PRINT_IN_DEBUG(spoolss_AbortPrinter, r);
1729 r->out.result = _spoolss_AbortPrinter(p, r);
1731 if (p->rng_fault_state) {
1732 talloc_free(r);
1733 /* Return true here, srv_pipe_hnd.c will take care */
1734 return true;
1737 if (DEBUGLEVEL >= 10) {
1738 NDR_PRINT_OUT_DEBUG(spoolss_AbortPrinter, r);
1741 push = ndr_push_init_ctx(r, NULL);
1742 if (push == NULL) {
1743 talloc_free(r);
1744 return false;
1747 ndr_err = call->ndr_push(push, NDR_OUT, r);
1748 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1749 talloc_free(r);
1750 return false;
1753 blob = ndr_push_blob(push);
1754 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1755 talloc_free(r);
1756 return false;
1759 talloc_free(r);
1761 return true;
1764 static bool api_spoolss_ReadPrinter(pipes_struct *p)
1766 const struct ndr_interface_call *call;
1767 struct ndr_pull *pull;
1768 struct ndr_push *push;
1769 enum ndr_err_code ndr_err;
1770 DATA_BLOB blob;
1771 struct spoolss_ReadPrinter *r;
1773 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_READPRINTER];
1775 r = talloc(talloc_tos(), struct spoolss_ReadPrinter);
1776 if (r == NULL) {
1777 return false;
1780 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1781 talloc_free(r);
1782 return false;
1785 pull = ndr_pull_init_blob(&blob, r, NULL);
1786 if (pull == NULL) {
1787 talloc_free(r);
1788 return false;
1791 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1792 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1793 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1794 talloc_free(r);
1795 return false;
1798 if (DEBUGLEVEL >= 10) {
1799 NDR_PRINT_IN_DEBUG(spoolss_ReadPrinter, r);
1802 ZERO_STRUCT(r->out);
1803 r->out.data = talloc_zero_array(r, uint8_t, r->in.data_size);
1804 if (r->out.data == NULL) {
1805 talloc_free(r);
1806 return false;
1809 r->out._data_size = talloc_zero(r, uint32_t);
1810 if (r->out._data_size == NULL) {
1811 talloc_free(r);
1812 return false;
1815 r->out.result = _spoolss_ReadPrinter(p, r);
1817 if (p->rng_fault_state) {
1818 talloc_free(r);
1819 /* Return true here, srv_pipe_hnd.c will take care */
1820 return true;
1823 if (DEBUGLEVEL >= 10) {
1824 NDR_PRINT_OUT_DEBUG(spoolss_ReadPrinter, r);
1827 push = ndr_push_init_ctx(r, NULL);
1828 if (push == NULL) {
1829 talloc_free(r);
1830 return false;
1833 ndr_err = call->ndr_push(push, NDR_OUT, r);
1834 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1835 talloc_free(r);
1836 return false;
1839 blob = ndr_push_blob(push);
1840 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1841 talloc_free(r);
1842 return false;
1845 talloc_free(r);
1847 return true;
1850 static bool api_spoolss_EndDocPrinter(pipes_struct *p)
1852 const struct ndr_interface_call *call;
1853 struct ndr_pull *pull;
1854 struct ndr_push *push;
1855 enum ndr_err_code ndr_err;
1856 DATA_BLOB blob;
1857 struct spoolss_EndDocPrinter *r;
1859 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENDDOCPRINTER];
1861 r = talloc(talloc_tos(), struct spoolss_EndDocPrinter);
1862 if (r == NULL) {
1863 return false;
1866 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1867 talloc_free(r);
1868 return false;
1871 pull = ndr_pull_init_blob(&blob, r, NULL);
1872 if (pull == NULL) {
1873 talloc_free(r);
1874 return false;
1877 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1878 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1879 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1880 talloc_free(r);
1881 return false;
1884 if (DEBUGLEVEL >= 10) {
1885 NDR_PRINT_IN_DEBUG(spoolss_EndDocPrinter, r);
1888 r->out.result = _spoolss_EndDocPrinter(p, r);
1890 if (p->rng_fault_state) {
1891 talloc_free(r);
1892 /* Return true here, srv_pipe_hnd.c will take care */
1893 return true;
1896 if (DEBUGLEVEL >= 10) {
1897 NDR_PRINT_OUT_DEBUG(spoolss_EndDocPrinter, r);
1900 push = ndr_push_init_ctx(r, NULL);
1901 if (push == NULL) {
1902 talloc_free(r);
1903 return false;
1906 ndr_err = call->ndr_push(push, NDR_OUT, r);
1907 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1908 talloc_free(r);
1909 return false;
1912 blob = ndr_push_blob(push);
1913 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1914 talloc_free(r);
1915 return false;
1918 talloc_free(r);
1920 return true;
1923 static bool api_spoolss_AddJob(pipes_struct *p)
1925 const struct ndr_interface_call *call;
1926 struct ndr_pull *pull;
1927 struct ndr_push *push;
1928 enum ndr_err_code ndr_err;
1929 DATA_BLOB blob;
1930 struct spoolss_AddJob *r;
1932 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDJOB];
1934 r = talloc(talloc_tos(), struct spoolss_AddJob);
1935 if (r == NULL) {
1936 return false;
1939 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1940 talloc_free(r);
1941 return false;
1944 pull = ndr_pull_init_blob(&blob, r, NULL);
1945 if (pull == NULL) {
1946 talloc_free(r);
1947 return false;
1950 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1951 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1952 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1953 talloc_free(r);
1954 return false;
1957 if (DEBUGLEVEL >= 10) {
1958 NDR_PRINT_IN_DEBUG(spoolss_AddJob, r);
1961 ZERO_STRUCT(r->out);
1962 r->out.buffer = r->in.buffer;
1963 r->out.needed = talloc_zero(r, uint32_t);
1964 if (r->out.needed == NULL) {
1965 talloc_free(r);
1966 return false;
1969 r->out.result = _spoolss_AddJob(p, r);
1971 if (p->rng_fault_state) {
1972 talloc_free(r);
1973 /* Return true here, srv_pipe_hnd.c will take care */
1974 return true;
1977 if (DEBUGLEVEL >= 10) {
1978 NDR_PRINT_OUT_DEBUG(spoolss_AddJob, r);
1981 push = ndr_push_init_ctx(r, NULL);
1982 if (push == NULL) {
1983 talloc_free(r);
1984 return false;
1987 ndr_err = call->ndr_push(push, NDR_OUT, r);
1988 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1989 talloc_free(r);
1990 return false;
1993 blob = ndr_push_blob(push);
1994 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1995 talloc_free(r);
1996 return false;
1999 talloc_free(r);
2001 return true;
2004 static bool api_spoolss_ScheduleJob(pipes_struct *p)
2006 const struct ndr_interface_call *call;
2007 struct ndr_pull *pull;
2008 struct ndr_push *push;
2009 enum ndr_err_code ndr_err;
2010 DATA_BLOB blob;
2011 struct spoolss_ScheduleJob *r;
2013 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SCHEDULEJOB];
2015 r = talloc(talloc_tos(), struct spoolss_ScheduleJob);
2016 if (r == NULL) {
2017 return false;
2020 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2021 talloc_free(r);
2022 return false;
2025 pull = ndr_pull_init_blob(&blob, r, NULL);
2026 if (pull == NULL) {
2027 talloc_free(r);
2028 return false;
2031 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2032 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2033 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2034 talloc_free(r);
2035 return false;
2038 if (DEBUGLEVEL >= 10) {
2039 NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, r);
2042 r->out.result = _spoolss_ScheduleJob(p, r);
2044 if (p->rng_fault_state) {
2045 talloc_free(r);
2046 /* Return true here, srv_pipe_hnd.c will take care */
2047 return true;
2050 if (DEBUGLEVEL >= 10) {
2051 NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, r);
2054 push = ndr_push_init_ctx(r, NULL);
2055 if (push == NULL) {
2056 talloc_free(r);
2057 return false;
2060 ndr_err = call->ndr_push(push, NDR_OUT, r);
2061 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2062 talloc_free(r);
2063 return false;
2066 blob = ndr_push_blob(push);
2067 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2068 talloc_free(r);
2069 return false;
2072 talloc_free(r);
2074 return true;
2077 static bool api_spoolss_GetPrinterData(pipes_struct *p)
2079 const struct ndr_interface_call *call;
2080 struct ndr_pull *pull;
2081 struct ndr_push *push;
2082 enum ndr_err_code ndr_err;
2083 DATA_BLOB blob;
2084 struct spoolss_GetPrinterData *r;
2086 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETPRINTERDATA];
2088 r = talloc(talloc_tos(), struct spoolss_GetPrinterData);
2089 if (r == NULL) {
2090 return false;
2093 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2094 talloc_free(r);
2095 return false;
2098 pull = ndr_pull_init_blob(&blob, r, NULL);
2099 if (pull == NULL) {
2100 talloc_free(r);
2101 return false;
2104 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2105 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2106 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2107 talloc_free(r);
2108 return false;
2111 if (DEBUGLEVEL >= 10) {
2112 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterData, r);
2115 ZERO_STRUCT(r->out);
2116 r->out.type = talloc_zero(r, enum winreg_Type);
2117 if (r->out.type == NULL) {
2118 talloc_free(r);
2119 return false;
2122 r->out.data = talloc_zero(r, union spoolss_PrinterData);
2123 if (r->out.data == NULL) {
2124 talloc_free(r);
2125 return false;
2128 r->out.needed = talloc_zero(r, uint32_t);
2129 if (r->out.needed == NULL) {
2130 talloc_free(r);
2131 return false;
2134 r->out.result = _spoolss_GetPrinterData(p, r);
2136 if (p->rng_fault_state) {
2137 talloc_free(r);
2138 /* Return true here, srv_pipe_hnd.c will take care */
2139 return true;
2142 if (DEBUGLEVEL >= 10) {
2143 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterData, r);
2146 push = ndr_push_init_ctx(r, NULL);
2147 if (push == NULL) {
2148 talloc_free(r);
2149 return false;
2152 ndr_err = call->ndr_push(push, NDR_OUT, r);
2153 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2154 talloc_free(r);
2155 return false;
2158 blob = ndr_push_blob(push);
2159 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2160 talloc_free(r);
2161 return false;
2164 talloc_free(r);
2166 return true;
2169 static bool api_spoolss_SetPrinterData(pipes_struct *p)
2171 const struct ndr_interface_call *call;
2172 struct ndr_pull *pull;
2173 struct ndr_push *push;
2174 enum ndr_err_code ndr_err;
2175 DATA_BLOB blob;
2176 struct spoolss_SetPrinterData *r;
2178 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SETPRINTERDATA];
2180 r = talloc(talloc_tos(), struct spoolss_SetPrinterData);
2181 if (r == NULL) {
2182 return false;
2185 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2186 talloc_free(r);
2187 return false;
2190 pull = ndr_pull_init_blob(&blob, r, NULL);
2191 if (pull == NULL) {
2192 talloc_free(r);
2193 return false;
2196 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2197 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2198 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2199 talloc_free(r);
2200 return false;
2203 if (DEBUGLEVEL >= 10) {
2204 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, r);
2207 r->out.result = _spoolss_SetPrinterData(p, r);
2209 if (p->rng_fault_state) {
2210 talloc_free(r);
2211 /* Return true here, srv_pipe_hnd.c will take care */
2212 return true;
2215 if (DEBUGLEVEL >= 10) {
2216 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterData, r);
2219 push = ndr_push_init_ctx(r, NULL);
2220 if (push == NULL) {
2221 talloc_free(r);
2222 return false;
2225 ndr_err = call->ndr_push(push, NDR_OUT, r);
2226 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2227 talloc_free(r);
2228 return false;
2231 blob = ndr_push_blob(push);
2232 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2233 talloc_free(r);
2234 return false;
2237 talloc_free(r);
2239 return true;
2242 static bool api_spoolss_WaitForPrinterChange(pipes_struct *p)
2244 const struct ndr_interface_call *call;
2245 struct ndr_pull *pull;
2246 struct ndr_push *push;
2247 enum ndr_err_code ndr_err;
2248 DATA_BLOB blob;
2249 struct spoolss_WaitForPrinterChange *r;
2251 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_WAITFORPRINTERCHANGE];
2253 r = talloc(talloc_tos(), struct spoolss_WaitForPrinterChange);
2254 if (r == NULL) {
2255 return false;
2258 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2259 talloc_free(r);
2260 return false;
2263 pull = ndr_pull_init_blob(&blob, r, NULL);
2264 if (pull == NULL) {
2265 talloc_free(r);
2266 return false;
2269 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2270 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2271 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2272 talloc_free(r);
2273 return false;
2276 if (DEBUGLEVEL >= 10) {
2277 NDR_PRINT_IN_DEBUG(spoolss_WaitForPrinterChange, r);
2280 r->out.result = _spoolss_WaitForPrinterChange(p, r);
2282 if (p->rng_fault_state) {
2283 talloc_free(r);
2284 /* Return true here, srv_pipe_hnd.c will take care */
2285 return true;
2288 if (DEBUGLEVEL >= 10) {
2289 NDR_PRINT_OUT_DEBUG(spoolss_WaitForPrinterChange, r);
2292 push = ndr_push_init_ctx(r, NULL);
2293 if (push == NULL) {
2294 talloc_free(r);
2295 return false;
2298 ndr_err = call->ndr_push(push, NDR_OUT, r);
2299 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2300 talloc_free(r);
2301 return false;
2304 blob = ndr_push_blob(push);
2305 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2306 talloc_free(r);
2307 return false;
2310 talloc_free(r);
2312 return true;
2315 static bool api_spoolss_ClosePrinter(pipes_struct *p)
2317 const struct ndr_interface_call *call;
2318 struct ndr_pull *pull;
2319 struct ndr_push *push;
2320 enum ndr_err_code ndr_err;
2321 DATA_BLOB blob;
2322 struct spoolss_ClosePrinter *r;
2324 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_CLOSEPRINTER];
2326 r = talloc(talloc_tos(), struct spoolss_ClosePrinter);
2327 if (r == NULL) {
2328 return false;
2331 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2332 talloc_free(r);
2333 return false;
2336 pull = ndr_pull_init_blob(&blob, r, NULL);
2337 if (pull == NULL) {
2338 talloc_free(r);
2339 return false;
2342 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2343 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2344 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2345 talloc_free(r);
2346 return false;
2349 if (DEBUGLEVEL >= 10) {
2350 NDR_PRINT_IN_DEBUG(spoolss_ClosePrinter, r);
2353 ZERO_STRUCT(r->out);
2354 r->out.handle = r->in.handle;
2355 r->out.result = _spoolss_ClosePrinter(p, r);
2357 if (p->rng_fault_state) {
2358 talloc_free(r);
2359 /* Return true here, srv_pipe_hnd.c will take care */
2360 return true;
2363 if (DEBUGLEVEL >= 10) {
2364 NDR_PRINT_OUT_DEBUG(spoolss_ClosePrinter, r);
2367 push = ndr_push_init_ctx(r, NULL);
2368 if (push == NULL) {
2369 talloc_free(r);
2370 return false;
2373 ndr_err = call->ndr_push(push, NDR_OUT, r);
2374 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2375 talloc_free(r);
2376 return false;
2379 blob = ndr_push_blob(push);
2380 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2381 talloc_free(r);
2382 return false;
2385 talloc_free(r);
2387 return true;
2390 static bool api_spoolss_AddForm(pipes_struct *p)
2392 const struct ndr_interface_call *call;
2393 struct ndr_pull *pull;
2394 struct ndr_push *push;
2395 enum ndr_err_code ndr_err;
2396 DATA_BLOB blob;
2397 struct spoolss_AddForm *r;
2399 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDFORM];
2401 r = talloc(talloc_tos(), struct spoolss_AddForm);
2402 if (r == NULL) {
2403 return false;
2406 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2407 talloc_free(r);
2408 return false;
2411 pull = ndr_pull_init_blob(&blob, r, NULL);
2412 if (pull == NULL) {
2413 talloc_free(r);
2414 return false;
2417 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2418 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2419 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2420 talloc_free(r);
2421 return false;
2424 if (DEBUGLEVEL >= 10) {
2425 NDR_PRINT_IN_DEBUG(spoolss_AddForm, r);
2428 r->out.result = _spoolss_AddForm(p, r);
2430 if (p->rng_fault_state) {
2431 talloc_free(r);
2432 /* Return true here, srv_pipe_hnd.c will take care */
2433 return true;
2436 if (DEBUGLEVEL >= 10) {
2437 NDR_PRINT_OUT_DEBUG(spoolss_AddForm, r);
2440 push = ndr_push_init_ctx(r, NULL);
2441 if (push == NULL) {
2442 talloc_free(r);
2443 return false;
2446 ndr_err = call->ndr_push(push, NDR_OUT, r);
2447 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2448 talloc_free(r);
2449 return false;
2452 blob = ndr_push_blob(push);
2453 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2454 talloc_free(r);
2455 return false;
2458 talloc_free(r);
2460 return true;
2463 static bool api_spoolss_DeleteForm(pipes_struct *p)
2465 const struct ndr_interface_call *call;
2466 struct ndr_pull *pull;
2467 struct ndr_push *push;
2468 enum ndr_err_code ndr_err;
2469 DATA_BLOB blob;
2470 struct spoolss_DeleteForm *r;
2472 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEFORM];
2474 r = talloc(talloc_tos(), struct spoolss_DeleteForm);
2475 if (r == NULL) {
2476 return false;
2479 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2480 talloc_free(r);
2481 return false;
2484 pull = ndr_pull_init_blob(&blob, r, NULL);
2485 if (pull == NULL) {
2486 talloc_free(r);
2487 return false;
2490 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2491 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2492 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2493 talloc_free(r);
2494 return false;
2497 if (DEBUGLEVEL >= 10) {
2498 NDR_PRINT_IN_DEBUG(spoolss_DeleteForm, r);
2501 r->out.result = _spoolss_DeleteForm(p, r);
2503 if (p->rng_fault_state) {
2504 talloc_free(r);
2505 /* Return true here, srv_pipe_hnd.c will take care */
2506 return true;
2509 if (DEBUGLEVEL >= 10) {
2510 NDR_PRINT_OUT_DEBUG(spoolss_DeleteForm, r);
2513 push = ndr_push_init_ctx(r, NULL);
2514 if (push == NULL) {
2515 talloc_free(r);
2516 return false;
2519 ndr_err = call->ndr_push(push, NDR_OUT, r);
2520 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2521 talloc_free(r);
2522 return false;
2525 blob = ndr_push_blob(push);
2526 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2527 talloc_free(r);
2528 return false;
2531 talloc_free(r);
2533 return true;
2536 static bool api_spoolss_GetForm(pipes_struct *p)
2538 const struct ndr_interface_call *call;
2539 struct ndr_pull *pull;
2540 struct ndr_push *push;
2541 enum ndr_err_code ndr_err;
2542 DATA_BLOB blob;
2543 struct spoolss_GetForm *r;
2545 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETFORM];
2547 r = talloc(talloc_tos(), struct spoolss_GetForm);
2548 if (r == NULL) {
2549 return false;
2552 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2553 talloc_free(r);
2554 return false;
2557 pull = ndr_pull_init_blob(&blob, r, NULL);
2558 if (pull == NULL) {
2559 talloc_free(r);
2560 return false;
2563 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2564 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2565 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2566 talloc_free(r);
2567 return false;
2570 if (DEBUGLEVEL >= 10) {
2571 NDR_PRINT_IN_DEBUG(spoolss_GetForm, r);
2574 ZERO_STRUCT(r->out);
2575 r->out.info = talloc_zero(r, union spoolss_FormInfo);
2576 if (r->out.info == NULL) {
2577 talloc_free(r);
2578 return false;
2581 r->out.needed = talloc_zero(r, uint32_t);
2582 if (r->out.needed == NULL) {
2583 talloc_free(r);
2584 return false;
2587 r->out.result = _spoolss_GetForm(p, r);
2589 if (p->rng_fault_state) {
2590 talloc_free(r);
2591 /* Return true here, srv_pipe_hnd.c will take care */
2592 return true;
2595 if (DEBUGLEVEL >= 10) {
2596 NDR_PRINT_OUT_DEBUG(spoolss_GetForm, r);
2599 push = ndr_push_init_ctx(r, NULL);
2600 if (push == NULL) {
2601 talloc_free(r);
2602 return false;
2605 ndr_err = call->ndr_push(push, NDR_OUT, r);
2606 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2607 talloc_free(r);
2608 return false;
2611 blob = ndr_push_blob(push);
2612 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2613 talloc_free(r);
2614 return false;
2617 talloc_free(r);
2619 return true;
2622 static bool api_spoolss_SetForm(pipes_struct *p)
2624 const struct ndr_interface_call *call;
2625 struct ndr_pull *pull;
2626 struct ndr_push *push;
2627 enum ndr_err_code ndr_err;
2628 DATA_BLOB blob;
2629 struct spoolss_SetForm *r;
2631 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SETFORM];
2633 r = talloc(talloc_tos(), struct spoolss_SetForm);
2634 if (r == NULL) {
2635 return false;
2638 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2639 talloc_free(r);
2640 return false;
2643 pull = ndr_pull_init_blob(&blob, r, NULL);
2644 if (pull == NULL) {
2645 talloc_free(r);
2646 return false;
2649 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2650 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2651 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2652 talloc_free(r);
2653 return false;
2656 if (DEBUGLEVEL >= 10) {
2657 NDR_PRINT_IN_DEBUG(spoolss_SetForm, r);
2660 r->out.result = _spoolss_SetForm(p, r);
2662 if (p->rng_fault_state) {
2663 talloc_free(r);
2664 /* Return true here, srv_pipe_hnd.c will take care */
2665 return true;
2668 if (DEBUGLEVEL >= 10) {
2669 NDR_PRINT_OUT_DEBUG(spoolss_SetForm, r);
2672 push = ndr_push_init_ctx(r, NULL);
2673 if (push == NULL) {
2674 talloc_free(r);
2675 return false;
2678 ndr_err = call->ndr_push(push, NDR_OUT, r);
2679 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2680 talloc_free(r);
2681 return false;
2684 blob = ndr_push_blob(push);
2685 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2686 talloc_free(r);
2687 return false;
2690 talloc_free(r);
2692 return true;
2695 static bool api_spoolss_EnumForms(pipes_struct *p)
2697 const struct ndr_interface_call *call;
2698 struct ndr_pull *pull;
2699 struct ndr_push *push;
2700 enum ndr_err_code ndr_err;
2701 DATA_BLOB blob;
2702 struct spoolss_EnumForms *r;
2704 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMFORMS];
2706 r = talloc(talloc_tos(), struct spoolss_EnumForms);
2707 if (r == NULL) {
2708 return false;
2711 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2712 talloc_free(r);
2713 return false;
2716 pull = ndr_pull_init_blob(&blob, r, NULL);
2717 if (pull == NULL) {
2718 talloc_free(r);
2719 return false;
2722 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2723 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2724 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2725 talloc_free(r);
2726 return false;
2729 if (DEBUGLEVEL >= 10) {
2730 NDR_PRINT_IN_DEBUG(spoolss_EnumForms, r);
2733 ZERO_STRUCT(r->out);
2734 r->out.count = talloc_zero(r, uint32_t);
2735 if (r->out.count == NULL) {
2736 talloc_free(r);
2737 return false;
2740 r->out.info = talloc_zero(r, union spoolss_FormInfo *);
2741 if (r->out.info == NULL) {
2742 talloc_free(r);
2743 return false;
2746 r->out.needed = talloc_zero(r, uint32_t);
2747 if (r->out.needed == NULL) {
2748 talloc_free(r);
2749 return false;
2752 r->out.result = _spoolss_EnumForms(p, r);
2754 if (p->rng_fault_state) {
2755 talloc_free(r);
2756 /* Return true here, srv_pipe_hnd.c will take care */
2757 return true;
2760 if (DEBUGLEVEL >= 10) {
2761 NDR_PRINT_OUT_DEBUG(spoolss_EnumForms, r);
2764 push = ndr_push_init_ctx(r, NULL);
2765 if (push == NULL) {
2766 talloc_free(r);
2767 return false;
2770 ndr_err = call->ndr_push(push, NDR_OUT, r);
2771 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2772 talloc_free(r);
2773 return false;
2776 blob = ndr_push_blob(push);
2777 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2778 talloc_free(r);
2779 return false;
2782 talloc_free(r);
2784 return true;
2787 static bool api_spoolss_EnumPorts(pipes_struct *p)
2789 const struct ndr_interface_call *call;
2790 struct ndr_pull *pull;
2791 struct ndr_push *push;
2792 enum ndr_err_code ndr_err;
2793 DATA_BLOB blob;
2794 struct spoolss_EnumPorts *r;
2796 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPORTS];
2798 r = talloc(talloc_tos(), struct spoolss_EnumPorts);
2799 if (r == NULL) {
2800 return false;
2803 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2804 talloc_free(r);
2805 return false;
2808 pull = ndr_pull_init_blob(&blob, r, NULL);
2809 if (pull == NULL) {
2810 talloc_free(r);
2811 return false;
2814 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2815 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2816 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2817 talloc_free(r);
2818 return false;
2821 if (DEBUGLEVEL >= 10) {
2822 NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, r);
2825 ZERO_STRUCT(r->out);
2826 r->out.count = talloc_zero(r, uint32_t);
2827 if (r->out.count == NULL) {
2828 talloc_free(r);
2829 return false;
2832 r->out.info = talloc_zero(r, union spoolss_PortInfo *);
2833 if (r->out.info == NULL) {
2834 talloc_free(r);
2835 return false;
2838 r->out.needed = talloc_zero(r, uint32_t);
2839 if (r->out.needed == NULL) {
2840 talloc_free(r);
2841 return false;
2844 r->out.result = _spoolss_EnumPorts(p, r);
2846 if (p->rng_fault_state) {
2847 talloc_free(r);
2848 /* Return true here, srv_pipe_hnd.c will take care */
2849 return true;
2852 if (DEBUGLEVEL >= 10) {
2853 NDR_PRINT_OUT_DEBUG(spoolss_EnumPorts, r);
2856 push = ndr_push_init_ctx(r, NULL);
2857 if (push == NULL) {
2858 talloc_free(r);
2859 return false;
2862 ndr_err = call->ndr_push(push, NDR_OUT, r);
2863 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2864 talloc_free(r);
2865 return false;
2868 blob = ndr_push_blob(push);
2869 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2870 talloc_free(r);
2871 return false;
2874 talloc_free(r);
2876 return true;
2879 static bool api_spoolss_EnumMonitors(pipes_struct *p)
2881 const struct ndr_interface_call *call;
2882 struct ndr_pull *pull;
2883 struct ndr_push *push;
2884 enum ndr_err_code ndr_err;
2885 DATA_BLOB blob;
2886 struct spoolss_EnumMonitors *r;
2888 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMMONITORS];
2890 r = talloc(talloc_tos(), struct spoolss_EnumMonitors);
2891 if (r == NULL) {
2892 return false;
2895 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2896 talloc_free(r);
2897 return false;
2900 pull = ndr_pull_init_blob(&blob, r, NULL);
2901 if (pull == NULL) {
2902 talloc_free(r);
2903 return false;
2906 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2907 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2908 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2909 talloc_free(r);
2910 return false;
2913 if (DEBUGLEVEL >= 10) {
2914 NDR_PRINT_IN_DEBUG(spoolss_EnumMonitors, r);
2917 ZERO_STRUCT(r->out);
2918 r->out.count = talloc_zero(r, uint32_t);
2919 if (r->out.count == NULL) {
2920 talloc_free(r);
2921 return false;
2924 r->out.info = talloc_zero(r, union spoolss_MonitorInfo *);
2925 if (r->out.info == NULL) {
2926 talloc_free(r);
2927 return false;
2930 r->out.needed = talloc_zero(r, uint32_t);
2931 if (r->out.needed == NULL) {
2932 talloc_free(r);
2933 return false;
2936 r->out.result = _spoolss_EnumMonitors(p, r);
2938 if (p->rng_fault_state) {
2939 talloc_free(r);
2940 /* Return true here, srv_pipe_hnd.c will take care */
2941 return true;
2944 if (DEBUGLEVEL >= 10) {
2945 NDR_PRINT_OUT_DEBUG(spoolss_EnumMonitors, r);
2948 push = ndr_push_init_ctx(r, NULL);
2949 if (push == NULL) {
2950 talloc_free(r);
2951 return false;
2954 ndr_err = call->ndr_push(push, NDR_OUT, r);
2955 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2956 talloc_free(r);
2957 return false;
2960 blob = ndr_push_blob(push);
2961 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2962 talloc_free(r);
2963 return false;
2966 talloc_free(r);
2968 return true;
2971 static bool api_spoolss_AddPort(pipes_struct *p)
2973 const struct ndr_interface_call *call;
2974 struct ndr_pull *pull;
2975 struct ndr_push *push;
2976 enum ndr_err_code ndr_err;
2977 DATA_BLOB blob;
2978 struct spoolss_AddPort *r;
2980 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPORT];
2982 r = talloc(talloc_tos(), struct spoolss_AddPort);
2983 if (r == NULL) {
2984 return false;
2987 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2988 talloc_free(r);
2989 return false;
2992 pull = ndr_pull_init_blob(&blob, r, NULL);
2993 if (pull == NULL) {
2994 talloc_free(r);
2995 return false;
2998 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2999 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3000 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3001 talloc_free(r);
3002 return false;
3005 if (DEBUGLEVEL >= 10) {
3006 NDR_PRINT_IN_DEBUG(spoolss_AddPort, r);
3009 r->out.result = _spoolss_AddPort(p, r);
3011 if (p->rng_fault_state) {
3012 talloc_free(r);
3013 /* Return true here, srv_pipe_hnd.c will take care */
3014 return true;
3017 if (DEBUGLEVEL >= 10) {
3018 NDR_PRINT_OUT_DEBUG(spoolss_AddPort, r);
3021 push = ndr_push_init_ctx(r, NULL);
3022 if (push == NULL) {
3023 talloc_free(r);
3024 return false;
3027 ndr_err = call->ndr_push(push, NDR_OUT, r);
3028 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3029 talloc_free(r);
3030 return false;
3033 blob = ndr_push_blob(push);
3034 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3035 talloc_free(r);
3036 return false;
3039 talloc_free(r);
3041 return true;
3044 static bool api_spoolss_ConfigurePort(pipes_struct *p)
3046 const struct ndr_interface_call *call;
3047 struct ndr_pull *pull;
3048 struct ndr_push *push;
3049 enum ndr_err_code ndr_err;
3050 DATA_BLOB blob;
3051 struct spoolss_ConfigurePort *r;
3053 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_CONFIGUREPORT];
3055 r = talloc(talloc_tos(), struct spoolss_ConfigurePort);
3056 if (r == NULL) {
3057 return false;
3060 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3061 talloc_free(r);
3062 return false;
3065 pull = ndr_pull_init_blob(&blob, r, NULL);
3066 if (pull == NULL) {
3067 talloc_free(r);
3068 return false;
3071 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3072 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3073 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3074 talloc_free(r);
3075 return false;
3078 if (DEBUGLEVEL >= 10) {
3079 NDR_PRINT_IN_DEBUG(spoolss_ConfigurePort, r);
3082 r->out.result = _spoolss_ConfigurePort(p, r);
3084 if (p->rng_fault_state) {
3085 talloc_free(r);
3086 /* Return true here, srv_pipe_hnd.c will take care */
3087 return true;
3090 if (DEBUGLEVEL >= 10) {
3091 NDR_PRINT_OUT_DEBUG(spoolss_ConfigurePort, r);
3094 push = ndr_push_init_ctx(r, NULL);
3095 if (push == NULL) {
3096 talloc_free(r);
3097 return false;
3100 ndr_err = call->ndr_push(push, NDR_OUT, r);
3101 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3102 talloc_free(r);
3103 return false;
3106 blob = ndr_push_blob(push);
3107 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3108 talloc_free(r);
3109 return false;
3112 talloc_free(r);
3114 return true;
3117 static bool api_spoolss_DeletePort(pipes_struct *p)
3119 const struct ndr_interface_call *call;
3120 struct ndr_pull *pull;
3121 struct ndr_push *push;
3122 enum ndr_err_code ndr_err;
3123 DATA_BLOB blob;
3124 struct spoolss_DeletePort *r;
3126 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPORT];
3128 r = talloc(talloc_tos(), struct spoolss_DeletePort);
3129 if (r == NULL) {
3130 return false;
3133 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3134 talloc_free(r);
3135 return false;
3138 pull = ndr_pull_init_blob(&blob, r, NULL);
3139 if (pull == NULL) {
3140 talloc_free(r);
3141 return false;
3144 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3145 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3146 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3147 talloc_free(r);
3148 return false;
3151 if (DEBUGLEVEL >= 10) {
3152 NDR_PRINT_IN_DEBUG(spoolss_DeletePort, r);
3155 r->out.result = _spoolss_DeletePort(p, r);
3157 if (p->rng_fault_state) {
3158 talloc_free(r);
3159 /* Return true here, srv_pipe_hnd.c will take care */
3160 return true;
3163 if (DEBUGLEVEL >= 10) {
3164 NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, r);
3167 push = ndr_push_init_ctx(r, NULL);
3168 if (push == NULL) {
3169 talloc_free(r);
3170 return false;
3173 ndr_err = call->ndr_push(push, NDR_OUT, r);
3174 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3175 talloc_free(r);
3176 return false;
3179 blob = ndr_push_blob(push);
3180 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3181 talloc_free(r);
3182 return false;
3185 talloc_free(r);
3187 return true;
3190 static bool api_spoolss_CreatePrinterIC(pipes_struct *p)
3192 const struct ndr_interface_call *call;
3193 struct ndr_pull *pull;
3194 struct ndr_push *push;
3195 enum ndr_err_code ndr_err;
3196 DATA_BLOB blob;
3197 struct spoolss_CreatePrinterIC *r;
3199 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_CREATEPRINTERIC];
3201 r = talloc(talloc_tos(), struct spoolss_CreatePrinterIC);
3202 if (r == NULL) {
3203 return false;
3206 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3207 talloc_free(r);
3208 return false;
3211 pull = ndr_pull_init_blob(&blob, r, NULL);
3212 if (pull == NULL) {
3213 talloc_free(r);
3214 return false;
3217 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3218 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3219 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3220 talloc_free(r);
3221 return false;
3224 if (DEBUGLEVEL >= 10) {
3225 NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, r);
3228 r->out.result = _spoolss_CreatePrinterIC(p, r);
3230 if (p->rng_fault_state) {
3231 talloc_free(r);
3232 /* Return true here, srv_pipe_hnd.c will take care */
3233 return true;
3236 if (DEBUGLEVEL >= 10) {
3237 NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, r);
3240 push = ndr_push_init_ctx(r, NULL);
3241 if (push == NULL) {
3242 talloc_free(r);
3243 return false;
3246 ndr_err = call->ndr_push(push, NDR_OUT, r);
3247 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3248 talloc_free(r);
3249 return false;
3252 blob = ndr_push_blob(push);
3253 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3254 talloc_free(r);
3255 return false;
3258 talloc_free(r);
3260 return true;
3263 static bool api_spoolss_PlayGDIScriptOnPrinterIC(pipes_struct *p)
3265 const struct ndr_interface_call *call;
3266 struct ndr_pull *pull;
3267 struct ndr_push *push;
3268 enum ndr_err_code ndr_err;
3269 DATA_BLOB blob;
3270 struct spoolss_PlayGDIScriptOnPrinterIC *r;
3272 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC];
3274 r = talloc(talloc_tos(), struct spoolss_PlayGDIScriptOnPrinterIC);
3275 if (r == NULL) {
3276 return false;
3279 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3280 talloc_free(r);
3281 return false;
3284 pull = ndr_pull_init_blob(&blob, r, NULL);
3285 if (pull == NULL) {
3286 talloc_free(r);
3287 return false;
3290 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3291 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3292 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3293 talloc_free(r);
3294 return false;
3297 if (DEBUGLEVEL >= 10) {
3298 NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, r);
3301 r->out.result = _spoolss_PlayGDIScriptOnPrinterIC(p, r);
3303 if (p->rng_fault_state) {
3304 talloc_free(r);
3305 /* Return true here, srv_pipe_hnd.c will take care */
3306 return true;
3309 if (DEBUGLEVEL >= 10) {
3310 NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, r);
3313 push = ndr_push_init_ctx(r, NULL);
3314 if (push == NULL) {
3315 talloc_free(r);
3316 return false;
3319 ndr_err = call->ndr_push(push, NDR_OUT, r);
3320 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3321 talloc_free(r);
3322 return false;
3325 blob = ndr_push_blob(push);
3326 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3327 talloc_free(r);
3328 return false;
3331 talloc_free(r);
3333 return true;
3336 static bool api_spoolss_DeletePrinterIC(pipes_struct *p)
3338 const struct ndr_interface_call *call;
3339 struct ndr_pull *pull;
3340 struct ndr_push *push;
3341 enum ndr_err_code ndr_err;
3342 DATA_BLOB blob;
3343 struct spoolss_DeletePrinterIC *r;
3345 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERIC];
3347 r = talloc(talloc_tos(), struct spoolss_DeletePrinterIC);
3348 if (r == NULL) {
3349 return false;
3352 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3353 talloc_free(r);
3354 return false;
3357 pull = ndr_pull_init_blob(&blob, r, NULL);
3358 if (pull == NULL) {
3359 talloc_free(r);
3360 return false;
3363 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3364 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3365 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3366 talloc_free(r);
3367 return false;
3370 if (DEBUGLEVEL >= 10) {
3371 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, r);
3374 r->out.result = _spoolss_DeletePrinterIC(p, r);
3376 if (p->rng_fault_state) {
3377 talloc_free(r);
3378 /* Return true here, srv_pipe_hnd.c will take care */
3379 return true;
3382 if (DEBUGLEVEL >= 10) {
3383 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, r);
3386 push = ndr_push_init_ctx(r, NULL);
3387 if (push == NULL) {
3388 talloc_free(r);
3389 return false;
3392 ndr_err = call->ndr_push(push, NDR_OUT, r);
3393 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3394 talloc_free(r);
3395 return false;
3398 blob = ndr_push_blob(push);
3399 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3400 talloc_free(r);
3401 return false;
3404 talloc_free(r);
3406 return true;
3409 static bool api_spoolss_AddPrinterConnection(pipes_struct *p)
3411 const struct ndr_interface_call *call;
3412 struct ndr_pull *pull;
3413 struct ndr_push *push;
3414 enum ndr_err_code ndr_err;
3415 DATA_BLOB blob;
3416 struct spoolss_AddPrinterConnection *r;
3418 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTERCONNECTION];
3420 r = talloc(talloc_tos(), struct spoolss_AddPrinterConnection);
3421 if (r == NULL) {
3422 return false;
3425 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3426 talloc_free(r);
3427 return false;
3430 pull = ndr_pull_init_blob(&blob, r, NULL);
3431 if (pull == NULL) {
3432 talloc_free(r);
3433 return false;
3436 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3437 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3438 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3439 talloc_free(r);
3440 return false;
3443 if (DEBUGLEVEL >= 10) {
3444 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, r);
3447 r->out.result = _spoolss_AddPrinterConnection(p, r);
3449 if (p->rng_fault_state) {
3450 talloc_free(r);
3451 /* Return true here, srv_pipe_hnd.c will take care */
3452 return true;
3455 if (DEBUGLEVEL >= 10) {
3456 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, r);
3459 push = ndr_push_init_ctx(r, NULL);
3460 if (push == NULL) {
3461 talloc_free(r);
3462 return false;
3465 ndr_err = call->ndr_push(push, NDR_OUT, r);
3466 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3467 talloc_free(r);
3468 return false;
3471 blob = ndr_push_blob(push);
3472 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3473 talloc_free(r);
3474 return false;
3477 talloc_free(r);
3479 return true;
3482 static bool api_spoolss_DeletePrinterConnection(pipes_struct *p)
3484 const struct ndr_interface_call *call;
3485 struct ndr_pull *pull;
3486 struct ndr_push *push;
3487 enum ndr_err_code ndr_err;
3488 DATA_BLOB blob;
3489 struct spoolss_DeletePrinterConnection *r;
3491 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERCONNECTION];
3493 r = talloc(talloc_tos(), struct spoolss_DeletePrinterConnection);
3494 if (r == NULL) {
3495 return false;
3498 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3499 talloc_free(r);
3500 return false;
3503 pull = ndr_pull_init_blob(&blob, r, NULL);
3504 if (pull == NULL) {
3505 talloc_free(r);
3506 return false;
3509 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3510 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3511 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3512 talloc_free(r);
3513 return false;
3516 if (DEBUGLEVEL >= 10) {
3517 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, r);
3520 r->out.result = _spoolss_DeletePrinterConnection(p, r);
3522 if (p->rng_fault_state) {
3523 talloc_free(r);
3524 /* Return true here, srv_pipe_hnd.c will take care */
3525 return true;
3528 if (DEBUGLEVEL >= 10) {
3529 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, r);
3532 push = ndr_push_init_ctx(r, NULL);
3533 if (push == NULL) {
3534 talloc_free(r);
3535 return false;
3538 ndr_err = call->ndr_push(push, NDR_OUT, r);
3539 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3540 talloc_free(r);
3541 return false;
3544 blob = ndr_push_blob(push);
3545 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3546 talloc_free(r);
3547 return false;
3550 talloc_free(r);
3552 return true;
3555 static bool api_spoolss_PrinterMessageBox(pipes_struct *p)
3557 const struct ndr_interface_call *call;
3558 struct ndr_pull *pull;
3559 struct ndr_push *push;
3560 enum ndr_err_code ndr_err;
3561 DATA_BLOB blob;
3562 struct spoolss_PrinterMessageBox *r;
3564 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_PRINTERMESSAGEBOX];
3566 r = talloc(talloc_tos(), struct spoolss_PrinterMessageBox);
3567 if (r == NULL) {
3568 return false;
3571 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3572 talloc_free(r);
3573 return false;
3576 pull = ndr_pull_init_blob(&blob, r, NULL);
3577 if (pull == NULL) {
3578 talloc_free(r);
3579 return false;
3582 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3583 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3584 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3585 talloc_free(r);
3586 return false;
3589 if (DEBUGLEVEL >= 10) {
3590 NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, r);
3593 r->out.result = _spoolss_PrinterMessageBox(p, r);
3595 if (p->rng_fault_state) {
3596 talloc_free(r);
3597 /* Return true here, srv_pipe_hnd.c will take care */
3598 return true;
3601 if (DEBUGLEVEL >= 10) {
3602 NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, r);
3605 push = ndr_push_init_ctx(r, NULL);
3606 if (push == NULL) {
3607 talloc_free(r);
3608 return false;
3611 ndr_err = call->ndr_push(push, NDR_OUT, r);
3612 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3613 talloc_free(r);
3614 return false;
3617 blob = ndr_push_blob(push);
3618 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3619 talloc_free(r);
3620 return false;
3623 talloc_free(r);
3625 return true;
3628 static bool api_spoolss_AddMonitor(pipes_struct *p)
3630 const struct ndr_interface_call *call;
3631 struct ndr_pull *pull;
3632 struct ndr_push *push;
3633 enum ndr_err_code ndr_err;
3634 DATA_BLOB blob;
3635 struct spoolss_AddMonitor *r;
3637 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDMONITOR];
3639 r = talloc(talloc_tos(), struct spoolss_AddMonitor);
3640 if (r == NULL) {
3641 return false;
3644 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3645 talloc_free(r);
3646 return false;
3649 pull = ndr_pull_init_blob(&blob, r, NULL);
3650 if (pull == NULL) {
3651 talloc_free(r);
3652 return false;
3655 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3656 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3657 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3658 talloc_free(r);
3659 return false;
3662 if (DEBUGLEVEL >= 10) {
3663 NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, r);
3666 r->out.result = _spoolss_AddMonitor(p, r);
3668 if (p->rng_fault_state) {
3669 talloc_free(r);
3670 /* Return true here, srv_pipe_hnd.c will take care */
3671 return true;
3674 if (DEBUGLEVEL >= 10) {
3675 NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, r);
3678 push = ndr_push_init_ctx(r, NULL);
3679 if (push == NULL) {
3680 talloc_free(r);
3681 return false;
3684 ndr_err = call->ndr_push(push, NDR_OUT, r);
3685 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3686 talloc_free(r);
3687 return false;
3690 blob = ndr_push_blob(push);
3691 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3692 talloc_free(r);
3693 return false;
3696 talloc_free(r);
3698 return true;
3701 static bool api_spoolss_DeleteMonitor(pipes_struct *p)
3703 const struct ndr_interface_call *call;
3704 struct ndr_pull *pull;
3705 struct ndr_push *push;
3706 enum ndr_err_code ndr_err;
3707 DATA_BLOB blob;
3708 struct spoolss_DeleteMonitor *r;
3710 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEMONITOR];
3712 r = talloc(talloc_tos(), struct spoolss_DeleteMonitor);
3713 if (r == NULL) {
3714 return false;
3717 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3718 talloc_free(r);
3719 return false;
3722 pull = ndr_pull_init_blob(&blob, r, NULL);
3723 if (pull == NULL) {
3724 talloc_free(r);
3725 return false;
3728 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3729 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3730 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3731 talloc_free(r);
3732 return false;
3735 if (DEBUGLEVEL >= 10) {
3736 NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, r);
3739 r->out.result = _spoolss_DeleteMonitor(p, r);
3741 if (p->rng_fault_state) {
3742 talloc_free(r);
3743 /* Return true here, srv_pipe_hnd.c will take care */
3744 return true;
3747 if (DEBUGLEVEL >= 10) {
3748 NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, r);
3751 push = ndr_push_init_ctx(r, NULL);
3752 if (push == NULL) {
3753 talloc_free(r);
3754 return false;
3757 ndr_err = call->ndr_push(push, NDR_OUT, r);
3758 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3759 talloc_free(r);
3760 return false;
3763 blob = ndr_push_blob(push);
3764 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3765 talloc_free(r);
3766 return false;
3769 talloc_free(r);
3771 return true;
3774 static bool api_spoolss_DeletePrintProcessor(pipes_struct *p)
3776 const struct ndr_interface_call *call;
3777 struct ndr_pull *pull;
3778 struct ndr_push *push;
3779 enum ndr_err_code ndr_err;
3780 DATA_BLOB blob;
3781 struct spoolss_DeletePrintProcessor *r;
3783 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTPROCESSOR];
3785 r = talloc(talloc_tos(), struct spoolss_DeletePrintProcessor);
3786 if (r == NULL) {
3787 return false;
3790 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3791 talloc_free(r);
3792 return false;
3795 pull = ndr_pull_init_blob(&blob, r, NULL);
3796 if (pull == NULL) {
3797 talloc_free(r);
3798 return false;
3801 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3802 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3803 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3804 talloc_free(r);
3805 return false;
3808 if (DEBUGLEVEL >= 10) {
3809 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, r);
3812 r->out.result = _spoolss_DeletePrintProcessor(p, r);
3814 if (p->rng_fault_state) {
3815 talloc_free(r);
3816 /* Return true here, srv_pipe_hnd.c will take care */
3817 return true;
3820 if (DEBUGLEVEL >= 10) {
3821 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, r);
3824 push = ndr_push_init_ctx(r, NULL);
3825 if (push == NULL) {
3826 talloc_free(r);
3827 return false;
3830 ndr_err = call->ndr_push(push, NDR_OUT, r);
3831 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3832 talloc_free(r);
3833 return false;
3836 blob = ndr_push_blob(push);
3837 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3838 talloc_free(r);
3839 return false;
3842 talloc_free(r);
3844 return true;
3847 static bool api_spoolss_AddPrintProvidor(pipes_struct *p)
3849 const struct ndr_interface_call *call;
3850 struct ndr_pull *pull;
3851 struct ndr_push *push;
3852 enum ndr_err_code ndr_err;
3853 DATA_BLOB blob;
3854 struct spoolss_AddPrintProvidor *r;
3856 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTPROVIDOR];
3858 r = talloc(talloc_tos(), struct spoolss_AddPrintProvidor);
3859 if (r == NULL) {
3860 return false;
3863 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3864 talloc_free(r);
3865 return false;
3868 pull = ndr_pull_init_blob(&blob, r, NULL);
3869 if (pull == NULL) {
3870 talloc_free(r);
3871 return false;
3874 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3875 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3876 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3877 talloc_free(r);
3878 return false;
3881 if (DEBUGLEVEL >= 10) {
3882 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, r);
3885 r->out.result = _spoolss_AddPrintProvidor(p, r);
3887 if (p->rng_fault_state) {
3888 talloc_free(r);
3889 /* Return true here, srv_pipe_hnd.c will take care */
3890 return true;
3893 if (DEBUGLEVEL >= 10) {
3894 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, r);
3897 push = ndr_push_init_ctx(r, NULL);
3898 if (push == NULL) {
3899 talloc_free(r);
3900 return false;
3903 ndr_err = call->ndr_push(push, NDR_OUT, r);
3904 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3905 talloc_free(r);
3906 return false;
3909 blob = ndr_push_blob(push);
3910 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3911 talloc_free(r);
3912 return false;
3915 talloc_free(r);
3917 return true;
3920 static bool api_spoolss_DeletePrintProvidor(pipes_struct *p)
3922 const struct ndr_interface_call *call;
3923 struct ndr_pull *pull;
3924 struct ndr_push *push;
3925 enum ndr_err_code ndr_err;
3926 DATA_BLOB blob;
3927 struct spoolss_DeletePrintProvidor *r;
3929 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTPROVIDOR];
3931 r = talloc(talloc_tos(), struct spoolss_DeletePrintProvidor);
3932 if (r == NULL) {
3933 return false;
3936 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3937 talloc_free(r);
3938 return false;
3941 pull = ndr_pull_init_blob(&blob, r, NULL);
3942 if (pull == NULL) {
3943 talloc_free(r);
3944 return false;
3947 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3948 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3949 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3950 talloc_free(r);
3951 return false;
3954 if (DEBUGLEVEL >= 10) {
3955 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, r);
3958 r->out.result = _spoolss_DeletePrintProvidor(p, r);
3960 if (p->rng_fault_state) {
3961 talloc_free(r);
3962 /* Return true here, srv_pipe_hnd.c will take care */
3963 return true;
3966 if (DEBUGLEVEL >= 10) {
3967 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, r);
3970 push = ndr_push_init_ctx(r, NULL);
3971 if (push == NULL) {
3972 talloc_free(r);
3973 return false;
3976 ndr_err = call->ndr_push(push, NDR_OUT, r);
3977 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3978 talloc_free(r);
3979 return false;
3982 blob = ndr_push_blob(push);
3983 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3984 talloc_free(r);
3985 return false;
3988 talloc_free(r);
3990 return true;
3993 static bool api_spoolss_EnumPrintProcDataTypes(pipes_struct *p)
3995 const struct ndr_interface_call *call;
3996 struct ndr_pull *pull;
3997 struct ndr_push *push;
3998 enum ndr_err_code ndr_err;
3999 DATA_BLOB blob;
4000 struct spoolss_EnumPrintProcDataTypes *r;
4002 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTPROCDATATYPES];
4004 r = talloc(talloc_tos(), struct spoolss_EnumPrintProcDataTypes);
4005 if (r == NULL) {
4006 return false;
4009 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4010 talloc_free(r);
4011 return false;
4014 pull = ndr_pull_init_blob(&blob, r, NULL);
4015 if (pull == NULL) {
4016 talloc_free(r);
4017 return false;
4020 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4021 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4022 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4023 talloc_free(r);
4024 return false;
4027 if (DEBUGLEVEL >= 10) {
4028 NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, r);
4031 ZERO_STRUCT(r->out);
4032 r->out.count = talloc_zero(r, uint32_t);
4033 if (r->out.count == NULL) {
4034 talloc_free(r);
4035 return false;
4038 r->out.info = talloc_zero(r, union spoolss_PrintProcDataTypesInfo *);
4039 if (r->out.info == NULL) {
4040 talloc_free(r);
4041 return false;
4044 r->out.needed = talloc_zero(r, uint32_t);
4045 if (r->out.needed == NULL) {
4046 talloc_free(r);
4047 return false;
4050 r->out.result = _spoolss_EnumPrintProcDataTypes(p, r);
4052 if (p->rng_fault_state) {
4053 talloc_free(r);
4054 /* Return true here, srv_pipe_hnd.c will take care */
4055 return true;
4058 if (DEBUGLEVEL >= 10) {
4059 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, r);
4062 push = ndr_push_init_ctx(r, NULL);
4063 if (push == NULL) {
4064 talloc_free(r);
4065 return false;
4068 ndr_err = call->ndr_push(push, NDR_OUT, r);
4069 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4070 talloc_free(r);
4071 return false;
4074 blob = ndr_push_blob(push);
4075 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4076 talloc_free(r);
4077 return false;
4080 talloc_free(r);
4082 return true;
4085 static bool api_spoolss_ResetPrinter(pipes_struct *p)
4087 const struct ndr_interface_call *call;
4088 struct ndr_pull *pull;
4089 struct ndr_push *push;
4090 enum ndr_err_code ndr_err;
4091 DATA_BLOB blob;
4092 struct spoolss_ResetPrinter *r;
4094 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_RESETPRINTER];
4096 r = talloc(talloc_tos(), struct spoolss_ResetPrinter);
4097 if (r == NULL) {
4098 return false;
4101 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4102 talloc_free(r);
4103 return false;
4106 pull = ndr_pull_init_blob(&blob, r, NULL);
4107 if (pull == NULL) {
4108 talloc_free(r);
4109 return false;
4112 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4113 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4114 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4115 talloc_free(r);
4116 return false;
4119 if (DEBUGLEVEL >= 10) {
4120 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, r);
4123 r->out.result = _spoolss_ResetPrinter(p, r);
4125 if (p->rng_fault_state) {
4126 talloc_free(r);
4127 /* Return true here, srv_pipe_hnd.c will take care */
4128 return true;
4131 if (DEBUGLEVEL >= 10) {
4132 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, r);
4135 push = ndr_push_init_ctx(r, NULL);
4136 if (push == NULL) {
4137 talloc_free(r);
4138 return false;
4141 ndr_err = call->ndr_push(push, NDR_OUT, r);
4142 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4143 talloc_free(r);
4144 return false;
4147 blob = ndr_push_blob(push);
4148 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4149 talloc_free(r);
4150 return false;
4153 talloc_free(r);
4155 return true;
4158 static bool api_spoolss_GetPrinterDriver2(pipes_struct *p)
4160 const struct ndr_interface_call *call;
4161 struct ndr_pull *pull;
4162 struct ndr_push *push;
4163 enum ndr_err_code ndr_err;
4164 DATA_BLOB blob;
4165 struct spoolss_GetPrinterDriver2 *r;
4167 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETPRINTERDRIVER2];
4169 r = talloc(talloc_tos(), struct spoolss_GetPrinterDriver2);
4170 if (r == NULL) {
4171 return false;
4174 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4175 talloc_free(r);
4176 return false;
4179 pull = ndr_pull_init_blob(&blob, r, NULL);
4180 if (pull == NULL) {
4181 talloc_free(r);
4182 return false;
4185 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4186 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4187 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4188 talloc_free(r);
4189 return false;
4192 if (DEBUGLEVEL >= 10) {
4193 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, r);
4196 ZERO_STRUCT(r->out);
4197 r->out.info = talloc_zero(r, union spoolss_DriverInfo);
4198 if (r->out.info == NULL) {
4199 talloc_free(r);
4200 return false;
4203 r->out.needed = talloc_zero(r, uint32_t);
4204 if (r->out.needed == NULL) {
4205 talloc_free(r);
4206 return false;
4209 r->out.server_major_version = talloc_zero(r, uint32_t);
4210 if (r->out.server_major_version == NULL) {
4211 talloc_free(r);
4212 return false;
4215 r->out.server_minor_version = talloc_zero(r, uint32_t);
4216 if (r->out.server_minor_version == NULL) {
4217 talloc_free(r);
4218 return false;
4221 r->out.result = _spoolss_GetPrinterDriver2(p, r);
4223 if (p->rng_fault_state) {
4224 talloc_free(r);
4225 /* Return true here, srv_pipe_hnd.c will take care */
4226 return true;
4229 if (DEBUGLEVEL >= 10) {
4230 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, r);
4233 push = ndr_push_init_ctx(r, NULL);
4234 if (push == NULL) {
4235 talloc_free(r);
4236 return false;
4239 ndr_err = call->ndr_push(push, NDR_OUT, r);
4240 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4241 talloc_free(r);
4242 return false;
4245 blob = ndr_push_blob(push);
4246 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4247 talloc_free(r);
4248 return false;
4251 talloc_free(r);
4253 return true;
4256 static bool api_spoolss_FindFirstPrinterChangeNotification(pipes_struct *p)
4258 const struct ndr_interface_call *call;
4259 struct ndr_pull *pull;
4260 struct ndr_push *push;
4261 enum ndr_err_code ndr_err;
4262 DATA_BLOB blob;
4263 struct spoolss_FindFirstPrinterChangeNotification *r;
4265 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION];
4267 r = talloc(talloc_tos(), struct spoolss_FindFirstPrinterChangeNotification);
4268 if (r == NULL) {
4269 return false;
4272 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4273 talloc_free(r);
4274 return false;
4277 pull = ndr_pull_init_blob(&blob, r, NULL);
4278 if (pull == NULL) {
4279 talloc_free(r);
4280 return false;
4283 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4284 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4285 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4286 talloc_free(r);
4287 return false;
4290 if (DEBUGLEVEL >= 10) {
4291 NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, r);
4294 r->out.result = _spoolss_FindFirstPrinterChangeNotification(p, r);
4296 if (p->rng_fault_state) {
4297 talloc_free(r);
4298 /* Return true here, srv_pipe_hnd.c will take care */
4299 return true;
4302 if (DEBUGLEVEL >= 10) {
4303 NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, r);
4306 push = ndr_push_init_ctx(r, NULL);
4307 if (push == NULL) {
4308 talloc_free(r);
4309 return false;
4312 ndr_err = call->ndr_push(push, NDR_OUT, r);
4313 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4314 talloc_free(r);
4315 return false;
4318 blob = ndr_push_blob(push);
4319 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4320 talloc_free(r);
4321 return false;
4324 talloc_free(r);
4326 return true;
4329 static bool api_spoolss_FindNextPrinterChangeNotification(pipes_struct *p)
4331 const struct ndr_interface_call *call;
4332 struct ndr_pull *pull;
4333 struct ndr_push *push;
4334 enum ndr_err_code ndr_err;
4335 DATA_BLOB blob;
4336 struct spoolss_FindNextPrinterChangeNotification *r;
4338 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION];
4340 r = talloc(talloc_tos(), struct spoolss_FindNextPrinterChangeNotification);
4341 if (r == NULL) {
4342 return false;
4345 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4346 talloc_free(r);
4347 return false;
4350 pull = ndr_pull_init_blob(&blob, r, NULL);
4351 if (pull == NULL) {
4352 talloc_free(r);
4353 return false;
4356 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4357 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4358 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4359 talloc_free(r);
4360 return false;
4363 if (DEBUGLEVEL >= 10) {
4364 NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, r);
4367 r->out.result = _spoolss_FindNextPrinterChangeNotification(p, r);
4369 if (p->rng_fault_state) {
4370 talloc_free(r);
4371 /* Return true here, srv_pipe_hnd.c will take care */
4372 return true;
4375 if (DEBUGLEVEL >= 10) {
4376 NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, r);
4379 push = ndr_push_init_ctx(r, NULL);
4380 if (push == NULL) {
4381 talloc_free(r);
4382 return false;
4385 ndr_err = call->ndr_push(push, NDR_OUT, r);
4386 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4387 talloc_free(r);
4388 return false;
4391 blob = ndr_push_blob(push);
4392 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4393 talloc_free(r);
4394 return false;
4397 talloc_free(r);
4399 return true;
4402 static bool api_spoolss_FindClosePrinterNotify(pipes_struct *p)
4404 const struct ndr_interface_call *call;
4405 struct ndr_pull *pull;
4406 struct ndr_push *push;
4407 enum ndr_err_code ndr_err;
4408 DATA_BLOB blob;
4409 struct spoolss_FindClosePrinterNotify *r;
4411 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY];
4413 r = talloc(talloc_tos(), struct spoolss_FindClosePrinterNotify);
4414 if (r == NULL) {
4415 return false;
4418 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4419 talloc_free(r);
4420 return false;
4423 pull = ndr_pull_init_blob(&blob, r, NULL);
4424 if (pull == NULL) {
4425 talloc_free(r);
4426 return false;
4429 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4430 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4431 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4432 talloc_free(r);
4433 return false;
4436 if (DEBUGLEVEL >= 10) {
4437 NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, r);
4440 r->out.result = _spoolss_FindClosePrinterNotify(p, r);
4442 if (p->rng_fault_state) {
4443 talloc_free(r);
4444 /* Return true here, srv_pipe_hnd.c will take care */
4445 return true;
4448 if (DEBUGLEVEL >= 10) {
4449 NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, r);
4452 push = ndr_push_init_ctx(r, NULL);
4453 if (push == NULL) {
4454 talloc_free(r);
4455 return false;
4458 ndr_err = call->ndr_push(push, NDR_OUT, r);
4459 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4460 talloc_free(r);
4461 return false;
4464 blob = ndr_push_blob(push);
4465 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4466 talloc_free(r);
4467 return false;
4470 talloc_free(r);
4472 return true;
4475 static bool api_spoolss_RouterFindFirstPrinterChangeNotificationOld(pipes_struct *p)
4477 const struct ndr_interface_call *call;
4478 struct ndr_pull *pull;
4479 struct ndr_push *push;
4480 enum ndr_err_code ndr_err;
4481 DATA_BLOB blob;
4482 struct spoolss_RouterFindFirstPrinterChangeNotificationOld *r;
4484 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD];
4486 r = talloc(talloc_tos(), struct spoolss_RouterFindFirstPrinterChangeNotificationOld);
4487 if (r == NULL) {
4488 return false;
4491 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4492 talloc_free(r);
4493 return false;
4496 pull = ndr_pull_init_blob(&blob, r, NULL);
4497 if (pull == NULL) {
4498 talloc_free(r);
4499 return false;
4502 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4503 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4504 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4505 talloc_free(r);
4506 return false;
4509 if (DEBUGLEVEL >= 10) {
4510 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, r);
4513 r->out.result = _spoolss_RouterFindFirstPrinterChangeNotificationOld(p, r);
4515 if (p->rng_fault_state) {
4516 talloc_free(r);
4517 /* Return true here, srv_pipe_hnd.c will take care */
4518 return true;
4521 if (DEBUGLEVEL >= 10) {
4522 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, r);
4525 push = ndr_push_init_ctx(r, NULL);
4526 if (push == NULL) {
4527 talloc_free(r);
4528 return false;
4531 ndr_err = call->ndr_push(push, NDR_OUT, r);
4532 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4533 talloc_free(r);
4534 return false;
4537 blob = ndr_push_blob(push);
4538 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4539 talloc_free(r);
4540 return false;
4543 talloc_free(r);
4545 return true;
4548 static bool api_spoolss_ReplyOpenPrinter(pipes_struct *p)
4550 const struct ndr_interface_call *call;
4551 struct ndr_pull *pull;
4552 struct ndr_push *push;
4553 enum ndr_err_code ndr_err;
4554 DATA_BLOB blob;
4555 struct spoolss_ReplyOpenPrinter *r;
4557 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_REPLYOPENPRINTER];
4559 r = talloc(talloc_tos(), struct spoolss_ReplyOpenPrinter);
4560 if (r == NULL) {
4561 return false;
4564 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4565 talloc_free(r);
4566 return false;
4569 pull = ndr_pull_init_blob(&blob, r, NULL);
4570 if (pull == NULL) {
4571 talloc_free(r);
4572 return false;
4575 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4576 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4577 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4578 talloc_free(r);
4579 return false;
4582 if (DEBUGLEVEL >= 10) {
4583 NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, r);
4586 ZERO_STRUCT(r->out);
4587 r->out.handle = talloc_zero(r, struct policy_handle);
4588 if (r->out.handle == NULL) {
4589 talloc_free(r);
4590 return false;
4593 r->out.result = _spoolss_ReplyOpenPrinter(p, r);
4595 if (p->rng_fault_state) {
4596 talloc_free(r);
4597 /* Return true here, srv_pipe_hnd.c will take care */
4598 return true;
4601 if (DEBUGLEVEL >= 10) {
4602 NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, r);
4605 push = ndr_push_init_ctx(r, NULL);
4606 if (push == NULL) {
4607 talloc_free(r);
4608 return false;
4611 ndr_err = call->ndr_push(push, NDR_OUT, r);
4612 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4613 talloc_free(r);
4614 return false;
4617 blob = ndr_push_blob(push);
4618 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4619 talloc_free(r);
4620 return false;
4623 talloc_free(r);
4625 return true;
4628 static bool api_spoolss_RouterReplyPrinter(pipes_struct *p)
4630 const struct ndr_interface_call *call;
4631 struct ndr_pull *pull;
4632 struct ndr_push *push;
4633 enum ndr_err_code ndr_err;
4634 DATA_BLOB blob;
4635 struct spoolss_RouterReplyPrinter *r;
4637 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERREPLYPRINTER];
4639 r = talloc(talloc_tos(), struct spoolss_RouterReplyPrinter);
4640 if (r == NULL) {
4641 return false;
4644 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4645 talloc_free(r);
4646 return false;
4649 pull = ndr_pull_init_blob(&blob, r, NULL);
4650 if (pull == NULL) {
4651 talloc_free(r);
4652 return false;
4655 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4656 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4657 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4658 talloc_free(r);
4659 return false;
4662 if (DEBUGLEVEL >= 10) {
4663 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, r);
4666 r->out.result = _spoolss_RouterReplyPrinter(p, r);
4668 if (p->rng_fault_state) {
4669 talloc_free(r);
4670 /* Return true here, srv_pipe_hnd.c will take care */
4671 return true;
4674 if (DEBUGLEVEL >= 10) {
4675 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, r);
4678 push = ndr_push_init_ctx(r, NULL);
4679 if (push == NULL) {
4680 talloc_free(r);
4681 return false;
4684 ndr_err = call->ndr_push(push, NDR_OUT, r);
4685 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4686 talloc_free(r);
4687 return false;
4690 blob = ndr_push_blob(push);
4691 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4692 talloc_free(r);
4693 return false;
4696 talloc_free(r);
4698 return true;
4701 static bool api_spoolss_ReplyClosePrinter(pipes_struct *p)
4703 const struct ndr_interface_call *call;
4704 struct ndr_pull *pull;
4705 struct ndr_push *push;
4706 enum ndr_err_code ndr_err;
4707 DATA_BLOB blob;
4708 struct spoolss_ReplyClosePrinter *r;
4710 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_REPLYCLOSEPRINTER];
4712 r = talloc(talloc_tos(), struct spoolss_ReplyClosePrinter);
4713 if (r == NULL) {
4714 return false;
4717 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4718 talloc_free(r);
4719 return false;
4722 pull = ndr_pull_init_blob(&blob, r, NULL);
4723 if (pull == NULL) {
4724 talloc_free(r);
4725 return false;
4728 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4729 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4730 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4731 talloc_free(r);
4732 return false;
4735 if (DEBUGLEVEL >= 10) {
4736 NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, r);
4739 ZERO_STRUCT(r->out);
4740 r->out.handle = r->in.handle;
4741 r->out.result = _spoolss_ReplyClosePrinter(p, r);
4743 if (p->rng_fault_state) {
4744 talloc_free(r);
4745 /* Return true here, srv_pipe_hnd.c will take care */
4746 return true;
4749 if (DEBUGLEVEL >= 10) {
4750 NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, r);
4753 push = ndr_push_init_ctx(r, NULL);
4754 if (push == NULL) {
4755 talloc_free(r);
4756 return false;
4759 ndr_err = call->ndr_push(push, NDR_OUT, r);
4760 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4761 talloc_free(r);
4762 return false;
4765 blob = ndr_push_blob(push);
4766 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4767 talloc_free(r);
4768 return false;
4771 talloc_free(r);
4773 return true;
4776 static bool api_spoolss_AddPortEx(pipes_struct *p)
4778 const struct ndr_interface_call *call;
4779 struct ndr_pull *pull;
4780 struct ndr_push *push;
4781 enum ndr_err_code ndr_err;
4782 DATA_BLOB blob;
4783 struct spoolss_AddPortEx *r;
4785 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPORTEX];
4787 r = talloc(talloc_tos(), struct spoolss_AddPortEx);
4788 if (r == NULL) {
4789 return false;
4792 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4793 talloc_free(r);
4794 return false;
4797 pull = ndr_pull_init_blob(&blob, r, NULL);
4798 if (pull == NULL) {
4799 talloc_free(r);
4800 return false;
4803 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4804 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4805 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4806 talloc_free(r);
4807 return false;
4810 if (DEBUGLEVEL >= 10) {
4811 NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, r);
4814 r->out.result = _spoolss_AddPortEx(p, r);
4816 if (p->rng_fault_state) {
4817 talloc_free(r);
4818 /* Return true here, srv_pipe_hnd.c will take care */
4819 return true;
4822 if (DEBUGLEVEL >= 10) {
4823 NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, r);
4826 push = ndr_push_init_ctx(r, NULL);
4827 if (push == NULL) {
4828 talloc_free(r);
4829 return false;
4832 ndr_err = call->ndr_push(push, NDR_OUT, r);
4833 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4834 talloc_free(r);
4835 return false;
4838 blob = ndr_push_blob(push);
4839 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4840 talloc_free(r);
4841 return false;
4844 talloc_free(r);
4846 return true;
4849 static bool api_spoolss_RouterFindFirstPrinterChangeNotification(pipes_struct *p)
4851 const struct ndr_interface_call *call;
4852 struct ndr_pull *pull;
4853 struct ndr_push *push;
4854 enum ndr_err_code ndr_err;
4855 DATA_BLOB blob;
4856 struct spoolss_RouterFindFirstPrinterChangeNotification *r;
4858 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION];
4860 r = talloc(talloc_tos(), struct spoolss_RouterFindFirstPrinterChangeNotification);
4861 if (r == NULL) {
4862 return false;
4865 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4866 talloc_free(r);
4867 return false;
4870 pull = ndr_pull_init_blob(&blob, r, NULL);
4871 if (pull == NULL) {
4872 talloc_free(r);
4873 return false;
4876 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4877 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4878 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4879 talloc_free(r);
4880 return false;
4883 if (DEBUGLEVEL >= 10) {
4884 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, r);
4887 r->out.result = _spoolss_RouterFindFirstPrinterChangeNotification(p, r);
4889 if (p->rng_fault_state) {
4890 talloc_free(r);
4891 /* Return true here, srv_pipe_hnd.c will take care */
4892 return true;
4895 if (DEBUGLEVEL >= 10) {
4896 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, r);
4899 push = ndr_push_init_ctx(r, NULL);
4900 if (push == NULL) {
4901 talloc_free(r);
4902 return false;
4905 ndr_err = call->ndr_push(push, NDR_OUT, r);
4906 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4907 talloc_free(r);
4908 return false;
4911 blob = ndr_push_blob(push);
4912 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4913 talloc_free(r);
4914 return false;
4917 talloc_free(r);
4919 return true;
4922 static bool api_spoolss_SpoolerInit(pipes_struct *p)
4924 const struct ndr_interface_call *call;
4925 struct ndr_pull *pull;
4926 struct ndr_push *push;
4927 enum ndr_err_code ndr_err;
4928 DATA_BLOB blob;
4929 struct spoolss_SpoolerInit *r;
4931 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SPOOLERINIT];
4933 r = talloc(talloc_tos(), struct spoolss_SpoolerInit);
4934 if (r == NULL) {
4935 return false;
4938 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4939 talloc_free(r);
4940 return false;
4943 pull = ndr_pull_init_blob(&blob, r, NULL);
4944 if (pull == NULL) {
4945 talloc_free(r);
4946 return false;
4949 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4950 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4951 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4952 talloc_free(r);
4953 return false;
4956 if (DEBUGLEVEL >= 10) {
4957 NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, r);
4960 r->out.result = _spoolss_SpoolerInit(p, r);
4962 if (p->rng_fault_state) {
4963 talloc_free(r);
4964 /* Return true here, srv_pipe_hnd.c will take care */
4965 return true;
4968 if (DEBUGLEVEL >= 10) {
4969 NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, r);
4972 push = ndr_push_init_ctx(r, NULL);
4973 if (push == NULL) {
4974 talloc_free(r);
4975 return false;
4978 ndr_err = call->ndr_push(push, NDR_OUT, r);
4979 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4980 talloc_free(r);
4981 return false;
4984 blob = ndr_push_blob(push);
4985 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4986 talloc_free(r);
4987 return false;
4990 talloc_free(r);
4992 return true;
4995 static bool api_spoolss_ResetPrinterEx(pipes_struct *p)
4997 const struct ndr_interface_call *call;
4998 struct ndr_pull *pull;
4999 struct ndr_push *push;
5000 enum ndr_err_code ndr_err;
5001 DATA_BLOB blob;
5002 struct spoolss_ResetPrinterEx *r;
5004 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_RESETPRINTEREX];
5006 r = talloc(talloc_tos(), struct spoolss_ResetPrinterEx);
5007 if (r == NULL) {
5008 return false;
5011 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5012 talloc_free(r);
5013 return false;
5016 pull = ndr_pull_init_blob(&blob, r, NULL);
5017 if (pull == NULL) {
5018 talloc_free(r);
5019 return false;
5022 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5023 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5024 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5025 talloc_free(r);
5026 return false;
5029 if (DEBUGLEVEL >= 10) {
5030 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, r);
5033 r->out.result = _spoolss_ResetPrinterEx(p, r);
5035 if (p->rng_fault_state) {
5036 talloc_free(r);
5037 /* Return true here, srv_pipe_hnd.c will take care */
5038 return true;
5041 if (DEBUGLEVEL >= 10) {
5042 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, r);
5045 push = ndr_push_init_ctx(r, NULL);
5046 if (push == NULL) {
5047 talloc_free(r);
5048 return false;
5051 ndr_err = call->ndr_push(push, NDR_OUT, r);
5052 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5053 talloc_free(r);
5054 return false;
5057 blob = ndr_push_blob(push);
5058 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5059 talloc_free(r);
5060 return false;
5063 talloc_free(r);
5065 return true;
5068 static bool api_spoolss_RemoteFindFirstPrinterChangeNotifyEx(pipes_struct *p)
5070 const struct ndr_interface_call *call;
5071 struct ndr_pull *pull;
5072 struct ndr_push *push;
5073 enum ndr_err_code ndr_err;
5074 DATA_BLOB blob;
5075 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r;
5077 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX];
5079 r = talloc(talloc_tos(), struct spoolss_RemoteFindFirstPrinterChangeNotifyEx);
5080 if (r == NULL) {
5081 return false;
5084 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5085 talloc_free(r);
5086 return false;
5089 pull = ndr_pull_init_blob(&blob, r, NULL);
5090 if (pull == NULL) {
5091 talloc_free(r);
5092 return false;
5095 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5096 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5097 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5098 talloc_free(r);
5099 return false;
5102 if (DEBUGLEVEL >= 10) {
5103 NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, r);
5106 r->out.result = _spoolss_RemoteFindFirstPrinterChangeNotifyEx(p, r);
5108 if (p->rng_fault_state) {
5109 talloc_free(r);
5110 /* Return true here, srv_pipe_hnd.c will take care */
5111 return true;
5114 if (DEBUGLEVEL >= 10) {
5115 NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, r);
5118 push = ndr_push_init_ctx(r, NULL);
5119 if (push == NULL) {
5120 talloc_free(r);
5121 return false;
5124 ndr_err = call->ndr_push(push, NDR_OUT, r);
5125 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5126 talloc_free(r);
5127 return false;
5130 blob = ndr_push_blob(push);
5131 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5132 talloc_free(r);
5133 return false;
5136 talloc_free(r);
5138 return true;
5141 static bool api_spoolss_RouterReplyPrinterEx(pipes_struct *p)
5143 const struct ndr_interface_call *call;
5144 struct ndr_pull *pull;
5145 struct ndr_push *push;
5146 enum ndr_err_code ndr_err;
5147 DATA_BLOB blob;
5148 struct spoolss_RouterReplyPrinterEx *r;
5150 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERREPLYPRINTEREX];
5152 r = talloc(talloc_tos(), struct spoolss_RouterReplyPrinterEx);
5153 if (r == NULL) {
5154 return false;
5157 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5158 talloc_free(r);
5159 return false;
5162 pull = ndr_pull_init_blob(&blob, r, NULL);
5163 if (pull == NULL) {
5164 talloc_free(r);
5165 return false;
5168 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5169 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5170 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5171 talloc_free(r);
5172 return false;
5175 if (DEBUGLEVEL >= 10) {
5176 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, r);
5179 ZERO_STRUCT(r->out);
5180 r->out.reply_result = talloc_zero(r, uint32_t);
5181 if (r->out.reply_result == NULL) {
5182 talloc_free(r);
5183 return false;
5186 r->out.result = _spoolss_RouterReplyPrinterEx(p, r);
5188 if (p->rng_fault_state) {
5189 talloc_free(r);
5190 /* Return true here, srv_pipe_hnd.c will take care */
5191 return true;
5194 if (DEBUGLEVEL >= 10) {
5195 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinterEx, r);
5198 push = ndr_push_init_ctx(r, NULL);
5199 if (push == NULL) {
5200 talloc_free(r);
5201 return false;
5204 ndr_err = call->ndr_push(push, NDR_OUT, r);
5205 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5206 talloc_free(r);
5207 return false;
5210 blob = ndr_push_blob(push);
5211 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5212 talloc_free(r);
5213 return false;
5216 talloc_free(r);
5218 return true;
5221 static bool api_spoolss_RouterRefreshPrinterChangeNotify(pipes_struct *p)
5223 const struct ndr_interface_call *call;
5224 struct ndr_pull *pull;
5225 struct ndr_push *push;
5226 enum ndr_err_code ndr_err;
5227 DATA_BLOB blob;
5228 struct spoolss_RouterRefreshPrinterChangeNotify *r;
5230 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY];
5232 r = talloc(talloc_tos(), struct spoolss_RouterRefreshPrinterChangeNotify);
5233 if (r == NULL) {
5234 return false;
5237 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5238 talloc_free(r);
5239 return false;
5242 pull = ndr_pull_init_blob(&blob, r, NULL);
5243 if (pull == NULL) {
5244 talloc_free(r);
5245 return false;
5248 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5249 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5250 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5251 talloc_free(r);
5252 return false;
5255 if (DEBUGLEVEL >= 10) {
5256 NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, r);
5259 ZERO_STRUCT(r->out);
5260 r->out.info = talloc_zero(r, struct spoolss_NotifyInfo *);
5261 if (r->out.info == NULL) {
5262 talloc_free(r);
5263 return false;
5266 r->out.result = _spoolss_RouterRefreshPrinterChangeNotify(p, r);
5268 if (p->rng_fault_state) {
5269 talloc_free(r);
5270 /* Return true here, srv_pipe_hnd.c will take care */
5271 return true;
5274 if (DEBUGLEVEL >= 10) {
5275 NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, r);
5278 push = ndr_push_init_ctx(r, NULL);
5279 if (push == NULL) {
5280 talloc_free(r);
5281 return false;
5284 ndr_err = call->ndr_push(push, NDR_OUT, r);
5285 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5286 talloc_free(r);
5287 return false;
5290 blob = ndr_push_blob(push);
5291 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5292 talloc_free(r);
5293 return false;
5296 talloc_free(r);
5298 return true;
5301 static bool api_spoolss_44(pipes_struct *p)
5303 const struct ndr_interface_call *call;
5304 struct ndr_pull *pull;
5305 struct ndr_push *push;
5306 enum ndr_err_code ndr_err;
5307 DATA_BLOB blob;
5308 struct spoolss_44 *r;
5310 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_44];
5312 r = talloc(talloc_tos(), struct spoolss_44);
5313 if (r == NULL) {
5314 return false;
5317 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5318 talloc_free(r);
5319 return false;
5322 pull = ndr_pull_init_blob(&blob, r, NULL);
5323 if (pull == NULL) {
5324 talloc_free(r);
5325 return false;
5328 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5329 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5330 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5331 talloc_free(r);
5332 return false;
5335 if (DEBUGLEVEL >= 10) {
5336 NDR_PRINT_IN_DEBUG(spoolss_44, r);
5339 r->out.result = _spoolss_44(p, r);
5341 if (p->rng_fault_state) {
5342 talloc_free(r);
5343 /* Return true here, srv_pipe_hnd.c will take care */
5344 return true;
5347 if (DEBUGLEVEL >= 10) {
5348 NDR_PRINT_OUT_DEBUG(spoolss_44, r);
5351 push = ndr_push_init_ctx(r, NULL);
5352 if (push == NULL) {
5353 talloc_free(r);
5354 return false;
5357 ndr_err = call->ndr_push(push, NDR_OUT, r);
5358 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5359 talloc_free(r);
5360 return false;
5363 blob = ndr_push_blob(push);
5364 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5365 talloc_free(r);
5366 return false;
5369 talloc_free(r);
5371 return true;
5374 static bool api_spoolss_OpenPrinterEx(pipes_struct *p)
5376 const struct ndr_interface_call *call;
5377 struct ndr_pull *pull;
5378 struct ndr_push *push;
5379 enum ndr_err_code ndr_err;
5380 DATA_BLOB blob;
5381 struct spoolss_OpenPrinterEx *r;
5383 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_OPENPRINTEREX];
5385 r = talloc(talloc_tos(), struct spoolss_OpenPrinterEx);
5386 if (r == NULL) {
5387 return false;
5390 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5391 talloc_free(r);
5392 return false;
5395 pull = ndr_pull_init_blob(&blob, r, NULL);
5396 if (pull == NULL) {
5397 talloc_free(r);
5398 return false;
5401 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5402 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5403 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5404 talloc_free(r);
5405 return false;
5408 if (DEBUGLEVEL >= 10) {
5409 NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, r);
5412 ZERO_STRUCT(r->out);
5413 r->out.handle = talloc_zero(r, struct policy_handle);
5414 if (r->out.handle == NULL) {
5415 talloc_free(r);
5416 return false;
5419 r->out.result = _spoolss_OpenPrinterEx(p, r);
5421 if (p->rng_fault_state) {
5422 talloc_free(r);
5423 /* Return true here, srv_pipe_hnd.c will take care */
5424 return true;
5427 if (DEBUGLEVEL >= 10) {
5428 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, r);
5431 push = ndr_push_init_ctx(r, NULL);
5432 if (push == NULL) {
5433 talloc_free(r);
5434 return false;
5437 ndr_err = call->ndr_push(push, NDR_OUT, r);
5438 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5439 talloc_free(r);
5440 return false;
5443 blob = ndr_push_blob(push);
5444 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5445 talloc_free(r);
5446 return false;
5449 talloc_free(r);
5451 return true;
5454 static bool api_spoolss_AddPrinterEx(pipes_struct *p)
5456 const struct ndr_interface_call *call;
5457 struct ndr_pull *pull;
5458 struct ndr_push *push;
5459 enum ndr_err_code ndr_err;
5460 DATA_BLOB blob;
5461 struct spoolss_AddPrinterEx *r;
5463 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTEREX];
5465 r = talloc(talloc_tos(), struct spoolss_AddPrinterEx);
5466 if (r == NULL) {
5467 return false;
5470 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5471 talloc_free(r);
5472 return false;
5475 pull = ndr_pull_init_blob(&blob, r, NULL);
5476 if (pull == NULL) {
5477 talloc_free(r);
5478 return false;
5481 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5482 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5483 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5484 talloc_free(r);
5485 return false;
5488 if (DEBUGLEVEL >= 10) {
5489 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, r);
5492 ZERO_STRUCT(r->out);
5493 r->out.handle = talloc_zero(r, struct policy_handle);
5494 if (r->out.handle == NULL) {
5495 talloc_free(r);
5496 return false;
5499 r->out.result = _spoolss_AddPrinterEx(p, r);
5501 if (p->rng_fault_state) {
5502 talloc_free(r);
5503 /* Return true here, srv_pipe_hnd.c will take care */
5504 return true;
5507 if (DEBUGLEVEL >= 10) {
5508 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, r);
5511 push = ndr_push_init_ctx(r, NULL);
5512 if (push == NULL) {
5513 talloc_free(r);
5514 return false;
5517 ndr_err = call->ndr_push(push, NDR_OUT, r);
5518 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5519 talloc_free(r);
5520 return false;
5523 blob = ndr_push_blob(push);
5524 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5525 talloc_free(r);
5526 return false;
5529 talloc_free(r);
5531 return true;
5534 static bool api_spoolss_47(pipes_struct *p)
5536 const struct ndr_interface_call *call;
5537 struct ndr_pull *pull;
5538 struct ndr_push *push;
5539 enum ndr_err_code ndr_err;
5540 DATA_BLOB blob;
5541 struct spoolss_47 *r;
5543 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_47];
5545 r = talloc(talloc_tos(), struct spoolss_47);
5546 if (r == NULL) {
5547 return false;
5550 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5551 talloc_free(r);
5552 return false;
5555 pull = ndr_pull_init_blob(&blob, r, NULL);
5556 if (pull == NULL) {
5557 talloc_free(r);
5558 return false;
5561 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5562 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5563 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5564 talloc_free(r);
5565 return false;
5568 if (DEBUGLEVEL >= 10) {
5569 NDR_PRINT_IN_DEBUG(spoolss_47, r);
5572 r->out.result = _spoolss_47(p, r);
5574 if (p->rng_fault_state) {
5575 talloc_free(r);
5576 /* Return true here, srv_pipe_hnd.c will take care */
5577 return true;
5580 if (DEBUGLEVEL >= 10) {
5581 NDR_PRINT_OUT_DEBUG(spoolss_47, r);
5584 push = ndr_push_init_ctx(r, NULL);
5585 if (push == NULL) {
5586 talloc_free(r);
5587 return false;
5590 ndr_err = call->ndr_push(push, NDR_OUT, r);
5591 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5592 talloc_free(r);
5593 return false;
5596 blob = ndr_push_blob(push);
5597 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5598 talloc_free(r);
5599 return false;
5602 talloc_free(r);
5604 return true;
5607 static bool api_spoolss_EnumPrinterData(pipes_struct *p)
5609 const struct ndr_interface_call *call;
5610 struct ndr_pull *pull;
5611 struct ndr_push *push;
5612 enum ndr_err_code ndr_err;
5613 DATA_BLOB blob;
5614 struct spoolss_EnumPrinterData *r;
5616 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTERDATA];
5618 r = talloc(talloc_tos(), struct spoolss_EnumPrinterData);
5619 if (r == NULL) {
5620 return false;
5623 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5624 talloc_free(r);
5625 return false;
5628 pull = ndr_pull_init_blob(&blob, r, NULL);
5629 if (pull == NULL) {
5630 talloc_free(r);
5631 return false;
5634 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5635 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5636 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5637 talloc_free(r);
5638 return false;
5641 if (DEBUGLEVEL >= 10) {
5642 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterData, r);
5645 ZERO_STRUCT(r->out);
5646 r->out.value_name = talloc_zero_array(r, const char, r->in.value_offered / 2);
5647 if (r->out.value_name == NULL) {
5648 talloc_free(r);
5649 return false;
5652 r->out.value_needed = talloc_zero(r, uint32_t);
5653 if (r->out.value_needed == NULL) {
5654 talloc_free(r);
5655 return false;
5658 r->out.type = talloc_zero(r, enum winreg_Type);
5659 if (r->out.type == NULL) {
5660 talloc_free(r);
5661 return false;
5664 r->out.data = talloc_zero_array(r, uint8_t, r->in.data_offered);
5665 if (r->out.data == NULL) {
5666 talloc_free(r);
5667 return false;
5670 r->out.data_needed = talloc_zero(r, uint32_t);
5671 if (r->out.data_needed == NULL) {
5672 talloc_free(r);
5673 return false;
5676 r->out.result = _spoolss_EnumPrinterData(p, r);
5678 if (p->rng_fault_state) {
5679 talloc_free(r);
5680 /* Return true here, srv_pipe_hnd.c will take care */
5681 return true;
5684 if (DEBUGLEVEL >= 10) {
5685 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterData, r);
5688 push = ndr_push_init_ctx(r, NULL);
5689 if (push == NULL) {
5690 talloc_free(r);
5691 return false;
5694 ndr_err = call->ndr_push(push, NDR_OUT, r);
5695 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5696 talloc_free(r);
5697 return false;
5700 blob = ndr_push_blob(push);
5701 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5702 talloc_free(r);
5703 return false;
5706 talloc_free(r);
5708 return true;
5711 static bool api_spoolss_DeletePrinterData(pipes_struct *p)
5713 const struct ndr_interface_call *call;
5714 struct ndr_pull *pull;
5715 struct ndr_push *push;
5716 enum ndr_err_code ndr_err;
5717 DATA_BLOB blob;
5718 struct spoolss_DeletePrinterData *r;
5720 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERDATA];
5722 r = talloc(talloc_tos(), struct spoolss_DeletePrinterData);
5723 if (r == NULL) {
5724 return false;
5727 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5728 talloc_free(r);
5729 return false;
5732 pull = ndr_pull_init_blob(&blob, r, NULL);
5733 if (pull == NULL) {
5734 talloc_free(r);
5735 return false;
5738 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5739 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5740 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5741 talloc_free(r);
5742 return false;
5745 if (DEBUGLEVEL >= 10) {
5746 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterData, r);
5749 r->out.result = _spoolss_DeletePrinterData(p, r);
5751 if (p->rng_fault_state) {
5752 talloc_free(r);
5753 /* Return true here, srv_pipe_hnd.c will take care */
5754 return true;
5757 if (DEBUGLEVEL >= 10) {
5758 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterData, r);
5761 push = ndr_push_init_ctx(r, NULL);
5762 if (push == NULL) {
5763 talloc_free(r);
5764 return false;
5767 ndr_err = call->ndr_push(push, NDR_OUT, r);
5768 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5769 talloc_free(r);
5770 return false;
5773 blob = ndr_push_blob(push);
5774 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5775 talloc_free(r);
5776 return false;
5779 talloc_free(r);
5781 return true;
5784 static bool api_spoolss_4a(pipes_struct *p)
5786 const struct ndr_interface_call *call;
5787 struct ndr_pull *pull;
5788 struct ndr_push *push;
5789 enum ndr_err_code ndr_err;
5790 DATA_BLOB blob;
5791 struct spoolss_4a *r;
5793 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_4A];
5795 r = talloc(talloc_tos(), struct spoolss_4a);
5796 if (r == NULL) {
5797 return false;
5800 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5801 talloc_free(r);
5802 return false;
5805 pull = ndr_pull_init_blob(&blob, r, NULL);
5806 if (pull == NULL) {
5807 talloc_free(r);
5808 return false;
5811 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5812 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5813 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5814 talloc_free(r);
5815 return false;
5818 if (DEBUGLEVEL >= 10) {
5819 NDR_PRINT_IN_DEBUG(spoolss_4a, r);
5822 r->out.result = _spoolss_4a(p, r);
5824 if (p->rng_fault_state) {
5825 talloc_free(r);
5826 /* Return true here, srv_pipe_hnd.c will take care */
5827 return true;
5830 if (DEBUGLEVEL >= 10) {
5831 NDR_PRINT_OUT_DEBUG(spoolss_4a, r);
5834 push = ndr_push_init_ctx(r, NULL);
5835 if (push == NULL) {
5836 talloc_free(r);
5837 return false;
5840 ndr_err = call->ndr_push(push, NDR_OUT, r);
5841 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5842 talloc_free(r);
5843 return false;
5846 blob = ndr_push_blob(push);
5847 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5848 talloc_free(r);
5849 return false;
5852 talloc_free(r);
5854 return true;
5857 static bool api_spoolss_4b(pipes_struct *p)
5859 const struct ndr_interface_call *call;
5860 struct ndr_pull *pull;
5861 struct ndr_push *push;
5862 enum ndr_err_code ndr_err;
5863 DATA_BLOB blob;
5864 struct spoolss_4b *r;
5866 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_4B];
5868 r = talloc(talloc_tos(), struct spoolss_4b);
5869 if (r == NULL) {
5870 return false;
5873 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5874 talloc_free(r);
5875 return false;
5878 pull = ndr_pull_init_blob(&blob, r, NULL);
5879 if (pull == NULL) {
5880 talloc_free(r);
5881 return false;
5884 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5885 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5886 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5887 talloc_free(r);
5888 return false;
5891 if (DEBUGLEVEL >= 10) {
5892 NDR_PRINT_IN_DEBUG(spoolss_4b, r);
5895 r->out.result = _spoolss_4b(p, r);
5897 if (p->rng_fault_state) {
5898 talloc_free(r);
5899 /* Return true here, srv_pipe_hnd.c will take care */
5900 return true;
5903 if (DEBUGLEVEL >= 10) {
5904 NDR_PRINT_OUT_DEBUG(spoolss_4b, r);
5907 push = ndr_push_init_ctx(r, NULL);
5908 if (push == NULL) {
5909 talloc_free(r);
5910 return false;
5913 ndr_err = call->ndr_push(push, NDR_OUT, r);
5914 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5915 talloc_free(r);
5916 return false;
5919 blob = ndr_push_blob(push);
5920 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5921 talloc_free(r);
5922 return false;
5925 talloc_free(r);
5927 return true;
5930 static bool api_spoolss_4c(pipes_struct *p)
5932 const struct ndr_interface_call *call;
5933 struct ndr_pull *pull;
5934 struct ndr_push *push;
5935 enum ndr_err_code ndr_err;
5936 DATA_BLOB blob;
5937 struct spoolss_4c *r;
5939 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_4C];
5941 r = talloc(talloc_tos(), struct spoolss_4c);
5942 if (r == NULL) {
5943 return false;
5946 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5947 talloc_free(r);
5948 return false;
5951 pull = ndr_pull_init_blob(&blob, r, NULL);
5952 if (pull == NULL) {
5953 talloc_free(r);
5954 return false;
5957 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5958 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5959 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5960 talloc_free(r);
5961 return false;
5964 if (DEBUGLEVEL >= 10) {
5965 NDR_PRINT_IN_DEBUG(spoolss_4c, r);
5968 r->out.result = _spoolss_4c(p, r);
5970 if (p->rng_fault_state) {
5971 talloc_free(r);
5972 /* Return true here, srv_pipe_hnd.c will take care */
5973 return true;
5976 if (DEBUGLEVEL >= 10) {
5977 NDR_PRINT_OUT_DEBUG(spoolss_4c, r);
5980 push = ndr_push_init_ctx(r, NULL);
5981 if (push == NULL) {
5982 talloc_free(r);
5983 return false;
5986 ndr_err = call->ndr_push(push, NDR_OUT, r);
5987 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5988 talloc_free(r);
5989 return false;
5992 blob = ndr_push_blob(push);
5993 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5994 talloc_free(r);
5995 return false;
5998 talloc_free(r);
6000 return true;
6003 static bool api_spoolss_SetPrinterDataEx(pipes_struct *p)
6005 const struct ndr_interface_call *call;
6006 struct ndr_pull *pull;
6007 struct ndr_push *push;
6008 enum ndr_err_code ndr_err;
6009 DATA_BLOB blob;
6010 struct spoolss_SetPrinterDataEx *r;
6012 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SETPRINTERDATAEX];
6014 r = talloc(talloc_tos(), struct spoolss_SetPrinterDataEx);
6015 if (r == NULL) {
6016 return false;
6019 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6020 talloc_free(r);
6021 return false;
6024 pull = ndr_pull_init_blob(&blob, r, NULL);
6025 if (pull == NULL) {
6026 talloc_free(r);
6027 return false;
6030 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6031 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6032 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6033 talloc_free(r);
6034 return false;
6037 if (DEBUGLEVEL >= 10) {
6038 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterDataEx, r);
6041 r->out.result = _spoolss_SetPrinterDataEx(p, r);
6043 if (p->rng_fault_state) {
6044 talloc_free(r);
6045 /* Return true here, srv_pipe_hnd.c will take care */
6046 return true;
6049 if (DEBUGLEVEL >= 10) {
6050 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterDataEx, r);
6053 push = ndr_push_init_ctx(r, NULL);
6054 if (push == NULL) {
6055 talloc_free(r);
6056 return false;
6059 ndr_err = call->ndr_push(push, NDR_OUT, r);
6060 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6061 talloc_free(r);
6062 return false;
6065 blob = ndr_push_blob(push);
6066 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6067 talloc_free(r);
6068 return false;
6071 talloc_free(r);
6073 return true;
6076 static bool api_spoolss_GetPrinterDataEx(pipes_struct *p)
6078 const struct ndr_interface_call *call;
6079 struct ndr_pull *pull;
6080 struct ndr_push *push;
6081 enum ndr_err_code ndr_err;
6082 DATA_BLOB blob;
6083 struct spoolss_GetPrinterDataEx *r;
6085 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETPRINTERDATAEX];
6087 r = talloc(talloc_tos(), struct spoolss_GetPrinterDataEx);
6088 if (r == NULL) {
6089 return false;
6092 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6093 talloc_free(r);
6094 return false;
6097 pull = ndr_pull_init_blob(&blob, r, NULL);
6098 if (pull == NULL) {
6099 talloc_free(r);
6100 return false;
6103 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6104 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6105 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6106 talloc_free(r);
6107 return false;
6110 if (DEBUGLEVEL >= 10) {
6111 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDataEx, r);
6114 ZERO_STRUCT(r->out);
6115 r->out.type = talloc_zero(r, enum winreg_Type);
6116 if (r->out.type == NULL) {
6117 talloc_free(r);
6118 return false;
6121 r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
6122 if (r->out.buffer == NULL) {
6123 talloc_free(r);
6124 return false;
6127 r->out.needed = talloc_zero(r, uint32_t);
6128 if (r->out.needed == NULL) {
6129 talloc_free(r);
6130 return false;
6133 r->out.result = _spoolss_GetPrinterDataEx(p, r);
6135 if (p->rng_fault_state) {
6136 talloc_free(r);
6137 /* Return true here, srv_pipe_hnd.c will take care */
6138 return true;
6141 if (DEBUGLEVEL >= 10) {
6142 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDataEx, r);
6145 push = ndr_push_init_ctx(r, NULL);
6146 if (push == NULL) {
6147 talloc_free(r);
6148 return false;
6151 ndr_err = call->ndr_push(push, NDR_OUT, r);
6152 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6153 talloc_free(r);
6154 return false;
6157 blob = ndr_push_blob(push);
6158 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6159 talloc_free(r);
6160 return false;
6163 talloc_free(r);
6165 return true;
6168 static bool api_spoolss_EnumPrinterDataEx(pipes_struct *p)
6170 const struct ndr_interface_call *call;
6171 struct ndr_pull *pull;
6172 struct ndr_push *push;
6173 enum ndr_err_code ndr_err;
6174 DATA_BLOB blob;
6175 struct spoolss_EnumPrinterDataEx *r;
6177 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTERDATAEX];
6179 r = talloc(talloc_tos(), struct spoolss_EnumPrinterDataEx);
6180 if (r == NULL) {
6181 return false;
6184 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6185 talloc_free(r);
6186 return false;
6189 pull = ndr_pull_init_blob(&blob, r, NULL);
6190 if (pull == NULL) {
6191 talloc_free(r);
6192 return false;
6195 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6196 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6197 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6198 talloc_free(r);
6199 return false;
6202 if (DEBUGLEVEL >= 10) {
6203 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDataEx, r);
6206 ZERO_STRUCT(r->out);
6207 r->out.count = talloc_zero(r, uint32_t);
6208 if (r->out.count == NULL) {
6209 talloc_free(r);
6210 return false;
6213 r->out.info = talloc_zero(r, struct spoolss_PrinterEnumValues *);
6214 if (r->out.info == NULL) {
6215 talloc_free(r);
6216 return false;
6219 r->out.needed = talloc_zero(r, uint32_t);
6220 if (r->out.needed == NULL) {
6221 talloc_free(r);
6222 return false;
6225 r->out.result = _spoolss_EnumPrinterDataEx(p, r);
6227 if (p->rng_fault_state) {
6228 talloc_free(r);
6229 /* Return true here, srv_pipe_hnd.c will take care */
6230 return true;
6233 if (DEBUGLEVEL >= 10) {
6234 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDataEx, r);
6237 push = ndr_push_init_ctx(r, NULL);
6238 if (push == NULL) {
6239 talloc_free(r);
6240 return false;
6243 ndr_err = call->ndr_push(push, NDR_OUT, r);
6244 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6245 talloc_free(r);
6246 return false;
6249 blob = ndr_push_blob(push);
6250 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6251 talloc_free(r);
6252 return false;
6255 talloc_free(r);
6257 return true;
6260 static bool api_spoolss_EnumPrinterKey(pipes_struct *p)
6262 const struct ndr_interface_call *call;
6263 struct ndr_pull *pull;
6264 struct ndr_push *push;
6265 enum ndr_err_code ndr_err;
6266 DATA_BLOB blob;
6267 struct spoolss_EnumPrinterKey *r;
6269 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTERKEY];
6271 r = talloc(talloc_tos(), struct spoolss_EnumPrinterKey);
6272 if (r == NULL) {
6273 return false;
6276 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6277 talloc_free(r);
6278 return false;
6281 pull = ndr_pull_init_blob(&blob, r, NULL);
6282 if (pull == NULL) {
6283 talloc_free(r);
6284 return false;
6287 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6288 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6289 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6290 talloc_free(r);
6291 return false;
6294 if (DEBUGLEVEL >= 10) {
6295 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, r);
6298 ZERO_STRUCT(r->out);
6299 r->out.key_buffer = talloc_zero(r, const char **);
6300 if (r->out.key_buffer == NULL) {
6301 talloc_free(r);
6302 return false;
6305 r->out.needed = talloc_zero(r, uint32_t);
6306 if (r->out.needed == NULL) {
6307 talloc_free(r);
6308 return false;
6311 r->out.result = _spoolss_EnumPrinterKey(p, r);
6313 if (p->rng_fault_state) {
6314 talloc_free(r);
6315 /* Return true here, srv_pipe_hnd.c will take care */
6316 return true;
6319 if (DEBUGLEVEL >= 10) {
6320 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterKey, r);
6323 push = ndr_push_init_ctx(r, NULL);
6324 if (push == NULL) {
6325 talloc_free(r);
6326 return false;
6329 ndr_err = call->ndr_push(push, NDR_OUT, r);
6330 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6331 talloc_free(r);
6332 return false;
6335 blob = ndr_push_blob(push);
6336 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6337 talloc_free(r);
6338 return false;
6341 talloc_free(r);
6343 return true;
6346 static bool api_spoolss_DeletePrinterDataEx(pipes_struct *p)
6348 const struct ndr_interface_call *call;
6349 struct ndr_pull *pull;
6350 struct ndr_push *push;
6351 enum ndr_err_code ndr_err;
6352 DATA_BLOB blob;
6353 struct spoolss_DeletePrinterDataEx *r;
6355 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERDATAEX];
6357 r = talloc(talloc_tos(), struct spoolss_DeletePrinterDataEx);
6358 if (r == NULL) {
6359 return false;
6362 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6363 talloc_free(r);
6364 return false;
6367 pull = ndr_pull_init_blob(&blob, r, NULL);
6368 if (pull == NULL) {
6369 talloc_free(r);
6370 return false;
6373 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6374 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6375 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6376 talloc_free(r);
6377 return false;
6380 if (DEBUGLEVEL >= 10) {
6381 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDataEx, r);
6384 r->out.result = _spoolss_DeletePrinterDataEx(p, r);
6386 if (p->rng_fault_state) {
6387 talloc_free(r);
6388 /* Return true here, srv_pipe_hnd.c will take care */
6389 return true;
6392 if (DEBUGLEVEL >= 10) {
6393 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDataEx, r);
6396 push = ndr_push_init_ctx(r, NULL);
6397 if (push == NULL) {
6398 talloc_free(r);
6399 return false;
6402 ndr_err = call->ndr_push(push, NDR_OUT, r);
6403 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6404 talloc_free(r);
6405 return false;
6408 blob = ndr_push_blob(push);
6409 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6410 talloc_free(r);
6411 return false;
6414 talloc_free(r);
6416 return true;
6419 static bool api_spoolss_DeletePrinterKey(pipes_struct *p)
6421 const struct ndr_interface_call *call;
6422 struct ndr_pull *pull;
6423 struct ndr_push *push;
6424 enum ndr_err_code ndr_err;
6425 DATA_BLOB blob;
6426 struct spoolss_DeletePrinterKey *r;
6428 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERKEY];
6430 r = talloc(talloc_tos(), struct spoolss_DeletePrinterKey);
6431 if (r == NULL) {
6432 return false;
6435 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6436 talloc_free(r);
6437 return false;
6440 pull = ndr_pull_init_blob(&blob, r, NULL);
6441 if (pull == NULL) {
6442 talloc_free(r);
6443 return false;
6446 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6447 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6448 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6449 talloc_free(r);
6450 return false;
6453 if (DEBUGLEVEL >= 10) {
6454 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, r);
6457 r->out.result = _spoolss_DeletePrinterKey(p, r);
6459 if (p->rng_fault_state) {
6460 talloc_free(r);
6461 /* Return true here, srv_pipe_hnd.c will take care */
6462 return true;
6465 if (DEBUGLEVEL >= 10) {
6466 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterKey, r);
6469 push = ndr_push_init_ctx(r, NULL);
6470 if (push == NULL) {
6471 talloc_free(r);
6472 return false;
6475 ndr_err = call->ndr_push(push, NDR_OUT, r);
6476 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6477 talloc_free(r);
6478 return false;
6481 blob = ndr_push_blob(push);
6482 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6483 talloc_free(r);
6484 return false;
6487 talloc_free(r);
6489 return true;
6492 static bool api_spoolss_53(pipes_struct *p)
6494 const struct ndr_interface_call *call;
6495 struct ndr_pull *pull;
6496 struct ndr_push *push;
6497 enum ndr_err_code ndr_err;
6498 DATA_BLOB blob;
6499 struct spoolss_53 *r;
6501 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_53];
6503 r = talloc(talloc_tos(), struct spoolss_53);
6504 if (r == NULL) {
6505 return false;
6508 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6509 talloc_free(r);
6510 return false;
6513 pull = ndr_pull_init_blob(&blob, r, NULL);
6514 if (pull == NULL) {
6515 talloc_free(r);
6516 return false;
6519 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6520 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6521 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6522 talloc_free(r);
6523 return false;
6526 if (DEBUGLEVEL >= 10) {
6527 NDR_PRINT_IN_DEBUG(spoolss_53, r);
6530 r->out.result = _spoolss_53(p, r);
6532 if (p->rng_fault_state) {
6533 talloc_free(r);
6534 /* Return true here, srv_pipe_hnd.c will take care */
6535 return true;
6538 if (DEBUGLEVEL >= 10) {
6539 NDR_PRINT_OUT_DEBUG(spoolss_53, r);
6542 push = ndr_push_init_ctx(r, NULL);
6543 if (push == NULL) {
6544 talloc_free(r);
6545 return false;
6548 ndr_err = call->ndr_push(push, NDR_OUT, r);
6549 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6550 talloc_free(r);
6551 return false;
6554 blob = ndr_push_blob(push);
6555 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6556 talloc_free(r);
6557 return false;
6560 talloc_free(r);
6562 return true;
6565 static bool api_spoolss_DeletePrinterDriverEx(pipes_struct *p)
6567 const struct ndr_interface_call *call;
6568 struct ndr_pull *pull;
6569 struct ndr_push *push;
6570 enum ndr_err_code ndr_err;
6571 DATA_BLOB blob;
6572 struct spoolss_DeletePrinterDriverEx *r;
6574 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERDRIVEREX];
6576 r = talloc(talloc_tos(), struct spoolss_DeletePrinterDriverEx);
6577 if (r == NULL) {
6578 return false;
6581 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6582 talloc_free(r);
6583 return false;
6586 pull = ndr_pull_init_blob(&blob, r, NULL);
6587 if (pull == NULL) {
6588 talloc_free(r);
6589 return false;
6592 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6593 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6594 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6595 talloc_free(r);
6596 return false;
6599 if (DEBUGLEVEL >= 10) {
6600 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, r);
6603 r->out.result = _spoolss_DeletePrinterDriverEx(p, r);
6605 if (p->rng_fault_state) {
6606 talloc_free(r);
6607 /* Return true here, srv_pipe_hnd.c will take care */
6608 return true;
6611 if (DEBUGLEVEL >= 10) {
6612 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriverEx, r);
6615 push = ndr_push_init_ctx(r, NULL);
6616 if (push == NULL) {
6617 talloc_free(r);
6618 return false;
6621 ndr_err = call->ndr_push(push, NDR_OUT, r);
6622 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6623 talloc_free(r);
6624 return false;
6627 blob = ndr_push_blob(push);
6628 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6629 talloc_free(r);
6630 return false;
6633 talloc_free(r);
6635 return true;
6638 static bool api_spoolss_55(pipes_struct *p)
6640 const struct ndr_interface_call *call;
6641 struct ndr_pull *pull;
6642 struct ndr_push *push;
6643 enum ndr_err_code ndr_err;
6644 DATA_BLOB blob;
6645 struct spoolss_55 *r;
6647 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_55];
6649 r = talloc(talloc_tos(), struct spoolss_55);
6650 if (r == NULL) {
6651 return false;
6654 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6655 talloc_free(r);
6656 return false;
6659 pull = ndr_pull_init_blob(&blob, r, NULL);
6660 if (pull == NULL) {
6661 talloc_free(r);
6662 return false;
6665 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6666 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6667 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6668 talloc_free(r);
6669 return false;
6672 if (DEBUGLEVEL >= 10) {
6673 NDR_PRINT_IN_DEBUG(spoolss_55, r);
6676 r->out.result = _spoolss_55(p, r);
6678 if (p->rng_fault_state) {
6679 talloc_free(r);
6680 /* Return true here, srv_pipe_hnd.c will take care */
6681 return true;
6684 if (DEBUGLEVEL >= 10) {
6685 NDR_PRINT_OUT_DEBUG(spoolss_55, r);
6688 push = ndr_push_init_ctx(r, NULL);
6689 if (push == NULL) {
6690 talloc_free(r);
6691 return false;
6694 ndr_err = call->ndr_push(push, NDR_OUT, r);
6695 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6696 talloc_free(r);
6697 return false;
6700 blob = ndr_push_blob(push);
6701 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6702 talloc_free(r);
6703 return false;
6706 talloc_free(r);
6708 return true;
6711 static bool api_spoolss_56(pipes_struct *p)
6713 const struct ndr_interface_call *call;
6714 struct ndr_pull *pull;
6715 struct ndr_push *push;
6716 enum ndr_err_code ndr_err;
6717 DATA_BLOB blob;
6718 struct spoolss_56 *r;
6720 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_56];
6722 r = talloc(talloc_tos(), struct spoolss_56);
6723 if (r == NULL) {
6724 return false;
6727 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6728 talloc_free(r);
6729 return false;
6732 pull = ndr_pull_init_blob(&blob, r, NULL);
6733 if (pull == NULL) {
6734 talloc_free(r);
6735 return false;
6738 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6739 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6740 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6741 talloc_free(r);
6742 return false;
6745 if (DEBUGLEVEL >= 10) {
6746 NDR_PRINT_IN_DEBUG(spoolss_56, r);
6749 r->out.result = _spoolss_56(p, r);
6751 if (p->rng_fault_state) {
6752 talloc_free(r);
6753 /* Return true here, srv_pipe_hnd.c will take care */
6754 return true;
6757 if (DEBUGLEVEL >= 10) {
6758 NDR_PRINT_OUT_DEBUG(spoolss_56, r);
6761 push = ndr_push_init_ctx(r, NULL);
6762 if (push == NULL) {
6763 talloc_free(r);
6764 return false;
6767 ndr_err = call->ndr_push(push, NDR_OUT, r);
6768 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6769 talloc_free(r);
6770 return false;
6773 blob = ndr_push_blob(push);
6774 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6775 talloc_free(r);
6776 return false;
6779 talloc_free(r);
6781 return true;
6784 static bool api_spoolss_57(pipes_struct *p)
6786 const struct ndr_interface_call *call;
6787 struct ndr_pull *pull;
6788 struct ndr_push *push;
6789 enum ndr_err_code ndr_err;
6790 DATA_BLOB blob;
6791 struct spoolss_57 *r;
6793 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_57];
6795 r = talloc(talloc_tos(), struct spoolss_57);
6796 if (r == NULL) {
6797 return false;
6800 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6801 talloc_free(r);
6802 return false;
6805 pull = ndr_pull_init_blob(&blob, r, NULL);
6806 if (pull == NULL) {
6807 talloc_free(r);
6808 return false;
6811 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6812 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6813 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6814 talloc_free(r);
6815 return false;
6818 if (DEBUGLEVEL >= 10) {
6819 NDR_PRINT_IN_DEBUG(spoolss_57, r);
6822 r->out.result = _spoolss_57(p, r);
6824 if (p->rng_fault_state) {
6825 talloc_free(r);
6826 /* Return true here, srv_pipe_hnd.c will take care */
6827 return true;
6830 if (DEBUGLEVEL >= 10) {
6831 NDR_PRINT_OUT_DEBUG(spoolss_57, r);
6834 push = ndr_push_init_ctx(r, NULL);
6835 if (push == NULL) {
6836 talloc_free(r);
6837 return false;
6840 ndr_err = call->ndr_push(push, NDR_OUT, r);
6841 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6842 talloc_free(r);
6843 return false;
6846 blob = ndr_push_blob(push);
6847 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6848 talloc_free(r);
6849 return false;
6852 talloc_free(r);
6854 return true;
6857 static bool api_spoolss_XcvData(pipes_struct *p)
6859 const struct ndr_interface_call *call;
6860 struct ndr_pull *pull;
6861 struct ndr_push *push;
6862 enum ndr_err_code ndr_err;
6863 DATA_BLOB blob;
6864 struct spoolss_XcvData *r;
6866 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_XCVDATA];
6868 r = talloc(talloc_tos(), struct spoolss_XcvData);
6869 if (r == NULL) {
6870 return false;
6873 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6874 talloc_free(r);
6875 return false;
6878 pull = ndr_pull_init_blob(&blob, r, NULL);
6879 if (pull == NULL) {
6880 talloc_free(r);
6881 return false;
6884 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6885 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6886 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6887 talloc_free(r);
6888 return false;
6891 if (DEBUGLEVEL >= 10) {
6892 NDR_PRINT_IN_DEBUG(spoolss_XcvData, r);
6895 ZERO_STRUCT(r->out);
6896 r->out.status_code = r->in.status_code;
6897 r->out.out_data = talloc_zero_array(r, uint8_t, r->in.out_data_size);
6898 if (r->out.out_data == NULL) {
6899 talloc_free(r);
6900 return false;
6903 r->out.needed = talloc_zero(r, uint32_t);
6904 if (r->out.needed == NULL) {
6905 talloc_free(r);
6906 return false;
6909 r->out.result = _spoolss_XcvData(p, r);
6911 if (p->rng_fault_state) {
6912 talloc_free(r);
6913 /* Return true here, srv_pipe_hnd.c will take care */
6914 return true;
6917 if (DEBUGLEVEL >= 10) {
6918 NDR_PRINT_OUT_DEBUG(spoolss_XcvData, r);
6921 push = ndr_push_init_ctx(r, NULL);
6922 if (push == NULL) {
6923 talloc_free(r);
6924 return false;
6927 ndr_err = call->ndr_push(push, NDR_OUT, r);
6928 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6929 talloc_free(r);
6930 return false;
6933 blob = ndr_push_blob(push);
6934 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6935 talloc_free(r);
6936 return false;
6939 talloc_free(r);
6941 return true;
6944 static bool api_spoolss_AddPrinterDriverEx(pipes_struct *p)
6946 const struct ndr_interface_call *call;
6947 struct ndr_pull *pull;
6948 struct ndr_push *push;
6949 enum ndr_err_code ndr_err;
6950 DATA_BLOB blob;
6951 struct spoolss_AddPrinterDriverEx *r;
6953 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTERDRIVEREX];
6955 r = talloc(talloc_tos(), struct spoolss_AddPrinterDriverEx);
6956 if (r == NULL) {
6957 return false;
6960 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6961 talloc_free(r);
6962 return false;
6965 pull = ndr_pull_init_blob(&blob, r, NULL);
6966 if (pull == NULL) {
6967 talloc_free(r);
6968 return false;
6971 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6972 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6973 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6974 talloc_free(r);
6975 return false;
6978 if (DEBUGLEVEL >= 10) {
6979 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriverEx, r);
6982 r->out.result = _spoolss_AddPrinterDriverEx(p, r);
6984 if (p->rng_fault_state) {
6985 talloc_free(r);
6986 /* Return true here, srv_pipe_hnd.c will take care */
6987 return true;
6990 if (DEBUGLEVEL >= 10) {
6991 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriverEx, r);
6994 push = ndr_push_init_ctx(r, NULL);
6995 if (push == NULL) {
6996 talloc_free(r);
6997 return false;
7000 ndr_err = call->ndr_push(push, NDR_OUT, r);
7001 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7002 talloc_free(r);
7003 return false;
7006 blob = ndr_push_blob(push);
7007 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7008 talloc_free(r);
7009 return false;
7012 talloc_free(r);
7014 return true;
7017 static bool api_spoolss_5a(pipes_struct *p)
7019 const struct ndr_interface_call *call;
7020 struct ndr_pull *pull;
7021 struct ndr_push *push;
7022 enum ndr_err_code ndr_err;
7023 DATA_BLOB blob;
7024 struct spoolss_5a *r;
7026 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5A];
7028 r = talloc(talloc_tos(), struct spoolss_5a);
7029 if (r == NULL) {
7030 return false;
7033 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7034 talloc_free(r);
7035 return false;
7038 pull = ndr_pull_init_blob(&blob, r, NULL);
7039 if (pull == NULL) {
7040 talloc_free(r);
7041 return false;
7044 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7045 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7046 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7047 talloc_free(r);
7048 return false;
7051 if (DEBUGLEVEL >= 10) {
7052 NDR_PRINT_IN_DEBUG(spoolss_5a, r);
7055 r->out.result = _spoolss_5a(p, r);
7057 if (p->rng_fault_state) {
7058 talloc_free(r);
7059 /* Return true here, srv_pipe_hnd.c will take care */
7060 return true;
7063 if (DEBUGLEVEL >= 10) {
7064 NDR_PRINT_OUT_DEBUG(spoolss_5a, r);
7067 push = ndr_push_init_ctx(r, NULL);
7068 if (push == NULL) {
7069 talloc_free(r);
7070 return false;
7073 ndr_err = call->ndr_push(push, NDR_OUT, r);
7074 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7075 talloc_free(r);
7076 return false;
7079 blob = ndr_push_blob(push);
7080 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7081 talloc_free(r);
7082 return false;
7085 talloc_free(r);
7087 return true;
7090 static bool api_spoolss_5b(pipes_struct *p)
7092 const struct ndr_interface_call *call;
7093 struct ndr_pull *pull;
7094 struct ndr_push *push;
7095 enum ndr_err_code ndr_err;
7096 DATA_BLOB blob;
7097 struct spoolss_5b *r;
7099 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5B];
7101 r = talloc(talloc_tos(), struct spoolss_5b);
7102 if (r == NULL) {
7103 return false;
7106 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7107 talloc_free(r);
7108 return false;
7111 pull = ndr_pull_init_blob(&blob, r, NULL);
7112 if (pull == NULL) {
7113 talloc_free(r);
7114 return false;
7117 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7118 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7119 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7120 talloc_free(r);
7121 return false;
7124 if (DEBUGLEVEL >= 10) {
7125 NDR_PRINT_IN_DEBUG(spoolss_5b, r);
7128 r->out.result = _spoolss_5b(p, r);
7130 if (p->rng_fault_state) {
7131 talloc_free(r);
7132 /* Return true here, srv_pipe_hnd.c will take care */
7133 return true;
7136 if (DEBUGLEVEL >= 10) {
7137 NDR_PRINT_OUT_DEBUG(spoolss_5b, r);
7140 push = ndr_push_init_ctx(r, NULL);
7141 if (push == NULL) {
7142 talloc_free(r);
7143 return false;
7146 ndr_err = call->ndr_push(push, NDR_OUT, r);
7147 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7148 talloc_free(r);
7149 return false;
7152 blob = ndr_push_blob(push);
7153 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7154 talloc_free(r);
7155 return false;
7158 talloc_free(r);
7160 return true;
7163 static bool api_spoolss_5c(pipes_struct *p)
7165 const struct ndr_interface_call *call;
7166 struct ndr_pull *pull;
7167 struct ndr_push *push;
7168 enum ndr_err_code ndr_err;
7169 DATA_BLOB blob;
7170 struct spoolss_5c *r;
7172 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5C];
7174 r = talloc(talloc_tos(), struct spoolss_5c);
7175 if (r == NULL) {
7176 return false;
7179 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7180 talloc_free(r);
7181 return false;
7184 pull = ndr_pull_init_blob(&blob, r, NULL);
7185 if (pull == NULL) {
7186 talloc_free(r);
7187 return false;
7190 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7191 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7192 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7193 talloc_free(r);
7194 return false;
7197 if (DEBUGLEVEL >= 10) {
7198 NDR_PRINT_IN_DEBUG(spoolss_5c, r);
7201 r->out.result = _spoolss_5c(p, r);
7203 if (p->rng_fault_state) {
7204 talloc_free(r);
7205 /* Return true here, srv_pipe_hnd.c will take care */
7206 return true;
7209 if (DEBUGLEVEL >= 10) {
7210 NDR_PRINT_OUT_DEBUG(spoolss_5c, r);
7213 push = ndr_push_init_ctx(r, NULL);
7214 if (push == NULL) {
7215 talloc_free(r);
7216 return false;
7219 ndr_err = call->ndr_push(push, NDR_OUT, r);
7220 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7221 talloc_free(r);
7222 return false;
7225 blob = ndr_push_blob(push);
7226 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7227 talloc_free(r);
7228 return false;
7231 talloc_free(r);
7233 return true;
7236 static bool api_spoolss_5d(pipes_struct *p)
7238 const struct ndr_interface_call *call;
7239 struct ndr_pull *pull;
7240 struct ndr_push *push;
7241 enum ndr_err_code ndr_err;
7242 DATA_BLOB blob;
7243 struct spoolss_5d *r;
7245 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5D];
7247 r = talloc(talloc_tos(), struct spoolss_5d);
7248 if (r == NULL) {
7249 return false;
7252 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7253 talloc_free(r);
7254 return false;
7257 pull = ndr_pull_init_blob(&blob, r, NULL);
7258 if (pull == NULL) {
7259 talloc_free(r);
7260 return false;
7263 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7264 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7265 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7266 talloc_free(r);
7267 return false;
7270 if (DEBUGLEVEL >= 10) {
7271 NDR_PRINT_IN_DEBUG(spoolss_5d, r);
7274 r->out.result = _spoolss_5d(p, r);
7276 if (p->rng_fault_state) {
7277 talloc_free(r);
7278 /* Return true here, srv_pipe_hnd.c will take care */
7279 return true;
7282 if (DEBUGLEVEL >= 10) {
7283 NDR_PRINT_OUT_DEBUG(spoolss_5d, r);
7286 push = ndr_push_init_ctx(r, NULL);
7287 if (push == NULL) {
7288 talloc_free(r);
7289 return false;
7292 ndr_err = call->ndr_push(push, NDR_OUT, r);
7293 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7294 talloc_free(r);
7295 return false;
7298 blob = ndr_push_blob(push);
7299 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7300 talloc_free(r);
7301 return false;
7304 talloc_free(r);
7306 return true;
7309 static bool api_spoolss_5e(pipes_struct *p)
7311 const struct ndr_interface_call *call;
7312 struct ndr_pull *pull;
7313 struct ndr_push *push;
7314 enum ndr_err_code ndr_err;
7315 DATA_BLOB blob;
7316 struct spoolss_5e *r;
7318 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5E];
7320 r = talloc(talloc_tos(), struct spoolss_5e);
7321 if (r == NULL) {
7322 return false;
7325 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7326 talloc_free(r);
7327 return false;
7330 pull = ndr_pull_init_blob(&blob, r, NULL);
7331 if (pull == NULL) {
7332 talloc_free(r);
7333 return false;
7336 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7337 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7338 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7339 talloc_free(r);
7340 return false;
7343 if (DEBUGLEVEL >= 10) {
7344 NDR_PRINT_IN_DEBUG(spoolss_5e, r);
7347 r->out.result = _spoolss_5e(p, r);
7349 if (p->rng_fault_state) {
7350 talloc_free(r);
7351 /* Return true here, srv_pipe_hnd.c will take care */
7352 return true;
7355 if (DEBUGLEVEL >= 10) {
7356 NDR_PRINT_OUT_DEBUG(spoolss_5e, r);
7359 push = ndr_push_init_ctx(r, NULL);
7360 if (push == NULL) {
7361 talloc_free(r);
7362 return false;
7365 ndr_err = call->ndr_push(push, NDR_OUT, r);
7366 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7367 talloc_free(r);
7368 return false;
7371 blob = ndr_push_blob(push);
7372 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7373 talloc_free(r);
7374 return false;
7377 talloc_free(r);
7379 return true;
7382 static bool api_spoolss_5f(pipes_struct *p)
7384 const struct ndr_interface_call *call;
7385 struct ndr_pull *pull;
7386 struct ndr_push *push;
7387 enum ndr_err_code ndr_err;
7388 DATA_BLOB blob;
7389 struct spoolss_5f *r;
7391 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5F];
7393 r = talloc(talloc_tos(), struct spoolss_5f);
7394 if (r == NULL) {
7395 return false;
7398 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7399 talloc_free(r);
7400 return false;
7403 pull = ndr_pull_init_blob(&blob, r, NULL);
7404 if (pull == NULL) {
7405 talloc_free(r);
7406 return false;
7409 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7410 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7411 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7412 talloc_free(r);
7413 return false;
7416 if (DEBUGLEVEL >= 10) {
7417 NDR_PRINT_IN_DEBUG(spoolss_5f, r);
7420 r->out.result = _spoolss_5f(p, r);
7422 if (p->rng_fault_state) {
7423 talloc_free(r);
7424 /* Return true here, srv_pipe_hnd.c will take care */
7425 return true;
7428 if (DEBUGLEVEL >= 10) {
7429 NDR_PRINT_OUT_DEBUG(spoolss_5f, r);
7432 push = ndr_push_init_ctx(r, NULL);
7433 if (push == NULL) {
7434 talloc_free(r);
7435 return false;
7438 ndr_err = call->ndr_push(push, NDR_OUT, r);
7439 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7440 talloc_free(r);
7441 return false;
7444 blob = ndr_push_blob(push);
7445 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7446 talloc_free(r);
7447 return false;
7450 talloc_free(r);
7452 return true;
7456 /* Tables */
7457 static struct api_struct api_spoolss_cmds[] =
7459 {"SPOOLSS_ENUMPRINTERS", NDR_SPOOLSS_ENUMPRINTERS, api_spoolss_EnumPrinters},
7460 {"SPOOLSS_OPENPRINTER", NDR_SPOOLSS_OPENPRINTER, api_spoolss_OpenPrinter},
7461 {"SPOOLSS_SETJOB", NDR_SPOOLSS_SETJOB, api_spoolss_SetJob},
7462 {"SPOOLSS_GETJOB", NDR_SPOOLSS_GETJOB, api_spoolss_GetJob},
7463 {"SPOOLSS_ENUMJOBS", NDR_SPOOLSS_ENUMJOBS, api_spoolss_EnumJobs},
7464 {"SPOOLSS_ADDPRINTER", NDR_SPOOLSS_ADDPRINTER, api_spoolss_AddPrinter},
7465 {"SPOOLSS_DELETEPRINTER", NDR_SPOOLSS_DELETEPRINTER, api_spoolss_DeletePrinter},
7466 {"SPOOLSS_SETPRINTER", NDR_SPOOLSS_SETPRINTER, api_spoolss_SetPrinter},
7467 {"SPOOLSS_GETPRINTER", NDR_SPOOLSS_GETPRINTER, api_spoolss_GetPrinter},
7468 {"SPOOLSS_ADDPRINTERDRIVER", NDR_SPOOLSS_ADDPRINTERDRIVER, api_spoolss_AddPrinterDriver},
7469 {"SPOOLSS_ENUMPRINTERDRIVERS", NDR_SPOOLSS_ENUMPRINTERDRIVERS, api_spoolss_EnumPrinterDrivers},
7470 {"SPOOLSS_GETPRINTERDRIVER", NDR_SPOOLSS_GETPRINTERDRIVER, api_spoolss_GetPrinterDriver},
7471 {"SPOOLSS_GETPRINTERDRIVERDIRECTORY", NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY, api_spoolss_GetPrinterDriverDirectory},
7472 {"SPOOLSS_DELETEPRINTERDRIVER", NDR_SPOOLSS_DELETEPRINTERDRIVER, api_spoolss_DeletePrinterDriver},
7473 {"SPOOLSS_ADDPRINTPROCESSOR", NDR_SPOOLSS_ADDPRINTPROCESSOR, api_spoolss_AddPrintProcessor},
7474 {"SPOOLSS_ENUMPRINTPROCESSORS", NDR_SPOOLSS_ENUMPRINTPROCESSORS, api_spoolss_EnumPrintProcessors},
7475 {"SPOOLSS_GETPRINTPROCESSORDIRECTORY", NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY, api_spoolss_GetPrintProcessorDirectory},
7476 {"SPOOLSS_STARTDOCPRINTER", NDR_SPOOLSS_STARTDOCPRINTER, api_spoolss_StartDocPrinter},
7477 {"SPOOLSS_STARTPAGEPRINTER", NDR_SPOOLSS_STARTPAGEPRINTER, api_spoolss_StartPagePrinter},
7478 {"SPOOLSS_WRITEPRINTER", NDR_SPOOLSS_WRITEPRINTER, api_spoolss_WritePrinter},
7479 {"SPOOLSS_ENDPAGEPRINTER", NDR_SPOOLSS_ENDPAGEPRINTER, api_spoolss_EndPagePrinter},
7480 {"SPOOLSS_ABORTPRINTER", NDR_SPOOLSS_ABORTPRINTER, api_spoolss_AbortPrinter},
7481 {"SPOOLSS_READPRINTER", NDR_SPOOLSS_READPRINTER, api_spoolss_ReadPrinter},
7482 {"SPOOLSS_ENDDOCPRINTER", NDR_SPOOLSS_ENDDOCPRINTER, api_spoolss_EndDocPrinter},
7483 {"SPOOLSS_ADDJOB", NDR_SPOOLSS_ADDJOB, api_spoolss_AddJob},
7484 {"SPOOLSS_SCHEDULEJOB", NDR_SPOOLSS_SCHEDULEJOB, api_spoolss_ScheduleJob},
7485 {"SPOOLSS_GETPRINTERDATA", NDR_SPOOLSS_GETPRINTERDATA, api_spoolss_GetPrinterData},
7486 {"SPOOLSS_SETPRINTERDATA", NDR_SPOOLSS_SETPRINTERDATA, api_spoolss_SetPrinterData},
7487 {"SPOOLSS_WAITFORPRINTERCHANGE", NDR_SPOOLSS_WAITFORPRINTERCHANGE, api_spoolss_WaitForPrinterChange},
7488 {"SPOOLSS_CLOSEPRINTER", NDR_SPOOLSS_CLOSEPRINTER, api_spoolss_ClosePrinter},
7489 {"SPOOLSS_ADDFORM", NDR_SPOOLSS_ADDFORM, api_spoolss_AddForm},
7490 {"SPOOLSS_DELETEFORM", NDR_SPOOLSS_DELETEFORM, api_spoolss_DeleteForm},
7491 {"SPOOLSS_GETFORM", NDR_SPOOLSS_GETFORM, api_spoolss_GetForm},
7492 {"SPOOLSS_SETFORM", NDR_SPOOLSS_SETFORM, api_spoolss_SetForm},
7493 {"SPOOLSS_ENUMFORMS", NDR_SPOOLSS_ENUMFORMS, api_spoolss_EnumForms},
7494 {"SPOOLSS_ENUMPORTS", NDR_SPOOLSS_ENUMPORTS, api_spoolss_EnumPorts},
7495 {"SPOOLSS_ENUMMONITORS", NDR_SPOOLSS_ENUMMONITORS, api_spoolss_EnumMonitors},
7496 {"SPOOLSS_ADDPORT", NDR_SPOOLSS_ADDPORT, api_spoolss_AddPort},
7497 {"SPOOLSS_CONFIGUREPORT", NDR_SPOOLSS_CONFIGUREPORT, api_spoolss_ConfigurePort},
7498 {"SPOOLSS_DELETEPORT", NDR_SPOOLSS_DELETEPORT, api_spoolss_DeletePort},
7499 {"SPOOLSS_CREATEPRINTERIC", NDR_SPOOLSS_CREATEPRINTERIC, api_spoolss_CreatePrinterIC},
7500 {"SPOOLSS_PLAYGDISCRIPTONPRINTERIC", NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC, api_spoolss_PlayGDIScriptOnPrinterIC},
7501 {"SPOOLSS_DELETEPRINTERIC", NDR_SPOOLSS_DELETEPRINTERIC, api_spoolss_DeletePrinterIC},
7502 {"SPOOLSS_ADDPRINTERCONNECTION", NDR_SPOOLSS_ADDPRINTERCONNECTION, api_spoolss_AddPrinterConnection},
7503 {"SPOOLSS_DELETEPRINTERCONNECTION", NDR_SPOOLSS_DELETEPRINTERCONNECTION, api_spoolss_DeletePrinterConnection},
7504 {"SPOOLSS_PRINTERMESSAGEBOX", NDR_SPOOLSS_PRINTERMESSAGEBOX, api_spoolss_PrinterMessageBox},
7505 {"SPOOLSS_ADDMONITOR", NDR_SPOOLSS_ADDMONITOR, api_spoolss_AddMonitor},
7506 {"SPOOLSS_DELETEMONITOR", NDR_SPOOLSS_DELETEMONITOR, api_spoolss_DeleteMonitor},
7507 {"SPOOLSS_DELETEPRINTPROCESSOR", NDR_SPOOLSS_DELETEPRINTPROCESSOR, api_spoolss_DeletePrintProcessor},
7508 {"SPOOLSS_ADDPRINTPROVIDOR", NDR_SPOOLSS_ADDPRINTPROVIDOR, api_spoolss_AddPrintProvidor},
7509 {"SPOOLSS_DELETEPRINTPROVIDOR", NDR_SPOOLSS_DELETEPRINTPROVIDOR, api_spoolss_DeletePrintProvidor},
7510 {"SPOOLSS_ENUMPRINTPROCDATATYPES", NDR_SPOOLSS_ENUMPRINTPROCDATATYPES, api_spoolss_EnumPrintProcDataTypes},
7511 {"SPOOLSS_RESETPRINTER", NDR_SPOOLSS_RESETPRINTER, api_spoolss_ResetPrinter},
7512 {"SPOOLSS_GETPRINTERDRIVER2", NDR_SPOOLSS_GETPRINTERDRIVER2, api_spoolss_GetPrinterDriver2},
7513 {"SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION, api_spoolss_FindFirstPrinterChangeNotification},
7514 {"SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION, api_spoolss_FindNextPrinterChangeNotification},
7515 {"SPOOLSS_FINDCLOSEPRINTERNOTIFY", NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY, api_spoolss_FindClosePrinterNotify},
7516 {"SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD", NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD, api_spoolss_RouterFindFirstPrinterChangeNotificationOld},
7517 {"SPOOLSS_REPLYOPENPRINTER", NDR_SPOOLSS_REPLYOPENPRINTER, api_spoolss_ReplyOpenPrinter},
7518 {"SPOOLSS_ROUTERREPLYPRINTER", NDR_SPOOLSS_ROUTERREPLYPRINTER, api_spoolss_RouterReplyPrinter},
7519 {"SPOOLSS_REPLYCLOSEPRINTER", NDR_SPOOLSS_REPLYCLOSEPRINTER, api_spoolss_ReplyClosePrinter},
7520 {"SPOOLSS_ADDPORTEX", NDR_SPOOLSS_ADDPORTEX, api_spoolss_AddPortEx},
7521 {"SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION, api_spoolss_RouterFindFirstPrinterChangeNotification},
7522 {"SPOOLSS_SPOOLERINIT", NDR_SPOOLSS_SPOOLERINIT, api_spoolss_SpoolerInit},
7523 {"SPOOLSS_RESETPRINTEREX", NDR_SPOOLSS_RESETPRINTEREX, api_spoolss_ResetPrinterEx},
7524 {"SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX", NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX, api_spoolss_RemoteFindFirstPrinterChangeNotifyEx},
7525 {"SPOOLSS_ROUTERREPLYPRINTEREX", NDR_SPOOLSS_ROUTERREPLYPRINTEREX, api_spoolss_RouterReplyPrinterEx},
7526 {"SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY", NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY, api_spoolss_RouterRefreshPrinterChangeNotify},
7527 {"SPOOLSS_44", NDR_SPOOLSS_44, api_spoolss_44},
7528 {"SPOOLSS_OPENPRINTEREX", NDR_SPOOLSS_OPENPRINTEREX, api_spoolss_OpenPrinterEx},
7529 {"SPOOLSS_ADDPRINTEREX", NDR_SPOOLSS_ADDPRINTEREX, api_spoolss_AddPrinterEx},
7530 {"SPOOLSS_47", NDR_SPOOLSS_47, api_spoolss_47},
7531 {"SPOOLSS_ENUMPRINTERDATA", NDR_SPOOLSS_ENUMPRINTERDATA, api_spoolss_EnumPrinterData},
7532 {"SPOOLSS_DELETEPRINTERDATA", NDR_SPOOLSS_DELETEPRINTERDATA, api_spoolss_DeletePrinterData},
7533 {"SPOOLSS_4A", NDR_SPOOLSS_4A, api_spoolss_4a},
7534 {"SPOOLSS_4B", NDR_SPOOLSS_4B, api_spoolss_4b},
7535 {"SPOOLSS_4C", NDR_SPOOLSS_4C, api_spoolss_4c},
7536 {"SPOOLSS_SETPRINTERDATAEX", NDR_SPOOLSS_SETPRINTERDATAEX, api_spoolss_SetPrinterDataEx},
7537 {"SPOOLSS_GETPRINTERDATAEX", NDR_SPOOLSS_GETPRINTERDATAEX, api_spoolss_GetPrinterDataEx},
7538 {"SPOOLSS_ENUMPRINTERDATAEX", NDR_SPOOLSS_ENUMPRINTERDATAEX, api_spoolss_EnumPrinterDataEx},
7539 {"SPOOLSS_ENUMPRINTERKEY", NDR_SPOOLSS_ENUMPRINTERKEY, api_spoolss_EnumPrinterKey},
7540 {"SPOOLSS_DELETEPRINTERDATAEX", NDR_SPOOLSS_DELETEPRINTERDATAEX, api_spoolss_DeletePrinterDataEx},
7541 {"SPOOLSS_DELETEPRINTERKEY", NDR_SPOOLSS_DELETEPRINTERKEY, api_spoolss_DeletePrinterKey},
7542 {"SPOOLSS_53", NDR_SPOOLSS_53, api_spoolss_53},
7543 {"SPOOLSS_DELETEPRINTERDRIVEREX", NDR_SPOOLSS_DELETEPRINTERDRIVEREX, api_spoolss_DeletePrinterDriverEx},
7544 {"SPOOLSS_55", NDR_SPOOLSS_55, api_spoolss_55},
7545 {"SPOOLSS_56", NDR_SPOOLSS_56, api_spoolss_56},
7546 {"SPOOLSS_57", NDR_SPOOLSS_57, api_spoolss_57},
7547 {"SPOOLSS_XCVDATA", NDR_SPOOLSS_XCVDATA, api_spoolss_XcvData},
7548 {"SPOOLSS_ADDPRINTERDRIVEREX", NDR_SPOOLSS_ADDPRINTERDRIVEREX, api_spoolss_AddPrinterDriverEx},
7549 {"SPOOLSS_5A", NDR_SPOOLSS_5A, api_spoolss_5a},
7550 {"SPOOLSS_5B", NDR_SPOOLSS_5B, api_spoolss_5b},
7551 {"SPOOLSS_5C", NDR_SPOOLSS_5C, api_spoolss_5c},
7552 {"SPOOLSS_5D", NDR_SPOOLSS_5D, api_spoolss_5d},
7553 {"SPOOLSS_5E", NDR_SPOOLSS_5E, api_spoolss_5e},
7554 {"SPOOLSS_5F", NDR_SPOOLSS_5F, api_spoolss_5f},
7557 void spoolss_get_pipe_fns(struct api_struct **fns, int *n_fns)
7559 *fns = api_spoolss_cmds;
7560 *n_fns = sizeof(api_spoolss_cmds) / sizeof(struct api_struct);
7563 NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
7565 if (cli->pipes_struct == NULL) {
7566 return NT_STATUS_INVALID_PARAMETER;
7569 switch (opnum)
7571 case NDR_SPOOLSS_ENUMPRINTERS: {
7572 struct spoolss_EnumPrinters *r = (struct spoolss_EnumPrinters *)_r;
7573 ZERO_STRUCT(r->out);
7574 r->out.count = talloc_zero(mem_ctx, uint32_t);
7575 if (r->out.count == NULL) {
7576 return NT_STATUS_NO_MEMORY;
7579 r->out.info = talloc_zero(mem_ctx, union spoolss_PrinterInfo *);
7580 if (r->out.info == NULL) {
7581 return NT_STATUS_NO_MEMORY;
7584 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7585 if (r->out.needed == NULL) {
7586 return NT_STATUS_NO_MEMORY;
7589 r->out.result = _spoolss_EnumPrinters(cli->pipes_struct, r);
7590 return NT_STATUS_OK;
7593 case NDR_SPOOLSS_OPENPRINTER: {
7594 struct spoolss_OpenPrinter *r = (struct spoolss_OpenPrinter *)_r;
7595 ZERO_STRUCT(r->out);
7596 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
7597 if (r->out.handle == NULL) {
7598 return NT_STATUS_NO_MEMORY;
7601 r->out.result = _spoolss_OpenPrinter(cli->pipes_struct, r);
7602 return NT_STATUS_OK;
7605 case NDR_SPOOLSS_SETJOB: {
7606 struct spoolss_SetJob *r = (struct spoolss_SetJob *)_r;
7607 r->out.result = _spoolss_SetJob(cli->pipes_struct, r);
7608 return NT_STATUS_OK;
7611 case NDR_SPOOLSS_GETJOB: {
7612 struct spoolss_GetJob *r = (struct spoolss_GetJob *)_r;
7613 ZERO_STRUCT(r->out);
7614 r->out.info = talloc_zero(mem_ctx, union spoolss_JobInfo);
7615 if (r->out.info == NULL) {
7616 return NT_STATUS_NO_MEMORY;
7619 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7620 if (r->out.needed == NULL) {
7621 return NT_STATUS_NO_MEMORY;
7624 r->out.result = _spoolss_GetJob(cli->pipes_struct, r);
7625 return NT_STATUS_OK;
7628 case NDR_SPOOLSS_ENUMJOBS: {
7629 struct spoolss_EnumJobs *r = (struct spoolss_EnumJobs *)_r;
7630 ZERO_STRUCT(r->out);
7631 r->out.count = talloc_zero(mem_ctx, uint32_t);
7632 if (r->out.count == NULL) {
7633 return NT_STATUS_NO_MEMORY;
7636 r->out.info = talloc_zero(mem_ctx, union spoolss_JobInfo *);
7637 if (r->out.info == NULL) {
7638 return NT_STATUS_NO_MEMORY;
7641 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7642 if (r->out.needed == NULL) {
7643 return NT_STATUS_NO_MEMORY;
7646 r->out.result = _spoolss_EnumJobs(cli->pipes_struct, r);
7647 return NT_STATUS_OK;
7650 case NDR_SPOOLSS_ADDPRINTER: {
7651 struct spoolss_AddPrinter *r = (struct spoolss_AddPrinter *)_r;
7652 r->out.result = _spoolss_AddPrinter(cli->pipes_struct, r);
7653 return NT_STATUS_OK;
7656 case NDR_SPOOLSS_DELETEPRINTER: {
7657 struct spoolss_DeletePrinter *r = (struct spoolss_DeletePrinter *)_r;
7658 r->out.result = _spoolss_DeletePrinter(cli->pipes_struct, r);
7659 return NT_STATUS_OK;
7662 case NDR_SPOOLSS_SETPRINTER: {
7663 struct spoolss_SetPrinter *r = (struct spoolss_SetPrinter *)_r;
7664 r->out.result = _spoolss_SetPrinter(cli->pipes_struct, r);
7665 return NT_STATUS_OK;
7668 case NDR_SPOOLSS_GETPRINTER: {
7669 struct spoolss_GetPrinter *r = (struct spoolss_GetPrinter *)_r;
7670 ZERO_STRUCT(r->out);
7671 r->out.info = talloc_zero(mem_ctx, union spoolss_PrinterInfo);
7672 if (r->out.info == NULL) {
7673 return NT_STATUS_NO_MEMORY;
7676 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7677 if (r->out.needed == NULL) {
7678 return NT_STATUS_NO_MEMORY;
7681 r->out.result = _spoolss_GetPrinter(cli->pipes_struct, r);
7682 return NT_STATUS_OK;
7685 case NDR_SPOOLSS_ADDPRINTERDRIVER: {
7686 struct spoolss_AddPrinterDriver *r = (struct spoolss_AddPrinterDriver *)_r;
7687 r->out.result = _spoolss_AddPrinterDriver(cli->pipes_struct, r);
7688 return NT_STATUS_OK;
7691 case NDR_SPOOLSS_ENUMPRINTERDRIVERS: {
7692 struct spoolss_EnumPrinterDrivers *r = (struct spoolss_EnumPrinterDrivers *)_r;
7693 ZERO_STRUCT(r->out);
7694 r->out.count = talloc_zero(mem_ctx, uint32_t);
7695 if (r->out.count == NULL) {
7696 return NT_STATUS_NO_MEMORY;
7699 r->out.info = talloc_zero(mem_ctx, union spoolss_DriverInfo *);
7700 if (r->out.info == NULL) {
7701 return NT_STATUS_NO_MEMORY;
7704 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7705 if (r->out.needed == NULL) {
7706 return NT_STATUS_NO_MEMORY;
7709 r->out.result = _spoolss_EnumPrinterDrivers(cli->pipes_struct, r);
7710 return NT_STATUS_OK;
7713 case NDR_SPOOLSS_GETPRINTERDRIVER: {
7714 struct spoolss_GetPrinterDriver *r = (struct spoolss_GetPrinterDriver *)_r;
7715 r->out.result = _spoolss_GetPrinterDriver(cli->pipes_struct, r);
7716 return NT_STATUS_OK;
7719 case NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY: {
7720 struct spoolss_GetPrinterDriverDirectory *r = (struct spoolss_GetPrinterDriverDirectory *)_r;
7721 ZERO_STRUCT(r->out);
7722 r->out.info = talloc_zero(mem_ctx, union spoolss_DriverDirectoryInfo);
7723 if (r->out.info == NULL) {
7724 return NT_STATUS_NO_MEMORY;
7727 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7728 if (r->out.needed == NULL) {
7729 return NT_STATUS_NO_MEMORY;
7732 r->out.result = _spoolss_GetPrinterDriverDirectory(cli->pipes_struct, r);
7733 return NT_STATUS_OK;
7736 case NDR_SPOOLSS_DELETEPRINTERDRIVER: {
7737 struct spoolss_DeletePrinterDriver *r = (struct spoolss_DeletePrinterDriver *)_r;
7738 r->out.result = _spoolss_DeletePrinterDriver(cli->pipes_struct, r);
7739 return NT_STATUS_OK;
7742 case NDR_SPOOLSS_ADDPRINTPROCESSOR: {
7743 struct spoolss_AddPrintProcessor *r = (struct spoolss_AddPrintProcessor *)_r;
7744 r->out.result = _spoolss_AddPrintProcessor(cli->pipes_struct, r);
7745 return NT_STATUS_OK;
7748 case NDR_SPOOLSS_ENUMPRINTPROCESSORS: {
7749 struct spoolss_EnumPrintProcessors *r = (struct spoolss_EnumPrintProcessors *)_r;
7750 ZERO_STRUCT(r->out);
7751 r->out.count = talloc_zero(mem_ctx, uint32_t);
7752 if (r->out.count == NULL) {
7753 return NT_STATUS_NO_MEMORY;
7756 r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcessorInfo *);
7757 if (r->out.info == NULL) {
7758 return NT_STATUS_NO_MEMORY;
7761 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7762 if (r->out.needed == NULL) {
7763 return NT_STATUS_NO_MEMORY;
7766 r->out.result = _spoolss_EnumPrintProcessors(cli->pipes_struct, r);
7767 return NT_STATUS_OK;
7770 case NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY: {
7771 struct spoolss_GetPrintProcessorDirectory *r = (struct spoolss_GetPrintProcessorDirectory *)_r;
7772 ZERO_STRUCT(r->out);
7773 r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcessorDirectoryInfo);
7774 if (r->out.info == NULL) {
7775 return NT_STATUS_NO_MEMORY;
7778 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7779 if (r->out.needed == NULL) {
7780 return NT_STATUS_NO_MEMORY;
7783 r->out.result = _spoolss_GetPrintProcessorDirectory(cli->pipes_struct, r);
7784 return NT_STATUS_OK;
7787 case NDR_SPOOLSS_STARTDOCPRINTER: {
7788 struct spoolss_StartDocPrinter *r = (struct spoolss_StartDocPrinter *)_r;
7789 ZERO_STRUCT(r->out);
7790 r->out.job_id = talloc_zero(mem_ctx, uint32_t);
7791 if (r->out.job_id == NULL) {
7792 return NT_STATUS_NO_MEMORY;
7795 r->out.result = _spoolss_StartDocPrinter(cli->pipes_struct, r);
7796 return NT_STATUS_OK;
7799 case NDR_SPOOLSS_STARTPAGEPRINTER: {
7800 struct spoolss_StartPagePrinter *r = (struct spoolss_StartPagePrinter *)_r;
7801 r->out.result = _spoolss_StartPagePrinter(cli->pipes_struct, r);
7802 return NT_STATUS_OK;
7805 case NDR_SPOOLSS_WRITEPRINTER: {
7806 struct spoolss_WritePrinter *r = (struct spoolss_WritePrinter *)_r;
7807 ZERO_STRUCT(r->out);
7808 r->out.num_written = talloc_zero(mem_ctx, uint32_t);
7809 if (r->out.num_written == NULL) {
7810 return NT_STATUS_NO_MEMORY;
7813 r->out.result = _spoolss_WritePrinter(cli->pipes_struct, r);
7814 return NT_STATUS_OK;
7817 case NDR_SPOOLSS_ENDPAGEPRINTER: {
7818 struct spoolss_EndPagePrinter *r = (struct spoolss_EndPagePrinter *)_r;
7819 r->out.result = _spoolss_EndPagePrinter(cli->pipes_struct, r);
7820 return NT_STATUS_OK;
7823 case NDR_SPOOLSS_ABORTPRINTER: {
7824 struct spoolss_AbortPrinter *r = (struct spoolss_AbortPrinter *)_r;
7825 r->out.result = _spoolss_AbortPrinter(cli->pipes_struct, r);
7826 return NT_STATUS_OK;
7829 case NDR_SPOOLSS_READPRINTER: {
7830 struct spoolss_ReadPrinter *r = (struct spoolss_ReadPrinter *)_r;
7831 ZERO_STRUCT(r->out);
7832 r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.data_size);
7833 if (r->out.data == NULL) {
7834 return NT_STATUS_NO_MEMORY;
7837 r->out._data_size = talloc_zero(mem_ctx, uint32_t);
7838 if (r->out._data_size == NULL) {
7839 return NT_STATUS_NO_MEMORY;
7842 r->out.result = _spoolss_ReadPrinter(cli->pipes_struct, r);
7843 return NT_STATUS_OK;
7846 case NDR_SPOOLSS_ENDDOCPRINTER: {
7847 struct spoolss_EndDocPrinter *r = (struct spoolss_EndDocPrinter *)_r;
7848 r->out.result = _spoolss_EndDocPrinter(cli->pipes_struct, r);
7849 return NT_STATUS_OK;
7852 case NDR_SPOOLSS_ADDJOB: {
7853 struct spoolss_AddJob *r = (struct spoolss_AddJob *)_r;
7854 ZERO_STRUCT(r->out);
7855 r->out.buffer = r->in.buffer;
7856 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7857 if (r->out.needed == NULL) {
7858 return NT_STATUS_NO_MEMORY;
7861 r->out.result = _spoolss_AddJob(cli->pipes_struct, r);
7862 return NT_STATUS_OK;
7865 case NDR_SPOOLSS_SCHEDULEJOB: {
7866 struct spoolss_ScheduleJob *r = (struct spoolss_ScheduleJob *)_r;
7867 r->out.result = _spoolss_ScheduleJob(cli->pipes_struct, r);
7868 return NT_STATUS_OK;
7871 case NDR_SPOOLSS_GETPRINTERDATA: {
7872 struct spoolss_GetPrinterData *r = (struct spoolss_GetPrinterData *)_r;
7873 ZERO_STRUCT(r->out);
7874 r->out.type = talloc_zero(mem_ctx, enum winreg_Type);
7875 if (r->out.type == NULL) {
7876 return NT_STATUS_NO_MEMORY;
7879 r->out.data = talloc_zero(mem_ctx, union spoolss_PrinterData);
7880 if (r->out.data == NULL) {
7881 return NT_STATUS_NO_MEMORY;
7884 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7885 if (r->out.needed == NULL) {
7886 return NT_STATUS_NO_MEMORY;
7889 r->out.result = _spoolss_GetPrinterData(cli->pipes_struct, r);
7890 return NT_STATUS_OK;
7893 case NDR_SPOOLSS_SETPRINTERDATA: {
7894 struct spoolss_SetPrinterData *r = (struct spoolss_SetPrinterData *)_r;
7895 r->out.result = _spoolss_SetPrinterData(cli->pipes_struct, r);
7896 return NT_STATUS_OK;
7899 case NDR_SPOOLSS_WAITFORPRINTERCHANGE: {
7900 struct spoolss_WaitForPrinterChange *r = (struct spoolss_WaitForPrinterChange *)_r;
7901 r->out.result = _spoolss_WaitForPrinterChange(cli->pipes_struct, r);
7902 return NT_STATUS_OK;
7905 case NDR_SPOOLSS_CLOSEPRINTER: {
7906 struct spoolss_ClosePrinter *r = (struct spoolss_ClosePrinter *)_r;
7907 ZERO_STRUCT(r->out);
7908 r->out.handle = r->in.handle;
7909 r->out.result = _spoolss_ClosePrinter(cli->pipes_struct, r);
7910 return NT_STATUS_OK;
7913 case NDR_SPOOLSS_ADDFORM: {
7914 struct spoolss_AddForm *r = (struct spoolss_AddForm *)_r;
7915 r->out.result = _spoolss_AddForm(cli->pipes_struct, r);
7916 return NT_STATUS_OK;
7919 case NDR_SPOOLSS_DELETEFORM: {
7920 struct spoolss_DeleteForm *r = (struct spoolss_DeleteForm *)_r;
7921 r->out.result = _spoolss_DeleteForm(cli->pipes_struct, r);
7922 return NT_STATUS_OK;
7925 case NDR_SPOOLSS_GETFORM: {
7926 struct spoolss_GetForm *r = (struct spoolss_GetForm *)_r;
7927 ZERO_STRUCT(r->out);
7928 r->out.info = talloc_zero(mem_ctx, union spoolss_FormInfo);
7929 if (r->out.info == NULL) {
7930 return NT_STATUS_NO_MEMORY;
7933 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7934 if (r->out.needed == NULL) {
7935 return NT_STATUS_NO_MEMORY;
7938 r->out.result = _spoolss_GetForm(cli->pipes_struct, r);
7939 return NT_STATUS_OK;
7942 case NDR_SPOOLSS_SETFORM: {
7943 struct spoolss_SetForm *r = (struct spoolss_SetForm *)_r;
7944 r->out.result = _spoolss_SetForm(cli->pipes_struct, r);
7945 return NT_STATUS_OK;
7948 case NDR_SPOOLSS_ENUMFORMS: {
7949 struct spoolss_EnumForms *r = (struct spoolss_EnumForms *)_r;
7950 ZERO_STRUCT(r->out);
7951 r->out.count = talloc_zero(mem_ctx, uint32_t);
7952 if (r->out.count == NULL) {
7953 return NT_STATUS_NO_MEMORY;
7956 r->out.info = talloc_zero(mem_ctx, union spoolss_FormInfo *);
7957 if (r->out.info == NULL) {
7958 return NT_STATUS_NO_MEMORY;
7961 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7962 if (r->out.needed == NULL) {
7963 return NT_STATUS_NO_MEMORY;
7966 r->out.result = _spoolss_EnumForms(cli->pipes_struct, r);
7967 return NT_STATUS_OK;
7970 case NDR_SPOOLSS_ENUMPORTS: {
7971 struct spoolss_EnumPorts *r = (struct spoolss_EnumPorts *)_r;
7972 ZERO_STRUCT(r->out);
7973 r->out.count = talloc_zero(mem_ctx, uint32_t);
7974 if (r->out.count == NULL) {
7975 return NT_STATUS_NO_MEMORY;
7978 r->out.info = talloc_zero(mem_ctx, union spoolss_PortInfo *);
7979 if (r->out.info == NULL) {
7980 return NT_STATUS_NO_MEMORY;
7983 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7984 if (r->out.needed == NULL) {
7985 return NT_STATUS_NO_MEMORY;
7988 r->out.result = _spoolss_EnumPorts(cli->pipes_struct, r);
7989 return NT_STATUS_OK;
7992 case NDR_SPOOLSS_ENUMMONITORS: {
7993 struct spoolss_EnumMonitors *r = (struct spoolss_EnumMonitors *)_r;
7994 ZERO_STRUCT(r->out);
7995 r->out.count = talloc_zero(mem_ctx, uint32_t);
7996 if (r->out.count == NULL) {
7997 return NT_STATUS_NO_MEMORY;
8000 r->out.info = talloc_zero(mem_ctx, union spoolss_MonitorInfo *);
8001 if (r->out.info == NULL) {
8002 return NT_STATUS_NO_MEMORY;
8005 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8006 if (r->out.needed == NULL) {
8007 return NT_STATUS_NO_MEMORY;
8010 r->out.result = _spoolss_EnumMonitors(cli->pipes_struct, r);
8011 return NT_STATUS_OK;
8014 case NDR_SPOOLSS_ADDPORT: {
8015 struct spoolss_AddPort *r = (struct spoolss_AddPort *)_r;
8016 r->out.result = _spoolss_AddPort(cli->pipes_struct, r);
8017 return NT_STATUS_OK;
8020 case NDR_SPOOLSS_CONFIGUREPORT: {
8021 struct spoolss_ConfigurePort *r = (struct spoolss_ConfigurePort *)_r;
8022 r->out.result = _spoolss_ConfigurePort(cli->pipes_struct, r);
8023 return NT_STATUS_OK;
8026 case NDR_SPOOLSS_DELETEPORT: {
8027 struct spoolss_DeletePort *r = (struct spoolss_DeletePort *)_r;
8028 r->out.result = _spoolss_DeletePort(cli->pipes_struct, r);
8029 return NT_STATUS_OK;
8032 case NDR_SPOOLSS_CREATEPRINTERIC: {
8033 struct spoolss_CreatePrinterIC *r = (struct spoolss_CreatePrinterIC *)_r;
8034 r->out.result = _spoolss_CreatePrinterIC(cli->pipes_struct, r);
8035 return NT_STATUS_OK;
8038 case NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC: {
8039 struct spoolss_PlayGDIScriptOnPrinterIC *r = (struct spoolss_PlayGDIScriptOnPrinterIC *)_r;
8040 r->out.result = _spoolss_PlayGDIScriptOnPrinterIC(cli->pipes_struct, r);
8041 return NT_STATUS_OK;
8044 case NDR_SPOOLSS_DELETEPRINTERIC: {
8045 struct spoolss_DeletePrinterIC *r = (struct spoolss_DeletePrinterIC *)_r;
8046 r->out.result = _spoolss_DeletePrinterIC(cli->pipes_struct, r);
8047 return NT_STATUS_OK;
8050 case NDR_SPOOLSS_ADDPRINTERCONNECTION: {
8051 struct spoolss_AddPrinterConnection *r = (struct spoolss_AddPrinterConnection *)_r;
8052 r->out.result = _spoolss_AddPrinterConnection(cli->pipes_struct, r);
8053 return NT_STATUS_OK;
8056 case NDR_SPOOLSS_DELETEPRINTERCONNECTION: {
8057 struct spoolss_DeletePrinterConnection *r = (struct spoolss_DeletePrinterConnection *)_r;
8058 r->out.result = _spoolss_DeletePrinterConnection(cli->pipes_struct, r);
8059 return NT_STATUS_OK;
8062 case NDR_SPOOLSS_PRINTERMESSAGEBOX: {
8063 struct spoolss_PrinterMessageBox *r = (struct spoolss_PrinterMessageBox *)_r;
8064 r->out.result = _spoolss_PrinterMessageBox(cli->pipes_struct, r);
8065 return NT_STATUS_OK;
8068 case NDR_SPOOLSS_ADDMONITOR: {
8069 struct spoolss_AddMonitor *r = (struct spoolss_AddMonitor *)_r;
8070 r->out.result = _spoolss_AddMonitor(cli->pipes_struct, r);
8071 return NT_STATUS_OK;
8074 case NDR_SPOOLSS_DELETEMONITOR: {
8075 struct spoolss_DeleteMonitor *r = (struct spoolss_DeleteMonitor *)_r;
8076 r->out.result = _spoolss_DeleteMonitor(cli->pipes_struct, r);
8077 return NT_STATUS_OK;
8080 case NDR_SPOOLSS_DELETEPRINTPROCESSOR: {
8081 struct spoolss_DeletePrintProcessor *r = (struct spoolss_DeletePrintProcessor *)_r;
8082 r->out.result = _spoolss_DeletePrintProcessor(cli->pipes_struct, r);
8083 return NT_STATUS_OK;
8086 case NDR_SPOOLSS_ADDPRINTPROVIDOR: {
8087 struct spoolss_AddPrintProvidor *r = (struct spoolss_AddPrintProvidor *)_r;
8088 r->out.result = _spoolss_AddPrintProvidor(cli->pipes_struct, r);
8089 return NT_STATUS_OK;
8092 case NDR_SPOOLSS_DELETEPRINTPROVIDOR: {
8093 struct spoolss_DeletePrintProvidor *r = (struct spoolss_DeletePrintProvidor *)_r;
8094 r->out.result = _spoolss_DeletePrintProvidor(cli->pipes_struct, r);
8095 return NT_STATUS_OK;
8098 case NDR_SPOOLSS_ENUMPRINTPROCDATATYPES: {
8099 struct spoolss_EnumPrintProcDataTypes *r = (struct spoolss_EnumPrintProcDataTypes *)_r;
8100 ZERO_STRUCT(r->out);
8101 r->out.count = talloc_zero(mem_ctx, uint32_t);
8102 if (r->out.count == NULL) {
8103 return NT_STATUS_NO_MEMORY;
8106 r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcDataTypesInfo *);
8107 if (r->out.info == NULL) {
8108 return NT_STATUS_NO_MEMORY;
8111 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8112 if (r->out.needed == NULL) {
8113 return NT_STATUS_NO_MEMORY;
8116 r->out.result = _spoolss_EnumPrintProcDataTypes(cli->pipes_struct, r);
8117 return NT_STATUS_OK;
8120 case NDR_SPOOLSS_RESETPRINTER: {
8121 struct spoolss_ResetPrinter *r = (struct spoolss_ResetPrinter *)_r;
8122 r->out.result = _spoolss_ResetPrinter(cli->pipes_struct, r);
8123 return NT_STATUS_OK;
8126 case NDR_SPOOLSS_GETPRINTERDRIVER2: {
8127 struct spoolss_GetPrinterDriver2 *r = (struct spoolss_GetPrinterDriver2 *)_r;
8128 ZERO_STRUCT(r->out);
8129 r->out.info = talloc_zero(mem_ctx, union spoolss_DriverInfo);
8130 if (r->out.info == NULL) {
8131 return NT_STATUS_NO_MEMORY;
8134 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8135 if (r->out.needed == NULL) {
8136 return NT_STATUS_NO_MEMORY;
8139 r->out.server_major_version = talloc_zero(mem_ctx, uint32_t);
8140 if (r->out.server_major_version == NULL) {
8141 return NT_STATUS_NO_MEMORY;
8144 r->out.server_minor_version = talloc_zero(mem_ctx, uint32_t);
8145 if (r->out.server_minor_version == NULL) {
8146 return NT_STATUS_NO_MEMORY;
8149 r->out.result = _spoolss_GetPrinterDriver2(cli->pipes_struct, r);
8150 return NT_STATUS_OK;
8153 case NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION: {
8154 struct spoolss_FindFirstPrinterChangeNotification *r = (struct spoolss_FindFirstPrinterChangeNotification *)_r;
8155 r->out.result = _spoolss_FindFirstPrinterChangeNotification(cli->pipes_struct, r);
8156 return NT_STATUS_OK;
8159 case NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION: {
8160 struct spoolss_FindNextPrinterChangeNotification *r = (struct spoolss_FindNextPrinterChangeNotification *)_r;
8161 r->out.result = _spoolss_FindNextPrinterChangeNotification(cli->pipes_struct, r);
8162 return NT_STATUS_OK;
8165 case NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY: {
8166 struct spoolss_FindClosePrinterNotify *r = (struct spoolss_FindClosePrinterNotify *)_r;
8167 r->out.result = _spoolss_FindClosePrinterNotify(cli->pipes_struct, r);
8168 return NT_STATUS_OK;
8171 case NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD: {
8172 struct spoolss_RouterFindFirstPrinterChangeNotificationOld *r = (struct spoolss_RouterFindFirstPrinterChangeNotificationOld *)_r;
8173 r->out.result = _spoolss_RouterFindFirstPrinterChangeNotificationOld(cli->pipes_struct, r);
8174 return NT_STATUS_OK;
8177 case NDR_SPOOLSS_REPLYOPENPRINTER: {
8178 struct spoolss_ReplyOpenPrinter *r = (struct spoolss_ReplyOpenPrinter *)_r;
8179 ZERO_STRUCT(r->out);
8180 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
8181 if (r->out.handle == NULL) {
8182 return NT_STATUS_NO_MEMORY;
8185 r->out.result = _spoolss_ReplyOpenPrinter(cli->pipes_struct, r);
8186 return NT_STATUS_OK;
8189 case NDR_SPOOLSS_ROUTERREPLYPRINTER: {
8190 struct spoolss_RouterReplyPrinter *r = (struct spoolss_RouterReplyPrinter *)_r;
8191 r->out.result = _spoolss_RouterReplyPrinter(cli->pipes_struct, r);
8192 return NT_STATUS_OK;
8195 case NDR_SPOOLSS_REPLYCLOSEPRINTER: {
8196 struct spoolss_ReplyClosePrinter *r = (struct spoolss_ReplyClosePrinter *)_r;
8197 ZERO_STRUCT(r->out);
8198 r->out.handle = r->in.handle;
8199 r->out.result = _spoolss_ReplyClosePrinter(cli->pipes_struct, r);
8200 return NT_STATUS_OK;
8203 case NDR_SPOOLSS_ADDPORTEX: {
8204 struct spoolss_AddPortEx *r = (struct spoolss_AddPortEx *)_r;
8205 r->out.result = _spoolss_AddPortEx(cli->pipes_struct, r);
8206 return NT_STATUS_OK;
8209 case NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION: {
8210 struct spoolss_RouterFindFirstPrinterChangeNotification *r = (struct spoolss_RouterFindFirstPrinterChangeNotification *)_r;
8211 r->out.result = _spoolss_RouterFindFirstPrinterChangeNotification(cli->pipes_struct, r);
8212 return NT_STATUS_OK;
8215 case NDR_SPOOLSS_SPOOLERINIT: {
8216 struct spoolss_SpoolerInit *r = (struct spoolss_SpoolerInit *)_r;
8217 r->out.result = _spoolss_SpoolerInit(cli->pipes_struct, r);
8218 return NT_STATUS_OK;
8221 case NDR_SPOOLSS_RESETPRINTEREX: {
8222 struct spoolss_ResetPrinterEx *r = (struct spoolss_ResetPrinterEx *)_r;
8223 r->out.result = _spoolss_ResetPrinterEx(cli->pipes_struct, r);
8224 return NT_STATUS_OK;
8227 case NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX: {
8228 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r = (struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *)_r;
8229 r->out.result = _spoolss_RemoteFindFirstPrinterChangeNotifyEx(cli->pipes_struct, r);
8230 return NT_STATUS_OK;
8233 case NDR_SPOOLSS_ROUTERREPLYPRINTEREX: {
8234 struct spoolss_RouterReplyPrinterEx *r = (struct spoolss_RouterReplyPrinterEx *)_r;
8235 ZERO_STRUCT(r->out);
8236 r->out.reply_result = talloc_zero(mem_ctx, uint32_t);
8237 if (r->out.reply_result == NULL) {
8238 return NT_STATUS_NO_MEMORY;
8241 r->out.result = _spoolss_RouterReplyPrinterEx(cli->pipes_struct, r);
8242 return NT_STATUS_OK;
8245 case NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY: {
8246 struct spoolss_RouterRefreshPrinterChangeNotify *r = (struct spoolss_RouterRefreshPrinterChangeNotify *)_r;
8247 ZERO_STRUCT(r->out);
8248 r->out.info = talloc_zero(mem_ctx, struct spoolss_NotifyInfo *);
8249 if (r->out.info == NULL) {
8250 return NT_STATUS_NO_MEMORY;
8253 r->out.result = _spoolss_RouterRefreshPrinterChangeNotify(cli->pipes_struct, r);
8254 return NT_STATUS_OK;
8257 case NDR_SPOOLSS_44: {
8258 struct spoolss_44 *r = (struct spoolss_44 *)_r;
8259 r->out.result = _spoolss_44(cli->pipes_struct, r);
8260 return NT_STATUS_OK;
8263 case NDR_SPOOLSS_OPENPRINTEREX: {
8264 struct spoolss_OpenPrinterEx *r = (struct spoolss_OpenPrinterEx *)_r;
8265 ZERO_STRUCT(r->out);
8266 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
8267 if (r->out.handle == NULL) {
8268 return NT_STATUS_NO_MEMORY;
8271 r->out.result = _spoolss_OpenPrinterEx(cli->pipes_struct, r);
8272 return NT_STATUS_OK;
8275 case NDR_SPOOLSS_ADDPRINTEREX: {
8276 struct spoolss_AddPrinterEx *r = (struct spoolss_AddPrinterEx *)_r;
8277 ZERO_STRUCT(r->out);
8278 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
8279 if (r->out.handle == NULL) {
8280 return NT_STATUS_NO_MEMORY;
8283 r->out.result = _spoolss_AddPrinterEx(cli->pipes_struct, r);
8284 return NT_STATUS_OK;
8287 case NDR_SPOOLSS_47: {
8288 struct spoolss_47 *r = (struct spoolss_47 *)_r;
8289 r->out.result = _spoolss_47(cli->pipes_struct, r);
8290 return NT_STATUS_OK;
8293 case NDR_SPOOLSS_ENUMPRINTERDATA: {
8294 struct spoolss_EnumPrinterData *r = (struct spoolss_EnumPrinterData *)_r;
8295 ZERO_STRUCT(r->out);
8296 r->out.value_name = talloc_zero_array(mem_ctx, const char, r->in.value_offered / 2);
8297 if (r->out.value_name == NULL) {
8298 return NT_STATUS_NO_MEMORY;
8301 r->out.value_needed = talloc_zero(mem_ctx, uint32_t);
8302 if (r->out.value_needed == NULL) {
8303 return NT_STATUS_NO_MEMORY;
8306 r->out.type = talloc_zero(mem_ctx, enum winreg_Type);
8307 if (r->out.type == NULL) {
8308 return NT_STATUS_NO_MEMORY;
8311 r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.data_offered);
8312 if (r->out.data == NULL) {
8313 return NT_STATUS_NO_MEMORY;
8316 r->out.data_needed = talloc_zero(mem_ctx, uint32_t);
8317 if (r->out.data_needed == NULL) {
8318 return NT_STATUS_NO_MEMORY;
8321 r->out.result = _spoolss_EnumPrinterData(cli->pipes_struct, r);
8322 return NT_STATUS_OK;
8325 case NDR_SPOOLSS_DELETEPRINTERDATA: {
8326 struct spoolss_DeletePrinterData *r = (struct spoolss_DeletePrinterData *)_r;
8327 r->out.result = _spoolss_DeletePrinterData(cli->pipes_struct, r);
8328 return NT_STATUS_OK;
8331 case NDR_SPOOLSS_4A: {
8332 struct spoolss_4a *r = (struct spoolss_4a *)_r;
8333 r->out.result = _spoolss_4a(cli->pipes_struct, r);
8334 return NT_STATUS_OK;
8337 case NDR_SPOOLSS_4B: {
8338 struct spoolss_4b *r = (struct spoolss_4b *)_r;
8339 r->out.result = _spoolss_4b(cli->pipes_struct, r);
8340 return NT_STATUS_OK;
8343 case NDR_SPOOLSS_4C: {
8344 struct spoolss_4c *r = (struct spoolss_4c *)_r;
8345 r->out.result = _spoolss_4c(cli->pipes_struct, r);
8346 return NT_STATUS_OK;
8349 case NDR_SPOOLSS_SETPRINTERDATAEX: {
8350 struct spoolss_SetPrinterDataEx *r = (struct spoolss_SetPrinterDataEx *)_r;
8351 r->out.result = _spoolss_SetPrinterDataEx(cli->pipes_struct, r);
8352 return NT_STATUS_OK;
8355 case NDR_SPOOLSS_GETPRINTERDATAEX: {
8356 struct spoolss_GetPrinterDataEx *r = (struct spoolss_GetPrinterDataEx *)_r;
8357 ZERO_STRUCT(r->out);
8358 r->out.type = talloc_zero(mem_ctx, enum winreg_Type);
8359 if (r->out.type == NULL) {
8360 return NT_STATUS_NO_MEMORY;
8363 r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
8364 if (r->out.buffer == NULL) {
8365 return NT_STATUS_NO_MEMORY;
8368 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8369 if (r->out.needed == NULL) {
8370 return NT_STATUS_NO_MEMORY;
8373 r->out.result = _spoolss_GetPrinterDataEx(cli->pipes_struct, r);
8374 return NT_STATUS_OK;
8377 case NDR_SPOOLSS_ENUMPRINTERDATAEX: {
8378 struct spoolss_EnumPrinterDataEx *r = (struct spoolss_EnumPrinterDataEx *)_r;
8379 ZERO_STRUCT(r->out);
8380 r->out.count = talloc_zero(mem_ctx, uint32_t);
8381 if (r->out.count == NULL) {
8382 return NT_STATUS_NO_MEMORY;
8385 r->out.info = talloc_zero(mem_ctx, struct spoolss_PrinterEnumValues *);
8386 if (r->out.info == NULL) {
8387 return NT_STATUS_NO_MEMORY;
8390 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8391 if (r->out.needed == NULL) {
8392 return NT_STATUS_NO_MEMORY;
8395 r->out.result = _spoolss_EnumPrinterDataEx(cli->pipes_struct, r);
8396 return NT_STATUS_OK;
8399 case NDR_SPOOLSS_ENUMPRINTERKEY: {
8400 struct spoolss_EnumPrinterKey *r = (struct spoolss_EnumPrinterKey *)_r;
8401 ZERO_STRUCT(r->out);
8402 r->out.key_buffer = talloc_zero(mem_ctx, const char **);
8403 if (r->out.key_buffer == NULL) {
8404 return NT_STATUS_NO_MEMORY;
8407 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8408 if (r->out.needed == NULL) {
8409 return NT_STATUS_NO_MEMORY;
8412 r->out.result = _spoolss_EnumPrinterKey(cli->pipes_struct, r);
8413 return NT_STATUS_OK;
8416 case NDR_SPOOLSS_DELETEPRINTERDATAEX: {
8417 struct spoolss_DeletePrinterDataEx *r = (struct spoolss_DeletePrinterDataEx *)_r;
8418 r->out.result = _spoolss_DeletePrinterDataEx(cli->pipes_struct, r);
8419 return NT_STATUS_OK;
8422 case NDR_SPOOLSS_DELETEPRINTERKEY: {
8423 struct spoolss_DeletePrinterKey *r = (struct spoolss_DeletePrinterKey *)_r;
8424 r->out.result = _spoolss_DeletePrinterKey(cli->pipes_struct, r);
8425 return NT_STATUS_OK;
8428 case NDR_SPOOLSS_53: {
8429 struct spoolss_53 *r = (struct spoolss_53 *)_r;
8430 r->out.result = _spoolss_53(cli->pipes_struct, r);
8431 return NT_STATUS_OK;
8434 case NDR_SPOOLSS_DELETEPRINTERDRIVEREX: {
8435 struct spoolss_DeletePrinterDriverEx *r = (struct spoolss_DeletePrinterDriverEx *)_r;
8436 r->out.result = _spoolss_DeletePrinterDriverEx(cli->pipes_struct, r);
8437 return NT_STATUS_OK;
8440 case NDR_SPOOLSS_55: {
8441 struct spoolss_55 *r = (struct spoolss_55 *)_r;
8442 r->out.result = _spoolss_55(cli->pipes_struct, r);
8443 return NT_STATUS_OK;
8446 case NDR_SPOOLSS_56: {
8447 struct spoolss_56 *r = (struct spoolss_56 *)_r;
8448 r->out.result = _spoolss_56(cli->pipes_struct, r);
8449 return NT_STATUS_OK;
8452 case NDR_SPOOLSS_57: {
8453 struct spoolss_57 *r = (struct spoolss_57 *)_r;
8454 r->out.result = _spoolss_57(cli->pipes_struct, r);
8455 return NT_STATUS_OK;
8458 case NDR_SPOOLSS_XCVDATA: {
8459 struct spoolss_XcvData *r = (struct spoolss_XcvData *)_r;
8460 ZERO_STRUCT(r->out);
8461 r->out.status_code = r->in.status_code;
8462 r->out.out_data = talloc_zero_array(mem_ctx, uint8_t, r->in.out_data_size);
8463 if (r->out.out_data == NULL) {
8464 return NT_STATUS_NO_MEMORY;
8467 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8468 if (r->out.needed == NULL) {
8469 return NT_STATUS_NO_MEMORY;
8472 r->out.result = _spoolss_XcvData(cli->pipes_struct, r);
8473 return NT_STATUS_OK;
8476 case NDR_SPOOLSS_ADDPRINTERDRIVEREX: {
8477 struct spoolss_AddPrinterDriverEx *r = (struct spoolss_AddPrinterDriverEx *)_r;
8478 r->out.result = _spoolss_AddPrinterDriverEx(cli->pipes_struct, r);
8479 return NT_STATUS_OK;
8482 case NDR_SPOOLSS_5A: {
8483 struct spoolss_5a *r = (struct spoolss_5a *)_r;
8484 r->out.result = _spoolss_5a(cli->pipes_struct, r);
8485 return NT_STATUS_OK;
8488 case NDR_SPOOLSS_5B: {
8489 struct spoolss_5b *r = (struct spoolss_5b *)_r;
8490 r->out.result = _spoolss_5b(cli->pipes_struct, r);
8491 return NT_STATUS_OK;
8494 case NDR_SPOOLSS_5C: {
8495 struct spoolss_5c *r = (struct spoolss_5c *)_r;
8496 r->out.result = _spoolss_5c(cli->pipes_struct, r);
8497 return NT_STATUS_OK;
8500 case NDR_SPOOLSS_5D: {
8501 struct spoolss_5d *r = (struct spoolss_5d *)_r;
8502 r->out.result = _spoolss_5d(cli->pipes_struct, r);
8503 return NT_STATUS_OK;
8506 case NDR_SPOOLSS_5E: {
8507 struct spoolss_5e *r = (struct spoolss_5e *)_r;
8508 r->out.result = _spoolss_5e(cli->pipes_struct, r);
8509 return NT_STATUS_OK;
8512 case NDR_SPOOLSS_5F: {
8513 struct spoolss_5f *r = (struct spoolss_5f *)_r;
8514 r->out.result = _spoolss_5f(cli->pipes_struct, r);
8515 return NT_STATUS_OK;
8518 default:
8519 return NT_STATUS_NOT_IMPLEMENTED;
8523 NTSTATUS rpc_spoolss_init(void)
8525 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "spoolss", "spoolss", &ndr_table_spoolss, api_spoolss_cmds, sizeof(api_spoolss_cmds) / sizeof(struct api_struct));