s4:build: use SAMBA_PKG_CONFIG_MIN_VERSION instead of PKG_CONFIG_MIN_VERSION
[Samba/gbeck.git] / librpc / gen_ndr / srv_spoolss.c
blob9cb930f97976b3e6c5c5035baf453c5908c2ce2c
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 spoolss_PrinterDataType);
2117 if (r->out.type == NULL) {
2118 talloc_free(r);
2119 return false;
2122 r->out.needed = talloc_zero(r, uint32_t);
2123 if (r->out.needed == NULL) {
2124 talloc_free(r);
2125 return false;
2128 r->out.result = _spoolss_GetPrinterData(p, r);
2130 if (p->rng_fault_state) {
2131 talloc_free(r);
2132 /* Return true here, srv_pipe_hnd.c will take care */
2133 return true;
2136 if (DEBUGLEVEL >= 10) {
2137 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterData, r);
2140 push = ndr_push_init_ctx(r, NULL);
2141 if (push == NULL) {
2142 talloc_free(r);
2143 return false;
2146 ndr_err = call->ndr_push(push, NDR_OUT, r);
2147 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2148 talloc_free(r);
2149 return false;
2152 blob = ndr_push_blob(push);
2153 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2154 talloc_free(r);
2155 return false;
2158 talloc_free(r);
2160 return true;
2163 static bool api_spoolss_SetPrinterData(pipes_struct *p)
2165 const struct ndr_interface_call *call;
2166 struct ndr_pull *pull;
2167 struct ndr_push *push;
2168 enum ndr_err_code ndr_err;
2169 DATA_BLOB blob;
2170 struct spoolss_SetPrinterData *r;
2172 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SETPRINTERDATA];
2174 r = talloc(talloc_tos(), struct spoolss_SetPrinterData);
2175 if (r == NULL) {
2176 return false;
2179 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2180 talloc_free(r);
2181 return false;
2184 pull = ndr_pull_init_blob(&blob, r, NULL);
2185 if (pull == NULL) {
2186 talloc_free(r);
2187 return false;
2190 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2191 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2192 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2193 talloc_free(r);
2194 return false;
2197 if (DEBUGLEVEL >= 10) {
2198 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, r);
2201 r->out.result = _spoolss_SetPrinterData(p, r);
2203 if (p->rng_fault_state) {
2204 talloc_free(r);
2205 /* Return true here, srv_pipe_hnd.c will take care */
2206 return true;
2209 if (DEBUGLEVEL >= 10) {
2210 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterData, r);
2213 push = ndr_push_init_ctx(r, NULL);
2214 if (push == NULL) {
2215 talloc_free(r);
2216 return false;
2219 ndr_err = call->ndr_push(push, NDR_OUT, r);
2220 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2221 talloc_free(r);
2222 return false;
2225 blob = ndr_push_blob(push);
2226 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2227 talloc_free(r);
2228 return false;
2231 talloc_free(r);
2233 return true;
2236 static bool api_spoolss_WaitForPrinterChange(pipes_struct *p)
2238 const struct ndr_interface_call *call;
2239 struct ndr_pull *pull;
2240 struct ndr_push *push;
2241 enum ndr_err_code ndr_err;
2242 DATA_BLOB blob;
2243 struct spoolss_WaitForPrinterChange *r;
2245 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_WAITFORPRINTERCHANGE];
2247 r = talloc(talloc_tos(), struct spoolss_WaitForPrinterChange);
2248 if (r == NULL) {
2249 return false;
2252 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2253 talloc_free(r);
2254 return false;
2257 pull = ndr_pull_init_blob(&blob, r, NULL);
2258 if (pull == NULL) {
2259 talloc_free(r);
2260 return false;
2263 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2264 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2265 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2266 talloc_free(r);
2267 return false;
2270 if (DEBUGLEVEL >= 10) {
2271 NDR_PRINT_IN_DEBUG(spoolss_WaitForPrinterChange, r);
2274 r->out.result = _spoolss_WaitForPrinterChange(p, r);
2276 if (p->rng_fault_state) {
2277 talloc_free(r);
2278 /* Return true here, srv_pipe_hnd.c will take care */
2279 return true;
2282 if (DEBUGLEVEL >= 10) {
2283 NDR_PRINT_OUT_DEBUG(spoolss_WaitForPrinterChange, r);
2286 push = ndr_push_init_ctx(r, NULL);
2287 if (push == NULL) {
2288 talloc_free(r);
2289 return false;
2292 ndr_err = call->ndr_push(push, NDR_OUT, r);
2293 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2294 talloc_free(r);
2295 return false;
2298 blob = ndr_push_blob(push);
2299 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2300 talloc_free(r);
2301 return false;
2304 talloc_free(r);
2306 return true;
2309 static bool api_spoolss_ClosePrinter(pipes_struct *p)
2311 const struct ndr_interface_call *call;
2312 struct ndr_pull *pull;
2313 struct ndr_push *push;
2314 enum ndr_err_code ndr_err;
2315 DATA_BLOB blob;
2316 struct spoolss_ClosePrinter *r;
2318 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_CLOSEPRINTER];
2320 r = talloc(talloc_tos(), struct spoolss_ClosePrinter);
2321 if (r == NULL) {
2322 return false;
2325 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2326 talloc_free(r);
2327 return false;
2330 pull = ndr_pull_init_blob(&blob, r, NULL);
2331 if (pull == NULL) {
2332 talloc_free(r);
2333 return false;
2336 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2337 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2338 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2339 talloc_free(r);
2340 return false;
2343 if (DEBUGLEVEL >= 10) {
2344 NDR_PRINT_IN_DEBUG(spoolss_ClosePrinter, r);
2347 ZERO_STRUCT(r->out);
2348 r->out.handle = r->in.handle;
2349 r->out.result = _spoolss_ClosePrinter(p, r);
2351 if (p->rng_fault_state) {
2352 talloc_free(r);
2353 /* Return true here, srv_pipe_hnd.c will take care */
2354 return true;
2357 if (DEBUGLEVEL >= 10) {
2358 NDR_PRINT_OUT_DEBUG(spoolss_ClosePrinter, r);
2361 push = ndr_push_init_ctx(r, NULL);
2362 if (push == NULL) {
2363 talloc_free(r);
2364 return false;
2367 ndr_err = call->ndr_push(push, NDR_OUT, r);
2368 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2369 talloc_free(r);
2370 return false;
2373 blob = ndr_push_blob(push);
2374 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2375 talloc_free(r);
2376 return false;
2379 talloc_free(r);
2381 return true;
2384 static bool api_spoolss_AddForm(pipes_struct *p)
2386 const struct ndr_interface_call *call;
2387 struct ndr_pull *pull;
2388 struct ndr_push *push;
2389 enum ndr_err_code ndr_err;
2390 DATA_BLOB blob;
2391 struct spoolss_AddForm *r;
2393 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDFORM];
2395 r = talloc(talloc_tos(), struct spoolss_AddForm);
2396 if (r == NULL) {
2397 return false;
2400 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2401 talloc_free(r);
2402 return false;
2405 pull = ndr_pull_init_blob(&blob, r, NULL);
2406 if (pull == NULL) {
2407 talloc_free(r);
2408 return false;
2411 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2412 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2413 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2414 talloc_free(r);
2415 return false;
2418 if (DEBUGLEVEL >= 10) {
2419 NDR_PRINT_IN_DEBUG(spoolss_AddForm, r);
2422 r->out.result = _spoolss_AddForm(p, r);
2424 if (p->rng_fault_state) {
2425 talloc_free(r);
2426 /* Return true here, srv_pipe_hnd.c will take care */
2427 return true;
2430 if (DEBUGLEVEL >= 10) {
2431 NDR_PRINT_OUT_DEBUG(spoolss_AddForm, r);
2434 push = ndr_push_init_ctx(r, NULL);
2435 if (push == NULL) {
2436 talloc_free(r);
2437 return false;
2440 ndr_err = call->ndr_push(push, NDR_OUT, r);
2441 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2442 talloc_free(r);
2443 return false;
2446 blob = ndr_push_blob(push);
2447 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2448 talloc_free(r);
2449 return false;
2452 talloc_free(r);
2454 return true;
2457 static bool api_spoolss_DeleteForm(pipes_struct *p)
2459 const struct ndr_interface_call *call;
2460 struct ndr_pull *pull;
2461 struct ndr_push *push;
2462 enum ndr_err_code ndr_err;
2463 DATA_BLOB blob;
2464 struct spoolss_DeleteForm *r;
2466 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEFORM];
2468 r = talloc(talloc_tos(), struct spoolss_DeleteForm);
2469 if (r == NULL) {
2470 return false;
2473 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2474 talloc_free(r);
2475 return false;
2478 pull = ndr_pull_init_blob(&blob, r, NULL);
2479 if (pull == NULL) {
2480 talloc_free(r);
2481 return false;
2484 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2485 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2486 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2487 talloc_free(r);
2488 return false;
2491 if (DEBUGLEVEL >= 10) {
2492 NDR_PRINT_IN_DEBUG(spoolss_DeleteForm, r);
2495 r->out.result = _spoolss_DeleteForm(p, r);
2497 if (p->rng_fault_state) {
2498 talloc_free(r);
2499 /* Return true here, srv_pipe_hnd.c will take care */
2500 return true;
2503 if (DEBUGLEVEL >= 10) {
2504 NDR_PRINT_OUT_DEBUG(spoolss_DeleteForm, r);
2507 push = ndr_push_init_ctx(r, NULL);
2508 if (push == NULL) {
2509 talloc_free(r);
2510 return false;
2513 ndr_err = call->ndr_push(push, NDR_OUT, r);
2514 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2515 talloc_free(r);
2516 return false;
2519 blob = ndr_push_blob(push);
2520 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2521 talloc_free(r);
2522 return false;
2525 talloc_free(r);
2527 return true;
2530 static bool api_spoolss_GetForm(pipes_struct *p)
2532 const struct ndr_interface_call *call;
2533 struct ndr_pull *pull;
2534 struct ndr_push *push;
2535 enum ndr_err_code ndr_err;
2536 DATA_BLOB blob;
2537 struct spoolss_GetForm *r;
2539 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETFORM];
2541 r = talloc(talloc_tos(), struct spoolss_GetForm);
2542 if (r == NULL) {
2543 return false;
2546 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2547 talloc_free(r);
2548 return false;
2551 pull = ndr_pull_init_blob(&blob, r, NULL);
2552 if (pull == NULL) {
2553 talloc_free(r);
2554 return false;
2557 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2558 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2559 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2560 talloc_free(r);
2561 return false;
2564 if (DEBUGLEVEL >= 10) {
2565 NDR_PRINT_IN_DEBUG(spoolss_GetForm, r);
2568 ZERO_STRUCT(r->out);
2569 r->out.info = talloc_zero(r, union spoolss_FormInfo);
2570 if (r->out.info == NULL) {
2571 talloc_free(r);
2572 return false;
2575 r->out.needed = talloc_zero(r, uint32_t);
2576 if (r->out.needed == NULL) {
2577 talloc_free(r);
2578 return false;
2581 r->out.result = _spoolss_GetForm(p, r);
2583 if (p->rng_fault_state) {
2584 talloc_free(r);
2585 /* Return true here, srv_pipe_hnd.c will take care */
2586 return true;
2589 if (DEBUGLEVEL >= 10) {
2590 NDR_PRINT_OUT_DEBUG(spoolss_GetForm, r);
2593 push = ndr_push_init_ctx(r, NULL);
2594 if (push == NULL) {
2595 talloc_free(r);
2596 return false;
2599 ndr_err = call->ndr_push(push, NDR_OUT, r);
2600 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2601 talloc_free(r);
2602 return false;
2605 blob = ndr_push_blob(push);
2606 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2607 talloc_free(r);
2608 return false;
2611 talloc_free(r);
2613 return true;
2616 static bool api_spoolss_SetForm(pipes_struct *p)
2618 const struct ndr_interface_call *call;
2619 struct ndr_pull *pull;
2620 struct ndr_push *push;
2621 enum ndr_err_code ndr_err;
2622 DATA_BLOB blob;
2623 struct spoolss_SetForm *r;
2625 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SETFORM];
2627 r = talloc(talloc_tos(), struct spoolss_SetForm);
2628 if (r == NULL) {
2629 return false;
2632 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2633 talloc_free(r);
2634 return false;
2637 pull = ndr_pull_init_blob(&blob, r, NULL);
2638 if (pull == NULL) {
2639 talloc_free(r);
2640 return false;
2643 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2644 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2645 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2646 talloc_free(r);
2647 return false;
2650 if (DEBUGLEVEL >= 10) {
2651 NDR_PRINT_IN_DEBUG(spoolss_SetForm, r);
2654 r->out.result = _spoolss_SetForm(p, r);
2656 if (p->rng_fault_state) {
2657 talloc_free(r);
2658 /* Return true here, srv_pipe_hnd.c will take care */
2659 return true;
2662 if (DEBUGLEVEL >= 10) {
2663 NDR_PRINT_OUT_DEBUG(spoolss_SetForm, r);
2666 push = ndr_push_init_ctx(r, NULL);
2667 if (push == NULL) {
2668 talloc_free(r);
2669 return false;
2672 ndr_err = call->ndr_push(push, NDR_OUT, r);
2673 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2674 talloc_free(r);
2675 return false;
2678 blob = ndr_push_blob(push);
2679 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2680 talloc_free(r);
2681 return false;
2684 talloc_free(r);
2686 return true;
2689 static bool api_spoolss_EnumForms(pipes_struct *p)
2691 const struct ndr_interface_call *call;
2692 struct ndr_pull *pull;
2693 struct ndr_push *push;
2694 enum ndr_err_code ndr_err;
2695 DATA_BLOB blob;
2696 struct spoolss_EnumForms *r;
2698 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMFORMS];
2700 r = talloc(talloc_tos(), struct spoolss_EnumForms);
2701 if (r == NULL) {
2702 return false;
2705 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2706 talloc_free(r);
2707 return false;
2710 pull = ndr_pull_init_blob(&blob, r, NULL);
2711 if (pull == NULL) {
2712 talloc_free(r);
2713 return false;
2716 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2717 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2718 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2719 talloc_free(r);
2720 return false;
2723 if (DEBUGLEVEL >= 10) {
2724 NDR_PRINT_IN_DEBUG(spoolss_EnumForms, r);
2727 ZERO_STRUCT(r->out);
2728 r->out.count = talloc_zero(r, uint32_t);
2729 if (r->out.count == NULL) {
2730 talloc_free(r);
2731 return false;
2734 r->out.info = talloc_zero(r, union spoolss_FormInfo *);
2735 if (r->out.info == NULL) {
2736 talloc_free(r);
2737 return false;
2740 r->out.needed = talloc_zero(r, uint32_t);
2741 if (r->out.needed == NULL) {
2742 talloc_free(r);
2743 return false;
2746 r->out.result = _spoolss_EnumForms(p, r);
2748 if (p->rng_fault_state) {
2749 talloc_free(r);
2750 /* Return true here, srv_pipe_hnd.c will take care */
2751 return true;
2754 if (DEBUGLEVEL >= 10) {
2755 NDR_PRINT_OUT_DEBUG(spoolss_EnumForms, r);
2758 push = ndr_push_init_ctx(r, NULL);
2759 if (push == NULL) {
2760 talloc_free(r);
2761 return false;
2764 ndr_err = call->ndr_push(push, NDR_OUT, r);
2765 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2766 talloc_free(r);
2767 return false;
2770 blob = ndr_push_blob(push);
2771 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2772 talloc_free(r);
2773 return false;
2776 talloc_free(r);
2778 return true;
2781 static bool api_spoolss_EnumPorts(pipes_struct *p)
2783 const struct ndr_interface_call *call;
2784 struct ndr_pull *pull;
2785 struct ndr_push *push;
2786 enum ndr_err_code ndr_err;
2787 DATA_BLOB blob;
2788 struct spoolss_EnumPorts *r;
2790 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPORTS];
2792 r = talloc(talloc_tos(), struct spoolss_EnumPorts);
2793 if (r == NULL) {
2794 return false;
2797 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2798 talloc_free(r);
2799 return false;
2802 pull = ndr_pull_init_blob(&blob, r, NULL);
2803 if (pull == NULL) {
2804 talloc_free(r);
2805 return false;
2808 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2809 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2810 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2811 talloc_free(r);
2812 return false;
2815 if (DEBUGLEVEL >= 10) {
2816 NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, r);
2819 ZERO_STRUCT(r->out);
2820 r->out.count = talloc_zero(r, uint32_t);
2821 if (r->out.count == NULL) {
2822 talloc_free(r);
2823 return false;
2826 r->out.info = talloc_zero(r, union spoolss_PortInfo *);
2827 if (r->out.info == NULL) {
2828 talloc_free(r);
2829 return false;
2832 r->out.needed = talloc_zero(r, uint32_t);
2833 if (r->out.needed == NULL) {
2834 talloc_free(r);
2835 return false;
2838 r->out.result = _spoolss_EnumPorts(p, r);
2840 if (p->rng_fault_state) {
2841 talloc_free(r);
2842 /* Return true here, srv_pipe_hnd.c will take care */
2843 return true;
2846 if (DEBUGLEVEL >= 10) {
2847 NDR_PRINT_OUT_DEBUG(spoolss_EnumPorts, r);
2850 push = ndr_push_init_ctx(r, NULL);
2851 if (push == NULL) {
2852 talloc_free(r);
2853 return false;
2856 ndr_err = call->ndr_push(push, NDR_OUT, r);
2857 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2858 talloc_free(r);
2859 return false;
2862 blob = ndr_push_blob(push);
2863 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2864 talloc_free(r);
2865 return false;
2868 talloc_free(r);
2870 return true;
2873 static bool api_spoolss_EnumMonitors(pipes_struct *p)
2875 const struct ndr_interface_call *call;
2876 struct ndr_pull *pull;
2877 struct ndr_push *push;
2878 enum ndr_err_code ndr_err;
2879 DATA_BLOB blob;
2880 struct spoolss_EnumMonitors *r;
2882 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMMONITORS];
2884 r = talloc(talloc_tos(), struct spoolss_EnumMonitors);
2885 if (r == NULL) {
2886 return false;
2889 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2890 talloc_free(r);
2891 return false;
2894 pull = ndr_pull_init_blob(&blob, r, NULL);
2895 if (pull == NULL) {
2896 talloc_free(r);
2897 return false;
2900 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2901 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2902 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2903 talloc_free(r);
2904 return false;
2907 if (DEBUGLEVEL >= 10) {
2908 NDR_PRINT_IN_DEBUG(spoolss_EnumMonitors, r);
2911 ZERO_STRUCT(r->out);
2912 r->out.count = talloc_zero(r, uint32_t);
2913 if (r->out.count == NULL) {
2914 talloc_free(r);
2915 return false;
2918 r->out.info = talloc_zero(r, union spoolss_MonitorInfo *);
2919 if (r->out.info == NULL) {
2920 talloc_free(r);
2921 return false;
2924 r->out.needed = talloc_zero(r, uint32_t);
2925 if (r->out.needed == NULL) {
2926 talloc_free(r);
2927 return false;
2930 r->out.result = _spoolss_EnumMonitors(p, r);
2932 if (p->rng_fault_state) {
2933 talloc_free(r);
2934 /* Return true here, srv_pipe_hnd.c will take care */
2935 return true;
2938 if (DEBUGLEVEL >= 10) {
2939 NDR_PRINT_OUT_DEBUG(spoolss_EnumMonitors, r);
2942 push = ndr_push_init_ctx(r, NULL);
2943 if (push == NULL) {
2944 talloc_free(r);
2945 return false;
2948 ndr_err = call->ndr_push(push, NDR_OUT, r);
2949 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2950 talloc_free(r);
2951 return false;
2954 blob = ndr_push_blob(push);
2955 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2956 talloc_free(r);
2957 return false;
2960 talloc_free(r);
2962 return true;
2965 static bool api_spoolss_AddPort(pipes_struct *p)
2967 const struct ndr_interface_call *call;
2968 struct ndr_pull *pull;
2969 struct ndr_push *push;
2970 enum ndr_err_code ndr_err;
2971 DATA_BLOB blob;
2972 struct spoolss_AddPort *r;
2974 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPORT];
2976 r = talloc(talloc_tos(), struct spoolss_AddPort);
2977 if (r == NULL) {
2978 return false;
2981 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2982 talloc_free(r);
2983 return false;
2986 pull = ndr_pull_init_blob(&blob, r, NULL);
2987 if (pull == NULL) {
2988 talloc_free(r);
2989 return false;
2992 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2993 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2994 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2995 talloc_free(r);
2996 return false;
2999 if (DEBUGLEVEL >= 10) {
3000 NDR_PRINT_IN_DEBUG(spoolss_AddPort, r);
3003 r->out.result = _spoolss_AddPort(p, r);
3005 if (p->rng_fault_state) {
3006 talloc_free(r);
3007 /* Return true here, srv_pipe_hnd.c will take care */
3008 return true;
3011 if (DEBUGLEVEL >= 10) {
3012 NDR_PRINT_OUT_DEBUG(spoolss_AddPort, r);
3015 push = ndr_push_init_ctx(r, NULL);
3016 if (push == NULL) {
3017 talloc_free(r);
3018 return false;
3021 ndr_err = call->ndr_push(push, NDR_OUT, r);
3022 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3023 talloc_free(r);
3024 return false;
3027 blob = ndr_push_blob(push);
3028 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3029 talloc_free(r);
3030 return false;
3033 talloc_free(r);
3035 return true;
3038 static bool api_spoolss_ConfigurePort(pipes_struct *p)
3040 const struct ndr_interface_call *call;
3041 struct ndr_pull *pull;
3042 struct ndr_push *push;
3043 enum ndr_err_code ndr_err;
3044 DATA_BLOB blob;
3045 struct spoolss_ConfigurePort *r;
3047 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_CONFIGUREPORT];
3049 r = talloc(talloc_tos(), struct spoolss_ConfigurePort);
3050 if (r == NULL) {
3051 return false;
3054 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3055 talloc_free(r);
3056 return false;
3059 pull = ndr_pull_init_blob(&blob, r, NULL);
3060 if (pull == NULL) {
3061 talloc_free(r);
3062 return false;
3065 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3066 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3067 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3068 talloc_free(r);
3069 return false;
3072 if (DEBUGLEVEL >= 10) {
3073 NDR_PRINT_IN_DEBUG(spoolss_ConfigurePort, r);
3076 r->out.result = _spoolss_ConfigurePort(p, r);
3078 if (p->rng_fault_state) {
3079 talloc_free(r);
3080 /* Return true here, srv_pipe_hnd.c will take care */
3081 return true;
3084 if (DEBUGLEVEL >= 10) {
3085 NDR_PRINT_OUT_DEBUG(spoolss_ConfigurePort, r);
3088 push = ndr_push_init_ctx(r, NULL);
3089 if (push == NULL) {
3090 talloc_free(r);
3091 return false;
3094 ndr_err = call->ndr_push(push, NDR_OUT, r);
3095 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3096 talloc_free(r);
3097 return false;
3100 blob = ndr_push_blob(push);
3101 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3102 talloc_free(r);
3103 return false;
3106 talloc_free(r);
3108 return true;
3111 static bool api_spoolss_DeletePort(pipes_struct *p)
3113 const struct ndr_interface_call *call;
3114 struct ndr_pull *pull;
3115 struct ndr_push *push;
3116 enum ndr_err_code ndr_err;
3117 DATA_BLOB blob;
3118 struct spoolss_DeletePort *r;
3120 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPORT];
3122 r = talloc(talloc_tos(), struct spoolss_DeletePort);
3123 if (r == NULL) {
3124 return false;
3127 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3128 talloc_free(r);
3129 return false;
3132 pull = ndr_pull_init_blob(&blob, r, NULL);
3133 if (pull == NULL) {
3134 talloc_free(r);
3135 return false;
3138 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3139 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3140 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3141 talloc_free(r);
3142 return false;
3145 if (DEBUGLEVEL >= 10) {
3146 NDR_PRINT_IN_DEBUG(spoolss_DeletePort, r);
3149 r->out.result = _spoolss_DeletePort(p, r);
3151 if (p->rng_fault_state) {
3152 talloc_free(r);
3153 /* Return true here, srv_pipe_hnd.c will take care */
3154 return true;
3157 if (DEBUGLEVEL >= 10) {
3158 NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, r);
3161 push = ndr_push_init_ctx(r, NULL);
3162 if (push == NULL) {
3163 talloc_free(r);
3164 return false;
3167 ndr_err = call->ndr_push(push, NDR_OUT, r);
3168 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3169 talloc_free(r);
3170 return false;
3173 blob = ndr_push_blob(push);
3174 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3175 talloc_free(r);
3176 return false;
3179 talloc_free(r);
3181 return true;
3184 static bool api_spoolss_CreatePrinterIC(pipes_struct *p)
3186 const struct ndr_interface_call *call;
3187 struct ndr_pull *pull;
3188 struct ndr_push *push;
3189 enum ndr_err_code ndr_err;
3190 DATA_BLOB blob;
3191 struct spoolss_CreatePrinterIC *r;
3193 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_CREATEPRINTERIC];
3195 r = talloc(talloc_tos(), struct spoolss_CreatePrinterIC);
3196 if (r == NULL) {
3197 return false;
3200 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3201 talloc_free(r);
3202 return false;
3205 pull = ndr_pull_init_blob(&blob, r, NULL);
3206 if (pull == NULL) {
3207 talloc_free(r);
3208 return false;
3211 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3212 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3213 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3214 talloc_free(r);
3215 return false;
3218 if (DEBUGLEVEL >= 10) {
3219 NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, r);
3222 r->out.result = _spoolss_CreatePrinterIC(p, r);
3224 if (p->rng_fault_state) {
3225 talloc_free(r);
3226 /* Return true here, srv_pipe_hnd.c will take care */
3227 return true;
3230 if (DEBUGLEVEL >= 10) {
3231 NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, r);
3234 push = ndr_push_init_ctx(r, NULL);
3235 if (push == NULL) {
3236 talloc_free(r);
3237 return false;
3240 ndr_err = call->ndr_push(push, NDR_OUT, r);
3241 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3242 talloc_free(r);
3243 return false;
3246 blob = ndr_push_blob(push);
3247 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3248 talloc_free(r);
3249 return false;
3252 talloc_free(r);
3254 return true;
3257 static bool api_spoolss_PlayGDIScriptOnPrinterIC(pipes_struct *p)
3259 const struct ndr_interface_call *call;
3260 struct ndr_pull *pull;
3261 struct ndr_push *push;
3262 enum ndr_err_code ndr_err;
3263 DATA_BLOB blob;
3264 struct spoolss_PlayGDIScriptOnPrinterIC *r;
3266 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC];
3268 r = talloc(talloc_tos(), struct spoolss_PlayGDIScriptOnPrinterIC);
3269 if (r == NULL) {
3270 return false;
3273 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3274 talloc_free(r);
3275 return false;
3278 pull = ndr_pull_init_blob(&blob, r, NULL);
3279 if (pull == NULL) {
3280 talloc_free(r);
3281 return false;
3284 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3285 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3286 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3287 talloc_free(r);
3288 return false;
3291 if (DEBUGLEVEL >= 10) {
3292 NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, r);
3295 r->out.result = _spoolss_PlayGDIScriptOnPrinterIC(p, r);
3297 if (p->rng_fault_state) {
3298 talloc_free(r);
3299 /* Return true here, srv_pipe_hnd.c will take care */
3300 return true;
3303 if (DEBUGLEVEL >= 10) {
3304 NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, r);
3307 push = ndr_push_init_ctx(r, NULL);
3308 if (push == NULL) {
3309 talloc_free(r);
3310 return false;
3313 ndr_err = call->ndr_push(push, NDR_OUT, r);
3314 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3315 talloc_free(r);
3316 return false;
3319 blob = ndr_push_blob(push);
3320 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3321 talloc_free(r);
3322 return false;
3325 talloc_free(r);
3327 return true;
3330 static bool api_spoolss_DeletePrinterIC(pipes_struct *p)
3332 const struct ndr_interface_call *call;
3333 struct ndr_pull *pull;
3334 struct ndr_push *push;
3335 enum ndr_err_code ndr_err;
3336 DATA_BLOB blob;
3337 struct spoolss_DeletePrinterIC *r;
3339 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERIC];
3341 r = talloc(talloc_tos(), struct spoolss_DeletePrinterIC);
3342 if (r == NULL) {
3343 return false;
3346 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3347 talloc_free(r);
3348 return false;
3351 pull = ndr_pull_init_blob(&blob, r, NULL);
3352 if (pull == NULL) {
3353 talloc_free(r);
3354 return false;
3357 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3358 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3359 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3360 talloc_free(r);
3361 return false;
3364 if (DEBUGLEVEL >= 10) {
3365 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, r);
3368 r->out.result = _spoolss_DeletePrinterIC(p, r);
3370 if (p->rng_fault_state) {
3371 talloc_free(r);
3372 /* Return true here, srv_pipe_hnd.c will take care */
3373 return true;
3376 if (DEBUGLEVEL >= 10) {
3377 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, r);
3380 push = ndr_push_init_ctx(r, NULL);
3381 if (push == NULL) {
3382 talloc_free(r);
3383 return false;
3386 ndr_err = call->ndr_push(push, NDR_OUT, r);
3387 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3388 talloc_free(r);
3389 return false;
3392 blob = ndr_push_blob(push);
3393 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3394 talloc_free(r);
3395 return false;
3398 talloc_free(r);
3400 return true;
3403 static bool api_spoolss_AddPrinterConnection(pipes_struct *p)
3405 const struct ndr_interface_call *call;
3406 struct ndr_pull *pull;
3407 struct ndr_push *push;
3408 enum ndr_err_code ndr_err;
3409 DATA_BLOB blob;
3410 struct spoolss_AddPrinterConnection *r;
3412 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTERCONNECTION];
3414 r = talloc(talloc_tos(), struct spoolss_AddPrinterConnection);
3415 if (r == NULL) {
3416 return false;
3419 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3420 talloc_free(r);
3421 return false;
3424 pull = ndr_pull_init_blob(&blob, r, NULL);
3425 if (pull == NULL) {
3426 talloc_free(r);
3427 return false;
3430 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3431 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3432 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3433 talloc_free(r);
3434 return false;
3437 if (DEBUGLEVEL >= 10) {
3438 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, r);
3441 r->out.result = _spoolss_AddPrinterConnection(p, r);
3443 if (p->rng_fault_state) {
3444 talloc_free(r);
3445 /* Return true here, srv_pipe_hnd.c will take care */
3446 return true;
3449 if (DEBUGLEVEL >= 10) {
3450 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, r);
3453 push = ndr_push_init_ctx(r, NULL);
3454 if (push == NULL) {
3455 talloc_free(r);
3456 return false;
3459 ndr_err = call->ndr_push(push, NDR_OUT, r);
3460 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3461 talloc_free(r);
3462 return false;
3465 blob = ndr_push_blob(push);
3466 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3467 talloc_free(r);
3468 return false;
3471 talloc_free(r);
3473 return true;
3476 static bool api_spoolss_DeletePrinterConnection(pipes_struct *p)
3478 const struct ndr_interface_call *call;
3479 struct ndr_pull *pull;
3480 struct ndr_push *push;
3481 enum ndr_err_code ndr_err;
3482 DATA_BLOB blob;
3483 struct spoolss_DeletePrinterConnection *r;
3485 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERCONNECTION];
3487 r = talloc(talloc_tos(), struct spoolss_DeletePrinterConnection);
3488 if (r == NULL) {
3489 return false;
3492 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3493 talloc_free(r);
3494 return false;
3497 pull = ndr_pull_init_blob(&blob, r, NULL);
3498 if (pull == NULL) {
3499 talloc_free(r);
3500 return false;
3503 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3504 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3505 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3506 talloc_free(r);
3507 return false;
3510 if (DEBUGLEVEL >= 10) {
3511 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, r);
3514 r->out.result = _spoolss_DeletePrinterConnection(p, r);
3516 if (p->rng_fault_state) {
3517 talloc_free(r);
3518 /* Return true here, srv_pipe_hnd.c will take care */
3519 return true;
3522 if (DEBUGLEVEL >= 10) {
3523 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, r);
3526 push = ndr_push_init_ctx(r, NULL);
3527 if (push == NULL) {
3528 talloc_free(r);
3529 return false;
3532 ndr_err = call->ndr_push(push, NDR_OUT, r);
3533 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3534 talloc_free(r);
3535 return false;
3538 blob = ndr_push_blob(push);
3539 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3540 talloc_free(r);
3541 return false;
3544 talloc_free(r);
3546 return true;
3549 static bool api_spoolss_PrinterMessageBox(pipes_struct *p)
3551 const struct ndr_interface_call *call;
3552 struct ndr_pull *pull;
3553 struct ndr_push *push;
3554 enum ndr_err_code ndr_err;
3555 DATA_BLOB blob;
3556 struct spoolss_PrinterMessageBox *r;
3558 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_PRINTERMESSAGEBOX];
3560 r = talloc(talloc_tos(), struct spoolss_PrinterMessageBox);
3561 if (r == NULL) {
3562 return false;
3565 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3566 talloc_free(r);
3567 return false;
3570 pull = ndr_pull_init_blob(&blob, r, NULL);
3571 if (pull == NULL) {
3572 talloc_free(r);
3573 return false;
3576 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3577 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3578 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3579 talloc_free(r);
3580 return false;
3583 if (DEBUGLEVEL >= 10) {
3584 NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, r);
3587 r->out.result = _spoolss_PrinterMessageBox(p, r);
3589 if (p->rng_fault_state) {
3590 talloc_free(r);
3591 /* Return true here, srv_pipe_hnd.c will take care */
3592 return true;
3595 if (DEBUGLEVEL >= 10) {
3596 NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, r);
3599 push = ndr_push_init_ctx(r, NULL);
3600 if (push == NULL) {
3601 talloc_free(r);
3602 return false;
3605 ndr_err = call->ndr_push(push, NDR_OUT, r);
3606 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3607 talloc_free(r);
3608 return false;
3611 blob = ndr_push_blob(push);
3612 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3613 talloc_free(r);
3614 return false;
3617 talloc_free(r);
3619 return true;
3622 static bool api_spoolss_AddMonitor(pipes_struct *p)
3624 const struct ndr_interface_call *call;
3625 struct ndr_pull *pull;
3626 struct ndr_push *push;
3627 enum ndr_err_code ndr_err;
3628 DATA_BLOB blob;
3629 struct spoolss_AddMonitor *r;
3631 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDMONITOR];
3633 r = talloc(talloc_tos(), struct spoolss_AddMonitor);
3634 if (r == NULL) {
3635 return false;
3638 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3639 talloc_free(r);
3640 return false;
3643 pull = ndr_pull_init_blob(&blob, r, NULL);
3644 if (pull == NULL) {
3645 talloc_free(r);
3646 return false;
3649 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3650 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3651 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3652 talloc_free(r);
3653 return false;
3656 if (DEBUGLEVEL >= 10) {
3657 NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, r);
3660 r->out.result = _spoolss_AddMonitor(p, r);
3662 if (p->rng_fault_state) {
3663 talloc_free(r);
3664 /* Return true here, srv_pipe_hnd.c will take care */
3665 return true;
3668 if (DEBUGLEVEL >= 10) {
3669 NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, r);
3672 push = ndr_push_init_ctx(r, NULL);
3673 if (push == NULL) {
3674 talloc_free(r);
3675 return false;
3678 ndr_err = call->ndr_push(push, NDR_OUT, r);
3679 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3680 talloc_free(r);
3681 return false;
3684 blob = ndr_push_blob(push);
3685 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3686 talloc_free(r);
3687 return false;
3690 talloc_free(r);
3692 return true;
3695 static bool api_spoolss_DeleteMonitor(pipes_struct *p)
3697 const struct ndr_interface_call *call;
3698 struct ndr_pull *pull;
3699 struct ndr_push *push;
3700 enum ndr_err_code ndr_err;
3701 DATA_BLOB blob;
3702 struct spoolss_DeleteMonitor *r;
3704 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEMONITOR];
3706 r = talloc(talloc_tos(), struct spoolss_DeleteMonitor);
3707 if (r == NULL) {
3708 return false;
3711 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3712 talloc_free(r);
3713 return false;
3716 pull = ndr_pull_init_blob(&blob, r, NULL);
3717 if (pull == NULL) {
3718 talloc_free(r);
3719 return false;
3722 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3723 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3724 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3725 talloc_free(r);
3726 return false;
3729 if (DEBUGLEVEL >= 10) {
3730 NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, r);
3733 r->out.result = _spoolss_DeleteMonitor(p, r);
3735 if (p->rng_fault_state) {
3736 talloc_free(r);
3737 /* Return true here, srv_pipe_hnd.c will take care */
3738 return true;
3741 if (DEBUGLEVEL >= 10) {
3742 NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, r);
3745 push = ndr_push_init_ctx(r, NULL);
3746 if (push == NULL) {
3747 talloc_free(r);
3748 return false;
3751 ndr_err = call->ndr_push(push, NDR_OUT, r);
3752 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3753 talloc_free(r);
3754 return false;
3757 blob = ndr_push_blob(push);
3758 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3759 talloc_free(r);
3760 return false;
3763 talloc_free(r);
3765 return true;
3768 static bool api_spoolss_DeletePrintProcessor(pipes_struct *p)
3770 const struct ndr_interface_call *call;
3771 struct ndr_pull *pull;
3772 struct ndr_push *push;
3773 enum ndr_err_code ndr_err;
3774 DATA_BLOB blob;
3775 struct spoolss_DeletePrintProcessor *r;
3777 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTPROCESSOR];
3779 r = talloc(talloc_tos(), struct spoolss_DeletePrintProcessor);
3780 if (r == NULL) {
3781 return false;
3784 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3785 talloc_free(r);
3786 return false;
3789 pull = ndr_pull_init_blob(&blob, r, NULL);
3790 if (pull == NULL) {
3791 talloc_free(r);
3792 return false;
3795 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3796 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3797 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3798 talloc_free(r);
3799 return false;
3802 if (DEBUGLEVEL >= 10) {
3803 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, r);
3806 r->out.result = _spoolss_DeletePrintProcessor(p, r);
3808 if (p->rng_fault_state) {
3809 talloc_free(r);
3810 /* Return true here, srv_pipe_hnd.c will take care */
3811 return true;
3814 if (DEBUGLEVEL >= 10) {
3815 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, r);
3818 push = ndr_push_init_ctx(r, NULL);
3819 if (push == NULL) {
3820 talloc_free(r);
3821 return false;
3824 ndr_err = call->ndr_push(push, NDR_OUT, r);
3825 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3826 talloc_free(r);
3827 return false;
3830 blob = ndr_push_blob(push);
3831 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3832 talloc_free(r);
3833 return false;
3836 talloc_free(r);
3838 return true;
3841 static bool api_spoolss_AddPrintProvidor(pipes_struct *p)
3843 const struct ndr_interface_call *call;
3844 struct ndr_pull *pull;
3845 struct ndr_push *push;
3846 enum ndr_err_code ndr_err;
3847 DATA_BLOB blob;
3848 struct spoolss_AddPrintProvidor *r;
3850 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTPROVIDOR];
3852 r = talloc(talloc_tos(), struct spoolss_AddPrintProvidor);
3853 if (r == NULL) {
3854 return false;
3857 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3858 talloc_free(r);
3859 return false;
3862 pull = ndr_pull_init_blob(&blob, r, NULL);
3863 if (pull == NULL) {
3864 talloc_free(r);
3865 return false;
3868 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3869 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3870 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3871 talloc_free(r);
3872 return false;
3875 if (DEBUGLEVEL >= 10) {
3876 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, r);
3879 r->out.result = _spoolss_AddPrintProvidor(p, r);
3881 if (p->rng_fault_state) {
3882 talloc_free(r);
3883 /* Return true here, srv_pipe_hnd.c will take care */
3884 return true;
3887 if (DEBUGLEVEL >= 10) {
3888 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, r);
3891 push = ndr_push_init_ctx(r, NULL);
3892 if (push == NULL) {
3893 talloc_free(r);
3894 return false;
3897 ndr_err = call->ndr_push(push, NDR_OUT, r);
3898 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3899 talloc_free(r);
3900 return false;
3903 blob = ndr_push_blob(push);
3904 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3905 talloc_free(r);
3906 return false;
3909 talloc_free(r);
3911 return true;
3914 static bool api_spoolss_DeletePrintProvidor(pipes_struct *p)
3916 const struct ndr_interface_call *call;
3917 struct ndr_pull *pull;
3918 struct ndr_push *push;
3919 enum ndr_err_code ndr_err;
3920 DATA_BLOB blob;
3921 struct spoolss_DeletePrintProvidor *r;
3923 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTPROVIDOR];
3925 r = talloc(talloc_tos(), struct spoolss_DeletePrintProvidor);
3926 if (r == NULL) {
3927 return false;
3930 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3931 talloc_free(r);
3932 return false;
3935 pull = ndr_pull_init_blob(&blob, r, NULL);
3936 if (pull == NULL) {
3937 talloc_free(r);
3938 return false;
3941 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3942 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3943 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3944 talloc_free(r);
3945 return false;
3948 if (DEBUGLEVEL >= 10) {
3949 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, r);
3952 r->out.result = _spoolss_DeletePrintProvidor(p, r);
3954 if (p->rng_fault_state) {
3955 talloc_free(r);
3956 /* Return true here, srv_pipe_hnd.c will take care */
3957 return true;
3960 if (DEBUGLEVEL >= 10) {
3961 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, r);
3964 push = ndr_push_init_ctx(r, NULL);
3965 if (push == NULL) {
3966 talloc_free(r);
3967 return false;
3970 ndr_err = call->ndr_push(push, NDR_OUT, r);
3971 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3972 talloc_free(r);
3973 return false;
3976 blob = ndr_push_blob(push);
3977 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3978 talloc_free(r);
3979 return false;
3982 talloc_free(r);
3984 return true;
3987 static bool api_spoolss_EnumPrintProcDataTypes(pipes_struct *p)
3989 const struct ndr_interface_call *call;
3990 struct ndr_pull *pull;
3991 struct ndr_push *push;
3992 enum ndr_err_code ndr_err;
3993 DATA_BLOB blob;
3994 struct spoolss_EnumPrintProcDataTypes *r;
3996 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTPROCDATATYPES];
3998 r = talloc(talloc_tos(), struct spoolss_EnumPrintProcDataTypes);
3999 if (r == NULL) {
4000 return false;
4003 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4004 talloc_free(r);
4005 return false;
4008 pull = ndr_pull_init_blob(&blob, r, NULL);
4009 if (pull == NULL) {
4010 talloc_free(r);
4011 return false;
4014 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4015 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4016 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4017 talloc_free(r);
4018 return false;
4021 if (DEBUGLEVEL >= 10) {
4022 NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, r);
4025 ZERO_STRUCT(r->out);
4026 r->out.count = talloc_zero(r, uint32_t);
4027 if (r->out.count == NULL) {
4028 talloc_free(r);
4029 return false;
4032 r->out.info = talloc_zero(r, union spoolss_PrintProcDataTypesInfo *);
4033 if (r->out.info == NULL) {
4034 talloc_free(r);
4035 return false;
4038 r->out.needed = talloc_zero(r, uint32_t);
4039 if (r->out.needed == NULL) {
4040 talloc_free(r);
4041 return false;
4044 r->out.result = _spoolss_EnumPrintProcDataTypes(p, r);
4046 if (p->rng_fault_state) {
4047 talloc_free(r);
4048 /* Return true here, srv_pipe_hnd.c will take care */
4049 return true;
4052 if (DEBUGLEVEL >= 10) {
4053 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, r);
4056 push = ndr_push_init_ctx(r, NULL);
4057 if (push == NULL) {
4058 talloc_free(r);
4059 return false;
4062 ndr_err = call->ndr_push(push, NDR_OUT, r);
4063 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4064 talloc_free(r);
4065 return false;
4068 blob = ndr_push_blob(push);
4069 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4070 talloc_free(r);
4071 return false;
4074 talloc_free(r);
4076 return true;
4079 static bool api_spoolss_ResetPrinter(pipes_struct *p)
4081 const struct ndr_interface_call *call;
4082 struct ndr_pull *pull;
4083 struct ndr_push *push;
4084 enum ndr_err_code ndr_err;
4085 DATA_BLOB blob;
4086 struct spoolss_ResetPrinter *r;
4088 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_RESETPRINTER];
4090 r = talloc(talloc_tos(), struct spoolss_ResetPrinter);
4091 if (r == NULL) {
4092 return false;
4095 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4096 talloc_free(r);
4097 return false;
4100 pull = ndr_pull_init_blob(&blob, r, NULL);
4101 if (pull == NULL) {
4102 talloc_free(r);
4103 return false;
4106 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4107 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4108 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4109 talloc_free(r);
4110 return false;
4113 if (DEBUGLEVEL >= 10) {
4114 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, r);
4117 r->out.result = _spoolss_ResetPrinter(p, r);
4119 if (p->rng_fault_state) {
4120 talloc_free(r);
4121 /* Return true here, srv_pipe_hnd.c will take care */
4122 return true;
4125 if (DEBUGLEVEL >= 10) {
4126 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, r);
4129 push = ndr_push_init_ctx(r, NULL);
4130 if (push == NULL) {
4131 talloc_free(r);
4132 return false;
4135 ndr_err = call->ndr_push(push, NDR_OUT, r);
4136 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4137 talloc_free(r);
4138 return false;
4141 blob = ndr_push_blob(push);
4142 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4143 talloc_free(r);
4144 return false;
4147 talloc_free(r);
4149 return true;
4152 static bool api_spoolss_GetPrinterDriver2(pipes_struct *p)
4154 const struct ndr_interface_call *call;
4155 struct ndr_pull *pull;
4156 struct ndr_push *push;
4157 enum ndr_err_code ndr_err;
4158 DATA_BLOB blob;
4159 struct spoolss_GetPrinterDriver2 *r;
4161 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETPRINTERDRIVER2];
4163 r = talloc(talloc_tos(), struct spoolss_GetPrinterDriver2);
4164 if (r == NULL) {
4165 return false;
4168 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4169 talloc_free(r);
4170 return false;
4173 pull = ndr_pull_init_blob(&blob, r, NULL);
4174 if (pull == NULL) {
4175 talloc_free(r);
4176 return false;
4179 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4180 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4181 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4182 talloc_free(r);
4183 return false;
4186 if (DEBUGLEVEL >= 10) {
4187 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, r);
4190 ZERO_STRUCT(r->out);
4191 r->out.info = talloc_zero(r, union spoolss_DriverInfo);
4192 if (r->out.info == NULL) {
4193 talloc_free(r);
4194 return false;
4197 r->out.needed = talloc_zero(r, uint32_t);
4198 if (r->out.needed == NULL) {
4199 talloc_free(r);
4200 return false;
4203 r->out.server_major_version = talloc_zero(r, uint32_t);
4204 if (r->out.server_major_version == NULL) {
4205 talloc_free(r);
4206 return false;
4209 r->out.server_minor_version = talloc_zero(r, uint32_t);
4210 if (r->out.server_minor_version == NULL) {
4211 talloc_free(r);
4212 return false;
4215 r->out.result = _spoolss_GetPrinterDriver2(p, r);
4217 if (p->rng_fault_state) {
4218 talloc_free(r);
4219 /* Return true here, srv_pipe_hnd.c will take care */
4220 return true;
4223 if (DEBUGLEVEL >= 10) {
4224 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, r);
4227 push = ndr_push_init_ctx(r, NULL);
4228 if (push == NULL) {
4229 talloc_free(r);
4230 return false;
4233 ndr_err = call->ndr_push(push, NDR_OUT, r);
4234 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4235 talloc_free(r);
4236 return false;
4239 blob = ndr_push_blob(push);
4240 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4241 talloc_free(r);
4242 return false;
4245 talloc_free(r);
4247 return true;
4250 static bool api_spoolss_FindFirstPrinterChangeNotification(pipes_struct *p)
4252 const struct ndr_interface_call *call;
4253 struct ndr_pull *pull;
4254 struct ndr_push *push;
4255 enum ndr_err_code ndr_err;
4256 DATA_BLOB blob;
4257 struct spoolss_FindFirstPrinterChangeNotification *r;
4259 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION];
4261 r = talloc(talloc_tos(), struct spoolss_FindFirstPrinterChangeNotification);
4262 if (r == NULL) {
4263 return false;
4266 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4267 talloc_free(r);
4268 return false;
4271 pull = ndr_pull_init_blob(&blob, r, NULL);
4272 if (pull == NULL) {
4273 talloc_free(r);
4274 return false;
4277 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4278 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4279 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4280 talloc_free(r);
4281 return false;
4284 if (DEBUGLEVEL >= 10) {
4285 NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, r);
4288 r->out.result = _spoolss_FindFirstPrinterChangeNotification(p, r);
4290 if (p->rng_fault_state) {
4291 talloc_free(r);
4292 /* Return true here, srv_pipe_hnd.c will take care */
4293 return true;
4296 if (DEBUGLEVEL >= 10) {
4297 NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, r);
4300 push = ndr_push_init_ctx(r, NULL);
4301 if (push == NULL) {
4302 talloc_free(r);
4303 return false;
4306 ndr_err = call->ndr_push(push, NDR_OUT, r);
4307 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4308 talloc_free(r);
4309 return false;
4312 blob = ndr_push_blob(push);
4313 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4314 talloc_free(r);
4315 return false;
4318 talloc_free(r);
4320 return true;
4323 static bool api_spoolss_FindNextPrinterChangeNotification(pipes_struct *p)
4325 const struct ndr_interface_call *call;
4326 struct ndr_pull *pull;
4327 struct ndr_push *push;
4328 enum ndr_err_code ndr_err;
4329 DATA_BLOB blob;
4330 struct spoolss_FindNextPrinterChangeNotification *r;
4332 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION];
4334 r = talloc(talloc_tos(), struct spoolss_FindNextPrinterChangeNotification);
4335 if (r == NULL) {
4336 return false;
4339 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4340 talloc_free(r);
4341 return false;
4344 pull = ndr_pull_init_blob(&blob, r, NULL);
4345 if (pull == NULL) {
4346 talloc_free(r);
4347 return false;
4350 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4351 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4352 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4353 talloc_free(r);
4354 return false;
4357 if (DEBUGLEVEL >= 10) {
4358 NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, r);
4361 r->out.result = _spoolss_FindNextPrinterChangeNotification(p, r);
4363 if (p->rng_fault_state) {
4364 talloc_free(r);
4365 /* Return true here, srv_pipe_hnd.c will take care */
4366 return true;
4369 if (DEBUGLEVEL >= 10) {
4370 NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, r);
4373 push = ndr_push_init_ctx(r, NULL);
4374 if (push == NULL) {
4375 talloc_free(r);
4376 return false;
4379 ndr_err = call->ndr_push(push, NDR_OUT, r);
4380 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4381 talloc_free(r);
4382 return false;
4385 blob = ndr_push_blob(push);
4386 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4387 talloc_free(r);
4388 return false;
4391 talloc_free(r);
4393 return true;
4396 static bool api_spoolss_FindClosePrinterNotify(pipes_struct *p)
4398 const struct ndr_interface_call *call;
4399 struct ndr_pull *pull;
4400 struct ndr_push *push;
4401 enum ndr_err_code ndr_err;
4402 DATA_BLOB blob;
4403 struct spoolss_FindClosePrinterNotify *r;
4405 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY];
4407 r = talloc(talloc_tos(), struct spoolss_FindClosePrinterNotify);
4408 if (r == NULL) {
4409 return false;
4412 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4413 talloc_free(r);
4414 return false;
4417 pull = ndr_pull_init_blob(&blob, r, NULL);
4418 if (pull == NULL) {
4419 talloc_free(r);
4420 return false;
4423 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4424 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4425 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4426 talloc_free(r);
4427 return false;
4430 if (DEBUGLEVEL >= 10) {
4431 NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, r);
4434 r->out.result = _spoolss_FindClosePrinterNotify(p, r);
4436 if (p->rng_fault_state) {
4437 talloc_free(r);
4438 /* Return true here, srv_pipe_hnd.c will take care */
4439 return true;
4442 if (DEBUGLEVEL >= 10) {
4443 NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, r);
4446 push = ndr_push_init_ctx(r, NULL);
4447 if (push == NULL) {
4448 talloc_free(r);
4449 return false;
4452 ndr_err = call->ndr_push(push, NDR_OUT, r);
4453 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4454 talloc_free(r);
4455 return false;
4458 blob = ndr_push_blob(push);
4459 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4460 talloc_free(r);
4461 return false;
4464 talloc_free(r);
4466 return true;
4469 static bool api_spoolss_RouterFindFirstPrinterChangeNotificationOld(pipes_struct *p)
4471 const struct ndr_interface_call *call;
4472 struct ndr_pull *pull;
4473 struct ndr_push *push;
4474 enum ndr_err_code ndr_err;
4475 DATA_BLOB blob;
4476 struct spoolss_RouterFindFirstPrinterChangeNotificationOld *r;
4478 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD];
4480 r = talloc(talloc_tos(), struct spoolss_RouterFindFirstPrinterChangeNotificationOld);
4481 if (r == NULL) {
4482 return false;
4485 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4486 talloc_free(r);
4487 return false;
4490 pull = ndr_pull_init_blob(&blob, r, NULL);
4491 if (pull == NULL) {
4492 talloc_free(r);
4493 return false;
4496 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4497 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4498 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4499 talloc_free(r);
4500 return false;
4503 if (DEBUGLEVEL >= 10) {
4504 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, r);
4507 r->out.result = _spoolss_RouterFindFirstPrinterChangeNotificationOld(p, r);
4509 if (p->rng_fault_state) {
4510 talloc_free(r);
4511 /* Return true here, srv_pipe_hnd.c will take care */
4512 return true;
4515 if (DEBUGLEVEL >= 10) {
4516 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, r);
4519 push = ndr_push_init_ctx(r, NULL);
4520 if (push == NULL) {
4521 talloc_free(r);
4522 return false;
4525 ndr_err = call->ndr_push(push, NDR_OUT, r);
4526 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4527 talloc_free(r);
4528 return false;
4531 blob = ndr_push_blob(push);
4532 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4533 talloc_free(r);
4534 return false;
4537 talloc_free(r);
4539 return true;
4542 static bool api_spoolss_ReplyOpenPrinter(pipes_struct *p)
4544 const struct ndr_interface_call *call;
4545 struct ndr_pull *pull;
4546 struct ndr_push *push;
4547 enum ndr_err_code ndr_err;
4548 DATA_BLOB blob;
4549 struct spoolss_ReplyOpenPrinter *r;
4551 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_REPLYOPENPRINTER];
4553 r = talloc(talloc_tos(), struct spoolss_ReplyOpenPrinter);
4554 if (r == NULL) {
4555 return false;
4558 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4559 talloc_free(r);
4560 return false;
4563 pull = ndr_pull_init_blob(&blob, r, NULL);
4564 if (pull == NULL) {
4565 talloc_free(r);
4566 return false;
4569 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4570 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4571 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4572 talloc_free(r);
4573 return false;
4576 if (DEBUGLEVEL >= 10) {
4577 NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, r);
4580 ZERO_STRUCT(r->out);
4581 r->out.handle = talloc_zero(r, struct policy_handle);
4582 if (r->out.handle == NULL) {
4583 talloc_free(r);
4584 return false;
4587 r->out.result = _spoolss_ReplyOpenPrinter(p, r);
4589 if (p->rng_fault_state) {
4590 talloc_free(r);
4591 /* Return true here, srv_pipe_hnd.c will take care */
4592 return true;
4595 if (DEBUGLEVEL >= 10) {
4596 NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, r);
4599 push = ndr_push_init_ctx(r, NULL);
4600 if (push == NULL) {
4601 talloc_free(r);
4602 return false;
4605 ndr_err = call->ndr_push(push, NDR_OUT, r);
4606 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4607 talloc_free(r);
4608 return false;
4611 blob = ndr_push_blob(push);
4612 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4613 talloc_free(r);
4614 return false;
4617 talloc_free(r);
4619 return true;
4622 static bool api_spoolss_RouterReplyPrinter(pipes_struct *p)
4624 const struct ndr_interface_call *call;
4625 struct ndr_pull *pull;
4626 struct ndr_push *push;
4627 enum ndr_err_code ndr_err;
4628 DATA_BLOB blob;
4629 struct spoolss_RouterReplyPrinter *r;
4631 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERREPLYPRINTER];
4633 r = talloc(talloc_tos(), struct spoolss_RouterReplyPrinter);
4634 if (r == NULL) {
4635 return false;
4638 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4639 talloc_free(r);
4640 return false;
4643 pull = ndr_pull_init_blob(&blob, r, NULL);
4644 if (pull == NULL) {
4645 talloc_free(r);
4646 return false;
4649 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4650 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4651 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4652 talloc_free(r);
4653 return false;
4656 if (DEBUGLEVEL >= 10) {
4657 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, r);
4660 r->out.result = _spoolss_RouterReplyPrinter(p, r);
4662 if (p->rng_fault_state) {
4663 talloc_free(r);
4664 /* Return true here, srv_pipe_hnd.c will take care */
4665 return true;
4668 if (DEBUGLEVEL >= 10) {
4669 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, r);
4672 push = ndr_push_init_ctx(r, NULL);
4673 if (push == NULL) {
4674 talloc_free(r);
4675 return false;
4678 ndr_err = call->ndr_push(push, NDR_OUT, r);
4679 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4680 talloc_free(r);
4681 return false;
4684 blob = ndr_push_blob(push);
4685 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4686 talloc_free(r);
4687 return false;
4690 talloc_free(r);
4692 return true;
4695 static bool api_spoolss_ReplyClosePrinter(pipes_struct *p)
4697 const struct ndr_interface_call *call;
4698 struct ndr_pull *pull;
4699 struct ndr_push *push;
4700 enum ndr_err_code ndr_err;
4701 DATA_BLOB blob;
4702 struct spoolss_ReplyClosePrinter *r;
4704 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_REPLYCLOSEPRINTER];
4706 r = talloc(talloc_tos(), struct spoolss_ReplyClosePrinter);
4707 if (r == NULL) {
4708 return false;
4711 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4712 talloc_free(r);
4713 return false;
4716 pull = ndr_pull_init_blob(&blob, r, NULL);
4717 if (pull == NULL) {
4718 talloc_free(r);
4719 return false;
4722 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4723 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4724 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4725 talloc_free(r);
4726 return false;
4729 if (DEBUGLEVEL >= 10) {
4730 NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, r);
4733 ZERO_STRUCT(r->out);
4734 r->out.handle = r->in.handle;
4735 r->out.result = _spoolss_ReplyClosePrinter(p, r);
4737 if (p->rng_fault_state) {
4738 talloc_free(r);
4739 /* Return true here, srv_pipe_hnd.c will take care */
4740 return true;
4743 if (DEBUGLEVEL >= 10) {
4744 NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, r);
4747 push = ndr_push_init_ctx(r, NULL);
4748 if (push == NULL) {
4749 talloc_free(r);
4750 return false;
4753 ndr_err = call->ndr_push(push, NDR_OUT, r);
4754 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4755 talloc_free(r);
4756 return false;
4759 blob = ndr_push_blob(push);
4760 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4761 talloc_free(r);
4762 return false;
4765 talloc_free(r);
4767 return true;
4770 static bool api_spoolss_AddPortEx(pipes_struct *p)
4772 const struct ndr_interface_call *call;
4773 struct ndr_pull *pull;
4774 struct ndr_push *push;
4775 enum ndr_err_code ndr_err;
4776 DATA_BLOB blob;
4777 struct spoolss_AddPortEx *r;
4779 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPORTEX];
4781 r = talloc(talloc_tos(), struct spoolss_AddPortEx);
4782 if (r == NULL) {
4783 return false;
4786 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4787 talloc_free(r);
4788 return false;
4791 pull = ndr_pull_init_blob(&blob, r, NULL);
4792 if (pull == NULL) {
4793 talloc_free(r);
4794 return false;
4797 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4798 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4799 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4800 talloc_free(r);
4801 return false;
4804 if (DEBUGLEVEL >= 10) {
4805 NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, r);
4808 r->out.result = _spoolss_AddPortEx(p, r);
4810 if (p->rng_fault_state) {
4811 talloc_free(r);
4812 /* Return true here, srv_pipe_hnd.c will take care */
4813 return true;
4816 if (DEBUGLEVEL >= 10) {
4817 NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, r);
4820 push = ndr_push_init_ctx(r, NULL);
4821 if (push == NULL) {
4822 talloc_free(r);
4823 return false;
4826 ndr_err = call->ndr_push(push, NDR_OUT, r);
4827 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4828 talloc_free(r);
4829 return false;
4832 blob = ndr_push_blob(push);
4833 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4834 talloc_free(r);
4835 return false;
4838 talloc_free(r);
4840 return true;
4843 static bool api_spoolss_RouterFindFirstPrinterChangeNotification(pipes_struct *p)
4845 const struct ndr_interface_call *call;
4846 struct ndr_pull *pull;
4847 struct ndr_push *push;
4848 enum ndr_err_code ndr_err;
4849 DATA_BLOB blob;
4850 struct spoolss_RouterFindFirstPrinterChangeNotification *r;
4852 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION];
4854 r = talloc(talloc_tos(), struct spoolss_RouterFindFirstPrinterChangeNotification);
4855 if (r == NULL) {
4856 return false;
4859 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4860 talloc_free(r);
4861 return false;
4864 pull = ndr_pull_init_blob(&blob, r, NULL);
4865 if (pull == NULL) {
4866 talloc_free(r);
4867 return false;
4870 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4871 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4872 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4873 talloc_free(r);
4874 return false;
4877 if (DEBUGLEVEL >= 10) {
4878 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, r);
4881 r->out.result = _spoolss_RouterFindFirstPrinterChangeNotification(p, r);
4883 if (p->rng_fault_state) {
4884 talloc_free(r);
4885 /* Return true here, srv_pipe_hnd.c will take care */
4886 return true;
4889 if (DEBUGLEVEL >= 10) {
4890 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, r);
4893 push = ndr_push_init_ctx(r, NULL);
4894 if (push == NULL) {
4895 talloc_free(r);
4896 return false;
4899 ndr_err = call->ndr_push(push, NDR_OUT, r);
4900 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4901 talloc_free(r);
4902 return false;
4905 blob = ndr_push_blob(push);
4906 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4907 talloc_free(r);
4908 return false;
4911 talloc_free(r);
4913 return true;
4916 static bool api_spoolss_SpoolerInit(pipes_struct *p)
4918 const struct ndr_interface_call *call;
4919 struct ndr_pull *pull;
4920 struct ndr_push *push;
4921 enum ndr_err_code ndr_err;
4922 DATA_BLOB blob;
4923 struct spoolss_SpoolerInit *r;
4925 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SPOOLERINIT];
4927 r = talloc(talloc_tos(), struct spoolss_SpoolerInit);
4928 if (r == NULL) {
4929 return false;
4932 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4933 talloc_free(r);
4934 return false;
4937 pull = ndr_pull_init_blob(&blob, r, NULL);
4938 if (pull == NULL) {
4939 talloc_free(r);
4940 return false;
4943 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4944 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4945 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4946 talloc_free(r);
4947 return false;
4950 if (DEBUGLEVEL >= 10) {
4951 NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, r);
4954 r->out.result = _spoolss_SpoolerInit(p, r);
4956 if (p->rng_fault_state) {
4957 talloc_free(r);
4958 /* Return true here, srv_pipe_hnd.c will take care */
4959 return true;
4962 if (DEBUGLEVEL >= 10) {
4963 NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, r);
4966 push = ndr_push_init_ctx(r, NULL);
4967 if (push == NULL) {
4968 talloc_free(r);
4969 return false;
4972 ndr_err = call->ndr_push(push, NDR_OUT, r);
4973 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4974 talloc_free(r);
4975 return false;
4978 blob = ndr_push_blob(push);
4979 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4980 talloc_free(r);
4981 return false;
4984 talloc_free(r);
4986 return true;
4989 static bool api_spoolss_ResetPrinterEx(pipes_struct *p)
4991 const struct ndr_interface_call *call;
4992 struct ndr_pull *pull;
4993 struct ndr_push *push;
4994 enum ndr_err_code ndr_err;
4995 DATA_BLOB blob;
4996 struct spoolss_ResetPrinterEx *r;
4998 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_RESETPRINTEREX];
5000 r = talloc(talloc_tos(), struct spoolss_ResetPrinterEx);
5001 if (r == NULL) {
5002 return false;
5005 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5006 talloc_free(r);
5007 return false;
5010 pull = ndr_pull_init_blob(&blob, r, NULL);
5011 if (pull == NULL) {
5012 talloc_free(r);
5013 return false;
5016 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5017 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5018 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5019 talloc_free(r);
5020 return false;
5023 if (DEBUGLEVEL >= 10) {
5024 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, r);
5027 r->out.result = _spoolss_ResetPrinterEx(p, r);
5029 if (p->rng_fault_state) {
5030 talloc_free(r);
5031 /* Return true here, srv_pipe_hnd.c will take care */
5032 return true;
5035 if (DEBUGLEVEL >= 10) {
5036 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, r);
5039 push = ndr_push_init_ctx(r, NULL);
5040 if (push == NULL) {
5041 talloc_free(r);
5042 return false;
5045 ndr_err = call->ndr_push(push, NDR_OUT, r);
5046 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5047 talloc_free(r);
5048 return false;
5051 blob = ndr_push_blob(push);
5052 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5053 talloc_free(r);
5054 return false;
5057 talloc_free(r);
5059 return true;
5062 static bool api_spoolss_RemoteFindFirstPrinterChangeNotifyEx(pipes_struct *p)
5064 const struct ndr_interface_call *call;
5065 struct ndr_pull *pull;
5066 struct ndr_push *push;
5067 enum ndr_err_code ndr_err;
5068 DATA_BLOB blob;
5069 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r;
5071 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX];
5073 r = talloc(talloc_tos(), struct spoolss_RemoteFindFirstPrinterChangeNotifyEx);
5074 if (r == NULL) {
5075 return false;
5078 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5079 talloc_free(r);
5080 return false;
5083 pull = ndr_pull_init_blob(&blob, r, NULL);
5084 if (pull == NULL) {
5085 talloc_free(r);
5086 return false;
5089 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5090 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5091 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5092 talloc_free(r);
5093 return false;
5096 if (DEBUGLEVEL >= 10) {
5097 NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, r);
5100 r->out.result = _spoolss_RemoteFindFirstPrinterChangeNotifyEx(p, r);
5102 if (p->rng_fault_state) {
5103 talloc_free(r);
5104 /* Return true here, srv_pipe_hnd.c will take care */
5105 return true;
5108 if (DEBUGLEVEL >= 10) {
5109 NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, r);
5112 push = ndr_push_init_ctx(r, NULL);
5113 if (push == NULL) {
5114 talloc_free(r);
5115 return false;
5118 ndr_err = call->ndr_push(push, NDR_OUT, r);
5119 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5120 talloc_free(r);
5121 return false;
5124 blob = ndr_push_blob(push);
5125 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5126 talloc_free(r);
5127 return false;
5130 talloc_free(r);
5132 return true;
5135 static bool api_spoolss_RouterReplyPrinterEx(pipes_struct *p)
5137 const struct ndr_interface_call *call;
5138 struct ndr_pull *pull;
5139 struct ndr_push *push;
5140 enum ndr_err_code ndr_err;
5141 DATA_BLOB blob;
5142 struct spoolss_RouterReplyPrinterEx *r;
5144 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERREPLYPRINTEREX];
5146 r = talloc(talloc_tos(), struct spoolss_RouterReplyPrinterEx);
5147 if (r == NULL) {
5148 return false;
5151 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5152 talloc_free(r);
5153 return false;
5156 pull = ndr_pull_init_blob(&blob, r, NULL);
5157 if (pull == NULL) {
5158 talloc_free(r);
5159 return false;
5162 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5163 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5164 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5165 talloc_free(r);
5166 return false;
5169 if (DEBUGLEVEL >= 10) {
5170 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, r);
5173 ZERO_STRUCT(r->out);
5174 r->out.reply_result = talloc_zero(r, uint32_t);
5175 if (r->out.reply_result == NULL) {
5176 talloc_free(r);
5177 return false;
5180 r->out.result = _spoolss_RouterReplyPrinterEx(p, r);
5182 if (p->rng_fault_state) {
5183 talloc_free(r);
5184 /* Return true here, srv_pipe_hnd.c will take care */
5185 return true;
5188 if (DEBUGLEVEL >= 10) {
5189 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinterEx, r);
5192 push = ndr_push_init_ctx(r, NULL);
5193 if (push == NULL) {
5194 talloc_free(r);
5195 return false;
5198 ndr_err = call->ndr_push(push, NDR_OUT, r);
5199 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5200 talloc_free(r);
5201 return false;
5204 blob = ndr_push_blob(push);
5205 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5206 talloc_free(r);
5207 return false;
5210 talloc_free(r);
5212 return true;
5215 static bool api_spoolss_RouterRefreshPrinterChangeNotify(pipes_struct *p)
5217 const struct ndr_interface_call *call;
5218 struct ndr_pull *pull;
5219 struct ndr_push *push;
5220 enum ndr_err_code ndr_err;
5221 DATA_BLOB blob;
5222 struct spoolss_RouterRefreshPrinterChangeNotify *r;
5224 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY];
5226 r = talloc(talloc_tos(), struct spoolss_RouterRefreshPrinterChangeNotify);
5227 if (r == NULL) {
5228 return false;
5231 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5232 talloc_free(r);
5233 return false;
5236 pull = ndr_pull_init_blob(&blob, r, NULL);
5237 if (pull == NULL) {
5238 talloc_free(r);
5239 return false;
5242 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5243 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5244 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5245 talloc_free(r);
5246 return false;
5249 if (DEBUGLEVEL >= 10) {
5250 NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, r);
5253 ZERO_STRUCT(r->out);
5254 r->out.info = talloc_zero(r, struct spoolss_NotifyInfo *);
5255 if (r->out.info == NULL) {
5256 talloc_free(r);
5257 return false;
5260 r->out.result = _spoolss_RouterRefreshPrinterChangeNotify(p, r);
5262 if (p->rng_fault_state) {
5263 talloc_free(r);
5264 /* Return true here, srv_pipe_hnd.c will take care */
5265 return true;
5268 if (DEBUGLEVEL >= 10) {
5269 NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, r);
5272 push = ndr_push_init_ctx(r, NULL);
5273 if (push == NULL) {
5274 talloc_free(r);
5275 return false;
5278 ndr_err = call->ndr_push(push, NDR_OUT, r);
5279 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5280 talloc_free(r);
5281 return false;
5284 blob = ndr_push_blob(push);
5285 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5286 talloc_free(r);
5287 return false;
5290 talloc_free(r);
5292 return true;
5295 static bool api_spoolss_44(pipes_struct *p)
5297 const struct ndr_interface_call *call;
5298 struct ndr_pull *pull;
5299 struct ndr_push *push;
5300 enum ndr_err_code ndr_err;
5301 DATA_BLOB blob;
5302 struct spoolss_44 *r;
5304 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_44];
5306 r = talloc(talloc_tos(), struct spoolss_44);
5307 if (r == NULL) {
5308 return false;
5311 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5312 talloc_free(r);
5313 return false;
5316 pull = ndr_pull_init_blob(&blob, r, NULL);
5317 if (pull == NULL) {
5318 talloc_free(r);
5319 return false;
5322 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5323 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5324 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5325 talloc_free(r);
5326 return false;
5329 if (DEBUGLEVEL >= 10) {
5330 NDR_PRINT_IN_DEBUG(spoolss_44, r);
5333 r->out.result = _spoolss_44(p, r);
5335 if (p->rng_fault_state) {
5336 talloc_free(r);
5337 /* Return true here, srv_pipe_hnd.c will take care */
5338 return true;
5341 if (DEBUGLEVEL >= 10) {
5342 NDR_PRINT_OUT_DEBUG(spoolss_44, r);
5345 push = ndr_push_init_ctx(r, NULL);
5346 if (push == NULL) {
5347 talloc_free(r);
5348 return false;
5351 ndr_err = call->ndr_push(push, NDR_OUT, r);
5352 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5353 talloc_free(r);
5354 return false;
5357 blob = ndr_push_blob(push);
5358 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5359 talloc_free(r);
5360 return false;
5363 talloc_free(r);
5365 return true;
5368 static bool api_spoolss_OpenPrinterEx(pipes_struct *p)
5370 const struct ndr_interface_call *call;
5371 struct ndr_pull *pull;
5372 struct ndr_push *push;
5373 enum ndr_err_code ndr_err;
5374 DATA_BLOB blob;
5375 struct spoolss_OpenPrinterEx *r;
5377 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_OPENPRINTEREX];
5379 r = talloc(talloc_tos(), struct spoolss_OpenPrinterEx);
5380 if (r == NULL) {
5381 return false;
5384 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5385 talloc_free(r);
5386 return false;
5389 pull = ndr_pull_init_blob(&blob, r, NULL);
5390 if (pull == NULL) {
5391 talloc_free(r);
5392 return false;
5395 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5396 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5397 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5398 talloc_free(r);
5399 return false;
5402 if (DEBUGLEVEL >= 10) {
5403 NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, r);
5406 ZERO_STRUCT(r->out);
5407 r->out.handle = talloc_zero(r, struct policy_handle);
5408 if (r->out.handle == NULL) {
5409 talloc_free(r);
5410 return false;
5413 r->out.result = _spoolss_OpenPrinterEx(p, r);
5415 if (p->rng_fault_state) {
5416 talloc_free(r);
5417 /* Return true here, srv_pipe_hnd.c will take care */
5418 return true;
5421 if (DEBUGLEVEL >= 10) {
5422 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, r);
5425 push = ndr_push_init_ctx(r, NULL);
5426 if (push == NULL) {
5427 talloc_free(r);
5428 return false;
5431 ndr_err = call->ndr_push(push, NDR_OUT, r);
5432 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5433 talloc_free(r);
5434 return false;
5437 blob = ndr_push_blob(push);
5438 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5439 talloc_free(r);
5440 return false;
5443 talloc_free(r);
5445 return true;
5448 static bool api_spoolss_AddPrinterEx(pipes_struct *p)
5450 const struct ndr_interface_call *call;
5451 struct ndr_pull *pull;
5452 struct ndr_push *push;
5453 enum ndr_err_code ndr_err;
5454 DATA_BLOB blob;
5455 struct spoolss_AddPrinterEx *r;
5457 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTEREX];
5459 r = talloc(talloc_tos(), struct spoolss_AddPrinterEx);
5460 if (r == NULL) {
5461 return false;
5464 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5465 talloc_free(r);
5466 return false;
5469 pull = ndr_pull_init_blob(&blob, r, NULL);
5470 if (pull == NULL) {
5471 talloc_free(r);
5472 return false;
5475 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5476 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5477 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5478 talloc_free(r);
5479 return false;
5482 if (DEBUGLEVEL >= 10) {
5483 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, r);
5486 ZERO_STRUCT(r->out);
5487 r->out.handle = talloc_zero(r, struct policy_handle);
5488 if (r->out.handle == NULL) {
5489 talloc_free(r);
5490 return false;
5493 r->out.result = _spoolss_AddPrinterEx(p, r);
5495 if (p->rng_fault_state) {
5496 talloc_free(r);
5497 /* Return true here, srv_pipe_hnd.c will take care */
5498 return true;
5501 if (DEBUGLEVEL >= 10) {
5502 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, r);
5505 push = ndr_push_init_ctx(r, NULL);
5506 if (push == NULL) {
5507 talloc_free(r);
5508 return false;
5511 ndr_err = call->ndr_push(push, NDR_OUT, r);
5512 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5513 talloc_free(r);
5514 return false;
5517 blob = ndr_push_blob(push);
5518 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5519 talloc_free(r);
5520 return false;
5523 talloc_free(r);
5525 return true;
5528 static bool api_spoolss_47(pipes_struct *p)
5530 const struct ndr_interface_call *call;
5531 struct ndr_pull *pull;
5532 struct ndr_push *push;
5533 enum ndr_err_code ndr_err;
5534 DATA_BLOB blob;
5535 struct spoolss_47 *r;
5537 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_47];
5539 r = talloc(talloc_tos(), struct spoolss_47);
5540 if (r == NULL) {
5541 return false;
5544 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5545 talloc_free(r);
5546 return false;
5549 pull = ndr_pull_init_blob(&blob, r, NULL);
5550 if (pull == NULL) {
5551 talloc_free(r);
5552 return false;
5555 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5556 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5557 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5558 talloc_free(r);
5559 return false;
5562 if (DEBUGLEVEL >= 10) {
5563 NDR_PRINT_IN_DEBUG(spoolss_47, r);
5566 r->out.result = _spoolss_47(p, r);
5568 if (p->rng_fault_state) {
5569 talloc_free(r);
5570 /* Return true here, srv_pipe_hnd.c will take care */
5571 return true;
5574 if (DEBUGLEVEL >= 10) {
5575 NDR_PRINT_OUT_DEBUG(spoolss_47, r);
5578 push = ndr_push_init_ctx(r, NULL);
5579 if (push == NULL) {
5580 talloc_free(r);
5581 return false;
5584 ndr_err = call->ndr_push(push, NDR_OUT, r);
5585 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5586 talloc_free(r);
5587 return false;
5590 blob = ndr_push_blob(push);
5591 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5592 talloc_free(r);
5593 return false;
5596 talloc_free(r);
5598 return true;
5601 static bool api_spoolss_EnumPrinterData(pipes_struct *p)
5603 const struct ndr_interface_call *call;
5604 struct ndr_pull *pull;
5605 struct ndr_push *push;
5606 enum ndr_err_code ndr_err;
5607 DATA_BLOB blob;
5608 struct spoolss_EnumPrinterData *r;
5610 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTERDATA];
5612 r = talloc(talloc_tos(), struct spoolss_EnumPrinterData);
5613 if (r == NULL) {
5614 return false;
5617 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5618 talloc_free(r);
5619 return false;
5622 pull = ndr_pull_init_blob(&blob, r, NULL);
5623 if (pull == NULL) {
5624 talloc_free(r);
5625 return false;
5628 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5629 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5630 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5631 talloc_free(r);
5632 return false;
5635 if (DEBUGLEVEL >= 10) {
5636 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterData, r);
5639 ZERO_STRUCT(r->out);
5640 r->out.value_name = talloc_zero_array(r, const char, r->in.value_offered / 2);
5641 if (r->out.value_name == NULL) {
5642 talloc_free(r);
5643 return false;
5646 r->out.value_needed = talloc_zero(r, uint32_t);
5647 if (r->out.value_needed == NULL) {
5648 talloc_free(r);
5649 return false;
5652 r->out.printerdata_type = talloc_zero(r, uint32_t);
5653 if (r->out.printerdata_type == NULL) {
5654 talloc_free(r);
5655 return false;
5658 r->out.buffer = talloc_zero(r, DATA_BLOB);
5659 if (r->out.buffer == NULL) {
5660 talloc_free(r);
5661 return false;
5664 r->out.data_needed = talloc_zero(r, uint32_t);
5665 if (r->out.data_needed == NULL) {
5666 talloc_free(r);
5667 return false;
5670 r->out.result = _spoolss_EnumPrinterData(p, r);
5672 if (p->rng_fault_state) {
5673 talloc_free(r);
5674 /* Return true here, srv_pipe_hnd.c will take care */
5675 return true;
5678 if (DEBUGLEVEL >= 10) {
5679 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterData, r);
5682 push = ndr_push_init_ctx(r, NULL);
5683 if (push == NULL) {
5684 talloc_free(r);
5685 return false;
5688 ndr_err = call->ndr_push(push, NDR_OUT, r);
5689 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5690 talloc_free(r);
5691 return false;
5694 blob = ndr_push_blob(push);
5695 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5696 talloc_free(r);
5697 return false;
5700 talloc_free(r);
5702 return true;
5705 static bool api_spoolss_DeletePrinterData(pipes_struct *p)
5707 const struct ndr_interface_call *call;
5708 struct ndr_pull *pull;
5709 struct ndr_push *push;
5710 enum ndr_err_code ndr_err;
5711 DATA_BLOB blob;
5712 struct spoolss_DeletePrinterData *r;
5714 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERDATA];
5716 r = talloc(talloc_tos(), struct spoolss_DeletePrinterData);
5717 if (r == NULL) {
5718 return false;
5721 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5722 talloc_free(r);
5723 return false;
5726 pull = ndr_pull_init_blob(&blob, r, NULL);
5727 if (pull == NULL) {
5728 talloc_free(r);
5729 return false;
5732 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5733 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5734 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5735 talloc_free(r);
5736 return false;
5739 if (DEBUGLEVEL >= 10) {
5740 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterData, r);
5743 r->out.result = _spoolss_DeletePrinterData(p, r);
5745 if (p->rng_fault_state) {
5746 talloc_free(r);
5747 /* Return true here, srv_pipe_hnd.c will take care */
5748 return true;
5751 if (DEBUGLEVEL >= 10) {
5752 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterData, r);
5755 push = ndr_push_init_ctx(r, NULL);
5756 if (push == NULL) {
5757 talloc_free(r);
5758 return false;
5761 ndr_err = call->ndr_push(push, NDR_OUT, r);
5762 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5763 talloc_free(r);
5764 return false;
5767 blob = ndr_push_blob(push);
5768 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5769 talloc_free(r);
5770 return false;
5773 talloc_free(r);
5775 return true;
5778 static bool api_spoolss_4a(pipes_struct *p)
5780 const struct ndr_interface_call *call;
5781 struct ndr_pull *pull;
5782 struct ndr_push *push;
5783 enum ndr_err_code ndr_err;
5784 DATA_BLOB blob;
5785 struct spoolss_4a *r;
5787 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_4A];
5789 r = talloc(talloc_tos(), struct spoolss_4a);
5790 if (r == NULL) {
5791 return false;
5794 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5795 talloc_free(r);
5796 return false;
5799 pull = ndr_pull_init_blob(&blob, r, NULL);
5800 if (pull == NULL) {
5801 talloc_free(r);
5802 return false;
5805 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5806 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5807 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5808 talloc_free(r);
5809 return false;
5812 if (DEBUGLEVEL >= 10) {
5813 NDR_PRINT_IN_DEBUG(spoolss_4a, r);
5816 r->out.result = _spoolss_4a(p, r);
5818 if (p->rng_fault_state) {
5819 talloc_free(r);
5820 /* Return true here, srv_pipe_hnd.c will take care */
5821 return true;
5824 if (DEBUGLEVEL >= 10) {
5825 NDR_PRINT_OUT_DEBUG(spoolss_4a, r);
5828 push = ndr_push_init_ctx(r, NULL);
5829 if (push == NULL) {
5830 talloc_free(r);
5831 return false;
5834 ndr_err = call->ndr_push(push, NDR_OUT, r);
5835 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5836 talloc_free(r);
5837 return false;
5840 blob = ndr_push_blob(push);
5841 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5842 talloc_free(r);
5843 return false;
5846 talloc_free(r);
5848 return true;
5851 static bool api_spoolss_4b(pipes_struct *p)
5853 const struct ndr_interface_call *call;
5854 struct ndr_pull *pull;
5855 struct ndr_push *push;
5856 enum ndr_err_code ndr_err;
5857 DATA_BLOB blob;
5858 struct spoolss_4b *r;
5860 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_4B];
5862 r = talloc(talloc_tos(), struct spoolss_4b);
5863 if (r == NULL) {
5864 return false;
5867 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5868 talloc_free(r);
5869 return false;
5872 pull = ndr_pull_init_blob(&blob, r, NULL);
5873 if (pull == NULL) {
5874 talloc_free(r);
5875 return false;
5878 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5879 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5880 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5881 talloc_free(r);
5882 return false;
5885 if (DEBUGLEVEL >= 10) {
5886 NDR_PRINT_IN_DEBUG(spoolss_4b, r);
5889 r->out.result = _spoolss_4b(p, r);
5891 if (p->rng_fault_state) {
5892 talloc_free(r);
5893 /* Return true here, srv_pipe_hnd.c will take care */
5894 return true;
5897 if (DEBUGLEVEL >= 10) {
5898 NDR_PRINT_OUT_DEBUG(spoolss_4b, r);
5901 push = ndr_push_init_ctx(r, NULL);
5902 if (push == NULL) {
5903 talloc_free(r);
5904 return false;
5907 ndr_err = call->ndr_push(push, NDR_OUT, r);
5908 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5909 talloc_free(r);
5910 return false;
5913 blob = ndr_push_blob(push);
5914 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5915 talloc_free(r);
5916 return false;
5919 talloc_free(r);
5921 return true;
5924 static bool api_spoolss_4c(pipes_struct *p)
5926 const struct ndr_interface_call *call;
5927 struct ndr_pull *pull;
5928 struct ndr_push *push;
5929 enum ndr_err_code ndr_err;
5930 DATA_BLOB blob;
5931 struct spoolss_4c *r;
5933 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_4C];
5935 r = talloc(talloc_tos(), struct spoolss_4c);
5936 if (r == NULL) {
5937 return false;
5940 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5941 talloc_free(r);
5942 return false;
5945 pull = ndr_pull_init_blob(&blob, r, NULL);
5946 if (pull == NULL) {
5947 talloc_free(r);
5948 return false;
5951 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5952 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5953 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5954 talloc_free(r);
5955 return false;
5958 if (DEBUGLEVEL >= 10) {
5959 NDR_PRINT_IN_DEBUG(spoolss_4c, r);
5962 r->out.result = _spoolss_4c(p, r);
5964 if (p->rng_fault_state) {
5965 talloc_free(r);
5966 /* Return true here, srv_pipe_hnd.c will take care */
5967 return true;
5970 if (DEBUGLEVEL >= 10) {
5971 NDR_PRINT_OUT_DEBUG(spoolss_4c, r);
5974 push = ndr_push_init_ctx(r, NULL);
5975 if (push == NULL) {
5976 talloc_free(r);
5977 return false;
5980 ndr_err = call->ndr_push(push, NDR_OUT, r);
5981 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5982 talloc_free(r);
5983 return false;
5986 blob = ndr_push_blob(push);
5987 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5988 talloc_free(r);
5989 return false;
5992 talloc_free(r);
5994 return true;
5997 static bool api_spoolss_SetPrinterDataEx(pipes_struct *p)
5999 const struct ndr_interface_call *call;
6000 struct ndr_pull *pull;
6001 struct ndr_push *push;
6002 enum ndr_err_code ndr_err;
6003 DATA_BLOB blob;
6004 struct spoolss_SetPrinterDataEx *r;
6006 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_SETPRINTERDATAEX];
6008 r = talloc(talloc_tos(), struct spoolss_SetPrinterDataEx);
6009 if (r == NULL) {
6010 return false;
6013 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6014 talloc_free(r);
6015 return false;
6018 pull = ndr_pull_init_blob(&blob, r, NULL);
6019 if (pull == NULL) {
6020 talloc_free(r);
6021 return false;
6024 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6025 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6026 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6027 talloc_free(r);
6028 return false;
6031 if (DEBUGLEVEL >= 10) {
6032 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterDataEx, r);
6035 r->out.result = _spoolss_SetPrinterDataEx(p, r);
6037 if (p->rng_fault_state) {
6038 talloc_free(r);
6039 /* Return true here, srv_pipe_hnd.c will take care */
6040 return true;
6043 if (DEBUGLEVEL >= 10) {
6044 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterDataEx, r);
6047 push = ndr_push_init_ctx(r, NULL);
6048 if (push == NULL) {
6049 talloc_free(r);
6050 return false;
6053 ndr_err = call->ndr_push(push, NDR_OUT, r);
6054 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6055 talloc_free(r);
6056 return false;
6059 blob = ndr_push_blob(push);
6060 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6061 talloc_free(r);
6062 return false;
6065 talloc_free(r);
6067 return true;
6070 static bool api_spoolss_GetPrinterDataEx(pipes_struct *p)
6072 const struct ndr_interface_call *call;
6073 struct ndr_pull *pull;
6074 struct ndr_push *push;
6075 enum ndr_err_code ndr_err;
6076 DATA_BLOB blob;
6077 struct spoolss_GetPrinterDataEx *r;
6079 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETPRINTERDATAEX];
6081 r = talloc(talloc_tos(), struct spoolss_GetPrinterDataEx);
6082 if (r == NULL) {
6083 return false;
6086 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6087 talloc_free(r);
6088 return false;
6091 pull = ndr_pull_init_blob(&blob, r, NULL);
6092 if (pull == NULL) {
6093 talloc_free(r);
6094 return false;
6097 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6098 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6099 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6100 talloc_free(r);
6101 return false;
6104 if (DEBUGLEVEL >= 10) {
6105 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDataEx, r);
6108 ZERO_STRUCT(r->out);
6109 r->out.type = talloc_zero(r, uint32_t);
6110 if (r->out.type == NULL) {
6111 talloc_free(r);
6112 return false;
6115 r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
6116 if (r->out.buffer == NULL) {
6117 talloc_free(r);
6118 return false;
6121 r->out.needed = talloc_zero(r, uint32_t);
6122 if (r->out.needed == NULL) {
6123 talloc_free(r);
6124 return false;
6127 r->out.result = _spoolss_GetPrinterDataEx(p, r);
6129 if (p->rng_fault_state) {
6130 talloc_free(r);
6131 /* Return true here, srv_pipe_hnd.c will take care */
6132 return true;
6135 if (DEBUGLEVEL >= 10) {
6136 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDataEx, r);
6139 push = ndr_push_init_ctx(r, NULL);
6140 if (push == NULL) {
6141 talloc_free(r);
6142 return false;
6145 ndr_err = call->ndr_push(push, NDR_OUT, r);
6146 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6147 talloc_free(r);
6148 return false;
6151 blob = ndr_push_blob(push);
6152 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6153 talloc_free(r);
6154 return false;
6157 talloc_free(r);
6159 return true;
6162 static bool api_spoolss_EnumPrinterDataEx(pipes_struct *p)
6164 const struct ndr_interface_call *call;
6165 struct ndr_pull *pull;
6166 struct ndr_push *push;
6167 enum ndr_err_code ndr_err;
6168 DATA_BLOB blob;
6169 struct spoolss_EnumPrinterDataEx *r;
6171 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTERDATAEX];
6173 r = talloc(talloc_tos(), struct spoolss_EnumPrinterDataEx);
6174 if (r == NULL) {
6175 return false;
6178 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6179 talloc_free(r);
6180 return false;
6183 pull = ndr_pull_init_blob(&blob, r, NULL);
6184 if (pull == NULL) {
6185 talloc_free(r);
6186 return false;
6189 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6190 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6191 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6192 talloc_free(r);
6193 return false;
6196 if (DEBUGLEVEL >= 10) {
6197 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDataEx, r);
6200 ZERO_STRUCT(r->out);
6201 r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
6202 if (r->out.buffer == NULL) {
6203 talloc_free(r);
6204 return false;
6207 r->out.needed = talloc_zero(r, uint32_t);
6208 if (r->out.needed == NULL) {
6209 talloc_free(r);
6210 return false;
6213 r->out.count = talloc_zero(r, uint32_t);
6214 if (r->out.count == NULL) {
6215 talloc_free(r);
6216 return false;
6219 r->out.result = _spoolss_EnumPrinterDataEx(p, r);
6221 if (p->rng_fault_state) {
6222 talloc_free(r);
6223 /* Return true here, srv_pipe_hnd.c will take care */
6224 return true;
6227 if (DEBUGLEVEL >= 10) {
6228 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDataEx, r);
6231 push = ndr_push_init_ctx(r, NULL);
6232 if (push == NULL) {
6233 talloc_free(r);
6234 return false;
6237 ndr_err = call->ndr_push(push, NDR_OUT, r);
6238 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6239 talloc_free(r);
6240 return false;
6243 blob = ndr_push_blob(push);
6244 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6245 talloc_free(r);
6246 return false;
6249 talloc_free(r);
6251 return true;
6254 static bool api_spoolss_EnumPrinterKey(pipes_struct *p)
6256 const struct ndr_interface_call *call;
6257 struct ndr_pull *pull;
6258 struct ndr_push *push;
6259 enum ndr_err_code ndr_err;
6260 DATA_BLOB blob;
6261 struct spoolss_EnumPrinterKey *r;
6263 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ENUMPRINTERKEY];
6265 r = talloc(talloc_tos(), struct spoolss_EnumPrinterKey);
6266 if (r == NULL) {
6267 return false;
6270 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6271 talloc_free(r);
6272 return false;
6275 pull = ndr_pull_init_blob(&blob, r, NULL);
6276 if (pull == NULL) {
6277 talloc_free(r);
6278 return false;
6281 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6282 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6283 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6284 talloc_free(r);
6285 return false;
6288 if (DEBUGLEVEL >= 10) {
6289 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, r);
6292 ZERO_STRUCT(r->out);
6293 r->out.key_buffer = talloc_zero_array(r, uint16_t, r->in.key_buffer_size / 2);
6294 if (r->out.key_buffer == NULL) {
6295 talloc_free(r);
6296 return false;
6299 r->out.needed = talloc_zero(r, uint32_t);
6300 if (r->out.needed == NULL) {
6301 talloc_free(r);
6302 return false;
6305 r->out.result = _spoolss_EnumPrinterKey(p, r);
6307 if (p->rng_fault_state) {
6308 talloc_free(r);
6309 /* Return true here, srv_pipe_hnd.c will take care */
6310 return true;
6313 if (DEBUGLEVEL >= 10) {
6314 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterKey, r);
6317 push = ndr_push_init_ctx(r, NULL);
6318 if (push == NULL) {
6319 talloc_free(r);
6320 return false;
6323 ndr_err = call->ndr_push(push, NDR_OUT, r);
6324 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6325 talloc_free(r);
6326 return false;
6329 blob = ndr_push_blob(push);
6330 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6331 talloc_free(r);
6332 return false;
6335 talloc_free(r);
6337 return true;
6340 static bool api_spoolss_DeletePrinterDataEx(pipes_struct *p)
6342 const struct ndr_interface_call *call;
6343 struct ndr_pull *pull;
6344 struct ndr_push *push;
6345 enum ndr_err_code ndr_err;
6346 DATA_BLOB blob;
6347 struct spoolss_DeletePrinterDataEx *r;
6349 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERDATAEX];
6351 r = talloc(talloc_tos(), struct spoolss_DeletePrinterDataEx);
6352 if (r == NULL) {
6353 return false;
6356 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6357 talloc_free(r);
6358 return false;
6361 pull = ndr_pull_init_blob(&blob, r, NULL);
6362 if (pull == NULL) {
6363 talloc_free(r);
6364 return false;
6367 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6368 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6369 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6370 talloc_free(r);
6371 return false;
6374 if (DEBUGLEVEL >= 10) {
6375 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDataEx, r);
6378 r->out.result = _spoolss_DeletePrinterDataEx(p, r);
6380 if (p->rng_fault_state) {
6381 talloc_free(r);
6382 /* Return true here, srv_pipe_hnd.c will take care */
6383 return true;
6386 if (DEBUGLEVEL >= 10) {
6387 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDataEx, r);
6390 push = ndr_push_init_ctx(r, NULL);
6391 if (push == NULL) {
6392 talloc_free(r);
6393 return false;
6396 ndr_err = call->ndr_push(push, NDR_OUT, r);
6397 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6398 talloc_free(r);
6399 return false;
6402 blob = ndr_push_blob(push);
6403 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6404 talloc_free(r);
6405 return false;
6408 talloc_free(r);
6410 return true;
6413 static bool api_spoolss_DeletePrinterKey(pipes_struct *p)
6415 const struct ndr_interface_call *call;
6416 struct ndr_pull *pull;
6417 struct ndr_push *push;
6418 enum ndr_err_code ndr_err;
6419 DATA_BLOB blob;
6420 struct spoolss_DeletePrinterKey *r;
6422 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERKEY];
6424 r = talloc(talloc_tos(), struct spoolss_DeletePrinterKey);
6425 if (r == NULL) {
6426 return false;
6429 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6430 talloc_free(r);
6431 return false;
6434 pull = ndr_pull_init_blob(&blob, r, NULL);
6435 if (pull == NULL) {
6436 talloc_free(r);
6437 return false;
6440 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6441 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6442 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6443 talloc_free(r);
6444 return false;
6447 if (DEBUGLEVEL >= 10) {
6448 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, r);
6451 r->out.result = _spoolss_DeletePrinterKey(p, r);
6453 if (p->rng_fault_state) {
6454 talloc_free(r);
6455 /* Return true here, srv_pipe_hnd.c will take care */
6456 return true;
6459 if (DEBUGLEVEL >= 10) {
6460 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterKey, r);
6463 push = ndr_push_init_ctx(r, NULL);
6464 if (push == NULL) {
6465 talloc_free(r);
6466 return false;
6469 ndr_err = call->ndr_push(push, NDR_OUT, r);
6470 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6471 talloc_free(r);
6472 return false;
6475 blob = ndr_push_blob(push);
6476 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6477 talloc_free(r);
6478 return false;
6481 talloc_free(r);
6483 return true;
6486 static bool api_spoolss_53(pipes_struct *p)
6488 const struct ndr_interface_call *call;
6489 struct ndr_pull *pull;
6490 struct ndr_push *push;
6491 enum ndr_err_code ndr_err;
6492 DATA_BLOB blob;
6493 struct spoolss_53 *r;
6495 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_53];
6497 r = talloc(talloc_tos(), struct spoolss_53);
6498 if (r == NULL) {
6499 return false;
6502 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6503 talloc_free(r);
6504 return false;
6507 pull = ndr_pull_init_blob(&blob, r, NULL);
6508 if (pull == NULL) {
6509 talloc_free(r);
6510 return false;
6513 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6514 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6515 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6516 talloc_free(r);
6517 return false;
6520 if (DEBUGLEVEL >= 10) {
6521 NDR_PRINT_IN_DEBUG(spoolss_53, r);
6524 r->out.result = _spoolss_53(p, r);
6526 if (p->rng_fault_state) {
6527 talloc_free(r);
6528 /* Return true here, srv_pipe_hnd.c will take care */
6529 return true;
6532 if (DEBUGLEVEL >= 10) {
6533 NDR_PRINT_OUT_DEBUG(spoolss_53, r);
6536 push = ndr_push_init_ctx(r, NULL);
6537 if (push == NULL) {
6538 talloc_free(r);
6539 return false;
6542 ndr_err = call->ndr_push(push, NDR_OUT, r);
6543 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6544 talloc_free(r);
6545 return false;
6548 blob = ndr_push_blob(push);
6549 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6550 talloc_free(r);
6551 return false;
6554 talloc_free(r);
6556 return true;
6559 static bool api_spoolss_DeletePrinterDriverEx(pipes_struct *p)
6561 const struct ndr_interface_call *call;
6562 struct ndr_pull *pull;
6563 struct ndr_push *push;
6564 enum ndr_err_code ndr_err;
6565 DATA_BLOB blob;
6566 struct spoolss_DeletePrinterDriverEx *r;
6568 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_DELETEPRINTERDRIVEREX];
6570 r = talloc(talloc_tos(), struct spoolss_DeletePrinterDriverEx);
6571 if (r == NULL) {
6572 return false;
6575 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6576 talloc_free(r);
6577 return false;
6580 pull = ndr_pull_init_blob(&blob, r, NULL);
6581 if (pull == NULL) {
6582 talloc_free(r);
6583 return false;
6586 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6587 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6588 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6589 talloc_free(r);
6590 return false;
6593 if (DEBUGLEVEL >= 10) {
6594 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, r);
6597 r->out.result = _spoolss_DeletePrinterDriverEx(p, r);
6599 if (p->rng_fault_state) {
6600 talloc_free(r);
6601 /* Return true here, srv_pipe_hnd.c will take care */
6602 return true;
6605 if (DEBUGLEVEL >= 10) {
6606 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriverEx, r);
6609 push = ndr_push_init_ctx(r, NULL);
6610 if (push == NULL) {
6611 talloc_free(r);
6612 return false;
6615 ndr_err = call->ndr_push(push, NDR_OUT, r);
6616 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6617 talloc_free(r);
6618 return false;
6621 blob = ndr_push_blob(push);
6622 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6623 talloc_free(r);
6624 return false;
6627 talloc_free(r);
6629 return true;
6632 static bool api_spoolss_55(pipes_struct *p)
6634 const struct ndr_interface_call *call;
6635 struct ndr_pull *pull;
6636 struct ndr_push *push;
6637 enum ndr_err_code ndr_err;
6638 DATA_BLOB blob;
6639 struct spoolss_55 *r;
6641 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_55];
6643 r = talloc(talloc_tos(), struct spoolss_55);
6644 if (r == NULL) {
6645 return false;
6648 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6649 talloc_free(r);
6650 return false;
6653 pull = ndr_pull_init_blob(&blob, r, NULL);
6654 if (pull == NULL) {
6655 talloc_free(r);
6656 return false;
6659 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6660 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6661 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6662 talloc_free(r);
6663 return false;
6666 if (DEBUGLEVEL >= 10) {
6667 NDR_PRINT_IN_DEBUG(spoolss_55, r);
6670 r->out.result = _spoolss_55(p, r);
6672 if (p->rng_fault_state) {
6673 talloc_free(r);
6674 /* Return true here, srv_pipe_hnd.c will take care */
6675 return true;
6678 if (DEBUGLEVEL >= 10) {
6679 NDR_PRINT_OUT_DEBUG(spoolss_55, r);
6682 push = ndr_push_init_ctx(r, NULL);
6683 if (push == NULL) {
6684 talloc_free(r);
6685 return false;
6688 ndr_err = call->ndr_push(push, NDR_OUT, r);
6689 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6690 talloc_free(r);
6691 return false;
6694 blob = ndr_push_blob(push);
6695 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6696 talloc_free(r);
6697 return false;
6700 talloc_free(r);
6702 return true;
6705 static bool api_spoolss_56(pipes_struct *p)
6707 const struct ndr_interface_call *call;
6708 struct ndr_pull *pull;
6709 struct ndr_push *push;
6710 enum ndr_err_code ndr_err;
6711 DATA_BLOB blob;
6712 struct spoolss_56 *r;
6714 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_56];
6716 r = talloc(talloc_tos(), struct spoolss_56);
6717 if (r == NULL) {
6718 return false;
6721 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6722 talloc_free(r);
6723 return false;
6726 pull = ndr_pull_init_blob(&blob, r, NULL);
6727 if (pull == NULL) {
6728 talloc_free(r);
6729 return false;
6732 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6733 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6734 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6735 talloc_free(r);
6736 return false;
6739 if (DEBUGLEVEL >= 10) {
6740 NDR_PRINT_IN_DEBUG(spoolss_56, r);
6743 r->out.result = _spoolss_56(p, r);
6745 if (p->rng_fault_state) {
6746 talloc_free(r);
6747 /* Return true here, srv_pipe_hnd.c will take care */
6748 return true;
6751 if (DEBUGLEVEL >= 10) {
6752 NDR_PRINT_OUT_DEBUG(spoolss_56, r);
6755 push = ndr_push_init_ctx(r, NULL);
6756 if (push == NULL) {
6757 talloc_free(r);
6758 return false;
6761 ndr_err = call->ndr_push(push, NDR_OUT, r);
6762 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6763 talloc_free(r);
6764 return false;
6767 blob = ndr_push_blob(push);
6768 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6769 talloc_free(r);
6770 return false;
6773 talloc_free(r);
6775 return true;
6778 static bool api_spoolss_57(pipes_struct *p)
6780 const struct ndr_interface_call *call;
6781 struct ndr_pull *pull;
6782 struct ndr_push *push;
6783 enum ndr_err_code ndr_err;
6784 DATA_BLOB blob;
6785 struct spoolss_57 *r;
6787 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_57];
6789 r = talloc(talloc_tos(), struct spoolss_57);
6790 if (r == NULL) {
6791 return false;
6794 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6795 talloc_free(r);
6796 return false;
6799 pull = ndr_pull_init_blob(&blob, r, NULL);
6800 if (pull == NULL) {
6801 talloc_free(r);
6802 return false;
6805 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6806 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6807 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6808 talloc_free(r);
6809 return false;
6812 if (DEBUGLEVEL >= 10) {
6813 NDR_PRINT_IN_DEBUG(spoolss_57, r);
6816 r->out.result = _spoolss_57(p, r);
6818 if (p->rng_fault_state) {
6819 talloc_free(r);
6820 /* Return true here, srv_pipe_hnd.c will take care */
6821 return true;
6824 if (DEBUGLEVEL >= 10) {
6825 NDR_PRINT_OUT_DEBUG(spoolss_57, r);
6828 push = ndr_push_init_ctx(r, NULL);
6829 if (push == NULL) {
6830 talloc_free(r);
6831 return false;
6834 ndr_err = call->ndr_push(push, NDR_OUT, r);
6835 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6836 talloc_free(r);
6837 return false;
6840 blob = ndr_push_blob(push);
6841 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6842 talloc_free(r);
6843 return false;
6846 talloc_free(r);
6848 return true;
6851 static bool api_spoolss_XcvData(pipes_struct *p)
6853 const struct ndr_interface_call *call;
6854 struct ndr_pull *pull;
6855 struct ndr_push *push;
6856 enum ndr_err_code ndr_err;
6857 DATA_BLOB blob;
6858 struct spoolss_XcvData *r;
6860 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_XCVDATA];
6862 r = talloc(talloc_tos(), struct spoolss_XcvData);
6863 if (r == NULL) {
6864 return false;
6867 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6868 talloc_free(r);
6869 return false;
6872 pull = ndr_pull_init_blob(&blob, r, NULL);
6873 if (pull == NULL) {
6874 talloc_free(r);
6875 return false;
6878 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6879 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6880 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6881 talloc_free(r);
6882 return false;
6885 if (DEBUGLEVEL >= 10) {
6886 NDR_PRINT_IN_DEBUG(spoolss_XcvData, r);
6889 ZERO_STRUCT(r->out);
6890 r->out.status_code = r->in.status_code;
6891 r->out.out_data = talloc_zero_array(r, uint8_t, r->in.out_data_size);
6892 if (r->out.out_data == NULL) {
6893 talloc_free(r);
6894 return false;
6897 r->out.needed = talloc_zero(r, uint32_t);
6898 if (r->out.needed == NULL) {
6899 talloc_free(r);
6900 return false;
6903 r->out.result = _spoolss_XcvData(p, r);
6905 if (p->rng_fault_state) {
6906 talloc_free(r);
6907 /* Return true here, srv_pipe_hnd.c will take care */
6908 return true;
6911 if (DEBUGLEVEL >= 10) {
6912 NDR_PRINT_OUT_DEBUG(spoolss_XcvData, r);
6915 push = ndr_push_init_ctx(r, NULL);
6916 if (push == NULL) {
6917 talloc_free(r);
6918 return false;
6921 ndr_err = call->ndr_push(push, NDR_OUT, r);
6922 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6923 talloc_free(r);
6924 return false;
6927 blob = ndr_push_blob(push);
6928 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6929 talloc_free(r);
6930 return false;
6933 talloc_free(r);
6935 return true;
6938 static bool api_spoolss_AddPrinterDriverEx(pipes_struct *p)
6940 const struct ndr_interface_call *call;
6941 struct ndr_pull *pull;
6942 struct ndr_push *push;
6943 enum ndr_err_code ndr_err;
6944 DATA_BLOB blob;
6945 struct spoolss_AddPrinterDriverEx *r;
6947 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ADDPRINTERDRIVEREX];
6949 r = talloc(talloc_tos(), struct spoolss_AddPrinterDriverEx);
6950 if (r == NULL) {
6951 return false;
6954 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6955 talloc_free(r);
6956 return false;
6959 pull = ndr_pull_init_blob(&blob, r, NULL);
6960 if (pull == NULL) {
6961 talloc_free(r);
6962 return false;
6965 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6966 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6967 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6968 talloc_free(r);
6969 return false;
6972 if (DEBUGLEVEL >= 10) {
6973 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriverEx, r);
6976 r->out.result = _spoolss_AddPrinterDriverEx(p, r);
6978 if (p->rng_fault_state) {
6979 talloc_free(r);
6980 /* Return true here, srv_pipe_hnd.c will take care */
6981 return true;
6984 if (DEBUGLEVEL >= 10) {
6985 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriverEx, r);
6988 push = ndr_push_init_ctx(r, NULL);
6989 if (push == NULL) {
6990 talloc_free(r);
6991 return false;
6994 ndr_err = call->ndr_push(push, NDR_OUT, r);
6995 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6996 talloc_free(r);
6997 return false;
7000 blob = ndr_push_blob(push);
7001 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7002 talloc_free(r);
7003 return false;
7006 talloc_free(r);
7008 return true;
7011 static bool api_spoolss_5a(pipes_struct *p)
7013 const struct ndr_interface_call *call;
7014 struct ndr_pull *pull;
7015 struct ndr_push *push;
7016 enum ndr_err_code ndr_err;
7017 DATA_BLOB blob;
7018 struct spoolss_5a *r;
7020 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5A];
7022 r = talloc(talloc_tos(), struct spoolss_5a);
7023 if (r == NULL) {
7024 return false;
7027 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7028 talloc_free(r);
7029 return false;
7032 pull = ndr_pull_init_blob(&blob, r, NULL);
7033 if (pull == NULL) {
7034 talloc_free(r);
7035 return false;
7038 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7039 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7040 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7041 talloc_free(r);
7042 return false;
7045 if (DEBUGLEVEL >= 10) {
7046 NDR_PRINT_IN_DEBUG(spoolss_5a, r);
7049 r->out.result = _spoolss_5a(p, r);
7051 if (p->rng_fault_state) {
7052 talloc_free(r);
7053 /* Return true here, srv_pipe_hnd.c will take care */
7054 return true;
7057 if (DEBUGLEVEL >= 10) {
7058 NDR_PRINT_OUT_DEBUG(spoolss_5a, r);
7061 push = ndr_push_init_ctx(r, NULL);
7062 if (push == NULL) {
7063 talloc_free(r);
7064 return false;
7067 ndr_err = call->ndr_push(push, NDR_OUT, r);
7068 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7069 talloc_free(r);
7070 return false;
7073 blob = ndr_push_blob(push);
7074 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7075 talloc_free(r);
7076 return false;
7079 talloc_free(r);
7081 return true;
7084 static bool api_spoolss_5b(pipes_struct *p)
7086 const struct ndr_interface_call *call;
7087 struct ndr_pull *pull;
7088 struct ndr_push *push;
7089 enum ndr_err_code ndr_err;
7090 DATA_BLOB blob;
7091 struct spoolss_5b *r;
7093 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5B];
7095 r = talloc(talloc_tos(), struct spoolss_5b);
7096 if (r == NULL) {
7097 return false;
7100 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7101 talloc_free(r);
7102 return false;
7105 pull = ndr_pull_init_blob(&blob, r, NULL);
7106 if (pull == NULL) {
7107 talloc_free(r);
7108 return false;
7111 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7112 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7113 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7114 talloc_free(r);
7115 return false;
7118 if (DEBUGLEVEL >= 10) {
7119 NDR_PRINT_IN_DEBUG(spoolss_5b, r);
7122 r->out.result = _spoolss_5b(p, r);
7124 if (p->rng_fault_state) {
7125 talloc_free(r);
7126 /* Return true here, srv_pipe_hnd.c will take care */
7127 return true;
7130 if (DEBUGLEVEL >= 10) {
7131 NDR_PRINT_OUT_DEBUG(spoolss_5b, r);
7134 push = ndr_push_init_ctx(r, NULL);
7135 if (push == NULL) {
7136 talloc_free(r);
7137 return false;
7140 ndr_err = call->ndr_push(push, NDR_OUT, r);
7141 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7142 talloc_free(r);
7143 return false;
7146 blob = ndr_push_blob(push);
7147 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7148 talloc_free(r);
7149 return false;
7152 talloc_free(r);
7154 return true;
7157 static bool api_spoolss_5c(pipes_struct *p)
7159 const struct ndr_interface_call *call;
7160 struct ndr_pull *pull;
7161 struct ndr_push *push;
7162 enum ndr_err_code ndr_err;
7163 DATA_BLOB blob;
7164 struct spoolss_5c *r;
7166 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5C];
7168 r = talloc(talloc_tos(), struct spoolss_5c);
7169 if (r == NULL) {
7170 return false;
7173 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7174 talloc_free(r);
7175 return false;
7178 pull = ndr_pull_init_blob(&blob, r, NULL);
7179 if (pull == NULL) {
7180 talloc_free(r);
7181 return false;
7184 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7185 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7186 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7187 talloc_free(r);
7188 return false;
7191 if (DEBUGLEVEL >= 10) {
7192 NDR_PRINT_IN_DEBUG(spoolss_5c, r);
7195 r->out.result = _spoolss_5c(p, r);
7197 if (p->rng_fault_state) {
7198 talloc_free(r);
7199 /* Return true here, srv_pipe_hnd.c will take care */
7200 return true;
7203 if (DEBUGLEVEL >= 10) {
7204 NDR_PRINT_OUT_DEBUG(spoolss_5c, r);
7207 push = ndr_push_init_ctx(r, NULL);
7208 if (push == NULL) {
7209 talloc_free(r);
7210 return false;
7213 ndr_err = call->ndr_push(push, NDR_OUT, r);
7214 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7215 talloc_free(r);
7216 return false;
7219 blob = ndr_push_blob(push);
7220 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7221 talloc_free(r);
7222 return false;
7225 talloc_free(r);
7227 return true;
7230 static bool api_spoolss_5d(pipes_struct *p)
7232 const struct ndr_interface_call *call;
7233 struct ndr_pull *pull;
7234 struct ndr_push *push;
7235 enum ndr_err_code ndr_err;
7236 DATA_BLOB blob;
7237 struct spoolss_5d *r;
7239 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5D];
7241 r = talloc(talloc_tos(), struct spoolss_5d);
7242 if (r == NULL) {
7243 return false;
7246 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7247 talloc_free(r);
7248 return false;
7251 pull = ndr_pull_init_blob(&blob, r, NULL);
7252 if (pull == NULL) {
7253 talloc_free(r);
7254 return false;
7257 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7258 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7259 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7260 talloc_free(r);
7261 return false;
7264 if (DEBUGLEVEL >= 10) {
7265 NDR_PRINT_IN_DEBUG(spoolss_5d, r);
7268 r->out.result = _spoolss_5d(p, r);
7270 if (p->rng_fault_state) {
7271 talloc_free(r);
7272 /* Return true here, srv_pipe_hnd.c will take care */
7273 return true;
7276 if (DEBUGLEVEL >= 10) {
7277 NDR_PRINT_OUT_DEBUG(spoolss_5d, r);
7280 push = ndr_push_init_ctx(r, NULL);
7281 if (push == NULL) {
7282 talloc_free(r);
7283 return false;
7286 ndr_err = call->ndr_push(push, NDR_OUT, r);
7287 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7288 talloc_free(r);
7289 return false;
7292 blob = ndr_push_blob(push);
7293 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7294 talloc_free(r);
7295 return false;
7298 talloc_free(r);
7300 return true;
7303 static bool api_spoolss_5e(pipes_struct *p)
7305 const struct ndr_interface_call *call;
7306 struct ndr_pull *pull;
7307 struct ndr_push *push;
7308 enum ndr_err_code ndr_err;
7309 DATA_BLOB blob;
7310 struct spoolss_5e *r;
7312 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5E];
7314 r = talloc(talloc_tos(), struct spoolss_5e);
7315 if (r == NULL) {
7316 return false;
7319 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7320 talloc_free(r);
7321 return false;
7324 pull = ndr_pull_init_blob(&blob, r, NULL);
7325 if (pull == NULL) {
7326 talloc_free(r);
7327 return false;
7330 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7331 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7332 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7333 talloc_free(r);
7334 return false;
7337 if (DEBUGLEVEL >= 10) {
7338 NDR_PRINT_IN_DEBUG(spoolss_5e, r);
7341 r->out.result = _spoolss_5e(p, r);
7343 if (p->rng_fault_state) {
7344 talloc_free(r);
7345 /* Return true here, srv_pipe_hnd.c will take care */
7346 return true;
7349 if (DEBUGLEVEL >= 10) {
7350 NDR_PRINT_OUT_DEBUG(spoolss_5e, r);
7353 push = ndr_push_init_ctx(r, NULL);
7354 if (push == NULL) {
7355 talloc_free(r);
7356 return false;
7359 ndr_err = call->ndr_push(push, NDR_OUT, r);
7360 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7361 talloc_free(r);
7362 return false;
7365 blob = ndr_push_blob(push);
7366 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7367 talloc_free(r);
7368 return false;
7371 talloc_free(r);
7373 return true;
7376 static bool api_spoolss_5f(pipes_struct *p)
7378 const struct ndr_interface_call *call;
7379 struct ndr_pull *pull;
7380 struct ndr_push *push;
7381 enum ndr_err_code ndr_err;
7382 DATA_BLOB blob;
7383 struct spoolss_5f *r;
7385 call = &ndr_table_spoolss.calls[NDR_SPOOLSS_5F];
7387 r = talloc(talloc_tos(), struct spoolss_5f);
7388 if (r == NULL) {
7389 return false;
7392 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
7393 talloc_free(r);
7394 return false;
7397 pull = ndr_pull_init_blob(&blob, r, NULL);
7398 if (pull == NULL) {
7399 talloc_free(r);
7400 return false;
7403 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7404 ndr_err = call->ndr_pull(pull, NDR_IN, r);
7405 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7406 talloc_free(r);
7407 return false;
7410 if (DEBUGLEVEL >= 10) {
7411 NDR_PRINT_IN_DEBUG(spoolss_5f, r);
7414 r->out.result = _spoolss_5f(p, r);
7416 if (p->rng_fault_state) {
7417 talloc_free(r);
7418 /* Return true here, srv_pipe_hnd.c will take care */
7419 return true;
7422 if (DEBUGLEVEL >= 10) {
7423 NDR_PRINT_OUT_DEBUG(spoolss_5f, r);
7426 push = ndr_push_init_ctx(r, NULL);
7427 if (push == NULL) {
7428 talloc_free(r);
7429 return false;
7432 ndr_err = call->ndr_push(push, NDR_OUT, r);
7433 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7434 talloc_free(r);
7435 return false;
7438 blob = ndr_push_blob(push);
7439 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
7440 talloc_free(r);
7441 return false;
7444 talloc_free(r);
7446 return true;
7450 /* Tables */
7451 static struct api_struct api_spoolss_cmds[] =
7453 {"SPOOLSS_ENUMPRINTERS", NDR_SPOOLSS_ENUMPRINTERS, api_spoolss_EnumPrinters},
7454 {"SPOOLSS_OPENPRINTER", NDR_SPOOLSS_OPENPRINTER, api_spoolss_OpenPrinter},
7455 {"SPOOLSS_SETJOB", NDR_SPOOLSS_SETJOB, api_spoolss_SetJob},
7456 {"SPOOLSS_GETJOB", NDR_SPOOLSS_GETJOB, api_spoolss_GetJob},
7457 {"SPOOLSS_ENUMJOBS", NDR_SPOOLSS_ENUMJOBS, api_spoolss_EnumJobs},
7458 {"SPOOLSS_ADDPRINTER", NDR_SPOOLSS_ADDPRINTER, api_spoolss_AddPrinter},
7459 {"SPOOLSS_DELETEPRINTER", NDR_SPOOLSS_DELETEPRINTER, api_spoolss_DeletePrinter},
7460 {"SPOOLSS_SETPRINTER", NDR_SPOOLSS_SETPRINTER, api_spoolss_SetPrinter},
7461 {"SPOOLSS_GETPRINTER", NDR_SPOOLSS_GETPRINTER, api_spoolss_GetPrinter},
7462 {"SPOOLSS_ADDPRINTERDRIVER", NDR_SPOOLSS_ADDPRINTERDRIVER, api_spoolss_AddPrinterDriver},
7463 {"SPOOLSS_ENUMPRINTERDRIVERS", NDR_SPOOLSS_ENUMPRINTERDRIVERS, api_spoolss_EnumPrinterDrivers},
7464 {"SPOOLSS_GETPRINTERDRIVER", NDR_SPOOLSS_GETPRINTERDRIVER, api_spoolss_GetPrinterDriver},
7465 {"SPOOLSS_GETPRINTERDRIVERDIRECTORY", NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY, api_spoolss_GetPrinterDriverDirectory},
7466 {"SPOOLSS_DELETEPRINTERDRIVER", NDR_SPOOLSS_DELETEPRINTERDRIVER, api_spoolss_DeletePrinterDriver},
7467 {"SPOOLSS_ADDPRINTPROCESSOR", NDR_SPOOLSS_ADDPRINTPROCESSOR, api_spoolss_AddPrintProcessor},
7468 {"SPOOLSS_ENUMPRINTPROCESSORS", NDR_SPOOLSS_ENUMPRINTPROCESSORS, api_spoolss_EnumPrintProcessors},
7469 {"SPOOLSS_GETPRINTPROCESSORDIRECTORY", NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY, api_spoolss_GetPrintProcessorDirectory},
7470 {"SPOOLSS_STARTDOCPRINTER", NDR_SPOOLSS_STARTDOCPRINTER, api_spoolss_StartDocPrinter},
7471 {"SPOOLSS_STARTPAGEPRINTER", NDR_SPOOLSS_STARTPAGEPRINTER, api_spoolss_StartPagePrinter},
7472 {"SPOOLSS_WRITEPRINTER", NDR_SPOOLSS_WRITEPRINTER, api_spoolss_WritePrinter},
7473 {"SPOOLSS_ENDPAGEPRINTER", NDR_SPOOLSS_ENDPAGEPRINTER, api_spoolss_EndPagePrinter},
7474 {"SPOOLSS_ABORTPRINTER", NDR_SPOOLSS_ABORTPRINTER, api_spoolss_AbortPrinter},
7475 {"SPOOLSS_READPRINTER", NDR_SPOOLSS_READPRINTER, api_spoolss_ReadPrinter},
7476 {"SPOOLSS_ENDDOCPRINTER", NDR_SPOOLSS_ENDDOCPRINTER, api_spoolss_EndDocPrinter},
7477 {"SPOOLSS_ADDJOB", NDR_SPOOLSS_ADDJOB, api_spoolss_AddJob},
7478 {"SPOOLSS_SCHEDULEJOB", NDR_SPOOLSS_SCHEDULEJOB, api_spoolss_ScheduleJob},
7479 {"SPOOLSS_GETPRINTERDATA", NDR_SPOOLSS_GETPRINTERDATA, api_spoolss_GetPrinterData},
7480 {"SPOOLSS_SETPRINTERDATA", NDR_SPOOLSS_SETPRINTERDATA, api_spoolss_SetPrinterData},
7481 {"SPOOLSS_WAITFORPRINTERCHANGE", NDR_SPOOLSS_WAITFORPRINTERCHANGE, api_spoolss_WaitForPrinterChange},
7482 {"SPOOLSS_CLOSEPRINTER", NDR_SPOOLSS_CLOSEPRINTER, api_spoolss_ClosePrinter},
7483 {"SPOOLSS_ADDFORM", NDR_SPOOLSS_ADDFORM, api_spoolss_AddForm},
7484 {"SPOOLSS_DELETEFORM", NDR_SPOOLSS_DELETEFORM, api_spoolss_DeleteForm},
7485 {"SPOOLSS_GETFORM", NDR_SPOOLSS_GETFORM, api_spoolss_GetForm},
7486 {"SPOOLSS_SETFORM", NDR_SPOOLSS_SETFORM, api_spoolss_SetForm},
7487 {"SPOOLSS_ENUMFORMS", NDR_SPOOLSS_ENUMFORMS, api_spoolss_EnumForms},
7488 {"SPOOLSS_ENUMPORTS", NDR_SPOOLSS_ENUMPORTS, api_spoolss_EnumPorts},
7489 {"SPOOLSS_ENUMMONITORS", NDR_SPOOLSS_ENUMMONITORS, api_spoolss_EnumMonitors},
7490 {"SPOOLSS_ADDPORT", NDR_SPOOLSS_ADDPORT, api_spoolss_AddPort},
7491 {"SPOOLSS_CONFIGUREPORT", NDR_SPOOLSS_CONFIGUREPORT, api_spoolss_ConfigurePort},
7492 {"SPOOLSS_DELETEPORT", NDR_SPOOLSS_DELETEPORT, api_spoolss_DeletePort},
7493 {"SPOOLSS_CREATEPRINTERIC", NDR_SPOOLSS_CREATEPRINTERIC, api_spoolss_CreatePrinterIC},
7494 {"SPOOLSS_PLAYGDISCRIPTONPRINTERIC", NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC, api_spoolss_PlayGDIScriptOnPrinterIC},
7495 {"SPOOLSS_DELETEPRINTERIC", NDR_SPOOLSS_DELETEPRINTERIC, api_spoolss_DeletePrinterIC},
7496 {"SPOOLSS_ADDPRINTERCONNECTION", NDR_SPOOLSS_ADDPRINTERCONNECTION, api_spoolss_AddPrinterConnection},
7497 {"SPOOLSS_DELETEPRINTERCONNECTION", NDR_SPOOLSS_DELETEPRINTERCONNECTION, api_spoolss_DeletePrinterConnection},
7498 {"SPOOLSS_PRINTERMESSAGEBOX", NDR_SPOOLSS_PRINTERMESSAGEBOX, api_spoolss_PrinterMessageBox},
7499 {"SPOOLSS_ADDMONITOR", NDR_SPOOLSS_ADDMONITOR, api_spoolss_AddMonitor},
7500 {"SPOOLSS_DELETEMONITOR", NDR_SPOOLSS_DELETEMONITOR, api_spoolss_DeleteMonitor},
7501 {"SPOOLSS_DELETEPRINTPROCESSOR", NDR_SPOOLSS_DELETEPRINTPROCESSOR, api_spoolss_DeletePrintProcessor},
7502 {"SPOOLSS_ADDPRINTPROVIDOR", NDR_SPOOLSS_ADDPRINTPROVIDOR, api_spoolss_AddPrintProvidor},
7503 {"SPOOLSS_DELETEPRINTPROVIDOR", NDR_SPOOLSS_DELETEPRINTPROVIDOR, api_spoolss_DeletePrintProvidor},
7504 {"SPOOLSS_ENUMPRINTPROCDATATYPES", NDR_SPOOLSS_ENUMPRINTPROCDATATYPES, api_spoolss_EnumPrintProcDataTypes},
7505 {"SPOOLSS_RESETPRINTER", NDR_SPOOLSS_RESETPRINTER, api_spoolss_ResetPrinter},
7506 {"SPOOLSS_GETPRINTERDRIVER2", NDR_SPOOLSS_GETPRINTERDRIVER2, api_spoolss_GetPrinterDriver2},
7507 {"SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION, api_spoolss_FindFirstPrinterChangeNotification},
7508 {"SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION, api_spoolss_FindNextPrinterChangeNotification},
7509 {"SPOOLSS_FINDCLOSEPRINTERNOTIFY", NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY, api_spoolss_FindClosePrinterNotify},
7510 {"SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD", NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD, api_spoolss_RouterFindFirstPrinterChangeNotificationOld},
7511 {"SPOOLSS_REPLYOPENPRINTER", NDR_SPOOLSS_REPLYOPENPRINTER, api_spoolss_ReplyOpenPrinter},
7512 {"SPOOLSS_ROUTERREPLYPRINTER", NDR_SPOOLSS_ROUTERREPLYPRINTER, api_spoolss_RouterReplyPrinter},
7513 {"SPOOLSS_REPLYCLOSEPRINTER", NDR_SPOOLSS_REPLYCLOSEPRINTER, api_spoolss_ReplyClosePrinter},
7514 {"SPOOLSS_ADDPORTEX", NDR_SPOOLSS_ADDPORTEX, api_spoolss_AddPortEx},
7515 {"SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION, api_spoolss_RouterFindFirstPrinterChangeNotification},
7516 {"SPOOLSS_SPOOLERINIT", NDR_SPOOLSS_SPOOLERINIT, api_spoolss_SpoolerInit},
7517 {"SPOOLSS_RESETPRINTEREX", NDR_SPOOLSS_RESETPRINTEREX, api_spoolss_ResetPrinterEx},
7518 {"SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX", NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX, api_spoolss_RemoteFindFirstPrinterChangeNotifyEx},
7519 {"SPOOLSS_ROUTERREPLYPRINTEREX", NDR_SPOOLSS_ROUTERREPLYPRINTEREX, api_spoolss_RouterReplyPrinterEx},
7520 {"SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY", NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY, api_spoolss_RouterRefreshPrinterChangeNotify},
7521 {"SPOOLSS_44", NDR_SPOOLSS_44, api_spoolss_44},
7522 {"SPOOLSS_OPENPRINTEREX", NDR_SPOOLSS_OPENPRINTEREX, api_spoolss_OpenPrinterEx},
7523 {"SPOOLSS_ADDPRINTEREX", NDR_SPOOLSS_ADDPRINTEREX, api_spoolss_AddPrinterEx},
7524 {"SPOOLSS_47", NDR_SPOOLSS_47, api_spoolss_47},
7525 {"SPOOLSS_ENUMPRINTERDATA", NDR_SPOOLSS_ENUMPRINTERDATA, api_spoolss_EnumPrinterData},
7526 {"SPOOLSS_DELETEPRINTERDATA", NDR_SPOOLSS_DELETEPRINTERDATA, api_spoolss_DeletePrinterData},
7527 {"SPOOLSS_4A", NDR_SPOOLSS_4A, api_spoolss_4a},
7528 {"SPOOLSS_4B", NDR_SPOOLSS_4B, api_spoolss_4b},
7529 {"SPOOLSS_4C", NDR_SPOOLSS_4C, api_spoolss_4c},
7530 {"SPOOLSS_SETPRINTERDATAEX", NDR_SPOOLSS_SETPRINTERDATAEX, api_spoolss_SetPrinterDataEx},
7531 {"SPOOLSS_GETPRINTERDATAEX", NDR_SPOOLSS_GETPRINTERDATAEX, api_spoolss_GetPrinterDataEx},
7532 {"SPOOLSS_ENUMPRINTERDATAEX", NDR_SPOOLSS_ENUMPRINTERDATAEX, api_spoolss_EnumPrinterDataEx},
7533 {"SPOOLSS_ENUMPRINTERKEY", NDR_SPOOLSS_ENUMPRINTERKEY, api_spoolss_EnumPrinterKey},
7534 {"SPOOLSS_DELETEPRINTERDATAEX", NDR_SPOOLSS_DELETEPRINTERDATAEX, api_spoolss_DeletePrinterDataEx},
7535 {"SPOOLSS_DELETEPRINTERKEY", NDR_SPOOLSS_DELETEPRINTERKEY, api_spoolss_DeletePrinterKey},
7536 {"SPOOLSS_53", NDR_SPOOLSS_53, api_spoolss_53},
7537 {"SPOOLSS_DELETEPRINTERDRIVEREX", NDR_SPOOLSS_DELETEPRINTERDRIVEREX, api_spoolss_DeletePrinterDriverEx},
7538 {"SPOOLSS_55", NDR_SPOOLSS_55, api_spoolss_55},
7539 {"SPOOLSS_56", NDR_SPOOLSS_56, api_spoolss_56},
7540 {"SPOOLSS_57", NDR_SPOOLSS_57, api_spoolss_57},
7541 {"SPOOLSS_XCVDATA", NDR_SPOOLSS_XCVDATA, api_spoolss_XcvData},
7542 {"SPOOLSS_ADDPRINTERDRIVEREX", NDR_SPOOLSS_ADDPRINTERDRIVEREX, api_spoolss_AddPrinterDriverEx},
7543 {"SPOOLSS_5A", NDR_SPOOLSS_5A, api_spoolss_5a},
7544 {"SPOOLSS_5B", NDR_SPOOLSS_5B, api_spoolss_5b},
7545 {"SPOOLSS_5C", NDR_SPOOLSS_5C, api_spoolss_5c},
7546 {"SPOOLSS_5D", NDR_SPOOLSS_5D, api_spoolss_5d},
7547 {"SPOOLSS_5E", NDR_SPOOLSS_5E, api_spoolss_5e},
7548 {"SPOOLSS_5F", NDR_SPOOLSS_5F, api_spoolss_5f},
7551 void spoolss_get_pipe_fns(struct api_struct **fns, int *n_fns)
7553 *fns = api_spoolss_cmds;
7554 *n_fns = sizeof(api_spoolss_cmds) / sizeof(struct api_struct);
7557 NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
7559 if (cli->pipes_struct == NULL) {
7560 return NT_STATUS_INVALID_PARAMETER;
7563 switch (opnum)
7565 case NDR_SPOOLSS_ENUMPRINTERS: {
7566 struct spoolss_EnumPrinters *r = (struct spoolss_EnumPrinters *)_r;
7567 ZERO_STRUCT(r->out);
7568 r->out.count = talloc_zero(mem_ctx, uint32_t);
7569 if (r->out.count == NULL) {
7570 return NT_STATUS_NO_MEMORY;
7573 r->out.info = talloc_zero(mem_ctx, union spoolss_PrinterInfo *);
7574 if (r->out.info == NULL) {
7575 return NT_STATUS_NO_MEMORY;
7578 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7579 if (r->out.needed == NULL) {
7580 return NT_STATUS_NO_MEMORY;
7583 r->out.result = _spoolss_EnumPrinters(cli->pipes_struct, r);
7584 return NT_STATUS_OK;
7587 case NDR_SPOOLSS_OPENPRINTER: {
7588 struct spoolss_OpenPrinter *r = (struct spoolss_OpenPrinter *)_r;
7589 ZERO_STRUCT(r->out);
7590 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
7591 if (r->out.handle == NULL) {
7592 return NT_STATUS_NO_MEMORY;
7595 r->out.result = _spoolss_OpenPrinter(cli->pipes_struct, r);
7596 return NT_STATUS_OK;
7599 case NDR_SPOOLSS_SETJOB: {
7600 struct spoolss_SetJob *r = (struct spoolss_SetJob *)_r;
7601 r->out.result = _spoolss_SetJob(cli->pipes_struct, r);
7602 return NT_STATUS_OK;
7605 case NDR_SPOOLSS_GETJOB: {
7606 struct spoolss_GetJob *r = (struct spoolss_GetJob *)_r;
7607 ZERO_STRUCT(r->out);
7608 r->out.info = talloc_zero(mem_ctx, union spoolss_JobInfo);
7609 if (r->out.info == NULL) {
7610 return NT_STATUS_NO_MEMORY;
7613 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7614 if (r->out.needed == NULL) {
7615 return NT_STATUS_NO_MEMORY;
7618 r->out.result = _spoolss_GetJob(cli->pipes_struct, r);
7619 return NT_STATUS_OK;
7622 case NDR_SPOOLSS_ENUMJOBS: {
7623 struct spoolss_EnumJobs *r = (struct spoolss_EnumJobs *)_r;
7624 ZERO_STRUCT(r->out);
7625 r->out.count = talloc_zero(mem_ctx, uint32_t);
7626 if (r->out.count == NULL) {
7627 return NT_STATUS_NO_MEMORY;
7630 r->out.info = talloc_zero(mem_ctx, union spoolss_JobInfo *);
7631 if (r->out.info == NULL) {
7632 return NT_STATUS_NO_MEMORY;
7635 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7636 if (r->out.needed == NULL) {
7637 return NT_STATUS_NO_MEMORY;
7640 r->out.result = _spoolss_EnumJobs(cli->pipes_struct, r);
7641 return NT_STATUS_OK;
7644 case NDR_SPOOLSS_ADDPRINTER: {
7645 struct spoolss_AddPrinter *r = (struct spoolss_AddPrinter *)_r;
7646 r->out.result = _spoolss_AddPrinter(cli->pipes_struct, r);
7647 return NT_STATUS_OK;
7650 case NDR_SPOOLSS_DELETEPRINTER: {
7651 struct spoolss_DeletePrinter *r = (struct spoolss_DeletePrinter *)_r;
7652 r->out.result = _spoolss_DeletePrinter(cli->pipes_struct, r);
7653 return NT_STATUS_OK;
7656 case NDR_SPOOLSS_SETPRINTER: {
7657 struct spoolss_SetPrinter *r = (struct spoolss_SetPrinter *)_r;
7658 r->out.result = _spoolss_SetPrinter(cli->pipes_struct, r);
7659 return NT_STATUS_OK;
7662 case NDR_SPOOLSS_GETPRINTER: {
7663 struct spoolss_GetPrinter *r = (struct spoolss_GetPrinter *)_r;
7664 ZERO_STRUCT(r->out);
7665 r->out.info = talloc_zero(mem_ctx, union spoolss_PrinterInfo);
7666 if (r->out.info == NULL) {
7667 return NT_STATUS_NO_MEMORY;
7670 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7671 if (r->out.needed == NULL) {
7672 return NT_STATUS_NO_MEMORY;
7675 r->out.result = _spoolss_GetPrinter(cli->pipes_struct, r);
7676 return NT_STATUS_OK;
7679 case NDR_SPOOLSS_ADDPRINTERDRIVER: {
7680 struct spoolss_AddPrinterDriver *r = (struct spoolss_AddPrinterDriver *)_r;
7681 r->out.result = _spoolss_AddPrinterDriver(cli->pipes_struct, r);
7682 return NT_STATUS_OK;
7685 case NDR_SPOOLSS_ENUMPRINTERDRIVERS: {
7686 struct spoolss_EnumPrinterDrivers *r = (struct spoolss_EnumPrinterDrivers *)_r;
7687 ZERO_STRUCT(r->out);
7688 r->out.count = talloc_zero(mem_ctx, uint32_t);
7689 if (r->out.count == NULL) {
7690 return NT_STATUS_NO_MEMORY;
7693 r->out.info = talloc_zero(mem_ctx, union spoolss_DriverInfo *);
7694 if (r->out.info == NULL) {
7695 return NT_STATUS_NO_MEMORY;
7698 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7699 if (r->out.needed == NULL) {
7700 return NT_STATUS_NO_MEMORY;
7703 r->out.result = _spoolss_EnumPrinterDrivers(cli->pipes_struct, r);
7704 return NT_STATUS_OK;
7707 case NDR_SPOOLSS_GETPRINTERDRIVER: {
7708 struct spoolss_GetPrinterDriver *r = (struct spoolss_GetPrinterDriver *)_r;
7709 r->out.result = _spoolss_GetPrinterDriver(cli->pipes_struct, r);
7710 return NT_STATUS_OK;
7713 case NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY: {
7714 struct spoolss_GetPrinterDriverDirectory *r = (struct spoolss_GetPrinterDriverDirectory *)_r;
7715 ZERO_STRUCT(r->out);
7716 r->out.info = talloc_zero(mem_ctx, union spoolss_DriverDirectoryInfo);
7717 if (r->out.info == NULL) {
7718 return NT_STATUS_NO_MEMORY;
7721 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7722 if (r->out.needed == NULL) {
7723 return NT_STATUS_NO_MEMORY;
7726 r->out.result = _spoolss_GetPrinterDriverDirectory(cli->pipes_struct, r);
7727 return NT_STATUS_OK;
7730 case NDR_SPOOLSS_DELETEPRINTERDRIVER: {
7731 struct spoolss_DeletePrinterDriver *r = (struct spoolss_DeletePrinterDriver *)_r;
7732 r->out.result = _spoolss_DeletePrinterDriver(cli->pipes_struct, r);
7733 return NT_STATUS_OK;
7736 case NDR_SPOOLSS_ADDPRINTPROCESSOR: {
7737 struct spoolss_AddPrintProcessor *r = (struct spoolss_AddPrintProcessor *)_r;
7738 r->out.result = _spoolss_AddPrintProcessor(cli->pipes_struct, r);
7739 return NT_STATUS_OK;
7742 case NDR_SPOOLSS_ENUMPRINTPROCESSORS: {
7743 struct spoolss_EnumPrintProcessors *r = (struct spoolss_EnumPrintProcessors *)_r;
7744 ZERO_STRUCT(r->out);
7745 r->out.count = talloc_zero(mem_ctx, uint32_t);
7746 if (r->out.count == NULL) {
7747 return NT_STATUS_NO_MEMORY;
7750 r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcessorInfo *);
7751 if (r->out.info == NULL) {
7752 return NT_STATUS_NO_MEMORY;
7755 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7756 if (r->out.needed == NULL) {
7757 return NT_STATUS_NO_MEMORY;
7760 r->out.result = _spoolss_EnumPrintProcessors(cli->pipes_struct, r);
7761 return NT_STATUS_OK;
7764 case NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY: {
7765 struct spoolss_GetPrintProcessorDirectory *r = (struct spoolss_GetPrintProcessorDirectory *)_r;
7766 ZERO_STRUCT(r->out);
7767 r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcessorDirectoryInfo);
7768 if (r->out.info == NULL) {
7769 return NT_STATUS_NO_MEMORY;
7772 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7773 if (r->out.needed == NULL) {
7774 return NT_STATUS_NO_MEMORY;
7777 r->out.result = _spoolss_GetPrintProcessorDirectory(cli->pipes_struct, r);
7778 return NT_STATUS_OK;
7781 case NDR_SPOOLSS_STARTDOCPRINTER: {
7782 struct spoolss_StartDocPrinter *r = (struct spoolss_StartDocPrinter *)_r;
7783 ZERO_STRUCT(r->out);
7784 r->out.job_id = talloc_zero(mem_ctx, uint32_t);
7785 if (r->out.job_id == NULL) {
7786 return NT_STATUS_NO_MEMORY;
7789 r->out.result = _spoolss_StartDocPrinter(cli->pipes_struct, r);
7790 return NT_STATUS_OK;
7793 case NDR_SPOOLSS_STARTPAGEPRINTER: {
7794 struct spoolss_StartPagePrinter *r = (struct spoolss_StartPagePrinter *)_r;
7795 r->out.result = _spoolss_StartPagePrinter(cli->pipes_struct, r);
7796 return NT_STATUS_OK;
7799 case NDR_SPOOLSS_WRITEPRINTER: {
7800 struct spoolss_WritePrinter *r = (struct spoolss_WritePrinter *)_r;
7801 ZERO_STRUCT(r->out);
7802 r->out.num_written = talloc_zero(mem_ctx, uint32_t);
7803 if (r->out.num_written == NULL) {
7804 return NT_STATUS_NO_MEMORY;
7807 r->out.result = _spoolss_WritePrinter(cli->pipes_struct, r);
7808 return NT_STATUS_OK;
7811 case NDR_SPOOLSS_ENDPAGEPRINTER: {
7812 struct spoolss_EndPagePrinter *r = (struct spoolss_EndPagePrinter *)_r;
7813 r->out.result = _spoolss_EndPagePrinter(cli->pipes_struct, r);
7814 return NT_STATUS_OK;
7817 case NDR_SPOOLSS_ABORTPRINTER: {
7818 struct spoolss_AbortPrinter *r = (struct spoolss_AbortPrinter *)_r;
7819 r->out.result = _spoolss_AbortPrinter(cli->pipes_struct, r);
7820 return NT_STATUS_OK;
7823 case NDR_SPOOLSS_READPRINTER: {
7824 struct spoolss_ReadPrinter *r = (struct spoolss_ReadPrinter *)_r;
7825 ZERO_STRUCT(r->out);
7826 r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.data_size);
7827 if (r->out.data == NULL) {
7828 return NT_STATUS_NO_MEMORY;
7831 r->out._data_size = talloc_zero(mem_ctx, uint32_t);
7832 if (r->out._data_size == NULL) {
7833 return NT_STATUS_NO_MEMORY;
7836 r->out.result = _spoolss_ReadPrinter(cli->pipes_struct, r);
7837 return NT_STATUS_OK;
7840 case NDR_SPOOLSS_ENDDOCPRINTER: {
7841 struct spoolss_EndDocPrinter *r = (struct spoolss_EndDocPrinter *)_r;
7842 r->out.result = _spoolss_EndDocPrinter(cli->pipes_struct, r);
7843 return NT_STATUS_OK;
7846 case NDR_SPOOLSS_ADDJOB: {
7847 struct spoolss_AddJob *r = (struct spoolss_AddJob *)_r;
7848 ZERO_STRUCT(r->out);
7849 r->out.buffer = r->in.buffer;
7850 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7851 if (r->out.needed == NULL) {
7852 return NT_STATUS_NO_MEMORY;
7855 r->out.result = _spoolss_AddJob(cli->pipes_struct, r);
7856 return NT_STATUS_OK;
7859 case NDR_SPOOLSS_SCHEDULEJOB: {
7860 struct spoolss_ScheduleJob *r = (struct spoolss_ScheduleJob *)_r;
7861 r->out.result = _spoolss_ScheduleJob(cli->pipes_struct, r);
7862 return NT_STATUS_OK;
7865 case NDR_SPOOLSS_GETPRINTERDATA: {
7866 struct spoolss_GetPrinterData *r = (struct spoolss_GetPrinterData *)_r;
7867 ZERO_STRUCT(r->out);
7868 r->out.type = talloc_zero(mem_ctx, enum spoolss_PrinterDataType);
7869 if (r->out.type == NULL) {
7870 return NT_STATUS_NO_MEMORY;
7873 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7874 if (r->out.needed == NULL) {
7875 return NT_STATUS_NO_MEMORY;
7878 r->out.result = _spoolss_GetPrinterData(cli->pipes_struct, r);
7879 return NT_STATUS_OK;
7882 case NDR_SPOOLSS_SETPRINTERDATA: {
7883 struct spoolss_SetPrinterData *r = (struct spoolss_SetPrinterData *)_r;
7884 r->out.result = _spoolss_SetPrinterData(cli->pipes_struct, r);
7885 return NT_STATUS_OK;
7888 case NDR_SPOOLSS_WAITFORPRINTERCHANGE: {
7889 struct spoolss_WaitForPrinterChange *r = (struct spoolss_WaitForPrinterChange *)_r;
7890 r->out.result = _spoolss_WaitForPrinterChange(cli->pipes_struct, r);
7891 return NT_STATUS_OK;
7894 case NDR_SPOOLSS_CLOSEPRINTER: {
7895 struct spoolss_ClosePrinter *r = (struct spoolss_ClosePrinter *)_r;
7896 ZERO_STRUCT(r->out);
7897 r->out.handle = r->in.handle;
7898 r->out.result = _spoolss_ClosePrinter(cli->pipes_struct, r);
7899 return NT_STATUS_OK;
7902 case NDR_SPOOLSS_ADDFORM: {
7903 struct spoolss_AddForm *r = (struct spoolss_AddForm *)_r;
7904 r->out.result = _spoolss_AddForm(cli->pipes_struct, r);
7905 return NT_STATUS_OK;
7908 case NDR_SPOOLSS_DELETEFORM: {
7909 struct spoolss_DeleteForm *r = (struct spoolss_DeleteForm *)_r;
7910 r->out.result = _spoolss_DeleteForm(cli->pipes_struct, r);
7911 return NT_STATUS_OK;
7914 case NDR_SPOOLSS_GETFORM: {
7915 struct spoolss_GetForm *r = (struct spoolss_GetForm *)_r;
7916 ZERO_STRUCT(r->out);
7917 r->out.info = talloc_zero(mem_ctx, union spoolss_FormInfo);
7918 if (r->out.info == NULL) {
7919 return NT_STATUS_NO_MEMORY;
7922 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7923 if (r->out.needed == NULL) {
7924 return NT_STATUS_NO_MEMORY;
7927 r->out.result = _spoolss_GetForm(cli->pipes_struct, r);
7928 return NT_STATUS_OK;
7931 case NDR_SPOOLSS_SETFORM: {
7932 struct spoolss_SetForm *r = (struct spoolss_SetForm *)_r;
7933 r->out.result = _spoolss_SetForm(cli->pipes_struct, r);
7934 return NT_STATUS_OK;
7937 case NDR_SPOOLSS_ENUMFORMS: {
7938 struct spoolss_EnumForms *r = (struct spoolss_EnumForms *)_r;
7939 ZERO_STRUCT(r->out);
7940 r->out.count = talloc_zero(mem_ctx, uint32_t);
7941 if (r->out.count == NULL) {
7942 return NT_STATUS_NO_MEMORY;
7945 r->out.info = talloc_zero(mem_ctx, union spoolss_FormInfo *);
7946 if (r->out.info == NULL) {
7947 return NT_STATUS_NO_MEMORY;
7950 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7951 if (r->out.needed == NULL) {
7952 return NT_STATUS_NO_MEMORY;
7955 r->out.result = _spoolss_EnumForms(cli->pipes_struct, r);
7956 return NT_STATUS_OK;
7959 case NDR_SPOOLSS_ENUMPORTS: {
7960 struct spoolss_EnumPorts *r = (struct spoolss_EnumPorts *)_r;
7961 ZERO_STRUCT(r->out);
7962 r->out.count = talloc_zero(mem_ctx, uint32_t);
7963 if (r->out.count == NULL) {
7964 return NT_STATUS_NO_MEMORY;
7967 r->out.info = talloc_zero(mem_ctx, union spoolss_PortInfo *);
7968 if (r->out.info == NULL) {
7969 return NT_STATUS_NO_MEMORY;
7972 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7973 if (r->out.needed == NULL) {
7974 return NT_STATUS_NO_MEMORY;
7977 r->out.result = _spoolss_EnumPorts(cli->pipes_struct, r);
7978 return NT_STATUS_OK;
7981 case NDR_SPOOLSS_ENUMMONITORS: {
7982 struct spoolss_EnumMonitors *r = (struct spoolss_EnumMonitors *)_r;
7983 ZERO_STRUCT(r->out);
7984 r->out.count = talloc_zero(mem_ctx, uint32_t);
7985 if (r->out.count == NULL) {
7986 return NT_STATUS_NO_MEMORY;
7989 r->out.info = talloc_zero(mem_ctx, union spoolss_MonitorInfo *);
7990 if (r->out.info == NULL) {
7991 return NT_STATUS_NO_MEMORY;
7994 r->out.needed = talloc_zero(mem_ctx, uint32_t);
7995 if (r->out.needed == NULL) {
7996 return NT_STATUS_NO_MEMORY;
7999 r->out.result = _spoolss_EnumMonitors(cli->pipes_struct, r);
8000 return NT_STATUS_OK;
8003 case NDR_SPOOLSS_ADDPORT: {
8004 struct spoolss_AddPort *r = (struct spoolss_AddPort *)_r;
8005 r->out.result = _spoolss_AddPort(cli->pipes_struct, r);
8006 return NT_STATUS_OK;
8009 case NDR_SPOOLSS_CONFIGUREPORT: {
8010 struct spoolss_ConfigurePort *r = (struct spoolss_ConfigurePort *)_r;
8011 r->out.result = _spoolss_ConfigurePort(cli->pipes_struct, r);
8012 return NT_STATUS_OK;
8015 case NDR_SPOOLSS_DELETEPORT: {
8016 struct spoolss_DeletePort *r = (struct spoolss_DeletePort *)_r;
8017 r->out.result = _spoolss_DeletePort(cli->pipes_struct, r);
8018 return NT_STATUS_OK;
8021 case NDR_SPOOLSS_CREATEPRINTERIC: {
8022 struct spoolss_CreatePrinterIC *r = (struct spoolss_CreatePrinterIC *)_r;
8023 r->out.result = _spoolss_CreatePrinterIC(cli->pipes_struct, r);
8024 return NT_STATUS_OK;
8027 case NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC: {
8028 struct spoolss_PlayGDIScriptOnPrinterIC *r = (struct spoolss_PlayGDIScriptOnPrinterIC *)_r;
8029 r->out.result = _spoolss_PlayGDIScriptOnPrinterIC(cli->pipes_struct, r);
8030 return NT_STATUS_OK;
8033 case NDR_SPOOLSS_DELETEPRINTERIC: {
8034 struct spoolss_DeletePrinterIC *r = (struct spoolss_DeletePrinterIC *)_r;
8035 r->out.result = _spoolss_DeletePrinterIC(cli->pipes_struct, r);
8036 return NT_STATUS_OK;
8039 case NDR_SPOOLSS_ADDPRINTERCONNECTION: {
8040 struct spoolss_AddPrinterConnection *r = (struct spoolss_AddPrinterConnection *)_r;
8041 r->out.result = _spoolss_AddPrinterConnection(cli->pipes_struct, r);
8042 return NT_STATUS_OK;
8045 case NDR_SPOOLSS_DELETEPRINTERCONNECTION: {
8046 struct spoolss_DeletePrinterConnection *r = (struct spoolss_DeletePrinterConnection *)_r;
8047 r->out.result = _spoolss_DeletePrinterConnection(cli->pipes_struct, r);
8048 return NT_STATUS_OK;
8051 case NDR_SPOOLSS_PRINTERMESSAGEBOX: {
8052 struct spoolss_PrinterMessageBox *r = (struct spoolss_PrinterMessageBox *)_r;
8053 r->out.result = _spoolss_PrinterMessageBox(cli->pipes_struct, r);
8054 return NT_STATUS_OK;
8057 case NDR_SPOOLSS_ADDMONITOR: {
8058 struct spoolss_AddMonitor *r = (struct spoolss_AddMonitor *)_r;
8059 r->out.result = _spoolss_AddMonitor(cli->pipes_struct, r);
8060 return NT_STATUS_OK;
8063 case NDR_SPOOLSS_DELETEMONITOR: {
8064 struct spoolss_DeleteMonitor *r = (struct spoolss_DeleteMonitor *)_r;
8065 r->out.result = _spoolss_DeleteMonitor(cli->pipes_struct, r);
8066 return NT_STATUS_OK;
8069 case NDR_SPOOLSS_DELETEPRINTPROCESSOR: {
8070 struct spoolss_DeletePrintProcessor *r = (struct spoolss_DeletePrintProcessor *)_r;
8071 r->out.result = _spoolss_DeletePrintProcessor(cli->pipes_struct, r);
8072 return NT_STATUS_OK;
8075 case NDR_SPOOLSS_ADDPRINTPROVIDOR: {
8076 struct spoolss_AddPrintProvidor *r = (struct spoolss_AddPrintProvidor *)_r;
8077 r->out.result = _spoolss_AddPrintProvidor(cli->pipes_struct, r);
8078 return NT_STATUS_OK;
8081 case NDR_SPOOLSS_DELETEPRINTPROVIDOR: {
8082 struct spoolss_DeletePrintProvidor *r = (struct spoolss_DeletePrintProvidor *)_r;
8083 r->out.result = _spoolss_DeletePrintProvidor(cli->pipes_struct, r);
8084 return NT_STATUS_OK;
8087 case NDR_SPOOLSS_ENUMPRINTPROCDATATYPES: {
8088 struct spoolss_EnumPrintProcDataTypes *r = (struct spoolss_EnumPrintProcDataTypes *)_r;
8089 ZERO_STRUCT(r->out);
8090 r->out.count = talloc_zero(mem_ctx, uint32_t);
8091 if (r->out.count == NULL) {
8092 return NT_STATUS_NO_MEMORY;
8095 r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcDataTypesInfo *);
8096 if (r->out.info == NULL) {
8097 return NT_STATUS_NO_MEMORY;
8100 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8101 if (r->out.needed == NULL) {
8102 return NT_STATUS_NO_MEMORY;
8105 r->out.result = _spoolss_EnumPrintProcDataTypes(cli->pipes_struct, r);
8106 return NT_STATUS_OK;
8109 case NDR_SPOOLSS_RESETPRINTER: {
8110 struct spoolss_ResetPrinter *r = (struct spoolss_ResetPrinter *)_r;
8111 r->out.result = _spoolss_ResetPrinter(cli->pipes_struct, r);
8112 return NT_STATUS_OK;
8115 case NDR_SPOOLSS_GETPRINTERDRIVER2: {
8116 struct spoolss_GetPrinterDriver2 *r = (struct spoolss_GetPrinterDriver2 *)_r;
8117 ZERO_STRUCT(r->out);
8118 r->out.info = talloc_zero(mem_ctx, union spoolss_DriverInfo);
8119 if (r->out.info == NULL) {
8120 return NT_STATUS_NO_MEMORY;
8123 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8124 if (r->out.needed == NULL) {
8125 return NT_STATUS_NO_MEMORY;
8128 r->out.server_major_version = talloc_zero(mem_ctx, uint32_t);
8129 if (r->out.server_major_version == NULL) {
8130 return NT_STATUS_NO_MEMORY;
8133 r->out.server_minor_version = talloc_zero(mem_ctx, uint32_t);
8134 if (r->out.server_minor_version == NULL) {
8135 return NT_STATUS_NO_MEMORY;
8138 r->out.result = _spoolss_GetPrinterDriver2(cli->pipes_struct, r);
8139 return NT_STATUS_OK;
8142 case NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION: {
8143 struct spoolss_FindFirstPrinterChangeNotification *r = (struct spoolss_FindFirstPrinterChangeNotification *)_r;
8144 r->out.result = _spoolss_FindFirstPrinterChangeNotification(cli->pipes_struct, r);
8145 return NT_STATUS_OK;
8148 case NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION: {
8149 struct spoolss_FindNextPrinterChangeNotification *r = (struct spoolss_FindNextPrinterChangeNotification *)_r;
8150 r->out.result = _spoolss_FindNextPrinterChangeNotification(cli->pipes_struct, r);
8151 return NT_STATUS_OK;
8154 case NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY: {
8155 struct spoolss_FindClosePrinterNotify *r = (struct spoolss_FindClosePrinterNotify *)_r;
8156 r->out.result = _spoolss_FindClosePrinterNotify(cli->pipes_struct, r);
8157 return NT_STATUS_OK;
8160 case NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD: {
8161 struct spoolss_RouterFindFirstPrinterChangeNotificationOld *r = (struct spoolss_RouterFindFirstPrinterChangeNotificationOld *)_r;
8162 r->out.result = _spoolss_RouterFindFirstPrinterChangeNotificationOld(cli->pipes_struct, r);
8163 return NT_STATUS_OK;
8166 case NDR_SPOOLSS_REPLYOPENPRINTER: {
8167 struct spoolss_ReplyOpenPrinter *r = (struct spoolss_ReplyOpenPrinter *)_r;
8168 ZERO_STRUCT(r->out);
8169 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
8170 if (r->out.handle == NULL) {
8171 return NT_STATUS_NO_MEMORY;
8174 r->out.result = _spoolss_ReplyOpenPrinter(cli->pipes_struct, r);
8175 return NT_STATUS_OK;
8178 case NDR_SPOOLSS_ROUTERREPLYPRINTER: {
8179 struct spoolss_RouterReplyPrinter *r = (struct spoolss_RouterReplyPrinter *)_r;
8180 r->out.result = _spoolss_RouterReplyPrinter(cli->pipes_struct, r);
8181 return NT_STATUS_OK;
8184 case NDR_SPOOLSS_REPLYCLOSEPRINTER: {
8185 struct spoolss_ReplyClosePrinter *r = (struct spoolss_ReplyClosePrinter *)_r;
8186 ZERO_STRUCT(r->out);
8187 r->out.handle = r->in.handle;
8188 r->out.result = _spoolss_ReplyClosePrinter(cli->pipes_struct, r);
8189 return NT_STATUS_OK;
8192 case NDR_SPOOLSS_ADDPORTEX: {
8193 struct spoolss_AddPortEx *r = (struct spoolss_AddPortEx *)_r;
8194 r->out.result = _spoolss_AddPortEx(cli->pipes_struct, r);
8195 return NT_STATUS_OK;
8198 case NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION: {
8199 struct spoolss_RouterFindFirstPrinterChangeNotification *r = (struct spoolss_RouterFindFirstPrinterChangeNotification *)_r;
8200 r->out.result = _spoolss_RouterFindFirstPrinterChangeNotification(cli->pipes_struct, r);
8201 return NT_STATUS_OK;
8204 case NDR_SPOOLSS_SPOOLERINIT: {
8205 struct spoolss_SpoolerInit *r = (struct spoolss_SpoolerInit *)_r;
8206 r->out.result = _spoolss_SpoolerInit(cli->pipes_struct, r);
8207 return NT_STATUS_OK;
8210 case NDR_SPOOLSS_RESETPRINTEREX: {
8211 struct spoolss_ResetPrinterEx *r = (struct spoolss_ResetPrinterEx *)_r;
8212 r->out.result = _spoolss_ResetPrinterEx(cli->pipes_struct, r);
8213 return NT_STATUS_OK;
8216 case NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX: {
8217 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r = (struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *)_r;
8218 r->out.result = _spoolss_RemoteFindFirstPrinterChangeNotifyEx(cli->pipes_struct, r);
8219 return NT_STATUS_OK;
8222 case NDR_SPOOLSS_ROUTERREPLYPRINTEREX: {
8223 struct spoolss_RouterReplyPrinterEx *r = (struct spoolss_RouterReplyPrinterEx *)_r;
8224 ZERO_STRUCT(r->out);
8225 r->out.reply_result = talloc_zero(mem_ctx, uint32_t);
8226 if (r->out.reply_result == NULL) {
8227 return NT_STATUS_NO_MEMORY;
8230 r->out.result = _spoolss_RouterReplyPrinterEx(cli->pipes_struct, r);
8231 return NT_STATUS_OK;
8234 case NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY: {
8235 struct spoolss_RouterRefreshPrinterChangeNotify *r = (struct spoolss_RouterRefreshPrinterChangeNotify *)_r;
8236 ZERO_STRUCT(r->out);
8237 r->out.info = talloc_zero(mem_ctx, struct spoolss_NotifyInfo *);
8238 if (r->out.info == NULL) {
8239 return NT_STATUS_NO_MEMORY;
8242 r->out.result = _spoolss_RouterRefreshPrinterChangeNotify(cli->pipes_struct, r);
8243 return NT_STATUS_OK;
8246 case NDR_SPOOLSS_44: {
8247 struct spoolss_44 *r = (struct spoolss_44 *)_r;
8248 r->out.result = _spoolss_44(cli->pipes_struct, r);
8249 return NT_STATUS_OK;
8252 case NDR_SPOOLSS_OPENPRINTEREX: {
8253 struct spoolss_OpenPrinterEx *r = (struct spoolss_OpenPrinterEx *)_r;
8254 ZERO_STRUCT(r->out);
8255 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
8256 if (r->out.handle == NULL) {
8257 return NT_STATUS_NO_MEMORY;
8260 r->out.result = _spoolss_OpenPrinterEx(cli->pipes_struct, r);
8261 return NT_STATUS_OK;
8264 case NDR_SPOOLSS_ADDPRINTEREX: {
8265 struct spoolss_AddPrinterEx *r = (struct spoolss_AddPrinterEx *)_r;
8266 ZERO_STRUCT(r->out);
8267 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
8268 if (r->out.handle == NULL) {
8269 return NT_STATUS_NO_MEMORY;
8272 r->out.result = _spoolss_AddPrinterEx(cli->pipes_struct, r);
8273 return NT_STATUS_OK;
8276 case NDR_SPOOLSS_47: {
8277 struct spoolss_47 *r = (struct spoolss_47 *)_r;
8278 r->out.result = _spoolss_47(cli->pipes_struct, r);
8279 return NT_STATUS_OK;
8282 case NDR_SPOOLSS_ENUMPRINTERDATA: {
8283 struct spoolss_EnumPrinterData *r = (struct spoolss_EnumPrinterData *)_r;
8284 ZERO_STRUCT(r->out);
8285 r->out.value_name = talloc_zero_array(mem_ctx, const char, r->in.value_offered / 2);
8286 if (r->out.value_name == NULL) {
8287 return NT_STATUS_NO_MEMORY;
8290 r->out.value_needed = talloc_zero(mem_ctx, uint32_t);
8291 if (r->out.value_needed == NULL) {
8292 return NT_STATUS_NO_MEMORY;
8295 r->out.printerdata_type = talloc_zero(mem_ctx, uint32_t);
8296 if (r->out.printerdata_type == NULL) {
8297 return NT_STATUS_NO_MEMORY;
8300 r->out.buffer = talloc_zero(mem_ctx, DATA_BLOB);
8301 if (r->out.buffer == NULL) {
8302 return NT_STATUS_NO_MEMORY;
8305 r->out.data_needed = talloc_zero(mem_ctx, uint32_t);
8306 if (r->out.data_needed == NULL) {
8307 return NT_STATUS_NO_MEMORY;
8310 r->out.result = _spoolss_EnumPrinterData(cli->pipes_struct, r);
8311 return NT_STATUS_OK;
8314 case NDR_SPOOLSS_DELETEPRINTERDATA: {
8315 struct spoolss_DeletePrinterData *r = (struct spoolss_DeletePrinterData *)_r;
8316 r->out.result = _spoolss_DeletePrinterData(cli->pipes_struct, r);
8317 return NT_STATUS_OK;
8320 case NDR_SPOOLSS_4A: {
8321 struct spoolss_4a *r = (struct spoolss_4a *)_r;
8322 r->out.result = _spoolss_4a(cli->pipes_struct, r);
8323 return NT_STATUS_OK;
8326 case NDR_SPOOLSS_4B: {
8327 struct spoolss_4b *r = (struct spoolss_4b *)_r;
8328 r->out.result = _spoolss_4b(cli->pipes_struct, r);
8329 return NT_STATUS_OK;
8332 case NDR_SPOOLSS_4C: {
8333 struct spoolss_4c *r = (struct spoolss_4c *)_r;
8334 r->out.result = _spoolss_4c(cli->pipes_struct, r);
8335 return NT_STATUS_OK;
8338 case NDR_SPOOLSS_SETPRINTERDATAEX: {
8339 struct spoolss_SetPrinterDataEx *r = (struct spoolss_SetPrinterDataEx *)_r;
8340 r->out.result = _spoolss_SetPrinterDataEx(cli->pipes_struct, r);
8341 return NT_STATUS_OK;
8344 case NDR_SPOOLSS_GETPRINTERDATAEX: {
8345 struct spoolss_GetPrinterDataEx *r = (struct spoolss_GetPrinterDataEx *)_r;
8346 ZERO_STRUCT(r->out);
8347 r->out.type = talloc_zero(mem_ctx, uint32_t);
8348 if (r->out.type == NULL) {
8349 return NT_STATUS_NO_MEMORY;
8352 r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
8353 if (r->out.buffer == NULL) {
8354 return NT_STATUS_NO_MEMORY;
8357 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8358 if (r->out.needed == NULL) {
8359 return NT_STATUS_NO_MEMORY;
8362 r->out.result = _spoolss_GetPrinterDataEx(cli->pipes_struct, r);
8363 return NT_STATUS_OK;
8366 case NDR_SPOOLSS_ENUMPRINTERDATAEX: {
8367 struct spoolss_EnumPrinterDataEx *r = (struct spoolss_EnumPrinterDataEx *)_r;
8368 ZERO_STRUCT(r->out);
8369 r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
8370 if (r->out.buffer == NULL) {
8371 return NT_STATUS_NO_MEMORY;
8374 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8375 if (r->out.needed == NULL) {
8376 return NT_STATUS_NO_MEMORY;
8379 r->out.count = talloc_zero(mem_ctx, uint32_t);
8380 if (r->out.count == NULL) {
8381 return NT_STATUS_NO_MEMORY;
8384 r->out.result = _spoolss_EnumPrinterDataEx(cli->pipes_struct, r);
8385 return NT_STATUS_OK;
8388 case NDR_SPOOLSS_ENUMPRINTERKEY: {
8389 struct spoolss_EnumPrinterKey *r = (struct spoolss_EnumPrinterKey *)_r;
8390 ZERO_STRUCT(r->out);
8391 r->out.key_buffer = talloc_zero_array(mem_ctx, uint16_t, r->in.key_buffer_size / 2);
8392 if (r->out.key_buffer == NULL) {
8393 return NT_STATUS_NO_MEMORY;
8396 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8397 if (r->out.needed == NULL) {
8398 return NT_STATUS_NO_MEMORY;
8401 r->out.result = _spoolss_EnumPrinterKey(cli->pipes_struct, r);
8402 return NT_STATUS_OK;
8405 case NDR_SPOOLSS_DELETEPRINTERDATAEX: {
8406 struct spoolss_DeletePrinterDataEx *r = (struct spoolss_DeletePrinterDataEx *)_r;
8407 r->out.result = _spoolss_DeletePrinterDataEx(cli->pipes_struct, r);
8408 return NT_STATUS_OK;
8411 case NDR_SPOOLSS_DELETEPRINTERKEY: {
8412 struct spoolss_DeletePrinterKey *r = (struct spoolss_DeletePrinterKey *)_r;
8413 r->out.result = _spoolss_DeletePrinterKey(cli->pipes_struct, r);
8414 return NT_STATUS_OK;
8417 case NDR_SPOOLSS_53: {
8418 struct spoolss_53 *r = (struct spoolss_53 *)_r;
8419 r->out.result = _spoolss_53(cli->pipes_struct, r);
8420 return NT_STATUS_OK;
8423 case NDR_SPOOLSS_DELETEPRINTERDRIVEREX: {
8424 struct spoolss_DeletePrinterDriverEx *r = (struct spoolss_DeletePrinterDriverEx *)_r;
8425 r->out.result = _spoolss_DeletePrinterDriverEx(cli->pipes_struct, r);
8426 return NT_STATUS_OK;
8429 case NDR_SPOOLSS_55: {
8430 struct spoolss_55 *r = (struct spoolss_55 *)_r;
8431 r->out.result = _spoolss_55(cli->pipes_struct, r);
8432 return NT_STATUS_OK;
8435 case NDR_SPOOLSS_56: {
8436 struct spoolss_56 *r = (struct spoolss_56 *)_r;
8437 r->out.result = _spoolss_56(cli->pipes_struct, r);
8438 return NT_STATUS_OK;
8441 case NDR_SPOOLSS_57: {
8442 struct spoolss_57 *r = (struct spoolss_57 *)_r;
8443 r->out.result = _spoolss_57(cli->pipes_struct, r);
8444 return NT_STATUS_OK;
8447 case NDR_SPOOLSS_XCVDATA: {
8448 struct spoolss_XcvData *r = (struct spoolss_XcvData *)_r;
8449 ZERO_STRUCT(r->out);
8450 r->out.status_code = r->in.status_code;
8451 r->out.out_data = talloc_zero_array(mem_ctx, uint8_t, r->in.out_data_size);
8452 if (r->out.out_data == NULL) {
8453 return NT_STATUS_NO_MEMORY;
8456 r->out.needed = talloc_zero(mem_ctx, uint32_t);
8457 if (r->out.needed == NULL) {
8458 return NT_STATUS_NO_MEMORY;
8461 r->out.result = _spoolss_XcvData(cli->pipes_struct, r);
8462 return NT_STATUS_OK;
8465 case NDR_SPOOLSS_ADDPRINTERDRIVEREX: {
8466 struct spoolss_AddPrinterDriverEx *r = (struct spoolss_AddPrinterDriverEx *)_r;
8467 r->out.result = _spoolss_AddPrinterDriverEx(cli->pipes_struct, r);
8468 return NT_STATUS_OK;
8471 case NDR_SPOOLSS_5A: {
8472 struct spoolss_5a *r = (struct spoolss_5a *)_r;
8473 r->out.result = _spoolss_5a(cli->pipes_struct, r);
8474 return NT_STATUS_OK;
8477 case NDR_SPOOLSS_5B: {
8478 struct spoolss_5b *r = (struct spoolss_5b *)_r;
8479 r->out.result = _spoolss_5b(cli->pipes_struct, r);
8480 return NT_STATUS_OK;
8483 case NDR_SPOOLSS_5C: {
8484 struct spoolss_5c *r = (struct spoolss_5c *)_r;
8485 r->out.result = _spoolss_5c(cli->pipes_struct, r);
8486 return NT_STATUS_OK;
8489 case NDR_SPOOLSS_5D: {
8490 struct spoolss_5d *r = (struct spoolss_5d *)_r;
8491 r->out.result = _spoolss_5d(cli->pipes_struct, r);
8492 return NT_STATUS_OK;
8495 case NDR_SPOOLSS_5E: {
8496 struct spoolss_5e *r = (struct spoolss_5e *)_r;
8497 r->out.result = _spoolss_5e(cli->pipes_struct, r);
8498 return NT_STATUS_OK;
8501 case NDR_SPOOLSS_5F: {
8502 struct spoolss_5f *r = (struct spoolss_5f *)_r;
8503 r->out.result = _spoolss_5f(cli->pipes_struct, r);
8504 return NT_STATUS_OK;
8507 default:
8508 return NT_STATUS_NOT_IMPLEMENTED;
8512 NTSTATUS rpc_spoolss_init(void)
8514 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "spoolss", "spoolss", &ndr_table_spoolss, api_spoolss_cmds, sizeof(api_spoolss_cmds) / sizeof(struct api_struct));