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