s3: re-run make samba3-idl.
[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                                struct policy_handle *handle /* [in] [ref] */,
1194                                uint32_t level /* [in]  */,
1195                                uint8_t *buffer /* [in,out] [unique,size_is(offered)] */,
1196                                uint32_t offered /* [in]  */,
1197                                uint32_t *needed /* [out] [ref] */,
1198                                WERROR *werror)
1199 {
1200         struct spoolss_AddJob r;
1201         NTSTATUS status;
1202
1203         /* In parameters */
1204         r.in.handle = handle;
1205         r.in.level = level;
1206         r.in.buffer = buffer;
1207         r.in.offered = offered;
1208
1209         if (DEBUGLEVEL >= 10) {
1210                 NDR_PRINT_IN_DEBUG(spoolss_AddJob, &r);
1211         }
1212
1213         status = cli->dispatch(cli,
1214                                 mem_ctx,
1215                                 &ndr_table_spoolss,
1216                                 NDR_SPOOLSS_ADDJOB,
1217                                 &r);
1218
1219         if (!NT_STATUS_IS_OK(status)) {
1220                 return status;
1221         }
1222
1223         if (DEBUGLEVEL >= 10) {
1224                 NDR_PRINT_OUT_DEBUG(spoolss_AddJob, &r);
1225         }
1226
1227         if (NT_STATUS_IS_ERR(status)) {
1228                 return status;
1229         }
1230
1231         /* Return variables */
1232         if (buffer && r.out.buffer) {
1233                 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
1234         }
1235         *needed = *r.out.needed;
1236
1237         /* Return result */
1238         if (werror) {
1239                 *werror = r.out.result;
1240         }
1241
1242         return werror_to_ntstatus(r.out.result);
1243 }
1244
1245 NTSTATUS rpccli_spoolss_ScheduleJob(struct rpc_pipe_client *cli,
1246                                     TALLOC_CTX *mem_ctx,
1247                                     struct policy_handle *handle /* [in] [ref] */,
1248                                     uint32_t jobid /* [in]  */,
1249                                     WERROR *werror)
1250 {
1251         struct spoolss_ScheduleJob r;
1252         NTSTATUS status;
1253
1254         /* In parameters */
1255         r.in.handle = handle;
1256         r.in.jobid = jobid;
1257
1258         if (DEBUGLEVEL >= 10) {
1259                 NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, &r);
1260         }
1261
1262         status = cli->dispatch(cli,
1263                                 mem_ctx,
1264                                 &ndr_table_spoolss,
1265                                 NDR_SPOOLSS_SCHEDULEJOB,
1266                                 &r);
1267
1268         if (!NT_STATUS_IS_OK(status)) {
1269                 return status;
1270         }
1271
1272         if (DEBUGLEVEL >= 10) {
1273                 NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, &r);
1274         }
1275
1276         if (NT_STATUS_IS_ERR(status)) {
1277                 return status;
1278         }
1279
1280         /* Return variables */
1281
1282         /* Return result */
1283         if (werror) {
1284                 *werror = r.out.result;
1285         }
1286
1287         return werror_to_ntstatus(r.out.result);
1288 }
1289
1290 NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
1291                                        TALLOC_CTX *mem_ctx,
1292                                        struct policy_handle *handle /* [in] [ref] */,
1293                                        const char *value_name /* [in] [charset(UTF16)] */,
1294                                        uint32_t offered /* [in]  */,
1295                                        enum spoolss_PrinterDataType *type /* [out] [ref] */,
1296                                        union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(*type)] */,
1297                                        uint32_t *needed /* [out] [ref] */,
1298                                        WERROR *werror)
1299 {
1300         struct spoolss_GetPrinterData r;
1301         NTSTATUS status;
1302
1303         /* In parameters */
1304         r.in.handle = handle;
1305         r.in.value_name = value_name;
1306         r.in.offered = offered;
1307
1308         if (DEBUGLEVEL >= 10) {
1309                 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterData, &r);
1310         }
1311
1312         status = cli->dispatch(cli,
1313                                 mem_ctx,
1314                                 &ndr_table_spoolss,
1315                                 NDR_SPOOLSS_GETPRINTERDATA,
1316                                 &r);
1317
1318         if (!NT_STATUS_IS_OK(status)) {
1319                 return status;
1320         }
1321
1322         if (DEBUGLEVEL >= 10) {
1323                 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterData, &r);
1324         }
1325
1326         if (NT_STATUS_IS_ERR(status)) {
1327                 return status;
1328         }
1329
1330         /* Return variables */
1331         *type = *r.out.type;
1332         return NT_STATUS_NOT_SUPPORTED;
1333         *needed = *r.out.needed;
1334
1335         /* Return result */
1336         if (werror) {
1337                 *werror = r.out.result;
1338         }
1339
1340         return werror_to_ntstatus(r.out.result);
1341 }
1342
1343 NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli,
1344                                        TALLOC_CTX *mem_ctx,
1345                                        struct policy_handle *handle /* [in] [ref] */,
1346                                        const char *value_name /* [in] [charset(UTF16)] */,
1347                                        enum spoolss_PrinterDataType type /* [in]  */,
1348                                        union spoolss_PrinterData data /* [in] [subcontext(4),switch_is(type)] */,
1349                                        uint32_t _offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */,
1350                                        WERROR *werror)
1351 {
1352         struct spoolss_SetPrinterData r;
1353         NTSTATUS status;
1354
1355         /* In parameters */
1356         r.in.handle = handle;
1357         r.in.value_name = value_name;
1358         r.in.type = type;
1359         r.in.data = data;
1360         r.in._offered = _offered;
1361
1362         if (DEBUGLEVEL >= 10) {
1363                 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, &r);
1364         }
1365
1366         status = cli->dispatch(cli,
1367                                 mem_ctx,
1368                                 &ndr_table_spoolss,
1369                                 NDR_SPOOLSS_SETPRINTERDATA,
1370                                 &r);
1371
1372         if (!NT_STATUS_IS_OK(status)) {
1373                 return status;
1374         }
1375
1376         if (DEBUGLEVEL >= 10) {
1377                 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterData, &r);
1378         }
1379
1380         if (NT_STATUS_IS_ERR(status)) {
1381                 return status;
1382         }
1383
1384         /* Return variables */
1385
1386         /* Return result */
1387         if (werror) {
1388                 *werror = r.out.result;
1389         }
1390
1391         return werror_to_ntstatus(r.out.result);
1392 }
1393
1394 NTSTATUS rpccli_spoolss_WaitForPrinterChange(struct rpc_pipe_client *cli,
1395                                              TALLOC_CTX *mem_ctx,
1396                                              WERROR *werror)
1397 {
1398         struct spoolss_WaitForPrinterChange r;
1399         NTSTATUS status;
1400
1401         /* In parameters */
1402
1403         if (DEBUGLEVEL >= 10) {
1404                 NDR_PRINT_IN_DEBUG(spoolss_WaitForPrinterChange, &r);
1405         }
1406
1407         status = cli->dispatch(cli,
1408                                 mem_ctx,
1409                                 &ndr_table_spoolss,
1410                                 NDR_SPOOLSS_WAITFORPRINTERCHANGE,
1411                                 &r);
1412
1413         if (!NT_STATUS_IS_OK(status)) {
1414                 return status;
1415         }
1416
1417         if (DEBUGLEVEL >= 10) {
1418                 NDR_PRINT_OUT_DEBUG(spoolss_WaitForPrinterChange, &r);
1419         }
1420
1421         if (NT_STATUS_IS_ERR(status)) {
1422                 return status;
1423         }
1424
1425         /* Return variables */
1426
1427         /* Return result */
1428         if (werror) {
1429                 *werror = r.out.result;
1430         }
1431
1432         return werror_to_ntstatus(r.out.result);
1433 }
1434
1435 NTSTATUS rpccli_spoolss_ClosePrinter(struct rpc_pipe_client *cli,
1436                                      TALLOC_CTX *mem_ctx,
1437                                      struct policy_handle *handle /* [in,out] [ref] */,
1438                                      WERROR *werror)
1439 {
1440         struct spoolss_ClosePrinter r;
1441         NTSTATUS status;
1442
1443         /* In parameters */
1444         r.in.handle = handle;
1445
1446         if (DEBUGLEVEL >= 10) {
1447                 NDR_PRINT_IN_DEBUG(spoolss_ClosePrinter, &r);
1448         }
1449
1450         status = cli->dispatch(cli,
1451                                 mem_ctx,
1452                                 &ndr_table_spoolss,
1453                                 NDR_SPOOLSS_CLOSEPRINTER,
1454                                 &r);
1455
1456         if (!NT_STATUS_IS_OK(status)) {
1457                 return status;
1458         }
1459
1460         if (DEBUGLEVEL >= 10) {
1461                 NDR_PRINT_OUT_DEBUG(spoolss_ClosePrinter, &r);
1462         }
1463
1464         if (NT_STATUS_IS_ERR(status)) {
1465                 return status;
1466         }
1467
1468         /* Return variables */
1469         *handle = *r.out.handle;
1470
1471         /* Return result */
1472         if (werror) {
1473                 *werror = r.out.result;
1474         }
1475
1476         return werror_to_ntstatus(r.out.result);
1477 }
1478
1479 NTSTATUS rpccli_spoolss_AddForm(struct rpc_pipe_client *cli,
1480                                 TALLOC_CTX *mem_ctx,
1481                                 struct policy_handle *handle /* [in] [ref] */,
1482                                 uint32_t level /* [in]  */,
1483                                 union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
1484                                 WERROR *werror)
1485 {
1486         struct spoolss_AddForm r;
1487         NTSTATUS status;
1488
1489         /* In parameters */
1490         r.in.handle = handle;
1491         r.in.level = level;
1492         r.in.info = info;
1493
1494         if (DEBUGLEVEL >= 10) {
1495                 NDR_PRINT_IN_DEBUG(spoolss_AddForm, &r);
1496         }
1497
1498         status = cli->dispatch(cli,
1499                                 mem_ctx,
1500                                 &ndr_table_spoolss,
1501                                 NDR_SPOOLSS_ADDFORM,
1502                                 &r);
1503
1504         if (!NT_STATUS_IS_OK(status)) {
1505                 return status;
1506         }
1507
1508         if (DEBUGLEVEL >= 10) {
1509                 NDR_PRINT_OUT_DEBUG(spoolss_AddForm, &r);
1510         }
1511
1512         if (NT_STATUS_IS_ERR(status)) {
1513                 return status;
1514         }
1515
1516         /* Return variables */
1517
1518         /* Return result */
1519         if (werror) {
1520                 *werror = r.out.result;
1521         }
1522
1523         return werror_to_ntstatus(r.out.result);
1524 }
1525
1526 NTSTATUS rpccli_spoolss_DeleteForm(struct rpc_pipe_client *cli,
1527                                    TALLOC_CTX *mem_ctx,
1528                                    struct policy_handle *handle /* [in] [ref] */,
1529                                    const char *form_name /* [in] [charset(UTF16)] */,
1530                                    WERROR *werror)
1531 {
1532         struct spoolss_DeleteForm r;
1533         NTSTATUS status;
1534
1535         /* In parameters */
1536         r.in.handle = handle;
1537         r.in.form_name = form_name;
1538
1539         if (DEBUGLEVEL >= 10) {
1540                 NDR_PRINT_IN_DEBUG(spoolss_DeleteForm, &r);
1541         }
1542
1543         status = cli->dispatch(cli,
1544                                 mem_ctx,
1545                                 &ndr_table_spoolss,
1546                                 NDR_SPOOLSS_DELETEFORM,
1547                                 &r);
1548
1549         if (!NT_STATUS_IS_OK(status)) {
1550                 return status;
1551         }
1552
1553         if (DEBUGLEVEL >= 10) {
1554                 NDR_PRINT_OUT_DEBUG(spoolss_DeleteForm, &r);
1555         }
1556
1557         if (NT_STATUS_IS_ERR(status)) {
1558                 return status;
1559         }
1560
1561         /* Return variables */
1562
1563         /* Return result */
1564         if (werror) {
1565                 *werror = r.out.result;
1566         }
1567
1568         return werror_to_ntstatus(r.out.result);
1569 }
1570
1571 NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
1572                                 TALLOC_CTX *mem_ctx,
1573                                 struct policy_handle *handle /* [in] [ref] */,
1574                                 const char *form_name /* [in] [charset(UTF16)] */,
1575                                 uint32_t level /* [in]  */,
1576                                 DATA_BLOB *buffer /* [in] [unique] */,
1577                                 uint32_t offered /* [in]  */,
1578                                 union spoolss_FormInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
1579                                 uint32_t *needed /* [out] [ref] */,
1580                                 WERROR *werror)
1581 {
1582         struct spoolss_GetForm r;
1583         NTSTATUS status;
1584
1585         /* In parameters */
1586         r.in.handle = handle;
1587         r.in.form_name = form_name;
1588         r.in.level = level;
1589         r.in.buffer = buffer;
1590         r.in.offered = offered;
1591
1592         if (DEBUGLEVEL >= 10) {
1593                 NDR_PRINT_IN_DEBUG(spoolss_GetForm, &r);
1594         }
1595
1596         status = cli->dispatch(cli,
1597                                 mem_ctx,
1598                                 &ndr_table_spoolss,
1599                                 NDR_SPOOLSS_GETFORM,
1600                                 &r);
1601
1602         if (!NT_STATUS_IS_OK(status)) {
1603                 return status;
1604         }
1605
1606         if (DEBUGLEVEL >= 10) {
1607                 NDR_PRINT_OUT_DEBUG(spoolss_GetForm, &r);
1608         }
1609
1610         if (NT_STATUS_IS_ERR(status)) {
1611                 return status;
1612         }
1613
1614         /* Return variables */
1615         if (info && r.out.info) {
1616                 *info = *r.out.info;
1617         }
1618         *needed = *r.out.needed;
1619
1620         /* Return result */
1621         if (werror) {
1622                 *werror = r.out.result;
1623         }
1624
1625         return werror_to_ntstatus(r.out.result);
1626 }
1627
1628 NTSTATUS rpccli_spoolss_SetForm(struct rpc_pipe_client *cli,
1629                                 TALLOC_CTX *mem_ctx,
1630                                 struct policy_handle *handle /* [in] [ref] */,
1631                                 const char *form_name /* [in] [charset(UTF16)] */,
1632                                 uint32_t level /* [in]  */,
1633                                 union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
1634                                 WERROR *werror)
1635 {
1636         struct spoolss_SetForm r;
1637         NTSTATUS status;
1638
1639         /* In parameters */
1640         r.in.handle = handle;
1641         r.in.form_name = form_name;
1642         r.in.level = level;
1643         r.in.info = info;
1644
1645         if (DEBUGLEVEL >= 10) {
1646                 NDR_PRINT_IN_DEBUG(spoolss_SetForm, &r);
1647         }
1648
1649         status = cli->dispatch(cli,
1650                                 mem_ctx,
1651                                 &ndr_table_spoolss,
1652                                 NDR_SPOOLSS_SETFORM,
1653                                 &r);
1654
1655         if (!NT_STATUS_IS_OK(status)) {
1656                 return status;
1657         }
1658
1659         if (DEBUGLEVEL >= 10) {
1660                 NDR_PRINT_OUT_DEBUG(spoolss_SetForm, &r);
1661         }
1662
1663         if (NT_STATUS_IS_ERR(status)) {
1664                 return status;
1665         }
1666
1667         /* Return variables */
1668
1669         /* Return result */
1670         if (werror) {
1671                 *werror = r.out.result;
1672         }
1673
1674         return werror_to_ntstatus(r.out.result);
1675 }
1676
1677 NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
1678                                   TALLOC_CTX *mem_ctx,
1679                                   struct policy_handle *handle /* [in] [ref] */,
1680                                   uint32_t level /* [in]  */,
1681                                   DATA_BLOB *buffer /* [in] [unique] */,
1682                                   uint32_t offered /* [in]  */,
1683                                   union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
1684                                   uint32_t *needed /* [out] [ref] */,
1685                                   uint32_t count /* [out]  */,
1686                                   WERROR *werror)
1687 {
1688         struct spoolss_EnumForms r;
1689         NTSTATUS status;
1690
1691         /* In parameters */
1692         r.in.handle = handle;
1693         r.in.level = level;
1694         r.in.buffer = buffer;
1695         r.in.offered = offered;
1696
1697         if (DEBUGLEVEL >= 10) {
1698                 NDR_PRINT_IN_DEBUG(spoolss_EnumForms, &r);
1699         }
1700
1701         status = cli->dispatch(cli,
1702                                 mem_ctx,
1703                                 &ndr_table_spoolss,
1704                                 NDR_SPOOLSS_ENUMFORMS,
1705                                 &r);
1706
1707         if (!NT_STATUS_IS_OK(status)) {
1708                 return status;
1709         }
1710
1711         if (DEBUGLEVEL >= 10) {
1712                 NDR_PRINT_OUT_DEBUG(spoolss_EnumForms, &r);
1713         }
1714
1715         if (NT_STATUS_IS_ERR(status)) {
1716                 return status;
1717         }
1718
1719         /* Return variables */
1720         if (info && r.out.info) {
1721                 memcpy(info, r.out.info, count * sizeof(*info));
1722         }
1723         *needed = *r.out.needed;
1724         return NT_STATUS_NOT_SUPPORTED;
1725
1726         /* Return result */
1727         if (werror) {
1728                 *werror = r.out.result;
1729         }
1730
1731         return werror_to_ntstatus(r.out.result);
1732 }
1733
1734 NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
1735                                   TALLOC_CTX *mem_ctx,
1736                                   const char *servername /* [in] [unique,charset(UTF16)] */,
1737                                   uint32_t level /* [in]  */,
1738                                   DATA_BLOB *buffer /* [in] [unique] */,
1739                                   uint32_t offered /* [in]  */,
1740                                   union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
1741                                   uint32_t *needed /* [out] [ref] */,
1742                                   uint32_t count /* [out]  */,
1743                                   WERROR *werror)
1744 {
1745         struct spoolss_EnumPorts r;
1746         NTSTATUS status;
1747
1748         /* In parameters */
1749         r.in.servername = servername;
1750         r.in.level = level;
1751         r.in.buffer = buffer;
1752         r.in.offered = offered;
1753
1754         if (DEBUGLEVEL >= 10) {
1755                 NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, &r);
1756         }
1757
1758         status = cli->dispatch(cli,
1759                                 mem_ctx,
1760                                 &ndr_table_spoolss,
1761                                 NDR_SPOOLSS_ENUMPORTS,
1762                                 &r);
1763
1764         if (!NT_STATUS_IS_OK(status)) {
1765                 return status;
1766         }
1767
1768         if (DEBUGLEVEL >= 10) {
1769                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPorts, &r);
1770         }
1771
1772         if (NT_STATUS_IS_ERR(status)) {
1773                 return status;
1774         }
1775
1776         /* Return variables */
1777         if (info && r.out.info) {
1778                 memcpy(info, r.out.info, count * sizeof(*info));
1779         }
1780         *needed = *r.out.needed;
1781         return NT_STATUS_NOT_SUPPORTED;
1782
1783         /* Return result */
1784         if (werror) {
1785                 *werror = r.out.result;
1786         }
1787
1788         return werror_to_ntstatus(r.out.result);
1789 }
1790
1791 NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
1792                                      TALLOC_CTX *mem_ctx,
1793                                      const char *servername /* [in] [unique,charset(UTF16)] */,
1794                                      uint32_t level /* [in]  */,
1795                                      DATA_BLOB *buffer /* [in] [unique] */,
1796                                      uint32_t offered /* [in]  */,
1797                                      union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
1798                                      uint32_t *needed /* [out] [ref] */,
1799                                      uint32_t count /* [out]  */,
1800                                      WERROR *werror)
1801 {
1802         struct spoolss_EnumMonitors r;
1803         NTSTATUS status;
1804
1805         /* In parameters */
1806         r.in.servername = servername;
1807         r.in.level = level;
1808         r.in.buffer = buffer;
1809         r.in.offered = offered;
1810
1811         if (DEBUGLEVEL >= 10) {
1812                 NDR_PRINT_IN_DEBUG(spoolss_EnumMonitors, &r);
1813         }
1814
1815         status = cli->dispatch(cli,
1816                                 mem_ctx,
1817                                 &ndr_table_spoolss,
1818                                 NDR_SPOOLSS_ENUMMONITORS,
1819                                 &r);
1820
1821         if (!NT_STATUS_IS_OK(status)) {
1822                 return status;
1823         }
1824
1825         if (DEBUGLEVEL >= 10) {
1826                 NDR_PRINT_OUT_DEBUG(spoolss_EnumMonitors, &r);
1827         }
1828
1829         if (NT_STATUS_IS_ERR(status)) {
1830                 return status;
1831         }
1832
1833         /* Return variables */
1834         if (info && r.out.info) {
1835                 memcpy(info, r.out.info, count * sizeof(*info));
1836         }
1837         *needed = *r.out.needed;
1838         return NT_STATUS_NOT_SUPPORTED;
1839
1840         /* Return result */
1841         if (werror) {
1842                 *werror = r.out.result;
1843         }
1844
1845         return werror_to_ntstatus(r.out.result);
1846 }
1847
1848 NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli,
1849                                 TALLOC_CTX *mem_ctx,
1850                                 const char *server_name /* [in] [unique,charset(UTF16)] */,
1851                                 uint32_t unknown /* [in]  */,
1852                                 const char *monitor_name /* [in] [charset(UTF16)] */,
1853                                 WERROR *werror)
1854 {
1855         struct spoolss_AddPort r;
1856         NTSTATUS status;
1857
1858         /* In parameters */
1859         r.in.server_name = server_name;
1860         r.in.unknown = unknown;
1861         r.in.monitor_name = monitor_name;
1862
1863         if (DEBUGLEVEL >= 10) {
1864                 NDR_PRINT_IN_DEBUG(spoolss_AddPort, &r);
1865         }
1866
1867         status = cli->dispatch(cli,
1868                                 mem_ctx,
1869                                 &ndr_table_spoolss,
1870                                 NDR_SPOOLSS_ADDPORT,
1871                                 &r);
1872
1873         if (!NT_STATUS_IS_OK(status)) {
1874                 return status;
1875         }
1876
1877         if (DEBUGLEVEL >= 10) {
1878                 NDR_PRINT_OUT_DEBUG(spoolss_AddPort, &r);
1879         }
1880
1881         if (NT_STATUS_IS_ERR(status)) {
1882                 return status;
1883         }
1884
1885         /* Return variables */
1886
1887         /* Return result */
1888         if (werror) {
1889                 *werror = r.out.result;
1890         }
1891
1892         return werror_to_ntstatus(r.out.result);
1893 }
1894
1895 NTSTATUS rpccli_spoolss_ConfigurePort(struct rpc_pipe_client *cli,
1896                                       TALLOC_CTX *mem_ctx,
1897                                       WERROR *werror)
1898 {
1899         struct spoolss_ConfigurePort r;
1900         NTSTATUS status;
1901
1902         /* In parameters */
1903
1904         if (DEBUGLEVEL >= 10) {
1905                 NDR_PRINT_IN_DEBUG(spoolss_ConfigurePort, &r);
1906         }
1907
1908         status = cli->dispatch(cli,
1909                                 mem_ctx,
1910                                 &ndr_table_spoolss,
1911                                 NDR_SPOOLSS_CONFIGUREPORT,
1912                                 &r);
1913
1914         if (!NT_STATUS_IS_OK(status)) {
1915                 return status;
1916         }
1917
1918         if (DEBUGLEVEL >= 10) {
1919                 NDR_PRINT_OUT_DEBUG(spoolss_ConfigurePort, &r);
1920         }
1921
1922         if (NT_STATUS_IS_ERR(status)) {
1923                 return status;
1924         }
1925
1926         /* Return variables */
1927
1928         /* Return result */
1929         if (werror) {
1930                 *werror = r.out.result;
1931         }
1932
1933         return werror_to_ntstatus(r.out.result);
1934 }
1935
1936 NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
1937                                    TALLOC_CTX *mem_ctx,
1938                                    WERROR *werror)
1939 {
1940         struct spoolss_DeletePort r;
1941         NTSTATUS status;
1942
1943         /* In parameters */
1944
1945         if (DEBUGLEVEL >= 10) {
1946                 NDR_PRINT_IN_DEBUG(spoolss_DeletePort, &r);
1947         }
1948
1949         status = cli->dispatch(cli,
1950                                 mem_ctx,
1951                                 &ndr_table_spoolss,
1952                                 NDR_SPOOLSS_DELETEPORT,
1953                                 &r);
1954
1955         if (!NT_STATUS_IS_OK(status)) {
1956                 return status;
1957         }
1958
1959         if (DEBUGLEVEL >= 10) {
1960                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, &r);
1961         }
1962
1963         if (NT_STATUS_IS_ERR(status)) {
1964                 return status;
1965         }
1966
1967         /* Return variables */
1968
1969         /* Return result */
1970         if (werror) {
1971                 *werror = r.out.result;
1972         }
1973
1974         return werror_to_ntstatus(r.out.result);
1975 }
1976
1977 NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
1978                                         TALLOC_CTX *mem_ctx,
1979                                         WERROR *werror)
1980 {
1981         struct spoolss_CreatePrinterIC r;
1982         NTSTATUS status;
1983
1984         /* In parameters */
1985
1986         if (DEBUGLEVEL >= 10) {
1987                 NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &r);
1988         }
1989
1990         status = cli->dispatch(cli,
1991                                 mem_ctx,
1992                                 &ndr_table_spoolss,
1993                                 NDR_SPOOLSS_CREATEPRINTERIC,
1994                                 &r);
1995
1996         if (!NT_STATUS_IS_OK(status)) {
1997                 return status;
1998         }
1999
2000         if (DEBUGLEVEL >= 10) {
2001                 NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, &r);
2002         }
2003
2004         if (NT_STATUS_IS_ERR(status)) {
2005                 return status;
2006         }
2007
2008         /* Return variables */
2009
2010         /* Return result */
2011         if (werror) {
2012                 *werror = r.out.result;
2013         }
2014
2015         return werror_to_ntstatus(r.out.result);
2016 }
2017
2018 NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
2019                                                  TALLOC_CTX *mem_ctx,
2020                                                  WERROR *werror)
2021 {
2022         struct spoolss_PlayGDIScriptOnPrinterIC r;
2023         NTSTATUS status;
2024
2025         /* In parameters */
2026
2027         if (DEBUGLEVEL >= 10) {
2028                 NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
2029         }
2030
2031         status = cli->dispatch(cli,
2032                                 mem_ctx,
2033                                 &ndr_table_spoolss,
2034                                 NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
2035                                 &r);
2036
2037         if (!NT_STATUS_IS_OK(status)) {
2038                 return status;
2039         }
2040
2041         if (DEBUGLEVEL >= 10) {
2042                 NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
2043         }
2044
2045         if (NT_STATUS_IS_ERR(status)) {
2046                 return status;
2047         }
2048
2049         /* Return variables */
2050
2051         /* Return result */
2052         if (werror) {
2053                 *werror = r.out.result;
2054         }
2055
2056         return werror_to_ntstatus(r.out.result);
2057 }
2058
2059 NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
2060                                         TALLOC_CTX *mem_ctx,
2061                                         WERROR *werror)
2062 {
2063         struct spoolss_DeletePrinterIC r;
2064         NTSTATUS status;
2065
2066         /* In parameters */
2067
2068         if (DEBUGLEVEL >= 10) {
2069                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &r);
2070         }
2071
2072         status = cli->dispatch(cli,
2073                                 mem_ctx,
2074                                 &ndr_table_spoolss,
2075                                 NDR_SPOOLSS_DELETEPRINTERIC,
2076                                 &r);
2077
2078         if (!NT_STATUS_IS_OK(status)) {
2079                 return status;
2080         }
2081
2082         if (DEBUGLEVEL >= 10) {
2083                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, &r);
2084         }
2085
2086         if (NT_STATUS_IS_ERR(status)) {
2087                 return status;
2088         }
2089
2090         /* Return variables */
2091
2092         /* Return result */
2093         if (werror) {
2094                 *werror = r.out.result;
2095         }
2096
2097         return werror_to_ntstatus(r.out.result);
2098 }
2099
2100 NTSTATUS rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client *cli,
2101                                              TALLOC_CTX *mem_ctx,
2102                                              WERROR *werror)
2103 {
2104         struct spoolss_AddPrinterConnection r;
2105         NTSTATUS status;
2106
2107         /* In parameters */
2108
2109         if (DEBUGLEVEL >= 10) {
2110                 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, &r);
2111         }
2112
2113         status = cli->dispatch(cli,
2114                                 mem_ctx,
2115                                 &ndr_table_spoolss,
2116                                 NDR_SPOOLSS_ADDPRINTERCONNECTION,
2117                                 &r);
2118
2119         if (!NT_STATUS_IS_OK(status)) {
2120                 return status;
2121         }
2122
2123         if (DEBUGLEVEL >= 10) {
2124                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, &r);
2125         }
2126
2127         if (NT_STATUS_IS_ERR(status)) {
2128                 return status;
2129         }
2130
2131         /* Return variables */
2132
2133         /* Return result */
2134         if (werror) {
2135                 *werror = r.out.result;
2136         }
2137
2138         return werror_to_ntstatus(r.out.result);
2139 }
2140
2141 NTSTATUS rpccli_spoolss_DeletePrinterConnection(struct rpc_pipe_client *cli,
2142                                                 TALLOC_CTX *mem_ctx,
2143                                                 WERROR *werror)
2144 {
2145         struct spoolss_DeletePrinterConnection r;
2146         NTSTATUS status;
2147
2148         /* In parameters */
2149
2150         if (DEBUGLEVEL >= 10) {
2151                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, &r);
2152         }
2153
2154         status = cli->dispatch(cli,
2155                                 mem_ctx,
2156                                 &ndr_table_spoolss,
2157                                 NDR_SPOOLSS_DELETEPRINTERCONNECTION,
2158                                 &r);
2159
2160         if (!NT_STATUS_IS_OK(status)) {
2161                 return status;
2162         }
2163
2164         if (DEBUGLEVEL >= 10) {
2165                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, &r);
2166         }
2167
2168         if (NT_STATUS_IS_ERR(status)) {
2169                 return status;
2170         }
2171
2172         /* Return variables */
2173
2174         /* Return result */
2175         if (werror) {
2176                 *werror = r.out.result;
2177         }
2178
2179         return werror_to_ntstatus(r.out.result);
2180 }
2181
2182 NTSTATUS rpccli_spoolss_PrinterMessageBox(struct rpc_pipe_client *cli,
2183                                           TALLOC_CTX *mem_ctx,
2184                                           WERROR *werror)
2185 {
2186         struct spoolss_PrinterMessageBox r;
2187         NTSTATUS status;
2188
2189         /* In parameters */
2190
2191         if (DEBUGLEVEL >= 10) {
2192                 NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, &r);
2193         }
2194
2195         status = cli->dispatch(cli,
2196                                 mem_ctx,
2197                                 &ndr_table_spoolss,
2198                                 NDR_SPOOLSS_PRINTERMESSAGEBOX,
2199                                 &r);
2200
2201         if (!NT_STATUS_IS_OK(status)) {
2202                 return status;
2203         }
2204
2205         if (DEBUGLEVEL >= 10) {
2206                 NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, &r);
2207         }
2208
2209         if (NT_STATUS_IS_ERR(status)) {
2210                 return status;
2211         }
2212
2213         /* Return variables */
2214
2215         /* Return result */
2216         if (werror) {
2217                 *werror = r.out.result;
2218         }
2219
2220         return werror_to_ntstatus(r.out.result);
2221 }
2222
2223 NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
2224                                    TALLOC_CTX *mem_ctx,
2225                                    WERROR *werror)
2226 {
2227         struct spoolss_AddMonitor r;
2228         NTSTATUS status;
2229
2230         /* In parameters */
2231
2232         if (DEBUGLEVEL >= 10) {
2233                 NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, &r);
2234         }
2235
2236         status = cli->dispatch(cli,
2237                                 mem_ctx,
2238                                 &ndr_table_spoolss,
2239                                 NDR_SPOOLSS_ADDMONITOR,
2240                                 &r);
2241
2242         if (!NT_STATUS_IS_OK(status)) {
2243                 return status;
2244         }
2245
2246         if (DEBUGLEVEL >= 10) {
2247                 NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, &r);
2248         }
2249
2250         if (NT_STATUS_IS_ERR(status)) {
2251                 return status;
2252         }
2253
2254         /* Return variables */
2255
2256         /* Return result */
2257         if (werror) {
2258                 *werror = r.out.result;
2259         }
2260
2261         return werror_to_ntstatus(r.out.result);
2262 }
2263
2264 NTSTATUS rpccli_spoolss_DeleteMonitor(struct rpc_pipe_client *cli,
2265                                       TALLOC_CTX *mem_ctx,
2266                                       WERROR *werror)
2267 {
2268         struct spoolss_DeleteMonitor r;
2269         NTSTATUS status;
2270
2271         /* In parameters */
2272
2273         if (DEBUGLEVEL >= 10) {
2274                 NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, &r);
2275         }
2276
2277         status = cli->dispatch(cli,
2278                                 mem_ctx,
2279                                 &ndr_table_spoolss,
2280                                 NDR_SPOOLSS_DELETEMONITOR,
2281                                 &r);
2282
2283         if (!NT_STATUS_IS_OK(status)) {
2284                 return status;
2285         }
2286
2287         if (DEBUGLEVEL >= 10) {
2288                 NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, &r);
2289         }
2290
2291         if (NT_STATUS_IS_ERR(status)) {
2292                 return status;
2293         }
2294
2295         /* Return variables */
2296
2297         /* Return result */
2298         if (werror) {
2299                 *werror = r.out.result;
2300         }
2301
2302         return werror_to_ntstatus(r.out.result);
2303 }
2304
2305 NTSTATUS rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client *cli,
2306                                              TALLOC_CTX *mem_ctx,
2307                                              WERROR *werror)
2308 {
2309         struct spoolss_DeletePrintProcessor r;
2310         NTSTATUS status;
2311
2312         /* In parameters */
2313
2314         if (DEBUGLEVEL >= 10) {
2315                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, &r);
2316         }
2317
2318         status = cli->dispatch(cli,
2319                                 mem_ctx,
2320                                 &ndr_table_spoolss,
2321                                 NDR_SPOOLSS_DELETEPRINTPROCESSOR,
2322                                 &r);
2323
2324         if (!NT_STATUS_IS_OK(status)) {
2325                 return status;
2326         }
2327
2328         if (DEBUGLEVEL >= 10) {
2329                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, &r);
2330         }
2331
2332         if (NT_STATUS_IS_ERR(status)) {
2333                 return status;
2334         }
2335
2336         /* Return variables */
2337
2338         /* Return result */
2339         if (werror) {
2340                 *werror = r.out.result;
2341         }
2342
2343         return werror_to_ntstatus(r.out.result);
2344 }
2345
2346 NTSTATUS rpccli_spoolss_AddPrintProvidor(struct rpc_pipe_client *cli,
2347                                          TALLOC_CTX *mem_ctx,
2348                                          WERROR *werror)
2349 {
2350         struct spoolss_AddPrintProvidor r;
2351         NTSTATUS status;
2352
2353         /* In parameters */
2354
2355         if (DEBUGLEVEL >= 10) {
2356                 NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, &r);
2357         }
2358
2359         status = cli->dispatch(cli,
2360                                 mem_ctx,
2361                                 &ndr_table_spoolss,
2362                                 NDR_SPOOLSS_ADDPRINTPROVIDOR,
2363                                 &r);
2364
2365         if (!NT_STATUS_IS_OK(status)) {
2366                 return status;
2367         }
2368
2369         if (DEBUGLEVEL >= 10) {
2370                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, &r);
2371         }
2372
2373         if (NT_STATUS_IS_ERR(status)) {
2374                 return status;
2375         }
2376
2377         /* Return variables */
2378
2379         /* Return result */
2380         if (werror) {
2381                 *werror = r.out.result;
2382         }
2383
2384         return werror_to_ntstatus(r.out.result);
2385 }
2386
2387 NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli,
2388                                             TALLOC_CTX *mem_ctx,
2389                                             WERROR *werror)
2390 {
2391         struct spoolss_DeletePrintProvidor r;
2392         NTSTATUS status;
2393
2394         /* In parameters */
2395
2396         if (DEBUGLEVEL >= 10) {
2397                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, &r);
2398         }
2399
2400         status = cli->dispatch(cli,
2401                                 mem_ctx,
2402                                 &ndr_table_spoolss,
2403                                 NDR_SPOOLSS_DELETEPRINTPROVIDOR,
2404                                 &r);
2405
2406         if (!NT_STATUS_IS_OK(status)) {
2407                 return status;
2408         }
2409
2410         if (DEBUGLEVEL >= 10) {
2411                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, &r);
2412         }
2413
2414         if (NT_STATUS_IS_ERR(status)) {
2415                 return status;
2416         }
2417
2418         /* Return variables */
2419
2420         /* Return result */
2421         if (werror) {
2422                 *werror = r.out.result;
2423         }
2424
2425         return werror_to_ntstatus(r.out.result);
2426 }
2427
2428 NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli,
2429                                                TALLOC_CTX *mem_ctx,
2430                                                WERROR *werror)
2431 {
2432         struct spoolss_EnumPrintProcDataTypes r;
2433         NTSTATUS status;
2434
2435         /* In parameters */
2436
2437         if (DEBUGLEVEL >= 10) {
2438                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
2439         }
2440
2441         status = cli->dispatch(cli,
2442                                 mem_ctx,
2443                                 &ndr_table_spoolss,
2444                                 NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
2445                                 &r);
2446
2447         if (!NT_STATUS_IS_OK(status)) {
2448                 return status;
2449         }
2450
2451         if (DEBUGLEVEL >= 10) {
2452                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
2453         }
2454
2455         if (NT_STATUS_IS_ERR(status)) {
2456                 return status;
2457         }
2458
2459         /* Return variables */
2460
2461         /* Return result */
2462         if (werror) {
2463                 *werror = r.out.result;
2464         }
2465
2466         return werror_to_ntstatus(r.out.result);
2467 }
2468
2469 NTSTATUS rpccli_spoolss_ResetPrinter(struct rpc_pipe_client *cli,
2470                                      TALLOC_CTX *mem_ctx,
2471                                      WERROR *werror)
2472 {
2473         struct spoolss_ResetPrinter r;
2474         NTSTATUS status;
2475
2476         /* In parameters */
2477
2478         if (DEBUGLEVEL >= 10) {
2479                 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, &r);
2480         }
2481
2482         status = cli->dispatch(cli,
2483                                 mem_ctx,
2484                                 &ndr_table_spoolss,
2485                                 NDR_SPOOLSS_RESETPRINTER,
2486                                 &r);
2487
2488         if (!NT_STATUS_IS_OK(status)) {
2489                 return status;
2490         }
2491
2492         if (DEBUGLEVEL >= 10) {
2493                 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, &r);
2494         }
2495
2496         if (NT_STATUS_IS_ERR(status)) {
2497                 return status;
2498         }
2499
2500         /* Return variables */
2501
2502         /* Return result */
2503         if (werror) {
2504                 *werror = r.out.result;
2505         }
2506
2507         return werror_to_ntstatus(r.out.result);
2508 }
2509
2510 NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
2511                                           TALLOC_CTX *mem_ctx,
2512                                           struct policy_handle *handle /* [in] [ref] */,
2513                                           const char *architecture /* [in] [unique,charset(UTF16)] */,
2514                                           uint32_t level /* [in]  */,
2515                                           DATA_BLOB *buffer /* [in] [unique] */,
2516                                           uint32_t offered /* [in]  */,
2517                                           uint32_t client_major_version /* [in]  */,
2518                                           uint32_t client_minor_version /* [in]  */,
2519                                           DATA_BLOB *info /* [out] [unique] */,
2520                                           uint32_t *needed /* [out] [ref] */,
2521                                           uint32_t *server_major_version /* [out] [ref] */,
2522                                           uint32_t *server_minor_version /* [out] [ref] */,
2523                                           WERROR *werror)
2524 {
2525         struct spoolss_GetPrinterDriver2 r;
2526         NTSTATUS status;
2527
2528         /* In parameters */
2529         r.in.handle = handle;
2530         r.in.architecture = architecture;
2531         r.in.level = level;
2532         r.in.buffer = buffer;
2533         r.in.offered = offered;
2534         r.in.client_major_version = client_major_version;
2535         r.in.client_minor_version = client_minor_version;
2536
2537         if (DEBUGLEVEL >= 10) {
2538                 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, &r);
2539         }
2540
2541         status = cli->dispatch(cli,
2542                                 mem_ctx,
2543                                 &ndr_table_spoolss,
2544                                 NDR_SPOOLSS_GETPRINTERDRIVER2,
2545                                 &r);
2546
2547         if (!NT_STATUS_IS_OK(status)) {
2548                 return status;
2549         }
2550
2551         if (DEBUGLEVEL >= 10) {
2552                 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, &r);
2553         }
2554
2555         if (NT_STATUS_IS_ERR(status)) {
2556                 return status;
2557         }
2558
2559         /* Return variables */
2560         if (info && r.out.info) {
2561                 *info = *r.out.info;
2562         }
2563         *needed = *r.out.needed;
2564         *server_major_version = *r.out.server_major_version;
2565         *server_minor_version = *r.out.server_minor_version;
2566
2567         /* Return result */
2568         if (werror) {
2569                 *werror = r.out.result;
2570         }
2571
2572         return werror_to_ntstatus(r.out.result);
2573 }
2574
2575 NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
2576                                                            TALLOC_CTX *mem_ctx,
2577                                                            WERROR *werror)
2578 {
2579         struct spoolss_FindFirstPrinterChangeNotification r;
2580         NTSTATUS status;
2581
2582         /* In parameters */
2583
2584         if (DEBUGLEVEL >= 10) {
2585                 NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
2586         }
2587
2588         status = cli->dispatch(cli,
2589                                 mem_ctx,
2590                                 &ndr_table_spoolss,
2591                                 NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
2592                                 &r);
2593
2594         if (!NT_STATUS_IS_OK(status)) {
2595                 return status;
2596         }
2597
2598         if (DEBUGLEVEL >= 10) {
2599                 NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
2600         }
2601
2602         if (NT_STATUS_IS_ERR(status)) {
2603                 return status;
2604         }
2605
2606         /* Return variables */
2607
2608         /* Return result */
2609         if (werror) {
2610                 *werror = r.out.result;
2611         }
2612
2613         return werror_to_ntstatus(r.out.result);
2614 }
2615
2616 NTSTATUS rpccli_spoolss_FindNextPrinterChangeNotification(struct rpc_pipe_client *cli,
2617                                                           TALLOC_CTX *mem_ctx,
2618                                                           WERROR *werror)
2619 {
2620         struct spoolss_FindNextPrinterChangeNotification r;
2621         NTSTATUS status;
2622
2623         /* In parameters */
2624
2625         if (DEBUGLEVEL >= 10) {
2626                 NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
2627         }
2628
2629         status = cli->dispatch(cli,
2630                                 mem_ctx,
2631                                 &ndr_table_spoolss,
2632                                 NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
2633                                 &r);
2634
2635         if (!NT_STATUS_IS_OK(status)) {
2636                 return status;
2637         }
2638
2639         if (DEBUGLEVEL >= 10) {
2640                 NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
2641         }
2642
2643         if (NT_STATUS_IS_ERR(status)) {
2644                 return status;
2645         }
2646
2647         /* Return variables */
2648
2649         /* Return result */
2650         if (werror) {
2651                 *werror = r.out.result;
2652         }
2653
2654         return werror_to_ntstatus(r.out.result);
2655 }
2656
2657 NTSTATUS rpccli_spoolss_FindClosePrinterNotify(struct rpc_pipe_client *cli,
2658                                                TALLOC_CTX *mem_ctx,
2659                                                struct policy_handle *handle /* [in] [ref] */,
2660                                                WERROR *werror)
2661 {
2662         struct spoolss_FindClosePrinterNotify r;
2663         NTSTATUS status;
2664
2665         /* In parameters */
2666         r.in.handle = handle;
2667
2668         if (DEBUGLEVEL >= 10) {
2669                 NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, &r);
2670         }
2671
2672         status = cli->dispatch(cli,
2673                                 mem_ctx,
2674                                 &ndr_table_spoolss,
2675                                 NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
2676                                 &r);
2677
2678         if (!NT_STATUS_IS_OK(status)) {
2679                 return status;
2680         }
2681
2682         if (DEBUGLEVEL >= 10) {
2683                 NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, &r);
2684         }
2685
2686         if (NT_STATUS_IS_ERR(status)) {
2687                 return status;
2688         }
2689
2690         /* Return variables */
2691
2692         /* Return result */
2693         if (werror) {
2694                 *werror = r.out.result;
2695         }
2696
2697         return werror_to_ntstatus(r.out.result);
2698 }
2699
2700 NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld(struct rpc_pipe_client *cli,
2701                                                                     TALLOC_CTX *mem_ctx,
2702                                                                     WERROR *werror)
2703 {
2704         struct spoolss_RouterFindFirstPrinterChangeNotificationOld r;
2705         NTSTATUS status;
2706
2707         /* In parameters */
2708
2709         if (DEBUGLEVEL >= 10) {
2710                 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
2711         }
2712
2713         status = cli->dispatch(cli,
2714                                 mem_ctx,
2715                                 &ndr_table_spoolss,
2716                                 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
2717                                 &r);
2718
2719         if (!NT_STATUS_IS_OK(status)) {
2720                 return status;
2721         }
2722
2723         if (DEBUGLEVEL >= 10) {
2724                 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
2725         }
2726
2727         if (NT_STATUS_IS_ERR(status)) {
2728                 return status;
2729         }
2730
2731         /* Return variables */
2732
2733         /* Return result */
2734         if (werror) {
2735                 *werror = r.out.result;
2736         }
2737
2738         return werror_to_ntstatus(r.out.result);
2739 }
2740
2741 NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
2742                                          TALLOC_CTX *mem_ctx,
2743                                          const char *server_name /* [in] [charset(UTF16)] */,
2744                                          uint32_t printer_local /* [in]  */,
2745                                          enum winreg_Type type /* [in]  */,
2746                                          uint32_t bufsize /* [in] [range(0,512)] */,
2747                                          uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
2748                                          struct policy_handle *handle /* [out] [ref] */,
2749                                          WERROR *werror)
2750 {
2751         struct spoolss_ReplyOpenPrinter r;
2752         NTSTATUS status;
2753
2754         /* In parameters */
2755         r.in.server_name = server_name;
2756         r.in.printer_local = printer_local;
2757         r.in.type = type;
2758         r.in.bufsize = bufsize;
2759         r.in.buffer = buffer;
2760
2761         if (DEBUGLEVEL >= 10) {
2762                 NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, &r);
2763         }
2764
2765         status = cli->dispatch(cli,
2766                                 mem_ctx,
2767                                 &ndr_table_spoolss,
2768                                 NDR_SPOOLSS_REPLYOPENPRINTER,
2769                                 &r);
2770
2771         if (!NT_STATUS_IS_OK(status)) {
2772                 return status;
2773         }
2774
2775         if (DEBUGLEVEL >= 10) {
2776                 NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, &r);
2777         }
2778
2779         if (NT_STATUS_IS_ERR(status)) {
2780                 return status;
2781         }
2782
2783         /* Return variables */
2784         *handle = *r.out.handle;
2785
2786         /* Return result */
2787         if (werror) {
2788                 *werror = r.out.result;
2789         }
2790
2791         return werror_to_ntstatus(r.out.result);
2792 }
2793
2794 NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
2795                                            TALLOC_CTX *mem_ctx,
2796                                            struct policy_handle *handle /* [in] [ref] */,
2797                                            uint32_t flags /* [in]  */,
2798                                            uint32_t bufsize /* [in] [range(0,512)] */,
2799                                            uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
2800                                            WERROR *werror)
2801 {
2802         struct spoolss_RouterReplyPrinter r;
2803         NTSTATUS status;
2804
2805         /* In parameters */
2806         r.in.handle = handle;
2807         r.in.flags = flags;
2808         r.in.bufsize = bufsize;
2809         r.in.buffer = buffer;
2810
2811         if (DEBUGLEVEL >= 10) {
2812                 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &r);
2813         }
2814
2815         status = cli->dispatch(cli,
2816                                 mem_ctx,
2817                                 &ndr_table_spoolss,
2818                                 NDR_SPOOLSS_ROUTERREPLYPRINTER,
2819                                 &r);
2820
2821         if (!NT_STATUS_IS_OK(status)) {
2822                 return status;
2823         }
2824
2825         if (DEBUGLEVEL >= 10) {
2826                 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, &r);
2827         }
2828
2829         if (NT_STATUS_IS_ERR(status)) {
2830                 return status;
2831         }
2832
2833         /* Return variables */
2834
2835         /* Return result */
2836         if (werror) {
2837                 *werror = r.out.result;
2838         }
2839
2840         return werror_to_ntstatus(r.out.result);
2841 }
2842
2843 NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
2844                                           TALLOC_CTX *mem_ctx,
2845                                           struct policy_handle *handle /* [in,out] [ref] */,
2846                                           WERROR *werror)
2847 {
2848         struct spoolss_ReplyClosePrinter r;
2849         NTSTATUS status;
2850
2851         /* In parameters */
2852         r.in.handle = handle;
2853
2854         if (DEBUGLEVEL >= 10) {
2855                 NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, &r);
2856         }
2857
2858         status = cli->dispatch(cli,
2859                                 mem_ctx,
2860                                 &ndr_table_spoolss,
2861                                 NDR_SPOOLSS_REPLYCLOSEPRINTER,
2862                                 &r);
2863
2864         if (!NT_STATUS_IS_OK(status)) {
2865                 return status;
2866         }
2867
2868         if (DEBUGLEVEL >= 10) {
2869                 NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, &r);
2870         }
2871
2872         if (NT_STATUS_IS_ERR(status)) {
2873                 return status;
2874         }
2875
2876         /* Return variables */
2877         *handle = *r.out.handle;
2878
2879         /* Return result */
2880         if (werror) {
2881                 *werror = r.out.result;
2882         }
2883
2884         return werror_to_ntstatus(r.out.result);
2885 }
2886
2887 NTSTATUS rpccli_spoolss_AddPortEx(struct rpc_pipe_client *cli,
2888                                   TALLOC_CTX *mem_ctx,
2889                                   WERROR *werror)
2890 {
2891         struct spoolss_AddPortEx r;
2892         NTSTATUS status;
2893
2894         /* In parameters */
2895
2896         if (DEBUGLEVEL >= 10) {
2897                 NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, &r);
2898         }
2899
2900         status = cli->dispatch(cli,
2901                                 mem_ctx,
2902                                 &ndr_table_spoolss,
2903                                 NDR_SPOOLSS_ADDPORTEX,
2904                                 &r);
2905
2906         if (!NT_STATUS_IS_OK(status)) {
2907                 return status;
2908         }
2909
2910         if (DEBUGLEVEL >= 10) {
2911                 NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, &r);
2912         }
2913
2914         if (NT_STATUS_IS_ERR(status)) {
2915                 return status;
2916         }
2917
2918         /* Return variables */
2919
2920         /* Return result */
2921         if (werror) {
2922                 *werror = r.out.result;
2923         }
2924
2925         return werror_to_ntstatus(r.out.result);
2926 }
2927
2928 NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
2929                                                                  TALLOC_CTX *mem_ctx,
2930                                                                  WERROR *werror)
2931 {
2932         struct spoolss_RouterFindFirstPrinterChangeNotification r;
2933         NTSTATUS status;
2934
2935         /* In parameters */
2936
2937         if (DEBUGLEVEL >= 10) {
2938                 NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
2939         }
2940
2941         status = cli->dispatch(cli,
2942                                 mem_ctx,
2943                                 &ndr_table_spoolss,
2944                                 NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION,
2945                                 &r);
2946
2947         if (!NT_STATUS_IS_OK(status)) {
2948                 return status;
2949         }
2950
2951         if (DEBUGLEVEL >= 10) {
2952                 NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
2953         }
2954
2955         if (NT_STATUS_IS_ERR(status)) {
2956                 return status;
2957         }
2958
2959         /* Return variables */
2960
2961         /* Return result */
2962         if (werror) {
2963                 *werror = r.out.result;
2964         }
2965
2966         return werror_to_ntstatus(r.out.result);
2967 }
2968
2969 NTSTATUS rpccli_spoolss_SpoolerInit(struct rpc_pipe_client *cli,
2970                                     TALLOC_CTX *mem_ctx,
2971                                     WERROR *werror)
2972 {
2973         struct spoolss_SpoolerInit r;
2974         NTSTATUS status;
2975
2976         /* In parameters */
2977
2978         if (DEBUGLEVEL >= 10) {
2979                 NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, &r);
2980         }
2981
2982         status = cli->dispatch(cli,
2983                                 mem_ctx,
2984                                 &ndr_table_spoolss,
2985                                 NDR_SPOOLSS_SPOOLERINIT,
2986                                 &r);
2987
2988         if (!NT_STATUS_IS_OK(status)) {
2989                 return status;
2990         }
2991
2992         if (DEBUGLEVEL >= 10) {
2993                 NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, &r);
2994         }
2995
2996         if (NT_STATUS_IS_ERR(status)) {
2997                 return status;
2998         }
2999
3000         /* Return variables */
3001
3002         /* Return result */
3003         if (werror) {
3004                 *werror = r.out.result;
3005         }
3006
3007         return werror_to_ntstatus(r.out.result);
3008 }
3009
3010 NTSTATUS rpccli_spoolss_ResetPrinterEx(struct rpc_pipe_client *cli,
3011                                        TALLOC_CTX *mem_ctx,
3012                                        WERROR *werror)
3013 {
3014         struct spoolss_ResetPrinterEx r;
3015         NTSTATUS status;
3016
3017         /* In parameters */
3018
3019         if (DEBUGLEVEL >= 10) {
3020                 NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, &r);
3021         }
3022
3023         status = cli->dispatch(cli,
3024                                 mem_ctx,
3025                                 &ndr_table_spoolss,
3026                                 NDR_SPOOLSS_RESETPRINTEREX,
3027                                 &r);
3028
3029         if (!NT_STATUS_IS_OK(status)) {
3030                 return status;
3031         }
3032
3033         if (DEBUGLEVEL >= 10) {
3034                 NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, &r);
3035         }
3036
3037         if (NT_STATUS_IS_ERR(status)) {
3038                 return status;
3039         }
3040
3041         /* Return variables */
3042
3043         /* Return result */
3044         if (werror) {
3045                 *werror = r.out.result;
3046         }
3047
3048         return werror_to_ntstatus(r.out.result);
3049 }
3050
3051 NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
3052                                                              TALLOC_CTX *mem_ctx,
3053                                                              struct policy_handle *handle /* [in] [ref] */,
3054                                                              uint32_t flags /* [in]  */,
3055                                                              uint32_t options /* [in]  */,
3056                                                              const char *str /* [in] [unique,charset(UTF16)] */,
3057                                                              uint32_t printer_local /* [in]  */,
3058                                                              struct spoolss_NotifyOptionsContainer *t1 /* [in] [unique] */,
3059                                                              WERROR *werror)
3060 {
3061         struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
3062         NTSTATUS status;
3063
3064         /* In parameters */
3065         r.in.handle = handle;
3066         r.in.flags = flags;
3067         r.in.options = options;
3068         r.in.str = str;
3069         r.in.printer_local = printer_local;
3070         r.in.t1 = t1;
3071
3072         if (DEBUGLEVEL >= 10) {
3073                 NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
3074         }
3075
3076         status = cli->dispatch(cli,
3077                                 mem_ctx,
3078                                 &ndr_table_spoolss,
3079                                 NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX,
3080                                 &r);
3081
3082         if (!NT_STATUS_IS_OK(status)) {
3083                 return status;
3084         }
3085
3086         if (DEBUGLEVEL >= 10) {
3087                 NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
3088         }
3089
3090         if (NT_STATUS_IS_ERR(status)) {
3091                 return status;
3092         }
3093
3094         /* Return variables */
3095
3096         /* Return result */
3097         if (werror) {
3098                 *werror = r.out.result;
3099         }
3100
3101         return werror_to_ntstatus(r.out.result);
3102 }
3103
3104 NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotification(struct rpc_pipe_client *cli,
3105                                                                TALLOC_CTX *mem_ctx,
3106                                                                WERROR *werror)
3107 {
3108         struct spoolss_RouterRefreshPrinterChangeNotification r;
3109         NTSTATUS status;
3110
3111         /* In parameters */
3112
3113         if (DEBUGLEVEL >= 10) {
3114                 NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotification, &r);
3115         }
3116
3117         status = cli->dispatch(cli,
3118                                 mem_ctx,
3119                                 &ndr_table_spoolss,
3120                                 NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION,
3121                                 &r);
3122
3123         if (!NT_STATUS_IS_OK(status)) {
3124                 return status;
3125         }
3126
3127         if (DEBUGLEVEL >= 10) {
3128                 NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotification, &r);
3129         }
3130
3131         if (NT_STATUS_IS_ERR(status)) {
3132                 return status;
3133         }
3134
3135         /* Return variables */
3136
3137         /* Return result */
3138         if (werror) {
3139                 *werror = r.out.result;
3140         }
3141
3142         return werror_to_ntstatus(r.out.result);
3143 }
3144
3145 NTSTATUS rpccli_spoolss_RemoteFindNextPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
3146                                                             TALLOC_CTX *mem_ctx,
3147                                                             struct policy_handle *handle /* [in] [ref] */,
3148                                                             uint32_t change_low /* [in]  */,
3149                                                             struct spoolss_NotifyOptionsContainer *container /* [in] [unique] */,
3150                                                             struct spoolss_NotifyInfo **info /* [out] [ref] */,
3151                                                             WERROR *werror)
3152 {
3153         struct spoolss_RemoteFindNextPrinterChangeNotifyEx r;
3154         NTSTATUS status;
3155
3156         /* In parameters */
3157         r.in.handle = handle;
3158         r.in.change_low = change_low;
3159         r.in.container = container;
3160
3161         if (DEBUGLEVEL >= 10) {
3162                 NDR_PRINT_IN_DEBUG(spoolss_RemoteFindNextPrinterChangeNotifyEx, &r);
3163         }
3164
3165         status = cli->dispatch(cli,
3166                                 mem_ctx,
3167                                 &ndr_table_spoolss,
3168                                 NDR_SPOOLSS_REMOTEFINDNEXTPRINTERCHANGENOTIFYEX,
3169                                 &r);
3170
3171         if (!NT_STATUS_IS_OK(status)) {
3172                 return status;
3173         }
3174
3175         if (DEBUGLEVEL >= 10) {
3176                 NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindNextPrinterChangeNotifyEx, &r);
3177         }
3178
3179         if (NT_STATUS_IS_ERR(status)) {
3180                 return status;
3181         }
3182
3183         /* Return variables */
3184         *info = *r.out.info;
3185
3186         /* Return result */
3187         if (werror) {
3188                 *werror = r.out.result;
3189         }
3190
3191         return werror_to_ntstatus(r.out.result);
3192 }
3193
3194 NTSTATUS rpccli_spoolss_44(struct rpc_pipe_client *cli,
3195                            TALLOC_CTX *mem_ctx,
3196                            WERROR *werror)
3197 {
3198         struct spoolss_44 r;
3199         NTSTATUS status;
3200
3201         /* In parameters */
3202
3203         if (DEBUGLEVEL >= 10) {
3204                 NDR_PRINT_IN_DEBUG(spoolss_44, &r);
3205         }
3206
3207         status = cli->dispatch(cli,
3208                                 mem_ctx,
3209                                 &ndr_table_spoolss,
3210                                 NDR_SPOOLSS_44,
3211                                 &r);
3212
3213         if (!NT_STATUS_IS_OK(status)) {
3214                 return status;
3215         }
3216
3217         if (DEBUGLEVEL >= 10) {
3218                 NDR_PRINT_OUT_DEBUG(spoolss_44, &r);
3219         }
3220
3221         if (NT_STATUS_IS_ERR(status)) {
3222                 return status;
3223         }
3224
3225         /* Return variables */
3226
3227         /* Return result */
3228         if (werror) {
3229                 *werror = r.out.result;
3230         }
3231
3232         return werror_to_ntstatus(r.out.result);
3233 }
3234
3235 NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
3236                                       TALLOC_CTX *mem_ctx,
3237                                       const char *printername /* [in] [unique,charset(UTF16)] */,
3238                                       const char *datatype /* [in] [unique,charset(UTF16)] */,
3239                                       struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
3240                                       uint32_t access_mask /* [in]  */,
3241                                       uint32_t level /* [in]  */,
3242                                       union spoolss_UserLevel userlevel /* [in] [switch_is(level)] */,
3243                                       struct policy_handle *handle /* [out] [ref] */,
3244                                       WERROR *werror)
3245 {
3246         struct spoolss_OpenPrinterEx r;
3247         NTSTATUS status;
3248
3249         /* In parameters */
3250         r.in.printername = printername;
3251         r.in.datatype = datatype;
3252         r.in.devmode_ctr = devmode_ctr;
3253         r.in.access_mask = access_mask;
3254         r.in.level = level;
3255         r.in.userlevel = userlevel;
3256
3257         if (DEBUGLEVEL >= 10) {
3258                 NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, &r);
3259         }
3260
3261         status = cli->dispatch(cli,
3262                                 mem_ctx,
3263                                 &ndr_table_spoolss,
3264                                 NDR_SPOOLSS_OPENPRINTEREX,
3265                                 &r);
3266
3267         if (!NT_STATUS_IS_OK(status)) {
3268                 return status;
3269         }
3270
3271         if (DEBUGLEVEL >= 10) {
3272                 NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, &r);
3273         }
3274
3275         if (NT_STATUS_IS_ERR(status)) {
3276                 return status;
3277         }
3278
3279         /* Return variables */
3280         *handle = *r.out.handle;
3281
3282         /* Return result */
3283         if (werror) {
3284                 *werror = r.out.result;
3285         }
3286
3287         return werror_to_ntstatus(r.out.result);
3288 }
3289
3290 NTSTATUS rpccli_spoolss_AddPrinterEx(struct rpc_pipe_client *cli,
3291                                      TALLOC_CTX *mem_ctx,
3292                                      const char *server /* [in] [unique,charset(UTF16)] */,
3293                                      uint32_t level /* [in]  */,
3294                                      union spoolss_PrinterInfo *info /* [in] [unique,switch_is(level)] */,
3295                                      struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
3296                                      struct security_descriptor *secdesc /* [in] [unique] */,
3297                                      uint32_t ulevel /* [in]  */,
3298                                      union spoolss_UserLevel userlevel /* [in] [switch_is(ulevel)] */,
3299                                      WERROR *werror)
3300 {
3301         struct spoolss_AddPrinterEx r;
3302         NTSTATUS status;
3303
3304         /* In parameters */
3305         r.in.server = server;
3306         r.in.level = level;
3307         r.in.info = info;
3308         r.in.devmode_ctr = devmode_ctr;
3309         r.in.secdesc = secdesc;
3310         r.in.ulevel = ulevel;
3311         r.in.userlevel = userlevel;
3312
3313         if (DEBUGLEVEL >= 10) {
3314                 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, &r);
3315         }
3316
3317         status = cli->dispatch(cli,
3318                                 mem_ctx,
3319                                 &ndr_table_spoolss,
3320                                 NDR_SPOOLSS_ADDPRINTEREX,
3321                                 &r);
3322
3323         if (!NT_STATUS_IS_OK(status)) {
3324                 return status;
3325         }
3326
3327         if (DEBUGLEVEL >= 10) {
3328                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, &r);
3329         }
3330
3331         if (NT_STATUS_IS_ERR(status)) {
3332                 return status;
3333         }
3334
3335         /* Return variables */
3336
3337         /* Return result */
3338         if (werror) {
3339                 *werror = r.out.result;
3340         }
3341
3342         return werror_to_ntstatus(r.out.result);
3343 }
3344
3345 NTSTATUS rpccli_spoolss_47(struct rpc_pipe_client *cli,
3346                            TALLOC_CTX *mem_ctx,
3347                            WERROR *werror)
3348 {
3349         struct spoolss_47 r;
3350         NTSTATUS status;
3351
3352         /* In parameters */
3353
3354         if (DEBUGLEVEL >= 10) {
3355                 NDR_PRINT_IN_DEBUG(spoolss_47, &r);
3356         }
3357
3358         status = cli->dispatch(cli,
3359                                 mem_ctx,
3360                                 &ndr_table_spoolss,
3361                                 NDR_SPOOLSS_47,
3362                                 &r);
3363
3364         if (!NT_STATUS_IS_OK(status)) {
3365                 return status;
3366         }
3367
3368         if (DEBUGLEVEL >= 10) {
3369                 NDR_PRINT_OUT_DEBUG(spoolss_47, &r);
3370         }
3371
3372         if (NT_STATUS_IS_ERR(status)) {
3373                 return status;
3374         }
3375
3376         /* Return variables */
3377
3378         /* Return result */
3379         if (werror) {
3380                 *werror = r.out.result;
3381         }
3382
3383         return werror_to_ntstatus(r.out.result);
3384 }
3385
3386 NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli,
3387                                         TALLOC_CTX *mem_ctx,
3388                                         struct policy_handle *handle /* [in] [ref] */,
3389                                         uint32_t enum_index /* [in]  */,
3390                                         const char *value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
3391                                         uint32_t value_offered /* [in]  */,
3392                                         uint32_t *value_needed /* [out] [ref] */,
3393                                         uint32_t *printerdata_type /* [out] [ref] */,
3394                                         DATA_BLOB *buffer /* [out] [ref] */,
3395                                         uint32_t data_offered /* [in]  */,
3396                                         uint32_t *data_needed /* [out] [ref] */,
3397                                         WERROR *werror)
3398 {
3399         struct spoolss_EnumPrinterData r;
3400         NTSTATUS status;
3401
3402         /* In parameters */
3403         r.in.handle = handle;
3404         r.in.enum_index = enum_index;
3405         r.in.value_offered = value_offered;
3406         r.in.data_offered = data_offered;
3407
3408         if (DEBUGLEVEL >= 10) {
3409                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterData, &r);
3410         }
3411
3412         status = cli->dispatch(cli,
3413                                 mem_ctx,
3414                                 &ndr_table_spoolss,
3415                                 NDR_SPOOLSS_ENUMPRINTERDATA,
3416                                 &r);
3417
3418         if (!NT_STATUS_IS_OK(status)) {
3419                 return status;
3420         }
3421
3422         if (DEBUGLEVEL >= 10) {
3423                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterData, &r);
3424         }
3425
3426         if (NT_STATUS_IS_ERR(status)) {
3427                 return status;
3428         }
3429
3430         /* Return variables */
3431         memcpy(CONST_DISCARD(char *, value_name), r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name));
3432         *value_needed = *r.out.value_needed;
3433         *printerdata_type = *r.out.printerdata_type;
3434         *buffer = *r.out.buffer;
3435         *data_needed = *r.out.data_needed;
3436
3437         /* Return result */
3438         if (werror) {
3439                 *werror = r.out.result;
3440         }
3441
3442         return werror_to_ntstatus(r.out.result);
3443 }
3444
3445 NTSTATUS rpccli_spoolss_DeletePrinterData(struct rpc_pipe_client *cli,
3446                                           TALLOC_CTX *mem_ctx,
3447                                           struct policy_handle *handle /* [in] [ref] */,
3448                                           const char *value_name /* [in] [charset(UTF16)] */,
3449                                           WERROR *werror)
3450 {
3451         struct spoolss_DeletePrinterData r;
3452         NTSTATUS status;
3453
3454         /* In parameters */
3455         r.in.handle = handle;
3456         r.in.value_name = value_name;
3457
3458         if (DEBUGLEVEL >= 10) {
3459                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterData, &r);
3460         }
3461
3462         status = cli->dispatch(cli,
3463                                 mem_ctx,
3464                                 &ndr_table_spoolss,
3465                                 NDR_SPOOLSS_DELETEPRINTERDATA,
3466                                 &r);
3467
3468         if (!NT_STATUS_IS_OK(status)) {
3469                 return status;
3470         }
3471
3472         if (DEBUGLEVEL >= 10) {
3473                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterData, &r);
3474         }
3475
3476         if (NT_STATUS_IS_ERR(status)) {
3477                 return status;
3478         }
3479
3480         /* Return variables */
3481
3482         /* Return result */
3483         if (werror) {
3484                 *werror = r.out.result;
3485         }
3486
3487         return werror_to_ntstatus(r.out.result);
3488 }
3489
3490 NTSTATUS rpccli_spoolss_4a(struct rpc_pipe_client *cli,
3491                            TALLOC_CTX *mem_ctx,
3492                            WERROR *werror)
3493 {
3494         struct spoolss_4a r;
3495         NTSTATUS status;
3496
3497         /* In parameters */
3498
3499         if (DEBUGLEVEL >= 10) {
3500                 NDR_PRINT_IN_DEBUG(spoolss_4a, &r);
3501         }
3502
3503         status = cli->dispatch(cli,
3504                                 mem_ctx,
3505                                 &ndr_table_spoolss,
3506                                 NDR_SPOOLSS_4A,
3507                                 &r);
3508
3509         if (!NT_STATUS_IS_OK(status)) {
3510                 return status;
3511         }
3512
3513         if (DEBUGLEVEL >= 10) {
3514                 NDR_PRINT_OUT_DEBUG(spoolss_4a, &r);
3515         }
3516
3517         if (NT_STATUS_IS_ERR(status)) {
3518                 return status;
3519         }
3520
3521         /* Return variables */
3522
3523         /* Return result */
3524         if (werror) {
3525                 *werror = r.out.result;
3526         }
3527
3528         return werror_to_ntstatus(r.out.result);
3529 }
3530
3531 NTSTATUS rpccli_spoolss_4b(struct rpc_pipe_client *cli,
3532                            TALLOC_CTX *mem_ctx,
3533                            WERROR *werror)
3534 {
3535         struct spoolss_4b r;
3536         NTSTATUS status;
3537
3538         /* In parameters */
3539
3540         if (DEBUGLEVEL >= 10) {
3541                 NDR_PRINT_IN_DEBUG(spoolss_4b, &r);
3542         }
3543
3544         status = cli->dispatch(cli,
3545                                 mem_ctx,
3546                                 &ndr_table_spoolss,
3547                                 NDR_SPOOLSS_4B,
3548                                 &r);
3549
3550         if (!NT_STATUS_IS_OK(status)) {
3551                 return status;
3552         }
3553
3554         if (DEBUGLEVEL >= 10) {
3555                 NDR_PRINT_OUT_DEBUG(spoolss_4b, &r);
3556         }
3557
3558         if (NT_STATUS_IS_ERR(status)) {
3559                 return status;
3560         }
3561
3562         /* Return variables */
3563
3564         /* Return result */
3565         if (werror) {
3566                 *werror = r.out.result;
3567         }
3568
3569         return werror_to_ntstatus(r.out.result);
3570 }
3571
3572 NTSTATUS rpccli_spoolss_4c(struct rpc_pipe_client *cli,
3573                            TALLOC_CTX *mem_ctx,
3574                            WERROR *werror)
3575 {
3576         struct spoolss_4c r;
3577         NTSTATUS status;
3578
3579         /* In parameters */
3580
3581         if (DEBUGLEVEL >= 10) {
3582                 NDR_PRINT_IN_DEBUG(spoolss_4c, &r);
3583         }
3584
3585         status = cli->dispatch(cli,
3586                                 mem_ctx,
3587                                 &ndr_table_spoolss,
3588                                 NDR_SPOOLSS_4C,
3589                                 &r);
3590
3591         if (!NT_STATUS_IS_OK(status)) {
3592                 return status;
3593         }
3594
3595         if (DEBUGLEVEL >= 10) {
3596                 NDR_PRINT_OUT_DEBUG(spoolss_4c, &r);
3597         }
3598
3599         if (NT_STATUS_IS_ERR(status)) {
3600                 return status;
3601         }
3602
3603         /* Return variables */
3604
3605         /* Return result */
3606         if (werror) {
3607                 *werror = r.out.result;
3608         }
3609
3610         return werror_to_ntstatus(r.out.result);
3611 }
3612
3613 NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli,
3614                                          TALLOC_CTX *mem_ctx,
3615                                          struct policy_handle *handle /* [in] [ref] */,
3616                                          const char *key_name /* [in] [charset(UTF16)] */,
3617                                          const char *value_name /* [in] [charset(UTF16)] */,
3618                                          uint32_t type /* [in]  */,
3619                                          DATA_BLOB buffer /* [in]  */,
3620                                          uint32_t offered /* [in]  */,
3621                                          WERROR *werror)
3622 {
3623         struct spoolss_SetPrinterDataEx r;
3624         NTSTATUS status;
3625
3626         /* In parameters */
3627         r.in.handle = handle;
3628         r.in.key_name = key_name;
3629         r.in.value_name = value_name;
3630         r.in.type = type;
3631         r.in.buffer = buffer;
3632         r.in.offered = offered;
3633
3634         if (DEBUGLEVEL >= 10) {
3635                 NDR_PRINT_IN_DEBUG(spoolss_SetPrinterDataEx, &r);
3636         }
3637
3638         status = cli->dispatch(cli,
3639                                 mem_ctx,
3640                                 &ndr_table_spoolss,
3641                                 NDR_SPOOLSS_SETPRINTERDATAEX,
3642                                 &r);
3643
3644         if (!NT_STATUS_IS_OK(status)) {
3645                 return status;
3646         }
3647
3648         if (DEBUGLEVEL >= 10) {
3649                 NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterDataEx, &r);
3650         }
3651
3652         if (NT_STATUS_IS_ERR(status)) {
3653                 return status;
3654         }
3655
3656         /* Return variables */
3657
3658         /* Return result */
3659         if (werror) {
3660                 *werror = r.out.result;
3661         }
3662
3663         return werror_to_ntstatus(r.out.result);
3664 }
3665
3666 NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
3667                                          TALLOC_CTX *mem_ctx,
3668                                          struct policy_handle *handle /* [in] [ref] */,
3669                                          const char *key_name /* [in] [charset(UTF16)] */,
3670                                          const char *value_name /* [in] [charset(UTF16)] */,
3671                                          uint32_t *type /* [out] [ref] */,
3672                                          uint8_t *buffer /* [out] [ref,size_is(offered)] */,
3673                                          uint32_t offered /* [in]  */,
3674                                          uint32_t *needed /* [out] [ref] */,
3675                                          WERROR *werror)
3676 {
3677         struct spoolss_GetPrinterDataEx r;
3678         NTSTATUS status;
3679
3680         /* In parameters */
3681         r.in.handle = handle;
3682         r.in.key_name = key_name;
3683         r.in.value_name = value_name;
3684         r.in.offered = offered;
3685
3686         if (DEBUGLEVEL >= 10) {
3687                 NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDataEx, &r);
3688         }
3689
3690         status = cli->dispatch(cli,
3691                                 mem_ctx,
3692                                 &ndr_table_spoolss,
3693                                 NDR_SPOOLSS_GETPRINTERDATAEX,
3694                                 &r);
3695
3696         if (!NT_STATUS_IS_OK(status)) {
3697                 return status;
3698         }
3699
3700         if (DEBUGLEVEL >= 10) {
3701                 NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDataEx, &r);
3702         }
3703
3704         if (NT_STATUS_IS_ERR(status)) {
3705                 return status;
3706         }
3707
3708         /* Return variables */
3709         *type = *r.out.type;
3710         memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
3711         *needed = *r.out.needed;
3712
3713         /* Return result */
3714         if (werror) {
3715                 *werror = r.out.result;
3716         }
3717
3718         return werror_to_ntstatus(r.out.result);
3719 }
3720
3721 NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
3722                                           TALLOC_CTX *mem_ctx,
3723                                           struct policy_handle *handle /* [in] [ref] */,
3724                                           const char *key_name /* [in] [charset(UTF16)] */,
3725                                           uint8_t *buffer /* [out] [ref,size_is(offered)] */,
3726                                           uint32_t offered /* [in]  */,
3727                                           uint32_t *needed /* [out] [ref] */,
3728                                           uint32_t *count /* [out] [ref] */,
3729                                           WERROR *werror)
3730 {
3731         struct spoolss_EnumPrinterDataEx r;
3732         NTSTATUS status;
3733
3734         /* In parameters */
3735         r.in.handle = handle;
3736         r.in.key_name = key_name;
3737         r.in.offered = offered;
3738
3739         if (DEBUGLEVEL >= 10) {
3740                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDataEx, &r);
3741         }
3742
3743         status = cli->dispatch(cli,
3744                                 mem_ctx,
3745                                 &ndr_table_spoolss,
3746                                 NDR_SPOOLSS_ENUMPRINTERDATAEX,
3747                                 &r);
3748
3749         if (!NT_STATUS_IS_OK(status)) {
3750                 return status;
3751         }
3752
3753         if (DEBUGLEVEL >= 10) {
3754                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDataEx, &r);
3755         }
3756
3757         if (NT_STATUS_IS_ERR(status)) {
3758                 return status;
3759         }
3760
3761         /* Return variables */
3762         memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
3763         *needed = *r.out.needed;
3764         *count = *r.out.count;
3765
3766         /* Return result */
3767         if (werror) {
3768                 *werror = r.out.result;
3769         }
3770
3771         return werror_to_ntstatus(r.out.result);
3772 }
3773
3774 NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
3775                                        TALLOC_CTX *mem_ctx,
3776                                        struct policy_handle *handle /* [in] [ref] */,
3777                                        const char *key_name /* [in] [charset(UTF16)] */,
3778                                        uint16_t *key_buffer /* [out] [ref,size_is(key_buffer_size/2)] */,
3779                                        uint32_t key_buffer_size /* [in]  */,
3780                                        uint32_t *needed /* [out] [ref] */,
3781                                        WERROR *werror)
3782 {
3783         struct spoolss_EnumPrinterKey r;
3784         NTSTATUS status;
3785
3786         /* In parameters */
3787         r.in.handle = handle;
3788         r.in.key_name = key_name;
3789         r.in.key_buffer_size = key_buffer_size;
3790
3791         if (DEBUGLEVEL >= 10) {
3792                 NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &r);
3793         }
3794
3795         status = cli->dispatch(cli,
3796                                 mem_ctx,
3797                                 &ndr_table_spoolss,
3798                                 NDR_SPOOLSS_ENUMPRINTERKEY,
3799                                 &r);
3800
3801         if (!NT_STATUS_IS_OK(status)) {
3802                 return status;
3803         }
3804
3805         if (DEBUGLEVEL >= 10) {
3806                 NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterKey, &r);
3807         }
3808
3809         if (NT_STATUS_IS_ERR(status)) {
3810                 return status;
3811         }
3812
3813         /* Return variables */
3814         memcpy(key_buffer, r.out.key_buffer, r.in.key_buffer_size / 2 * sizeof(*key_buffer));
3815         *needed = *r.out.needed;
3816
3817         /* Return result */
3818         if (werror) {
3819                 *werror = r.out.result;
3820         }
3821
3822         return werror_to_ntstatus(r.out.result);
3823 }
3824
3825 NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
3826                                             TALLOC_CTX *mem_ctx,
3827                                             struct policy_handle *handle /* [in] [ref] */,
3828                                             const char *key_name /* [in] [charset(UTF16)] */,
3829                                             const char *value_name /* [in] [charset(UTF16)] */,
3830                                             WERROR *werror)
3831 {
3832         struct spoolss_DeletePrinterDataEx r;
3833         NTSTATUS status;
3834
3835         /* In parameters */
3836         r.in.handle = handle;
3837         r.in.key_name = key_name;
3838         r.in.value_name = value_name;
3839
3840         if (DEBUGLEVEL >= 10) {
3841                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDataEx, &r);
3842         }
3843
3844         status = cli->dispatch(cli,
3845                                 mem_ctx,
3846                                 &ndr_table_spoolss,
3847                                 NDR_SPOOLSS_DELETEPRINTERDATAEX,
3848                                 &r);
3849
3850         if (!NT_STATUS_IS_OK(status)) {
3851                 return status;
3852         }
3853
3854         if (DEBUGLEVEL >= 10) {
3855                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDataEx, &r);
3856         }
3857
3858         if (NT_STATUS_IS_ERR(status)) {
3859                 return status;
3860         }
3861
3862         /* Return variables */
3863
3864         /* Return result */
3865         if (werror) {
3866                 *werror = r.out.result;
3867         }
3868
3869         return werror_to_ntstatus(r.out.result);
3870 }
3871
3872 NTSTATUS rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client *cli,
3873                                          TALLOC_CTX *mem_ctx,
3874                                          struct policy_handle *handle /* [in] [ref] */,
3875                                          const char *key_name /* [in] [charset(UTF16)] */,
3876                                          WERROR *werror)
3877 {
3878         struct spoolss_DeletePrinterKey r;
3879         NTSTATUS status;
3880
3881         /* In parameters */
3882         r.in.handle = handle;
3883         r.in.key_name = key_name;
3884
3885         if (DEBUGLEVEL >= 10) {
3886                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, &r);
3887         }
3888
3889         status = cli->dispatch(cli,
3890                                 mem_ctx,
3891                                 &ndr_table_spoolss,
3892                                 NDR_SPOOLSS_DELETEPRINTERKEY,
3893                                 &r);
3894
3895         if (!NT_STATUS_IS_OK(status)) {
3896                 return status;
3897         }
3898
3899         if (DEBUGLEVEL >= 10) {
3900                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterKey, &r);
3901         }
3902
3903         if (NT_STATUS_IS_ERR(status)) {
3904                 return status;
3905         }
3906
3907         /* Return variables */
3908
3909         /* Return result */
3910         if (werror) {
3911                 *werror = r.out.result;
3912         }
3913
3914         return werror_to_ntstatus(r.out.result);
3915 }
3916
3917 NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli,
3918                            TALLOC_CTX *mem_ctx,
3919                            WERROR *werror)
3920 {
3921         struct spoolss_53 r;
3922         NTSTATUS status;
3923
3924         /* In parameters */
3925
3926         if (DEBUGLEVEL >= 10) {
3927                 NDR_PRINT_IN_DEBUG(spoolss_53, &r);
3928         }
3929
3930         status = cli->dispatch(cli,
3931                                 mem_ctx,
3932                                 &ndr_table_spoolss,
3933                                 NDR_SPOOLSS_53,
3934                                 &r);
3935
3936         if (!NT_STATUS_IS_OK(status)) {
3937                 return status;
3938         }
3939
3940         if (DEBUGLEVEL >= 10) {
3941                 NDR_PRINT_OUT_DEBUG(spoolss_53, &r);
3942         }
3943
3944         if (NT_STATUS_IS_ERR(status)) {
3945                 return status;
3946         }
3947
3948         /* Return variables */
3949
3950         /* Return result */
3951         if (werror) {
3952                 *werror = r.out.result;
3953         }
3954
3955         return werror_to_ntstatus(r.out.result);
3956 }
3957
3958 NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli,
3959                                               TALLOC_CTX *mem_ctx,
3960                                               const char *server /* [in] [unique,charset(UTF16)] */,
3961                                               const char *architecture /* [in] [charset(UTF16)] */,
3962                                               const char *driver /* [in] [charset(UTF16)] */,
3963                                               uint32_t delete_flags /* [in]  */,
3964                                               uint32_t version /* [in]  */,
3965                                               WERROR *werror)
3966 {
3967         struct spoolss_DeletePrinterDriverEx r;
3968         NTSTATUS status;
3969
3970         /* In parameters */
3971         r.in.server = server;
3972         r.in.architecture = architecture;
3973         r.in.driver = driver;
3974         r.in.delete_flags = delete_flags;
3975         r.in.version = version;
3976
3977         if (DEBUGLEVEL >= 10) {
3978                 NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, &r);
3979         }
3980
3981         status = cli->dispatch(cli,
3982                                 mem_ctx,
3983                                 &ndr_table_spoolss,
3984                                 NDR_SPOOLSS_DELETEPRINTERDRIVEREX,
3985                                 &r);
3986
3987         if (!NT_STATUS_IS_OK(status)) {
3988                 return status;
3989         }
3990
3991         if (DEBUGLEVEL >= 10) {
3992                 NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriverEx, &r);
3993         }
3994
3995         if (NT_STATUS_IS_ERR(status)) {
3996                 return status;
3997         }
3998
3999         /* Return variables */
4000
4001         /* Return result */
4002         if (werror) {
4003                 *werror = r.out.result;
4004         }
4005
4006         return werror_to_ntstatus(r.out.result);
4007 }
4008
4009 NTSTATUS rpccli_spoolss_55(struct rpc_pipe_client *cli,
4010                            TALLOC_CTX *mem_ctx,
4011                            WERROR *werror)
4012 {
4013         struct spoolss_55 r;
4014         NTSTATUS status;
4015
4016         /* In parameters */
4017
4018         if (DEBUGLEVEL >= 10) {
4019                 NDR_PRINT_IN_DEBUG(spoolss_55, &r);
4020         }
4021
4022         status = cli->dispatch(cli,
4023                                 mem_ctx,
4024                                 &ndr_table_spoolss,
4025                                 NDR_SPOOLSS_55,
4026                                 &r);
4027
4028         if (!NT_STATUS_IS_OK(status)) {
4029                 return status;
4030         }
4031
4032         if (DEBUGLEVEL >= 10) {
4033                 NDR_PRINT_OUT_DEBUG(spoolss_55, &r);
4034         }
4035
4036         if (NT_STATUS_IS_ERR(status)) {
4037                 return status;
4038         }
4039
4040         /* Return variables */
4041
4042         /* Return result */
4043         if (werror) {
4044                 *werror = r.out.result;
4045         }
4046
4047         return werror_to_ntstatus(r.out.result);
4048 }
4049
4050 NTSTATUS rpccli_spoolss_56(struct rpc_pipe_client *cli,
4051                            TALLOC_CTX *mem_ctx,
4052                            WERROR *werror)
4053 {
4054         struct spoolss_56 r;
4055         NTSTATUS status;
4056
4057         /* In parameters */
4058
4059         if (DEBUGLEVEL >= 10) {
4060                 NDR_PRINT_IN_DEBUG(spoolss_56, &r);
4061         }
4062
4063         status = cli->dispatch(cli,
4064                                 mem_ctx,
4065                                 &ndr_table_spoolss,
4066                                 NDR_SPOOLSS_56,
4067                                 &r);
4068
4069         if (!NT_STATUS_IS_OK(status)) {
4070                 return status;
4071         }
4072
4073         if (DEBUGLEVEL >= 10) {
4074                 NDR_PRINT_OUT_DEBUG(spoolss_56, &r);
4075         }
4076
4077         if (NT_STATUS_IS_ERR(status)) {
4078                 return status;
4079         }
4080
4081         /* Return variables */
4082
4083         /* Return result */
4084         if (werror) {
4085                 *werror = r.out.result;
4086         }
4087
4088         return werror_to_ntstatus(r.out.result);
4089 }
4090
4091 NTSTATUS rpccli_spoolss_57(struct rpc_pipe_client *cli,
4092                            TALLOC_CTX *mem_ctx,
4093                            WERROR *werror)
4094 {
4095         struct spoolss_57 r;
4096         NTSTATUS status;
4097
4098         /* In parameters */
4099
4100         if (DEBUGLEVEL >= 10) {
4101                 NDR_PRINT_IN_DEBUG(spoolss_57, &r);
4102         }
4103
4104         status = cli->dispatch(cli,
4105                                 mem_ctx,
4106                                 &ndr_table_spoolss,
4107                                 NDR_SPOOLSS_57,
4108                                 &r);
4109
4110         if (!NT_STATUS_IS_OK(status)) {
4111                 return status;
4112         }
4113
4114         if (DEBUGLEVEL >= 10) {
4115                 NDR_PRINT_OUT_DEBUG(spoolss_57, &r);
4116         }
4117
4118         if (NT_STATUS_IS_ERR(status)) {
4119                 return status;
4120         }
4121
4122         /* Return variables */
4123
4124         /* Return result */
4125         if (werror) {
4126                 *werror = r.out.result;
4127         }
4128
4129         return werror_to_ntstatus(r.out.result);
4130 }
4131
4132 NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
4133                                 TALLOC_CTX *mem_ctx,
4134                                 struct policy_handle *handle /* [in] [ref] */,
4135                                 const char *function_name /* [in] [charset(UTF16)] */,
4136                                 DATA_BLOB in_data /* [in]  */,
4137                                 uint32_t _in_data_length /* [in] [value(r->in.in_data.length)] */,
4138                                 uint8_t *out_data /* [out] [ref,size_is(out_data_size)] */,
4139                                 uint32_t out_data_size /* [in]  */,
4140                                 uint32_t *needed /* [out] [ref] */,
4141                                 uint32_t *status_code /* [in,out] [ref] */,
4142                                 WERROR *werror)
4143 {
4144         struct spoolss_XcvData r;
4145         NTSTATUS status;
4146
4147         /* In parameters */
4148         r.in.handle = handle;
4149         r.in.function_name = function_name;
4150         r.in.in_data = in_data;
4151         r.in._in_data_length = _in_data_length;
4152         r.in.out_data_size = out_data_size;
4153         r.in.status_code = status_code;
4154
4155         if (DEBUGLEVEL >= 10) {
4156                 NDR_PRINT_IN_DEBUG(spoolss_XcvData, &r);
4157         }
4158
4159         status = cli->dispatch(cli,
4160                                 mem_ctx,
4161                                 &ndr_table_spoolss,
4162                                 NDR_SPOOLSS_XCVDATA,
4163                                 &r);
4164
4165         if (!NT_STATUS_IS_OK(status)) {
4166                 return status;
4167         }
4168
4169         if (DEBUGLEVEL >= 10) {
4170                 NDR_PRINT_OUT_DEBUG(spoolss_XcvData, &r);
4171         }
4172
4173         if (NT_STATUS_IS_ERR(status)) {
4174                 return status;
4175         }
4176
4177         /* Return variables */
4178         memcpy(out_data, r.out.out_data, r.in.out_data_size * sizeof(*out_data));
4179         *needed = *r.out.needed;
4180         *status_code = *r.out.status_code;
4181
4182         /* Return result */
4183         if (werror) {
4184                 *werror = r.out.result;
4185         }
4186
4187         return werror_to_ntstatus(r.out.result);
4188 }
4189
4190 NTSTATUS rpccli_spoolss_AddPrinterDriverEx(struct rpc_pipe_client *cli,
4191                                            TALLOC_CTX *mem_ctx,
4192                                            WERROR *werror)
4193 {
4194         struct spoolss_AddPrinterDriverEx r;
4195         NTSTATUS status;
4196
4197         /* In parameters */
4198
4199         if (DEBUGLEVEL >= 10) {
4200                 NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriverEx, &r);
4201         }
4202
4203         status = cli->dispatch(cli,
4204                                 mem_ctx,
4205                                 &ndr_table_spoolss,
4206                                 NDR_SPOOLSS_ADDPRINTERDRIVEREX,
4207                                 &r);
4208
4209         if (!NT_STATUS_IS_OK(status)) {
4210                 return status;
4211         }
4212
4213         if (DEBUGLEVEL >= 10) {
4214                 NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriverEx, &r);
4215         }
4216
4217         if (NT_STATUS_IS_ERR(status)) {
4218                 return status;
4219         }
4220
4221         /* Return variables */
4222
4223         /* Return result */
4224         if (werror) {
4225                 *werror = r.out.result;
4226         }
4227
4228         return werror_to_ntstatus(r.out.result);
4229 }
4230
4231 NTSTATUS rpccli_spoolss_5a(struct rpc_pipe_client *cli,
4232                            TALLOC_CTX *mem_ctx,
4233                            WERROR *werror)
4234 {
4235         struct spoolss_5a r;
4236         NTSTATUS status;
4237
4238         /* In parameters */
4239
4240         if (DEBUGLEVEL >= 10) {
4241                 NDR_PRINT_IN_DEBUG(spoolss_5a, &r);
4242         }
4243
4244         status = cli->dispatch(cli,
4245                                 mem_ctx,
4246                                 &ndr_table_spoolss,
4247                                 NDR_SPOOLSS_5A,
4248                                 &r);
4249
4250         if (!NT_STATUS_IS_OK(status)) {
4251                 return status;
4252         }
4253
4254         if (DEBUGLEVEL >= 10) {
4255                 NDR_PRINT_OUT_DEBUG(spoolss_5a, &r);
4256         }
4257
4258         if (NT_STATUS_IS_ERR(status)) {
4259                 return status;
4260         }
4261
4262         /* Return variables */
4263
4264         /* Return result */
4265         if (werror) {
4266                 *werror = r.out.result;
4267         }
4268
4269         return werror_to_ntstatus(r.out.result);
4270 }
4271
4272 NTSTATUS rpccli_spoolss_5b(struct rpc_pipe_client *cli,
4273                            TALLOC_CTX *mem_ctx,
4274                            WERROR *werror)
4275 {
4276         struct spoolss_5b r;
4277         NTSTATUS status;
4278
4279         /* In parameters */
4280
4281         if (DEBUGLEVEL >= 10) {
4282                 NDR_PRINT_IN_DEBUG(spoolss_5b, &r);
4283         }
4284
4285         status = cli->dispatch(cli,
4286                                 mem_ctx,
4287                                 &ndr_table_spoolss,
4288                                 NDR_SPOOLSS_5B,
4289                                 &r);
4290
4291         if (!NT_STATUS_IS_OK(status)) {
4292                 return status;
4293         }
4294
4295         if (DEBUGLEVEL >= 10) {
4296                 NDR_PRINT_OUT_DEBUG(spoolss_5b, &r);
4297         }
4298
4299         if (NT_STATUS_IS_ERR(status)) {
4300                 return status;
4301         }
4302
4303         /* Return variables */
4304
4305         /* Return result */
4306         if (werror) {
4307                 *werror = r.out.result;
4308         }
4309
4310         return werror_to_ntstatus(r.out.result);
4311 }
4312
4313 NTSTATUS rpccli_spoolss_5c(struct rpc_pipe_client *cli,
4314                            TALLOC_CTX *mem_ctx,
4315                            WERROR *werror)
4316 {
4317         struct spoolss_5c r;
4318         NTSTATUS status;
4319
4320         /* In parameters */
4321
4322         if (DEBUGLEVEL >= 10) {
4323                 NDR_PRINT_IN_DEBUG(spoolss_5c, &r);
4324         }
4325
4326         status = cli->dispatch(cli,
4327                                 mem_ctx,
4328                                 &ndr_table_spoolss,
4329                                 NDR_SPOOLSS_5C,
4330                                 &r);
4331
4332         if (!NT_STATUS_IS_OK(status)) {
4333                 return status;
4334         }
4335
4336         if (DEBUGLEVEL >= 10) {
4337                 NDR_PRINT_OUT_DEBUG(spoolss_5c, &r);
4338         }
4339
4340         if (NT_STATUS_IS_ERR(status)) {
4341                 return status;
4342         }
4343
4344         /* Return variables */
4345
4346         /* Return result */
4347         if (werror) {
4348                 *werror = r.out.result;
4349         }
4350
4351         return werror_to_ntstatus(r.out.result);
4352 }
4353
4354 NTSTATUS rpccli_spoolss_5d(struct rpc_pipe_client *cli,
4355                            TALLOC_CTX *mem_ctx,
4356                            WERROR *werror)
4357 {
4358         struct spoolss_5d r;
4359         NTSTATUS status;
4360
4361         /* In parameters */
4362
4363         if (DEBUGLEVEL >= 10) {
4364                 NDR_PRINT_IN_DEBUG(spoolss_5d, &r);
4365         }
4366
4367         status = cli->dispatch(cli,
4368                                 mem_ctx,
4369                                 &ndr_table_spoolss,
4370                                 NDR_SPOOLSS_5D,
4371                                 &r);
4372
4373         if (!NT_STATUS_IS_OK(status)) {
4374                 return status;
4375         }
4376
4377         if (DEBUGLEVEL >= 10) {
4378                 NDR_PRINT_OUT_DEBUG(spoolss_5d, &r);
4379         }
4380
4381         if (NT_STATUS_IS_ERR(status)) {
4382                 return status;
4383         }
4384
4385         /* Return variables */
4386
4387         /* Return result */
4388         if (werror) {
4389                 *werror = r.out.result;
4390         }
4391
4392         return werror_to_ntstatus(r.out.result);
4393 }
4394
4395 NTSTATUS rpccli_spoolss_5e(struct rpc_pipe_client *cli,
4396                            TALLOC_CTX *mem_ctx,
4397                            WERROR *werror)
4398 {
4399         struct spoolss_5e r;
4400         NTSTATUS status;
4401
4402         /* In parameters */
4403
4404         if (DEBUGLEVEL >= 10) {
4405                 NDR_PRINT_IN_DEBUG(spoolss_5e, &r);
4406         }
4407
4408         status = cli->dispatch(cli,
4409                                 mem_ctx,
4410                                 &ndr_table_spoolss,
4411                                 NDR_SPOOLSS_5E,
4412                                 &r);
4413
4414         if (!NT_STATUS_IS_OK(status)) {
4415                 return status;
4416         }
4417
4418         if (DEBUGLEVEL >= 10) {
4419                 NDR_PRINT_OUT_DEBUG(spoolss_5e, &r);
4420         }
4421
4422         if (NT_STATUS_IS_ERR(status)) {
4423                 return status;
4424         }
4425
4426         /* Return variables */
4427
4428         /* Return result */
4429         if (werror) {
4430                 *werror = r.out.result;
4431         }
4432
4433         return werror_to_ntstatus(r.out.result);
4434 }
4435
4436 NTSTATUS rpccli_spoolss_5f(struct rpc_pipe_client *cli,
4437                            TALLOC_CTX *mem_ctx,
4438                            WERROR *werror)
4439 {
4440         struct spoolss_5f r;
4441         NTSTATUS status;
4442
4443         /* In parameters */
4444
4445         if (DEBUGLEVEL >= 10) {
4446                 NDR_PRINT_IN_DEBUG(spoolss_5f, &r);
4447         }
4448
4449         status = cli->dispatch(cli,
4450                                 mem_ctx,
4451                                 &ndr_table_spoolss,
4452                                 NDR_SPOOLSS_5F,
4453                                 &r);
4454
4455         if (!NT_STATUS_IS_OK(status)) {
4456                 return status;
4457         }
4458
4459         if (DEBUGLEVEL >= 10) {
4460                 NDR_PRINT_OUT_DEBUG(spoolss_5f, &r);
4461         }
4462
4463         if (NT_STATUS_IS_ERR(status)) {
4464                 return status;
4465         }
4466
4467         /* Return variables */
4468
4469         /* Return result */
4470         if (werror) {
4471                 *werror = r.out.result;
4472         }
4473
4474         return werror_to_ntstatus(r.out.result);
4475 }
4476