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