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