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