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