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