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