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