s3-spoolss: use pidl for _spoolss_EnumPrinterKey.
[ira/wip.git] / source3 / rpc_server / srv_spoolss.c
1 /* 
2  *  Unix SMB/CIFS implementation.
3  *  RPC Pipe client / server routines
4  *  Copyright (C) Andrew Tridgell              1992-2000,
5  *  Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
6  *  Copyright (C) Jean Fran├žois Micouleau      1998-2000,
7  *  Copyright (C) Jeremy Allison                    2001,
8  *  Copyright (C) Gerald Carter                2001-2002,
9  *  Copyright (C) Jim McDonough <jmcd@us.ibm.com>   2003.
10  *  
11  *  This program is free software; you can redistribute it and/or modify
12  *  it under the terms of the GNU General Public License as published by
13  *  the Free Software Foundation; either version 3 of the License, or
14  *  (at your option) any later version.
15  *  
16  *  This program is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *  GNU General Public License for more details.
20  *  
21  *  You should have received a copy of the GNU General Public License
22  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
23  */
24
25 #include "includes.h"
26
27 #undef DBGC_CLASS
28 #define DBGC_CLASS DBGC_RPC_SRV
29
30 /*******************************************************************
31  ********************************************************************/
32
33 static bool proxy_spoolss_call(pipes_struct *p, uint8_t opnum)
34 {
35         struct api_struct *fns;
36         int n_fns;
37
38         spoolss_get_pipe_fns(&fns, &n_fns);
39
40         if (opnum >= n_fns) {
41                 return false;
42         }
43
44         if (fns[opnum].opnum != opnum) {
45                 smb_panic("SPOOLSS function table not sorted");
46         }
47
48         return fns[opnum].fn(p);
49 }
50
51 /********************************************************************
52  * api_spoolss_open_printer_ex (rarely seen - older call)
53  ********************************************************************/
54
55 static bool api_spoolss_open_printer(pipes_struct *p)
56 {
57         return proxy_spoolss_call(p, NDR_SPOOLSS_OPENPRINTER);
58 }
59
60 /********************************************************************
61  * api_spoolss_open_printer_ex
62  ********************************************************************/
63
64 static bool api_spoolss_open_printer_ex(pipes_struct *p)
65 {
66         return proxy_spoolss_call(p, NDR_SPOOLSS_OPENPRINTEREX);
67 }
68
69 /********************************************************************
70  * api_spoolss_getprinterdata
71  *
72  * called from the spoolss dispatcher
73  ********************************************************************/
74
75 static bool api_spoolss_getprinterdata(pipes_struct *p)
76 {
77         return proxy_spoolss_call(p, NDR_SPOOLSS_GETPRINTERDATA);
78 }
79
80 /********************************************************************
81  * api_spoolss_deleteprinterdata
82  *
83  * called from the spoolss dispatcher
84  ********************************************************************/
85
86 static bool api_spoolss_deleteprinterdata(pipes_struct *p)
87 {
88         return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERDATA);
89 }
90
91 /********************************************************************
92  * api_spoolss_closeprinter
93  *
94  * called from the spoolss dispatcher
95  ********************************************************************/
96
97 static bool api_spoolss_closeprinter(pipes_struct *p)
98 {
99         return proxy_spoolss_call(p, NDR_SPOOLSS_CLOSEPRINTER);
100 }
101
102 /********************************************************************
103  * api_spoolss_abortprinter
104  *
105  * called from the spoolss dispatcher
106  ********************************************************************/
107
108 static bool api_spoolss_abortprinter(pipes_struct *p)
109 {
110         return proxy_spoolss_call(p, NDR_SPOOLSS_ABORTPRINTER);
111 }
112
113 /********************************************************************
114  * api_spoolss_deleteprinter
115  *
116  * called from the spoolss dispatcher
117  ********************************************************************/
118
119 static bool api_spoolss_deleteprinter(pipes_struct *p)
120 {
121         return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTER);
122 }
123
124 /********************************************************************
125  * api_spoolss_deleteprinterdriver
126  *
127  * called from the spoolss dispatcher
128  ********************************************************************/
129
130 static bool api_spoolss_deleteprinterdriver(pipes_struct *p)
131 {
132         return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERDRIVER);
133 }
134
135
136 /********************************************************************
137  * api_spoolss_rffpcnex
138  * ReplyFindFirstPrinterChangeNotifyEx
139  ********************************************************************/
140
141 static bool api_spoolss_rffpcnex(pipes_struct *p)
142 {
143         return proxy_spoolss_call(p, NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX);
144 }
145
146
147 /********************************************************************
148  * api_spoolss_rfnpcnex
149  * ReplyFindNextPrinterChangeNotifyEx
150  * called from the spoolss dispatcher
151
152  * Note - this is the *ONLY* function that breaks the RPC call
153  * symmetry in all the other calls. We need to do this to fix
154  * the massive memory allocation problem with thousands of jobs...
155  * JRA.
156  ********************************************************************/
157
158 static bool api_spoolss_rfnpcnex(pipes_struct *p)
159 {
160         return proxy_spoolss_call(p, NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY);
161 }
162
163
164 /********************************************************************
165  * api_spoolss_enumprinters
166  * called from the spoolss dispatcher
167  *
168  ********************************************************************/
169
170 static bool api_spoolss_enumprinters(pipes_struct *p)
171 {
172         return proxy_spoolss_call(p, NDR_SPOOLSS_ENUMPRINTERS);
173 }
174
175 /********************************************************************
176  * api_spoolss_getprinter
177  * called from the spoolss dispatcher
178  *
179  ********************************************************************/
180
181 static bool api_spoolss_getprinter(pipes_struct *p)
182 {
183         return proxy_spoolss_call(p, NDR_SPOOLSS_GETPRINTER);
184 }
185
186 /********************************************************************
187  * api_spoolss_getprinter
188  * called from the spoolss dispatcher
189  *
190  ********************************************************************/
191
192 static bool api_spoolss_getprinterdriver2(pipes_struct *p)
193 {
194         return proxy_spoolss_call(p, NDR_SPOOLSS_GETPRINTERDRIVER2);
195 }
196
197 /********************************************************************
198  * api_spoolss_getprinter
199  * called from the spoolss dispatcher
200  *
201  ********************************************************************/
202
203 static bool api_spoolss_startpageprinter(pipes_struct *p)
204 {
205         return proxy_spoolss_call(p, NDR_SPOOLSS_STARTPAGEPRINTER);
206 }
207
208 /********************************************************************
209  * api_spoolss_getprinter
210  * called from the spoolss dispatcher
211  *
212  ********************************************************************/
213
214 static bool api_spoolss_endpageprinter(pipes_struct *p)
215 {
216         return proxy_spoolss_call(p, NDR_SPOOLSS_ENDPAGEPRINTER);
217 }
218
219 /********************************************************************
220 ********************************************************************/
221
222 static bool api_spoolss_startdocprinter(pipes_struct *p)
223 {
224         return proxy_spoolss_call(p, NDR_SPOOLSS_STARTDOCPRINTER);
225 }
226
227 /********************************************************************
228 ********************************************************************/
229
230 static bool api_spoolss_enddocprinter(pipes_struct *p)
231 {
232         return proxy_spoolss_call(p, NDR_SPOOLSS_ENDDOCPRINTER);
233 }
234
235 /********************************************************************
236 ********************************************************************/
237
238 static bool api_spoolss_writeprinter(pipes_struct *p)
239 {
240         return proxy_spoolss_call(p, NDR_SPOOLSS_WRITEPRINTER);
241 }
242
243 /****************************************************************************
244
245 ****************************************************************************/
246
247 static bool api_spoolss_setprinter(pipes_struct *p)
248 {
249         return proxy_spoolss_call(p, NDR_SPOOLSS_SETPRINTER);
250 }
251
252 /****************************************************************************
253 ****************************************************************************/
254
255 static bool api_spoolss_fcpn(pipes_struct *p)
256 {
257         return proxy_spoolss_call(p, NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY);
258 }
259
260 /****************************************************************************
261 ****************************************************************************/
262
263 static bool api_spoolss_addjob(pipes_struct *p)
264 {
265         return proxy_spoolss_call(p, NDR_SPOOLSS_ADDJOB);
266 }
267
268 /****************************************************************************
269 ****************************************************************************/
270
271 static bool api_spoolss_enumjobs(pipes_struct *p)
272 {
273         return proxy_spoolss_call(p, NDR_SPOOLSS_ENUMJOBS);
274 }
275
276 /****************************************************************************
277 ****************************************************************************/
278
279 static bool api_spoolss_schedulejob(pipes_struct *p)
280 {
281         return proxy_spoolss_call(p, NDR_SPOOLSS_SCHEDULEJOB);
282 }
283
284 /****************************************************************************
285 ****************************************************************************/
286
287 static bool api_spoolss_setjob(pipes_struct *p)
288 {
289         return proxy_spoolss_call(p, NDR_SPOOLSS_SETJOB);
290 }
291
292 /****************************************************************************
293 ****************************************************************************/
294
295 static bool api_spoolss_enumprinterdrivers(pipes_struct *p)
296 {
297         return proxy_spoolss_call(p, NDR_SPOOLSS_ENUMPRINTERDRIVERS);
298 }
299
300 /****************************************************************************
301 ****************************************************************************/
302
303 static bool api_spoolss_getform(pipes_struct *p)
304 {
305         return proxy_spoolss_call(p, NDR_SPOOLSS_GETFORM);
306 }
307
308 /****************************************************************************
309 ****************************************************************************/
310
311 static bool api_spoolss_enumforms(pipes_struct *p)
312 {
313         return proxy_spoolss_call(p, NDR_SPOOLSS_ENUMFORMS);
314 }
315
316 /****************************************************************************
317 ****************************************************************************/
318
319 static bool api_spoolss_enumports(pipes_struct *p)
320 {
321         return proxy_spoolss_call(p, NDR_SPOOLSS_ENUMPORTS);
322 }
323
324 /****************************************************************************
325 ****************************************************************************/
326
327 static bool api_spoolss_addprinterex(pipes_struct *p)
328 {
329         return proxy_spoolss_call(p, NDR_SPOOLSS_ADDPRINTEREX);
330 }
331
332 /****************************************************************************
333 ****************************************************************************/
334
335 static bool api_spoolss_addprinterdriver(pipes_struct *p)
336 {
337         return proxy_spoolss_call(p, NDR_SPOOLSS_ADDPRINTERDRIVER);
338 }
339
340 /****************************************************************************
341 ****************************************************************************/
342
343 static bool api_spoolss_getprinterdriverdirectory(pipes_struct *p)
344 {
345         return proxy_spoolss_call(p, NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY);
346 }
347
348 /****************************************************************************
349 ****************************************************************************/
350
351 static bool api_spoolss_enumprinterdata(pipes_struct *p)
352 {
353         return proxy_spoolss_call(p, NDR_SPOOLSS_ENUMPRINTERDATA);
354 }
355
356 /****************************************************************************
357 ****************************************************************************/
358
359 static bool api_spoolss_setprinterdata(pipes_struct *p)
360 {
361         return proxy_spoolss_call(p, NDR_SPOOLSS_SETPRINTERDATA);
362 }
363
364 /****************************************************************************
365 ****************************************************************************/
366 static bool api_spoolss_reset_printer(pipes_struct *p)
367 {
368         return proxy_spoolss_call(p, NDR_SPOOLSS_RESETPRINTER);
369 }
370
371 /****************************************************************************
372 ****************************************************************************/
373 static bool api_spoolss_addform(pipes_struct *p)
374 {
375         return proxy_spoolss_call(p, NDR_SPOOLSS_ADDFORM);
376 }
377
378 /****************************************************************************
379 ****************************************************************************/
380
381 static bool api_spoolss_deleteform(pipes_struct *p)
382 {
383         return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEFORM);
384 }
385
386 /****************************************************************************
387 ****************************************************************************/
388
389 static bool api_spoolss_setform(pipes_struct *p)
390 {
391         return proxy_spoolss_call(p, NDR_SPOOLSS_SETFORM);
392 }
393
394 /****************************************************************************
395 ****************************************************************************/
396
397 static bool api_spoolss_enumprintprocessors(pipes_struct *p)
398 {
399         return proxy_spoolss_call(p, NDR_SPOOLSS_ENUMPRINTPROCESSORS);
400 }
401
402 /****************************************************************************
403 ****************************************************************************/
404
405 static bool api_spoolss_addprintprocessor(pipes_struct *p)
406 {
407         return proxy_spoolss_call(p, NDR_SPOOLSS_ADDPRINTPROCESSOR);
408 }
409
410 /****************************************************************************
411 ****************************************************************************/
412
413 static bool api_spoolss_enumprintprocdatatypes(pipes_struct *p)
414 {
415         return proxy_spoolss_call(p, NDR_SPOOLSS_ENUMPRINTPROCDATATYPES);
416 }
417
418 /****************************************************************************
419 ****************************************************************************/
420
421 static bool api_spoolss_enumprintmonitors(pipes_struct *p)
422 {
423         return proxy_spoolss_call(p, NDR_SPOOLSS_ENUMMONITORS);
424 }
425
426 /****************************************************************************
427 ****************************************************************************/
428
429 static bool api_spoolss_getjob(pipes_struct *p)
430 {
431         return proxy_spoolss_call(p, NDR_SPOOLSS_GETJOB);
432 }
433
434 /********************************************************************
435  * api_spoolss_getprinterdataex
436  *
437  * called from the spoolss dispatcher
438  ********************************************************************/
439
440 static bool api_spoolss_getprinterdataex(pipes_struct *p)
441 {
442         return proxy_spoolss_call(p, NDR_SPOOLSS_GETPRINTERDATAEX);
443 }
444
445 /****************************************************************************
446 ****************************************************************************/
447
448 static bool api_spoolss_setprinterdataex(pipes_struct *p)
449 {
450         return proxy_spoolss_call(p, NDR_SPOOLSS_SETPRINTERDATAEX);
451 }
452
453
454 /****************************************************************************
455 ****************************************************************************/
456
457 static bool api_spoolss_enumprinterkey(pipes_struct *p)
458 {
459         return proxy_spoolss_call(p, NDR_SPOOLSS_ENUMPRINTERKEY);
460 }
461
462 /****************************************************************************
463 ****************************************************************************/
464
465 static bool api_spoolss_enumprinterdataex(pipes_struct *p)
466 {
467         SPOOL_Q_ENUMPRINTERDATAEX q_u;
468         SPOOL_R_ENUMPRINTERDATAEX r_u;
469         prs_struct *data = &p->in_data.data;
470         prs_struct *rdata = &p->out_data.rdata;
471         
472         ZERO_STRUCT(q_u);
473         ZERO_STRUCT(r_u);
474         
475         if(!spoolss_io_q_enumprinterdataex("", &q_u, data, 0)) {
476                 DEBUG(0,("spoolss_io_q_enumprinterdataex: unable to unmarshall SPOOL_Q_ENUMPRINTERDATAEX.\n"));
477                 return False;
478         }
479         
480         r_u.status = _spoolss_enumprinterdataex(p, &q_u, &r_u);
481                                 
482         if(!spoolss_io_r_enumprinterdataex("", &r_u, rdata, 0)) {
483                 DEBUG(0,("spoolss_io_r_enumprinterdataex: unable to marshall SPOOL_R_ENUMPRINTERDATAEX.\n"));
484                 return False;
485         }
486
487         return True;
488 }
489
490 /****************************************************************************
491 ****************************************************************************/
492
493 static bool api_spoolss_getprintprocessordirectory(pipes_struct *p)
494 {
495         return proxy_spoolss_call(p, NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY);
496 }
497
498 /****************************************************************************
499 ****************************************************************************/
500
501 static bool api_spoolss_deleteprinterdataex(pipes_struct *p)
502 {
503         return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERDATAEX);
504 }
505
506 /****************************************************************************
507 ****************************************************************************/
508
509 static bool api_spoolss_deleteprinterkey(pipes_struct *p)
510 {
511         return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERKEY);
512 }
513
514 /****************************************************************************
515 ****************************************************************************/
516
517 static bool api_spoolss_addprinterdriverex(pipes_struct *p)
518 {
519         return proxy_spoolss_call(p, NDR_SPOOLSS_ADDPRINTERDRIVEREX);
520 }
521
522 /****************************************************************************
523 ****************************************************************************/
524
525 static bool api_spoolss_deleteprinterdriverex(pipes_struct *p)
526 {
527         return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERDRIVEREX);
528 }
529
530 /****************************************************************************
531 ****************************************************************************/
532
533 static bool api_spoolss_xcvdataport(pipes_struct *p)
534 {
535         return proxy_spoolss_call(p, NDR_SPOOLSS_XCVDATA);
536 }
537
538 /*******************************************************************
539 \pipe\spoolss commands
540 ********************************************************************/
541
542   struct api_struct api_spoolss_cmds[] = 
543     {
544  {"SPOOLSS_OPENPRINTER",               SPOOLSS_OPENPRINTER,               api_spoolss_open_printer              },
545  {"SPOOLSS_OPENPRINTEREX",             SPOOLSS_OPENPRINTEREX,             api_spoolss_open_printer_ex           },
546  {"SPOOLSS_GETPRINTERDATA",            SPOOLSS_GETPRINTERDATA,            api_spoolss_getprinterdata            },
547  {"SPOOLSS_CLOSEPRINTER",              SPOOLSS_CLOSEPRINTER,              api_spoolss_closeprinter              },
548  {"SPOOLSS_DELETEPRINTER",             SPOOLSS_DELETEPRINTER,             api_spoolss_deleteprinter             },
549  {"SPOOLSS_ABORTPRINTER",              SPOOLSS_ABORTPRINTER,              api_spoolss_abortprinter              },
550  {"SPOOLSS_RFFPCNEX",                  SPOOLSS_RFFPCNEX,                  api_spoolss_rffpcnex                  },
551  {"SPOOLSS_RFNPCNEX",                  SPOOLSS_RFNPCNEX,                  api_spoolss_rfnpcnex                  },
552  {"SPOOLSS_ENUMPRINTERS",              SPOOLSS_ENUMPRINTERS,              api_spoolss_enumprinters              },
553  {"SPOOLSS_GETPRINTER",                SPOOLSS_GETPRINTER,                api_spoolss_getprinter                },
554  {"SPOOLSS_GETPRINTERDRIVER2",         SPOOLSS_GETPRINTERDRIVER2,         api_spoolss_getprinterdriver2         }, 
555  {"SPOOLSS_STARTPAGEPRINTER",          SPOOLSS_STARTPAGEPRINTER,          api_spoolss_startpageprinter          },
556  {"SPOOLSS_ENDPAGEPRINTER",            SPOOLSS_ENDPAGEPRINTER,            api_spoolss_endpageprinter            }, 
557  {"SPOOLSS_STARTDOCPRINTER",           SPOOLSS_STARTDOCPRINTER,           api_spoolss_startdocprinter           },
558  {"SPOOLSS_ENDDOCPRINTER",             SPOOLSS_ENDDOCPRINTER,             api_spoolss_enddocprinter             },
559  {"SPOOLSS_WRITEPRINTER",              SPOOLSS_WRITEPRINTER,              api_spoolss_writeprinter              },
560  {"SPOOLSS_SETPRINTER",                SPOOLSS_SETPRINTER,                api_spoolss_setprinter                },
561  {"SPOOLSS_FCPN",                      SPOOLSS_FCPN,                      api_spoolss_fcpn                      },
562  {"SPOOLSS_ADDJOB",                    SPOOLSS_ADDJOB,                    api_spoolss_addjob                    },
563  {"SPOOLSS_ENUMJOBS",                  SPOOLSS_ENUMJOBS,                  api_spoolss_enumjobs                  },
564  {"SPOOLSS_SCHEDULEJOB",               SPOOLSS_SCHEDULEJOB,               api_spoolss_schedulejob               },
565  {"SPOOLSS_SETJOB",                    SPOOLSS_SETJOB,                    api_spoolss_setjob                    },
566  {"SPOOLSS_ENUMFORMS",                 SPOOLSS_ENUMFORMS,                 api_spoolss_enumforms                 },
567  {"SPOOLSS_ENUMPORTS",                 SPOOLSS_ENUMPORTS,                 api_spoolss_enumports                 },
568  {"SPOOLSS_ENUMPRINTERDRIVERS",        SPOOLSS_ENUMPRINTERDRIVERS,        api_spoolss_enumprinterdrivers        },
569  {"SPOOLSS_ADDPRINTEREX",              SPOOLSS_ADDPRINTEREX,              api_spoolss_addprinterex              },
570  {"SPOOLSS_ADDPRINTERDRIVER",          SPOOLSS_ADDPRINTERDRIVER,          api_spoolss_addprinterdriver          },
571  {"SPOOLSS_DELETEPRINTERDRIVER",       SPOOLSS_DELETEPRINTERDRIVER,       api_spoolss_deleteprinterdriver       },
572  {"SPOOLSS_GETPRINTERDRIVERDIRECTORY", SPOOLSS_GETPRINTERDRIVERDIRECTORY, api_spoolss_getprinterdriverdirectory },
573  {"SPOOLSS_ENUMPRINTERDATA",           SPOOLSS_ENUMPRINTERDATA,           api_spoolss_enumprinterdata           },
574  {"SPOOLSS_SETPRINTERDATA",            SPOOLSS_SETPRINTERDATA,            api_spoolss_setprinterdata            },
575  {"SPOOLSS_RESETPRINTER",              SPOOLSS_RESETPRINTER,              api_spoolss_reset_printer             },
576  {"SPOOLSS_DELETEPRINTERDATA",         SPOOLSS_DELETEPRINTERDATA,         api_spoolss_deleteprinterdata         },
577  {"SPOOLSS_ADDFORM",                   SPOOLSS_ADDFORM,                   api_spoolss_addform                   },
578  {"SPOOLSS_DELETEFORM",                SPOOLSS_DELETEFORM,                api_spoolss_deleteform                },
579  {"SPOOLSS_GETFORM",                   SPOOLSS_GETFORM,                   api_spoolss_getform                   },
580  {"SPOOLSS_SETFORM",                   SPOOLSS_SETFORM,                   api_spoolss_setform                   },
581  {"SPOOLSS_ADDPRINTPROCESSOR",         SPOOLSS_ADDPRINTPROCESSOR,         api_spoolss_addprintprocessor         },
582  {"SPOOLSS_ENUMPRINTPROCESSORS",       SPOOLSS_ENUMPRINTPROCESSORS,       api_spoolss_enumprintprocessors       },
583  {"SPOOLSS_ENUMMONITORS",              SPOOLSS_ENUMMONITORS,              api_spoolss_enumprintmonitors         },
584  {"SPOOLSS_GETJOB",                    SPOOLSS_GETJOB,                    api_spoolss_getjob                    },
585  {"SPOOLSS_ENUMPRINTPROCDATATYPES",    SPOOLSS_ENUMPRINTPROCDATATYPES,    api_spoolss_enumprintprocdatatypes    },
586  {"SPOOLSS_GETPRINTERDATAEX",          SPOOLSS_GETPRINTERDATAEX,          api_spoolss_getprinterdataex          },
587  {"SPOOLSS_SETPRINTERDATAEX",          SPOOLSS_SETPRINTERDATAEX,          api_spoolss_setprinterdataex          },
588  {"SPOOLSS_DELETEPRINTERDATAEX",       SPOOLSS_DELETEPRINTERDATAEX,       api_spoolss_deleteprinterdataex       },
589  {"SPOOLSS_ENUMPRINTERDATAEX",         SPOOLSS_ENUMPRINTERDATAEX,         api_spoolss_enumprinterdataex         },
590  {"SPOOLSS_ENUMPRINTERKEY",            SPOOLSS_ENUMPRINTERKEY,            api_spoolss_enumprinterkey            },
591  {"SPOOLSS_DELETEPRINTERKEY",          SPOOLSS_DELETEPRINTERKEY,          api_spoolss_deleteprinterkey          },
592  {"SPOOLSS_GETPRINTPROCESSORDIRECTORY",SPOOLSS_GETPRINTPROCESSORDIRECTORY,api_spoolss_getprintprocessordirectory},
593  {"SPOOLSS_ADDPRINTERDRIVEREX",        SPOOLSS_ADDPRINTERDRIVEREX,        api_spoolss_addprinterdriverex        },
594  {"SPOOLSS_DELETEPRINTERDRIVEREX",     SPOOLSS_DELETEPRINTERDRIVEREX,     api_spoolss_deleteprinterdriverex     },
595  {"SPOOLSS_XCVDATAPORT",               SPOOLSS_XCVDATAPORT,               api_spoolss_xcvdataport               },
596 };
597
598 void spoolss2_get_pipe_fns( struct api_struct **fns, int *n_fns )
599 {
600         *fns = api_spoolss_cmds;
601         *n_fns = sizeof(api_spoolss_cmds) / sizeof(struct api_struct);
602 }
603
604 NTSTATUS rpc_spoolss2_init(void)
605 {
606         return rpc_srv_register(
607                 SMB_RPC_INTERFACE_VERSION, "spoolss", "spoolss",
608                 &ndr_table_spoolss,
609                 api_spoolss_cmds,
610                 sizeof(api_spoolss_cmds) / sizeof(struct api_struct));
611 }