librpc: Re-run make idl_full from source3
[amitay/samba.git] / librpc / gen_ndr / cli_spoolss.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * client auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_spoolss.h"
8
9 NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
10                                      TALLOC_CTX *mem_ctx,
11                                      uint32_t flags /* [in]  */,
12                                      const char *server /* [in] [unique,charset(UTF16)] */,
13                                      uint32_t level /* [in]  */,
14                                      DATA_BLOB *buffer /* [in] [unique] */,
15                                      uint32_t offered /* [in]  */,
16                                      union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
17                                      uint32_t *needed /* [out] [ref] */,
18                                      uint32_t count /* [out]  */,
19                                      WERROR *werror)
20 {
21         struct spoolss_EnumPrinters r;
22         NTSTATUS status;
23
24         /* In parameters */
25         r.in.flags = flags;
26         r.in.server = server;
27         r.in.level = level;
28         r.in.buffer = buffer;
29         r.in.offered = offered;
30
31         if (DEBUGLEVEL >= 10) {
32                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinters, &r);
33         }
34
35         status = cli->dispatch(cli,
36                                 mem_ctx,
37                                 &ndr_table_spoolss,
38                                 NDR_SPOOLSS_ENUMPRINTERS,
39                                 &r);
40
41         if (!NT_STATUS_IS_OK(status)) {
42                 return status;
43         }
44
45         if (DEBUGLEVEL >= 10) {
46                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinters, &r);
47         }
48
49         if (NT_STATUS_IS_ERR(status)) {
50                 return status;
51         }
52
53         /* Return variables */
54         if (info && r.out.info) {
55                 memcpy(info, r.out.info, count * sizeof(*info));
56         }
57         *needed = *r.out.needed;
58         return NT_STATUS_NOT_SUPPORTED;
59
60         /* Return result */
61         if (werror) {
62                 *werror = r.out.result;
63         }
64
65         return werror_to_ntstatus(r.out.result);
66 }
67
68 NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli,
69                                     TALLOC_CTX *mem_ctx,
70                                     const char *printername /* [in] [unique,charset(UTF16)] */,
71                                     const char *datatype /* [in] [unique,charset(UTF16)] */,
72                                     struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
73                                     uint32_t access_mask /* [in]  */,
74                                     struct policy_handle *handle /* [out] [ref] */,
75                                     WERROR *werror)
76 {
77         struct spoolss_OpenPrinter r;
78         NTSTATUS status;
79
80         /* In parameters */
81         r.in.printername = printername;
82         r.in.datatype = datatype;
83         r.in.devmode_ctr = devmode_ctr;
84         r.in.access_mask = access_mask;
85
86         if (DEBUGLEVEL >= 10) {
87                 NDR_PRINT_IN_DEBUG(spoolss_OpenPrinter, &r);
88         }
89
90         status = cli->dispatch(cli,
91                                 mem_ctx,
92                                 &ndr_table_spoolss,
93                                 NDR_SPOOLSS_OPENPRINTER,
94                                 &r);
95
96         if (!NT_STATUS_IS_OK(status)) {
97                 return status;
98         }
99
100         if (DEBUGLEVEL >= 10) {
101                 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinter, &r);
102         }
103
104         if (NT_STATUS_IS_ERR(status)) {
105                 return status;
106         }
107
108         /* Return variables */
109         *handle = *r.out.handle;
110
111         /* Return result */
112         if (werror) {
113                 *werror = r.out.result;
114         }
115
116         return werror_to_ntstatus(r.out.result);
117 }
118
119 NTSTATUS rpccli_spoolss_SetJob(struct rpc_pipe_client *cli,
120                                TALLOC_CTX *mem_ctx,
121                                struct policy_handle *handle /* [in] [ref] */,
122                                uint32_t job_id /* [in]  */,
123                                struct spoolss_JobInfoContainer *ctr /* [in] [unique] */,
124                                enum spoolss_JobControl command /* [in]  */,
125                                WERROR *werror)
126 {
127         struct spoolss_SetJob r;
128         NTSTATUS status;
129
130         /* In parameters */
131         r.in.handle = handle;
132         r.in.job_id = job_id;
133         r.in.ctr = ctr;
134         r.in.command = command;
135
136         if (DEBUGLEVEL >= 10) {
137                 NDR_PRINT_IN_DEBUG(spoolss_SetJob, &r);
138         }
139
140         status = cli->dispatch(cli,
141                                 mem_ctx,
142                                 &ndr_table_spoolss,
143                                 NDR_SPOOLSS_SETJOB,
144                                 &r);
145
146         if (!NT_STATUS_IS_OK(status)) {
147                 return status;
148         }
149
150         if (DEBUGLEVEL >= 10) {
151                 NDR_PRINT_OUT_DEBUG(spoolss_SetJob, &r);
152         }
153
154         if (NT_STATUS_IS_ERR(status)) {
155                 return status;
156         }
157
158         /* Return variables */
159
160         /* Return result */
161         if (werror) {
162                 *werror = r.out.result;
163         }
164
165         return werror_to_ntstatus(r.out.result);
166 }
167
168 NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
169                                TALLOC_CTX *mem_ctx,
170                                struct policy_handle *handle /* [in] [ref] */,
171                                uint32_t job_id /* [in]  */,
172                                uint32_t level /* [in]  */,
173                                DATA_BLOB *buffer /* [in] [unique] */,
174                                uint32_t offered /* [in]  */,
175                                union spoolss_JobInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
176                                uint32_t *needed /* [out] [ref] */,
177                                WERROR *werror)
178 {
179         struct spoolss_GetJob r;
180         NTSTATUS status;
181
182         /* In parameters */
183         r.in.handle = handle;
184         r.in.job_id = job_id;
185         r.in.level = level;
186         r.in.buffer = buffer;
187         r.in.offered = offered;
188
189         if (DEBUGLEVEL >= 10) {
190                 NDR_PRINT_IN_DEBUG(spoolss_GetJob, &r);
191         }
192
193         status = cli->dispatch(cli,
194                                 mem_ctx,
195                                 &ndr_table_spoolss,
196                                 NDR_SPOOLSS_GETJOB,
197                                 &r);
198
199         if (!NT_STATUS_IS_OK(status)) {
200                 return status;
201         }
202
203         if (DEBUGLEVEL >= 10) {
204                 NDR_PRINT_OUT_DEBUG(spoolss_GetJob, &r);
205         }
206
207         if (NT_STATUS_IS_ERR(status)) {
208                 return status;
209         }
210
211         /* Return variables */
212         if (info && r.out.info) {
213                 *info = *r.out.info;
214         }
215         *needed = *r.out.needed;
216
217         /* Return result */
218         if (werror) {
219                 *werror = r.out.result;
220         }
221
222         return werror_to_ntstatus(r.out.result);
223 }
224
225 NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
226                                  TALLOC_CTX *mem_ctx,
227                                  struct policy_handle *handle /* [in] [ref] */,
228                                  uint32_t firstjob /* [in]  */,
229                                  uint32_t numjobs /* [in]  */,
230                                  uint32_t level /* [in]  */,
231                                  DATA_BLOB *buffer /* [in] [unique] */,
232                                  uint32_t offered /* [in]  */,
233                                  union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
234                                  uint32_t *needed /* [out] [ref] */,
235                                  uint32_t count /* [out]  */,
236                                  WERROR *werror)
237 {
238         struct spoolss_EnumJobs r;
239         NTSTATUS status;
240
241         /* In parameters */
242         r.in.handle = handle;
243         r.in.firstjob = firstjob;
244         r.in.numjobs = numjobs;
245         r.in.level = level;
246         r.in.buffer = buffer;
247         r.in.offered = offered;
248
249         if (DEBUGLEVEL >= 10) {
250                 NDR_PRINT_IN_DEBUG(spoolss_EnumJobs, &r);
251         }
252
253         status = cli->dispatch(cli,
254                                 mem_ctx,
255                                 &ndr_table_spoolss,
256                                 NDR_SPOOLSS_ENUMJOBS,
257                                 &r);
258
259         if (!NT_STATUS_IS_OK(status)) {
260                 return status;
261         }
262
263         if (DEBUGLEVEL >= 10) {
264                 NDR_PRINT_OUT_DEBUG(spoolss_EnumJobs, &r);
265         }
266
267         if (NT_STATUS_IS_ERR(status)) {
268                 return status;
269         }
270
271         /* Return variables */
272         if (info && r.out.info) {
273                 memcpy(info, r.out.info, count * sizeof(*info));
274         }
275         *needed = *r.out.needed;
276         return NT_STATUS_NOT_SUPPORTED;
277
278         /* Return result */
279         if (werror) {
280                 *werror = r.out.result;
281         }
282
283         return werror_to_ntstatus(r.out.result);
284 }
285
286 NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli,
287                                    TALLOC_CTX *mem_ctx,
288                                    WERROR *werror)
289 {
290         struct spoolss_AddPrinter r;
291         NTSTATUS status;
292
293         /* In parameters */
294
295         if (DEBUGLEVEL >= 10) {
296                 NDR_PRINT_IN_DEBUG(spoolss_AddPrinter, &r);
297         }
298
299         status = cli->dispatch(cli,
300                                 mem_ctx,
301                                 &ndr_table_spoolss,
302                                 NDR_SPOOLSS_ADDPRINTER,
303                                 &r);
304
305         if (!NT_STATUS_IS_OK(status)) {
306                 return status;
307         }
308
309         if (DEBUGLEVEL >= 10) {
310                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinter, &r);
311         }
312
313         if (NT_STATUS_IS_ERR(status)) {
314                 return status;
315         }
316
317         /* Return variables */
318
319         /* Return result */
320         if (werror) {
321                 *werror = r.out.result;
322         }
323
324         return werror_to_ntstatus(r.out.result);
325 }
326
327 NTSTATUS rpccli_spoolss_DeletePrinter(struct rpc_pipe_client *cli,
328                                       TALLOC_CTX *mem_ctx,
329                                       struct policy_handle *handle /* [in] [ref] */,
330                                       WERROR *werror)
331 {
332         struct spoolss_DeletePrinter r;
333         NTSTATUS status;
334
335         /* In parameters */
336         r.in.handle = handle;
337
338         if (DEBUGLEVEL >= 10) {
339                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinter, &r);
340         }
341
342         status = cli->dispatch(cli,
343                                 mem_ctx,
344                                 &ndr_table_spoolss,
345                                 NDR_SPOOLSS_DELETEPRINTER,
346                                 &r);
347
348         if (!NT_STATUS_IS_OK(status)) {
349                 return status;
350         }
351
352         if (DEBUGLEVEL >= 10) {
353                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinter, &r);
354         }
355
356         if (NT_STATUS_IS_ERR(status)) {
357                 return status;
358         }
359
360         /* Return variables */
361
362         /* Return result */
363         if (werror) {
364                 *werror = r.out.result;
365         }
366
367         return werror_to_ntstatus(r.out.result);
368 }
369
370 NTSTATUS rpccli_spoolss_SetPrinter(struct rpc_pipe_client *cli,
371                                    TALLOC_CTX *mem_ctx,
372                                    struct policy_handle *handle /* [in] [ref] */,
373                                    uint32_t level /* [in]  */,
374                                    union spoolss_SetPrinterInfo info /* [in] [switch_is(level)] */,
375                                    struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
376                                    struct sec_desc_buf secdesc_ctr /* [in]  */,
377                                    enum spoolss_PrinterControl command /* [in]  */,
378                                    WERROR *werror)
379 {
380         struct spoolss_SetPrinter r;
381         NTSTATUS status;
382
383         /* In parameters */
384         r.in.handle = handle;
385         r.in.level = level;
386         r.in.info = info;
387         r.in.devmode_ctr = devmode_ctr;
388         r.in.secdesc_ctr = secdesc_ctr;
389         r.in.command = command;
390
391         if (DEBUGLEVEL >= 10) {
392                 NDR_PRINT_IN_DEBUG(spoolss_SetPrinter, &r);
393         }
394
395         status = cli->dispatch(cli,
396                                 mem_ctx,
397                                 &ndr_table_spoolss,
398                                 NDR_SPOOLSS_SETPRINTER,
399                                 &r);
400
401         if (!NT_STATUS_IS_OK(status)) {
402                 return status;
403         }
404
405         if (DEBUGLEVEL >= 10) {
406                 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinter, &r);
407         }
408
409         if (NT_STATUS_IS_ERR(status)) {
410                 return status;
411         }
412
413         /* Return variables */
414
415         /* Return result */
416         if (werror) {
417                 *werror = r.out.result;
418         }
419
420         return werror_to_ntstatus(r.out.result);
421 }
422
423 NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli,
424                                    TALLOC_CTX *mem_ctx,
425                                    struct policy_handle *handle /* [in] [ref] */,
426                                    uint32_t level /* [in]  */,
427                                    DATA_BLOB *buffer /* [in] [unique] */,
428                                    uint32_t offered /* [in]  */,
429                                    union spoolss_PrinterInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
430                                    uint32_t *needed /* [out] [ref] */,
431                                    WERROR *werror)
432 {
433         struct spoolss_GetPrinter r;
434         NTSTATUS status;
435
436         /* In parameters */
437         r.in.handle = handle;
438         r.in.level = level;
439         r.in.buffer = buffer;
440         r.in.offered = offered;
441
442         if (DEBUGLEVEL >= 10) {
443                 NDR_PRINT_IN_DEBUG(spoolss_GetPrinter, &r);
444         }
445
446         status = cli->dispatch(cli,
447                                 mem_ctx,
448                                 &ndr_table_spoolss,
449                                 NDR_SPOOLSS_GETPRINTER,
450                                 &r);
451
452         if (!NT_STATUS_IS_OK(status)) {
453                 return status;
454         }
455
456         if (DEBUGLEVEL >= 10) {
457                 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinter, &r);
458         }
459
460         if (NT_STATUS_IS_ERR(status)) {
461                 return status;
462         }
463
464         /* Return variables */
465         if (info && r.out.info) {
466                 *info = *r.out.info;
467         }
468         *needed = *r.out.needed;
469
470         /* Return result */
471         if (werror) {
472                 *werror = r.out.result;
473         }
474
475         return werror_to_ntstatus(r.out.result);
476 }
477
478 NTSTATUS rpccli_spoolss_AddPrinterDriver(struct rpc_pipe_client *cli,
479                                          TALLOC_CTX *mem_ctx,
480                                          WERROR *werror)
481 {
482         struct spoolss_AddPrinterDriver r;
483         NTSTATUS status;
484
485         /* In parameters */
486
487         if (DEBUGLEVEL >= 10) {
488                 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriver, &r);
489         }
490
491         status = cli->dispatch(cli,
492                                 mem_ctx,
493                                 &ndr_table_spoolss,
494                                 NDR_SPOOLSS_ADDPRINTERDRIVER,
495                                 &r);
496
497         if (!NT_STATUS_IS_OK(status)) {
498                 return status;
499         }
500
501         if (DEBUGLEVEL >= 10) {
502                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriver, &r);
503         }
504
505         if (NT_STATUS_IS_ERR(status)) {
506                 return status;
507         }
508
509         /* Return variables */
510
511         /* Return result */
512         if (werror) {
513                 *werror = r.out.result;
514         }
515
516         return werror_to_ntstatus(r.out.result);
517 }
518
519 NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
520                                            TALLOC_CTX *mem_ctx,
521                                            const char *server /* [in] [unique,charset(UTF16)] */,
522                                            const char *environment /* [in] [unique,charset(UTF16)] */,
523                                            uint32_t level /* [in]  */,
524                                            DATA_BLOB *buffer /* [in] [unique] */,
525                                            uint32_t offered /* [in]  */,
526                                            union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
527                                            uint32_t *needed /* [out] [ref] */,
528                                            uint32_t count /* [out]  */,
529                                            WERROR *werror)
530 {
531         struct spoolss_EnumPrinterDrivers r;
532         NTSTATUS status;
533
534         /* In parameters */
535         r.in.server = server;
536         r.in.environment = environment;
537         r.in.level = level;
538         r.in.buffer = buffer;
539         r.in.offered = offered;
540
541         if (DEBUGLEVEL >= 10) {
542                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDrivers, &r);
543         }
544
545         status = cli->dispatch(cli,
546                                 mem_ctx,
547                                 &ndr_table_spoolss,
548                                 NDR_SPOOLSS_ENUMPRINTERDRIVERS,
549                                 &r);
550
551         if (!NT_STATUS_IS_OK(status)) {
552                 return status;
553         }
554
555         if (DEBUGLEVEL >= 10) {
556                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDrivers, &r);
557         }
558
559         if (NT_STATUS_IS_ERR(status)) {
560                 return status;
561         }
562
563         /* Return variables */
564         if (info && r.out.info) {
565                 memcpy(info, r.out.info, count * sizeof(*info));
566         }
567         *needed = *r.out.needed;
568         return NT_STATUS_NOT_SUPPORTED;
569
570         /* Return result */
571         if (werror) {
572                 *werror = r.out.result;
573         }
574
575         return werror_to_ntstatus(r.out.result);
576 }
577
578 NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli,
579                                          TALLOC_CTX *mem_ctx,
580                                          WERROR *werror)
581 {
582         struct spoolss_GetPrinterDriver r;
583         NTSTATUS status;
584
585         /* In parameters */
586
587         if (DEBUGLEVEL >= 10) {
588                 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver, &r);
589         }
590
591         status = cli->dispatch(cli,
592                                 mem_ctx,
593                                 &ndr_table_spoolss,
594                                 NDR_SPOOLSS_GETPRINTERDRIVER,
595                                 &r);
596
597         if (!NT_STATUS_IS_OK(status)) {
598                 return status;
599         }
600
601         if (DEBUGLEVEL >= 10) {
602                 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver, &r);
603         }
604
605         if (NT_STATUS_IS_ERR(status)) {
606                 return status;
607         }
608
609         /* Return variables */
610
611         /* Return result */
612         if (werror) {
613                 *werror = r.out.result;
614         }
615
616         return werror_to_ntstatus(r.out.result);
617 }
618
619 NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
620                                                   TALLOC_CTX *mem_ctx,
621                                                   const char *server /* [in] [unique,charset(UTF16)] */,
622                                                   const char *environment /* [in] [unique,charset(UTF16)] */,
623                                                   uint32_t level /* [in]  */,
624                                                   DATA_BLOB *buffer /* [in] [unique] */,
625                                                   uint32_t offered /* [in]  */,
626                                                   union spoolss_DriverDirectoryInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
627                                                   uint32_t *needed /* [out] [ref] */,
628                                                   WERROR *werror)
629 {
630         struct spoolss_GetPrinterDriverDirectory r;
631         NTSTATUS status;
632
633         /* In parameters */
634         r.in.server = server;
635         r.in.environment = environment;
636         r.in.level = level;
637         r.in.buffer = buffer;
638         r.in.offered = offered;
639
640         if (DEBUGLEVEL >= 10) {
641                 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriverDirectory, &r);
642         }
643
644         status = cli->dispatch(cli,
645                                 mem_ctx,
646                                 &ndr_table_spoolss,
647                                 NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY,
648                                 &r);
649
650         if (!NT_STATUS_IS_OK(status)) {
651                 return status;
652         }
653
654         if (DEBUGLEVEL >= 10) {
655                 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverDirectory, &r);
656         }
657
658         if (NT_STATUS_IS_ERR(status)) {
659                 return status;
660         }
661
662         /* Return variables */
663         if (info && r.out.info) {
664                 *info = *r.out.info;
665         }
666         *needed = *r.out.needed;
667
668         /* Return result */
669         if (werror) {
670                 *werror = r.out.result;
671         }
672
673         return werror_to_ntstatus(r.out.result);
674 }
675
676 NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli,
677                                             TALLOC_CTX *mem_ctx,
678                                             struct policy_handle *handle /* [in] [ref] */,
679                                             const char *server /* [in] [unique,charset(UTF16)] */,
680                                             const char *architecture /* [in] [charset(UTF16)] */,
681                                             const char *driver /* [in] [charset(UTF16)] */,
682                                             WERROR *werror)
683 {
684         struct spoolss_DeletePrinterDriver r;
685         NTSTATUS status;
686
687         /* In parameters */
688         r.in.handle = handle;
689         r.in.server = server;
690         r.in.architecture = architecture;
691         r.in.driver = driver;
692
693         if (DEBUGLEVEL >= 10) {
694                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriver, &r);
695         }
696
697         status = cli->dispatch(cli,
698                                 mem_ctx,
699                                 &ndr_table_spoolss,
700                                 NDR_SPOOLSS_DELETEPRINTERDRIVER,
701                                 &r);
702
703         if (!NT_STATUS_IS_OK(status)) {
704                 return status;
705         }
706
707         if (DEBUGLEVEL >= 10) {
708                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriver, &r);
709         }
710
711         if (NT_STATUS_IS_ERR(status)) {
712                 return status;
713         }
714
715         /* Return variables */
716
717         /* Return result */
718         if (werror) {
719                 *werror = r.out.result;
720         }
721
722         return werror_to_ntstatus(r.out.result);
723 }
724
725 NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli,
726                                           TALLOC_CTX *mem_ctx,
727                                           WERROR *werror)
728 {
729         struct spoolss_AddPrintProcessor r;
730         NTSTATUS status;
731
732         /* In parameters */
733
734         if (DEBUGLEVEL >= 10) {
735                 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProcessor, &r);
736         }
737
738         status = cli->dispatch(cli,
739                                 mem_ctx,
740                                 &ndr_table_spoolss,
741                                 NDR_SPOOLSS_ADDPRINTPROCESSOR,
742                                 &r);
743
744         if (!NT_STATUS_IS_OK(status)) {
745                 return status;
746         }
747
748         if (DEBUGLEVEL >= 10) {
749                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProcessor, &r);
750         }
751
752         if (NT_STATUS_IS_ERR(status)) {
753                 return status;
754         }
755
756         /* Return variables */
757
758         /* Return result */
759         if (werror) {
760                 *werror = r.out.result;
761         }
762
763         return werror_to_ntstatus(r.out.result);
764 }
765
766 NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
767                                             TALLOC_CTX *mem_ctx,
768                                             const char *servername /* [in] [unique,charset(UTF16)] */,
769                                             const char *environment /* [in] [unique,charset(UTF16)] */,
770                                             uint32_t level /* [in]  */,
771                                             DATA_BLOB *buffer /* [in] [unique] */,
772                                             uint32_t offered /* [in]  */,
773                                             union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
774                                             uint32_t *needed /* [out] [ref] */,
775                                             uint32_t count /* [out]  */,
776                                             WERROR *werror)
777 {
778         struct spoolss_EnumPrintProcessors r;
779         NTSTATUS status;
780
781         /* In parameters */
782         r.in.servername = servername;
783         r.in.environment = environment;
784         r.in.level = level;
785         r.in.buffer = buffer;
786         r.in.offered = offered;
787
788         if (DEBUGLEVEL >= 10) {
789                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcessors, &r);
790         }
791
792         status = cli->dispatch(cli,
793                                 mem_ctx,
794                                 &ndr_table_spoolss,
795                                 NDR_SPOOLSS_ENUMPRINTPROCESSORS,
796                                 &r);
797
798         if (!NT_STATUS_IS_OK(status)) {
799                 return status;
800         }
801
802         if (DEBUGLEVEL >= 10) {
803                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcessors, &r);
804         }
805
806         if (NT_STATUS_IS_ERR(status)) {
807                 return status;
808         }
809
810         /* Return variables */
811         if (info && r.out.info) {
812                 memcpy(info, r.out.info, count * sizeof(*info));
813         }
814         *needed = *r.out.needed;
815         return NT_STATUS_NOT_SUPPORTED;
816
817         /* Return result */
818         if (werror) {
819                 *werror = r.out.result;
820         }
821
822         return werror_to_ntstatus(r.out.result);
823 }
824
825 NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli,
826                                                    TALLOC_CTX *mem_ctx,
827                                                    WERROR *werror)
828 {
829         struct spoolss_GetPrintProcessorDirectory r;
830         NTSTATUS status;
831
832         /* In parameters */
833
834         if (DEBUGLEVEL >= 10) {
835                 NDR_PRINT_IN_DEBUG(spoolss_GetPrintProcessorDirectory, &r);
836         }
837
838         status = cli->dispatch(cli,
839                                 mem_ctx,
840                                 &ndr_table_spoolss,
841                                 NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY,
842                                 &r);
843
844         if (!NT_STATUS_IS_OK(status)) {
845                 return status;
846         }
847
848         if (DEBUGLEVEL >= 10) {
849                 NDR_PRINT_OUT_DEBUG(spoolss_GetPrintProcessorDirectory, &r);
850         }
851
852         if (NT_STATUS_IS_ERR(status)) {
853                 return status;
854         }
855
856         /* Return variables */
857
858         /* Return result */
859         if (werror) {
860                 *werror = r.out.result;
861         }
862
863         return werror_to_ntstatus(r.out.result);
864 }
865
866 NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
867                                         TALLOC_CTX *mem_ctx,
868                                         struct policy_handle *handle /* [in] [ref] */,
869                                         uint32_t level /* [in]  */,
870                                         union spoolss_DocumentInfo info /* [in] [switch_is(level)] */,
871                                         uint32_t *job_id /* [out] [ref] */,
872                                         WERROR *werror)
873 {
874         struct spoolss_StartDocPrinter r;
875         NTSTATUS status;
876
877         /* In parameters */
878         r.in.handle = handle;
879         r.in.level = level;
880         r.in.info = info;
881
882         if (DEBUGLEVEL >= 10) {
883                 NDR_PRINT_IN_DEBUG(spoolss_StartDocPrinter, &r);
884         }
885
886         status = cli->dispatch(cli,
887                                 mem_ctx,
888                                 &ndr_table_spoolss,
889                                 NDR_SPOOLSS_STARTDOCPRINTER,
890                                 &r);
891
892         if (!NT_STATUS_IS_OK(status)) {
893                 return status;
894         }
895
896         if (DEBUGLEVEL >= 10) {
897                 NDR_PRINT_OUT_DEBUG(spoolss_StartDocPrinter, &r);
898         }
899
900         if (NT_STATUS_IS_ERR(status)) {
901                 return status;
902         }
903
904         /* Return variables */
905         *job_id = *r.out.job_id;
906
907         /* Return result */
908         if (werror) {
909                 *werror = r.out.result;
910         }
911
912         return werror_to_ntstatus(r.out.result);
913 }
914
915 NTSTATUS rpccli_spoolss_StartPagePrinter(struct rpc_pipe_client *cli,
916                                          TALLOC_CTX *mem_ctx,
917                                          struct policy_handle *handle /* [in] [ref] */,
918                                          WERROR *werror)
919 {
920         struct spoolss_StartPagePrinter r;
921         NTSTATUS status;
922
923         /* In parameters */
924         r.in.handle = handle;
925
926         if (DEBUGLEVEL >= 10) {
927                 NDR_PRINT_IN_DEBUG(spoolss_StartPagePrinter, &r);
928         }
929
930         status = cli->dispatch(cli,
931                                 mem_ctx,
932                                 &ndr_table_spoolss,
933                                 NDR_SPOOLSS_STARTPAGEPRINTER,
934                                 &r);
935
936         if (!NT_STATUS_IS_OK(status)) {
937                 return status;
938         }
939
940         if (DEBUGLEVEL >= 10) {
941                 NDR_PRINT_OUT_DEBUG(spoolss_StartPagePrinter, &r);
942         }
943
944         if (NT_STATUS_IS_ERR(status)) {
945                 return status;
946         }
947
948         /* Return variables */
949
950         /* Return result */
951         if (werror) {
952                 *werror = r.out.result;
953         }
954
955         return werror_to_ntstatus(r.out.result);
956 }
957
958 NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli,
959                                      TALLOC_CTX *mem_ctx,
960                                      struct policy_handle *handle /* [in] [ref] */,
961                                      DATA_BLOB data /* [in]  */,
962                                      uint32_t _data_size /* [in] [value(r->in.data.length)] */,
963                                      uint32_t *num_written /* [out] [ref] */,
964                                      WERROR *werror)
965 {
966         struct spoolss_WritePrinter r;
967         NTSTATUS status;
968
969         /* In parameters */
970         r.in.handle = handle;
971         r.in.data = data;
972         r.in._data_size = _data_size;
973
974         if (DEBUGLEVEL >= 10) {
975                 NDR_PRINT_IN_DEBUG(spoolss_WritePrinter, &r);
976         }
977
978         status = cli->dispatch(cli,
979                                 mem_ctx,
980                                 &ndr_table_spoolss,
981                                 NDR_SPOOLSS_WRITEPRINTER,
982                                 &r);
983
984         if (!NT_STATUS_IS_OK(status)) {
985                 return status;
986         }
987
988         if (DEBUGLEVEL >= 10) {
989                 NDR_PRINT_OUT_DEBUG(spoolss_WritePrinter, &r);
990         }
991
992         if (NT_STATUS_IS_ERR(status)) {
993                 return status;
994         }
995
996         /* Return variables */
997         *num_written = *r.out.num_written;
998
999         /* Return result */
1000         if (werror) {
1001                 *werror = r.out.result;
1002         }
1003
1004         return werror_to_ntstatus(r.out.result);
1005 }
1006
1007 NTSTATUS rpccli_spoolss_EndPagePrinter(struct rpc_pipe_client *cli,
1008                                        TALLOC_CTX *mem_ctx,
1009                                        struct policy_handle *handle /* [in] [ref] */,
1010                                        WERROR *werror)
1011 {
1012         struct spoolss_EndPagePrinter r;
1013         NTSTATUS status;
1014
1015         /* In parameters */
1016         r.in.handle = handle;
1017
1018         if (DEBUGLEVEL >= 10) {
1019                 NDR_PRINT_IN_DEBUG(spoolss_EndPagePrinter, &r);
1020         }
1021
1022         status = cli->dispatch(cli,
1023                                 mem_ctx,
1024                                 &ndr_table_spoolss,
1025                                 NDR_SPOOLSS_ENDPAGEPRINTER,
1026                                 &r);
1027
1028         if (!NT_STATUS_IS_OK(status)) {
1029                 return status;
1030         }
1031
1032         if (DEBUGLEVEL >= 10) {
1033                 NDR_PRINT_OUT_DEBUG(spoolss_EndPagePrinter, &r);
1034         }
1035
1036         if (NT_STATUS_IS_ERR(status)) {
1037                 return status;
1038         }
1039
1040         /* Return variables */
1041
1042         /* Return result */
1043         if (werror) {
1044                 *werror = r.out.result;
1045         }
1046
1047         return werror_to_ntstatus(r.out.result);
1048 }
1049
1050 NTSTATUS rpccli_spoolss_AbortPrinter(struct rpc_pipe_client *cli,
1051                                      TALLOC_CTX *mem_ctx,
1052                                      struct policy_handle *handle /* [in] [ref] */,
1053                                      WERROR *werror)
1054 {
1055         struct spoolss_AbortPrinter r;
1056         NTSTATUS status;
1057
1058         /* In parameters */
1059         r.in.handle = handle;
1060
1061         if (DEBUGLEVEL >= 10) {
1062                 NDR_PRINT_IN_DEBUG(spoolss_AbortPrinter, &r);
1063         }
1064
1065         status = cli->dispatch(cli,
1066                                 mem_ctx,
1067                                 &ndr_table_spoolss,
1068                                 NDR_SPOOLSS_ABORTPRINTER,
1069                                 &r);
1070
1071         if (!NT_STATUS_IS_OK(status)) {
1072                 return status;
1073         }
1074
1075         if (DEBUGLEVEL >= 10) {
1076                 NDR_PRINT_OUT_DEBUG(spoolss_AbortPrinter, &r);
1077         }
1078
1079         if (NT_STATUS_IS_ERR(status)) {
1080                 return status;
1081         }
1082
1083         /* Return variables */
1084
1085         /* Return result */
1086         if (werror) {
1087                 *werror = r.out.result;
1088         }
1089
1090         return werror_to_ntstatus(r.out.result);
1091 }
1092
1093 NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
1094                                     TALLOC_CTX *mem_ctx,
1095                                     struct policy_handle *handle /* [in] [ref] */,
1096                                     uint8_t *data /* [out] [ref,size_is(data_size)] */,
1097                                     uint32_t data_size /* [in]  */,
1098                                     uint32_t *_data_size /* [out] [ref] */,
1099                                     WERROR *werror)
1100 {
1101         struct spoolss_ReadPrinter r;
1102         NTSTATUS status;
1103
1104         /* In parameters */
1105         r.in.handle = handle;
1106         r.in.data_size = data_size;
1107
1108         if (DEBUGLEVEL >= 10) {
1109                 NDR_PRINT_IN_DEBUG(spoolss_ReadPrinter, &r);
1110         }
1111
1112         status = cli->dispatch(cli,
1113                                 mem_ctx,
1114                                 &ndr_table_spoolss,
1115                                 NDR_SPOOLSS_READPRINTER,
1116                                 &r);
1117
1118         if (!NT_STATUS_IS_OK(status)) {
1119                 return status;
1120         }
1121
1122         if (DEBUGLEVEL >= 10) {
1123                 NDR_PRINT_OUT_DEBUG(spoolss_ReadPrinter, &r);
1124         }
1125
1126         if (NT_STATUS_IS_ERR(status)) {
1127                 return status;
1128         }
1129
1130         /* Return variables */
1131         memcpy(data, r.out.data, r.in.data_size * sizeof(*data));
1132         *_data_size = *r.out._data_size;
1133
1134         /* Return result */
1135         if (werror) {
1136                 *werror = r.out.result;
1137         }
1138
1139         return werror_to_ntstatus(r.out.result);
1140 }
1141
1142 NTSTATUS rpccli_spoolss_EndDocPrinter(struct rpc_pipe_client *cli,
1143                                       TALLOC_CTX *mem_ctx,
1144                                       struct policy_handle *handle /* [in] [ref] */,
1145                                       WERROR *werror)
1146 {
1147         struct spoolss_EndDocPrinter r;
1148         NTSTATUS status;
1149
1150         /* In parameters */
1151         r.in.handle = handle;
1152
1153         if (DEBUGLEVEL >= 10) {
1154                 NDR_PRINT_IN_DEBUG(spoolss_EndDocPrinter, &r);
1155         }
1156
1157         status = cli->dispatch(cli,
1158                                 mem_ctx,
1159                                 &ndr_table_spoolss,
1160                                 NDR_SPOOLSS_ENDDOCPRINTER,
1161                                 &r);
1162
1163         if (!NT_STATUS_IS_OK(status)) {
1164                 return status;
1165         }
1166
1167         if (DEBUGLEVEL >= 10) {
1168                 NDR_PRINT_OUT_DEBUG(spoolss_EndDocPrinter, &r);
1169         }
1170
1171         if (NT_STATUS_IS_ERR(status)) {
1172                 return status;
1173         }
1174
1175         /* Return variables */
1176
1177         /* Return result */
1178         if (werror) {
1179                 *werror = r.out.result;
1180         }
1181
1182         return werror_to_ntstatus(r.out.result);
1183 }
1184
1185 NTSTATUS rpccli_spoolss_AddJob(struct rpc_pipe_client *cli,
1186                                TALLOC_CTX *mem_ctx,
1187                                WERROR *werror)
1188 {
1189         struct spoolss_AddJob r;
1190         NTSTATUS status;
1191
1192         /* In parameters */
1193
1194         if (DEBUGLEVEL >= 10) {
1195                 NDR_PRINT_IN_DEBUG(spoolss_AddJob, &r);
1196         }
1197
1198         status = cli->dispatch(cli,
1199                                 mem_ctx,
1200                                 &ndr_table_spoolss,
1201                                 NDR_SPOOLSS_ADDJOB,
1202                                 &r);
1203
1204         if (!NT_STATUS_IS_OK(status)) {
1205                 return status;
1206         }
1207
1208         if (DEBUGLEVEL >= 10) {
1209                 NDR_PRINT_OUT_DEBUG(spoolss_AddJob, &r);
1210         }
1211
1212         if (NT_STATUS_IS_ERR(status)) {
1213                 return status;
1214         }
1215
1216         /* Return variables */
1217
1218         /* Return result */
1219         if (werror) {
1220                 *werror = r.out.result;
1221         }
1222
1223         return werror_to_ntstatus(r.out.result);
1224 }
1225
1226 NTSTATUS rpccli_spoolss_ScheduleJob(struct rpc_pipe_client *cli,
1227                                     TALLOC_CTX *mem_ctx,
1228                                     WERROR *werror)
1229 {
1230         struct spoolss_ScheduleJob r;
1231         NTSTATUS status;
1232
1233         /* In parameters */
1234
1235         if (DEBUGLEVEL >= 10) {
1236                 NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, &r);
1237         }
1238
1239         status = cli->dispatch(cli,
1240                                 mem_ctx,
1241                                 &ndr_table_spoolss,
1242                                 NDR_SPOOLSS_SCHEDULEJOB,
1243                                 &r);
1244
1245         if (!NT_STATUS_IS_OK(status)) {
1246                 return status;
1247         }
1248
1249         if (DEBUGLEVEL >= 10) {
1250                 NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, &r);
1251         }
1252
1253         if (NT_STATUS_IS_ERR(status)) {
1254                 return status;
1255         }
1256
1257         /* Return variables */
1258
1259         /* Return result */
1260         if (werror) {
1261                 *werror = r.out.result;
1262         }
1263
1264         return werror_to_ntstatus(r.out.result);
1265 }
1266
1267 NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
1268                                        TALLOC_CTX *mem_ctx,
1269                                        struct policy_handle *handle /* [in] [ref] */,
1270                                        const char *value_name /* [in] [charset(UTF16)] */,
1271                                        uint32_t offered /* [in]  */,
1272                                        enum spoolss_PrinterDataType *type /* [out] [ref] */,
1273                                        union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(*type)] */,
1274                                        uint32_t *needed /* [out] [ref] */,
1275                                        WERROR *werror)
1276 {
1277         struct spoolss_GetPrinterData r;
1278         NTSTATUS status;
1279
1280         /* In parameters */
1281         r.in.handle = handle;
1282         r.in.value_name = value_name;
1283         r.in.offered = offered;
1284
1285         if (DEBUGLEVEL >= 10) {
1286                 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterData, &r);
1287         }
1288
1289         status = cli->dispatch(cli,
1290                                 mem_ctx,
1291                                 &ndr_table_spoolss,
1292                                 NDR_SPOOLSS_GETPRINTERDATA,
1293                                 &r);
1294
1295         if (!NT_STATUS_IS_OK(status)) {
1296                 return status;
1297         }
1298
1299         if (DEBUGLEVEL >= 10) {
1300                 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterData, &r);
1301         }
1302
1303         if (NT_STATUS_IS_ERR(status)) {
1304                 return status;
1305         }
1306
1307         /* Return variables */
1308         *type = *r.out.type;
1309         return NT_STATUS_NOT_SUPPORTED;
1310         *needed = *r.out.needed;
1311
1312         /* Return result */
1313         if (werror) {
1314                 *werror = r.out.result;
1315         }
1316
1317         return werror_to_ntstatus(r.out.result);
1318 }
1319
1320 NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli,
1321                                        TALLOC_CTX *mem_ctx,
1322                                        struct policy_handle *handle /* [in] [ref] */,
1323                                        const char *value_name /* [in] [charset(UTF16)] */,
1324                                        enum spoolss_PrinterDataType type /* [in]  */,
1325                                        union spoolss_PrinterData data /* [in] [subcontext(4),switch_is(type)] */,
1326                                        uint32_t _offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */,
1327                                        WERROR *werror)
1328 {
1329         struct spoolss_SetPrinterData r;
1330         NTSTATUS status;
1331
1332         /* In parameters */
1333         r.in.handle = handle;
1334         r.in.value_name = value_name;
1335         r.in.type = type;
1336         r.in.data = data;
1337         r.in._offered = _offered;
1338
1339         if (DEBUGLEVEL >= 10) {
1340                 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, &r);
1341         }
1342
1343         status = cli->dispatch(cli,
1344                                 mem_ctx,
1345                                 &ndr_table_spoolss,
1346                                 NDR_SPOOLSS_SETPRINTERDATA,
1347                                 &r);
1348
1349         if (!NT_STATUS_IS_OK(status)) {
1350                 return status;
1351         }
1352
1353         if (DEBUGLEVEL >= 10) {
1354                 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterData, &r);
1355         }
1356
1357         if (NT_STATUS_IS_ERR(status)) {
1358                 return status;
1359         }
1360
1361         /* Return variables */
1362
1363         /* Return result */
1364         if (werror) {
1365                 *werror = r.out.result;
1366         }
1367
1368         return werror_to_ntstatus(r.out.result);
1369 }
1370
1371 NTSTATUS rpccli_spoolss_WaitForPrinterChange(struct rpc_pipe_client *cli,
1372                                              TALLOC_CTX *mem_ctx,
1373                                              WERROR *werror)
1374 {
1375         struct spoolss_WaitForPrinterChange r;
1376         NTSTATUS status;
1377
1378         /* In parameters */
1379
1380         if (DEBUGLEVEL >= 10) {
1381                 NDR_PRINT_IN_DEBUG(spoolss_WaitForPrinterChange, &r);
1382         }
1383
1384         status = cli->dispatch(cli,
1385                                 mem_ctx,
1386                                 &ndr_table_spoolss,
1387                                 NDR_SPOOLSS_WAITFORPRINTERCHANGE,
1388                                 &r);
1389
1390         if (!NT_STATUS_IS_OK(status)) {
1391                 return status;
1392         }
1393
1394         if (DEBUGLEVEL >= 10) {
1395                 NDR_PRINT_OUT_DEBUG(spoolss_WaitForPrinterChange, &r);
1396         }
1397
1398         if (NT_STATUS_IS_ERR(status)) {
1399                 return status;
1400         }
1401
1402         /* Return variables */
1403
1404         /* Return result */
1405         if (werror) {
1406                 *werror = r.out.result;
1407         }
1408
1409         return werror_to_ntstatus(r.out.result);
1410 }
1411
1412 NTSTATUS rpccli_spoolss_ClosePrinter(struct rpc_pipe_client *cli,
1413                                      TALLOC_CTX *mem_ctx,
1414                                      struct policy_handle *handle /* [in,out] [ref] */,
1415                                      WERROR *werror)
1416 {
1417         struct spoolss_ClosePrinter r;
1418         NTSTATUS status;
1419
1420         /* In parameters */
1421         r.in.handle = handle;
1422
1423         if (DEBUGLEVEL >= 10) {
1424                 NDR_PRINT_IN_DEBUG(spoolss_ClosePrinter, &r);
1425         }
1426
1427         status = cli->dispatch(cli,
1428                                 mem_ctx,
1429                                 &ndr_table_spoolss,
1430                                 NDR_SPOOLSS_CLOSEPRINTER,
1431                                 &r);
1432
1433         if (!NT_STATUS_IS_OK(status)) {
1434                 return status;
1435         }
1436
1437         if (DEBUGLEVEL >= 10) {
1438                 NDR_PRINT_OUT_DEBUG(spoolss_ClosePrinter, &r);
1439         }
1440
1441         if (NT_STATUS_IS_ERR(status)) {
1442                 return status;
1443         }
1444
1445         /* Return variables */
1446         *handle = *r.out.handle;
1447
1448         /* Return result */
1449         if (werror) {
1450                 *werror = r.out.result;
1451         }
1452
1453         return werror_to_ntstatus(r.out.result);
1454 }
1455
1456 NTSTATUS rpccli_spoolss_AddForm(struct rpc_pipe_client *cli,
1457                                 TALLOC_CTX *mem_ctx,
1458                                 struct policy_handle *handle /* [in] [ref] */,
1459                                 uint32_t level /* [in]  */,
1460                                 union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
1461                                 WERROR *werror)
1462 {
1463         struct spoolss_AddForm r;
1464         NTSTATUS status;
1465
1466         /* In parameters */
1467         r.in.handle = handle;
1468         r.in.level = level;
1469         r.in.info = info;
1470
1471         if (DEBUGLEVEL >= 10) {
1472                 NDR_PRINT_IN_DEBUG(spoolss_AddForm, &r);
1473         }
1474
1475         status = cli->dispatch(cli,
1476                                 mem_ctx,
1477                                 &ndr_table_spoolss,
1478                                 NDR_SPOOLSS_ADDFORM,
1479                                 &r);
1480
1481         if (!NT_STATUS_IS_OK(status)) {
1482                 return status;
1483         }
1484
1485         if (DEBUGLEVEL >= 10) {
1486                 NDR_PRINT_OUT_DEBUG(spoolss_AddForm, &r);
1487         }
1488
1489         if (NT_STATUS_IS_ERR(status)) {
1490                 return status;
1491         }
1492
1493         /* Return variables */
1494
1495         /* Return result */
1496         if (werror) {
1497                 *werror = r.out.result;
1498         }
1499
1500         return werror_to_ntstatus(r.out.result);
1501 }
1502
1503 NTSTATUS rpccli_spoolss_DeleteForm(struct rpc_pipe_client *cli,
1504                                    TALLOC_CTX *mem_ctx,
1505                                    struct policy_handle *handle /* [in] [ref] */,
1506                                    const char *form_name /* [in] [charset(UTF16)] */,
1507                                    WERROR *werror)
1508 {
1509         struct spoolss_DeleteForm r;
1510         NTSTATUS status;
1511
1512         /* In parameters */
1513         r.in.handle = handle;
1514         r.in.form_name = form_name;
1515
1516         if (DEBUGLEVEL >= 10) {
1517                 NDR_PRINT_IN_DEBUG(spoolss_DeleteForm, &r);
1518         }
1519
1520         status = cli->dispatch(cli,
1521                                 mem_ctx,
1522                                 &ndr_table_spoolss,
1523                                 NDR_SPOOLSS_DELETEFORM,
1524                                 &r);
1525
1526         if (!NT_STATUS_IS_OK(status)) {
1527                 return status;
1528         }
1529
1530         if (DEBUGLEVEL >= 10) {
1531                 NDR_PRINT_OUT_DEBUG(spoolss_DeleteForm, &r);
1532         }
1533
1534         if (NT_STATUS_IS_ERR(status)) {
1535                 return status;
1536         }
1537
1538         /* Return variables */
1539
1540         /* Return result */
1541         if (werror) {
1542                 *werror = r.out.result;
1543         }
1544
1545         return werror_to_ntstatus(r.out.result);
1546 }
1547
1548 NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
1549                                 TALLOC_CTX *mem_ctx,
1550                                 struct policy_handle *handle /* [in] [ref] */,
1551                                 const char *form_name /* [in] [charset(UTF16)] */,
1552                                 uint32_t level /* [in]  */,
1553                                 DATA_BLOB *buffer /* [in] [unique] */,
1554                                 uint32_t offered /* [in]  */,
1555                                 union spoolss_FormInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1556                                 uint32_t *needed /* [out] [ref] */,
1557                                 WERROR *werror)
1558 {
1559         struct spoolss_GetForm r;
1560         NTSTATUS status;
1561
1562         /* In parameters */
1563         r.in.handle = handle;
1564         r.in.form_name = form_name;
1565         r.in.level = level;
1566         r.in.buffer = buffer;
1567         r.in.offered = offered;
1568
1569         if (DEBUGLEVEL >= 10) {
1570                 NDR_PRINT_IN_DEBUG(spoolss_GetForm, &r);
1571         }
1572
1573         status = cli->dispatch(cli,
1574                                 mem_ctx,
1575                                 &ndr_table_spoolss,
1576                                 NDR_SPOOLSS_GETFORM,
1577                                 &r);
1578
1579         if (!NT_STATUS_IS_OK(status)) {
1580                 return status;
1581         }
1582
1583         if (DEBUGLEVEL >= 10) {
1584                 NDR_PRINT_OUT_DEBUG(spoolss_GetForm, &r);
1585         }
1586
1587         if (NT_STATUS_IS_ERR(status)) {
1588                 return status;
1589         }
1590
1591         /* Return variables */
1592         if (info && r.out.info) {
1593                 *info = *r.out.info;
1594         }
1595         *needed = *r.out.needed;
1596
1597         /* Return result */
1598         if (werror) {
1599                 *werror = r.out.result;
1600         }
1601
1602         return werror_to_ntstatus(r.out.result);
1603 }
1604
1605 NTSTATUS rpccli_spoolss_SetForm(struct rpc_pipe_client *cli,
1606                                 TALLOC_CTX *mem_ctx,
1607                                 struct policy_handle *handle /* [in] [ref] */,
1608                                 const char *form_name /* [in] [charset(UTF16)] */,
1609                                 uint32_t level /* [in]  */,
1610                                 union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
1611                                 WERROR *werror)
1612 {
1613         struct spoolss_SetForm r;
1614         NTSTATUS status;
1615
1616         /* In parameters */
1617         r.in.handle = handle;
1618         r.in.form_name = form_name;
1619         r.in.level = level;
1620         r.in.info = info;
1621
1622         if (DEBUGLEVEL >= 10) {
1623                 NDR_PRINT_IN_DEBUG(spoolss_SetForm, &r);
1624         }
1625
1626         status = cli->dispatch(cli,
1627                                 mem_ctx,
1628                                 &ndr_table_spoolss,
1629                                 NDR_SPOOLSS_SETFORM,
1630                                 &r);
1631
1632         if (!NT_STATUS_IS_OK(status)) {
1633                 return status;
1634         }
1635
1636         if (DEBUGLEVEL >= 10) {
1637                 NDR_PRINT_OUT_DEBUG(spoolss_SetForm, &r);
1638         }
1639
1640         if (NT_STATUS_IS_ERR(status)) {
1641                 return status;
1642         }
1643
1644         /* Return variables */
1645
1646         /* Return result */
1647         if (werror) {
1648                 *werror = r.out.result;
1649         }
1650
1651         return werror_to_ntstatus(r.out.result);
1652 }
1653
1654 NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
1655                                   TALLOC_CTX *mem_ctx,
1656                                   struct policy_handle *handle /* [in] [ref] */,
1657                                   uint32_t level /* [in]  */,
1658                                   DATA_BLOB *buffer /* [in] [unique] */,
1659                                   uint32_t offered /* [in]  */,
1660                                   union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
1661                                   uint32_t *needed /* [out] [ref] */,
1662                                   uint32_t count /* [out]  */,
1663                                   WERROR *werror)
1664 {
1665         struct spoolss_EnumForms r;
1666         NTSTATUS status;
1667
1668         /* In parameters */
1669         r.in.handle = handle;
1670         r.in.level = level;
1671         r.in.buffer = buffer;
1672         r.in.offered = offered;
1673
1674         if (DEBUGLEVEL >= 10) {
1675                 NDR_PRINT_IN_DEBUG(spoolss_EnumForms, &r);
1676         }
1677
1678         status = cli->dispatch(cli,
1679                                 mem_ctx,
1680                                 &ndr_table_spoolss,
1681                                 NDR_SPOOLSS_ENUMFORMS,
1682                                 &r);
1683
1684         if (!NT_STATUS_IS_OK(status)) {
1685                 return status;
1686         }
1687
1688         if (DEBUGLEVEL >= 10) {
1689                 NDR_PRINT_OUT_DEBUG(spoolss_EnumForms, &r);
1690         }
1691
1692         if (NT_STATUS_IS_ERR(status)) {
1693                 return status;
1694         }
1695
1696         /* Return variables */
1697         if (info && r.out.info) {
1698                 memcpy(info, r.out.info, count * sizeof(*info));
1699         }
1700         *needed = *r.out.needed;
1701         return NT_STATUS_NOT_SUPPORTED;
1702
1703         /* Return result */
1704         if (werror) {
1705                 *werror = r.out.result;
1706         }
1707
1708         return werror_to_ntstatus(r.out.result);
1709 }
1710
1711 NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
1712                                   TALLOC_CTX *mem_ctx,
1713                                   const char *servername /* [in] [unique,charset(UTF16)] */,
1714                                   uint32_t level /* [in]  */,
1715                                   DATA_BLOB *buffer /* [in] [unique] */,
1716                                   uint32_t offered /* [in]  */,
1717                                   union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
1718                                   uint32_t *needed /* [out] [ref] */,
1719                                   uint32_t count /* [out]  */,
1720                                   WERROR *werror)
1721 {
1722         struct spoolss_EnumPorts r;
1723         NTSTATUS status;
1724
1725         /* In parameters */
1726         r.in.servername = servername;
1727         r.in.level = level;
1728         r.in.buffer = buffer;
1729         r.in.offered = offered;
1730
1731         if (DEBUGLEVEL >= 10) {
1732                 NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, &r);
1733         }
1734
1735         status = cli->dispatch(cli,
1736                                 mem_ctx,
1737                                 &ndr_table_spoolss,
1738                                 NDR_SPOOLSS_ENUMPORTS,
1739                                 &r);
1740
1741         if (!NT_STATUS_IS_OK(status)) {
1742                 return status;
1743         }
1744
1745         if (DEBUGLEVEL >= 10) {
1746                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPorts, &r);
1747         }
1748
1749         if (NT_STATUS_IS_ERR(status)) {
1750                 return status;
1751         }
1752
1753         /* Return variables */
1754         if (info && r.out.info) {
1755                 memcpy(info, r.out.info, count * sizeof(*info));
1756         }
1757         *needed = *r.out.needed;
1758         return NT_STATUS_NOT_SUPPORTED;
1759
1760         /* Return result */
1761         if (werror) {
1762                 *werror = r.out.result;
1763         }
1764
1765         return werror_to_ntstatus(r.out.result);
1766 }
1767
1768 NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
1769                                      TALLOC_CTX *mem_ctx,
1770                                      const char *servername /* [in] [unique,charset(UTF16)] */,
1771                                      uint32_t level /* [in]  */,
1772                                      DATA_BLOB *buffer /* [in] [unique] */,
1773                                      uint32_t offered /* [in]  */,
1774                                      union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
1775                                      uint32_t *needed /* [out] [ref] */,
1776                                      uint32_t count /* [out]  */,
1777                                      WERROR *werror)
1778 {
1779         struct spoolss_EnumMonitors r;
1780         NTSTATUS status;
1781
1782         /* In parameters */
1783         r.in.servername = servername;
1784         r.in.level = level;
1785         r.in.buffer = buffer;
1786         r.in.offered = offered;
1787
1788         if (DEBUGLEVEL >= 10) {
1789                 NDR_PRINT_IN_DEBUG(spoolss_EnumMonitors, &r);
1790         }
1791
1792         status = cli->dispatch(cli,
1793                                 mem_ctx,
1794                                 &ndr_table_spoolss,
1795                                 NDR_SPOOLSS_ENUMMONITORS,
1796                                 &r);
1797
1798         if (!NT_STATUS_IS_OK(status)) {
1799                 return status;
1800         }
1801
1802         if (DEBUGLEVEL >= 10) {
1803                 NDR_PRINT_OUT_DEBUG(spoolss_EnumMonitors, &r);
1804         }
1805
1806         if (NT_STATUS_IS_ERR(status)) {
1807                 return status;
1808         }
1809
1810         /* Return variables */
1811         if (info && r.out.info) {
1812                 memcpy(info, r.out.info, count * sizeof(*info));
1813         }
1814         *needed = *r.out.needed;
1815         return NT_STATUS_NOT_SUPPORTED;
1816
1817         /* Return result */
1818         if (werror) {
1819                 *werror = r.out.result;
1820         }
1821
1822         return werror_to_ntstatus(r.out.result);
1823 }
1824
1825 NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli,
1826                                 TALLOC_CTX *mem_ctx,
1827                                 const char *server_name /* [in] [unique,charset(UTF16)] */,
1828                                 uint32_t unknown /* [in]  */,
1829                                 const char *monitor_name /* [in] [charset(UTF16)] */,
1830                                 WERROR *werror)
1831 {
1832         struct spoolss_AddPort r;
1833         NTSTATUS status;
1834
1835         /* In parameters */
1836         r.in.server_name = server_name;
1837         r.in.unknown = unknown;
1838         r.in.monitor_name = monitor_name;
1839
1840         if (DEBUGLEVEL >= 10) {
1841                 NDR_PRINT_IN_DEBUG(spoolss_AddPort, &r);
1842         }
1843
1844         status = cli->dispatch(cli,
1845                                 mem_ctx,
1846                                 &ndr_table_spoolss,
1847                                 NDR_SPOOLSS_ADDPORT,
1848                                 &r);
1849
1850         if (!NT_STATUS_IS_OK(status)) {
1851                 return status;
1852         }
1853
1854         if (DEBUGLEVEL >= 10) {
1855                 NDR_PRINT_OUT_DEBUG(spoolss_AddPort, &r);
1856         }
1857
1858         if (NT_STATUS_IS_ERR(status)) {
1859                 return status;
1860         }
1861
1862         /* Return variables */
1863
1864         /* Return result */
1865         if (werror) {
1866                 *werror = r.out.result;
1867         }
1868
1869         return werror_to_ntstatus(r.out.result);
1870 }
1871
1872 NTSTATUS rpccli_spoolss_ConfigurePort(struct rpc_pipe_client *cli,
1873                                       TALLOC_CTX *mem_ctx,
1874                                       WERROR *werror)
1875 {
1876         struct spoolss_ConfigurePort r;
1877         NTSTATUS status;
1878
1879         /* In parameters */
1880
1881         if (DEBUGLEVEL >= 10) {
1882                 NDR_PRINT_IN_DEBUG(spoolss_ConfigurePort, &r);
1883         }
1884
1885         status = cli->dispatch(cli,
1886                                 mem_ctx,
1887                                 &ndr_table_spoolss,
1888                                 NDR_SPOOLSS_CONFIGUREPORT,
1889                                 &r);
1890
1891         if (!NT_STATUS_IS_OK(status)) {
1892                 return status;
1893         }
1894
1895         if (DEBUGLEVEL >= 10) {
1896                 NDR_PRINT_OUT_DEBUG(spoolss_ConfigurePort, &r);
1897         }
1898
1899         if (NT_STATUS_IS_ERR(status)) {
1900                 return status;
1901         }
1902
1903         /* Return variables */
1904
1905         /* Return result */
1906         if (werror) {
1907                 *werror = r.out.result;
1908         }
1909
1910         return werror_to_ntstatus(r.out.result);
1911 }
1912
1913 NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
1914                                    TALLOC_CTX *mem_ctx,
1915                                    WERROR *werror)
1916 {
1917         struct spoolss_DeletePort r;
1918         NTSTATUS status;
1919
1920         /* In parameters */
1921
1922         if (DEBUGLEVEL >= 10) {
1923                 NDR_PRINT_IN_DEBUG(spoolss_DeletePort, &r);
1924         }
1925
1926         status = cli->dispatch(cli,
1927                                 mem_ctx,
1928                                 &ndr_table_spoolss,
1929                                 NDR_SPOOLSS_DELETEPORT,
1930                                 &r);
1931
1932         if (!NT_STATUS_IS_OK(status)) {
1933                 return status;
1934         }
1935
1936         if (DEBUGLEVEL >= 10) {
1937                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, &r);
1938         }
1939
1940         if (NT_STATUS_IS_ERR(status)) {
1941                 return status;
1942         }
1943
1944         /* Return variables */
1945
1946         /* Return result */
1947         if (werror) {
1948                 *werror = r.out.result;
1949         }
1950
1951         return werror_to_ntstatus(r.out.result);
1952 }
1953
1954 NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
1955                                         TALLOC_CTX *mem_ctx,
1956                                         WERROR *werror)
1957 {
1958         struct spoolss_CreatePrinterIC r;
1959         NTSTATUS status;
1960
1961         /* In parameters */
1962
1963         if (DEBUGLEVEL >= 10) {
1964                 NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &r);
1965         }
1966
1967         status = cli->dispatch(cli,
1968                                 mem_ctx,
1969                                 &ndr_table_spoolss,
1970                                 NDR_SPOOLSS_CREATEPRINTERIC,
1971                                 &r);
1972
1973         if (!NT_STATUS_IS_OK(status)) {
1974                 return status;
1975         }
1976
1977         if (DEBUGLEVEL >= 10) {
1978                 NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, &r);
1979         }
1980
1981         if (NT_STATUS_IS_ERR(status)) {
1982                 return status;
1983         }
1984
1985         /* Return variables */
1986
1987         /* Return result */
1988         if (werror) {
1989                 *werror = r.out.result;
1990         }
1991
1992         return werror_to_ntstatus(r.out.result);
1993 }
1994
1995 NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
1996                                                  TALLOC_CTX *mem_ctx,
1997                                                  WERROR *werror)
1998 {
1999         struct spoolss_PlayGDIScriptOnPrinterIC r;
2000         NTSTATUS status;
2001
2002         /* In parameters */
2003
2004         if (DEBUGLEVEL >= 10) {
2005                 NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
2006         }
2007
2008         status = cli->dispatch(cli,
2009                                 mem_ctx,
2010                                 &ndr_table_spoolss,
2011                                 NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
2012                                 &r);
2013
2014         if (!NT_STATUS_IS_OK(status)) {
2015                 return status;
2016         }
2017
2018         if (DEBUGLEVEL >= 10) {
2019                 NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
2020         }
2021
2022         if (NT_STATUS_IS_ERR(status)) {
2023                 return status;
2024         }
2025
2026         /* Return variables */
2027
2028         /* Return result */
2029         if (werror) {
2030                 *werror = r.out.result;
2031         }
2032
2033         return werror_to_ntstatus(r.out.result);
2034 }
2035
2036 NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
2037                                         TALLOC_CTX *mem_ctx,
2038                                         WERROR *werror)
2039 {
2040         struct spoolss_DeletePrinterIC r;
2041         NTSTATUS status;
2042
2043         /* In parameters */
2044
2045         if (DEBUGLEVEL >= 10) {
2046                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &r);
2047         }
2048
2049         status = cli->dispatch(cli,
2050                                 mem_ctx,
2051                                 &ndr_table_spoolss,
2052                                 NDR_SPOOLSS_DELETEPRINTERIC,
2053                                 &r);
2054
2055         if (!NT_STATUS_IS_OK(status)) {
2056                 return status;
2057         }
2058
2059         if (DEBUGLEVEL >= 10) {
2060                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, &r);
2061         }
2062
2063         if (NT_STATUS_IS_ERR(status)) {
2064                 return status;
2065         }
2066
2067         /* Return variables */
2068
2069         /* Return result */
2070         if (werror) {
2071                 *werror = r.out.result;
2072         }
2073
2074         return werror_to_ntstatus(r.out.result);
2075 }
2076
2077 NTSTATUS rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client *cli,
2078                                              TALLOC_CTX *mem_ctx,
2079                                              WERROR *werror)
2080 {
2081         struct spoolss_AddPrinterConnection r;
2082         NTSTATUS status;
2083
2084         /* In parameters */
2085
2086         if (DEBUGLEVEL >= 10) {
2087                 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, &r);
2088         }
2089
2090         status = cli->dispatch(cli,
2091                                 mem_ctx,
2092                                 &ndr_table_spoolss,
2093                                 NDR_SPOOLSS_ADDPRINTERCONNECTION,
2094                                 &r);
2095
2096         if (!NT_STATUS_IS_OK(status)) {
2097                 return status;
2098         }
2099
2100         if (DEBUGLEVEL >= 10) {
2101                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, &r);
2102         }
2103
2104         if (NT_STATUS_IS_ERR(status)) {
2105                 return status;
2106         }
2107
2108         /* Return variables */
2109
2110         /* Return result */
2111         if (werror) {
2112                 *werror = r.out.result;
2113         }
2114
2115         return werror_to_ntstatus(r.out.result);
2116 }
2117
2118 NTSTATUS rpccli_spoolss_DeletePrinterConnection(struct rpc_pipe_client *cli,
2119                                                 TALLOC_CTX *mem_ctx,
2120                                                 WERROR *werror)
2121 {
2122         struct spoolss_DeletePrinterConnection r;
2123         NTSTATUS status;
2124
2125         /* In parameters */
2126
2127         if (DEBUGLEVEL >= 10) {
2128                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, &r);
2129         }
2130
2131         status = cli->dispatch(cli,
2132                                 mem_ctx,
2133                                 &ndr_table_spoolss,
2134                                 NDR_SPOOLSS_DELETEPRINTERCONNECTION,
2135                                 &r);
2136
2137         if (!NT_STATUS_IS_OK(status)) {
2138                 return status;
2139         }
2140
2141         if (DEBUGLEVEL >= 10) {
2142                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, &r);
2143         }
2144
2145         if (NT_STATUS_IS_ERR(status)) {
2146                 return status;
2147         }
2148
2149         /* Return variables */
2150
2151         /* Return result */
2152         if (werror) {
2153                 *werror = r.out.result;
2154         }
2155
2156         return werror_to_ntstatus(r.out.result);
2157 }
2158
2159 NTSTATUS rpccli_spoolss_PrinterMessageBox(struct rpc_pipe_client *cli,
2160                                           TALLOC_CTX *mem_ctx,
2161                                           WERROR *werror)
2162 {
2163         struct spoolss_PrinterMessageBox r;
2164         NTSTATUS status;
2165
2166         /* In parameters */
2167
2168         if (DEBUGLEVEL >= 10) {
2169                 NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, &r);
2170         }
2171
2172         status = cli->dispatch(cli,
2173                                 mem_ctx,
2174                                 &ndr_table_spoolss,
2175                                 NDR_SPOOLSS_PRINTERMESSAGEBOX,
2176                                 &r);
2177
2178         if (!NT_STATUS_IS_OK(status)) {
2179                 return status;
2180         }
2181
2182         if (DEBUGLEVEL >= 10) {
2183                 NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, &r);
2184         }
2185
2186         if (NT_STATUS_IS_ERR(status)) {
2187                 return status;
2188         }
2189
2190         /* Return variables */
2191
2192         /* Return result */
2193         if (werror) {
2194                 *werror = r.out.result;
2195         }
2196
2197         return werror_to_ntstatus(r.out.result);
2198 }
2199
2200 NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
2201                                    TALLOC_CTX *mem_ctx,
2202                                    WERROR *werror)
2203 {
2204         struct spoolss_AddMonitor r;
2205         NTSTATUS status;
2206
2207         /* In parameters */
2208
2209         if (DEBUGLEVEL >= 10) {
2210                 NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, &r);
2211         }
2212
2213         status = cli->dispatch(cli,
2214                                 mem_ctx,
2215                                 &ndr_table_spoolss,
2216                                 NDR_SPOOLSS_ADDMONITOR,
2217                                 &r);
2218
2219         if (!NT_STATUS_IS_OK(status)) {
2220                 return status;
2221         }
2222
2223         if (DEBUGLEVEL >= 10) {
2224                 NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, &r);
2225         }
2226
2227         if (NT_STATUS_IS_ERR(status)) {
2228                 return status;
2229         }
2230
2231         /* Return variables */
2232
2233         /* Return result */
2234         if (werror) {
2235                 *werror = r.out.result;
2236         }
2237
2238         return werror_to_ntstatus(r.out.result);
2239 }
2240
2241 NTSTATUS rpccli_spoolss_DeleteMonitor(struct rpc_pipe_client *cli,
2242                                       TALLOC_CTX *mem_ctx,
2243                                       WERROR *werror)
2244 {
2245         struct spoolss_DeleteMonitor r;
2246         NTSTATUS status;
2247
2248         /* In parameters */
2249
2250         if (DEBUGLEVEL >= 10) {
2251                 NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, &r);
2252         }
2253
2254         status = cli->dispatch(cli,
2255                                 mem_ctx,
2256                                 &ndr_table_spoolss,
2257                                 NDR_SPOOLSS_DELETEMONITOR,
2258                                 &r);
2259
2260         if (!NT_STATUS_IS_OK(status)) {
2261                 return status;
2262         }
2263
2264         if (DEBUGLEVEL >= 10) {
2265                 NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, &r);
2266         }
2267
2268         if (NT_STATUS_IS_ERR(status)) {
2269                 return status;
2270         }
2271
2272         /* Return variables */
2273
2274         /* Return result */
2275         if (werror) {
2276                 *werror = r.out.result;
2277         }
2278
2279         return werror_to_ntstatus(r.out.result);
2280 }
2281
2282 NTSTATUS rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client *cli,
2283                                              TALLOC_CTX *mem_ctx,
2284                                              WERROR *werror)
2285 {
2286         struct spoolss_DeletePrintProcessor r;
2287         NTSTATUS status;
2288
2289         /* In parameters */
2290
2291         if (DEBUGLEVEL >= 10) {
2292                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, &r);
2293         }
2294
2295         status = cli->dispatch(cli,
2296                                 mem_ctx,
2297                                 &ndr_table_spoolss,
2298                                 NDR_SPOOLSS_DELETEPRINTPROCESSOR,
2299                                 &r);
2300
2301         if (!NT_STATUS_IS_OK(status)) {
2302                 return status;
2303         }
2304
2305         if (DEBUGLEVEL >= 10) {
2306                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, &r);
2307         }
2308
2309         if (NT_STATUS_IS_ERR(status)) {
2310                 return status;
2311         }
2312
2313         /* Return variables */
2314
2315         /* Return result */
2316         if (werror) {
2317                 *werror = r.out.result;
2318         }
2319
2320         return werror_to_ntstatus(r.out.result);
2321 }
2322
2323 NTSTATUS rpccli_spoolss_AddPrintProvidor(struct rpc_pipe_client *cli,
2324                                          TALLOC_CTX *mem_ctx,
2325                                          WERROR *werror)
2326 {
2327         struct spoolss_AddPrintProvidor r;
2328         NTSTATUS status;
2329
2330         /* In parameters */
2331
2332         if (DEBUGLEVEL >= 10) {
2333                 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, &r);
2334         }
2335
2336         status = cli->dispatch(cli,
2337                                 mem_ctx,
2338                                 &ndr_table_spoolss,
2339                                 NDR_SPOOLSS_ADDPRINTPROVIDOR,
2340                                 &r);
2341
2342         if (!NT_STATUS_IS_OK(status)) {
2343                 return status;
2344         }
2345
2346         if (DEBUGLEVEL >= 10) {
2347                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, &r);
2348         }
2349
2350         if (NT_STATUS_IS_ERR(status)) {
2351                 return status;
2352         }
2353
2354         /* Return variables */
2355
2356         /* Return result */
2357         if (werror) {
2358                 *werror = r.out.result;
2359         }
2360
2361         return werror_to_ntstatus(r.out.result);
2362 }
2363
2364 NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli,
2365                                             TALLOC_CTX *mem_ctx,
2366                                             WERROR *werror)
2367 {
2368         struct spoolss_DeletePrintProvidor r;
2369         NTSTATUS status;
2370
2371         /* In parameters */
2372
2373         if (DEBUGLEVEL >= 10) {
2374                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, &r);
2375         }
2376
2377         status = cli->dispatch(cli,
2378                                 mem_ctx,
2379                                 &ndr_table_spoolss,
2380                                 NDR_SPOOLSS_DELETEPRINTPROVIDOR,
2381                                 &r);
2382
2383         if (!NT_STATUS_IS_OK(status)) {
2384                 return status;
2385         }
2386
2387         if (DEBUGLEVEL >= 10) {
2388                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, &r);
2389         }
2390
2391         if (NT_STATUS_IS_ERR(status)) {
2392                 return status;
2393         }
2394
2395         /* Return variables */
2396
2397         /* Return result */
2398         if (werror) {
2399                 *werror = r.out.result;
2400         }
2401
2402         return werror_to_ntstatus(r.out.result);
2403 }
2404
2405 NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli,
2406                                                TALLOC_CTX *mem_ctx,
2407                                                WERROR *werror)
2408 {
2409         struct spoolss_EnumPrintProcDataTypes r;
2410         NTSTATUS status;
2411
2412         /* In parameters */
2413
2414         if (DEBUGLEVEL >= 10) {
2415                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
2416         }
2417
2418         status = cli->dispatch(cli,
2419                                 mem_ctx,
2420                                 &ndr_table_spoolss,
2421                                 NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
2422                                 &r);
2423
2424         if (!NT_STATUS_IS_OK(status)) {
2425                 return status;
2426         }
2427
2428         if (DEBUGLEVEL >= 10) {
2429                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
2430         }
2431
2432         if (NT_STATUS_IS_ERR(status)) {
2433                 return status;
2434         }
2435
2436         /* Return variables */
2437
2438         /* Return result */
2439         if (werror) {
2440                 *werror = r.out.result;
2441         }
2442
2443         return werror_to_ntstatus(r.out.result);
2444 }
2445
2446 NTSTATUS rpccli_spoolss_ResetPrinter(struct rpc_pipe_client *cli,
2447                                      TALLOC_CTX *mem_ctx,
2448                                      WERROR *werror)
2449 {
2450         struct spoolss_ResetPrinter r;
2451         NTSTATUS status;
2452
2453         /* In parameters */
2454
2455         if (DEBUGLEVEL >= 10) {
2456                 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, &r);
2457         }
2458
2459         status = cli->dispatch(cli,
2460                                 mem_ctx,
2461                                 &ndr_table_spoolss,
2462                                 NDR_SPOOLSS_RESETPRINTER,
2463                                 &r);
2464
2465         if (!NT_STATUS_IS_OK(status)) {
2466                 return status;
2467         }
2468
2469         if (DEBUGLEVEL >= 10) {
2470                 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, &r);
2471         }
2472
2473         if (NT_STATUS_IS_ERR(status)) {
2474                 return status;
2475         }
2476
2477         /* Return variables */
2478
2479         /* Return result */
2480         if (werror) {
2481                 *werror = r.out.result;
2482         }
2483
2484         return werror_to_ntstatus(r.out.result);
2485 }
2486
2487 NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
2488                                           TALLOC_CTX *mem_ctx,
2489                                           struct policy_handle *handle /* [in] [ref] */,
2490                                           const char *architecture /* [in] [unique,charset(UTF16)] */,
2491                                           uint32_t level /* [in]  */,
2492                                           DATA_BLOB *buffer /* [in] [unique] */,
2493                                           uint32_t offered /* [in]  */,
2494                                           uint32_t client_major_version /* [in]  */,
2495                                           uint32_t client_minor_version /* [in]  */,
2496                                           DATA_BLOB *info /* [out] [unique] */,
2497                                           uint32_t *needed /* [out] [ref] */,
2498                                           uint32_t *server_major_version /* [out] [ref] */,
2499                                           uint32_t *server_minor_version /* [out] [ref] */,
2500                                           WERROR *werror)
2501 {
2502         struct spoolss_GetPrinterDriver2 r;
2503         NTSTATUS status;
2504
2505         /* In parameters */
2506         r.in.handle = handle;
2507         r.in.architecture = architecture;
2508         r.in.level = level;
2509         r.in.buffer = buffer;
2510         r.in.offered = offered;
2511         r.in.client_major_version = client_major_version;
2512         r.in.client_minor_version = client_minor_version;
2513
2514         if (DEBUGLEVEL >= 10) {
2515                 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, &r);
2516         }
2517
2518         status = cli->dispatch(cli,
2519                                 mem_ctx,
2520                                 &ndr_table_spoolss,
2521                                 NDR_SPOOLSS_GETPRINTERDRIVER2,
2522                                 &r);
2523
2524         if (!NT_STATUS_IS_OK(status)) {
2525                 return status;
2526         }
2527
2528         if (DEBUGLEVEL >= 10) {
2529                 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, &r);
2530         }
2531
2532         if (NT_STATUS_IS_ERR(status)) {
2533                 return status;
2534         }
2535
2536         /* Return variables */
2537         if (info && r.out.info) {
2538                 *info = *r.out.info;
2539         }
2540         *needed = *r.out.needed;
2541         *server_major_version = *r.out.server_major_version;
2542         *server_minor_version = *r.out.server_minor_version;
2543
2544         /* Return result */
2545         if (werror) {
2546                 *werror = r.out.result;
2547         }
2548
2549         return werror_to_ntstatus(r.out.result);
2550 }
2551
2552 NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
2553                                                            TALLOC_CTX *mem_ctx,
2554                                                            WERROR *werror)
2555 {
2556         struct spoolss_FindFirstPrinterChangeNotification r;
2557         NTSTATUS status;
2558
2559         /* In parameters */
2560
2561         if (DEBUGLEVEL >= 10) {
2562                 NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
2563         }
2564
2565         status = cli->dispatch(cli,
2566                                 mem_ctx,
2567                                 &ndr_table_spoolss,
2568                                 NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
2569                                 &r);
2570
2571         if (!NT_STATUS_IS_OK(status)) {
2572                 return status;
2573         }
2574
2575         if (DEBUGLEVEL >= 10) {
2576                 NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
2577         }
2578
2579         if (NT_STATUS_IS_ERR(status)) {
2580                 return status;
2581         }
2582
2583         /* Return variables */
2584
2585         /* Return result */
2586         if (werror) {
2587                 *werror = r.out.result;
2588         }
2589
2590         return werror_to_ntstatus(r.out.result);
2591 }
2592
2593 NTSTATUS rpccli_spoolss_FindNextPrinterChangeNotification(struct rpc_pipe_client *cli,
2594                                                           TALLOC_CTX *mem_ctx,
2595                                                           WERROR *werror)
2596 {
2597         struct spoolss_FindNextPrinterChangeNotification r;
2598         NTSTATUS status;
2599
2600         /* In parameters */
2601
2602         if (DEBUGLEVEL >= 10) {
2603                 NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
2604         }
2605
2606         status = cli->dispatch(cli,
2607                                 mem_ctx,
2608                                 &ndr_table_spoolss,
2609                                 NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
2610                                 &r);
2611
2612         if (!NT_STATUS_IS_OK(status)) {
2613                 return status;
2614         }
2615
2616         if (DEBUGLEVEL >= 10) {
2617                 NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
2618         }
2619
2620         if (NT_STATUS_IS_ERR(status)) {
2621                 return status;
2622         }
2623
2624         /* Return variables */
2625
2626         /* Return result */
2627         if (werror) {
2628                 *werror = r.out.result;
2629         }
2630
2631         return werror_to_ntstatus(r.out.result);
2632 }
2633
2634 NTSTATUS rpccli_spoolss_FindClosePrinterNotify(struct rpc_pipe_client *cli,
2635                                                TALLOC_CTX *mem_ctx,
2636                                                struct policy_handle *handle /* [in] [ref] */,
2637                                                WERROR *werror)
2638 {
2639         struct spoolss_FindClosePrinterNotify r;
2640         NTSTATUS status;
2641
2642         /* In parameters */
2643         r.in.handle = handle;
2644
2645         if (DEBUGLEVEL >= 10) {
2646                 NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, &r);
2647         }
2648
2649         status = cli->dispatch(cli,
2650                                 mem_ctx,
2651                                 &ndr_table_spoolss,
2652                                 NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
2653                                 &r);
2654
2655         if (!NT_STATUS_IS_OK(status)) {
2656                 return status;
2657         }
2658
2659         if (DEBUGLEVEL >= 10) {
2660                 NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, &r);
2661         }
2662
2663         if (NT_STATUS_IS_ERR(status)) {
2664                 return status;
2665         }
2666
2667         /* Return variables */
2668
2669         /* Return result */
2670         if (werror) {
2671                 *werror = r.out.result;
2672         }
2673
2674         return werror_to_ntstatus(r.out.result);
2675 }
2676
2677 NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld(struct rpc_pipe_client *cli,
2678                                                                     TALLOC_CTX *mem_ctx,
2679                                                                     WERROR *werror)
2680 {
2681         struct spoolss_RouterFindFirstPrinterChangeNotificationOld r;
2682         NTSTATUS status;
2683
2684         /* In parameters */
2685
2686         if (DEBUGLEVEL >= 10) {
2687                 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
2688         }
2689
2690         status = cli->dispatch(cli,
2691                                 mem_ctx,
2692                                 &ndr_table_spoolss,
2693                                 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
2694                                 &r);
2695
2696         if (!NT_STATUS_IS_OK(status)) {
2697                 return status;
2698         }
2699
2700         if (DEBUGLEVEL >= 10) {
2701                 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
2702         }
2703
2704         if (NT_STATUS_IS_ERR(status)) {
2705                 return status;
2706         }
2707
2708         /* Return variables */
2709
2710         /* Return result */
2711         if (werror) {
2712                 *werror = r.out.result;
2713         }
2714
2715         return werror_to_ntstatus(r.out.result);
2716 }
2717
2718 NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
2719                                          TALLOC_CTX *mem_ctx,
2720                                          const char *server_name /* [in] [charset(UTF16)] */,
2721                                          uint32_t printer_local /* [in]  */,
2722                                          enum winreg_Type type /* [in]  */,
2723                                          uint32_t unknown1 /* [in]  */,
2724                                          uint32_t unknown2 /* [in]  */,
2725                                          struct policy_handle *handle /* [out] [ref] */,
2726                                          WERROR *werror)
2727 {
2728         struct spoolss_ReplyOpenPrinter r;
2729         NTSTATUS status;
2730
2731         /* In parameters */
2732         r.in.server_name = server_name;
2733         r.in.printer_local = printer_local;
2734         r.in.type = type;
2735         r.in.unknown1 = unknown1;
2736         r.in.unknown2 = unknown2;
2737
2738         if (DEBUGLEVEL >= 10) {
2739                 NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, &r);
2740         }
2741
2742         status = cli->dispatch(cli,
2743                                 mem_ctx,
2744                                 &ndr_table_spoolss,
2745                                 NDR_SPOOLSS_REPLYOPENPRINTER,
2746                                 &r);
2747
2748         if (!NT_STATUS_IS_OK(status)) {
2749                 return status;
2750         }
2751
2752         if (DEBUGLEVEL >= 10) {
2753                 NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, &r);
2754         }
2755
2756         if (NT_STATUS_IS_ERR(status)) {
2757                 return status;
2758         }
2759
2760         /* Return variables */
2761         *handle = *r.out.handle;
2762
2763         /* Return result */
2764         if (werror) {
2765                 *werror = r.out.result;
2766         }
2767
2768         return werror_to_ntstatus(r.out.result);
2769 }
2770
2771 NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
2772                                            TALLOC_CTX *mem_ctx,
2773                                            WERROR *werror)
2774 {
2775         struct spoolss_RouterReplyPrinter r;
2776         NTSTATUS status;
2777
2778         /* In parameters */
2779
2780         if (DEBUGLEVEL >= 10) {
2781                 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &r);
2782         }
2783
2784         status = cli->dispatch(cli,
2785                                 mem_ctx,
2786                                 &ndr_table_spoolss,
2787                                 NDR_SPOOLSS_ROUTERREPLYPRINTER,
2788                                 &r);
2789
2790         if (!NT_STATUS_IS_OK(status)) {
2791                 return status;
2792         }
2793
2794         if (DEBUGLEVEL >= 10) {
2795                 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, &r);
2796         }
2797
2798         if (NT_STATUS_IS_ERR(status)) {
2799                 return status;
2800         }
2801
2802         /* Return variables */
2803
2804         /* Return result */
2805         if (werror) {
2806                 *werror = r.out.result;
2807         }
2808
2809         return werror_to_ntstatus(r.out.result);
2810 }
2811
2812 NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
2813                                           TALLOC_CTX *mem_ctx,
2814                                           struct policy_handle *handle /* [in,out] [ref] */,
2815                                           WERROR *werror)
2816 {
2817         struct spoolss_ReplyClosePrinter r;
2818         NTSTATUS status;
2819
2820         /* In parameters */
2821         r.in.handle = handle;
2822
2823         if (DEBUGLEVEL >= 10) {
2824                 NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, &r);
2825         }
2826
2827         status = cli->dispatch(cli,
2828                                 mem_ctx,
2829                                 &ndr_table_spoolss,
2830                                 NDR_SPOOLSS_REPLYCLOSEPRINTER,
2831                                 &r);
2832
2833         if (!NT_STATUS_IS_OK(status)) {
2834                 return status;
2835         }
2836
2837         if (DEBUGLEVEL >= 10) {
2838                 NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, &r);
2839         }
2840
2841         if (NT_STATUS_IS_ERR(status)) {
2842                 return status;
2843         }
2844
2845         /* Return variables */
2846         *handle = *r.out.handle;
2847
2848         /* Return result */
2849         if (werror) {
2850                 *werror = r.out.result;
2851         }
2852
2853         return werror_to_ntstatus(r.out.result);
2854 }
2855
2856 NTSTATUS rpccli_spoolss_AddPortEx(struct rpc_pipe_client *cli,
2857                                   TALLOC_CTX *mem_ctx,
2858                                   WERROR *werror)
2859 {
2860         struct spoolss_AddPortEx r;
2861         NTSTATUS status;
2862
2863         /* In parameters */
2864
2865         if (DEBUGLEVEL >= 10) {
2866                 NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, &r);
2867         }
2868
2869         status = cli->dispatch(cli,
2870                                 mem_ctx,
2871                                 &ndr_table_spoolss,
2872                                 NDR_SPOOLSS_ADDPORTEX,
2873                                 &r);
2874
2875         if (!NT_STATUS_IS_OK(status)) {
2876                 return status;
2877         }
2878
2879         if (DEBUGLEVEL >= 10) {
2880                 NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, &r);
2881         }
2882
2883         if (NT_STATUS_IS_ERR(status)) {
2884                 return status;
2885         }
2886
2887         /* Return variables */
2888
2889         /* Return result */
2890         if (werror) {
2891                 *werror = r.out.result;
2892         }
2893
2894         return werror_to_ntstatus(r.out.result);
2895 }
2896
2897 NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
2898                                                                  TALLOC_CTX *mem_ctx,
2899                                                                  WERROR *werror)
2900 {
2901         struct spoolss_RouterFindFirstPrinterChangeNotification r;
2902         NTSTATUS status;
2903
2904         /* In parameters */
2905
2906         if (DEBUGLEVEL >= 10) {
2907                 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
2908         }
2909
2910         status = cli->dispatch(cli,
2911                                 mem_ctx,
2912                                 &ndr_table_spoolss,
2913                                 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION,
2914                                 &r);
2915
2916         if (!NT_STATUS_IS_OK(status)) {
2917                 return status;
2918         }
2919
2920         if (DEBUGLEVEL >= 10) {
2921                 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
2922         }
2923
2924         if (NT_STATUS_IS_ERR(status)) {
2925                 return status;
2926         }
2927
2928         /* Return variables */
2929
2930         /* Return result */
2931         if (werror) {
2932                 *werror = r.out.result;
2933         }
2934
2935         return werror_to_ntstatus(r.out.result);
2936 }
2937
2938 NTSTATUS rpccli_spoolss_SpoolerInit(struct rpc_pipe_client *cli,
2939                                     TALLOC_CTX *mem_ctx,
2940                                     WERROR *werror)
2941 {
2942         struct spoolss_SpoolerInit r;
2943         NTSTATUS status;
2944
2945         /* In parameters */
2946
2947         if (DEBUGLEVEL >= 10) {
2948                 NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, &r);
2949         }
2950
2951         status = cli->dispatch(cli,
2952                                 mem_ctx,
2953                                 &ndr_table_spoolss,
2954                                 NDR_SPOOLSS_SPOOLERINIT,
2955                                 &r);
2956
2957         if (!NT_STATUS_IS_OK(status)) {
2958                 return status;
2959         }
2960
2961         if (DEBUGLEVEL >= 10) {
2962                 NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, &r);
2963         }
2964
2965         if (NT_STATUS_IS_ERR(status)) {
2966                 return status;
2967         }
2968
2969         /* Return variables */
2970
2971         /* Return result */
2972         if (werror) {
2973                 *werror = r.out.result;
2974         }
2975
2976         return werror_to_ntstatus(r.out.result);
2977 }
2978
2979 NTSTATUS rpccli_spoolss_ResetPrinterEx(struct rpc_pipe_client *cli,
2980                                        TALLOC_CTX *mem_ctx,
2981                                        WERROR *werror)
2982 {
2983         struct spoolss_ResetPrinterEx r;
2984         NTSTATUS status;
2985
2986         /* In parameters */
2987
2988         if (DEBUGLEVEL >= 10) {
2989                 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, &r);
2990         }
2991
2992         status = cli->dispatch(cli,
2993                                 mem_ctx,
2994                                 &ndr_table_spoolss,
2995                                 NDR_SPOOLSS_RESETPRINTEREX,
2996                                 &r);
2997
2998         if (!NT_STATUS_IS_OK(status)) {
2999                 return status;
3000         }
3001
3002         if (DEBUGLEVEL >= 10) {
3003                 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, &r);
3004         }
3005
3006         if (NT_STATUS_IS_ERR(status)) {
3007                 return status;
3008         }
3009
3010         /* Return variables */
3011
3012         /* Return result */
3013         if (werror) {
3014                 *werror = r.out.result;
3015         }
3016
3017         return werror_to_ntstatus(r.out.result);
3018 }
3019
3020 NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
3021                                                              TALLOC_CTX *mem_ctx,
3022                                                              struct policy_handle *handle /* [in] [ref] */,
3023                                                              uint32_t flags /* [in]  */,
3024                                                              uint32_t options /* [in]  */,
3025                                                              const char *str /* [in] [unique,charset(UTF16)] */,
3026                                                              uint32_t printer_local /* [in]  */,
3027                                                              struct spoolss_NotifyOptionsContainer *t1 /* [in] [unique] */,
3028                                                              WERROR *werror)
3029 {
3030         struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
3031         NTSTATUS status;
3032
3033         /* In parameters */
3034         r.in.handle = handle;
3035         r.in.flags = flags;
3036         r.in.options = options;
3037         r.in.str = str;
3038         r.in.printer_local = printer_local;
3039         r.in.t1 = t1;
3040
3041         if (DEBUGLEVEL >= 10) {
3042                 NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
3043         }
3044
3045         status = cli->dispatch(cli,
3046                                 mem_ctx,
3047                                 &ndr_table_spoolss,
3048                                 NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX,
3049                                 &r);
3050
3051         if (!NT_STATUS_IS_OK(status)) {
3052                 return status;
3053         }
3054
3055         if (DEBUGLEVEL >= 10) {
3056                 NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
3057         }
3058
3059         if (NT_STATUS_IS_ERR(status)) {
3060                 return status;
3061         }
3062
3063         /* Return variables */
3064
3065         /* Return result */
3066         if (werror) {
3067                 *werror = r.out.result;
3068         }
3069
3070         return werror_to_ntstatus(r.out.result);
3071 }
3072
3073 NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotification(struct rpc_pipe_client *cli,
3074                                                                TALLOC_CTX *mem_ctx,
3075                                                                WERROR *werror)
3076 {
3077         struct spoolss_RouterRefreshPrinterChangeNotification r;
3078         NTSTATUS status;
3079
3080         /* In parameters */
3081
3082         if (DEBUGLEVEL >= 10) {
3083                 NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotification, &r);
3084         }
3085
3086         status = cli->dispatch(cli,
3087                                 mem_ctx,
3088                                 &ndr_table_spoolss,
3089                                 NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION,
3090                                 &r);
3091
3092         if (!NT_STATUS_IS_OK(status)) {
3093                 return status;
3094         }
3095
3096         if (DEBUGLEVEL >= 10) {
3097                 NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotification, &r);
3098         }
3099
3100         if (NT_STATUS_IS_ERR(status)) {
3101                 return status;
3102         }
3103
3104         /* Return variables */
3105
3106         /* Return result */
3107         if (werror) {
3108                 *werror = r.out.result;
3109         }
3110
3111         return werror_to_ntstatus(r.out.result);
3112 }
3113
3114 NTSTATUS rpccli_spoolss_RemoteFindNextPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
3115                                                             TALLOC_CTX *mem_ctx,
3116                                                             struct policy_handle *handle /* [in] [ref] */,
3117                                                             uint32_t change_low /* [in]  */,
3118                                                             struct spoolss_NotifyOptionsContainer *container /* [in] [unique] */,
3119                                                             struct spoolss_NotifyInfo **info /* [out] [ref] */,
3120                                                             WERROR *werror)
3121 {
3122         struct spoolss_RemoteFindNextPrinterChangeNotifyEx r;
3123         NTSTATUS status;
3124
3125         /* In parameters */
3126         r.in.handle = handle;
3127         r.in.change_low = change_low;
3128         r.in.container = container;
3129
3130         if (DEBUGLEVEL >= 10) {
3131                 NDR_PRINT_IN_DEBUG(spoolss_RemoteFindNextPrinterChangeNotifyEx, &r);
3132         }
3133
3134         status = cli->dispatch(cli,
3135                                 mem_ctx,
3136                                 &ndr_table_spoolss,
3137                                 NDR_SPOOLSS_REMOTEFINDNEXTPRINTERCHANGENOTIFYEX,
3138                                 &r);
3139
3140         if (!NT_STATUS_IS_OK(status)) {
3141                 return status;
3142         }
3143
3144         if (DEBUGLEVEL >= 10) {
3145                 NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindNextPrinterChangeNotifyEx, &r);
3146         }
3147
3148         if (NT_STATUS_IS_ERR(status)) {
3149                 return status;
3150         }
3151
3152         /* Return variables */
3153         *info = *r.out.info;
3154
3155         /* Return result */
3156         if (werror) {
3157                 *werror = r.out.result;
3158         }
3159
3160         return werror_to_ntstatus(r.out.result);
3161 }
3162
3163 NTSTATUS rpccli_spoolss_44(struct rpc_pipe_client *cli,
3164                            TALLOC_CTX *mem_ctx,
3165                            WERROR *werror)
3166 {
3167         struct spoolss_44 r;
3168         NTSTATUS status;
3169
3170         /* In parameters */
3171
3172         if (DEBUGLEVEL >= 10) {
3173                 NDR_PRINT_IN_DEBUG(spoolss_44, &r);
3174         }
3175
3176         status = cli->dispatch(cli,
3177                                 mem_ctx,
3178                                 &ndr_table_spoolss,
3179                                 NDR_SPOOLSS_44,
3180                                 &r);
3181
3182         if (!NT_STATUS_IS_OK(status)) {
3183                 return status;
3184         }
3185
3186         if (DEBUGLEVEL >= 10) {
3187                 NDR_PRINT_OUT_DEBUG(spoolss_44, &r);
3188         }
3189
3190         if (NT_STATUS_IS_ERR(status)) {
3191                 return status;
3192         }
3193
3194         /* Return variables */
3195
3196         /* Return result */
3197         if (werror) {
3198                 *werror = r.out.result;
3199         }
3200
3201         return werror_to_ntstatus(r.out.result);
3202 }
3203
3204 NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
3205                                       TALLOC_CTX *mem_ctx,
3206                                       const char *printername /* [in] [unique,charset(UTF16)] */,
3207                                       const char *datatype /* [in] [unique,charset(UTF16)] */,
3208                                       struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
3209                                       uint32_t access_mask /* [in]  */,
3210                                       uint32_t level /* [in]  */,
3211                                       union spoolss_UserLevel userlevel /* [in] [switch_is(level)] */,
3212                                       struct policy_handle *handle /* [out] [ref] */,
3213                                       WERROR *werror)
3214 {
3215         struct spoolss_OpenPrinterEx r;
3216         NTSTATUS status;
3217
3218         /* In parameters */
3219         r.in.printername = printername;
3220         r.in.datatype = datatype;
3221         r.in.devmode_ctr = devmode_ctr;
3222         r.in.access_mask = access_mask;
3223         r.in.level = level;
3224         r.in.userlevel = userlevel;
3225
3226         if (DEBUGLEVEL >= 10) {
3227                 NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, &r);
3228         }
3229
3230         status = cli->dispatch(cli,
3231                                 mem_ctx,
3232                                 &ndr_table_spoolss,
3233                                 NDR_SPOOLSS_OPENPRINTEREX,
3234                                 &r);
3235
3236         if (!NT_STATUS_IS_OK(status)) {
3237                 return status;
3238         }
3239
3240         if (DEBUGLEVEL >= 10) {
3241                 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, &r);
3242         }
3243
3244         if (NT_STATUS_IS_ERR(status)) {
3245                 return status;
3246         }
3247
3248         /* Return variables */
3249         *handle = *r.out.handle;
3250
3251         /* Return result */
3252         if (werror) {
3253                 *werror = r.out.result;
3254         }
3255
3256         return werror_to_ntstatus(r.out.result);
3257 }
3258
3259 NTSTATUS rpccli_spoolss_AddPrinterEx(struct rpc_pipe_client *cli,
3260                                      TALLOC_CTX *mem_ctx,
3261                                      const char *server /* [in] [unique,charset(UTF16)] */,
3262                                      uint32_t level /* [in]  */,
3263                                      union spoolss_PrinterInfo *info /* [in] [unique,switch_is(level)] */,
3264                                      struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
3265                                      struct security_descriptor *secdesc /* [in] [unique] */,
3266                                      uint32_t ulevel /* [in]  */,
3267                                      union spoolss_UserLevel userlevel /* [in] [switch_is(ulevel)] */,
3268                                      WERROR *werror)
3269 {
3270         struct spoolss_AddPrinterEx r;
3271         NTSTATUS status;
3272
3273         /* In parameters */
3274         r.in.server = server;
3275         r.in.level = level;
3276         r.in.info = info;
3277         r.in.devmode_ctr = devmode_ctr;
3278         r.in.secdesc = secdesc;
3279         r.in.ulevel = ulevel;
3280         r.in.userlevel = userlevel;
3281
3282         if (DEBUGLEVEL >= 10) {
3283                 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, &r);
3284         }
3285
3286         status = cli->dispatch(cli,
3287                                 mem_ctx,
3288                                 &ndr_table_spoolss,
3289                                 NDR_SPOOLSS_ADDPRINTEREX,
3290                                 &r);
3291
3292         if (!NT_STATUS_IS_OK(status)) {
3293                 return status;
3294         }
3295
3296         if (DEBUGLEVEL >= 10) {
3297                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, &r);
3298         }
3299
3300         if (NT_STATUS_IS_ERR(status)) {
3301                 return status;
3302         }
3303
3304         /* Return variables */
3305
3306         /* Return result */
3307         if (werror) {
3308                 *werror = r.out.result;
3309         }
3310
3311         return werror_to_ntstatus(r.out.result);
3312 }
3313
3314 NTSTATUS rpccli_spoolss_47(struct rpc_pipe_client *cli,
3315                            TALLOC_CTX *mem_ctx,
3316                            WERROR *werror)
3317 {
3318         struct spoolss_47 r;
3319         NTSTATUS status;
3320
3321         /* In parameters */
3322
3323         if (DEBUGLEVEL >= 10) {
3324                 NDR_PRINT_IN_DEBUG(spoolss_47, &r);
3325         }
3326
3327         status = cli->dispatch(cli,
3328                                 mem_ctx,
3329                                 &ndr_table_spoolss,
3330                                 NDR_SPOOLSS_47,
3331                                 &r);
3332
3333         if (!NT_STATUS_IS_OK(status)) {
3334                 return status;
3335         }
3336
3337         if (DEBUGLEVEL >= 10) {
3338                 NDR_PRINT_OUT_DEBUG(spoolss_47, &r);
3339         }
3340
3341         if (NT_STATUS_IS_ERR(status)) {
3342                 return status;
3343         }
3344
3345         /* Return variables */
3346
3347         /* Return result */
3348         if (werror) {
3349                 *werror = r.out.result;
3350         }
3351
3352         return werror_to_ntstatus(r.out.result);
3353 }
3354
3355 NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli,
3356                                         TALLOC_CTX *mem_ctx,
3357                                         struct policy_handle *handle /* [in] [ref] */,
3358                                         uint32_t enum_index /* [in]  */,
3359                                         const char *value_name /* [out] [ref,charset(UTF16),size_is(value_offered/2)] */,
3360                                         uint32_t value_offered /* [in]  */,
3361                                         uint32_t *value_needed /* [out] [ref] */,
3362                                         uint32_t *printerdata_type /* [out] [ref] */,
3363                                         DATA_BLOB *buffer /* [out] [ref] */,
3364                                         uint32_t data_offered /* [in]  */,
3365                                         uint32_t *data_needed /* [out] [ref] */,
3366                                         WERROR *werror)
3367 {
3368         struct spoolss_EnumPrinterData r;
3369         NTSTATUS status;
3370
3371         /* In parameters */
3372         r.in.handle = handle;
3373         r.in.enum_index = enum_index;
3374         r.in.value_offered = value_offered;
3375         r.in.data_offered = data_offered;
3376
3377         if (DEBUGLEVEL >= 10) {
3378                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterData, &r);
3379         }
3380
3381         status = cli->dispatch(cli,
3382                                 mem_ctx,
3383                                 &ndr_table_spoolss,
3384                                 NDR_SPOOLSS_ENUMPRINTERDATA,
3385                                 &r);
3386
3387         if (!NT_STATUS_IS_OK(status)) {
3388                 return status;
3389         }
3390
3391         if (DEBUGLEVEL >= 10) {
3392                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterData, &r);
3393         }
3394
3395         if (NT_STATUS_IS_ERR(status)) {
3396                 return status;
3397         }
3398
3399         /* Return variables */
3400         memcpy(CONST_DISCARD(char *, value_name), r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name));
3401         *value_needed = *r.out.value_needed;
3402         *printerdata_type = *r.out.printerdata_type;
3403         *buffer = *r.out.buffer;
3404         *data_needed = *r.out.data_needed;
3405
3406         /* Return result */
3407         if (werror) {
3408                 *werror = r.out.result;
3409         }
3410
3411         return werror_to_ntstatus(r.out.result);
3412 }
3413
3414 NTSTATUS rpccli_spoolss_DeletePrinterData(struct rpc_pipe_client *cli,
3415                                           TALLOC_CTX *mem_ctx,
3416                                           struct policy_handle *handle /* [in] [ref] */,
3417                                           const char *value_name /* [in] [charset(UTF16)] */,
3418                                           WERROR *werror)
3419 {
3420         struct spoolss_DeletePrinterData r;
3421         NTSTATUS status;
3422
3423         /* In parameters */
3424         r.in.handle = handle;
3425         r.in.value_name = value_name;
3426
3427         if (DEBUGLEVEL >= 10) {
3428                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterData, &r);
3429         }
3430
3431         status = cli->dispatch(cli,
3432                                 mem_ctx,
3433                                 &ndr_table_spoolss,
3434                                 NDR_SPOOLSS_DELETEPRINTERDATA,
3435                                 &r);
3436
3437         if (!NT_STATUS_IS_OK(status)) {
3438                 return status;
3439         }
3440
3441         if (DEBUGLEVEL >= 10) {
3442                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterData, &r);
3443         }
3444
3445         if (NT_STATUS_IS_ERR(status)) {
3446                 return status;
3447         }
3448
3449         /* Return variables */
3450
3451         /* Return result */
3452         if (werror) {
3453                 *werror = r.out.result;
3454         }
3455
3456         return werror_to_ntstatus(r.out.result);
3457 }
3458
3459 NTSTATUS rpccli_spoolss_4a(struct rpc_pipe_client *cli,
3460                            TALLOC_CTX *mem_ctx,
3461                            WERROR *werror)
3462 {
3463         struct spoolss_4a r;
3464         NTSTATUS status;
3465
3466         /* In parameters */
3467
3468         if (DEBUGLEVEL >= 10) {
3469                 NDR_PRINT_IN_DEBUG(spoolss_4a, &r);
3470         }
3471
3472         status = cli->dispatch(cli,
3473                                 mem_ctx,
3474                                 &ndr_table_spoolss,
3475                                 NDR_SPOOLSS_4A,
3476                                 &r);
3477
3478         if (!NT_STATUS_IS_OK(status)) {
3479                 return status;
3480         }
3481
3482         if (DEBUGLEVEL >= 10) {
3483                 NDR_PRINT_OUT_DEBUG(spoolss_4a, &r);
3484         }
3485
3486         if (NT_STATUS_IS_ERR(status)) {
3487                 return status;
3488         }
3489
3490         /* Return variables */
3491
3492         /* Return result */
3493         if (werror) {
3494                 *werror = r.out.result;
3495         }
3496
3497         return werror_to_ntstatus(r.out.result);
3498 }
3499
3500 NTSTATUS rpccli_spoolss_4b(struct rpc_pipe_client *cli,
3501                            TALLOC_CTX *mem_ctx,
3502                            WERROR *werror)
3503 {
3504         struct spoolss_4b r;
3505         NTSTATUS status;
3506
3507         /* In parameters */
3508
3509         if (DEBUGLEVEL >= 10) {
3510                 NDR_PRINT_IN_DEBUG(spoolss_4b, &r);
3511         }
3512
3513         status = cli->dispatch(cli,
3514                                 mem_ctx,
3515                                 &ndr_table_spoolss,
3516                                 NDR_SPOOLSS_4B,
3517                                 &r);
3518
3519         if (!NT_STATUS_IS_OK(status)) {
3520                 return status;
3521         }
3522
3523         if (DEBUGLEVEL >= 10) {
3524                 NDR_PRINT_OUT_DEBUG(spoolss_4b, &r);
3525         }
3526
3527         if (NT_STATUS_IS_ERR(status)) {
3528                 return status;
3529         }
3530
3531         /* Return variables */
3532
3533         /* Return result */
3534         if (werror) {
3535                 *werror = r.out.result;
3536         }
3537
3538         return werror_to_ntstatus(r.out.result);
3539 }
3540
3541 NTSTATUS rpccli_spoolss_4c(struct rpc_pipe_client *cli,
3542                            TALLOC_CTX *mem_ctx,
3543                            WERROR *werror)
3544 {
3545         struct spoolss_4c r;
3546         NTSTATUS status;
3547
3548         /* In parameters */
3549
3550         if (DEBUGLEVEL >= 10) {
3551                 NDR_PRINT_IN_DEBUG(spoolss_4c, &r);
3552         }
3553
3554         status = cli->dispatch(cli,
3555                                 mem_ctx,
3556                                 &ndr_table_spoolss,
3557                                 NDR_SPOOLSS_4C,
3558                                 &r);
3559
3560         if (!NT_STATUS_IS_OK(status)) {
3561                 return status;
3562         }
3563
3564         if (DEBUGLEVEL >= 10) {
3565                 NDR_PRINT_OUT_DEBUG(spoolss_4c, &r);
3566         }
3567
3568         if (NT_STATUS_IS_ERR(status)) {
3569                 return status;
3570         }
3571
3572         /* Return variables */
3573
3574         /* Return result */
3575         if (werror) {
3576                 *werror = r.out.result;
3577         }
3578
3579         return werror_to_ntstatus(r.out.result);
3580 }
3581
3582 NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli,
3583                                          TALLOC_CTX *mem_ctx,
3584                                          struct policy_handle *handle /* [in] [ref] */,
3585                                          const char *key_name /* [in] [charset(UTF16)] */,
3586                                          const char *value_name /* [in] [charset(UTF16)] */,
3587                                          uint32_t type /* [in]  */,
3588                                          DATA_BLOB buffer /* [in]  */,
3589                                          uint32_t offered /* [in]  */,
3590                                          WERROR *werror)
3591 {
3592         struct spoolss_SetPrinterDataEx r;
3593         NTSTATUS status;
3594
3595         /* In parameters */
3596         r.in.handle = handle;
3597         r.in.key_name = key_name;
3598         r.in.value_name = value_name;
3599         r.in.type = type;
3600         r.in.buffer = buffer;
3601         r.in.offered = offered;
3602
3603         if (DEBUGLEVEL >= 10) {
3604                 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterDataEx, &r);
3605         }
3606
3607         status = cli->dispatch(cli,
3608                                 mem_ctx,
3609                                 &ndr_table_spoolss,
3610                                 NDR_SPOOLSS_SETPRINTERDATAEX,
3611                                 &r);
3612
3613         if (!NT_STATUS_IS_OK(status)) {
3614                 return status;
3615         }
3616
3617         if (DEBUGLEVEL >= 10) {
3618                 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterDataEx, &r);
3619         }
3620
3621         if (NT_STATUS_IS_ERR(status)) {
3622                 return status;
3623         }
3624
3625         /* Return variables */
3626
3627         /* Return result */
3628         if (werror) {
3629                 *werror = r.out.result;
3630         }
3631
3632         return werror_to_ntstatus(r.out.result);
3633 }
3634
3635 NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
3636                                          TALLOC_CTX *mem_ctx,
3637                                          struct policy_handle *handle /* [in] [ref] */,
3638                                          const char *key_name /* [in] [charset(UTF16)] */,
3639                                          const char *value_name /* [in] [charset(UTF16)] */,
3640                                          uint32_t *type /* [out] [ref] */,
3641                                          uint8_t *buffer /* [out] [ref,size_is(offered)] */,
3642                                          uint32_t offered /* [in]  */,
3643                                          uint32_t *needed /* [out] [ref] */,
3644                                          WERROR *werror)
3645 {
3646         struct spoolss_GetPrinterDataEx r;
3647         NTSTATUS status;
3648
3649         /* In parameters */
3650         r.in.handle = handle;
3651         r.in.key_name = key_name;
3652         r.in.value_name = value_name;
3653         r.in.offered = offered;
3654
3655         if (DEBUGLEVEL >= 10) {
3656                 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDataEx, &r);
3657         }
3658
3659         status = cli->dispatch(cli,
3660                                 mem_ctx,
3661                                 &ndr_table_spoolss,
3662                                 NDR_SPOOLSS_GETPRINTERDATAEX,
3663                                 &r);
3664
3665         if (!NT_STATUS_IS_OK(status)) {
3666                 return status;
3667         }
3668
3669         if (DEBUGLEVEL >= 10) {
3670                 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDataEx, &r);
3671         }
3672
3673         if (NT_STATUS_IS_ERR(status)) {
3674                 return status;
3675         }
3676
3677         /* Return variables */
3678         *type = *r.out.type;
3679         memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
3680         *needed = *r.out.needed;
3681
3682         /* Return result */
3683         if (werror) {
3684                 *werror = r.out.result;
3685         }
3686
3687         return werror_to_ntstatus(r.out.result);
3688 }
3689
3690 NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
3691                                           TALLOC_CTX *mem_ctx,
3692                                           struct policy_handle *handle /* [in] [ref] */,
3693                                           const char *key_name /* [in] [charset(UTF16)] */,
3694                                           uint8_t *buffer /* [out] [ref,size_is(offered)] */,
3695                                           uint32_t offered /* [in]  */,
3696                                           uint32_t *needed /* [out] [ref] */,
3697                                           uint32_t *count /* [out] [ref] */,
3698                                           WERROR *werror)
3699 {
3700         struct spoolss_EnumPrinterDataEx r;
3701         NTSTATUS status;
3702
3703         /* In parameters */
3704         r.in.handle = handle;
3705         r.in.key_name = key_name;
3706         r.in.offered = offered;
3707
3708         if (DEBUGLEVEL >= 10) {
3709                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDataEx, &r);
3710         }
3711
3712         status = cli->dispatch(cli,
3713                                 mem_ctx,
3714                                 &ndr_table_spoolss,
3715                                 NDR_SPOOLSS_ENUMPRINTERDATAEX,
3716                                 &r);
3717
3718         if (!NT_STATUS_IS_OK(status)) {
3719                 return status;
3720         }
3721
3722         if (DEBUGLEVEL >= 10) {
3723                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDataEx, &r);
3724         }
3725
3726         if (NT_STATUS_IS_ERR(status)) {
3727                 return status;
3728         }
3729
3730         /* Return variables */
3731         memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
3732         *needed = *r.out.needed;
3733         *count = *r.out.count;
3734
3735         /* Return result */
3736         if (werror) {
3737                 *werror = r.out.result;
3738         }
3739
3740         return werror_to_ntstatus(r.out.result);
3741 }
3742
3743 NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
3744                                        TALLOC_CTX *mem_ctx,
3745                                        struct policy_handle *handle /* [in] [ref] */,
3746                                        const char *key_name /* [in] [charset(UTF16)] */,
3747                                        uint16_t *key_buffer /* [out] [ref,size_is(key_buffer_size/2)] */,
3748                                        uint32_t key_buffer_size /* [in]  */,
3749                                        uint32_t *needed /* [out] [ref] */,
3750                                        WERROR *werror)
3751 {
3752         struct spoolss_EnumPrinterKey r;
3753         NTSTATUS status;
3754
3755         /* In parameters */
3756         r.in.handle = handle;
3757         r.in.key_name = key_name;
3758         r.in.key_buffer_size = key_buffer_size;
3759
3760         if (DEBUGLEVEL >= 10) {
3761                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &r);
3762         }
3763
3764         status = cli->dispatch(cli,
3765                                 mem_ctx,
3766                                 &ndr_table_spoolss,
3767                                 NDR_SPOOLSS_ENUMPRINTERKEY,
3768                                 &r);
3769
3770         if (!NT_STATUS_IS_OK(status)) {
3771                 return status;
3772         }
3773
3774         if (DEBUGLEVEL >= 10) {
3775                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterKey, &r);
3776         }
3777
3778         if (NT_STATUS_IS_ERR(status)) {
3779                 return status;
3780         }
3781
3782         /* Return variables */
3783         memcpy(key_buffer, r.out.key_buffer, r.in.key_buffer_size / 2 * sizeof(*key_buffer));
3784         *needed = *r.out.needed;
3785
3786         /* Return result */
3787         if (werror) {
3788                 *werror = r.out.result;
3789         }
3790
3791         return werror_to_ntstatus(r.out.result);
3792 }
3793
3794 NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
3795                                             TALLOC_CTX *mem_ctx,
3796                                             struct policy_handle *handle /* [in] [ref] */,
3797                                             const char *key_name /* [in] [charset(UTF16)] */,
3798                                             const char *value_name /* [in] [charset(UTF16)] */,
3799                                             WERROR *werror)
3800 {
3801         struct spoolss_DeletePrinterDataEx r;
3802         NTSTATUS status;
3803
3804         /* In parameters */
3805         r.in.handle = handle;
3806         r.in.key_name = key_name;
3807         r.in.value_name = value_name;
3808
3809         if (DEBUGLEVEL >= 10) {
3810                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDataEx, &r);
3811         }
3812
3813         status = cli->dispatch(cli,
3814                                 mem_ctx,
3815                                 &ndr_table_spoolss,
3816                                 NDR_SPOOLSS_DELETEPRINTERDATAEX,
3817                                 &r);
3818
3819         if (!NT_STATUS_IS_OK(status)) {
3820                 return status;
3821         }
3822
3823         if (DEBUGLEVEL >= 10) {
3824                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDataEx, &r);
3825         }
3826
3827         if (NT_STATUS_IS_ERR(status)) {
3828                 return status;
3829         }
3830
3831         /* Return variables */
3832
3833         /* Return result */
3834         if (werror) {
3835                 *werror = r.out.result;
3836         }
3837
3838         return werror_to_ntstatus(r.out.result);
3839 }
3840
3841 NTSTATUS rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client *cli,
3842                                          TALLOC_CTX *mem_ctx,
3843                                          WERROR *werror)
3844 {
3845         struct spoolss_DeletePrinterKey r;
3846         NTSTATUS status;
3847
3848         /* In parameters */
3849
3850         if (DEBUGLEVEL >= 10) {
3851                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, &r);
3852         }
3853
3854         status = cli->dispatch(cli,
3855                                 mem_ctx,
3856                                 &ndr_table_spoolss,
3857                                 NDR_SPOOLSS_DELETEPRINTERKEY,
3858                                 &r);
3859
3860         if (!NT_STATUS_IS_OK(status)) {
3861                 return status;
3862         }
3863
3864         if (DEBUGLEVEL >= 10) {
3865                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterKey, &r);
3866         }
3867
3868         if (NT_STATUS_IS_ERR(status)) {
3869                 return status;
3870         }
3871
3872         /* Return variables */
3873
3874         /* Return result */
3875         if (werror) {
3876                 *werror = r.out.result;
3877         }
3878
3879         return werror_to_ntstatus(r.out.result);
3880 }
3881
3882 NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli,
3883                            TALLOC_CTX *mem_ctx,
3884                            WERROR *werror)
3885 {
3886         struct spoolss_53 r;
3887         NTSTATUS status;
3888
3889         /* In parameters */
3890
3891         if (DEBUGLEVEL >= 10) {
3892                 NDR_PRINT_IN_DEBUG(spoolss_53, &r);
3893         }
3894
3895         status = cli->dispatch(cli,
3896                                 mem_ctx,
3897                                 &ndr_table_spoolss,
3898                                 NDR_SPOOLSS_53,
3899                                 &r);
3900
3901         if (!NT_STATUS_IS_OK(status)) {
3902                 return status;
3903         }
3904
3905         if (DEBUGLEVEL >= 10) {
3906                 NDR_PRINT_OUT_DEBUG(spoolss_53, &r);
3907         }
3908
3909         if (NT_STATUS_IS_ERR(status)) {
3910                 return status;
3911         }
3912
3913         /* Return variables */
3914
3915         /* Return result */
3916         if (werror) {
3917                 *werror = r.out.result;
3918         }
3919
3920         return werror_to_ntstatus(r.out.result);
3921 }
3922
3923 NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli,
3924                                               TALLOC_CTX *mem_ctx,
3925                                               WERROR *werror)
3926 {
3927         struct spoolss_DeletePrinterDriverEx r;
3928         NTSTATUS status;
3929
3930         /* In parameters */
3931
3932         if (DEBUGLEVEL >= 10) {
3933                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, &r);
3934         }
3935
3936         status = cli->dispatch(cli,
3937                                 mem_ctx,
3938                                 &ndr_table_spoolss,
3939                                 NDR_SPOOLSS_DELETEPRINTERDRIVEREX,
3940                                 &r);
3941
3942         if (!NT_STATUS_IS_OK(status)) {
3943                 return status;
3944         }
3945
3946         if (DEBUGLEVEL >= 10) {
3947                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriverEx, &r);
3948         }
3949
3950         if (NT_STATUS_IS_ERR(status)) {
3951                 return status;
3952         }
3953
3954         /* Return variables */
3955
3956         /* Return result */
3957         if (werror) {
3958                 *werror = r.out.result;
3959         }
3960
3961         return werror_to_ntstatus(r.out.result);
3962 }
3963
3964 NTSTATUS rpccli_spoolss_55(struct rpc_pipe_client *cli,
3965                            TALLOC_CTX *mem_ctx,
3966                            WERROR *werror)
3967 {
3968         struct spoolss_55 r;
3969         NTSTATUS status;
3970
3971         /* In parameters */
3972
3973         if (DEBUGLEVEL >= 10) {
3974                 NDR_PRINT_IN_DEBUG(spoolss_55, &r);
3975         }
3976
3977         status = cli->dispatch(cli,
3978                                 mem_ctx,
3979                                 &ndr_table_spoolss,
3980                                 NDR_SPOOLSS_55,
3981                                 &r);
3982
3983         if (!NT_STATUS_IS_OK(status)) {
3984                 return status;
3985         }
3986
3987         if (DEBUGLEVEL >= 10) {
3988                 NDR_PRINT_OUT_DEBUG(spoolss_55, &r);
3989         }
3990
3991         if (NT_STATUS_IS_ERR(status)) {
3992                 return status;
3993         }
3994
3995         /* Return variables */
3996
3997         /* Return result */
3998         if (werror) {
3999                 *werror = r.out.result;
4000         }
4001
4002         return werror_to_ntstatus(r.out.result);
4003 }
4004
4005 NTSTATUS rpccli_spoolss_56(struct rpc_pipe_client *cli,
4006                            TALLOC_CTX *mem_ctx,
4007                            WERROR *werror)
4008 {
4009         struct spoolss_56 r;
4010         NTSTATUS status;
4011
4012         /* In parameters */
4013
4014         if (DEBUGLEVEL >= 10) {
4015                 NDR_PRINT_IN_DEBUG(spoolss_56, &r);
4016         }
4017
4018         status = cli->dispatch(cli,
4019                                 mem_ctx,
4020                                 &ndr_table_spoolss,
4021                                 NDR_SPOOLSS_56,
4022                                 &r);
4023
4024         if (!NT_STATUS_IS_OK(status)) {
4025                 return status;
4026         }
4027
4028         if (DEBUGLEVEL >= 10) {
4029                 NDR_PRINT_OUT_DEBUG(spoolss_56, &r);
4030         }
4031
4032         if (NT_STATUS_IS_ERR(status)) {
4033                 return status;
4034         }
4035
4036         /* Return variables */
4037
4038         /* Return result */
4039         if (werror) {
4040                 *werror = r.out.result;
4041         }
4042
4043         return werror_to_ntstatus(r.out.result);
4044 }
4045
4046 NTSTATUS rpccli_spoolss_57(struct rpc_pipe_client *cli,
4047                            TALLOC_CTX *mem_ctx,
4048                            WERROR *werror)
4049 {
4050         struct spoolss_57 r;
4051         NTSTATUS status;
4052
4053         /* In parameters */
4054
4055         if (DEBUGLEVEL >= 10) {
4056                 NDR_PRINT_IN_DEBUG(spoolss_57, &r);
4057         }
4058
4059         status = cli->dispatch(cli,
4060                                 mem_ctx,
4061                                 &ndr_table_spoolss,
4062                                 NDR_SPOOLSS_57,
4063                                 &r);
4064
4065         if (!NT_STATUS_IS_OK(status)) {
4066                 return status;
4067         }
4068
4069         if (DEBUGLEVEL >= 10) {
4070                 NDR_PRINT_OUT_DEBUG(spoolss_57, &r);
4071         }
4072
4073         if (NT_STATUS_IS_ERR(status)) {
4074                 return status;
4075         }
4076
4077         /* Return variables */
4078
4079         /* Return result */
4080         if (werror) {
4081                 *werror = r.out.result;
4082         }
4083
4084         return werror_to_ntstatus(r.out.result);
4085 }
4086
4087 NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
4088                                 TALLOC_CTX *mem_ctx,
4089                                 struct policy_handle *handle /* [in] [ref] */,
4090                                 const char *function_name /* [in] [charset(UTF16)] */,
4091                                 DATA_BLOB in_data /* [in]  */,
4092                                 uint32_t _in_data_length /* [in] [value(r->in.in_data.length)] */,
4093                                 uint8_t *out_data /* [out] [ref,size_is(out_data_size)] */,
4094                                 uint32_t out_data_size /* [in]  */,
4095                                 uint32_t *needed /* [out] [ref] */,
4096                                 uint32_t *status_code /* [in,out] [ref] */,
4097                                 WERROR *werror)
4098 {
4099         struct spoolss_XcvData r;
4100         NTSTATUS status;
4101
4102         /* In parameters */
4103         r.in.handle = handle;
4104         r.in.function_name = function_name;
4105         r.in.in_data = in_data;
4106         r.in._in_data_length = _in_data_length;
4107         r.in.out_data_size = out_data_size;
4108         r.in.status_code = status_code;
4109
4110         if (DEBUGLEVEL >= 10) {
4111                 NDR_PRINT_IN_DEBUG(spoolss_XcvData, &r);
4112         }
4113
4114         status = cli->dispatch(cli,
4115                                 mem_ctx,
4116                                 &ndr_table_spoolss,
4117                                 NDR_SPOOLSS_XCVDATA,
4118                                 &r);
4119
4120         if (!NT_STATUS_IS_OK(status)) {
4121                 return status;
4122         }
4123
4124         if (DEBUGLEVEL >= 10) {
4125                 NDR_PRINT_OUT_DEBUG(spoolss_XcvData, &r);
4126         }
4127
4128         if (NT_STATUS_IS_ERR(status)) {
4129                 return status;
4130         }
4131
4132         /* Return variables */
4133         memcpy(out_data, r.out.out_data, r.in.out_data_size * sizeof(*out_data));
4134         *needed = *r.out.needed;
4135         *status_code = *r.out.status_code;
4136
4137         /* Return result */
4138         if (werror) {
4139                 *werror = r.out.result;
4140         }
4141
4142         return werror_to_ntstatus(r.out.result);
4143 }
4144
4145 NTSTATUS rpccli_spoolss_AddPrinterDriverEx(struct rpc_pipe_client *cli,
4146                                            TALLOC_CTX *mem_ctx,
4147                                            WERROR *werror)
4148 {
4149         struct spoolss_AddPrinterDriverEx r;
4150         NTSTATUS status;
4151
4152         /* In parameters */
4153
4154         if (DEBUGLEVEL >= 10) {
4155                 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriverEx, &r);
4156         }
4157
4158         status = cli->dispatch(cli,
4159                                 mem_ctx,
4160                                 &ndr_table_spoolss,
4161                                 NDR_SPOOLSS_ADDPRINTERDRIVEREX,
4162                                 &r);
4163
4164         if (!NT_STATUS_IS_OK(status)) {
4165                 return status;
4166         }
4167
4168         if (DEBUGLEVEL >= 10) {
4169                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriverEx, &r);
4170         }
4171
4172         if (NT_STATUS_IS_ERR(status)) {
4173                 return status;
4174         }
4175
4176         /* Return variables */
4177
4178         /* Return result */
4179         if (werror) {
4180                 *werror = r.out.result;
4181         }
4182
4183         return werror_to_ntstatus(r.out.result);
4184 }
4185
4186 NTSTATUS rpccli_spoolss_5a(struct rpc_pipe_client *cli,
4187                            TALLOC_CTX *mem_ctx,
4188                            WERROR *werror)
4189 {
4190         struct spoolss_5a r;
4191         NTSTATUS status;
4192
4193         /* In parameters */
4194
4195         if (DEBUGLEVEL >= 10) {
4196                 NDR_PRINT_IN_DEBUG(spoolss_5a, &r);
4197         }
4198
4199         status = cli->dispatch(cli,
4200                                 mem_ctx,
4201                                 &ndr_table_spoolss,
4202                                 NDR_SPOOLSS_5A,
4203                                 &r);
4204
4205         if (!NT_STATUS_IS_OK(status)) {
4206                 return status;
4207         }
4208
4209         if (DEBUGLEVEL >= 10) {
4210                 NDR_PRINT_OUT_DEBUG(spoolss_5a, &r);
4211         }
4212
4213         if (NT_STATUS_IS_ERR(status)) {
4214                 return status;
4215         }
4216
4217         /* Return variables */
4218
4219         /* Return result */
4220         if (werror) {
4221                 *werror = r.out.result;
4222         }
4223
4224         return werror_to_ntstatus(r.out.result);
4225 }
4226
4227 NTSTATUS rpccli_spoolss_5b(struct rpc_pipe_client *cli,
4228                            TALLOC_CTX *mem_ctx,
4229                            WERROR *werror)
4230 {
4231         struct spoolss_5b r;
4232         NTSTATUS status;
4233
4234         /* In parameters */
4235
4236         if (DEBUGLEVEL >= 10) {
4237                 NDR_PRINT_IN_DEBUG(spoolss_5b, &r);
4238         }
4239
4240         status = cli->dispatch(cli,
4241                                 mem_ctx,
4242                                 &ndr_table_spoolss,
4243                                 NDR_SPOOLSS_5B,
4244                                 &r);
4245
4246         if (!NT_STATUS_IS_OK(status)) {
4247                 return status;
4248         }
4249
4250         if (DEBUGLEVEL >= 10) {
4251                 NDR_PRINT_OUT_DEBUG(spoolss_5b, &r);
4252         }
4253
4254         if (NT_STATUS_IS_ERR(status)) {
4255                 return status;
4256         }
4257
4258         /* Return variables */
4259
4260         /* Return result */
4261         if (werror) {
4262                 *werror = r.out.result;
4263         }
4264
4265         return werror_to_ntstatus(r.out.result);
4266 }
4267
4268 NTSTATUS rpccli_spoolss_5c(struct rpc_pipe_client *cli,
4269                            TALLOC_CTX *mem_ctx,
4270                            WERROR *werror)
4271 {
4272         struct spoolss_5c r;
4273         NTSTATUS status;
4274
4275         /* In parameters */
4276
4277         if (DEBUGLEVEL >= 10) {
4278                 NDR_PRINT_IN_DEBUG(spoolss_5c, &r);
4279         }
4280
4281         status = cli->dispatch(cli,
4282                                 mem_ctx,
4283                                 &ndr_table_spoolss,
4284                                 NDR_SPOOLSS_5C,
4285                                 &r);
4286
4287         if (!NT_STATUS_IS_OK(status)) {
4288                 return status;
4289         }
4290
4291         if (DEBUGLEVEL >= 10) {
4292                 NDR_PRINT_OUT_DEBUG(spoolss_5c, &r);
4293         }
4294
4295         if (NT_STATUS_IS_ERR(status)) {
4296                 return status;
4297         }
4298
4299         /* Return variables */
4300
4301         /* Return result */
4302         if (werror) {
4303                 *werror = r.out.result;
4304         }
4305
4306         return werror_to_ntstatus(r.out.result);
4307 }
4308
4309 NTSTATUS rpccli_spoolss_5d(struct rpc_pipe_client *cli,
4310                            TALLOC_CTX *mem_ctx,
4311                            WERROR *werror)
4312 {
4313         struct spoolss_5d r;
4314         NTSTATUS status;
4315
4316         /* In parameters */
4317
4318         if (DEBUGLEVEL >= 10) {
4319                 NDR_PRINT_IN_DEBUG(spoolss_5d, &r);
4320         }
4321
4322         status = cli->dispatch(cli,
4323                                 mem_ctx,
4324                                 &ndr_table_spoolss,
4325                                 NDR_SPOOLSS_5D,
4326                                 &r);
4327
4328         if (!NT_STATUS_IS_OK(status)) {
4329                 return status;
4330         }
4331
4332         if (DEBUGLEVEL >= 10) {
4333                 NDR_PRINT_OUT_DEBUG(spoolss_5d, &r);
4334         }
4335
4336         if (NT_STATUS_IS_ERR(status)) {
4337                 return status;
4338         }
4339
4340         /* Return variables */
4341
4342         /* Return result */
4343         if (werror) {
4344                 *werror = r.out.result;
4345         }
4346
4347         return werror_to_ntstatus(r.out.result);
4348 }
4349
4350 NTSTATUS rpccli_spoolss_5e(struct rpc_pipe_client *cli,
4351                            TALLOC_CTX *mem_ctx,
4352                            WERROR *werror)
4353 {
4354         struct spoolss_5e r;
4355         NTSTATUS status;
4356
4357         /* In parameters */
4358
4359         if (DEBUGLEVEL >= 10) {
4360                 NDR_PRINT_IN_DEBUG(spoolss_5e, &r);
4361         }
4362
4363         status = cli->dispatch(cli,
4364                                 mem_ctx,
4365                                 &ndr_table_spoolss,
4366                                 NDR_SPOOLSS_5E,
4367                                 &r);
4368
4369         if (!NT_STATUS_IS_OK(status)) {
4370                 return status;
4371         }
4372
4373         if (DEBUGLEVEL >= 10) {
4374                 NDR_PRINT_OUT_DEBUG(spoolss_5e, &r);
4375         }
4376
4377         if (NT_STATUS_IS_ERR(status)) {
4378                 return status;
4379         }
4380
4381         /* Return variables */
4382
4383         /* Return result */
4384         if (werror) {
4385                 *werror = r.out.result;
4386         }
4387
4388         return werror_to_ntstatus(r.out.result);
4389 }
4390
4391 NTSTATUS rpccli_spoolss_5f(struct rpc_pipe_client *cli,
4392                            TALLOC_CTX *mem_ctx,
4393                            WERROR *werror)
4394 {
4395         struct spoolss_5f r;
4396         NTSTATUS status;
4397
4398         /* In parameters */
4399
4400         if (DEBUGLEVEL >= 10) {
4401                 NDR_PRINT_IN_DEBUG(spoolss_5f, &r);
4402         }
4403
4404         status = cli->dispatch(cli,
4405                                 mem_ctx,
4406                                 &ndr_table_spoolss,
4407                                 NDR_SPOOLSS_5F,
4408                                 &r);
4409
4410         if (!NT_STATUS_IS_OK(status)) {
4411                 return status;
4412         }
4413
4414         if (DEBUGLEVEL >= 10) {
4415                 NDR_PRINT_OUT_DEBUG(spoolss_5f, &r);
4416         }
4417
4418         if (NT_STATUS_IS_ERR(status)) {
4419                 return status;
4420         }
4421
4422         /* Return variables */
4423
4424         /* Return result */
4425         if (werror) {
4426                 *werror = r.out.result;
4427         }
4428
4429         return werror_to_ntstatus(r.out.result);
4430 }
4431