s3-iremotewinspool: add generated server stubs and no longer compile autogenerated...
[amitay/samba.git] / source3 / rpc_server / spoolss / srv_iremotewinspool.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * server auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "ntdomain.h"
8 #include "bin/default/librpc/gen_ndr/srv_winspool.h"
9
10 static bool api_winspool_AsyncOpenPrinter(struct pipes_struct *p)
11 {
12         const struct ndr_interface_call *call;
13         struct ndr_pull *pull;
14         struct ndr_push *push;
15         enum ndr_err_code ndr_err;
16         struct winspool_AsyncOpenPrinter *r;
17
18         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCOPENPRINTER];
19
20         r = talloc(talloc_tos(), struct winspool_AsyncOpenPrinter);
21         if (r == NULL) {
22                 return false;
23         }
24
25         pull = ndr_pull_init_blob(&p->in_data.data, r);
26         if (pull == NULL) {
27                 talloc_free(r);
28                 return false;
29         }
30
31         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
32         if (p->endian) {
33                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
34         }
35         ndr_err = call->ndr_pull(pull, NDR_IN, r);
36         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
37                 talloc_free(r);
38                 return false;
39         }
40
41         if (DEBUGLEVEL >= 10) {
42                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncOpenPrinter, NDR_IN, r);
43         }
44
45         ZERO_STRUCT(r->out);
46         r->out.pHandle = talloc_zero(r, struct policy_handle);
47         if (r->out.pHandle == NULL) {
48                 talloc_free(r);
49                 return false;
50         }
51
52         r->out.result = _winspool_AsyncOpenPrinter(p, r);
53
54         if (p->fault_state) {
55                 talloc_free(r);
56                 /* Return true here, srv_pipe_hnd.c will take care */
57                 return true;
58         }
59
60         if (DEBUGLEVEL >= 10) {
61                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncOpenPrinter, NDR_OUT | NDR_SET_VALUES, r);
62         }
63
64         push = ndr_push_init_ctx(r);
65         if (push == NULL) {
66                 talloc_free(r);
67                 return false;
68         }
69
70         /*
71          * carry over the pointer count to the reply in case we are
72          * using full pointer. See NDR specification for full pointers
73          */
74         push->ptr_count = pull->ptr_count;
75
76         ndr_err = call->ndr_push(push, NDR_OUT, r);
77         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
78                 talloc_free(r);
79                 return false;
80         }
81
82         p->out_data.rdata = ndr_push_blob(push);
83         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
84
85         talloc_free(r);
86
87         return true;
88 }
89
90 static bool api_winspool_AsyncAddPrinter(struct pipes_struct *p)
91 {
92         const struct ndr_interface_call *call;
93         struct ndr_pull *pull;
94         struct ndr_push *push;
95         enum ndr_err_code ndr_err;
96         struct winspool_AsyncAddPrinter *r;
97
98         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDPRINTER];
99
100         r = talloc(talloc_tos(), struct winspool_AsyncAddPrinter);
101         if (r == NULL) {
102                 return false;
103         }
104
105         pull = ndr_pull_init_blob(&p->in_data.data, r);
106         if (pull == NULL) {
107                 talloc_free(r);
108                 return false;
109         }
110
111         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
112         if (p->endian) {
113                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
114         }
115         ndr_err = call->ndr_pull(pull, NDR_IN, r);
116         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
117                 talloc_free(r);
118                 return false;
119         }
120
121         if (DEBUGLEVEL >= 10) {
122                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrinter, NDR_IN, r);
123         }
124
125         ZERO_STRUCT(r->out);
126         r->out.pHandle = talloc_zero(r, struct policy_handle);
127         if (r->out.pHandle == NULL) {
128                 talloc_free(r);
129                 return false;
130         }
131
132         r->out.result = _winspool_AsyncAddPrinter(p, r);
133
134         if (p->fault_state) {
135                 talloc_free(r);
136                 /* Return true here, srv_pipe_hnd.c will take care */
137                 return true;
138         }
139
140         if (DEBUGLEVEL >= 10) {
141                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrinter, NDR_OUT | NDR_SET_VALUES, r);
142         }
143
144         push = ndr_push_init_ctx(r);
145         if (push == NULL) {
146                 talloc_free(r);
147                 return false;
148         }
149
150         /*
151          * carry over the pointer count to the reply in case we are
152          * using full pointer. See NDR specification for full pointers
153          */
154         push->ptr_count = pull->ptr_count;
155
156         ndr_err = call->ndr_push(push, NDR_OUT, r);
157         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
158                 talloc_free(r);
159                 return false;
160         }
161
162         p->out_data.rdata = ndr_push_blob(push);
163         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
164
165         talloc_free(r);
166
167         return true;
168 }
169
170 static bool api_winspool_AsyncSetJob(struct pipes_struct *p)
171 {
172         const struct ndr_interface_call *call;
173         struct ndr_pull *pull;
174         struct ndr_push *push;
175         enum ndr_err_code ndr_err;
176         struct winspool_AsyncSetJob *r;
177
178         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETJOB];
179
180         r = talloc(talloc_tos(), struct winspool_AsyncSetJob);
181         if (r == NULL) {
182                 return false;
183         }
184
185         pull = ndr_pull_init_blob(&p->in_data.data, r);
186         if (pull == NULL) {
187                 talloc_free(r);
188                 return false;
189         }
190
191         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
192         if (p->endian) {
193                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
194         }
195         ndr_err = call->ndr_pull(pull, NDR_IN, r);
196         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
197                 talloc_free(r);
198                 return false;
199         }
200
201         if (DEBUGLEVEL >= 10) {
202                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetJob, NDR_IN, r);
203         }
204
205         r->out.result = _winspool_AsyncSetJob(p, r);
206
207         if (p->fault_state) {
208                 talloc_free(r);
209                 /* Return true here, srv_pipe_hnd.c will take care */
210                 return true;
211         }
212
213         if (DEBUGLEVEL >= 10) {
214                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetJob, NDR_OUT | NDR_SET_VALUES, r);
215         }
216
217         push = ndr_push_init_ctx(r);
218         if (push == NULL) {
219                 talloc_free(r);
220                 return false;
221         }
222
223         /*
224          * carry over the pointer count to the reply in case we are
225          * using full pointer. See NDR specification for full pointers
226          */
227         push->ptr_count = pull->ptr_count;
228
229         ndr_err = call->ndr_push(push, NDR_OUT, r);
230         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
231                 talloc_free(r);
232                 return false;
233         }
234
235         p->out_data.rdata = ndr_push_blob(push);
236         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
237
238         talloc_free(r);
239
240         return true;
241 }
242
243 static bool api_winspool_AsyncGetJob(struct pipes_struct *p)
244 {
245         const struct ndr_interface_call *call;
246         struct ndr_pull *pull;
247         struct ndr_push *push;
248         enum ndr_err_code ndr_err;
249         struct winspool_AsyncGetJob *r;
250
251         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETJOB];
252
253         r = talloc(talloc_tos(), struct winspool_AsyncGetJob);
254         if (r == NULL) {
255                 return false;
256         }
257
258         pull = ndr_pull_init_blob(&p->in_data.data, r);
259         if (pull == NULL) {
260                 talloc_free(r);
261                 return false;
262         }
263
264         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
265         if (p->endian) {
266                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
267         }
268         ndr_err = call->ndr_pull(pull, NDR_IN, r);
269         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
270                 talloc_free(r);
271                 return false;
272         }
273
274         if (DEBUGLEVEL >= 10) {
275                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetJob, NDR_IN, r);
276         }
277
278         ZERO_STRUCT(r->out);
279         r->out.pJob = r->in.pJob;
280         r->out.pcbNeeded = talloc_zero(r, uint32_t);
281         if (r->out.pcbNeeded == NULL) {
282                 talloc_free(r);
283                 return false;
284         }
285
286         r->out.result = _winspool_AsyncGetJob(p, r);
287
288         if (p->fault_state) {
289                 talloc_free(r);
290                 /* Return true here, srv_pipe_hnd.c will take care */
291                 return true;
292         }
293
294         if (DEBUGLEVEL >= 10) {
295                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetJob, NDR_OUT | NDR_SET_VALUES, r);
296         }
297
298         push = ndr_push_init_ctx(r);
299         if (push == NULL) {
300                 talloc_free(r);
301                 return false;
302         }
303
304         /*
305          * carry over the pointer count to the reply in case we are
306          * using full pointer. See NDR specification for full pointers
307          */
308         push->ptr_count = pull->ptr_count;
309
310         ndr_err = call->ndr_push(push, NDR_OUT, r);
311         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
312                 talloc_free(r);
313                 return false;
314         }
315
316         p->out_data.rdata = ndr_push_blob(push);
317         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
318
319         talloc_free(r);
320
321         return true;
322 }
323
324 static bool api_winspool_AsyncEnumJobs(struct pipes_struct *p)
325 {
326         const struct ndr_interface_call *call;
327         struct ndr_pull *pull;
328         struct ndr_push *push;
329         enum ndr_err_code ndr_err;
330         struct winspool_AsyncEnumJobs *r;
331
332         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMJOBS];
333
334         r = talloc(talloc_tos(), struct winspool_AsyncEnumJobs);
335         if (r == NULL) {
336                 return false;
337         }
338
339         pull = ndr_pull_init_blob(&p->in_data.data, r);
340         if (pull == NULL) {
341                 talloc_free(r);
342                 return false;
343         }
344
345         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
346         if (p->endian) {
347                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
348         }
349         ndr_err = call->ndr_pull(pull, NDR_IN, r);
350         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
351                 talloc_free(r);
352                 return false;
353         }
354
355         if (DEBUGLEVEL >= 10) {
356                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumJobs, NDR_IN, r);
357         }
358
359         ZERO_STRUCT(r->out);
360         r->out.pJob = r->in.pJob;
361         r->out.pcbNeeded = talloc_zero(r, uint32_t);
362         if (r->out.pcbNeeded == NULL) {
363                 talloc_free(r);
364                 return false;
365         }
366
367         r->out.pcReturned = talloc_zero(r, uint32_t);
368         if (r->out.pcReturned == NULL) {
369                 talloc_free(r);
370                 return false;
371         }
372
373         r->out.result = _winspool_AsyncEnumJobs(p, r);
374
375         if (p->fault_state) {
376                 talloc_free(r);
377                 /* Return true here, srv_pipe_hnd.c will take care */
378                 return true;
379         }
380
381         if (DEBUGLEVEL >= 10) {
382                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumJobs, NDR_OUT | NDR_SET_VALUES, r);
383         }
384
385         push = ndr_push_init_ctx(r);
386         if (push == NULL) {
387                 talloc_free(r);
388                 return false;
389         }
390
391         /*
392          * carry over the pointer count to the reply in case we are
393          * using full pointer. See NDR specification for full pointers
394          */
395         push->ptr_count = pull->ptr_count;
396
397         ndr_err = call->ndr_push(push, NDR_OUT, r);
398         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
399                 talloc_free(r);
400                 return false;
401         }
402
403         p->out_data.rdata = ndr_push_blob(push);
404         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
405
406         talloc_free(r);
407
408         return true;
409 }
410
411 static bool api_winspool_AsyncAddJob(struct pipes_struct *p)
412 {
413         const struct ndr_interface_call *call;
414         struct ndr_pull *pull;
415         struct ndr_push *push;
416         enum ndr_err_code ndr_err;
417         struct winspool_AsyncAddJob *r;
418
419         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDJOB];
420
421         r = talloc(talloc_tos(), struct winspool_AsyncAddJob);
422         if (r == NULL) {
423                 return false;
424         }
425
426         pull = ndr_pull_init_blob(&p->in_data.data, r);
427         if (pull == NULL) {
428                 talloc_free(r);
429                 return false;
430         }
431
432         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
433         if (p->endian) {
434                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
435         }
436         ndr_err = call->ndr_pull(pull, NDR_IN, r);
437         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
438                 talloc_free(r);
439                 return false;
440         }
441
442         if (DEBUGLEVEL >= 10) {
443                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddJob, NDR_IN, r);
444         }
445
446         ZERO_STRUCT(r->out);
447         r->out.pAddJob = r->in.pAddJob;
448         r->out.pcbNeeded = talloc_zero(r, uint32_t);
449         if (r->out.pcbNeeded == NULL) {
450                 talloc_free(r);
451                 return false;
452         }
453
454         r->out.result = _winspool_AsyncAddJob(p, r);
455
456         if (p->fault_state) {
457                 talloc_free(r);
458                 /* Return true here, srv_pipe_hnd.c will take care */
459                 return true;
460         }
461
462         if (DEBUGLEVEL >= 10) {
463                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddJob, NDR_OUT | NDR_SET_VALUES, r);
464         }
465
466         push = ndr_push_init_ctx(r);
467         if (push == NULL) {
468                 talloc_free(r);
469                 return false;
470         }
471
472         /*
473          * carry over the pointer count to the reply in case we are
474          * using full pointer. See NDR specification for full pointers
475          */
476         push->ptr_count = pull->ptr_count;
477
478         ndr_err = call->ndr_push(push, NDR_OUT, r);
479         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
480                 talloc_free(r);
481                 return false;
482         }
483
484         p->out_data.rdata = ndr_push_blob(push);
485         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
486
487         talloc_free(r);
488
489         return true;
490 }
491
492 static bool api_winspool_AsyncScheduleJob(struct pipes_struct *p)
493 {
494         const struct ndr_interface_call *call;
495         struct ndr_pull *pull;
496         struct ndr_push *push;
497         enum ndr_err_code ndr_err;
498         struct winspool_AsyncScheduleJob *r;
499
500         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSCHEDULEJOB];
501
502         r = talloc(talloc_tos(), struct winspool_AsyncScheduleJob);
503         if (r == NULL) {
504                 return false;
505         }
506
507         pull = ndr_pull_init_blob(&p->in_data.data, r);
508         if (pull == NULL) {
509                 talloc_free(r);
510                 return false;
511         }
512
513         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
514         if (p->endian) {
515                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
516         }
517         ndr_err = call->ndr_pull(pull, NDR_IN, r);
518         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
519                 talloc_free(r);
520                 return false;
521         }
522
523         if (DEBUGLEVEL >= 10) {
524                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncScheduleJob, NDR_IN, r);
525         }
526
527         r->out.result = _winspool_AsyncScheduleJob(p, r);
528
529         if (p->fault_state) {
530                 talloc_free(r);
531                 /* Return true here, srv_pipe_hnd.c will take care */
532                 return true;
533         }
534
535         if (DEBUGLEVEL >= 10) {
536                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncScheduleJob, NDR_OUT | NDR_SET_VALUES, r);
537         }
538
539         push = ndr_push_init_ctx(r);
540         if (push == NULL) {
541                 talloc_free(r);
542                 return false;
543         }
544
545         /*
546          * carry over the pointer count to the reply in case we are
547          * using full pointer. See NDR specification for full pointers
548          */
549         push->ptr_count = pull->ptr_count;
550
551         ndr_err = call->ndr_push(push, NDR_OUT, r);
552         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
553                 talloc_free(r);
554                 return false;
555         }
556
557         p->out_data.rdata = ndr_push_blob(push);
558         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
559
560         talloc_free(r);
561
562         return true;
563 }
564
565 static bool api_winspool_AsyncDeletePrinter(struct pipes_struct *p)
566 {
567         const struct ndr_interface_call *call;
568         struct ndr_pull *pull;
569         struct ndr_push *push;
570         enum ndr_err_code ndr_err;
571         struct winspool_AsyncDeletePrinter *r;
572
573         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTER];
574
575         r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinter);
576         if (r == NULL) {
577                 return false;
578         }
579
580         pull = ndr_pull_init_blob(&p->in_data.data, r);
581         if (pull == NULL) {
582                 talloc_free(r);
583                 return false;
584         }
585
586         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
587         if (p->endian) {
588                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
589         }
590         ndr_err = call->ndr_pull(pull, NDR_IN, r);
591         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
592                 talloc_free(r);
593                 return false;
594         }
595
596         if (DEBUGLEVEL >= 10) {
597                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinter, NDR_IN, r);
598         }
599
600         r->out.result = _winspool_AsyncDeletePrinter(p, r);
601
602         if (p->fault_state) {
603                 talloc_free(r);
604                 /* Return true here, srv_pipe_hnd.c will take care */
605                 return true;
606         }
607
608         if (DEBUGLEVEL >= 10) {
609                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinter, NDR_OUT | NDR_SET_VALUES, r);
610         }
611
612         push = ndr_push_init_ctx(r);
613         if (push == NULL) {
614                 talloc_free(r);
615                 return false;
616         }
617
618         /*
619          * carry over the pointer count to the reply in case we are
620          * using full pointer. See NDR specification for full pointers
621          */
622         push->ptr_count = pull->ptr_count;
623
624         ndr_err = call->ndr_push(push, NDR_OUT, r);
625         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
626                 talloc_free(r);
627                 return false;
628         }
629
630         p->out_data.rdata = ndr_push_blob(push);
631         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
632
633         talloc_free(r);
634
635         return true;
636 }
637
638 static bool api_winspool_AsyncSetPrinter(struct pipes_struct *p)
639 {
640         const struct ndr_interface_call *call;
641         struct ndr_pull *pull;
642         struct ndr_push *push;
643         enum ndr_err_code ndr_err;
644         struct winspool_AsyncSetPrinter *r;
645
646         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETPRINTER];
647
648         r = talloc(talloc_tos(), struct winspool_AsyncSetPrinter);
649         if (r == NULL) {
650                 return false;
651         }
652
653         pull = ndr_pull_init_blob(&p->in_data.data, r);
654         if (pull == NULL) {
655                 talloc_free(r);
656                 return false;
657         }
658
659         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
660         if (p->endian) {
661                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
662         }
663         ndr_err = call->ndr_pull(pull, NDR_IN, r);
664         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
665                 talloc_free(r);
666                 return false;
667         }
668
669         if (DEBUGLEVEL >= 10) {
670                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinter, NDR_IN, r);
671         }
672
673         r->out.result = _winspool_AsyncSetPrinter(p, r);
674
675         if (p->fault_state) {
676                 talloc_free(r);
677                 /* Return true here, srv_pipe_hnd.c will take care */
678                 return true;
679         }
680
681         if (DEBUGLEVEL >= 10) {
682                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinter, NDR_OUT | NDR_SET_VALUES, r);
683         }
684
685         push = ndr_push_init_ctx(r);
686         if (push == NULL) {
687                 talloc_free(r);
688                 return false;
689         }
690
691         /*
692          * carry over the pointer count to the reply in case we are
693          * using full pointer. See NDR specification for full pointers
694          */
695         push->ptr_count = pull->ptr_count;
696
697         ndr_err = call->ndr_push(push, NDR_OUT, r);
698         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
699                 talloc_free(r);
700                 return false;
701         }
702
703         p->out_data.rdata = ndr_push_blob(push);
704         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
705
706         talloc_free(r);
707
708         return true;
709 }
710
711 static bool api_winspool_AsyncGetPrinter(struct pipes_struct *p)
712 {
713         const struct ndr_interface_call *call;
714         struct ndr_pull *pull;
715         struct ndr_push *push;
716         enum ndr_err_code ndr_err;
717         struct winspool_AsyncGetPrinter *r;
718
719         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTER];
720
721         r = talloc(talloc_tos(), struct winspool_AsyncGetPrinter);
722         if (r == NULL) {
723                 return false;
724         }
725
726         pull = ndr_pull_init_blob(&p->in_data.data, r);
727         if (pull == NULL) {
728                 talloc_free(r);
729                 return false;
730         }
731
732         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
733         if (p->endian) {
734                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
735         }
736         ndr_err = call->ndr_pull(pull, NDR_IN, r);
737         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
738                 talloc_free(r);
739                 return false;
740         }
741
742         if (DEBUGLEVEL >= 10) {
743                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinter, NDR_IN, r);
744         }
745
746         ZERO_STRUCT(r->out);
747         r->out.pPrinter = r->in.pPrinter;
748         r->out.pcbNeeded = talloc_zero(r, uint32_t);
749         if (r->out.pcbNeeded == NULL) {
750                 talloc_free(r);
751                 return false;
752         }
753
754         r->out.result = _winspool_AsyncGetPrinter(p, r);
755
756         if (p->fault_state) {
757                 talloc_free(r);
758                 /* Return true here, srv_pipe_hnd.c will take care */
759                 return true;
760         }
761
762         if (DEBUGLEVEL >= 10) {
763                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinter, NDR_OUT | NDR_SET_VALUES, r);
764         }
765
766         push = ndr_push_init_ctx(r);
767         if (push == NULL) {
768                 talloc_free(r);
769                 return false;
770         }
771
772         /*
773          * carry over the pointer count to the reply in case we are
774          * using full pointer. See NDR specification for full pointers
775          */
776         push->ptr_count = pull->ptr_count;
777
778         ndr_err = call->ndr_push(push, NDR_OUT, r);
779         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
780                 talloc_free(r);
781                 return false;
782         }
783
784         p->out_data.rdata = ndr_push_blob(push);
785         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
786
787         talloc_free(r);
788
789         return true;
790 }
791
792 static bool api_winspool_AsyncStartDocPrinter(struct pipes_struct *p)
793 {
794         const struct ndr_interface_call *call;
795         struct ndr_pull *pull;
796         struct ndr_push *push;
797         enum ndr_err_code ndr_err;
798         struct winspool_AsyncStartDocPrinter *r;
799
800         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSTARTDOCPRINTER];
801
802         r = talloc(talloc_tos(), struct winspool_AsyncStartDocPrinter);
803         if (r == NULL) {
804                 return false;
805         }
806
807         pull = ndr_pull_init_blob(&p->in_data.data, r);
808         if (pull == NULL) {
809                 talloc_free(r);
810                 return false;
811         }
812
813         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
814         if (p->endian) {
815                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
816         }
817         ndr_err = call->ndr_pull(pull, NDR_IN, r);
818         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
819                 talloc_free(r);
820                 return false;
821         }
822
823         if (DEBUGLEVEL >= 10) {
824                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncStartDocPrinter, NDR_IN, r);
825         }
826
827         ZERO_STRUCT(r->out);
828         r->out.pJobId = talloc_zero(r, uint32_t);
829         if (r->out.pJobId == NULL) {
830                 talloc_free(r);
831                 return false;
832         }
833
834         r->out.result = _winspool_AsyncStartDocPrinter(p, r);
835
836         if (p->fault_state) {
837                 talloc_free(r);
838                 /* Return true here, srv_pipe_hnd.c will take care */
839                 return true;
840         }
841
842         if (DEBUGLEVEL >= 10) {
843                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncStartDocPrinter, NDR_OUT | NDR_SET_VALUES, r);
844         }
845
846         push = ndr_push_init_ctx(r);
847         if (push == NULL) {
848                 talloc_free(r);
849                 return false;
850         }
851
852         /*
853          * carry over the pointer count to the reply in case we are
854          * using full pointer. See NDR specification for full pointers
855          */
856         push->ptr_count = pull->ptr_count;
857
858         ndr_err = call->ndr_push(push, NDR_OUT, r);
859         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
860                 talloc_free(r);
861                 return false;
862         }
863
864         p->out_data.rdata = ndr_push_blob(push);
865         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
866
867         talloc_free(r);
868
869         return true;
870 }
871
872 static bool api_winspool_AsyncStartPagePrinter(struct pipes_struct *p)
873 {
874         const struct ndr_interface_call *call;
875         struct ndr_pull *pull;
876         struct ndr_push *push;
877         enum ndr_err_code ndr_err;
878         struct winspool_AsyncStartPagePrinter *r;
879
880         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSTARTPAGEPRINTER];
881
882         r = talloc(talloc_tos(), struct winspool_AsyncStartPagePrinter);
883         if (r == NULL) {
884                 return false;
885         }
886
887         pull = ndr_pull_init_blob(&p->in_data.data, r);
888         if (pull == NULL) {
889                 talloc_free(r);
890                 return false;
891         }
892
893         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
894         if (p->endian) {
895                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
896         }
897         ndr_err = call->ndr_pull(pull, NDR_IN, r);
898         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
899                 talloc_free(r);
900                 return false;
901         }
902
903         if (DEBUGLEVEL >= 10) {
904                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncStartPagePrinter, NDR_IN, r);
905         }
906
907         r->out.result = _winspool_AsyncStartPagePrinter(p, r);
908
909         if (p->fault_state) {
910                 talloc_free(r);
911                 /* Return true here, srv_pipe_hnd.c will take care */
912                 return true;
913         }
914
915         if (DEBUGLEVEL >= 10) {
916                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncStartPagePrinter, NDR_OUT | NDR_SET_VALUES, r);
917         }
918
919         push = ndr_push_init_ctx(r);
920         if (push == NULL) {
921                 talloc_free(r);
922                 return false;
923         }
924
925         /*
926          * carry over the pointer count to the reply in case we are
927          * using full pointer. See NDR specification for full pointers
928          */
929         push->ptr_count = pull->ptr_count;
930
931         ndr_err = call->ndr_push(push, NDR_OUT, r);
932         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
933                 talloc_free(r);
934                 return false;
935         }
936
937         p->out_data.rdata = ndr_push_blob(push);
938         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
939
940         talloc_free(r);
941
942         return true;
943 }
944
945 static bool api_winspool_AsyncWritePrinter(struct pipes_struct *p)
946 {
947         const struct ndr_interface_call *call;
948         struct ndr_pull *pull;
949         struct ndr_push *push;
950         enum ndr_err_code ndr_err;
951         struct winspool_AsyncWritePrinter *r;
952
953         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCWRITEPRINTER];
954
955         r = talloc(talloc_tos(), struct winspool_AsyncWritePrinter);
956         if (r == NULL) {
957                 return false;
958         }
959
960         pull = ndr_pull_init_blob(&p->in_data.data, r);
961         if (pull == NULL) {
962                 talloc_free(r);
963                 return false;
964         }
965
966         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
967         if (p->endian) {
968                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
969         }
970         ndr_err = call->ndr_pull(pull, NDR_IN, r);
971         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
972                 talloc_free(r);
973                 return false;
974         }
975
976         if (DEBUGLEVEL >= 10) {
977                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncWritePrinter, NDR_IN, r);
978         }
979
980         ZERO_STRUCT(r->out);
981         r->out.pcWritten = talloc_zero(r, uint32_t);
982         if (r->out.pcWritten == NULL) {
983                 talloc_free(r);
984                 return false;
985         }
986
987         r->out.result = _winspool_AsyncWritePrinter(p, r);
988
989         if (p->fault_state) {
990                 talloc_free(r);
991                 /* Return true here, srv_pipe_hnd.c will take care */
992                 return true;
993         }
994
995         if (DEBUGLEVEL >= 10) {
996                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncWritePrinter, NDR_OUT | NDR_SET_VALUES, r);
997         }
998
999         push = ndr_push_init_ctx(r);
1000         if (push == NULL) {
1001                 talloc_free(r);
1002                 return false;
1003         }
1004
1005         /*
1006          * carry over the pointer count to the reply in case we are
1007          * using full pointer. See NDR specification for full pointers
1008          */
1009         push->ptr_count = pull->ptr_count;
1010
1011         ndr_err = call->ndr_push(push, NDR_OUT, r);
1012         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1013                 talloc_free(r);
1014                 return false;
1015         }
1016
1017         p->out_data.rdata = ndr_push_blob(push);
1018         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1019
1020         talloc_free(r);
1021
1022         return true;
1023 }
1024
1025 static bool api_winspool_AsyncEndPagePrinter(struct pipes_struct *p)
1026 {
1027         const struct ndr_interface_call *call;
1028         struct ndr_pull *pull;
1029         struct ndr_push *push;
1030         enum ndr_err_code ndr_err;
1031         struct winspool_AsyncEndPagePrinter *r;
1032
1033         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENDPAGEPRINTER];
1034
1035         r = talloc(talloc_tos(), struct winspool_AsyncEndPagePrinter);
1036         if (r == NULL) {
1037                 return false;
1038         }
1039
1040         pull = ndr_pull_init_blob(&p->in_data.data, r);
1041         if (pull == NULL) {
1042                 talloc_free(r);
1043                 return false;
1044         }
1045
1046         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1047         if (p->endian) {
1048                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1049         }
1050         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1051         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1052                 talloc_free(r);
1053                 return false;
1054         }
1055
1056         if (DEBUGLEVEL >= 10) {
1057                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEndPagePrinter, NDR_IN, r);
1058         }
1059
1060         r->out.result = _winspool_AsyncEndPagePrinter(p, r);
1061
1062         if (p->fault_state) {
1063                 talloc_free(r);
1064                 /* Return true here, srv_pipe_hnd.c will take care */
1065                 return true;
1066         }
1067
1068         if (DEBUGLEVEL >= 10) {
1069                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEndPagePrinter, NDR_OUT | NDR_SET_VALUES, r);
1070         }
1071
1072         push = ndr_push_init_ctx(r);
1073         if (push == NULL) {
1074                 talloc_free(r);
1075                 return false;
1076         }
1077
1078         /*
1079          * carry over the pointer count to the reply in case we are
1080          * using full pointer. See NDR specification for full pointers
1081          */
1082         push->ptr_count = pull->ptr_count;
1083
1084         ndr_err = call->ndr_push(push, NDR_OUT, r);
1085         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1086                 talloc_free(r);
1087                 return false;
1088         }
1089
1090         p->out_data.rdata = ndr_push_blob(push);
1091         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1092
1093         talloc_free(r);
1094
1095         return true;
1096 }
1097
1098 static bool api_winspool_AsyncEndDocPrinter(struct pipes_struct *p)
1099 {
1100         const struct ndr_interface_call *call;
1101         struct ndr_pull *pull;
1102         struct ndr_push *push;
1103         enum ndr_err_code ndr_err;
1104         struct winspool_AsyncEndDocPrinter *r;
1105
1106         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENDDOCPRINTER];
1107
1108         r = talloc(talloc_tos(), struct winspool_AsyncEndDocPrinter);
1109         if (r == NULL) {
1110                 return false;
1111         }
1112
1113         pull = ndr_pull_init_blob(&p->in_data.data, r);
1114         if (pull == NULL) {
1115                 talloc_free(r);
1116                 return false;
1117         }
1118
1119         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1120         if (p->endian) {
1121                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1122         }
1123         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1124         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1125                 talloc_free(r);
1126                 return false;
1127         }
1128
1129         if (DEBUGLEVEL >= 10) {
1130                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEndDocPrinter, NDR_IN, r);
1131         }
1132
1133         r->out.result = _winspool_AsyncEndDocPrinter(p, r);
1134
1135         if (p->fault_state) {
1136                 talloc_free(r);
1137                 /* Return true here, srv_pipe_hnd.c will take care */
1138                 return true;
1139         }
1140
1141         if (DEBUGLEVEL >= 10) {
1142                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEndDocPrinter, NDR_OUT | NDR_SET_VALUES, r);
1143         }
1144
1145         push = ndr_push_init_ctx(r);
1146         if (push == NULL) {
1147                 talloc_free(r);
1148                 return false;
1149         }
1150
1151         /*
1152          * carry over the pointer count to the reply in case we are
1153          * using full pointer. See NDR specification for full pointers
1154          */
1155         push->ptr_count = pull->ptr_count;
1156
1157         ndr_err = call->ndr_push(push, NDR_OUT, r);
1158         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1159                 talloc_free(r);
1160                 return false;
1161         }
1162
1163         p->out_data.rdata = ndr_push_blob(push);
1164         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1165
1166         talloc_free(r);
1167
1168         return true;
1169 }
1170
1171 static bool api_winspool_AsyncAbortPrinter(struct pipes_struct *p)
1172 {
1173         const struct ndr_interface_call *call;
1174         struct ndr_pull *pull;
1175         struct ndr_push *push;
1176         enum ndr_err_code ndr_err;
1177         struct winspool_AsyncAbortPrinter *r;
1178
1179         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCABORTPRINTER];
1180
1181         r = talloc(talloc_tos(), struct winspool_AsyncAbortPrinter);
1182         if (r == NULL) {
1183                 return false;
1184         }
1185
1186         pull = ndr_pull_init_blob(&p->in_data.data, r);
1187         if (pull == NULL) {
1188                 talloc_free(r);
1189                 return false;
1190         }
1191
1192         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1193         if (p->endian) {
1194                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1195         }
1196         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1197         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1198                 talloc_free(r);
1199                 return false;
1200         }
1201
1202         if (DEBUGLEVEL >= 10) {
1203                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAbortPrinter, NDR_IN, r);
1204         }
1205
1206         r->out.result = _winspool_AsyncAbortPrinter(p, r);
1207
1208         if (p->fault_state) {
1209                 talloc_free(r);
1210                 /* Return true here, srv_pipe_hnd.c will take care */
1211                 return true;
1212         }
1213
1214         if (DEBUGLEVEL >= 10) {
1215                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAbortPrinter, NDR_OUT | NDR_SET_VALUES, r);
1216         }
1217
1218         push = ndr_push_init_ctx(r);
1219         if (push == NULL) {
1220                 talloc_free(r);
1221                 return false;
1222         }
1223
1224         /*
1225          * carry over the pointer count to the reply in case we are
1226          * using full pointer. See NDR specification for full pointers
1227          */
1228         push->ptr_count = pull->ptr_count;
1229
1230         ndr_err = call->ndr_push(push, NDR_OUT, r);
1231         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1232                 talloc_free(r);
1233                 return false;
1234         }
1235
1236         p->out_data.rdata = ndr_push_blob(push);
1237         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1238
1239         talloc_free(r);
1240
1241         return true;
1242 }
1243
1244 static bool api_winspool_AsyncGetPrinterData(struct pipes_struct *p)
1245 {
1246         const struct ndr_interface_call *call;
1247         struct ndr_pull *pull;
1248         struct ndr_push *push;
1249         enum ndr_err_code ndr_err;
1250         struct winspool_AsyncGetPrinterData *r;
1251
1252         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTERDATA];
1253
1254         r = talloc(talloc_tos(), struct winspool_AsyncGetPrinterData);
1255         if (r == NULL) {
1256                 return false;
1257         }
1258
1259         pull = ndr_pull_init_blob(&p->in_data.data, r);
1260         if (pull == NULL) {
1261                 talloc_free(r);
1262                 return false;
1263         }
1264
1265         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1266         if (p->endian) {
1267                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1268         }
1269         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1270         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1271                 talloc_free(r);
1272                 return false;
1273         }
1274
1275         if (DEBUGLEVEL >= 10) {
1276                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterData, NDR_IN, r);
1277         }
1278
1279         ZERO_STRUCT(r->out);
1280         r->out.pType = talloc_zero(r, uint32_t);
1281         if (r->out.pType == NULL) {
1282                 talloc_free(r);
1283                 return false;
1284         }
1285
1286         r->out.pData = talloc_zero_array(r, uint8_t, r->in.nSize);
1287         if (r->out.pData == NULL) {
1288                 talloc_free(r);
1289                 return false;
1290         }
1291
1292         r->out.pcbNeeded = talloc_zero(r, uint32_t);
1293         if (r->out.pcbNeeded == NULL) {
1294                 talloc_free(r);
1295                 return false;
1296         }
1297
1298         r->out.result = _winspool_AsyncGetPrinterData(p, r);
1299
1300         if (p->fault_state) {
1301                 talloc_free(r);
1302                 /* Return true here, srv_pipe_hnd.c will take care */
1303                 return true;
1304         }
1305
1306         if (DEBUGLEVEL >= 10) {
1307                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterData, NDR_OUT | NDR_SET_VALUES, r);
1308         }
1309
1310         push = ndr_push_init_ctx(r);
1311         if (push == NULL) {
1312                 talloc_free(r);
1313                 return false;
1314         }
1315
1316         /*
1317          * carry over the pointer count to the reply in case we are
1318          * using full pointer. See NDR specification for full pointers
1319          */
1320         push->ptr_count = pull->ptr_count;
1321
1322         ndr_err = call->ndr_push(push, NDR_OUT, r);
1323         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1324                 talloc_free(r);
1325                 return false;
1326         }
1327
1328         p->out_data.rdata = ndr_push_blob(push);
1329         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1330
1331         talloc_free(r);
1332
1333         return true;
1334 }
1335
1336 static bool api_winspool_AsyncGetPrinterDataEx(struct pipes_struct *p)
1337 {
1338         const struct ndr_interface_call *call;
1339         struct ndr_pull *pull;
1340         struct ndr_push *push;
1341         enum ndr_err_code ndr_err;
1342         struct winspool_AsyncGetPrinterDataEx *r;
1343
1344         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTERDATAEX];
1345
1346         r = talloc(talloc_tos(), struct winspool_AsyncGetPrinterDataEx);
1347         if (r == NULL) {
1348                 return false;
1349         }
1350
1351         pull = ndr_pull_init_blob(&p->in_data.data, r);
1352         if (pull == NULL) {
1353                 talloc_free(r);
1354                 return false;
1355         }
1356
1357         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1358         if (p->endian) {
1359                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1360         }
1361         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1362         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1363                 talloc_free(r);
1364                 return false;
1365         }
1366
1367         if (DEBUGLEVEL >= 10) {
1368                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDataEx, NDR_IN, r);
1369         }
1370
1371         ZERO_STRUCT(r->out);
1372         r->out.pType = talloc_zero(r, uint32_t);
1373         if (r->out.pType == NULL) {
1374                 talloc_free(r);
1375                 return false;
1376         }
1377
1378         r->out.pData = talloc_zero_array(r, uint8_t, r->in.nSize);
1379         if (r->out.pData == NULL) {
1380                 talloc_free(r);
1381                 return false;
1382         }
1383
1384         r->out.pcbNeeded = talloc_zero(r, uint32_t);
1385         if (r->out.pcbNeeded == NULL) {
1386                 talloc_free(r);
1387                 return false;
1388         }
1389
1390         r->out.result = _winspool_AsyncGetPrinterDataEx(p, r);
1391
1392         if (p->fault_state) {
1393                 talloc_free(r);
1394                 /* Return true here, srv_pipe_hnd.c will take care */
1395                 return true;
1396         }
1397
1398         if (DEBUGLEVEL >= 10) {
1399                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDataEx, NDR_OUT | NDR_SET_VALUES, r);
1400         }
1401
1402         push = ndr_push_init_ctx(r);
1403         if (push == NULL) {
1404                 talloc_free(r);
1405                 return false;
1406         }
1407
1408         /*
1409          * carry over the pointer count to the reply in case we are
1410          * using full pointer. See NDR specification for full pointers
1411          */
1412         push->ptr_count = pull->ptr_count;
1413
1414         ndr_err = call->ndr_push(push, NDR_OUT, r);
1415         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1416                 talloc_free(r);
1417                 return false;
1418         }
1419
1420         p->out_data.rdata = ndr_push_blob(push);
1421         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1422
1423         talloc_free(r);
1424
1425         return true;
1426 }
1427
1428 static bool api_winspool_AsyncSetPrinterData(struct pipes_struct *p)
1429 {
1430         const struct ndr_interface_call *call;
1431         struct ndr_pull *pull;
1432         struct ndr_push *push;
1433         enum ndr_err_code ndr_err;
1434         struct winspool_AsyncSetPrinterData *r;
1435
1436         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETPRINTERDATA];
1437
1438         r = talloc(talloc_tos(), struct winspool_AsyncSetPrinterData);
1439         if (r == NULL) {
1440                 return false;
1441         }
1442
1443         pull = ndr_pull_init_blob(&p->in_data.data, r);
1444         if (pull == NULL) {
1445                 talloc_free(r);
1446                 return false;
1447         }
1448
1449         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1450         if (p->endian) {
1451                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1452         }
1453         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1454         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1455                 talloc_free(r);
1456                 return false;
1457         }
1458
1459         if (DEBUGLEVEL >= 10) {
1460                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinterData, NDR_IN, r);
1461         }
1462
1463         r->out.result = _winspool_AsyncSetPrinterData(p, r);
1464
1465         if (p->fault_state) {
1466                 talloc_free(r);
1467                 /* Return true here, srv_pipe_hnd.c will take care */
1468                 return true;
1469         }
1470
1471         if (DEBUGLEVEL >= 10) {
1472                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinterData, NDR_OUT | NDR_SET_VALUES, r);
1473         }
1474
1475         push = ndr_push_init_ctx(r);
1476         if (push == NULL) {
1477                 talloc_free(r);
1478                 return false;
1479         }
1480
1481         /*
1482          * carry over the pointer count to the reply in case we are
1483          * using full pointer. See NDR specification for full pointers
1484          */
1485         push->ptr_count = pull->ptr_count;
1486
1487         ndr_err = call->ndr_push(push, NDR_OUT, r);
1488         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1489                 talloc_free(r);
1490                 return false;
1491         }
1492
1493         p->out_data.rdata = ndr_push_blob(push);
1494         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1495
1496         talloc_free(r);
1497
1498         return true;
1499 }
1500
1501 static bool api_winspool_AsyncSetPrinterDataEx(struct pipes_struct *p)
1502 {
1503         const struct ndr_interface_call *call;
1504         struct ndr_pull *pull;
1505         struct ndr_push *push;
1506         enum ndr_err_code ndr_err;
1507         struct winspool_AsyncSetPrinterDataEx *r;
1508
1509         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETPRINTERDATAEX];
1510
1511         r = talloc(talloc_tos(), struct winspool_AsyncSetPrinterDataEx);
1512         if (r == NULL) {
1513                 return false;
1514         }
1515
1516         pull = ndr_pull_init_blob(&p->in_data.data, r);
1517         if (pull == NULL) {
1518                 talloc_free(r);
1519                 return false;
1520         }
1521
1522         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1523         if (p->endian) {
1524                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1525         }
1526         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1527         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1528                 talloc_free(r);
1529                 return false;
1530         }
1531
1532         if (DEBUGLEVEL >= 10) {
1533                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinterDataEx, NDR_IN, r);
1534         }
1535
1536         r->out.result = _winspool_AsyncSetPrinterDataEx(p, r);
1537
1538         if (p->fault_state) {
1539                 talloc_free(r);
1540                 /* Return true here, srv_pipe_hnd.c will take care */
1541                 return true;
1542         }
1543
1544         if (DEBUGLEVEL >= 10) {
1545                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinterDataEx, NDR_OUT | NDR_SET_VALUES, r);
1546         }
1547
1548         push = ndr_push_init_ctx(r);
1549         if (push == NULL) {
1550                 talloc_free(r);
1551                 return false;
1552         }
1553
1554         /*
1555          * carry over the pointer count to the reply in case we are
1556          * using full pointer. See NDR specification for full pointers
1557          */
1558         push->ptr_count = pull->ptr_count;
1559
1560         ndr_err = call->ndr_push(push, NDR_OUT, r);
1561         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1562                 talloc_free(r);
1563                 return false;
1564         }
1565
1566         p->out_data.rdata = ndr_push_blob(push);
1567         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1568
1569         talloc_free(r);
1570
1571         return true;
1572 }
1573
1574 static bool api_winspool_AsyncClosePrinter(struct pipes_struct *p)
1575 {
1576         const struct ndr_interface_call *call;
1577         struct ndr_pull *pull;
1578         struct ndr_push *push;
1579         enum ndr_err_code ndr_err;
1580         struct winspool_AsyncClosePrinter *r;
1581
1582         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCCLOSEPRINTER];
1583
1584         r = talloc(talloc_tos(), struct winspool_AsyncClosePrinter);
1585         if (r == NULL) {
1586                 return false;
1587         }
1588
1589         pull = ndr_pull_init_blob(&p->in_data.data, r);
1590         if (pull == NULL) {
1591                 talloc_free(r);
1592                 return false;
1593         }
1594
1595         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1596         if (p->endian) {
1597                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1598         }
1599         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1600         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1601                 talloc_free(r);
1602                 return false;
1603         }
1604
1605         if (DEBUGLEVEL >= 10) {
1606                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncClosePrinter, NDR_IN, r);
1607         }
1608
1609         ZERO_STRUCT(r->out);
1610         r->out.phPrinter = r->in.phPrinter;
1611         r->out.result = _winspool_AsyncClosePrinter(p, r);
1612
1613         if (p->fault_state) {
1614                 talloc_free(r);
1615                 /* Return true here, srv_pipe_hnd.c will take care */
1616                 return true;
1617         }
1618
1619         if (DEBUGLEVEL >= 10) {
1620                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncClosePrinter, NDR_OUT | NDR_SET_VALUES, r);
1621         }
1622
1623         push = ndr_push_init_ctx(r);
1624         if (push == NULL) {
1625                 talloc_free(r);
1626                 return false;
1627         }
1628
1629         /*
1630          * carry over the pointer count to the reply in case we are
1631          * using full pointer. See NDR specification for full pointers
1632          */
1633         push->ptr_count = pull->ptr_count;
1634
1635         ndr_err = call->ndr_push(push, NDR_OUT, r);
1636         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1637                 talloc_free(r);
1638                 return false;
1639         }
1640
1641         p->out_data.rdata = ndr_push_blob(push);
1642         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1643
1644         talloc_free(r);
1645
1646         return true;
1647 }
1648
1649 static bool api_winspool_AsyncAddForm(struct pipes_struct *p)
1650 {
1651         const struct ndr_interface_call *call;
1652         struct ndr_pull *pull;
1653         struct ndr_push *push;
1654         enum ndr_err_code ndr_err;
1655         struct winspool_AsyncAddForm *r;
1656
1657         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDFORM];
1658
1659         r = talloc(talloc_tos(), struct winspool_AsyncAddForm);
1660         if (r == NULL) {
1661                 return false;
1662         }
1663
1664         pull = ndr_pull_init_blob(&p->in_data.data, r);
1665         if (pull == NULL) {
1666                 talloc_free(r);
1667                 return false;
1668         }
1669
1670         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1671         if (p->endian) {
1672                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1673         }
1674         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1675         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1676                 talloc_free(r);
1677                 return false;
1678         }
1679
1680         if (DEBUGLEVEL >= 10) {
1681                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddForm, NDR_IN, r);
1682         }
1683
1684         r->out.result = _winspool_AsyncAddForm(p, r);
1685
1686         if (p->fault_state) {
1687                 talloc_free(r);
1688                 /* Return true here, srv_pipe_hnd.c will take care */
1689                 return true;
1690         }
1691
1692         if (DEBUGLEVEL >= 10) {
1693                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddForm, NDR_OUT | NDR_SET_VALUES, r);
1694         }
1695
1696         push = ndr_push_init_ctx(r);
1697         if (push == NULL) {
1698                 talloc_free(r);
1699                 return false;
1700         }
1701
1702         /*
1703          * carry over the pointer count to the reply in case we are
1704          * using full pointer. See NDR specification for full pointers
1705          */
1706         push->ptr_count = pull->ptr_count;
1707
1708         ndr_err = call->ndr_push(push, NDR_OUT, r);
1709         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1710                 talloc_free(r);
1711                 return false;
1712         }
1713
1714         p->out_data.rdata = ndr_push_blob(push);
1715         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1716
1717         talloc_free(r);
1718
1719         return true;
1720 }
1721
1722 static bool api_winspool_AsyncDeleteForm(struct pipes_struct *p)
1723 {
1724         const struct ndr_interface_call *call;
1725         struct ndr_pull *pull;
1726         struct ndr_push *push;
1727         enum ndr_err_code ndr_err;
1728         struct winspool_AsyncDeleteForm *r;
1729
1730         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEFORM];
1731
1732         r = talloc(talloc_tos(), struct winspool_AsyncDeleteForm);
1733         if (r == NULL) {
1734                 return false;
1735         }
1736
1737         pull = ndr_pull_init_blob(&p->in_data.data, r);
1738         if (pull == NULL) {
1739                 talloc_free(r);
1740                 return false;
1741         }
1742
1743         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1744         if (p->endian) {
1745                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1746         }
1747         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1748         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1749                 talloc_free(r);
1750                 return false;
1751         }
1752
1753         if (DEBUGLEVEL >= 10) {
1754                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteForm, NDR_IN, r);
1755         }
1756
1757         r->out.result = _winspool_AsyncDeleteForm(p, r);
1758
1759         if (p->fault_state) {
1760                 talloc_free(r);
1761                 /* Return true here, srv_pipe_hnd.c will take care */
1762                 return true;
1763         }
1764
1765         if (DEBUGLEVEL >= 10) {
1766                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteForm, NDR_OUT | NDR_SET_VALUES, r);
1767         }
1768
1769         push = ndr_push_init_ctx(r);
1770         if (push == NULL) {
1771                 talloc_free(r);
1772                 return false;
1773         }
1774
1775         /*
1776          * carry over the pointer count to the reply in case we are
1777          * using full pointer. See NDR specification for full pointers
1778          */
1779         push->ptr_count = pull->ptr_count;
1780
1781         ndr_err = call->ndr_push(push, NDR_OUT, r);
1782         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1783                 talloc_free(r);
1784                 return false;
1785         }
1786
1787         p->out_data.rdata = ndr_push_blob(push);
1788         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1789
1790         talloc_free(r);
1791
1792         return true;
1793 }
1794
1795 static bool api_winspool_AsyncGetForm(struct pipes_struct *p)
1796 {
1797         const struct ndr_interface_call *call;
1798         struct ndr_pull *pull;
1799         struct ndr_push *push;
1800         enum ndr_err_code ndr_err;
1801         struct winspool_AsyncGetForm *r;
1802
1803         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETFORM];
1804
1805         r = talloc(talloc_tos(), struct winspool_AsyncGetForm);
1806         if (r == NULL) {
1807                 return false;
1808         }
1809
1810         pull = ndr_pull_init_blob(&p->in_data.data, r);
1811         if (pull == NULL) {
1812                 talloc_free(r);
1813                 return false;
1814         }
1815
1816         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1817         if (p->endian) {
1818                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1819         }
1820         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1821         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1822                 talloc_free(r);
1823                 return false;
1824         }
1825
1826         if (DEBUGLEVEL >= 10) {
1827                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetForm, NDR_IN, r);
1828         }
1829
1830         ZERO_STRUCT(r->out);
1831         r->out.pForm = r->in.pForm;
1832         r->out.pcbNeeded = talloc_zero(r, uint32_t);
1833         if (r->out.pcbNeeded == NULL) {
1834                 talloc_free(r);
1835                 return false;
1836         }
1837
1838         r->out.result = _winspool_AsyncGetForm(p, r);
1839
1840         if (p->fault_state) {
1841                 talloc_free(r);
1842                 /* Return true here, srv_pipe_hnd.c will take care */
1843                 return true;
1844         }
1845
1846         if (DEBUGLEVEL >= 10) {
1847                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetForm, NDR_OUT | NDR_SET_VALUES, r);
1848         }
1849
1850         push = ndr_push_init_ctx(r);
1851         if (push == NULL) {
1852                 talloc_free(r);
1853                 return false;
1854         }
1855
1856         /*
1857          * carry over the pointer count to the reply in case we are
1858          * using full pointer. See NDR specification for full pointers
1859          */
1860         push->ptr_count = pull->ptr_count;
1861
1862         ndr_err = call->ndr_push(push, NDR_OUT, r);
1863         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1864                 talloc_free(r);
1865                 return false;
1866         }
1867
1868         p->out_data.rdata = ndr_push_blob(push);
1869         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1870
1871         talloc_free(r);
1872
1873         return true;
1874 }
1875
1876 static bool api_winspool_AsyncSetForm(struct pipes_struct *p)
1877 {
1878         const struct ndr_interface_call *call;
1879         struct ndr_pull *pull;
1880         struct ndr_push *push;
1881         enum ndr_err_code ndr_err;
1882         struct winspool_AsyncSetForm *r;
1883
1884         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETFORM];
1885
1886         r = talloc(talloc_tos(), struct winspool_AsyncSetForm);
1887         if (r == NULL) {
1888                 return false;
1889         }
1890
1891         pull = ndr_pull_init_blob(&p->in_data.data, r);
1892         if (pull == NULL) {
1893                 talloc_free(r);
1894                 return false;
1895         }
1896
1897         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1898         if (p->endian) {
1899                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1900         }
1901         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1902         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1903                 talloc_free(r);
1904                 return false;
1905         }
1906
1907         if (DEBUGLEVEL >= 10) {
1908                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetForm, NDR_IN, r);
1909         }
1910
1911         r->out.result = _winspool_AsyncSetForm(p, r);
1912
1913         if (p->fault_state) {
1914                 talloc_free(r);
1915                 /* Return true here, srv_pipe_hnd.c will take care */
1916                 return true;
1917         }
1918
1919         if (DEBUGLEVEL >= 10) {
1920                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetForm, NDR_OUT | NDR_SET_VALUES, r);
1921         }
1922
1923         push = ndr_push_init_ctx(r);
1924         if (push == NULL) {
1925                 talloc_free(r);
1926                 return false;
1927         }
1928
1929         /*
1930          * carry over the pointer count to the reply in case we are
1931          * using full pointer. See NDR specification for full pointers
1932          */
1933         push->ptr_count = pull->ptr_count;
1934
1935         ndr_err = call->ndr_push(push, NDR_OUT, r);
1936         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1937                 talloc_free(r);
1938                 return false;
1939         }
1940
1941         p->out_data.rdata = ndr_push_blob(push);
1942         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1943
1944         talloc_free(r);
1945
1946         return true;
1947 }
1948
1949 static bool api_winspool_AsyncEnumForms(struct pipes_struct *p)
1950 {
1951         const struct ndr_interface_call *call;
1952         struct ndr_pull *pull;
1953         struct ndr_push *push;
1954         enum ndr_err_code ndr_err;
1955         struct winspool_AsyncEnumForms *r;
1956
1957         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMFORMS];
1958
1959         r = talloc(talloc_tos(), struct winspool_AsyncEnumForms);
1960         if (r == NULL) {
1961                 return false;
1962         }
1963
1964         pull = ndr_pull_init_blob(&p->in_data.data, r);
1965         if (pull == NULL) {
1966                 talloc_free(r);
1967                 return false;
1968         }
1969
1970         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1971         if (p->endian) {
1972                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1973         }
1974         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1975         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1976                 talloc_free(r);
1977                 return false;
1978         }
1979
1980         if (DEBUGLEVEL >= 10) {
1981                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumForms, NDR_IN, r);
1982         }
1983
1984         ZERO_STRUCT(r->out);
1985         r->out.pForm = r->in.pForm;
1986         r->out.pcbNeeded = talloc_zero(r, uint32_t);
1987         if (r->out.pcbNeeded == NULL) {
1988                 talloc_free(r);
1989                 return false;
1990         }
1991
1992         r->out.pcReturned = talloc_zero(r, uint32_t);
1993         if (r->out.pcReturned == NULL) {
1994                 talloc_free(r);
1995                 return false;
1996         }
1997
1998         r->out.result = _winspool_AsyncEnumForms(p, r);
1999
2000         if (p->fault_state) {
2001                 talloc_free(r);
2002                 /* Return true here, srv_pipe_hnd.c will take care */
2003                 return true;
2004         }
2005
2006         if (DEBUGLEVEL >= 10) {
2007                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumForms, NDR_OUT | NDR_SET_VALUES, r);
2008         }
2009
2010         push = ndr_push_init_ctx(r);
2011         if (push == NULL) {
2012                 talloc_free(r);
2013                 return false;
2014         }
2015
2016         /*
2017          * carry over the pointer count to the reply in case we are
2018          * using full pointer. See NDR specification for full pointers
2019          */
2020         push->ptr_count = pull->ptr_count;
2021
2022         ndr_err = call->ndr_push(push, NDR_OUT, r);
2023         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2024                 talloc_free(r);
2025                 return false;
2026         }
2027
2028         p->out_data.rdata = ndr_push_blob(push);
2029         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2030
2031         talloc_free(r);
2032
2033         return true;
2034 }
2035
2036 static bool api_winspool_AsyncGetPrinterDriver(struct pipes_struct *p)
2037 {
2038         const struct ndr_interface_call *call;
2039         struct ndr_pull *pull;
2040         struct ndr_push *push;
2041         enum ndr_err_code ndr_err;
2042         struct winspool_AsyncGetPrinterDriver *r;
2043
2044         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTERDRIVER];
2045
2046         r = talloc(talloc_tos(), struct winspool_AsyncGetPrinterDriver);
2047         if (r == NULL) {
2048                 return false;
2049         }
2050
2051         pull = ndr_pull_init_blob(&p->in_data.data, r);
2052         if (pull == NULL) {
2053                 talloc_free(r);
2054                 return false;
2055         }
2056
2057         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2058         if (p->endian) {
2059                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2060         }
2061         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2062         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2063                 talloc_free(r);
2064                 return false;
2065         }
2066
2067         if (DEBUGLEVEL >= 10) {
2068                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriver, NDR_IN, r);
2069         }
2070
2071         ZERO_STRUCT(r->out);
2072         r->out.pDriver = r->in.pDriver;
2073         r->out.pcbNeeded = talloc_zero(r, uint32_t);
2074         if (r->out.pcbNeeded == NULL) {
2075                 talloc_free(r);
2076                 return false;
2077         }
2078
2079         r->out.pdwServerMaxVersion = talloc_zero(r, uint32_t);
2080         if (r->out.pdwServerMaxVersion == NULL) {
2081                 talloc_free(r);
2082                 return false;
2083         }
2084
2085         r->out.pdwServerMinVersion = talloc_zero(r, uint32_t);
2086         if (r->out.pdwServerMinVersion == NULL) {
2087                 talloc_free(r);
2088                 return false;
2089         }
2090
2091         r->out.result = _winspool_AsyncGetPrinterDriver(p, r);
2092
2093         if (p->fault_state) {
2094                 talloc_free(r);
2095                 /* Return true here, srv_pipe_hnd.c will take care */
2096                 return true;
2097         }
2098
2099         if (DEBUGLEVEL >= 10) {
2100                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriver, NDR_OUT | NDR_SET_VALUES, r);
2101         }
2102
2103         push = ndr_push_init_ctx(r);
2104         if (push == NULL) {
2105                 talloc_free(r);
2106                 return false;
2107         }
2108
2109         /*
2110          * carry over the pointer count to the reply in case we are
2111          * using full pointer. See NDR specification for full pointers
2112          */
2113         push->ptr_count = pull->ptr_count;
2114
2115         ndr_err = call->ndr_push(push, NDR_OUT, r);
2116         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2117                 talloc_free(r);
2118                 return false;
2119         }
2120
2121         p->out_data.rdata = ndr_push_blob(push);
2122         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2123
2124         talloc_free(r);
2125
2126         return true;
2127 }
2128
2129 static bool api_winspool_AsyncEnumPrinterData(struct pipes_struct *p)
2130 {
2131         const struct ndr_interface_call *call;
2132         struct ndr_pull *pull;
2133         struct ndr_push *push;
2134         enum ndr_err_code ndr_err;
2135         struct winspool_AsyncEnumPrinterData *r;
2136
2137         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTERDATA];
2138
2139         r = talloc(talloc_tos(), struct winspool_AsyncEnumPrinterData);
2140         if (r == NULL) {
2141                 return false;
2142         }
2143
2144         pull = ndr_pull_init_blob(&p->in_data.data, r);
2145         if (pull == NULL) {
2146                 talloc_free(r);
2147                 return false;
2148         }
2149
2150         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2151         if (p->endian) {
2152                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2153         }
2154         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2155         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2156                 talloc_free(r);
2157                 return false;
2158         }
2159
2160         if (DEBUGLEVEL >= 10) {
2161                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterData, NDR_IN, r);
2162         }
2163
2164         ZERO_STRUCT(r->out);
2165         r->out.pValueName = talloc_zero_array(r, uint16_t, r->in.cbValueName / 2);
2166         if (r->out.pValueName == NULL) {
2167                 talloc_free(r);
2168                 return false;
2169         }
2170
2171         r->out.pcbValueName = talloc_zero(r, uint32_t);
2172         if (r->out.pcbValueName == NULL) {
2173                 talloc_free(r);
2174                 return false;
2175         }
2176
2177         r->out.pType = talloc_zero(r, uint32_t);
2178         if (r->out.pType == NULL) {
2179                 talloc_free(r);
2180                 return false;
2181         }
2182
2183         r->out.pData = talloc_zero_array(r, uint8_t, r->in.cbData);
2184         if (r->out.pData == NULL) {
2185                 talloc_free(r);
2186                 return false;
2187         }
2188
2189         r->out.pcbData = talloc_zero(r, uint32_t);
2190         if (r->out.pcbData == NULL) {
2191                 talloc_free(r);
2192                 return false;
2193         }
2194
2195         r->out.result = _winspool_AsyncEnumPrinterData(p, r);
2196
2197         if (p->fault_state) {
2198                 talloc_free(r);
2199                 /* Return true here, srv_pipe_hnd.c will take care */
2200                 return true;
2201         }
2202
2203         if (DEBUGLEVEL >= 10) {
2204                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterData, NDR_OUT | NDR_SET_VALUES, r);
2205         }
2206
2207         push = ndr_push_init_ctx(r);
2208         if (push == NULL) {
2209                 talloc_free(r);
2210                 return false;
2211         }
2212
2213         /*
2214          * carry over the pointer count to the reply in case we are
2215          * using full pointer. See NDR specification for full pointers
2216          */
2217         push->ptr_count = pull->ptr_count;
2218
2219         ndr_err = call->ndr_push(push, NDR_OUT, r);
2220         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2221                 talloc_free(r);
2222                 return false;
2223         }
2224
2225         p->out_data.rdata = ndr_push_blob(push);
2226         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2227
2228         talloc_free(r);
2229
2230         return true;
2231 }
2232
2233 static bool api_winspool_AsyncEnumPrinterDataEx(struct pipes_struct *p)
2234 {
2235         const struct ndr_interface_call *call;
2236         struct ndr_pull *pull;
2237         struct ndr_push *push;
2238         enum ndr_err_code ndr_err;
2239         struct winspool_AsyncEnumPrinterDataEx *r;
2240
2241         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTERDATAEX];
2242
2243         r = talloc(talloc_tos(), struct winspool_AsyncEnumPrinterDataEx);
2244         if (r == NULL) {
2245                 return false;
2246         }
2247
2248         pull = ndr_pull_init_blob(&p->in_data.data, r);
2249         if (pull == NULL) {
2250                 talloc_free(r);
2251                 return false;
2252         }
2253
2254         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2255         if (p->endian) {
2256                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2257         }
2258         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2259         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2260                 talloc_free(r);
2261                 return false;
2262         }
2263
2264         if (DEBUGLEVEL >= 10) {
2265                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterDataEx, NDR_IN, r);
2266         }
2267
2268         ZERO_STRUCT(r->out);
2269         r->out.pEnumValues = talloc_zero_array(r, uint8_t, r->in.cbEnumValues);
2270         if (r->out.pEnumValues == NULL) {
2271                 talloc_free(r);
2272                 return false;
2273         }
2274
2275         r->out.pcbEnumValues = talloc_zero(r, uint32_t);
2276         if (r->out.pcbEnumValues == NULL) {
2277                 talloc_free(r);
2278                 return false;
2279         }
2280
2281         r->out.pnEnumValues = talloc_zero(r, uint32_t);
2282         if (r->out.pnEnumValues == NULL) {
2283                 talloc_free(r);
2284                 return false;
2285         }
2286
2287         r->out.result = _winspool_AsyncEnumPrinterDataEx(p, r);
2288
2289         if (p->fault_state) {
2290                 talloc_free(r);
2291                 /* Return true here, srv_pipe_hnd.c will take care */
2292                 return true;
2293         }
2294
2295         if (DEBUGLEVEL >= 10) {
2296                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterDataEx, NDR_OUT | NDR_SET_VALUES, r);
2297         }
2298
2299         push = ndr_push_init_ctx(r);
2300         if (push == NULL) {
2301                 talloc_free(r);
2302                 return false;
2303         }
2304
2305         /*
2306          * carry over the pointer count to the reply in case we are
2307          * using full pointer. See NDR specification for full pointers
2308          */
2309         push->ptr_count = pull->ptr_count;
2310
2311         ndr_err = call->ndr_push(push, NDR_OUT, r);
2312         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2313                 talloc_free(r);
2314                 return false;
2315         }
2316
2317         p->out_data.rdata = ndr_push_blob(push);
2318         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2319
2320         talloc_free(r);
2321
2322         return true;
2323 }
2324
2325 static bool api_winspool_AsyncEnumPrinterKey(struct pipes_struct *p)
2326 {
2327         const struct ndr_interface_call *call;
2328         struct ndr_pull *pull;
2329         struct ndr_push *push;
2330         enum ndr_err_code ndr_err;
2331         struct winspool_AsyncEnumPrinterKey *r;
2332
2333         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTERKEY];
2334
2335         r = talloc(talloc_tos(), struct winspool_AsyncEnumPrinterKey);
2336         if (r == NULL) {
2337                 return false;
2338         }
2339
2340         pull = ndr_pull_init_blob(&p->in_data.data, r);
2341         if (pull == NULL) {
2342                 talloc_free(r);
2343                 return false;
2344         }
2345
2346         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2347         if (p->endian) {
2348                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2349         }
2350         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2351         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2352                 talloc_free(r);
2353                 return false;
2354         }
2355
2356         if (DEBUGLEVEL >= 10) {
2357                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterKey, NDR_IN, r);
2358         }
2359
2360         ZERO_STRUCT(r->out);
2361         r->out.pSubkey = talloc_zero_array(r, uint16_t, r->in.cbSubkey / 2);
2362         if (r->out.pSubkey == NULL) {
2363                 talloc_free(r);
2364                 return false;
2365         }
2366
2367         r->out.pcbSubkey = talloc_zero(r, uint32_t);
2368         if (r->out.pcbSubkey == NULL) {
2369                 talloc_free(r);
2370                 return false;
2371         }
2372
2373         r->out.result = _winspool_AsyncEnumPrinterKey(p, r);
2374
2375         if (p->fault_state) {
2376                 talloc_free(r);
2377                 /* Return true here, srv_pipe_hnd.c will take care */
2378                 return true;
2379         }
2380
2381         if (DEBUGLEVEL >= 10) {
2382                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterKey, NDR_OUT | NDR_SET_VALUES, r);
2383         }
2384
2385         push = ndr_push_init_ctx(r);
2386         if (push == NULL) {
2387                 talloc_free(r);
2388                 return false;
2389         }
2390
2391         /*
2392          * carry over the pointer count to the reply in case we are
2393          * using full pointer. See NDR specification for full pointers
2394          */
2395         push->ptr_count = pull->ptr_count;
2396
2397         ndr_err = call->ndr_push(push, NDR_OUT, r);
2398         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2399                 talloc_free(r);
2400                 return false;
2401         }
2402
2403         p->out_data.rdata = ndr_push_blob(push);
2404         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2405
2406         talloc_free(r);
2407
2408         return true;
2409 }
2410
2411 static bool api_winspool_AsyncDeletePrinterData(struct pipes_struct *p)
2412 {
2413         const struct ndr_interface_call *call;
2414         struct ndr_pull *pull;
2415         struct ndr_push *push;
2416         enum ndr_err_code ndr_err;
2417         struct winspool_AsyncDeletePrinterData *r;
2418
2419         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDATA];
2420
2421         r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterData);
2422         if (r == NULL) {
2423                 return false;
2424         }
2425
2426         pull = ndr_pull_init_blob(&p->in_data.data, r);
2427         if (pull == NULL) {
2428                 talloc_free(r);
2429                 return false;
2430         }
2431
2432         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2433         if (p->endian) {
2434                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2435         }
2436         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2437         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2438                 talloc_free(r);
2439                 return false;
2440         }
2441
2442         if (DEBUGLEVEL >= 10) {
2443                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterData, NDR_IN, r);
2444         }
2445
2446         r->out.result = _winspool_AsyncDeletePrinterData(p, r);
2447
2448         if (p->fault_state) {
2449                 talloc_free(r);
2450                 /* Return true here, srv_pipe_hnd.c will take care */
2451                 return true;
2452         }
2453
2454         if (DEBUGLEVEL >= 10) {
2455                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterData, NDR_OUT | NDR_SET_VALUES, r);
2456         }
2457
2458         push = ndr_push_init_ctx(r);
2459         if (push == NULL) {
2460                 talloc_free(r);
2461                 return false;
2462         }
2463
2464         /*
2465          * carry over the pointer count to the reply in case we are
2466          * using full pointer. See NDR specification for full pointers
2467          */
2468         push->ptr_count = pull->ptr_count;
2469
2470         ndr_err = call->ndr_push(push, NDR_OUT, r);
2471         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2472                 talloc_free(r);
2473                 return false;
2474         }
2475
2476         p->out_data.rdata = ndr_push_blob(push);
2477         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2478
2479         talloc_free(r);
2480
2481         return true;
2482 }
2483
2484 static bool api_winspool_AsyncDeletePrinterDataEx(struct pipes_struct *p)
2485 {
2486         const struct ndr_interface_call *call;
2487         struct ndr_pull *pull;
2488         struct ndr_push *push;
2489         enum ndr_err_code ndr_err;
2490         struct winspool_AsyncDeletePrinterDataEx *r;
2491
2492         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDATAEX];
2493
2494         r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterDataEx);
2495         if (r == NULL) {
2496                 return false;
2497         }
2498
2499         pull = ndr_pull_init_blob(&p->in_data.data, r);
2500         if (pull == NULL) {
2501                 talloc_free(r);
2502                 return false;
2503         }
2504
2505         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2506         if (p->endian) {
2507                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2508         }
2509         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2510         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2511                 talloc_free(r);
2512                 return false;
2513         }
2514
2515         if (DEBUGLEVEL >= 10) {
2516                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDataEx, NDR_IN, r);
2517         }
2518
2519         r->out.result = _winspool_AsyncDeletePrinterDataEx(p, r);
2520
2521         if (p->fault_state) {
2522                 talloc_free(r);
2523                 /* Return true here, srv_pipe_hnd.c will take care */
2524                 return true;
2525         }
2526
2527         if (DEBUGLEVEL >= 10) {
2528                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDataEx, NDR_OUT | NDR_SET_VALUES, r);
2529         }
2530
2531         push = ndr_push_init_ctx(r);
2532         if (push == NULL) {
2533                 talloc_free(r);
2534                 return false;
2535         }
2536
2537         /*
2538          * carry over the pointer count to the reply in case we are
2539          * using full pointer. See NDR specification for full pointers
2540          */
2541         push->ptr_count = pull->ptr_count;
2542
2543         ndr_err = call->ndr_push(push, NDR_OUT, r);
2544         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2545                 talloc_free(r);
2546                 return false;
2547         }
2548
2549         p->out_data.rdata = ndr_push_blob(push);
2550         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2551
2552         talloc_free(r);
2553
2554         return true;
2555 }
2556
2557 static bool api_winspool_AsyncDeletePrinterKey(struct pipes_struct *p)
2558 {
2559         const struct ndr_interface_call *call;
2560         struct ndr_pull *pull;
2561         struct ndr_push *push;
2562         enum ndr_err_code ndr_err;
2563         struct winspool_AsyncDeletePrinterKey *r;
2564
2565         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERKEY];
2566
2567         r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterKey);
2568         if (r == NULL) {
2569                 return false;
2570         }
2571
2572         pull = ndr_pull_init_blob(&p->in_data.data, r);
2573         if (pull == NULL) {
2574                 talloc_free(r);
2575                 return false;
2576         }
2577
2578         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2579         if (p->endian) {
2580                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2581         }
2582         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2583         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2584                 talloc_free(r);
2585                 return false;
2586         }
2587
2588         if (DEBUGLEVEL >= 10) {
2589                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterKey, NDR_IN, r);
2590         }
2591
2592         r->out.result = _winspool_AsyncDeletePrinterKey(p, r);
2593
2594         if (p->fault_state) {
2595                 talloc_free(r);
2596                 /* Return true here, srv_pipe_hnd.c will take care */
2597                 return true;
2598         }
2599
2600         if (DEBUGLEVEL >= 10) {
2601                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterKey, NDR_OUT | NDR_SET_VALUES, r);
2602         }
2603
2604         push = ndr_push_init_ctx(r);
2605         if (push == NULL) {
2606                 talloc_free(r);
2607                 return false;
2608         }
2609
2610         /*
2611          * carry over the pointer count to the reply in case we are
2612          * using full pointer. See NDR specification for full pointers
2613          */
2614         push->ptr_count = pull->ptr_count;
2615
2616         ndr_err = call->ndr_push(push, NDR_OUT, r);
2617         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2618                 talloc_free(r);
2619                 return false;
2620         }
2621
2622         p->out_data.rdata = ndr_push_blob(push);
2623         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2624
2625         talloc_free(r);
2626
2627         return true;
2628 }
2629
2630 static bool api_winspool_AsyncXcvData(struct pipes_struct *p)
2631 {
2632         const struct ndr_interface_call *call;
2633         struct ndr_pull *pull;
2634         struct ndr_push *push;
2635         enum ndr_err_code ndr_err;
2636         struct winspool_AsyncXcvData *r;
2637
2638         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCXCVDATA];
2639
2640         r = talloc(talloc_tos(), struct winspool_AsyncXcvData);
2641         if (r == NULL) {
2642                 return false;
2643         }
2644
2645         pull = ndr_pull_init_blob(&p->in_data.data, r);
2646         if (pull == NULL) {
2647                 talloc_free(r);
2648                 return false;
2649         }
2650
2651         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2652         if (p->endian) {
2653                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2654         }
2655         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2656         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2657                 talloc_free(r);
2658                 return false;
2659         }
2660
2661         if (DEBUGLEVEL >= 10) {
2662                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncXcvData, NDR_IN, r);
2663         }
2664
2665         ZERO_STRUCT(r->out);
2666         r->out.pdwStatus = r->in.pdwStatus;
2667         r->out.pOutputData = talloc_zero_array(r, uint8_t, r->in.cbOutputData);
2668         if (r->out.pOutputData == NULL) {
2669                 talloc_free(r);
2670                 return false;
2671         }
2672
2673         r->out.pcbOutputNeeded = talloc_zero(r, uint32_t);
2674         if (r->out.pcbOutputNeeded == NULL) {
2675                 talloc_free(r);
2676                 return false;
2677         }
2678
2679         r->out.result = _winspool_AsyncXcvData(p, r);
2680
2681         if (p->fault_state) {
2682                 talloc_free(r);
2683                 /* Return true here, srv_pipe_hnd.c will take care */
2684                 return true;
2685         }
2686
2687         if (DEBUGLEVEL >= 10) {
2688                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncXcvData, NDR_OUT | NDR_SET_VALUES, r);
2689         }
2690
2691         push = ndr_push_init_ctx(r);
2692         if (push == NULL) {
2693                 talloc_free(r);
2694                 return false;
2695         }
2696
2697         /*
2698          * carry over the pointer count to the reply in case we are
2699          * using full pointer. See NDR specification for full pointers
2700          */
2701         push->ptr_count = pull->ptr_count;
2702
2703         ndr_err = call->ndr_push(push, NDR_OUT, r);
2704         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2705                 talloc_free(r);
2706                 return false;
2707         }
2708
2709         p->out_data.rdata = ndr_push_blob(push);
2710         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2711
2712         talloc_free(r);
2713
2714         return true;
2715 }
2716
2717 static bool api_winspool_AsyncSendRecvBidiData(struct pipes_struct *p)
2718 {
2719         const struct ndr_interface_call *call;
2720         struct ndr_pull *pull;
2721         struct ndr_push *push;
2722         enum ndr_err_code ndr_err;
2723         struct winspool_AsyncSendRecvBidiData *r;
2724
2725         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSENDRECVBIDIDATA];
2726
2727         r = talloc(talloc_tos(), struct winspool_AsyncSendRecvBidiData);
2728         if (r == NULL) {
2729                 return false;
2730         }
2731
2732         pull = ndr_pull_init_blob(&p->in_data.data, r);
2733         if (pull == NULL) {
2734                 talloc_free(r);
2735                 return false;
2736         }
2737
2738         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2739         if (p->endian) {
2740                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2741         }
2742         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2743         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2744                 talloc_free(r);
2745                 return false;
2746         }
2747
2748         if (DEBUGLEVEL >= 10) {
2749                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSendRecvBidiData, NDR_IN, r);
2750         }
2751
2752         ZERO_STRUCT(r->out);
2753         r->out.ppRespData = talloc_zero(r, struct RPC_BIDI_RESPONSE_CONTAINER *);
2754         if (r->out.ppRespData == NULL) {
2755                 talloc_free(r);
2756                 return false;
2757         }
2758
2759         r->out.result = _winspool_AsyncSendRecvBidiData(p, r);
2760
2761         if (p->fault_state) {
2762                 talloc_free(r);
2763                 /* Return true here, srv_pipe_hnd.c will take care */
2764                 return true;
2765         }
2766
2767         if (DEBUGLEVEL >= 10) {
2768                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSendRecvBidiData, NDR_OUT | NDR_SET_VALUES, r);
2769         }
2770
2771         push = ndr_push_init_ctx(r);
2772         if (push == NULL) {
2773                 talloc_free(r);
2774                 return false;
2775         }
2776
2777         /*
2778          * carry over the pointer count to the reply in case we are
2779          * using full pointer. See NDR specification for full pointers
2780          */
2781         push->ptr_count = pull->ptr_count;
2782
2783         ndr_err = call->ndr_push(push, NDR_OUT, r);
2784         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2785                 talloc_free(r);
2786                 return false;
2787         }
2788
2789         p->out_data.rdata = ndr_push_blob(push);
2790         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2791
2792         talloc_free(r);
2793
2794         return true;
2795 }
2796
2797 static bool api_winspool_AsyncCreatePrinterIC(struct pipes_struct *p)
2798 {
2799         const struct ndr_interface_call *call;
2800         struct ndr_pull *pull;
2801         struct ndr_push *push;
2802         enum ndr_err_code ndr_err;
2803         struct winspool_AsyncCreatePrinterIC *r;
2804
2805         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCCREATEPRINTERIC];
2806
2807         r = talloc(talloc_tos(), struct winspool_AsyncCreatePrinterIC);
2808         if (r == NULL) {
2809                 return false;
2810         }
2811
2812         pull = ndr_pull_init_blob(&p->in_data.data, r);
2813         if (pull == NULL) {
2814                 talloc_free(r);
2815                 return false;
2816         }
2817
2818         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2819         if (p->endian) {
2820                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2821         }
2822         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2823         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2824                 talloc_free(r);
2825                 return false;
2826         }
2827
2828         if (DEBUGLEVEL >= 10) {
2829                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncCreatePrinterIC, NDR_IN, r);
2830         }
2831
2832         ZERO_STRUCT(r->out);
2833         r->out.pHandle = talloc_zero(r, struct policy_handle);
2834         if (r->out.pHandle == NULL) {
2835                 talloc_free(r);
2836                 return false;
2837         }
2838
2839         r->out.result = _winspool_AsyncCreatePrinterIC(p, r);
2840
2841         if (p->fault_state) {
2842                 talloc_free(r);
2843                 /* Return true here, srv_pipe_hnd.c will take care */
2844                 return true;
2845         }
2846
2847         if (DEBUGLEVEL >= 10) {
2848                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncCreatePrinterIC, NDR_OUT | NDR_SET_VALUES, r);
2849         }
2850
2851         push = ndr_push_init_ctx(r);
2852         if (push == NULL) {
2853                 talloc_free(r);
2854                 return false;
2855         }
2856
2857         /*
2858          * carry over the pointer count to the reply in case we are
2859          * using full pointer. See NDR specification for full pointers
2860          */
2861         push->ptr_count = pull->ptr_count;
2862
2863         ndr_err = call->ndr_push(push, NDR_OUT, r);
2864         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2865                 talloc_free(r);
2866                 return false;
2867         }
2868
2869         p->out_data.rdata = ndr_push_blob(push);
2870         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2871
2872         talloc_free(r);
2873
2874         return true;
2875 }
2876
2877 static bool api_winspool_AsyncPlayGdiScriptOnPrinterIC(struct pipes_struct *p)
2878 {
2879         const struct ndr_interface_call *call;
2880         struct ndr_pull *pull;
2881         struct ndr_push *push;
2882         enum ndr_err_code ndr_err;
2883         struct winspool_AsyncPlayGdiScriptOnPrinterIC *r;
2884
2885         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCPLAYGDISCRIPTONPRINTERIC];
2886
2887         r = talloc(talloc_tos(), struct winspool_AsyncPlayGdiScriptOnPrinterIC);
2888         if (r == NULL) {
2889                 return false;
2890         }
2891
2892         pull = ndr_pull_init_blob(&p->in_data.data, r);
2893         if (pull == NULL) {
2894                 talloc_free(r);
2895                 return false;
2896         }
2897
2898         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2899         if (p->endian) {
2900                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2901         }
2902         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2903         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2904                 talloc_free(r);
2905                 return false;
2906         }
2907
2908         if (DEBUGLEVEL >= 10) {
2909                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncPlayGdiScriptOnPrinterIC, NDR_IN, r);
2910         }
2911
2912         ZERO_STRUCT(r->out);
2913         r->out.pOut = talloc_zero_array(r, uint8_t, r->in.cOut);
2914         if (r->out.pOut == NULL) {
2915                 talloc_free(r);
2916                 return false;
2917         }
2918
2919         r->out.result = _winspool_AsyncPlayGdiScriptOnPrinterIC(p, r);
2920
2921         if (p->fault_state) {
2922                 talloc_free(r);
2923                 /* Return true here, srv_pipe_hnd.c will take care */
2924                 return true;
2925         }
2926
2927         if (DEBUGLEVEL >= 10) {
2928                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncPlayGdiScriptOnPrinterIC, NDR_OUT | NDR_SET_VALUES, r);
2929         }
2930
2931         push = ndr_push_init_ctx(r);
2932         if (push == NULL) {
2933                 talloc_free(r);
2934                 return false;
2935         }
2936
2937         /*
2938          * carry over the pointer count to the reply in case we are
2939          * using full pointer. See NDR specification for full pointers
2940          */
2941         push->ptr_count = pull->ptr_count;
2942
2943         ndr_err = call->ndr_push(push, NDR_OUT, r);
2944         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2945                 talloc_free(r);
2946                 return false;
2947         }
2948
2949         p->out_data.rdata = ndr_push_blob(push);
2950         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2951
2952         talloc_free(r);
2953
2954         return true;
2955 }
2956
2957 static bool api_winspool_AsyncDeletePrinterIC(struct pipes_struct *p)
2958 {
2959         const struct ndr_interface_call *call;
2960         struct ndr_pull *pull;
2961         struct ndr_push *push;
2962         enum ndr_err_code ndr_err;
2963         struct winspool_AsyncDeletePrinterIC *r;
2964
2965         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERIC];
2966
2967         r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterIC);
2968         if (r == NULL) {
2969                 return false;
2970         }
2971
2972         pull = ndr_pull_init_blob(&p->in_data.data, r);
2973         if (pull == NULL) {
2974                 talloc_free(r);
2975                 return false;
2976         }
2977
2978         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2979         if (p->endian) {
2980                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2981         }
2982         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2983         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2984                 talloc_free(r);
2985                 return false;
2986         }
2987
2988         if (DEBUGLEVEL >= 10) {
2989                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterIC, NDR_IN, r);
2990         }
2991
2992         ZERO_STRUCT(r->out);
2993         r->out.phPrinterIC = r->in.phPrinterIC;
2994         r->out.result = _winspool_AsyncDeletePrinterIC(p, r);
2995
2996         if (p->fault_state) {
2997                 talloc_free(r);
2998                 /* Return true here, srv_pipe_hnd.c will take care */
2999                 return true;
3000         }
3001
3002         if (DEBUGLEVEL >= 10) {
3003                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterIC, NDR_OUT | NDR_SET_VALUES, r);
3004         }
3005
3006         push = ndr_push_init_ctx(r);
3007         if (push == NULL) {
3008                 talloc_free(r);
3009                 return false;
3010         }
3011
3012         /*
3013          * carry over the pointer count to the reply in case we are
3014          * using full pointer. See NDR specification for full pointers
3015          */
3016         push->ptr_count = pull->ptr_count;
3017
3018         ndr_err = call->ndr_push(push, NDR_OUT, r);
3019         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3020                 talloc_free(r);
3021                 return false;
3022         }
3023
3024         p->out_data.rdata = ndr_push_blob(push);
3025         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3026
3027         talloc_free(r);
3028
3029         return true;
3030 }
3031
3032 static bool api_winspool_AsyncEnumPrinters(struct pipes_struct *p)
3033 {
3034         const struct ndr_interface_call *call;
3035         struct ndr_pull *pull;
3036         struct ndr_push *push;
3037         enum ndr_err_code ndr_err;
3038         struct winspool_AsyncEnumPrinters *r;
3039
3040         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTERS];
3041
3042         r = talloc(talloc_tos(), struct winspool_AsyncEnumPrinters);
3043         if (r == NULL) {
3044                 return false;
3045         }
3046
3047         pull = ndr_pull_init_blob(&p->in_data.data, r);
3048         if (pull == NULL) {
3049                 talloc_free(r);
3050                 return false;
3051         }
3052
3053         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3054         if (p->endian) {
3055                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3056         }
3057         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3058         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3059                 talloc_free(r);
3060                 return false;
3061         }
3062
3063         if (DEBUGLEVEL >= 10) {
3064                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinters, NDR_IN, r);
3065         }
3066
3067         ZERO_STRUCT(r->out);
3068         r->out.pPrinterEnum = r->in.pPrinterEnum;
3069         r->out.pcbNeeded = talloc_zero(r, uint32_t);
3070         if (r->out.pcbNeeded == NULL) {
3071                 talloc_free(r);
3072                 return false;
3073         }
3074
3075         r->out.pcReturned = talloc_zero(r, uint32_t);
3076         if (r->out.pcReturned == NULL) {
3077                 talloc_free(r);
3078                 return false;
3079         }
3080
3081         r->out.result = _winspool_AsyncEnumPrinters(p, r);
3082
3083         if (p->fault_state) {
3084                 talloc_free(r);
3085                 /* Return true here, srv_pipe_hnd.c will take care */
3086                 return true;
3087         }
3088
3089         if (DEBUGLEVEL >= 10) {
3090                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinters, NDR_OUT | NDR_SET_VALUES, r);
3091         }
3092
3093         push = ndr_push_init_ctx(r);
3094         if (push == NULL) {
3095                 talloc_free(r);
3096                 return false;
3097         }
3098
3099         /*
3100          * carry over the pointer count to the reply in case we are
3101          * using full pointer. See NDR specification for full pointers
3102          */
3103         push->ptr_count = pull->ptr_count;
3104
3105         ndr_err = call->ndr_push(push, NDR_OUT, r);
3106         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3107                 talloc_free(r);
3108                 return false;
3109         }
3110
3111         p->out_data.rdata = ndr_push_blob(push);
3112         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3113
3114         talloc_free(r);
3115
3116         return true;
3117 }
3118
3119 static bool api_winspool_AsyncAddPrinterDriver(struct pipes_struct *p)
3120 {
3121         const struct ndr_interface_call *call;
3122         struct ndr_pull *pull;
3123         struct ndr_push *push;
3124         enum ndr_err_code ndr_err;
3125         struct winspool_AsyncAddPrinterDriver *r;
3126
3127         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDPRINTERDRIVER];
3128
3129         r = talloc(talloc_tos(), struct winspool_AsyncAddPrinterDriver);
3130         if (r == NULL) {
3131                 return false;
3132         }
3133
3134         pull = ndr_pull_init_blob(&p->in_data.data, r);
3135         if (pull == NULL) {
3136                 talloc_free(r);
3137                 return false;
3138         }
3139
3140         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3141         if (p->endian) {
3142                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3143         }
3144         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3145         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3146                 talloc_free(r);
3147                 return false;
3148         }
3149
3150         if (DEBUGLEVEL >= 10) {
3151                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrinterDriver, NDR_IN, r);
3152         }
3153
3154         r->out.result = _winspool_AsyncAddPrinterDriver(p, r);
3155
3156         if (p->fault_state) {
3157                 talloc_free(r);
3158                 /* Return true here, srv_pipe_hnd.c will take care */
3159                 return true;
3160         }
3161
3162         if (DEBUGLEVEL >= 10) {
3163                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrinterDriver, NDR_OUT | NDR_SET_VALUES, r);
3164         }
3165
3166         push = ndr_push_init_ctx(r);
3167         if (push == NULL) {
3168                 talloc_free(r);
3169                 return false;
3170         }
3171
3172         /*
3173          * carry over the pointer count to the reply in case we are
3174          * using full pointer. See NDR specification for full pointers
3175          */
3176         push->ptr_count = pull->ptr_count;
3177
3178         ndr_err = call->ndr_push(push, NDR_OUT, r);
3179         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3180                 talloc_free(r);
3181                 return false;
3182         }
3183
3184         p->out_data.rdata = ndr_push_blob(push);
3185         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3186
3187         talloc_free(r);
3188
3189         return true;
3190 }
3191
3192 static bool api_winspool_AsyncEnumPrinterDrivers(struct pipes_struct *p)
3193 {
3194         const struct ndr_interface_call *call;
3195         struct ndr_pull *pull;
3196         struct ndr_push *push;
3197         enum ndr_err_code ndr_err;
3198         struct winspool_AsyncEnumPrinterDrivers *r;
3199
3200         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTERDRIVERS];
3201
3202         r = talloc(talloc_tos(), struct winspool_AsyncEnumPrinterDrivers);
3203         if (r == NULL) {
3204                 return false;
3205         }
3206
3207         pull = ndr_pull_init_blob(&p->in_data.data, r);
3208         if (pull == NULL) {
3209                 talloc_free(r);
3210                 return false;
3211         }
3212
3213         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3214         if (p->endian) {
3215                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3216         }
3217         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3218         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3219                 talloc_free(r);
3220                 return false;
3221         }
3222
3223         if (DEBUGLEVEL >= 10) {
3224                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterDrivers, NDR_IN, r);
3225         }
3226
3227         ZERO_STRUCT(r->out);
3228         r->out.pDrivers = r->in.pDrivers;
3229         r->out.pcbNeeded = talloc_zero(r, uint32_t);
3230         if (r->out.pcbNeeded == NULL) {
3231                 talloc_free(r);
3232                 return false;
3233         }
3234
3235         r->out.pcReturned = talloc_zero(r, uint32_t);
3236         if (r->out.pcReturned == NULL) {
3237                 talloc_free(r);
3238                 return false;
3239         }
3240
3241         r->out.result = _winspool_AsyncEnumPrinterDrivers(p, r);
3242
3243         if (p->fault_state) {
3244                 talloc_free(r);
3245                 /* Return true here, srv_pipe_hnd.c will take care */
3246                 return true;
3247         }
3248
3249         if (DEBUGLEVEL >= 10) {
3250                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterDrivers, NDR_OUT | NDR_SET_VALUES, r);
3251         }
3252
3253         push = ndr_push_init_ctx(r);
3254         if (push == NULL) {
3255                 talloc_free(r);
3256                 return false;
3257         }
3258
3259         /*
3260          * carry over the pointer count to the reply in case we are
3261          * using full pointer. See NDR specification for full pointers
3262          */
3263         push->ptr_count = pull->ptr_count;
3264
3265         ndr_err = call->ndr_push(push, NDR_OUT, r);
3266         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3267                 talloc_free(r);
3268                 return false;
3269         }
3270
3271         p->out_data.rdata = ndr_push_blob(push);
3272         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3273
3274         talloc_free(r);
3275
3276         return true;
3277 }
3278
3279 static bool api_winspool_AsyncGetPrinterDriverDirectory(struct pipes_struct *p)
3280 {
3281         const struct ndr_interface_call *call;
3282         struct ndr_pull *pull;
3283         struct ndr_push *push;
3284         enum ndr_err_code ndr_err;
3285         struct winspool_AsyncGetPrinterDriverDirectory *r;
3286
3287         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTERDRIVERDIRECTORY];
3288
3289         r = talloc(talloc_tos(), struct winspool_AsyncGetPrinterDriverDirectory);
3290         if (r == NULL) {
3291                 return false;
3292         }
3293
3294         pull = ndr_pull_init_blob(&p->in_data.data, r);
3295         if (pull == NULL) {
3296                 talloc_free(r);
3297                 return false;
3298         }
3299
3300         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3301         if (p->endian) {
3302                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3303         }
3304         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3305         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3306                 talloc_free(r);
3307                 return false;
3308         }
3309
3310         if (DEBUGLEVEL >= 10) {
3311                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriverDirectory, NDR_IN, r);
3312         }
3313
3314         ZERO_STRUCT(r->out);
3315         r->out.pDriverDirectory = r->in.pDriverDirectory;
3316         r->out.pcbNeeded = talloc_zero(r, uint32_t);
3317         if (r->out.pcbNeeded == NULL) {
3318                 talloc_free(r);
3319                 return false;
3320         }
3321
3322         r->out.result = _winspool_AsyncGetPrinterDriverDirectory(p, r);
3323
3324         if (p->fault_state) {
3325                 talloc_free(r);
3326                 /* Return true here, srv_pipe_hnd.c will take care */
3327                 return true;
3328         }
3329
3330         if (DEBUGLEVEL >= 10) {
3331                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriverDirectory, NDR_OUT | NDR_SET_VALUES, r);
3332         }
3333
3334         push = ndr_push_init_ctx(r);
3335         if (push == NULL) {
3336                 talloc_free(r);
3337                 return false;
3338         }
3339
3340         /*
3341          * carry over the pointer count to the reply in case we are
3342          * using full pointer. See NDR specification for full pointers
3343          */
3344         push->ptr_count = pull->ptr_count;
3345
3346         ndr_err = call->ndr_push(push, NDR_OUT, r);
3347         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3348                 talloc_free(r);
3349                 return false;
3350         }
3351
3352         p->out_data.rdata = ndr_push_blob(push);
3353         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3354
3355         talloc_free(r);
3356
3357         return true;
3358 }
3359
3360 static bool api_winspool_AsyncDeletePrinterDriver(struct pipes_struct *p)
3361 {
3362         const struct ndr_interface_call *call;
3363         struct ndr_pull *pull;
3364         struct ndr_push *push;
3365         enum ndr_err_code ndr_err;
3366         struct winspool_AsyncDeletePrinterDriver *r;
3367
3368         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVER];
3369
3370         r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterDriver);
3371         if (r == NULL) {
3372                 return false;
3373         }
3374
3375         pull = ndr_pull_init_blob(&p->in_data.data, r);
3376         if (pull == NULL) {
3377                 talloc_free(r);
3378                 return false;
3379         }
3380
3381         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3382         if (p->endian) {
3383                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3384         }
3385         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3386         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3387                 talloc_free(r);
3388                 return false;
3389         }
3390
3391         if (DEBUGLEVEL >= 10) {
3392                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriver, NDR_IN, r);
3393         }
3394
3395         r->out.result = _winspool_AsyncDeletePrinterDriver(p, r);
3396
3397         if (p->fault_state) {
3398                 talloc_free(r);
3399                 /* Return true here, srv_pipe_hnd.c will take care */
3400                 return true;
3401         }
3402
3403         if (DEBUGLEVEL >= 10) {
3404                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriver, NDR_OUT | NDR_SET_VALUES, r);
3405         }
3406
3407         push = ndr_push_init_ctx(r);
3408         if (push == NULL) {
3409                 talloc_free(r);
3410                 return false;
3411         }
3412
3413         /*
3414          * carry over the pointer count to the reply in case we are
3415          * using full pointer. See NDR specification for full pointers
3416          */
3417         push->ptr_count = pull->ptr_count;
3418
3419         ndr_err = call->ndr_push(push, NDR_OUT, r);
3420         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3421                 talloc_free(r);
3422                 return false;
3423         }
3424
3425         p->out_data.rdata = ndr_push_blob(push);
3426         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3427
3428         talloc_free(r);
3429
3430         return true;
3431 }
3432
3433 static bool api_winspool_AsyncDeletePrinterDriverEx(struct pipes_struct *p)
3434 {
3435         const struct ndr_interface_call *call;
3436         struct ndr_pull *pull;
3437         struct ndr_push *push;
3438         enum ndr_err_code ndr_err;
3439         struct winspool_AsyncDeletePrinterDriverEx *r;
3440
3441         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVEREX];
3442
3443         r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterDriverEx);
3444         if (r == NULL) {
3445                 return false;
3446         }
3447
3448         pull = ndr_pull_init_blob(&p->in_data.data, r);
3449         if (pull == NULL) {
3450                 talloc_free(r);
3451                 return false;
3452         }
3453
3454         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3455         if (p->endian) {
3456                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3457         }
3458         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3459         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3460                 talloc_free(r);
3461                 return false;
3462         }
3463
3464         if (DEBUGLEVEL >= 10) {
3465                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriverEx, NDR_IN, r);
3466         }
3467
3468         r->out.result = _winspool_AsyncDeletePrinterDriverEx(p, r);
3469
3470         if (p->fault_state) {
3471                 talloc_free(r);
3472                 /* Return true here, srv_pipe_hnd.c will take care */
3473                 return true;
3474         }
3475
3476         if (DEBUGLEVEL >= 10) {
3477                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriverEx, NDR_OUT | NDR_SET_VALUES, r);
3478         }
3479
3480         push = ndr_push_init_ctx(r);
3481         if (push == NULL) {
3482                 talloc_free(r);
3483                 return false;
3484         }
3485
3486         /*
3487          * carry over the pointer count to the reply in case we are
3488          * using full pointer. See NDR specification for full pointers
3489          */
3490         push->ptr_count = pull->ptr_count;
3491
3492         ndr_err = call->ndr_push(push, NDR_OUT, r);
3493         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3494                 talloc_free(r);
3495                 return false;
3496         }
3497
3498         p->out_data.rdata = ndr_push_blob(push);
3499         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3500
3501         talloc_free(r);
3502
3503         return true;
3504 }
3505
3506 static bool api_winspool_AsyncAddPrintProcessor(struct pipes_struct *p)
3507 {
3508         const struct ndr_interface_call *call;
3509         struct ndr_pull *pull;
3510         struct ndr_push *push;
3511         enum ndr_err_code ndr_err;
3512         struct winspool_AsyncAddPrintProcessor *r;
3513
3514         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDPRINTPROCESSOR];
3515
3516         r = talloc(talloc_tos(), struct winspool_AsyncAddPrintProcessor);
3517         if (r == NULL) {
3518                 return false;
3519         }
3520
3521         pull = ndr_pull_init_blob(&p->in_data.data, r);
3522         if (pull == NULL) {
3523                 talloc_free(r);
3524                 return false;
3525         }
3526
3527         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3528         if (p->endian) {
3529                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3530         }
3531         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3532         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3533                 talloc_free(r);
3534                 return false;
3535         }
3536
3537         if (DEBUGLEVEL >= 10) {
3538                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrintProcessor, NDR_IN, r);
3539         }
3540
3541         r->out.result = _winspool_AsyncAddPrintProcessor(p, r);
3542
3543         if (p->fault_state) {
3544                 talloc_free(r);
3545                 /* Return true here, srv_pipe_hnd.c will take care */
3546                 return true;
3547         }
3548
3549         if (DEBUGLEVEL >= 10) {
3550                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrintProcessor, NDR_OUT | NDR_SET_VALUES, r);
3551         }
3552
3553         push = ndr_push_init_ctx(r);
3554         if (push == NULL) {
3555                 talloc_free(r);
3556                 return false;
3557         }
3558
3559         /*
3560          * carry over the pointer count to the reply in case we are
3561          * using full pointer. See NDR specification for full pointers
3562          */
3563         push->ptr_count = pull->ptr_count;
3564
3565         ndr_err = call->ndr_push(push, NDR_OUT, r);
3566         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3567                 talloc_free(r);
3568                 return false;
3569         }
3570
3571         p->out_data.rdata = ndr_push_blob(push);
3572         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3573
3574         talloc_free(r);
3575
3576         return true;
3577 }
3578
3579 static bool api_winspool_AsyncEnumPrintProcessors(struct pipes_struct *p)
3580 {
3581         const struct ndr_interface_call *call;
3582         struct ndr_pull *pull;
3583         struct ndr_push *push;
3584         enum ndr_err_code ndr_err;
3585         struct winspool_AsyncEnumPrintProcessors *r;
3586
3587         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORS];
3588
3589         r = talloc(talloc_tos(), struct winspool_AsyncEnumPrintProcessors);
3590         if (r == NULL) {
3591                 return false;
3592         }
3593
3594         pull = ndr_pull_init_blob(&p->in_data.data, r);
3595         if (pull == NULL) {
3596                 talloc_free(r);
3597                 return false;
3598         }
3599
3600         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3601         if (p->endian) {
3602                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3603         }
3604         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3605         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3606                 talloc_free(r);
3607                 return false;
3608         }
3609
3610         if (DEBUGLEVEL >= 10) {
3611                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrintProcessors, NDR_IN, r);
3612         }
3613
3614         ZERO_STRUCT(r->out);
3615         r->out.pPrintProcessorInfo = r->in.pPrintProcessorInfo;
3616         r->out.pcbNeeded = talloc_zero(r, uint32_t);
3617         if (r->out.pcbNeeded == NULL) {
3618                 talloc_free(r);
3619                 return false;
3620         }
3621
3622         r->out.pcReturned = talloc_zero(r, uint32_t);
3623         if (r->out.pcReturned == NULL) {
3624                 talloc_free(r);
3625                 return false;
3626         }
3627
3628         r->out.result = _winspool_AsyncEnumPrintProcessors(p, r);
3629
3630         if (p->fault_state) {
3631                 talloc_free(r);
3632                 /* Return true here, srv_pipe_hnd.c will take care */
3633                 return true;
3634         }
3635
3636         if (DEBUGLEVEL >= 10) {
3637                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrintProcessors, NDR_OUT | NDR_SET_VALUES, r);
3638         }
3639
3640         push = ndr_push_init_ctx(r);
3641         if (push == NULL) {
3642                 talloc_free(r);
3643                 return false;
3644         }
3645
3646         /*
3647          * carry over the pointer count to the reply in case we are
3648          * using full pointer. See NDR specification for full pointers
3649          */
3650         push->ptr_count = pull->ptr_count;
3651
3652         ndr_err = call->ndr_push(push, NDR_OUT, r);
3653         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3654                 talloc_free(r);
3655                 return false;
3656         }
3657
3658         p->out_data.rdata = ndr_push_blob(push);
3659         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3660
3661         talloc_free(r);
3662
3663         return true;
3664 }
3665
3666 static bool api_winspool_AsyncGetPrintProcessorDirectory(struct pipes_struct *p)
3667 {
3668         const struct ndr_interface_call *call;
3669         struct ndr_pull *pull;
3670         struct ndr_push *push;
3671         enum ndr_err_code ndr_err;
3672         struct winspool_AsyncGetPrintProcessorDirectory *r;
3673
3674         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTPROCESSORDIRECTORY];
3675
3676         r = talloc(talloc_tos(), struct winspool_AsyncGetPrintProcessorDirectory);
3677         if (r == NULL) {
3678                 return false;
3679         }
3680
3681         pull = ndr_pull_init_blob(&p->in_data.data, r);
3682         if (pull == NULL) {
3683                 talloc_free(r);
3684                 return false;
3685         }
3686
3687         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3688         if (p->endian) {
3689                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3690         }
3691         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3692         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3693                 talloc_free(r);
3694                 return false;
3695         }
3696
3697         if (DEBUGLEVEL >= 10) {
3698                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrintProcessorDirectory, NDR_IN, r);
3699         }
3700
3701         ZERO_STRUCT(r->out);
3702         r->out.pPrintProcessorDirectory = r->in.pPrintProcessorDirectory;
3703         r->out.pcbNeeded = talloc_zero(r, uint32_t);
3704         if (r->out.pcbNeeded == NULL) {
3705                 talloc_free(r);
3706                 return false;
3707         }
3708
3709         r->out.result = _winspool_AsyncGetPrintProcessorDirectory(p, r);
3710
3711         if (p->fault_state) {
3712                 talloc_free(r);
3713                 /* Return true here, srv_pipe_hnd.c will take care */
3714                 return true;
3715         }
3716
3717         if (DEBUGLEVEL >= 10) {
3718                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrintProcessorDirectory, NDR_OUT | NDR_SET_VALUES, r);
3719         }
3720
3721         push = ndr_push_init_ctx(r);
3722         if (push == NULL) {
3723                 talloc_free(r);
3724                 return false;
3725         }
3726
3727         /*
3728          * carry over the pointer count to the reply in case we are
3729          * using full pointer. See NDR specification for full pointers
3730          */
3731         push->ptr_count = pull->ptr_count;
3732
3733         ndr_err = call->ndr_push(push, NDR_OUT, r);
3734         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3735                 talloc_free(r);
3736                 return false;
3737         }
3738
3739         p->out_data.rdata = ndr_push_blob(push);
3740         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3741
3742         talloc_free(r);
3743
3744         return true;
3745 }
3746
3747 static bool api_winspool_AsyncEnumPorts(struct pipes_struct *p)
3748 {
3749         const struct ndr_interface_call *call;
3750         struct ndr_pull *pull;
3751         struct ndr_push *push;
3752         enum ndr_err_code ndr_err;
3753         struct winspool_AsyncEnumPorts *r;
3754
3755         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPORTS];
3756
3757         r = talloc(talloc_tos(), struct winspool_AsyncEnumPorts);
3758         if (r == NULL) {
3759                 return false;
3760         }
3761
3762         pull = ndr_pull_init_blob(&p->in_data.data, r);
3763         if (pull == NULL) {
3764                 talloc_free(r);
3765                 return false;
3766         }
3767
3768         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3769         if (p->endian) {
3770                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3771         }
3772         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3773         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3774                 talloc_free(r);
3775                 return false;
3776         }
3777
3778         if (DEBUGLEVEL >= 10) {
3779                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPorts, NDR_IN, r);
3780         }
3781
3782         ZERO_STRUCT(r->out);
3783         r->out.pPort = r->in.pPort;
3784         r->out.pcbNeeded = talloc_zero(r, uint32_t);
3785         if (r->out.pcbNeeded == NULL) {
3786                 talloc_free(r);
3787                 return false;
3788         }
3789
3790         r->out.pcReturned = talloc_zero(r, uint32_t);
3791         if (r->out.pcReturned == NULL) {
3792                 talloc_free(r);
3793                 return false;
3794         }
3795
3796         r->out.result = _winspool_AsyncEnumPorts(p, r);
3797
3798         if (p->fault_state) {
3799                 talloc_free(r);
3800                 /* Return true here, srv_pipe_hnd.c will take care */
3801                 return true;
3802         }
3803
3804         if (DEBUGLEVEL >= 10) {
3805                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPorts, NDR_OUT | NDR_SET_VALUES, r);
3806         }
3807
3808         push = ndr_push_init_ctx(r);
3809         if (push == NULL) {
3810                 talloc_free(r);
3811                 return false;
3812         }
3813
3814         /*
3815          * carry over the pointer count to the reply in case we are
3816          * using full pointer. See NDR specification for full pointers
3817          */
3818         push->ptr_count = pull->ptr_count;
3819
3820         ndr_err = call->ndr_push(push, NDR_OUT, r);
3821         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3822                 talloc_free(r);
3823                 return false;
3824         }
3825
3826         p->out_data.rdata = ndr_push_blob(push);
3827         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3828
3829         talloc_free(r);
3830
3831         return true;
3832 }
3833
3834 static bool api_winspool_AsyncEnumMonitors(struct pipes_struct *p)
3835 {
3836         const struct ndr_interface_call *call;
3837         struct ndr_pull *pull;
3838         struct ndr_push *push;
3839         enum ndr_err_code ndr_err;
3840         struct winspool_AsyncEnumMonitors *r;
3841
3842         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMMONITORS];
3843
3844         r = talloc(talloc_tos(), struct winspool_AsyncEnumMonitors);
3845         if (r == NULL) {
3846                 return false;
3847         }
3848
3849         pull = ndr_pull_init_blob(&p->in_data.data, r);
3850         if (pull == NULL) {
3851                 talloc_free(r);
3852                 return false;
3853         }
3854
3855         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3856         if (p->endian) {
3857                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3858         }
3859         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3860         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3861                 talloc_free(r);
3862                 return false;
3863         }
3864
3865         if (DEBUGLEVEL >= 10) {
3866                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumMonitors, NDR_IN, r);
3867         }
3868
3869         ZERO_STRUCT(r->out);
3870         r->out.pMonitor = r->in.pMonitor;
3871         r->out.pcbNeeded = talloc_zero(r, uint32_t);
3872         if (r->out.pcbNeeded == NULL) {
3873                 talloc_free(r);
3874                 return false;
3875         }
3876
3877         r->out.pcReturned = talloc_zero(r, uint32_t);
3878         if (r->out.pcReturned == NULL) {
3879                 talloc_free(r);
3880                 return false;
3881         }
3882
3883         r->out.result = _winspool_AsyncEnumMonitors(p, r);
3884
3885         if (p->fault_state) {
3886                 talloc_free(r);
3887                 /* Return true here, srv_pipe_hnd.c will take care */
3888                 return true;
3889         }
3890
3891         if (DEBUGLEVEL >= 10) {
3892                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumMonitors, NDR_OUT | NDR_SET_VALUES, r);
3893         }
3894
3895         push = ndr_push_init_ctx(r);
3896         if (push == NULL) {
3897                 talloc_free(r);
3898                 return false;
3899         }
3900
3901         /*
3902          * carry over the pointer count to the reply in case we are
3903          * using full pointer. See NDR specification for full pointers
3904          */
3905         push->ptr_count = pull->ptr_count;
3906
3907         ndr_err = call->ndr_push(push, NDR_OUT, r);
3908         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3909                 talloc_free(r);
3910                 return false;
3911         }
3912
3913         p->out_data.rdata = ndr_push_blob(push);
3914         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3915
3916         talloc_free(r);
3917
3918         return true;
3919 }
3920
3921 static bool api_winspool_AsyncAddPort(struct pipes_struct *p)
3922 {
3923         const struct ndr_interface_call *call;
3924         struct ndr_pull *pull;
3925         struct ndr_push *push;
3926         enum ndr_err_code ndr_err;
3927         struct winspool_AsyncAddPort *r;
3928
3929         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDPORT];
3930
3931         r = talloc(talloc_tos(), struct winspool_AsyncAddPort);
3932         if (r == NULL) {
3933                 return false;
3934         }
3935
3936         pull = ndr_pull_init_blob(&p->in_data.data, r);
3937         if (pull == NULL) {
3938                 talloc_free(r);
3939                 return false;
3940         }
3941
3942         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3943         if (p->endian) {
3944                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3945         }
3946         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3947         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3948                 talloc_free(r);
3949                 return false;
3950         }
3951
3952         if (DEBUGLEVEL >= 10) {
3953                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPort, NDR_IN, r);
3954         }
3955
3956         r->out.result = _winspool_AsyncAddPort(p, r);
3957
3958         if (p->fault_state) {
3959                 talloc_free(r);
3960                 /* Return true here, srv_pipe_hnd.c will take care */
3961                 return true;
3962         }
3963
3964         if (DEBUGLEVEL >= 10) {
3965                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPort, NDR_OUT | NDR_SET_VALUES, r);
3966         }
3967
3968         push = ndr_push_init_ctx(r);
3969         if (push == NULL) {
3970                 talloc_free(r);
3971                 return false;
3972         }
3973
3974         /*
3975          * carry over the pointer count to the reply in case we are
3976          * using full pointer. See NDR specification for full pointers
3977          */
3978         push->ptr_count = pull->ptr_count;
3979
3980         ndr_err = call->ndr_push(push, NDR_OUT, r);
3981         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3982                 talloc_free(r);
3983                 return false;
3984         }
3985
3986         p->out_data.rdata = ndr_push_blob(push);
3987         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3988
3989         talloc_free(r);
3990
3991         return true;
3992 }
3993
3994 static bool api_winspool_AsyncSetPort(struct pipes_struct *p)
3995 {
3996         const struct ndr_interface_call *call;
3997         struct ndr_pull *pull;
3998         struct ndr_push *push;
3999         enum ndr_err_code ndr_err;
4000         struct winspool_AsyncSetPort *r;
4001
4002         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETPORT];
4003
4004         r = talloc(talloc_tos(), struct winspool_AsyncSetPort);
4005         if (r == NULL) {
4006                 return false;
4007         }
4008
4009         pull = ndr_pull_init_blob(&p->in_data.data, r);
4010         if (pull == NULL) {
4011                 talloc_free(r);
4012                 return false;
4013         }
4014
4015         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4016         if (p->endian) {
4017                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4018         }
4019         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4020         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4021                 talloc_free(r);
4022                 return false;
4023         }
4024
4025         if (DEBUGLEVEL >= 10) {
4026                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPort, NDR_IN, r);
4027         }
4028
4029         r->out.result = _winspool_AsyncSetPort(p, r);
4030
4031         if (p->fault_state) {
4032                 talloc_free(r);
4033                 /* Return true here, srv_pipe_hnd.c will take care */
4034                 return true;
4035         }
4036
4037         if (DEBUGLEVEL >= 10) {
4038                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPort, NDR_OUT | NDR_SET_VALUES, r);
4039         }
4040
4041         push = ndr_push_init_ctx(r);
4042         if (push == NULL) {
4043                 talloc_free(r);
4044                 return false;
4045         }
4046
4047         /*
4048          * carry over the pointer count to the reply in case we are
4049          * using full pointer. See NDR specification for full pointers
4050          */
4051         push->ptr_count = pull->ptr_count;
4052
4053         ndr_err = call->ndr_push(push, NDR_OUT, r);
4054         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4055                 talloc_free(r);
4056                 return false;
4057         }
4058
4059         p->out_data.rdata = ndr_push_blob(push);
4060         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4061
4062         talloc_free(r);
4063
4064         return true;
4065 }
4066
4067 static bool api_winspool_AsyncAddMonitor(struct pipes_struct *p)
4068 {
4069         const struct ndr_interface_call *call;
4070         struct ndr_pull *pull;
4071         struct ndr_push *push;
4072         enum ndr_err_code ndr_err;
4073         struct winspool_AsyncAddMonitor *r;
4074
4075         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDMONITOR];
4076
4077         r = talloc(talloc_tos(), struct winspool_AsyncAddMonitor);
4078         if (r == NULL) {
4079                 return false;
4080         }
4081
4082         pull = ndr_pull_init_blob(&p->in_data.data, r);
4083         if (pull == NULL) {
4084                 talloc_free(r);
4085                 return false;
4086         }
4087
4088         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4089         if (p->endian) {
4090                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4091         }
4092         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4093         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4094                 talloc_free(r);
4095                 return false;
4096         }
4097
4098         if (DEBUGLEVEL >= 10) {
4099                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddMonitor, NDR_IN, r);
4100         }
4101
4102         r->out.result = _winspool_AsyncAddMonitor(p, r);
4103
4104         if (p->fault_state) {
4105                 talloc_free(r);
4106                 /* Return true here, srv_pipe_hnd.c will take care */
4107                 return true;
4108         }
4109
4110         if (DEBUGLEVEL >= 10) {
4111                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddMonitor, NDR_OUT | NDR_SET_VALUES, r);
4112         }
4113
4114         push = ndr_push_init_ctx(r);
4115         if (push == NULL) {
4116                 talloc_free(r);
4117                 return false;
4118         }
4119
4120         /*
4121          * carry over the pointer count to the reply in case we are
4122          * using full pointer. See NDR specification for full pointers
4123          */
4124         push->ptr_count = pull->ptr_count;
4125
4126         ndr_err = call->ndr_push(push, NDR_OUT, r);
4127         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4128                 talloc_free(r);
4129                 return false;
4130         }
4131
4132         p->out_data.rdata = ndr_push_blob(push);
4133         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4134
4135         talloc_free(r);
4136
4137         return true;
4138 }
4139
4140 static bool api_winspool_AsyncDeleteMonitor(struct pipes_struct *p)
4141 {
4142         const struct ndr_interface_call *call;
4143         struct ndr_pull *pull;
4144         struct ndr_push *push;
4145         enum ndr_err_code ndr_err;
4146         struct winspool_AsyncDeleteMonitor *r;
4147
4148         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEMONITOR];
4149
4150         r = talloc(talloc_tos(), struct winspool_AsyncDeleteMonitor);
4151         if (r == NULL) {
4152                 return false;
4153         }
4154
4155         pull = ndr_pull_init_blob(&p->in_data.data, r);
4156         if (pull == NULL) {
4157                 talloc_free(r);
4158                 return false;
4159         }
4160
4161         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4162         if (p->endian) {
4163                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4164         }
4165         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4166         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4167                 talloc_free(r);
4168                 return false;
4169         }
4170
4171         if (DEBUGLEVEL >= 10) {
4172                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteMonitor, NDR_IN, r);
4173         }
4174
4175         r->out.result = _winspool_AsyncDeleteMonitor(p, r);
4176
4177         if (p->fault_state) {
4178                 talloc_free(r);
4179                 /* Return true here, srv_pipe_hnd.c will take care */
4180                 return true;
4181         }
4182
4183         if (DEBUGLEVEL >= 10) {
4184                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteMonitor, NDR_OUT | NDR_SET_VALUES, r);
4185         }
4186
4187         push = ndr_push_init_ctx(r);
4188         if (push == NULL) {
4189                 talloc_free(r);
4190                 return false;
4191         }
4192
4193         /*
4194          * carry over the pointer count to the reply in case we are
4195          * using full pointer. See NDR specification for full pointers
4196          */
4197         push->ptr_count = pull->ptr_count;
4198
4199         ndr_err = call->ndr_push(push, NDR_OUT, r);
4200         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4201                 talloc_free(r);
4202                 return false;
4203         }
4204
4205         p->out_data.rdata = ndr_push_blob(push);
4206         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4207
4208         talloc_free(r);
4209
4210         return true;
4211 }
4212
4213 static bool api_winspool_AsyncDeletePrintProcessor(struct pipes_struct *p)
4214 {
4215         const struct ndr_interface_call *call;
4216         struct ndr_pull *pull;
4217         struct ndr_push *push;
4218         enum ndr_err_code ndr_err;
4219         struct winspool_AsyncDeletePrintProcessor *r;
4220
4221         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTPROCESSOR];
4222
4223         r = talloc(talloc_tos(), struct winspool_AsyncDeletePrintProcessor);
4224         if (r == NULL) {
4225                 return false;
4226         }
4227
4228         pull = ndr_pull_init_blob(&p->in_data.data, r);
4229         if (pull == NULL) {
4230                 talloc_free(r);
4231                 return false;
4232         }
4233
4234         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4235         if (p->endian) {
4236                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4237         }
4238         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4239         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4240                 talloc_free(r);
4241                 return false;
4242         }
4243
4244         if (DEBUGLEVEL >= 10) {
4245                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrintProcessor, NDR_IN, r);
4246         }
4247
4248         r->out.result = _winspool_AsyncDeletePrintProcessor(p, r);
4249
4250         if (p->fault_state) {
4251                 talloc_free(r);
4252                 /* Return true here, srv_pipe_hnd.c will take care */
4253                 return true;
4254         }
4255
4256         if (DEBUGLEVEL >= 10) {
4257                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrintProcessor, NDR_OUT | NDR_SET_VALUES, r);
4258         }
4259
4260         push = ndr_push_init_ctx(r);
4261         if (push == NULL) {
4262                 talloc_free(r);
4263                 return false;
4264         }
4265
4266         /*
4267          * carry over the pointer count to the reply in case we are
4268          * using full pointer. See NDR specification for full pointers
4269          */
4270         push->ptr_count = pull->ptr_count;
4271
4272         ndr_err = call->ndr_push(push, NDR_OUT, r);
4273         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4274                 talloc_free(r);
4275                 return false;
4276         }
4277
4278         p->out_data.rdata = ndr_push_blob(push);
4279         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4280
4281         talloc_free(r);
4282
4283         return true;
4284 }
4285
4286 static bool api_winspool_AsyncEnumPrintProcessorDatatypes(struct pipes_struct *p)
4287 {
4288         const struct ndr_interface_call *call;
4289         struct ndr_pull *pull;
4290         struct ndr_push *push;
4291         enum ndr_err_code ndr_err;
4292         struct winspool_AsyncEnumPrintProcessorDatatypes *r;
4293
4294         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORDATATYPES];
4295
4296         r = talloc(talloc_tos(), struct winspool_AsyncEnumPrintProcessorDatatypes);
4297         if (r == NULL) {
4298                 return false;
4299         }
4300
4301         pull = ndr_pull_init_blob(&p->in_data.data, r);
4302         if (pull == NULL) {
4303                 talloc_free(r);
4304                 return false;
4305         }
4306
4307         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4308         if (p->endian) {
4309                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4310         }
4311         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4312         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4313                 talloc_free(r);
4314                 return false;
4315         }
4316
4317         if (DEBUGLEVEL >= 10) {
4318                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrintProcessorDatatypes, NDR_IN, r);
4319         }
4320
4321         ZERO_STRUCT(r->out);
4322         r->out.pDatatypes = r->in.pDatatypes;
4323         r->out.pcbNeeded = talloc_zero(r, uint32_t);
4324         if (r->out.pcbNeeded == NULL) {
4325                 talloc_free(r);
4326                 return false;
4327         }
4328
4329         r->out.pcReturned = talloc_zero(r, uint32_t);
4330         if (r->out.pcReturned == NULL) {
4331                 talloc_free(r);
4332                 return false;
4333         }
4334
4335         r->out.result = _winspool_AsyncEnumPrintProcessorDatatypes(p, r);
4336
4337         if (p->fault_state) {
4338                 talloc_free(r);
4339                 /* Return true here, srv_pipe_hnd.c will take care */
4340                 return true;
4341         }
4342
4343         if (DEBUGLEVEL >= 10) {
4344                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrintProcessorDatatypes, NDR_OUT | NDR_SET_VALUES, r);
4345         }
4346
4347         push = ndr_push_init_ctx(r);
4348         if (push == NULL) {
4349                 talloc_free(r);
4350                 return false;
4351         }
4352
4353         /*
4354          * carry over the pointer count to the reply in case we are
4355          * using full pointer. See NDR specification for full pointers
4356          */
4357         push->ptr_count = pull->ptr_count;
4358
4359         ndr_err = call->ndr_push(push, NDR_OUT, r);
4360         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4361                 talloc_free(r);
4362                 return false;
4363         }
4364
4365         p->out_data.rdata = ndr_push_blob(push);
4366         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4367
4368         talloc_free(r);
4369
4370         return true;
4371 }
4372
4373 static bool api_winspool_AsyncAddPerMachineConnection(struct pipes_struct *p)
4374 {
4375         const struct ndr_interface_call *call;
4376         struct ndr_pull *pull;
4377         struct ndr_push *push;
4378         enum ndr_err_code ndr_err;
4379         struct winspool_AsyncAddPerMachineConnection *r;
4380
4381         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDPERMACHINECONNECTION];
4382
4383         r = talloc(talloc_tos(), struct winspool_AsyncAddPerMachineConnection);
4384         if (r == NULL) {
4385                 return false;
4386         }
4387
4388         pull = ndr_pull_init_blob(&p->in_data.data, r);
4389         if (pull == NULL) {
4390                 talloc_free(r);
4391                 return false;
4392         }
4393
4394         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4395         if (p->endian) {
4396                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4397         }
4398         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4399         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4400                 talloc_free(r);
4401                 return false;
4402         }
4403
4404         if (DEBUGLEVEL >= 10) {
4405                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPerMachineConnection, NDR_IN, r);
4406         }
4407
4408         r->out.result = _winspool_AsyncAddPerMachineConnection(p, r);
4409
4410         if (p->fault_state) {
4411                 talloc_free(r);
4412                 /* Return true here, srv_pipe_hnd.c will take care */
4413                 return true;
4414         }
4415
4416         if (DEBUGLEVEL >= 10) {
4417                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPerMachineConnection, NDR_OUT | NDR_SET_VALUES, r);
4418         }
4419
4420         push = ndr_push_init_ctx(r);
4421         if (push == NULL) {
4422                 talloc_free(r);
4423                 return false;
4424         }
4425
4426         /*
4427          * carry over the pointer count to the reply in case we are
4428          * using full pointer. See NDR specification for full pointers
4429          */
4430         push->ptr_count = pull->ptr_count;
4431
4432         ndr_err = call->ndr_push(push, NDR_OUT, r);
4433         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4434                 talloc_free(r);
4435                 return false;
4436         }
4437
4438         p->out_data.rdata = ndr_push_blob(push);
4439         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4440
4441         talloc_free(r);
4442
4443         return true;
4444 }
4445
4446 static bool api_winspool_AsyncDeletePerMachineConnection(struct pipes_struct *p)
4447 {
4448         const struct ndr_interface_call *call;
4449         struct ndr_pull *pull;
4450         struct ndr_push *push;
4451         enum ndr_err_code ndr_err;
4452         struct winspool_AsyncDeletePerMachineConnection *r;
4453
4454         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPERMACHINECONNECTION];
4455
4456         r = talloc(talloc_tos(), struct winspool_AsyncDeletePerMachineConnection);
4457         if (r == NULL) {
4458                 return false;
4459         }
4460
4461         pull = ndr_pull_init_blob(&p->in_data.data, r);
4462         if (pull == NULL) {
4463                 talloc_free(r);
4464                 return false;
4465         }
4466
4467         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4468         if (p->endian) {
4469                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4470         }
4471         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4472         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4473                 talloc_free(r);
4474                 return false;
4475         }
4476
4477         if (DEBUGLEVEL >= 10) {
4478                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePerMachineConnection, NDR_IN, r);
4479         }
4480
4481         r->out.result = _winspool_AsyncDeletePerMachineConnection(p, r);
4482
4483         if (p->fault_state) {
4484                 talloc_free(r);
4485                 /* Return true here, srv_pipe_hnd.c will take care */
4486                 return true;
4487         }
4488
4489         if (DEBUGLEVEL >= 10) {
4490                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePerMachineConnection, NDR_OUT | NDR_SET_VALUES, r);
4491         }
4492
4493         push = ndr_push_init_ctx(r);
4494         if (push == NULL) {
4495                 talloc_free(r);
4496                 return false;
4497         }
4498
4499         /*
4500          * carry over the pointer count to the reply in case we are
4501          * using full pointer. See NDR specification for full pointers
4502          */
4503         push->ptr_count = pull->ptr_count;
4504
4505         ndr_err = call->ndr_push(push, NDR_OUT, r);
4506         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4507                 talloc_free(r);
4508                 return false;
4509         }
4510
4511         p->out_data.rdata = ndr_push_blob(push);
4512         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4513
4514         talloc_free(r);
4515
4516         return true;
4517 }
4518
4519 static bool api_winspool_AsyncEnumPerMachineConnections(struct pipes_struct *p)
4520 {
4521         const struct ndr_interface_call *call;
4522         struct ndr_pull *pull;
4523         struct ndr_push *push;
4524         enum ndr_err_code ndr_err;
4525         struct winspool_AsyncEnumPerMachineConnections *r;
4526
4527         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPERMACHINECONNECTIONS];
4528
4529         r = talloc(talloc_tos(), struct winspool_AsyncEnumPerMachineConnections);
4530         if (r == NULL) {
4531                 return false;
4532         }
4533
4534         pull = ndr_pull_init_blob(&p->in_data.data, r);
4535         if (pull == NULL) {
4536                 talloc_free(r);
4537                 return false;
4538         }
4539
4540         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4541         if (p->endian) {
4542                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4543         }
4544         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4545         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4546                 talloc_free(r);
4547                 return false;
4548         }
4549
4550         if (DEBUGLEVEL >= 10) {
4551                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPerMachineConnections, NDR_IN, r);
4552         }
4553
4554         ZERO_STRUCT(r->out);
4555         r->out.pPrinterEnum = r->in.pPrinterEnum;
4556         r->out.pcbNeeded = talloc_zero(r, uint32_t);
4557         if (r->out.pcbNeeded == NULL) {
4558                 talloc_free(r);
4559                 return false;
4560         }
4561
4562         r->out.pcReturned = talloc_zero(r, uint32_t);
4563         if (r->out.pcReturned == NULL) {
4564                 talloc_free(r);
4565                 return false;
4566         }
4567
4568         r->out.result = _winspool_AsyncEnumPerMachineConnections(p, r);
4569
4570         if (p->fault_state) {
4571                 talloc_free(r);
4572                 /* Return true here, srv_pipe_hnd.c will take care */
4573                 return true;
4574         }
4575
4576         if (DEBUGLEVEL >= 10) {
4577                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPerMachineConnections, NDR_OUT | NDR_SET_VALUES, r);
4578         }
4579
4580         push = ndr_push_init_ctx(r);
4581         if (push == NULL) {
4582                 talloc_free(r);
4583                 return false;
4584         }
4585
4586         /*
4587          * carry over the pointer count to the reply in case we are
4588          * using full pointer. See NDR specification for full pointers
4589          */
4590         push->ptr_count = pull->ptr_count;
4591
4592         ndr_err = call->ndr_push(push, NDR_OUT, r);
4593         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4594                 talloc_free(r);
4595                 return false;
4596         }
4597
4598         p->out_data.rdata = ndr_push_blob(push);
4599         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4600
4601         talloc_free(r);
4602
4603         return true;
4604 }
4605
4606 static bool api_winspool_SyncRegisterForRemoteNotifications(struct pipes_struct *p)
4607 {
4608         const struct ndr_interface_call *call;
4609         struct ndr_pull *pull;
4610         struct ndr_push *push;
4611         enum ndr_err_code ndr_err;
4612         struct winspool_SyncRegisterForRemoteNotifications *r;
4613
4614         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS];
4615
4616         r = talloc(talloc_tos(), struct winspool_SyncRegisterForRemoteNotifications);
4617         if (r == NULL) {
4618                 return false;
4619         }
4620
4621         pull = ndr_pull_init_blob(&p->in_data.data, r);
4622         if (pull == NULL) {
4623                 talloc_free(r);
4624                 return false;
4625         }
4626
4627         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4628         if (p->endian) {
4629                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4630         }
4631         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4632         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4633                 talloc_free(r);
4634                 return false;
4635         }
4636
4637         if (DEBUGLEVEL >= 10) {
4638                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRegisterForRemoteNotifications, NDR_IN, r);
4639         }
4640
4641         ZERO_STRUCT(r->out);
4642         r->out.phRpcHandle = talloc_zero(r, struct policy_handle);
4643         if (r->out.phRpcHandle == NULL) {
4644                 talloc_free(r);
4645                 return false;
4646         }
4647
4648         r->out.result = _winspool_SyncRegisterForRemoteNotifications(p, r);
4649
4650         if (p->fault_state) {
4651                 talloc_free(r);
4652                 /* Return true here, srv_pipe_hnd.c will take care */
4653                 return true;
4654         }
4655
4656         if (DEBUGLEVEL >= 10) {
4657                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRegisterForRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
4658         }
4659
4660         push = ndr_push_init_ctx(r);
4661         if (push == NULL) {
4662                 talloc_free(r);
4663                 return false;
4664         }
4665
4666         /*
4667          * carry over the pointer count to the reply in case we are
4668          * using full pointer. See NDR specification for full pointers
4669          */
4670         push->ptr_count = pull->ptr_count;
4671
4672         ndr_err = call->ndr_push(push, NDR_OUT, r);
4673         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4674                 talloc_free(r);
4675                 return false;
4676         }
4677
4678         p->out_data.rdata = ndr_push_blob(push);
4679         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4680
4681         talloc_free(r);
4682
4683         return true;
4684 }
4685
4686 static bool api_winspool_SyncUnRegisterForRemoteNotifications(struct pipes_struct *p)
4687 {
4688         const struct ndr_interface_call *call;
4689         struct ndr_pull *pull;
4690         struct ndr_push *push;
4691         enum ndr_err_code ndr_err;
4692         struct winspool_SyncUnRegisterForRemoteNotifications *r;
4693
4694         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS];
4695
4696         r = talloc(talloc_tos(), struct winspool_SyncUnRegisterForRemoteNotifications);
4697         if (r == NULL) {
4698                 return false;
4699         }
4700
4701         pull = ndr_pull_init_blob(&p->in_data.data, r);
4702         if (pull == NULL) {
4703                 talloc_free(r);
4704                 return false;
4705         }
4706
4707         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4708         if (p->endian) {
4709                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4710         }
4711         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4712         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4713                 talloc_free(r);
4714                 return false;
4715         }
4716
4717         if (DEBUGLEVEL >= 10) {
4718                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncUnRegisterForRemoteNotifications, NDR_IN, r);
4719         }
4720
4721         ZERO_STRUCT(r->out);
4722         r->out.phRpcHandle = r->in.phRpcHandle;
4723         r->out.result = _winspool_SyncUnRegisterForRemoteNotifications(p, r);
4724
4725         if (p->fault_state) {
4726                 talloc_free(r);
4727                 /* Return true here, srv_pipe_hnd.c will take care */
4728                 return true;
4729         }
4730
4731         if (DEBUGLEVEL >= 10) {
4732                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncUnRegisterForRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
4733         }
4734
4735         push = ndr_push_init_ctx(r);
4736         if (push == NULL) {
4737                 talloc_free(r);
4738                 return false;
4739         }
4740
4741         /*
4742          * carry over the pointer count to the reply in case we are
4743          * using full pointer. See NDR specification for full pointers
4744          */
4745         push->ptr_count = pull->ptr_count;
4746
4747         ndr_err = call->ndr_push(push, NDR_OUT, r);
4748         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4749                 talloc_free(r);
4750                 return false;
4751         }
4752
4753         p->out_data.rdata = ndr_push_blob(push);
4754         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4755
4756         talloc_free(r);
4757
4758         return true;
4759 }
4760
4761 static bool api_winspool_SyncRefreshRemoteNotifications(struct pipes_struct *p)
4762 {
4763         const struct ndr_interface_call *call;
4764         struct ndr_pull *pull;
4765         struct ndr_push *push;
4766         enum ndr_err_code ndr_err;
4767         struct winspool_SyncRefreshRemoteNotifications *r;
4768
4769         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS];
4770
4771         r = talloc(talloc_tos(), struct winspool_SyncRefreshRemoteNotifications);
4772         if (r == NULL) {
4773                 return false;
4774         }
4775
4776         pull = ndr_pull_init_blob(&p->in_data.data, r);
4777         if (pull == NULL) {
4778                 talloc_free(r);
4779                 return false;
4780         }
4781
4782         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4783         if (p->endian) {
4784                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4785         }
4786         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4787         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4788                 talloc_free(r);
4789                 return false;
4790         }
4791
4792         if (DEBUGLEVEL >= 10) {
4793                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRefreshRemoteNotifications, NDR_IN, r);
4794         }
4795
4796         ZERO_STRUCT(r->out);
4797         r->out.ppNotifyData = talloc_zero(r, struct winspool_PrintPropertiesCollection *);
4798         if (r->out.ppNotifyData == NULL) {
4799                 talloc_free(r);
4800                 return false;
4801         }
4802
4803         r->out.result = _winspool_SyncRefreshRemoteNotifications(p, r);
4804
4805         if (p->fault_state) {
4806                 talloc_free(r);
4807                 /* Return true here, srv_pipe_hnd.c will take care */
4808                 return true;
4809         }
4810
4811         if (DEBUGLEVEL >= 10) {
4812                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRefreshRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
4813         }
4814
4815         push = ndr_push_init_ctx(r);
4816         if (push == NULL) {
4817                 talloc_free(r);
4818                 return false;
4819         }
4820
4821         /*
4822          * carry over the pointer count to the reply in case we are
4823          * using full pointer. See NDR specification for full pointers
4824          */
4825         push->ptr_count = pull->ptr_count;
4826
4827         ndr_err = call->ndr_push(push, NDR_OUT, r);
4828         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4829                 talloc_free(r);
4830                 return false;
4831         }
4832
4833         p->out_data.rdata = ndr_push_blob(push);
4834         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4835
4836         talloc_free(r);
4837
4838         return true;
4839 }
4840
4841 static bool api_winspool_AsyncGetRemoteNotifications(struct pipes_struct *p)
4842 {
4843         const struct ndr_interface_call *call;
4844         struct ndr_pull *pull;
4845         struct ndr_push *push;
4846         enum ndr_err_code ndr_err;
4847         struct winspool_AsyncGetRemoteNotifications *r;
4848
4849         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETREMOTENOTIFICATIONS];
4850
4851         r = talloc(talloc_tos(), struct winspool_AsyncGetRemoteNotifications);
4852         if (r == NULL) {
4853                 return false;
4854         }
4855
4856         pull = ndr_pull_init_blob(&p->in_data.data, r);
4857         if (pull == NULL) {
4858                 talloc_free(r);
4859                 return false;
4860         }
4861
4862         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4863         if (p->endian) {
4864                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4865         }
4866         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4867         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4868                 talloc_free(r);
4869                 return false;
4870         }
4871
4872         if (DEBUGLEVEL >= 10) {
4873                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetRemoteNotifications, NDR_IN, r);
4874         }
4875
4876         ZERO_STRUCT(r->out);
4877         r->out.ppNotifyData = talloc_zero(r, struct winspool_PrintPropertiesCollection *);
4878         if (r->out.ppNotifyData == NULL) {
4879                 talloc_free(r);
4880                 return false;
4881         }
4882
4883         r->out.result = _winspool_AsyncGetRemoteNotifications(p, r);
4884
4885         if (p->fault_state) {
4886                 talloc_free(r);
4887                 /* Return true here, srv_pipe_hnd.c will take care */
4888                 return true;
4889         }
4890
4891         if (DEBUGLEVEL >= 10) {
4892                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
4893         }
4894
4895         push = ndr_push_init_ctx(r);
4896         if (push == NULL) {
4897                 talloc_free(r);
4898                 return false;
4899         }
4900
4901         /*
4902          * carry over the pointer count to the reply in case we are
4903          * using full pointer. See NDR specification for full pointers
4904          */
4905         push->ptr_count = pull->ptr_count;
4906
4907         ndr_err = call->ndr_push(push, NDR_OUT, r);
4908         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4909                 talloc_free(r);
4910                 return false;
4911         }
4912
4913         p->out_data.rdata = ndr_push_blob(push);
4914         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4915
4916         talloc_free(r);
4917
4918         return true;
4919 }
4920
4921 static bool api_winspool_AsyncInstallPrinterDriverFromPackage(struct pipes_struct *p)
4922 {
4923         const struct ndr_interface_call *call;
4924         struct ndr_pull *pull;
4925         struct ndr_push *push;
4926         enum ndr_err_code ndr_err;
4927         struct winspool_AsyncInstallPrinterDriverFromPackage *r;
4928
4929         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE];
4930
4931         r = talloc(talloc_tos(), struct winspool_AsyncInstallPrinterDriverFromPackage);
4932         if (r == NULL) {
4933                 return false;
4934         }
4935
4936         pull = ndr_pull_init_blob(&p->in_data.data, r);
4937         if (pull == NULL) {
4938                 talloc_free(r);
4939                 return false;
4940         }
4941
4942         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4943         if (p->endian) {
4944                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4945         }
4946         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4947         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4948                 talloc_free(r);
4949                 return false;
4950         }
4951
4952         if (DEBUGLEVEL >= 10) {
4953                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncInstallPrinterDriverFromPackage, NDR_IN, r);
4954         }
4955
4956         r->out.result = _winspool_AsyncInstallPrinterDriverFromPackage(p, r);
4957
4958         if (p->fault_state) {
4959                 talloc_free(r);
4960                 /* Return true here, srv_pipe_hnd.c will take care */
4961                 return true;
4962         }
4963
4964         if (DEBUGLEVEL >= 10) {
4965                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncInstallPrinterDriverFromPackage, NDR_OUT | NDR_SET_VALUES, r);
4966         }
4967
4968         push = ndr_push_init_ctx(r);
4969         if (push == NULL) {
4970                 talloc_free(r);
4971                 return false;
4972         }
4973
4974         /*
4975          * carry over the pointer count to the reply in case we are
4976          * using full pointer. See NDR specification for full pointers
4977          */
4978         push->ptr_count = pull->ptr_count;
4979
4980         ndr_err = call->ndr_push(push, NDR_OUT, r);
4981         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4982                 talloc_free(r);
4983                 return false;
4984         }
4985
4986         p->out_data.rdata = ndr_push_blob(push);
4987         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4988
4989         talloc_free(r);
4990
4991         return true;
4992 }
4993
4994 static bool api_winspool_AsyncUploadPrinterDriverPackage(struct pipes_struct *p)
4995 {
4996         const struct ndr_interface_call *call;
4997         struct ndr_pull *pull;
4998         struct ndr_push *push;
4999         enum ndr_err_code ndr_err;
5000         struct winspool_AsyncUploadPrinterDriverPackage *r;
5001
5002         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE];
5003
5004         r = talloc(talloc_tos(), struct winspool_AsyncUploadPrinterDriverPackage);
5005         if (r == NULL) {
5006                 return false;
5007         }
5008
5009         pull = ndr_pull_init_blob(&p->in_data.data, r);
5010         if (pull == NULL) {
5011                 talloc_free(r);
5012                 return false;
5013         }
5014
5015         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5016         if (p->endian) {
5017                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5018         }
5019         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5020         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5021                 talloc_free(r);
5022                 return false;
5023         }
5024
5025         if (DEBUGLEVEL >= 10) {
5026                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncUploadPrinterDriverPackage, NDR_IN, r);
5027         }
5028
5029         ZERO_STRUCT(r->out);
5030         r->out.pszDestInfPath = r->in.pszDestInfPath;
5031         r->out.pcchDestInfPath = r->in.pcchDestInfPath;
5032         r->out.result = _winspool_AsyncUploadPrinterDriverPackage(p, r);
5033
5034         if (p->fault_state) {
5035                 talloc_free(r);
5036                 /* Return true here, srv_pipe_hnd.c will take care */
5037                 return true;
5038         }
5039
5040         if (DEBUGLEVEL >= 10) {
5041                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncUploadPrinterDriverPackage, NDR_OUT | NDR_SET_VALUES, r);
5042         }
5043
5044         push = ndr_push_init_ctx(r);
5045         if (push == NULL) {
5046                 talloc_free(r);
5047                 return false;
5048         }
5049
5050         /*
5051          * carry over the pointer count to the reply in case we are
5052          * using full pointer. See NDR specification for full pointers
5053          */
5054         push->ptr_count = pull->ptr_count;
5055
5056         ndr_err = call->ndr_push(push, NDR_OUT, r);
5057         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5058                 talloc_free(r);
5059                 return false;
5060         }
5061
5062         p->out_data.rdata = ndr_push_blob(push);
5063         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5064
5065         talloc_free(r);
5066
5067         return true;
5068 }
5069
5070 static bool api_winspool_AsyncGetCorePrinterDrivers(struct pipes_struct *p)
5071 {
5072         const struct ndr_interface_call *call;
5073         struct ndr_pull *pull;
5074         struct ndr_push *push;
5075         enum ndr_err_code ndr_err;
5076         struct winspool_AsyncGetCorePrinterDrivers *r;
5077
5078         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETCOREPRINTERDRIVERS];
5079
5080         r = talloc(talloc_tos(), struct winspool_AsyncGetCorePrinterDrivers);
5081         if (r == NULL) {
5082                 return false;
5083         }
5084
5085         pull = ndr_pull_init_blob(&p->in_data.data, r);
5086         if (pull == NULL) {
5087                 talloc_free(r);
5088                 return false;
5089         }
5090
5091         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5092         if (p->endian) {
5093                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5094         }
5095         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5096         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5097                 talloc_free(r);
5098                 return false;
5099         }
5100
5101         if (DEBUGLEVEL >= 10) {
5102                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetCorePrinterDrivers, NDR_IN, r);
5103         }
5104
5105         ZERO_STRUCT(r->out);
5106         r->out.pCorePrinterDrivers = talloc_zero_array(r, struct spoolss_CorePrinterDriver, r->in.cCorePrinterDrivers);
5107         if (r->out.pCorePrinterDrivers == NULL) {
5108                 talloc_free(r);
5109                 return false;
5110         }
5111
5112         r->out.result = _winspool_AsyncGetCorePrinterDrivers(p, r);
5113
5114         if (p->fault_state) {
5115                 talloc_free(r);
5116                 /* Return true here, srv_pipe_hnd.c will take care */
5117                 return true;
5118         }
5119
5120         if (DEBUGLEVEL >= 10) {
5121                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetCorePrinterDrivers, NDR_OUT | NDR_SET_VALUES, r);
5122         }
5123
5124         push = ndr_push_init_ctx(r);
5125         if (push == NULL) {
5126                 talloc_free(r);
5127                 return false;
5128         }
5129
5130         /*
5131          * carry over the pointer count to the reply in case we are
5132          * using full pointer. See NDR specification for full pointers
5133          */
5134         push->ptr_count = pull->ptr_count;
5135
5136         ndr_err = call->ndr_push(push, NDR_OUT, r);
5137         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5138                 talloc_free(r);
5139                 return false;
5140         }
5141
5142         p->out_data.rdata = ndr_push_blob(push);
5143         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5144
5145         talloc_free(r);
5146
5147         return true;
5148 }
5149
5150 static bool api_winspool_AsyncCorePrinterDriverInstalled(struct pipes_struct *p)
5151 {
5152         const struct ndr_interface_call *call;
5153         struct ndr_pull *pull;
5154         struct ndr_push *push;
5155         enum ndr_err_code ndr_err;
5156         struct winspool_AsyncCorePrinterDriverInstalled *r;
5157
5158         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED];
5159
5160         r = talloc(talloc_tos(), struct winspool_AsyncCorePrinterDriverInstalled);
5161         if (r == NULL) {
5162                 return false;
5163         }
5164
5165         pull = ndr_pull_init_blob(&p->in_data.data, r);
5166         if (pull == NULL) {
5167                 talloc_free(r);
5168                 return false;
5169         }
5170
5171         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5172         if (p->endian) {
5173                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5174         }
5175         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5176         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5177                 talloc_free(r);
5178                 return false;
5179         }
5180
5181         if (DEBUGLEVEL >= 10) {
5182                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncCorePrinterDriverInstalled, NDR_IN, r);
5183         }
5184
5185         ZERO_STRUCT(r->out);
5186         r->out.pbDriverInstalled = talloc_zero(r, int32_t);
5187         if (r->out.pbDriverInstalled == NULL) {
5188                 talloc_free(r);
5189                 return false;
5190         }
5191
5192         r->out.result = _winspool_AsyncCorePrinterDriverInstalled(p, r);
5193
5194         if (p->fault_state) {
5195                 talloc_free(r);
5196                 /* Return true here, srv_pipe_hnd.c will take care */
5197                 return true;
5198         }
5199
5200         if (DEBUGLEVEL >= 10) {
5201                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncCorePrinterDriverInstalled, NDR_OUT | NDR_SET_VALUES, r);
5202         }
5203
5204         push = ndr_push_init_ctx(r);
5205         if (push == NULL) {
5206                 talloc_free(r);
5207                 return false;
5208         }
5209
5210         /*
5211          * carry over the pointer count to the reply in case we are
5212          * using full pointer. See NDR specification for full pointers
5213          */
5214         push->ptr_count = pull->ptr_count;
5215
5216         ndr_err = call->ndr_push(push, NDR_OUT, r);
5217         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5218                 talloc_free(r);
5219                 return false;
5220         }
5221
5222         p->out_data.rdata = ndr_push_blob(push);
5223         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5224
5225         talloc_free(r);
5226
5227         return true;
5228 }
5229
5230 static bool api_winspool_AsyncGetPrinterDriverPackagePath(struct pipes_struct *p)
5231 {
5232         const struct ndr_interface_call *call;
5233         struct ndr_pull *pull;
5234         struct ndr_push *push;
5235         enum ndr_err_code ndr_err;
5236         struct winspool_AsyncGetPrinterDriverPackagePath *r;
5237
5238         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTERDRIVERPACKAGEPATH];
5239
5240         r = talloc(talloc_tos(), struct winspool_AsyncGetPrinterDriverPackagePath);
5241         if (r == NULL) {
5242                 return false;
5243         }
5244
5245         pull = ndr_pull_init_blob(&p->in_data.data, r);
5246         if (pull == NULL) {
5247                 talloc_free(r);
5248                 return false;
5249         }
5250
5251         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5252         if (p->endian) {
5253                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5254         }
5255         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5256         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5257                 talloc_free(r);
5258                 return false;
5259         }
5260
5261         if (DEBUGLEVEL >= 10) {
5262                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriverPackagePath, NDR_IN, r);
5263         }
5264
5265         ZERO_STRUCT(r->out);
5266         r->out.pszDriverPackageCab = r->in.pszDriverPackageCab;
5267         r->out.pcchRequiredSize = talloc_zero(r, uint32_t);
5268         if (r->out.pcchRequiredSize == NULL) {
5269                 talloc_free(r);
5270                 return false;
5271         }
5272
5273         r->out.result = _winspool_AsyncGetPrinterDriverPackagePath(p, r);
5274
5275         if (p->fault_state) {
5276                 talloc_free(r);
5277                 /* Return true here, srv_pipe_hnd.c will take care */
5278                 return true;
5279         }
5280
5281         if (DEBUGLEVEL >= 10) {
5282                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriverPackagePath, NDR_OUT | NDR_SET_VALUES, r);
5283         }
5284
5285         push = ndr_push_init_ctx(r);
5286         if (push == NULL) {
5287                 talloc_free(r);
5288                 return false;
5289         }
5290
5291         /*
5292          * carry over the pointer count to the reply in case we are
5293          * using full pointer. See NDR specification for full pointers
5294          */
5295         push->ptr_count = pull->ptr_count;
5296
5297         ndr_err = call->ndr_push(push, NDR_OUT, r);
5298         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5299                 talloc_free(r);
5300                 return false;
5301         }
5302
5303         p->out_data.rdata = ndr_push_blob(push);
5304         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5305
5306         talloc_free(r);
5307
5308         return true;
5309 }
5310
5311 static bool api_winspool_AsyncDeletePrinterDriverPackage(struct pipes_struct *p)
5312 {
5313         const struct ndr_interface_call *call;
5314         struct ndr_pull *pull;
5315         struct ndr_push *push;
5316         enum ndr_err_code ndr_err;
5317         struct winspool_AsyncDeletePrinterDriverPackage *r;
5318
5319         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE];
5320
5321         r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterDriverPackage);
5322         if (r == NULL) {
5323                 return false;
5324         }
5325
5326         pull = ndr_pull_init_blob(&p->in_data.data, r);
5327         if (pull == NULL) {
5328                 talloc_free(r);
5329                 return false;
5330         }
5331
5332         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5333         if (p->endian) {
5334                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5335         }
5336         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5337         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5338                 talloc_free(r);
5339                 return false;
5340         }
5341
5342         if (DEBUGLEVEL >= 10) {
5343                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriverPackage, NDR_IN, r);
5344         }
5345
5346         r->out.result = _winspool_AsyncDeletePrinterDriverPackage(p, r);
5347
5348         if (p->fault_state) {
5349                 talloc_free(r);
5350                 /* Return true here, srv_pipe_hnd.c will take care */
5351                 return true;
5352         }
5353
5354         if (DEBUGLEVEL >= 10) {
5355                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriverPackage, NDR_OUT | NDR_SET_VALUES, r);
5356         }
5357
5358         push = ndr_push_init_ctx(r);
5359         if (push == NULL) {
5360                 talloc_free(r);
5361                 return false;
5362         }
5363
5364         /*
5365          * carry over the pointer count to the reply in case we are
5366          * using full pointer. See NDR specification for full pointers
5367          */
5368         push->ptr_count = pull->ptr_count;
5369
5370         ndr_err = call->ndr_push(push, NDR_OUT, r);
5371         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5372                 talloc_free(r);
5373                 return false;
5374         }
5375
5376         p->out_data.rdata = ndr_push_blob(push);
5377         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5378
5379         talloc_free(r);
5380
5381         return true;
5382 }
5383
5384 static bool api_winspool_AsyncReadPrinter(struct pipes_struct *p)
5385 {
5386         const struct ndr_interface_call *call;
5387         struct ndr_pull *pull;
5388         struct ndr_push *push;
5389         enum ndr_err_code ndr_err;
5390         struct winspool_AsyncReadPrinter *r;
5391
5392         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCREADPRINTER];
5393
5394         r = talloc(talloc_tos(), struct winspool_AsyncReadPrinter);
5395         if (r == NULL) {
5396                 return false;
5397         }
5398
5399         pull = ndr_pull_init_blob(&p->in_data.data, r);
5400         if (pull == NULL) {
5401                 talloc_free(r);
5402                 return false;
5403         }
5404
5405         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5406         if (p->endian) {
5407                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5408         }
5409         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5410         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5411                 talloc_free(r);
5412                 return false;
5413         }
5414
5415         if (DEBUGLEVEL >= 10) {
5416                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncReadPrinter, NDR_IN, r);
5417         }
5418
5419         ZERO_STRUCT(r->out);
5420         r->out.pBuf = talloc_zero_array(r, uint8_t, r->in.cbBuf);
5421         if (r->out.pBuf == NULL) {
5422                 talloc_free(r);
5423                 return false;
5424         }
5425
5426         r->out.pcNoBytesRead = talloc_zero(r, uint32_t);
5427         if (r->out.pcNoBytesRead == NULL) {
5428                 talloc_free(r);
5429                 return false;
5430         }
5431
5432         r->out.result = _winspool_AsyncReadPrinter(p, r);
5433
5434         if (p->fault_state) {
5435                 talloc_free(r);
5436                 /* Return true here, srv_pipe_hnd.c will take care */
5437                 return true;
5438         }
5439
5440         if (DEBUGLEVEL >= 10) {
5441                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncReadPrinter, NDR_OUT | NDR_SET_VALUES, r);
5442         }
5443
5444         push = ndr_push_init_ctx(r);
5445         if (push == NULL) {
5446                 talloc_free(r);
5447                 return false;
5448         }
5449
5450         /*
5451          * carry over the pointer count to the reply in case we are
5452          * using full pointer. See NDR specification for full pointers
5453          */
5454         push->ptr_count = pull->ptr_count;
5455
5456         ndr_err = call->ndr_push(push, NDR_OUT, r);
5457         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5458                 talloc_free(r);
5459                 return false;
5460         }
5461
5462         p->out_data.rdata = ndr_push_blob(push);
5463         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5464
5465         talloc_free(r);
5466
5467         return true;
5468 }
5469
5470 static bool api_winspool_AsyncResetPrinter(struct pipes_struct *p)
5471 {
5472         const struct ndr_interface_call *call;
5473         struct ndr_pull *pull;
5474         struct ndr_push *push;
5475         enum ndr_err_code ndr_err;
5476         struct winspool_AsyncResetPrinter *r;
5477
5478         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCRESETPRINTER];
5479
5480         r = talloc(talloc_tos(), struct winspool_AsyncResetPrinter);
5481         if (r == NULL) {
5482                 return false;
5483         }
5484
5485         pull = ndr_pull_init_blob(&p->in_data.data, r);
5486         if (pull == NULL) {
5487                 talloc_free(r);
5488                 return false;
5489         }
5490
5491         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5492         if (p->endian) {
5493                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5494         }
5495         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5496         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5497                 talloc_free(r);
5498                 return false;
5499         }
5500
5501         if (DEBUGLEVEL >= 10) {
5502                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncResetPrinter, NDR_IN, r);
5503         }
5504
5505         r->out.result = _winspool_AsyncResetPrinter(p, r);
5506
5507         if (p->fault_state) {
5508                 talloc_free(r);
5509                 /* Return true here, srv_pipe_hnd.c will take care */
5510                 return true;
5511         }
5512
5513         if (DEBUGLEVEL >= 10) {
5514                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncResetPrinter, NDR_OUT | NDR_SET_VALUES, r);
5515         }
5516
5517         push = ndr_push_init_ctx(r);
5518         if (push == NULL) {
5519                 talloc_free(r);
5520                 return false;
5521         }
5522
5523         /*
5524          * carry over the pointer count to the reply in case we are
5525          * using full pointer. See NDR specification for full pointers
5526          */
5527         push->ptr_count = pull->ptr_count;
5528
5529         ndr_err = call->ndr_push(push, NDR_OUT, r);
5530         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5531                 talloc_free(r);
5532                 return false;
5533         }
5534
5535         p->out_data.rdata = ndr_push_blob(push);
5536         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5537
5538         talloc_free(r);
5539
5540         return true;
5541 }
5542
5543 static bool api_winspool_AsyncGetJobNamedPropertyValue(struct pipes_struct *p)
5544 {
5545         const struct ndr_interface_call *call;
5546         struct ndr_pull *pull;
5547         struct ndr_push *push;
5548         enum ndr_err_code ndr_err;
5549         struct winspool_AsyncGetJobNamedPropertyValue *r;
5550
5551         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETJOBNAMEDPROPERTYVALUE];
5552
5553         r = talloc(talloc_tos(), struct winspool_AsyncGetJobNamedPropertyValue);
5554         if (r == NULL) {
5555                 return false;
5556         }
5557
5558         pull = ndr_pull_init_blob(&p->in_data.data, r);
5559         if (pull == NULL) {
5560                 talloc_free(r);
5561                 return false;
5562         }
5563
5564         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5565         if (p->endian) {
5566                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5567         }
5568         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5569         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5570                 talloc_free(r);
5571                 return false;
5572         }
5573
5574         if (DEBUGLEVEL >= 10) {
5575                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetJobNamedPropertyValue, NDR_IN, r);
5576         }
5577
5578         ZERO_STRUCT(r->out);
5579         r->out.pValue = talloc_zero(r, struct spoolss_PrintPropertyValue);
5580         if (r->out.pValue == NULL) {
5581                 talloc_free(r);
5582                 return false;
5583         }
5584
5585         r->out.result = _winspool_AsyncGetJobNamedPropertyValue(p, r);
5586
5587         if (p->fault_state) {
5588                 talloc_free(r);
5589                 /* Return true here, srv_pipe_hnd.c will take care */
5590                 return true;
5591         }
5592
5593         if (DEBUGLEVEL >= 10) {
5594                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetJobNamedPropertyValue, NDR_OUT | NDR_SET_VALUES, r);
5595         }
5596
5597         push = ndr_push_init_ctx(r);
5598         if (push == NULL) {
5599                 talloc_free(r);
5600                 return false;
5601         }
5602
5603         /*
5604          * carry over the pointer count to the reply in case we are
5605          * using full pointer. See NDR specification for full pointers
5606          */
5607         push->ptr_count = pull->ptr_count;
5608
5609         ndr_err = call->ndr_push(push, NDR_OUT, r);
5610         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5611                 talloc_free(r);
5612                 return false;
5613         }
5614
5615         p->out_data.rdata = ndr_push_blob(push);
5616         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5617
5618         talloc_free(r);
5619
5620         return true;
5621 }
5622
5623 static bool api_winspool_AsyncSetJobNamedProperty(struct pipes_struct *p)
5624 {
5625         const struct ndr_interface_call *call;
5626         struct ndr_pull *pull;
5627         struct ndr_push *push;
5628         enum ndr_err_code ndr_err;
5629         struct winspool_AsyncSetJobNamedProperty *r;
5630
5631         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETJOBNAMEDPROPERTY];
5632
5633         r = talloc(talloc_tos(), struct winspool_AsyncSetJobNamedProperty);
5634         if (r == NULL) {
5635                 return false;
5636         }
5637
5638         pull = ndr_pull_init_blob(&p->in_data.data, r);
5639         if (pull == NULL) {
5640                 talloc_free(r);
5641                 return false;
5642         }
5643
5644         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5645         if (p->endian) {
5646                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5647         }
5648         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5649         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5650                 talloc_free(r);
5651                 return false;
5652         }
5653
5654         if (DEBUGLEVEL >= 10) {
5655                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetJobNamedProperty, NDR_IN, r);
5656         }
5657
5658         r->out.result = _winspool_AsyncSetJobNamedProperty(p, r);
5659
5660         if (p->fault_state) {
5661                 talloc_free(r);
5662                 /* Return true here, srv_pipe_hnd.c will take care */
5663                 return true;
5664         }
5665
5666         if (DEBUGLEVEL >= 10) {
5667                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetJobNamedProperty, NDR_OUT | NDR_SET_VALUES, r);
5668         }
5669
5670         push = ndr_push_init_ctx(r);
5671         if (push == NULL) {
5672                 talloc_free(r);
5673                 return false;
5674         }
5675
5676         /*
5677          * carry over the pointer count to the reply in case we are
5678          * using full pointer. See NDR specification for full pointers
5679          */
5680         push->ptr_count = pull->ptr_count;
5681
5682         ndr_err = call->ndr_push(push, NDR_OUT, r);
5683         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5684                 talloc_free(r);
5685                 return false;
5686         }
5687
5688         p->out_data.rdata = ndr_push_blob(push);
5689         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5690
5691         talloc_free(r);
5692
5693         return true;
5694 }
5695
5696 static bool api_winspool_AsyncDeleteJobNamedProperty(struct pipes_struct *p)
5697 {
5698         const struct ndr_interface_call *call;
5699         struct ndr_pull *pull;
5700         struct ndr_push *push;
5701         enum ndr_err_code ndr_err;
5702         struct winspool_AsyncDeleteJobNamedProperty *r;
5703
5704         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEJOBNAMEDPROPERTY];
5705
5706         r = talloc(talloc_tos(), struct winspool_AsyncDeleteJobNamedProperty);
5707         if (r == NULL) {
5708                 return false;
5709         }
5710
5711         pull = ndr_pull_init_blob(&p->in_data.data, r);
5712         if (pull == NULL) {
5713                 talloc_free(r);
5714                 return false;
5715         }
5716
5717         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5718         if (p->endian) {
5719                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5720         }
5721         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5722         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5723                 talloc_free(r);
5724                 return false;
5725         }
5726
5727         if (DEBUGLEVEL >= 10) {
5728                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteJobNamedProperty, NDR_IN, r);
5729         }
5730
5731         r->out.result = _winspool_AsyncDeleteJobNamedProperty(p, r);
5732
5733         if (p->fault_state) {
5734                 talloc_free(r);
5735                 /* Return true here, srv_pipe_hnd.c will take care */
5736                 return true;
5737         }
5738
5739         if (DEBUGLEVEL >= 10) {
5740                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteJobNamedProperty, NDR_OUT | NDR_SET_VALUES, r);
5741         }
5742
5743         push = ndr_push_init_ctx(r);
5744         if (push == NULL) {
5745                 talloc_free(r);
5746                 return false;
5747         }
5748
5749         /*
5750          * carry over the pointer count to the reply in case we are
5751          * using full pointer. See NDR specification for full pointers
5752          */
5753         push->ptr_count = pull->ptr_count;
5754
5755         ndr_err = call->ndr_push(push, NDR_OUT, r);
5756         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5757                 talloc_free(r);
5758                 return false;
5759         }
5760
5761         p->out_data.rdata = ndr_push_blob(push);
5762         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5763
5764         talloc_free(r);
5765
5766         return true;
5767 }
5768
5769 static bool api_winspool_AsyncEnumJobNamedProperties(struct pipes_struct *p)
5770 {
5771         const struct ndr_interface_call *call;
5772         struct ndr_pull *pull;
5773         struct ndr_push *push;
5774         enum ndr_err_code ndr_err;
5775         struct winspool_AsyncEnumJobNamedProperties *r;
5776
5777         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMJOBNAMEDPROPERTIES];
5778
5779         r = talloc(talloc_tos(), struct winspool_AsyncEnumJobNamedProperties);
5780         if (r == NULL) {
5781                 return false;
5782         }
5783
5784         pull = ndr_pull_init_blob(&p->in_data.data, r);
5785         if (pull == NULL) {
5786                 talloc_free(r);
5787                 return false;
5788         }
5789
5790         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5791         if (p->endian) {
5792                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5793         }
5794         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5795         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5796                 talloc_free(r);
5797                 return false;
5798         }
5799
5800         if (DEBUGLEVEL >= 10) {
5801                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumJobNamedProperties, NDR_IN, r);
5802         }
5803
5804         ZERO_STRUCT(r->out);
5805         r->out.pcProperties = talloc_zero(r, uint32_t);
5806         if (r->out.pcProperties == NULL) {
5807                 talloc_free(r);
5808                 return false;
5809         }
5810
5811         r->out.ppProperties = talloc_zero(r, struct spoolss_PrintNamedProperty *);
5812         if (r->out.ppProperties == NULL) {
5813                 talloc_free(r);
5814                 return false;
5815         }
5816
5817         r->out.result = _winspool_AsyncEnumJobNamedProperties(p, r);
5818
5819         if (p->fault_state) {
5820                 talloc_free(r);
5821                 /* Return true here, srv_pipe_hnd.c will take care */
5822                 return true;
5823         }
5824
5825         if (DEBUGLEVEL >= 10) {
5826                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumJobNamedProperties, NDR_OUT | NDR_SET_VALUES, r);
5827         }
5828
5829         push = ndr_push_init_ctx(r);
5830         if (push == NULL) {
5831                 talloc_free(r);
5832                 return false;
5833         }
5834
5835         /*
5836          * carry over the pointer count to the reply in case we are
5837          * using full pointer. See NDR specification for full pointers
5838          */
5839         push->ptr_count = pull->ptr_count;
5840
5841         ndr_err = call->ndr_push(push, NDR_OUT, r);
5842         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5843                 talloc_free(r);
5844                 return false;
5845         }
5846
5847         p->out_data.rdata = ndr_push_blob(push);
5848         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5849
5850         talloc_free(r);
5851
5852         return true;
5853 }
5854
5855 static bool api_winspool_AsyncLogJobInfoForBranchOffice(struct pipes_struct *p)
5856 {
5857         const struct ndr_interface_call *call;
5858         struct ndr_pull *pull;
5859         struct ndr_push *push;
5860         enum ndr_err_code ndr_err;
5861         struct winspool_AsyncLogJobInfoForBranchOffice *r;
5862
5863         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCLOGJOBINFOFORBRANCHOFFICE];
5864
5865         r = talloc(talloc_tos(), struct winspool_AsyncLogJobInfoForBranchOffice);
5866         if (r == NULL) {
5867                 return false;
5868         }
5869
5870         pull = ndr_pull_init_blob(&p->in_data.data, r);
5871         if (pull == NULL) {
5872                 talloc_free(r);
5873                 return false;
5874         }
5875
5876         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5877         if (p->endian) {
5878                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5879         }
5880         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5881         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5882                 talloc_free(r);
5883                 return false;
5884         }
5885
5886         if (DEBUGLEVEL >= 10) {
5887                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncLogJobInfoForBranchOffice, NDR_IN, r);
5888         }
5889
5890         r->out.result = _winspool_AsyncLogJobInfoForBranchOffice(p, r);
5891
5892         if (p->fault_state) {
5893                 talloc_free(r);
5894                 /* Return true here, srv_pipe_hnd.c will take care */
5895                 return true;
5896         }
5897
5898         if (DEBUGLEVEL >= 10) {
5899                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncLogJobInfoForBranchOffice, NDR_OUT | NDR_SET_VALUES, r);
5900         }
5901
5902         push = ndr_push_init_ctx(r);
5903         if (push == NULL) {
5904                 talloc_free(r);
5905                 return false;
5906         }
5907
5908         /*
5909          * carry over the pointer count to the reply in case we are
5910          * using full pointer. See NDR specification for full pointers
5911          */
5912         push->ptr_count = pull->ptr_count;
5913
5914         ndr_err = call->ndr_push(push, NDR_OUT, r);
5915         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5916                 talloc_free(r);
5917                 return false;
5918         }
5919
5920         p->out_data.rdata = ndr_push_blob(push);
5921         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5922
5923         talloc_free(r);
5924
5925         return true;
5926 }
5927
5928
5929 /* Tables */
5930 static struct api_struct api_iremotewinspool_cmds[] =
5931 {
5932         {"WINSPOOL_ASYNCOPENPRINTER", NDR_WINSPOOL_ASYNCOPENPRINTER, api_winspool_AsyncOpenPrinter},
5933         {"WINSPOOL_ASYNCADDPRINTER", NDR_WINSPOOL_ASYNCADDPRINTER, api_winspool_AsyncAddPrinter},
5934         {"WINSPOOL_ASYNCSETJOB", NDR_WINSPOOL_ASYNCSETJOB, api_winspool_AsyncSetJob},
5935         {"WINSPOOL_ASYNCGETJOB", NDR_WINSPOOL_ASYNCGETJOB, api_winspool_AsyncGetJob},
5936         {"WINSPOOL_ASYNCENUMJOBS", NDR_WINSPOOL_ASYNCENUMJOBS, api_winspool_AsyncEnumJobs},
5937         {"WINSPOOL_ASYNCADDJOB", NDR_WINSPOOL_ASYNCADDJOB, api_winspool_AsyncAddJob},
5938         {"WINSPOOL_ASYNCSCHEDULEJOB", NDR_WINSPOOL_ASYNCSCHEDULEJOB, api_winspool_AsyncScheduleJob},
5939         {"WINSPOOL_ASYNCDELETEPRINTER", NDR_WINSPOOL_ASYNCDELETEPRINTER, api_winspool_AsyncDeletePrinter},
5940         {"WINSPOOL_ASYNCSETPRINTER", NDR_WINSPOOL_ASYNCSETPRINTER, api_winspool_AsyncSetPrinter},
5941         {"WINSPOOL_ASYNCGETPRINTER", NDR_WINSPOOL_ASYNCGETPRINTER, api_winspool_AsyncGetPrinter},
5942         {"WINSPOOL_ASYNCSTARTDOCPRINTER", NDR_WINSPOOL_ASYNCSTARTDOCPRINTER, api_winspool_AsyncStartDocPrinter},
5943         {"WINSPOOL_ASYNCSTARTPAGEPRINTER", NDR_WINSPOOL_ASYNCSTARTPAGEPRINTER, api_winspool_AsyncStartPagePrinter},
5944         {"WINSPOOL_ASYNCWRITEPRINTER", NDR_WINSPOOL_ASYNCWRITEPRINTER, api_winspool_AsyncWritePrinter},
5945         {"WINSPOOL_ASYNCENDPAGEPRINTER", NDR_WINSPOOL_ASYNCENDPAGEPRINTER, api_winspool_AsyncEndPagePrinter},
5946         {"WINSPOOL_ASYNCENDDOCPRINTER", NDR_WINSPOOL_ASYNCENDDOCPRINTER, api_winspool_AsyncEndDocPrinter},
5947         {"WINSPOOL_ASYNCABORTPRINTER", NDR_WINSPOOL_ASYNCABORTPRINTER, api_winspool_AsyncAbortPrinter},
5948         {"WINSPOOL_ASYNCGETPRINTERDATA", NDR_WINSPOOL_ASYNCGETPRINTERDATA, api_winspool_AsyncGetPrinterData},
5949         {"WINSPOOL_ASYNCGETPRINTERDATAEX", NDR_WINSPOOL_ASYNCGETPRINTERDATAEX, api_winspool_AsyncGetPrinterDataEx},
5950         {"WINSPOOL_ASYNCSETPRINTERDATA", NDR_WINSPOOL_ASYNCSETPRINTERDATA, api_winspool_AsyncSetPrinterData},
5951         {"WINSPOOL_ASYNCSETPRINTERDATAEX", NDR_WINSPOOL_ASYNCSETPRINTERDATAEX, api_winspool_AsyncSetPrinterDataEx},
5952         {"WINSPOOL_ASYNCCLOSEPRINTER", NDR_WINSPOOL_ASYNCCLOSEPRINTER, api_winspool_AsyncClosePrinter},
5953         {"WINSPOOL_ASYNCADDFORM", NDR_WINSPOOL_ASYNCADDFORM, api_winspool_AsyncAddForm},
5954         {"WINSPOOL_ASYNCDELETEFORM", NDR_WINSPOOL_ASYNCDELETEFORM, api_winspool_AsyncDeleteForm},
5955         {"WINSPOOL_ASYNCGETFORM", NDR_WINSPOOL_ASYNCGETFORM, api_winspool_AsyncGetForm},
5956         {"WINSPOOL_ASYNCSETFORM", NDR_WINSPOOL_ASYNCSETFORM, api_winspool_AsyncSetForm},
5957         {"WINSPOOL_ASYNCENUMFORMS", NDR_WINSPOOL_ASYNCENUMFORMS, api_winspool_AsyncEnumForms},
5958         {"WINSPOOL_ASYNCGETPRINTERDRIVER", NDR_WINSPOOL_ASYNCGETPRINTERDRIVER, api_winspool_AsyncGetPrinterDriver},
5959         {"WINSPOOL_ASYNCENUMPRINTERDATA", NDR_WINSPOOL_ASYNCENUMPRINTERDATA, api_winspool_AsyncEnumPrinterData},
5960         {"WINSPOOL_ASYNCENUMPRINTERDATAEX", NDR_WINSPOOL_ASYNCENUMPRINTERDATAEX, api_winspool_AsyncEnumPrinterDataEx},
5961         {"WINSPOOL_ASYNCENUMPRINTERKEY", NDR_WINSPOOL_ASYNCENUMPRINTERKEY, api_winspool_AsyncEnumPrinterKey},
5962         {"WINSPOOL_ASYNCDELETEPRINTERDATA", NDR_WINSPOOL_ASYNCDELETEPRINTERDATA, api_winspool_AsyncDeletePrinterData},
5963         {"WINSPOOL_ASYNCDELETEPRINTERDATAEX", NDR_WINSPOOL_ASYNCDELETEPRINTERDATAEX, api_winspool_AsyncDeletePrinterDataEx},
5964         {"WINSPOOL_ASYNCDELETEPRINTERKEY", NDR_WINSPOOL_ASYNCDELETEPRINTERKEY, api_winspool_AsyncDeletePrinterKey},
5965         {"WINSPOOL_ASYNCXCVDATA", NDR_WINSPOOL_ASYNCXCVDATA, api_winspool_AsyncXcvData},
5966         {"WINSPOOL_ASYNCSENDRECVBIDIDATA", NDR_WINSPOOL_ASYNCSENDRECVBIDIDATA, api_winspool_AsyncSendRecvBidiData},
5967         {"WINSPOOL_ASYNCCREATEPRINTERIC", NDR_WINSPOOL_ASYNCCREATEPRINTERIC, api_winspool_AsyncCreatePrinterIC},
5968         {"WINSPOOL_ASYNCPLAYGDISCRIPTONPRINTERIC", NDR_WINSPOOL_ASYNCPLAYGDISCRIPTONPRINTERIC, api_winspool_AsyncPlayGdiScriptOnPrinterIC},
5969         {"WINSPOOL_ASYNCDELETEPRINTERIC", NDR_WINSPOOL_ASYNCDELETEPRINTERIC, api_winspool_AsyncDeletePrinterIC},
5970         {"WINSPOOL_ASYNCENUMPRINTERS", NDR_WINSPOOL_ASYNCENUMPRINTERS, api_winspool_AsyncEnumPrinters},
5971         {"WINSPOOL_ASYNCADDPRINTERDRIVER", NDR_WINSPOOL_ASYNCADDPRINTERDRIVER, api_winspool_AsyncAddPrinterDriver},
5972         {"WINSPOOL_ASYNCENUMPRINTERDRIVERS", NDR_WINSPOOL_ASYNCENUMPRINTERDRIVERS, api_winspool_AsyncEnumPrinterDrivers},
5973         {"WINSPOOL_ASYNCGETPRINTERDRIVERDIRECTORY", NDR_WINSPOOL_ASYNCGETPRINTERDRIVERDIRECTORY, api_winspool_AsyncGetPrinterDriverDirectory},
5974         {"WINSPOOL_ASYNCDELETEPRINTERDRIVER", NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVER, api_winspool_AsyncDeletePrinterDriver},
5975         {"WINSPOOL_ASYNCDELETEPRINTERDRIVEREX", NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVEREX, api_winspool_AsyncDeletePrinterDriverEx},
5976         {"WINSPOOL_ASYNCADDPRINTPROCESSOR", NDR_WINSPOOL_ASYNCADDPRINTPROCESSOR, api_winspool_AsyncAddPrintProcessor},
5977         {"WINSPOOL_ASYNCENUMPRINTPROCESSORS", NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORS, api_winspool_AsyncEnumPrintProcessors},
5978         {"WINSPOOL_ASYNCGETPRINTPROCESSORDIRECTORY", NDR_WINSPOOL_ASYNCGETPRINTPROCESSORDIRECTORY, api_winspool_AsyncGetPrintProcessorDirectory},
5979         {"WINSPOOL_ASYNCENUMPORTS", NDR_WINSPOOL_ASYNCENUMPORTS, api_winspool_AsyncEnumPorts},
5980         {"WINSPOOL_ASYNCENUMMONITORS", NDR_WINSPOOL_ASYNCENUMMONITORS, api_winspool_AsyncEnumMonitors},
5981         {"WINSPOOL_ASYNCADDPORT", NDR_WINSPOOL_ASYNCADDPORT, api_winspool_AsyncAddPort},
5982         {"WINSPOOL_ASYNCSETPORT", NDR_WINSPOOL_ASYNCSETPORT, api_winspool_AsyncSetPort},
5983         {"WINSPOOL_ASYNCADDMONITOR", NDR_WINSPOOL_ASYNCADDMONITOR, api_winspool_AsyncAddMonitor},
5984         {"WINSPOOL_ASYNCDELETEMONITOR", NDR_WINSPOOL_ASYNCDELETEMONITOR, api_winspool_AsyncDeleteMonitor},
5985         {"WINSPOOL_ASYNCDELETEPRINTPROCESSOR", NDR_WINSPOOL_ASYNCDELETEPRINTPROCESSOR, api_winspool_AsyncDeletePrintProcessor},
5986         {"WINSPOOL_ASYNCENUMPRINTPROCESSORDATATYPES", NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORDATATYPES, api_winspool_AsyncEnumPrintProcessorDatatypes},
5987         {"WINSPOOL_ASYNCADDPERMACHINECONNECTION", NDR_WINSPOOL_ASYNCADDPERMACHINECONNECTION, api_winspool_AsyncAddPerMachineConnection},
5988         {"WINSPOOL_ASYNCDELETEPERMACHINECONNECTION", NDR_WINSPOOL_ASYNCDELETEPERMACHINECONNECTION, api_winspool_AsyncDeletePerMachineConnection},
5989         {"WINSPOOL_ASYNCENUMPERMACHINECONNECTIONS", NDR_WINSPOOL_ASYNCENUMPERMACHINECONNECTIONS, api_winspool_AsyncEnumPerMachineConnections},
5990         {"WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS", NDR_WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS, api_winspool_SyncRegisterForRemoteNotifications},
5991         {"WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS", NDR_WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS, api_winspool_SyncUnRegisterForRemoteNotifications},
5992         {"WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS", NDR_WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS, api_winspool_SyncRefreshRemoteNotifications},
5993         {"WINSPOOL_ASYNCGETREMOTENOTIFICATIONS", NDR_WINSPOOL_ASYNCGETREMOTENOTIFICATIONS, api_winspool_AsyncGetRemoteNotifications},
5994         {"WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE", NDR_WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE, api_winspool_AsyncInstallPrinterDriverFromPackage},
5995         {"WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE", NDR_WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE, api_winspool_AsyncUploadPrinterDriverPackage},
5996         {"WINSPOOL_ASYNCGETCOREPRINTERDRIVERS", NDR_WINSPOOL_ASYNCGETCOREPRINTERDRIVERS, api_winspool_AsyncGetCorePrinterDrivers},
5997         {"WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED", NDR_WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED, api_winspool_AsyncCorePrinterDriverInstalled},
5998         {"WINSPOOL_ASYNCGETPRINTERDRIVERPACKAGEPATH", NDR_WINSPOOL_ASYNCGETPRINTERDRIVERPACKAGEPATH, api_winspool_AsyncGetPrinterDriverPackagePath},
5999         {"WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE", NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE, api_winspool_AsyncDeletePrinterDriverPackage},
6000         {"WINSPOOL_ASYNCREADPRINTER", NDR_WINSPOOL_ASYNCREADPRINTER, api_winspool_AsyncReadPrinter},
6001         {"WINSPOOL_ASYNCRESETPRINTER", NDR_WINSPOOL_ASYNCRESETPRINTER, api_winspool_AsyncResetPrinter},
6002         {"WINSPOOL_ASYNCGETJOBNAMEDPROPERTYVALUE", NDR_WINSPOOL_ASYNCGETJOBNAMEDPROPERTYVALUE, api_winspool_AsyncGetJobNamedPropertyValue},
6003         {"WINSPOOL_ASYNCSETJOBNAMEDPROPERTY", NDR_WINSPOOL_ASYNCSETJOBNAMEDPROPERTY, api_winspool_AsyncSetJobNamedProperty},
6004         {"WINSPOOL_ASYNCDELETEJOBNAMEDPROPERTY", NDR_WINSPOOL_ASYNCDELETEJOBNAMEDPROPERTY, api_winspool_AsyncDeleteJobNamedProperty},
6005         {"WINSPOOL_ASYNCENUMJOBNAMEDPROPERTIES", NDR_WINSPOOL_ASYNCENUMJOBNAMEDPROPERTIES, api_winspool_AsyncEnumJobNamedProperties},
6006         {"WINSPOOL_ASYNCLOGJOBINFOFORBRANCHOFFICE", NDR_WINSPOOL_ASYNCLOGJOBINFOFORBRANCHOFFICE, api_winspool_AsyncLogJobInfoForBranchOffice},
6007 };
6008
6009 const struct api_struct *iremotewinspool_get_pipe_fns(int *n_fns)
6010 {
6011         *n_fns = sizeof(api_iremotewinspool_cmds) / sizeof(struct api_struct);
6012         return api_iremotewinspool_cmds;
6013 }
6014
6015 NTSTATUS rpc_iremotewinspool_init(const struct rpc_srv_callbacks *rpc_srv_cb)
6016 {
6017         return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "iremotewinspool", "iremotewinspool", &ndr_table_iremotewinspool, api_iremotewinspool_cmds, sizeof(api_iremotewinspool_cmds) / sizeof(struct api_struct), rpc_srv_cb);
6018 }
6019
6020 NTSTATUS rpc_iremotewinspool_shutdown(void)
6021 {
6022         return rpc_srv_unregister(&ndr_table_iremotewinspool);
6023 }