s3-iremotewinspool: update api struct map so we only end up implementing 8 calls
[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 #include "bin/default/librpc/gen_ndr/srv_spoolss.c"
10
11 static bool api_winspool_SyncRegisterForRemoteNotifications(struct pipes_struct *p)
12 {
13         const struct ndr_interface_call *call;
14         struct ndr_pull *pull;
15         struct ndr_push *push;
16         enum ndr_err_code ndr_err;
17         struct winspool_SyncRegisterForRemoteNotifications *r;
18
19         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS];
20
21         r = talloc(talloc_tos(), struct winspool_SyncRegisterForRemoteNotifications);
22         if (r == NULL) {
23                 return false;
24         }
25
26         pull = ndr_pull_init_blob(&p->in_data.data, r);
27         if (pull == NULL) {
28                 talloc_free(r);
29                 return false;
30         }
31
32         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
33         if (p->endian) {
34                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
35         }
36         ndr_err = call->ndr_pull(pull, NDR_IN, r);
37         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
38                 talloc_free(r);
39                 return false;
40         }
41
42         if (DEBUGLEVEL >= 10) {
43                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRegisterForRemoteNotifications, NDR_IN, r);
44         }
45
46         ZERO_STRUCT(r->out);
47         r->out.phRpcHandle = talloc_zero(r, struct policy_handle);
48         if (r->out.phRpcHandle == NULL) {
49                 talloc_free(r);
50                 return false;
51         }
52
53         r->out.result = _winspool_SyncRegisterForRemoteNotifications(p, r);
54
55         if (p->fault_state) {
56                 talloc_free(r);
57                 /* Return true here, srv_pipe_hnd.c will take care */
58                 return true;
59         }
60
61         if (DEBUGLEVEL >= 10) {
62                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRegisterForRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
63         }
64
65         push = ndr_push_init_ctx(r);
66         if (push == NULL) {
67                 talloc_free(r);
68                 return false;
69         }
70
71         /*
72          * carry over the pointer count to the reply in case we are
73          * using full pointer. See NDR specification for full pointers
74          */
75         push->ptr_count = pull->ptr_count;
76
77         ndr_err = call->ndr_push(push, NDR_OUT, r);
78         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
79                 talloc_free(r);
80                 return false;
81         }
82
83         p->out_data.rdata = ndr_push_blob(push);
84         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
85
86         talloc_free(r);
87
88         return true;
89 }
90
91 static bool api_winspool_SyncUnRegisterForRemoteNotifications(struct pipes_struct *p)
92 {
93         const struct ndr_interface_call *call;
94         struct ndr_pull *pull;
95         struct ndr_push *push;
96         enum ndr_err_code ndr_err;
97         struct winspool_SyncUnRegisterForRemoteNotifications *r;
98
99         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS];
100
101         r = talloc(talloc_tos(), struct winspool_SyncUnRegisterForRemoteNotifications);
102         if (r == NULL) {
103                 return false;
104         }
105
106         pull = ndr_pull_init_blob(&p->in_data.data, r);
107         if (pull == NULL) {
108                 talloc_free(r);
109                 return false;
110         }
111
112         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
113         if (p->endian) {
114                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
115         }
116         ndr_err = call->ndr_pull(pull, NDR_IN, r);
117         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
118                 talloc_free(r);
119                 return false;
120         }
121
122         if (DEBUGLEVEL >= 10) {
123                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncUnRegisterForRemoteNotifications, NDR_IN, r);
124         }
125
126         ZERO_STRUCT(r->out);
127         r->out.phRpcHandle = r->in.phRpcHandle;
128         r->out.result = _winspool_SyncUnRegisterForRemoteNotifications(p, r);
129
130         if (p->fault_state) {
131                 talloc_free(r);
132                 /* Return true here, srv_pipe_hnd.c will take care */
133                 return true;
134         }
135
136         if (DEBUGLEVEL >= 10) {
137                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncUnRegisterForRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
138         }
139
140         push = ndr_push_init_ctx(r);
141         if (push == NULL) {
142                 talloc_free(r);
143                 return false;
144         }
145
146         /*
147          * carry over the pointer count to the reply in case we are
148          * using full pointer. See NDR specification for full pointers
149          */
150         push->ptr_count = pull->ptr_count;
151
152         ndr_err = call->ndr_push(push, NDR_OUT, r);
153         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
154                 talloc_free(r);
155                 return false;
156         }
157
158         p->out_data.rdata = ndr_push_blob(push);
159         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
160
161         talloc_free(r);
162
163         return true;
164 }
165
166 static bool api_winspool_SyncRefreshRemoteNotifications(struct pipes_struct *p)
167 {
168         const struct ndr_interface_call *call;
169         struct ndr_pull *pull;
170         struct ndr_push *push;
171         enum ndr_err_code ndr_err;
172         struct winspool_SyncRefreshRemoteNotifications *r;
173
174         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS];
175
176         r = talloc(talloc_tos(), struct winspool_SyncRefreshRemoteNotifications);
177         if (r == NULL) {
178                 return false;
179         }
180
181         pull = ndr_pull_init_blob(&p->in_data.data, r);
182         if (pull == NULL) {
183                 talloc_free(r);
184                 return false;
185         }
186
187         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
188         if (p->endian) {
189                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
190         }
191         ndr_err = call->ndr_pull(pull, NDR_IN, r);
192         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
193                 talloc_free(r);
194                 return false;
195         }
196
197         if (DEBUGLEVEL >= 10) {
198                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRefreshRemoteNotifications, NDR_IN, r);
199         }
200
201         ZERO_STRUCT(r->out);
202         r->out.ppNotifyData = talloc_zero(r, struct winspool_PrintPropertiesCollection *);
203         if (r->out.ppNotifyData == NULL) {
204                 talloc_free(r);
205                 return false;
206         }
207
208         r->out.result = _winspool_SyncRefreshRemoteNotifications(p, r);
209
210         if (p->fault_state) {
211                 talloc_free(r);
212                 /* Return true here, srv_pipe_hnd.c will take care */
213                 return true;
214         }
215
216         if (DEBUGLEVEL >= 10) {
217                 NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRefreshRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
218         }
219
220         push = ndr_push_init_ctx(r);
221         if (push == NULL) {
222                 talloc_free(r);
223                 return false;
224         }
225
226         /*
227          * carry over the pointer count to the reply in case we are
228          * using full pointer. See NDR specification for full pointers
229          */
230         push->ptr_count = pull->ptr_count;
231
232         ndr_err = call->ndr_push(push, NDR_OUT, r);
233         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
234                 talloc_free(r);
235                 return false;
236         }
237
238         p->out_data.rdata = ndr_push_blob(push);
239         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
240
241         talloc_free(r);
242
243         return true;
244 }
245
246 static bool api_winspool_AsyncGetRemoteNotifications(struct pipes_struct *p)
247 {
248         const struct ndr_interface_call *call;
249         struct ndr_pull *pull;
250         struct ndr_push *push;
251         enum ndr_err_code ndr_err;
252         struct winspool_AsyncGetRemoteNotifications *r;
253
254         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETREMOTENOTIFICATIONS];
255
256         r = talloc(talloc_tos(), struct winspool_AsyncGetRemoteNotifications);
257         if (r == NULL) {
258                 return false;
259         }
260
261         pull = ndr_pull_init_blob(&p->in_data.data, r);
262         if (pull == NULL) {
263                 talloc_free(r);
264                 return false;
265         }
266
267         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
268         if (p->endian) {
269                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
270         }
271         ndr_err = call->ndr_pull(pull, NDR_IN, r);
272         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
273                 talloc_free(r);
274                 return false;
275         }
276
277         if (DEBUGLEVEL >= 10) {
278                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetRemoteNotifications, NDR_IN, r);
279         }
280
281         ZERO_STRUCT(r->out);
282         r->out.ppNotifyData = talloc_zero(r, struct winspool_PrintPropertiesCollection *);
283         if (r->out.ppNotifyData == NULL) {
284                 talloc_free(r);
285                 return false;
286         }
287
288         r->out.result = _winspool_AsyncGetRemoteNotifications(p, r);
289
290         if (p->fault_state) {
291                 talloc_free(r);
292                 /* Return true here, srv_pipe_hnd.c will take care */
293                 return true;
294         }
295
296         if (DEBUGLEVEL >= 10) {
297                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
298         }
299
300         push = ndr_push_init_ctx(r);
301         if (push == NULL) {
302                 talloc_free(r);
303                 return false;
304         }
305
306         /*
307          * carry over the pointer count to the reply in case we are
308          * using full pointer. See NDR specification for full pointers
309          */
310         push->ptr_count = pull->ptr_count;
311
312         ndr_err = call->ndr_push(push, NDR_OUT, r);
313         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
314                 talloc_free(r);
315                 return false;
316         }
317
318         p->out_data.rdata = ndr_push_blob(push);
319         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
320
321         talloc_free(r);
322
323         return true;
324 }
325
326 static bool api_winspool_AsyncInstallPrinterDriverFromPackage(struct pipes_struct *p)
327 {
328         const struct ndr_interface_call *call;
329         struct ndr_pull *pull;
330         struct ndr_push *push;
331         enum ndr_err_code ndr_err;
332         struct winspool_AsyncInstallPrinterDriverFromPackage *r;
333
334         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE];
335
336         r = talloc(talloc_tos(), struct winspool_AsyncInstallPrinterDriverFromPackage);
337         if (r == NULL) {
338                 return false;
339         }
340
341         pull = ndr_pull_init_blob(&p->in_data.data, r);
342         if (pull == NULL) {
343                 talloc_free(r);
344                 return false;
345         }
346
347         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
348         if (p->endian) {
349                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
350         }
351         ndr_err = call->ndr_pull(pull, NDR_IN, r);
352         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
353                 talloc_free(r);
354                 return false;
355         }
356
357         if (DEBUGLEVEL >= 10) {
358                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncInstallPrinterDriverFromPackage, NDR_IN, r);
359         }
360
361         r->out.result = _winspool_AsyncInstallPrinterDriverFromPackage(p, r);
362
363         if (p->fault_state) {
364                 talloc_free(r);
365                 /* Return true here, srv_pipe_hnd.c will take care */
366                 return true;
367         }
368
369         if (DEBUGLEVEL >= 10) {
370                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncInstallPrinterDriverFromPackage, NDR_OUT | NDR_SET_VALUES, r);
371         }
372
373         push = ndr_push_init_ctx(r);
374         if (push == NULL) {
375                 talloc_free(r);
376                 return false;
377         }
378
379         /*
380          * carry over the pointer count to the reply in case we are
381          * using full pointer. See NDR specification for full pointers
382          */
383         push->ptr_count = pull->ptr_count;
384
385         ndr_err = call->ndr_push(push, NDR_OUT, r);
386         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
387                 talloc_free(r);
388                 return false;
389         }
390
391         p->out_data.rdata = ndr_push_blob(push);
392         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
393
394         talloc_free(r);
395
396         return true;
397 }
398
399 static bool api_winspool_AsyncUploadPrinterDriverPackage(struct pipes_struct *p)
400 {
401         const struct ndr_interface_call *call;
402         struct ndr_pull *pull;
403         struct ndr_push *push;
404         enum ndr_err_code ndr_err;
405         struct winspool_AsyncUploadPrinterDriverPackage *r;
406
407         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE];
408
409         r = talloc(talloc_tos(), struct winspool_AsyncUploadPrinterDriverPackage);
410         if (r == NULL) {
411                 return false;
412         }
413
414         pull = ndr_pull_init_blob(&p->in_data.data, r);
415         if (pull == NULL) {
416                 talloc_free(r);
417                 return false;
418         }
419
420         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
421         if (p->endian) {
422                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
423         }
424         ndr_err = call->ndr_pull(pull, NDR_IN, r);
425         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
426                 talloc_free(r);
427                 return false;
428         }
429
430         if (DEBUGLEVEL >= 10) {
431                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncUploadPrinterDriverPackage, NDR_IN, r);
432         }
433
434         ZERO_STRUCT(r->out);
435         r->out.pszDestInfPath = r->in.pszDestInfPath;
436         r->out.pcchDestInfPath = r->in.pcchDestInfPath;
437         r->out.result = _winspool_AsyncUploadPrinterDriverPackage(p, r);
438
439         if (p->fault_state) {
440                 talloc_free(r);
441                 /* Return true here, srv_pipe_hnd.c will take care */
442                 return true;
443         }
444
445         if (DEBUGLEVEL >= 10) {
446                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncUploadPrinterDriverPackage, NDR_OUT | NDR_SET_VALUES, r);
447         }
448
449         push = ndr_push_init_ctx(r);
450         if (push == NULL) {
451                 talloc_free(r);
452                 return false;
453         }
454
455         /*
456          * carry over the pointer count to the reply in case we are
457          * using full pointer. See NDR specification for full pointers
458          */
459         push->ptr_count = pull->ptr_count;
460
461         ndr_err = call->ndr_push(push, NDR_OUT, r);
462         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
463                 talloc_free(r);
464                 return false;
465         }
466
467         p->out_data.rdata = ndr_push_blob(push);
468         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
469
470         talloc_free(r);
471
472         return true;
473 }
474
475 static bool api_winspool_AsyncCorePrinterDriverInstalled(struct pipes_struct *p)
476 {
477         const struct ndr_interface_call *call;
478         struct ndr_pull *pull;
479         struct ndr_push *push;
480         enum ndr_err_code ndr_err;
481         struct winspool_AsyncCorePrinterDriverInstalled *r;
482
483         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED];
484
485         r = talloc(talloc_tos(), struct winspool_AsyncCorePrinterDriverInstalled);
486         if (r == NULL) {
487                 return false;
488         }
489
490         pull = ndr_pull_init_blob(&p->in_data.data, r);
491         if (pull == NULL) {
492                 talloc_free(r);
493                 return false;
494         }
495
496         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
497         if (p->endian) {
498                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
499         }
500         ndr_err = call->ndr_pull(pull, NDR_IN, r);
501         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
502                 talloc_free(r);
503                 return false;
504         }
505
506         if (DEBUGLEVEL >= 10) {
507                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncCorePrinterDriverInstalled, NDR_IN, r);
508         }
509
510         ZERO_STRUCT(r->out);
511         r->out.pbDriverInstalled = talloc_zero(r, int32_t);
512         if (r->out.pbDriverInstalled == NULL) {
513                 talloc_free(r);
514                 return false;
515         }
516
517         r->out.result = _winspool_AsyncCorePrinterDriverInstalled(p, r);
518
519         if (p->fault_state) {
520                 talloc_free(r);
521                 /* Return true here, srv_pipe_hnd.c will take care */
522                 return true;
523         }
524
525         if (DEBUGLEVEL >= 10) {
526                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncCorePrinterDriverInstalled, NDR_OUT | NDR_SET_VALUES, r);
527         }
528
529         push = ndr_push_init_ctx(r);
530         if (push == NULL) {
531                 talloc_free(r);
532                 return false;
533         }
534
535         /*
536          * carry over the pointer count to the reply in case we are
537          * using full pointer. See NDR specification for full pointers
538          */
539         push->ptr_count = pull->ptr_count;
540
541         ndr_err = call->ndr_push(push, NDR_OUT, r);
542         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
543                 talloc_free(r);
544                 return false;
545         }
546
547         p->out_data.rdata = ndr_push_blob(push);
548         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
549
550         talloc_free(r);
551
552         return true;
553 }
554
555 static bool api_winspool_AsyncDeletePrinterDriverPackage(struct pipes_struct *p)
556 {
557         const struct ndr_interface_call *call;
558         struct ndr_pull *pull;
559         struct ndr_push *push;
560         enum ndr_err_code ndr_err;
561         struct winspool_AsyncDeletePrinterDriverPackage *r;
562
563         call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE];
564
565         r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterDriverPackage);
566         if (r == NULL) {
567                 return false;
568         }
569
570         pull = ndr_pull_init_blob(&p->in_data.data, r);
571         if (pull == NULL) {
572                 talloc_free(r);
573                 return false;
574         }
575
576         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
577         if (p->endian) {
578                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
579         }
580         ndr_err = call->ndr_pull(pull, NDR_IN, r);
581         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
582                 talloc_free(r);
583                 return false;
584         }
585
586         if (DEBUGLEVEL >= 10) {
587                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriverPackage, NDR_IN, r);
588         }
589
590         r->out.result = _winspool_AsyncDeletePrinterDriverPackage(p, r);
591
592         if (p->fault_state) {
593                 talloc_free(r);
594                 /* Return true here, srv_pipe_hnd.c will take care */
595                 return true;
596         }
597
598         if (DEBUGLEVEL >= 10) {
599                 NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriverPackage, NDR_OUT | NDR_SET_VALUES, r);
600         }
601
602         push = ndr_push_init_ctx(r);
603         if (push == NULL) {
604                 talloc_free(r);
605                 return false;
606         }
607
608         /*
609          * carry over the pointer count to the reply in case we are
610          * using full pointer. See NDR specification for full pointers
611          */
612         push->ptr_count = pull->ptr_count;
613
614         ndr_err = call->ndr_push(push, NDR_OUT, r);
615         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
616                 talloc_free(r);
617                 return false;
618         }
619
620         p->out_data.rdata = ndr_push_blob(push);
621         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
622
623         talloc_free(r);
624
625         return true;
626 }
627
628
629 /* Tables */
630 static struct api_struct api_iremotewinspool_cmds[] =
631 {
632         {"WINSPOOL_ASYNCOPENPRINTER", NDR_WINSPOOL_ASYNCOPENPRINTER, api_spoolss_OpenPrinterEx},
633         {"WINSPOOL_ASYNCADDPRINTER", NDR_WINSPOOL_ASYNCADDPRINTER, api_spoolss_AddPrinterEx},
634         {"WINSPOOL_ASYNCSETJOB", NDR_WINSPOOL_ASYNCSETJOB, api_spoolss_SetJob},
635         {"WINSPOOL_ASYNCGETJOB", NDR_WINSPOOL_ASYNCGETJOB, api_spoolss_GetJob},
636         {"WINSPOOL_ASYNCENUMJOBS", NDR_WINSPOOL_ASYNCENUMJOBS, api_spoolss_EnumJobs},
637         {"WINSPOOL_ASYNCADDJOB", NDR_WINSPOOL_ASYNCADDJOB, api_spoolss_AddJob},
638         {"WINSPOOL_ASYNCSCHEDULEJOB", NDR_WINSPOOL_ASYNCSCHEDULEJOB, api_spoolss_ScheduleJob},
639         {"WINSPOOL_ASYNCDELETEPRINTER", NDR_WINSPOOL_ASYNCDELETEPRINTER, api_spoolss_DeletePrinter},
640         {"WINSPOOL_ASYNCSETPRINTER", NDR_WINSPOOL_ASYNCSETPRINTER, api_spoolss_SetPrinter},
641         {"WINSPOOL_ASYNCGETPRINTER", NDR_WINSPOOL_ASYNCGETPRINTER, api_spoolss_GetPrinter},
642         {"WINSPOOL_ASYNCSTARTDOCPRINTER", NDR_WINSPOOL_ASYNCSTARTDOCPRINTER, api_spoolss_StartDocPrinter},
643         {"WINSPOOL_ASYNCSTARTPAGEPRINTER", NDR_WINSPOOL_ASYNCSTARTPAGEPRINTER, api_spoolss_StartPagePrinter},
644         {"WINSPOOL_ASYNCWRITEPRINTER", NDR_WINSPOOL_ASYNCWRITEPRINTER, api_spoolss_WritePrinter},
645         {"WINSPOOL_ASYNCENDPAGEPRINTER", NDR_WINSPOOL_ASYNCENDPAGEPRINTER, api_spoolss_EndPagePrinter},
646         {"WINSPOOL_ASYNCENDDOCPRINTER", NDR_WINSPOOL_ASYNCENDDOCPRINTER, api_spoolss_EndDocPrinter},
647         {"WINSPOOL_ASYNCABORTPRINTER", NDR_WINSPOOL_ASYNCABORTPRINTER, api_spoolss_AbortPrinter},
648         {"WINSPOOL_ASYNCGETPRINTERDATA", NDR_WINSPOOL_ASYNCGETPRINTERDATA, api_spoolss_GetPrinterData},
649         {"WINSPOOL_ASYNCGETPRINTERDATAEX", NDR_WINSPOOL_ASYNCGETPRINTERDATAEX, api_spoolss_GetPrinterDataEx},
650         {"WINSPOOL_ASYNCSETPRINTERDATA", NDR_WINSPOOL_ASYNCSETPRINTERDATA, api_spoolss_SetPrinterData},
651         {"WINSPOOL_ASYNCSETPRINTERDATAEX", NDR_WINSPOOL_ASYNCSETPRINTERDATAEX, api_spoolss_SetPrinterDataEx},
652         {"WINSPOOL_ASYNCCLOSEPRINTER", NDR_WINSPOOL_ASYNCCLOSEPRINTER, api_spoolss_ClosePrinter},
653         {"WINSPOOL_ASYNCADDFORM", NDR_WINSPOOL_ASYNCADDFORM, api_spoolss_AddForm},
654         {"WINSPOOL_ASYNCDELETEFORM", NDR_WINSPOOL_ASYNCDELETEFORM, api_spoolss_DeleteForm},
655         {"WINSPOOL_ASYNCGETFORM", NDR_WINSPOOL_ASYNCGETFORM, api_spoolss_GetForm},
656         {"WINSPOOL_ASYNCSETFORM", NDR_WINSPOOL_ASYNCSETFORM, api_spoolss_SetForm},
657         {"WINSPOOL_ASYNCENUMFORMS", NDR_WINSPOOL_ASYNCENUMFORMS, api_spoolss_EnumForms},
658         {"WINSPOOL_ASYNCGETPRINTERDRIVER", NDR_WINSPOOL_ASYNCGETPRINTERDRIVER, api_spoolss_GetPrinterDriver2},
659         {"WINSPOOL_ASYNCENUMPRINTERDATA", NDR_WINSPOOL_ASYNCENUMPRINTERDATA, api_spoolss_EnumPrinterData},
660         {"WINSPOOL_ASYNCENUMPRINTERDATAEX", NDR_WINSPOOL_ASYNCENUMPRINTERDATAEX, api_spoolss_EnumPrinterDataEx},
661         {"WINSPOOL_ASYNCENUMPRINTERKEY", NDR_WINSPOOL_ASYNCENUMPRINTERKEY, api_spoolss_EnumPrinterKey},
662         {"WINSPOOL_ASYNCDELETEPRINTERDATA", NDR_WINSPOOL_ASYNCDELETEPRINTERDATA, api_spoolss_DeletePrinterData},
663         {"WINSPOOL_ASYNCDELETEPRINTERDATAEX", NDR_WINSPOOL_ASYNCDELETEPRINTERDATAEX, api_spoolss_DeletePrinterDataEx},
664         {"WINSPOOL_ASYNCDELETEPRINTERKEY", NDR_WINSPOOL_ASYNCDELETEPRINTERKEY, api_spoolss_DeletePrinterKey},
665         {"WINSPOOL_ASYNCXCVDATA", NDR_WINSPOOL_ASYNCXCVDATA, api_spoolss_XcvData},
666         {"WINSPOOL_ASYNCSENDRECVBIDIDATA", NDR_WINSPOOL_ASYNCSENDRECVBIDIDATA, api_spoolss_SendRecvBidiData},
667         {"WINSPOOL_ASYNCCREATEPRINTERIC", NDR_WINSPOOL_ASYNCCREATEPRINTERIC, api_spoolss_CreatePrinterIC},
668         {"WINSPOOL_ASYNCPLAYGDISCRIPTONPRINTERIC", NDR_WINSPOOL_ASYNCPLAYGDISCRIPTONPRINTERIC, api_spoolss_PlayGDIScriptOnPrinterIC},
669         {"WINSPOOL_ASYNCDELETEPRINTERIC", NDR_WINSPOOL_ASYNCDELETEPRINTERIC, api_spoolss_DeletePrinterIC},
670         {"WINSPOOL_ASYNCENUMPRINTERS", NDR_WINSPOOL_ASYNCENUMPRINTERS, api_spoolss_EnumPrinters},
671         {"WINSPOOL_ASYNCADDPRINTERDRIVER", NDR_WINSPOOL_ASYNCADDPRINTERDRIVER, api_spoolss_AddPrinterDriver},
672         {"WINSPOOL_ASYNCENUMPRINTERDRIVERS", NDR_WINSPOOL_ASYNCENUMPRINTERDRIVERS, api_spoolss_EnumPrinterDrivers},
673         {"WINSPOOL_ASYNCGETPRINTERDRIVERDIRECTORY", NDR_WINSPOOL_ASYNCGETPRINTERDRIVERDIRECTORY, api_spoolss_GetPrinterDriverDirectory},
674         {"WINSPOOL_ASYNCDELETEPRINTERDRIVER", NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVER, api_spoolss_DeletePrinterDriver},
675         {"WINSPOOL_ASYNCDELETEPRINTERDRIVEREX", NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVEREX, api_spoolss_DeletePrinterDriverEx},
676         {"WINSPOOL_ASYNCADDPRINTPROCESSOR", NDR_WINSPOOL_ASYNCADDPRINTPROCESSOR, api_spoolss_AddPrintProcessor},
677         {"WINSPOOL_ASYNCENUMPRINTPROCESSORS", NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORS, api_spoolss_EnumPrintProcessors},
678         {"WINSPOOL_ASYNCGETPRINTPROCESSORDIRECTORY", NDR_WINSPOOL_ASYNCGETPRINTPROCESSORDIRECTORY, api_spoolss_GetPrintProcessorDirectory},
679         {"WINSPOOL_ASYNCENUMPORTS", NDR_WINSPOOL_ASYNCENUMPORTS, api_spoolss_EnumPorts},
680         {"WINSPOOL_ASYNCENUMMONITORS", NDR_WINSPOOL_ASYNCENUMMONITORS, api_spoolss_EnumMonitors},
681         {"WINSPOOL_ASYNCADDPORT", NDR_WINSPOOL_ASYNCADDPORT, api_spoolss_AddPort},
682         {"WINSPOOL_ASYNCSETPORT", NDR_WINSPOOL_ASYNCSETPORT, api_spoolss_SetPort},
683         {"WINSPOOL_ASYNCADDMONITOR", NDR_WINSPOOL_ASYNCADDMONITOR, api_spoolss_AddMonitor},
684         {"WINSPOOL_ASYNCDELETEMONITOR", NDR_WINSPOOL_ASYNCDELETEMONITOR, api_spoolss_DeleteMonitor},
685         {"WINSPOOL_ASYNCDELETEPRINTPROCESSOR", NDR_WINSPOOL_ASYNCDELETEPRINTPROCESSOR, api_spoolss_DeletePrintProcessor},
686         {"WINSPOOL_ASYNCENUMPRINTPROCESSORDATATYPES", NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORDATATYPES, api_spoolss_EnumPrintProcessorDataTypes},
687         {"WINSPOOL_ASYNCADDPERMACHINECONNECTION", NDR_WINSPOOL_ASYNCADDPERMACHINECONNECTION, api_spoolss_AddPerMachineConnection},
688         {"WINSPOOL_ASYNCDELETEPERMACHINECONNECTION", NDR_WINSPOOL_ASYNCDELETEPERMACHINECONNECTION, api_spoolss_DeletePerMachineConnection},
689         {"WINSPOOL_ASYNCENUMPERMACHINECONNECTIONS", NDR_WINSPOOL_ASYNCENUMPERMACHINECONNECTIONS, api_spoolss_EnumPerMachineConnections},
690         {"WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS", NDR_WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS, api_winspool_SyncRegisterForRemoteNotifications},
691         {"WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS", NDR_WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS, api_winspool_SyncUnRegisterForRemoteNotifications},
692         {"WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS", NDR_WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS, api_winspool_SyncRefreshRemoteNotifications},
693         {"WINSPOOL_ASYNCGETREMOTENOTIFICATIONS", NDR_WINSPOOL_ASYNCGETREMOTENOTIFICATIONS, api_winspool_AsyncGetRemoteNotifications},
694         {"WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE", NDR_WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE, api_winspool_AsyncInstallPrinterDriverFromPackage},
695         {"WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE", NDR_WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE, api_winspool_AsyncUploadPrinterDriverPackage},
696         {"WINSPOOL_ASYNCGETCOREPRINTERDRIVERS", NDR_WINSPOOL_ASYNCGETCOREPRINTERDRIVERS, api_spoolss_GetCorePrinterDrivers},
697         {"WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED", NDR_WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED, api_winspool_AsyncCorePrinterDriverInstalled},
698         {"WINSPOOL_ASYNCGETPRINTERDRIVERPACKAGEPATH", NDR_WINSPOOL_ASYNCGETPRINTERDRIVERPACKAGEPATH, api_spoolss_GetPrinterDriverPackagePath},
699         {"WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE", NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE, api_winspool_AsyncDeletePrinterDriverPackage},
700         {"WINSPOOL_ASYNCREADPRINTER", NDR_WINSPOOL_ASYNCREADPRINTER, api_spoolss_ReadPrinter},
701         {"WINSPOOL_ASYNCRESETPRINTER", NDR_WINSPOOL_ASYNCRESETPRINTER, api_spoolss_ResetPrinter},
702         {"WINSPOOL_ASYNCGETJOBNAMEDPROPERTYVALUE", NDR_WINSPOOL_ASYNCGETJOBNAMEDPROPERTYVALUE, api_spoolss_GetJobNamedPropertyValue},
703         {"WINSPOOL_ASYNCSETJOBNAMEDPROPERTY", NDR_WINSPOOL_ASYNCSETJOBNAMEDPROPERTY, api_spoolss_SetJobNamedProperty},
704         {"WINSPOOL_ASYNCDELETEJOBNAMEDPROPERTY", NDR_WINSPOOL_ASYNCDELETEJOBNAMEDPROPERTY, api_spoolss_DeleteJobNamedProperty},
705         {"WINSPOOL_ASYNCENUMJOBNAMEDPROPERTIES", NDR_WINSPOOL_ASYNCENUMJOBNAMEDPROPERTIES, api_spoolss_EnumJobNamedProperties},
706         {"WINSPOOL_ASYNCLOGJOBINFOFORBRANCHOFFICE", NDR_WINSPOOL_ASYNCLOGJOBINFOFORBRANCHOFFICE, api_spoolss_LogJobInfoForBranchOffice},
707 };
708
709 const struct api_struct *iremotewinspool_get_pipe_fns(int *n_fns)
710 {
711         *n_fns = sizeof(api_iremotewinspool_cmds) / sizeof(struct api_struct);
712         return api_iremotewinspool_cmds;
713 }
714
715 NTSTATUS rpc_iremotewinspool_init(const struct rpc_srv_callbacks *rpc_srv_cb)
716 {
717         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);
718 }
719
720 NTSTATUS rpc_iremotewinspool_shutdown(void)
721 {
722         return rpc_srv_unregister(&ndr_table_iremotewinspool);
723 }