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