6c65cb078b8e65c8cc4ac8f09f3e955eba1f1b3e
[kai/samba.git] / source3 / rpc_server / srv_spoolss.c
1 /* 
2  *  Unix SMB/Netbios implementation.
3  *  Version 1.9.
4  *  RPC Pipe client / server routines
5  *  Copyright (C) Andrew Tridgell              1992-2000,
6  *  Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
7  *  Copyright (C) Jean François Micouleau      1998-2000.
8  *  Copyright (C) Jeremy Allison                                        2001.
9  *  
10  *  This program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 2 of the License, or
13  *  (at your option) any later version.
14  *  
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU General Public License for more details.
19  *  
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, write to the Free Software
22  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  */
24
25 #include "includes.h"
26
27 extern int DEBUGLEVEL;
28
29 /********************************************************************
30  * api_spoolss_open_printer_ex
31  ********************************************************************/
32
33 static BOOL api_spoolss_open_printer_ex(pipes_struct *p)
34 {
35         SPOOL_Q_OPEN_PRINTER_EX q_u;
36         SPOOL_R_OPEN_PRINTER_EX r_u;
37         prs_struct *data = &p->in_data.data;
38         prs_struct *rdata = &p->out_data.rdata;
39
40         ZERO_STRUCT(q_u);
41         ZERO_STRUCT(r_u);
42
43         if (!spoolss_io_q_open_printer_ex("", &q_u, data, 0)) {
44                 DEBUG(0,("spoolss_io_q_open_printer_ex: unable to unmarshall SPOOL_Q_OPEN_PRINTER_EX.\n"));
45                 return False;
46         }
47
48         r_u.status = _spoolss_open_printer_ex( p, &q_u, &r_u);
49
50         if (!spoolss_io_r_open_printer_ex("",&r_u,rdata,0)){
51                 DEBUG(0,("spoolss_io_r_open_printer_ex: unable to marshall SPOOL_R_OPEN_PRINTER_EX.\n"));
52                 return False;
53         }
54
55         return True;
56 }
57
58 /********************************************************************
59  * api_spoolss_getprinterdata
60  *
61  * called from the spoolss dispatcher
62  ********************************************************************/
63
64 static BOOL api_spoolss_getprinterdata(pipes_struct *p)
65 {
66         SPOOL_Q_GETPRINTERDATA q_u;
67         SPOOL_R_GETPRINTERDATA r_u;
68         prs_struct *data = &p->in_data.data;
69         prs_struct *rdata = &p->out_data.rdata;
70
71         ZERO_STRUCT(q_u);
72         ZERO_STRUCT(r_u);
73
74         /* read the stream and fill the struct */
75         if (!spoolss_io_q_getprinterdata("", &q_u, data, 0)) {
76                 DEBUG(0,("spoolss_io_q_getprinterdata: unable to unmarshall SPOOL_Q_GETPRINTERDATA.\n"));
77                 return False;
78         }
79         
80         r_u.status = _spoolss_getprinterdata( p, &q_u, &r_u);
81
82         if (!spoolss_io_r_getprinterdata("", &r_u, rdata, 0)) {
83                 DEBUG(0,("spoolss_io_r_getprinterdata: unable to marshall SPOOL_R_GETPRINTERDATA.\n"));
84                 return False;
85         }
86
87         return True;
88 }
89
90 /********************************************************************
91  * api_spoolss_deleteprinterdata
92  *
93  * called from the spoolss dispatcher
94  ********************************************************************/
95
96 static BOOL api_spoolss_deleteprinterdata(pipes_struct *p)
97 {
98         SPOOL_Q_DELETEPRINTERDATA q_u;
99         SPOOL_R_DELETEPRINTERDATA r_u;
100         prs_struct *data = &p->in_data.data;
101         prs_struct *rdata = &p->out_data.rdata;
102
103         ZERO_STRUCT(q_u);
104         ZERO_STRUCT(r_u);
105
106         /* read the stream and fill the struct */
107         if (!spoolss_io_q_deleteprinterdata("", &q_u, data, 0)) {
108                 DEBUG(0,("spoolss_io_q_deleteprinterdata: unable to unmarshall SPOOL_Q_DELETEPRINTERDATA.\n"));
109                 return False;
110         }
111         
112         r_u.status = _spoolss_deleteprinterdata( p, &q_u, &r_u);
113
114         if (!spoolss_io_r_deleteprinterdata("", &r_u, rdata, 0)) {
115                 DEBUG(0,("spoolss_io_r_deleteprinterdata: unable to marshall SPOOL_R_DELETEPRINTERDATA.\n"));
116                 return False;
117         }
118
119         return True;
120 }
121
122 /********************************************************************
123  * api_spoolss_closeprinter
124  *
125  * called from the spoolss dispatcher
126  ********************************************************************/
127
128 static BOOL api_spoolss_closeprinter(pipes_struct *p)
129 {
130         SPOOL_Q_CLOSEPRINTER q_u;
131         SPOOL_R_CLOSEPRINTER r_u;
132         prs_struct *data = &p->in_data.data;
133         prs_struct *rdata = &p->out_data.rdata;
134
135         ZERO_STRUCT(q_u);
136         ZERO_STRUCT(r_u);
137
138         if (!spoolss_io_q_closeprinter("", &q_u, data, 0)) {
139                 DEBUG(0,("spoolss_io_q_closeprinter: unable to unmarshall SPOOL_Q_CLOSEPRINTER.\n"));
140                 return False;
141         }
142
143         r_u.status = _spoolss_closeprinter(p, &q_u, &r_u);
144
145         if (!spoolss_io_r_closeprinter("",&r_u,rdata,0)) {
146                 DEBUG(0,("spoolss_io_r_closeprinter: unable to marshall SPOOL_R_CLOSEPRINTER.\n"));
147                 return False;
148         }
149
150         return True;
151 }
152
153 /********************************************************************
154  * api_spoolss_abortprinter
155  *
156  * called from the spoolss dispatcher
157  ********************************************************************/
158
159 static BOOL api_spoolss_abortprinter(pipes_struct *p)
160 {
161         SPOOL_Q_ABORTPRINTER q_u;
162         SPOOL_R_ABORTPRINTER r_u;
163         prs_struct *data = &p->in_data.data;
164         prs_struct *rdata = &p->out_data.rdata;
165
166         ZERO_STRUCT(q_u);
167         ZERO_STRUCT(r_u);
168
169         if (!spoolss_io_q_abortprinter("", &q_u, data, 0)) {
170                 DEBUG(0,("spoolss_io_q_abortprinter: unable to unmarshall SPOOL_Q_ABORTPRINTER.\n"));
171                 return False;
172         }
173
174         r_u.status = _spoolss_abortprinter(p, &q_u, &r_u);
175
176         if (!spoolss_io_r_abortprinter("",&r_u,rdata,0)) {
177                 DEBUG(0,("spoolss_io_r_abortprinter: unable to marshall SPOOL_R_ABORTPRINTER.\n"));
178                 return False;
179         }
180
181         return True;
182 }
183
184 /********************************************************************
185  * api_spoolss_deleteprinter
186  *
187  * called from the spoolss dispatcher
188  ********************************************************************/
189
190 static BOOL api_spoolss_deleteprinter(pipes_struct *p)
191 {
192         SPOOL_Q_DELETEPRINTER q_u;
193         SPOOL_R_DELETEPRINTER r_u;
194         prs_struct *data = &p->in_data.data;
195         prs_struct *rdata = &p->out_data.rdata;
196
197         ZERO_STRUCT(q_u);
198         ZERO_STRUCT(r_u);
199
200         if (!spoolss_io_q_deleteprinter("", &q_u, data, 0)) {
201                 DEBUG(0,("spoolss_io_q_deleteprinter: unable to unmarshall SPOOL_Q_DELETEPRINTER.\n"));
202                 return False;
203         }
204
205         r_u.status = _spoolss_deleteprinter(p, &q_u, &r_u);
206
207         if (!spoolss_io_r_deleteprinter("",&r_u,rdata,0)) {
208                 DEBUG(0,("spoolss_io_r_deleteprinter: unable to marshall SPOOL_R_DELETEPRINTER.\n"));
209                 return False;
210         }
211
212         return True;
213 }
214
215
216 /********************************************************************
217  * api_spoolss_deleteprinterdriver
218  *
219  * called from the spoolss dispatcher
220  ********************************************************************/
221
222 static BOOL api_spoolss_deleteprinterdriver(pipes_struct *p)
223 {
224         SPOOL_Q_DELETEPRINTERDRIVER q_u;
225         SPOOL_R_DELETEPRINTERDRIVER r_u;
226         prs_struct *data = &p->in_data.data;
227         prs_struct *rdata = &p->out_data.rdata;
228
229         ZERO_STRUCT(q_u);
230         ZERO_STRUCT(r_u);
231
232         if (!spoolss_io_q_deleteprinterdriver("", &q_u, data, 0)) {
233                 DEBUG(0,("spoolss_io_q_deleteprinterdriver: unable to unmarshall SPOOL_Q_DELETEPRINTERDRIVER.\n"));
234                 return False;
235         }
236
237         r_u.status = _spoolss_deleteprinterdriver(p, &q_u, &r_u);
238
239         if (!spoolss_io_r_deleteprinterdriver("",&r_u,rdata,0)) {
240                 DEBUG(0,("spoolss_io_r_deleteprinter: unable to marshall SPOOL_R_DELETEPRINTER.\n"));
241                 return False;
242         }
243
244         return True;
245 }
246
247
248 /********************************************************************
249  * api_spoolss_rffpcnex
250  * ReplyFindFirstPrinterChangeNotifyEx
251  ********************************************************************/
252
253 static BOOL api_spoolss_rffpcnex(pipes_struct *p)
254 {
255         SPOOL_Q_RFFPCNEX q_u;
256         SPOOL_R_RFFPCNEX r_u;
257         prs_struct *data = &p->in_data.data;
258         prs_struct *rdata = &p->out_data.rdata;
259
260         ZERO_STRUCT(q_u);
261         ZERO_STRUCT(r_u);
262
263         if (!spoolss_io_q_rffpcnex("", &q_u, data, 0)) {
264                 DEBUG(0,("spoolss_io_q_rffpcnex: unable to unmarshall SPOOL_Q_RFFPCNEX.\n"));
265                 return False;
266         }
267
268         r_u.status = _spoolss_rffpcnex(p, &q_u, &r_u);
269
270         if (!spoolss_io_r_rffpcnex("", &r_u, rdata, 0)) {
271                 DEBUG(0,("spoolss_io_r_rffpcnex: unable to marshall SPOOL_R_RFFPCNEX.\n"));
272                 return False;
273         }
274
275         return True;
276 }
277
278
279 /********************************************************************
280  * api_spoolss_rfnpcnex
281  * ReplyFindNextPrinterChangeNotifyEx
282  * called from the spoolss dispatcher
283
284  * Note - this is the *ONLY* function that breaks the RPC call
285  * symmetry in all the other calls. We need to do this to fix
286  * the massive memory allocation problem with thousands of jobs...
287  * JRA.
288  ********************************************************************/
289
290 static BOOL api_spoolss_rfnpcnex(pipes_struct *p)
291 {
292         SPOOL_Q_RFNPCNEX q_u;
293         SPOOL_R_RFNPCNEX r_u;
294         prs_struct *data = &p->in_data.data;
295         prs_struct *rdata = &p->out_data.rdata;
296
297         ZERO_STRUCT(q_u);
298         ZERO_STRUCT(r_u);
299
300         if (!spoolss_io_q_rfnpcnex("", &q_u, data, 0)) {
301                 DEBUG(0,("spoolss_io_q_rfnpcnex: unable to unmarshall SPOOL_Q_RFNPCNEX.\n"));
302                 return False;
303         }
304
305         r_u.status = _spoolss_rfnpcnex(p, &q_u, &r_u);
306
307         if (!spoolss_io_r_rfnpcnex("", &r_u, rdata, 0)) {
308                 SAFE_FREE(r_u.info.data);
309                 DEBUG(0,("spoolss_io_r_rfnpcnex: unable to marshall SPOOL_R_RFNPCNEX.\n"));
310                 return False;
311         }
312
313         SAFE_FREE(r_u.info.data);
314
315         return True;
316 }
317
318
319 /********************************************************************
320  * api_spoolss_enumprinters
321  * called from the spoolss dispatcher
322  *
323  ********************************************************************/
324
325 static BOOL api_spoolss_enumprinters(pipes_struct *p)
326 {
327         SPOOL_Q_ENUMPRINTERS q_u;
328         SPOOL_R_ENUMPRINTERS r_u;
329         prs_struct *data = &p->in_data.data;
330         prs_struct *rdata = &p->out_data.rdata;
331
332         ZERO_STRUCT(q_u);
333         ZERO_STRUCT(r_u);
334
335         if (!spoolss_io_q_enumprinters("", &q_u, data, 0)) {
336                 DEBUG(0,("spoolss_io_q_enumprinters: unable to unmarshall SPOOL_Q_ENUMPRINTERS.\n"));
337                 return False;
338         }
339
340         r_u.status = _spoolss_enumprinters( p, &q_u, &r_u);
341
342         if (!spoolss_io_r_enumprinters("", &r_u, rdata, 0)) {
343                 DEBUG(0,("spoolss_io_r_enumprinters: unable to marshall SPOOL_R_ENUMPRINTERS.\n"));
344                 return False;
345         }
346
347         return True;
348 }
349
350 /********************************************************************
351  * api_spoolss_getprinter
352  * called from the spoolss dispatcher
353  *
354  ********************************************************************/
355
356 static BOOL api_spoolss_getprinter(pipes_struct *p)
357 {
358         SPOOL_Q_GETPRINTER q_u;
359         SPOOL_R_GETPRINTER r_u;
360         prs_struct *data = &p->in_data.data;
361         prs_struct *rdata = &p->out_data.rdata;
362
363         ZERO_STRUCT(q_u);
364         ZERO_STRUCT(r_u);
365
366         if(!spoolss_io_q_getprinter("", &q_u, data, 0)) {
367                 DEBUG(0,("spoolss_io_q_getprinter: unable to unmarshall SPOOL_Q_GETPRINTER.\n"));
368                 return False;
369         }
370
371         r_u.status = _spoolss_getprinter(p, &q_u, &r_u);
372
373         if(!spoolss_io_r_getprinter("",&r_u,rdata,0)) {
374                 DEBUG(0,("spoolss_io_r_getprinter: unable to marshall SPOOL_R_GETPRINTER.\n"));
375                 return False;
376         }
377
378         return True;
379 }
380
381 /********************************************************************
382  * api_spoolss_getprinter
383  * called from the spoolss dispatcher
384  *
385  ********************************************************************/
386
387 static BOOL api_spoolss_getprinterdriver2(pipes_struct *p)
388 {
389         SPOOL_Q_GETPRINTERDRIVER2 q_u;
390         SPOOL_R_GETPRINTERDRIVER2 r_u;
391         prs_struct *data = &p->in_data.data;
392         prs_struct *rdata = &p->out_data.rdata;
393
394         ZERO_STRUCT(q_u);
395         ZERO_STRUCT(r_u);
396
397         if(!spoolss_io_q_getprinterdriver2("", &q_u, data, 0)) {
398                 DEBUG(0,("spoolss_io_q_getprinterdriver2: unable to unmarshall SPOOL_Q_GETPRINTERDRIVER2.\n"));
399                 return False;
400         }
401
402         r_u.status = _spoolss_getprinterdriver2(p, &q_u, &r_u);
403         
404         if(!spoolss_io_r_getprinterdriver2("",&r_u,rdata,0)) {
405                 DEBUG(0,("spoolss_io_r_getprinterdriver2: unable to marshall SPOOL_R_GETPRINTERDRIVER2.\n"));
406                 return False;
407         }
408         
409         return True;
410 }
411
412 /********************************************************************
413  * api_spoolss_getprinter
414  * called from the spoolss dispatcher
415  *
416  ********************************************************************/
417
418 static BOOL api_spoolss_startpageprinter(pipes_struct *p)
419 {
420         SPOOL_Q_STARTPAGEPRINTER q_u;
421         SPOOL_R_STARTPAGEPRINTER r_u;
422         prs_struct *data = &p->in_data.data;
423         prs_struct *rdata = &p->out_data.rdata;
424
425         ZERO_STRUCT(q_u);
426         ZERO_STRUCT(r_u);
427
428         if(!spoolss_io_q_startpageprinter("", &q_u, data, 0)) {
429                 DEBUG(0,("spoolss_io_q_startpageprinter: unable to unmarshall SPOOL_Q_STARTPAGEPRINTER.\n"));
430                 return False;
431         }
432
433         r_u.status = _spoolss_startpageprinter(p, &q_u, &r_u);
434
435         if(!spoolss_io_r_startpageprinter("",&r_u,rdata,0)) {
436                 DEBUG(0,("spoolss_io_r_startpageprinter: unable to marshall SPOOL_R_STARTPAGEPRINTER.\n"));
437                 return False;
438         }
439
440         return True;
441 }
442
443 /********************************************************************
444  * api_spoolss_getprinter
445  * called from the spoolss dispatcher
446  *
447  ********************************************************************/
448
449 static BOOL api_spoolss_endpageprinter(pipes_struct *p)
450 {
451         SPOOL_Q_ENDPAGEPRINTER q_u;
452         SPOOL_R_ENDPAGEPRINTER r_u;
453         prs_struct *data = &p->in_data.data;
454         prs_struct *rdata = &p->out_data.rdata;
455
456         ZERO_STRUCT(q_u);
457         ZERO_STRUCT(r_u);
458
459         if(!spoolss_io_q_endpageprinter("", &q_u, data, 0)) {
460                 DEBUG(0,("spoolss_io_q_endpageprinter: unable to unmarshall SPOOL_Q_ENDPAGEPRINTER.\n"));
461                 return False;
462         }
463
464         r_u.status = _spoolss_endpageprinter(p, &q_u, &r_u);
465
466         if(!spoolss_io_r_endpageprinter("",&r_u,rdata,0)) {
467                 DEBUG(0,("spoolss_io_r_endpageprinter: unable to marshall SPOOL_R_ENDPAGEPRINTER.\n"));
468                 return False;
469         }
470
471         return True;
472 }
473
474 /********************************************************************
475 ********************************************************************/
476
477 static BOOL api_spoolss_startdocprinter(pipes_struct *p)
478 {
479         SPOOL_Q_STARTDOCPRINTER q_u;
480         SPOOL_R_STARTDOCPRINTER r_u;
481         prs_struct *data = &p->in_data.data;
482         prs_struct *rdata = &p->out_data.rdata;
483
484         ZERO_STRUCT(q_u);
485         ZERO_STRUCT(r_u);
486
487         if(!spoolss_io_q_startdocprinter("", &q_u, data, 0)) {
488                 DEBUG(0,("spoolss_io_q_startdocprinter: unable to unmarshall SPOOL_Q_STARTDOCPRINTER.\n"));
489                 return False;
490         }
491
492         r_u.status = _spoolss_startdocprinter(p, &q_u, &r_u);
493
494         if(!spoolss_io_r_startdocprinter("",&r_u,rdata,0)) {
495                 DEBUG(0,("spoolss_io_r_startdocprinter: unable to marshall SPOOL_R_STARTDOCPRINTER.\n"));
496                 return False;
497         }
498
499         return True;
500 }
501
502 /********************************************************************
503 ********************************************************************/
504
505 static BOOL api_spoolss_enddocprinter(pipes_struct *p)
506 {
507         SPOOL_Q_ENDDOCPRINTER q_u;
508         SPOOL_R_ENDDOCPRINTER r_u;
509         prs_struct *data = &p->in_data.data;
510         prs_struct *rdata = &p->out_data.rdata;
511
512         ZERO_STRUCT(q_u);
513         ZERO_STRUCT(r_u);
514
515         if(!spoolss_io_q_enddocprinter("", &q_u, data, 0)) {
516                 DEBUG(0,("spoolss_io_q_enddocprinter: unable to unmarshall SPOOL_Q_ENDDOCPRINTER.\n"));
517                 return False;
518         }
519
520         r_u.status = _spoolss_enddocprinter(p, &q_u, &r_u);
521
522         if(!spoolss_io_r_enddocprinter("",&r_u,rdata,0)) {
523                 DEBUG(0,("spoolss_io_r_enddocprinter: unable to marshall SPOOL_R_ENDDOCPRINTER.\n"));
524                 return False;
525         }
526
527         return True;            
528 }
529
530 /********************************************************************
531 ********************************************************************/
532
533 static BOOL api_spoolss_writeprinter(pipes_struct *p)
534 {
535         SPOOL_Q_WRITEPRINTER q_u;
536         SPOOL_R_WRITEPRINTER r_u;
537         prs_struct *data = &p->in_data.data;
538         prs_struct *rdata = &p->out_data.rdata;
539
540         ZERO_STRUCT(q_u);
541         ZERO_STRUCT(r_u);
542
543         if(!spoolss_io_q_writeprinter("", &q_u, data, 0)) {
544                 DEBUG(0,("spoolss_io_q_writeprinter: unable to unmarshall SPOOL_Q_WRITEPRINTER.\n"));
545                 return False;
546         }
547
548         r_u.status = _spoolss_writeprinter(p, &q_u, &r_u);
549
550         if(!spoolss_io_r_writeprinter("",&r_u,rdata,0)) {
551                 DEBUG(0,("spoolss_io_r_writeprinter: unable to marshall SPOOL_R_WRITEPRINTER.\n"));
552                 return False;
553         }
554
555         return True;
556 }
557
558 /****************************************************************************
559
560 ****************************************************************************/
561
562 static BOOL api_spoolss_setprinter(pipes_struct *p)
563 {
564         SPOOL_Q_SETPRINTER q_u;
565         SPOOL_R_SETPRINTER r_u;
566         prs_struct *data = &p->in_data.data;
567         prs_struct *rdata = &p->out_data.rdata;
568
569         ZERO_STRUCT(q_u);
570         ZERO_STRUCT(r_u);
571
572         if(!spoolss_io_q_setprinter("", &q_u, data, 0)) {
573                 DEBUG(0,("spoolss_io_q_setprinter: unable to unmarshall SPOOL_Q_SETPRINTER.\n"));
574                 return False;
575         }
576         
577         r_u.status = _spoolss_setprinter(p, &q_u, &r_u);
578         
579         if(!spoolss_io_r_setprinter("",&r_u,rdata,0)) {
580                 DEBUG(0,("spoolss_io_r_setprinter: unable to marshall SPOOL_R_SETPRINTER.\n"));
581                 return False;
582         }
583
584         return True;
585 }
586
587 /****************************************************************************
588 ****************************************************************************/
589
590 static BOOL api_spoolss_fcpn(pipes_struct *p)
591 {
592         SPOOL_Q_FCPN q_u;
593         SPOOL_R_FCPN r_u;
594         prs_struct *data = &p->in_data.data;
595         prs_struct *rdata = &p->out_data.rdata;
596
597         ZERO_STRUCT(q_u);
598         ZERO_STRUCT(r_u);
599
600         if(!spoolss_io_q_fcpn("", &q_u, data, 0)) {
601                 DEBUG(0,("spoolss_io_q_fcpn: unable to unmarshall SPOOL_Q_FCPN.\n"));
602                 return False;
603         }
604
605         r_u.status = _spoolss_fcpn(p, &q_u, &r_u);
606
607         if(!spoolss_io_r_fcpn("",&r_u,rdata,0)) {
608                 DEBUG(0,("spoolss_io_r_fcpn: unable to marshall SPOOL_R_FCPN.\n"));
609                 return False;
610         }
611
612         return True;
613 }
614
615 /****************************************************************************
616 ****************************************************************************/
617
618 static BOOL api_spoolss_addjob(pipes_struct *p)
619 {
620         SPOOL_Q_ADDJOB q_u;
621         SPOOL_R_ADDJOB r_u;
622         prs_struct *data = &p->in_data.data;
623         prs_struct *rdata = &p->out_data.rdata;
624
625         ZERO_STRUCT(q_u);
626         ZERO_STRUCT(r_u);
627
628         if(!spoolss_io_q_addjob("", &q_u, data, 0)) {
629                 DEBUG(0,("spoolss_io_q_addjob: unable to unmarshall SPOOL_Q_ADDJOB.\n"));
630                 return False;
631         }
632
633         r_u.status = _spoolss_addjob(p, &q_u, &r_u);
634                 
635         if(!spoolss_io_r_addjob("",&r_u,rdata,0)) {
636                 DEBUG(0,("spoolss_io_r_addjob: unable to marshall SPOOL_R_ADDJOB.\n"));
637                 return False;
638         }
639
640         return True;            
641 }
642
643 /****************************************************************************
644 ****************************************************************************/
645
646 static BOOL api_spoolss_enumjobs(pipes_struct *p)
647 {
648         SPOOL_Q_ENUMJOBS q_u;
649         SPOOL_R_ENUMJOBS r_u;
650         prs_struct *data = &p->in_data.data;
651         prs_struct *rdata = &p->out_data.rdata;
652
653         ZERO_STRUCT(q_u);
654         ZERO_STRUCT(r_u);
655
656         if (!spoolss_io_q_enumjobs("", &q_u, data, 0)) {
657                 DEBUG(0,("spoolss_io_q_enumjobs: unable to unmarshall SPOOL_Q_ENUMJOBS.\n"));
658                 return False;
659         }
660
661         r_u.status = _spoolss_enumjobs(p, &q_u, &r_u);
662
663         if (!spoolss_io_r_enumjobs("",&r_u,rdata,0)) {
664                 DEBUG(0,("spoolss_io_r_enumjobs: unable to marshall SPOOL_R_ENUMJOBS.\n"));
665                 return False;
666         }
667
668         return True;
669 }
670
671 /****************************************************************************
672 ****************************************************************************/
673
674 static BOOL api_spoolss_schedulejob(pipes_struct *p)
675 {
676         SPOOL_Q_SCHEDULEJOB q_u;
677         SPOOL_R_SCHEDULEJOB r_u;
678         prs_struct *data = &p->in_data.data;
679         prs_struct *rdata = &p->out_data.rdata;
680
681         ZERO_STRUCT(q_u);
682         ZERO_STRUCT(r_u);
683
684         if(!spoolss_io_q_schedulejob("", &q_u, data, 0)) {
685                 DEBUG(0,("spoolss_io_q_schedulejob: unable to unmarshall SPOOL_Q_SCHEDULEJOB.\n"));
686                 return False;
687         }
688
689         r_u.status = _spoolss_schedulejob(p, &q_u, &r_u);
690
691         if(!spoolss_io_r_schedulejob("",&r_u,rdata,0)) {
692                 DEBUG(0,("spoolss_io_r_schedulejob: unable to marshall SPOOL_R_SCHEDULEJOB.\n"));
693                 return False;
694         }
695
696         return True;
697 }
698
699 /****************************************************************************
700 ****************************************************************************/
701
702 static BOOL api_spoolss_setjob(pipes_struct *p)
703 {
704         SPOOL_Q_SETJOB q_u;
705         SPOOL_R_SETJOB r_u;
706         prs_struct *data = &p->in_data.data;
707         prs_struct *rdata = &p->out_data.rdata;
708
709         ZERO_STRUCT(q_u);
710         ZERO_STRUCT(r_u);
711
712         if(!spoolss_io_q_setjob("", &q_u, data, 0)) {
713                 DEBUG(0,("spoolss_io_q_setjob: unable to unmarshall SPOOL_Q_SETJOB.\n"));
714                 return False;
715         }
716
717         r_u.status = _spoolss_setjob(p, &q_u, &r_u);
718
719         if(!spoolss_io_r_setjob("",&r_u,rdata,0)) {
720                 DEBUG(0,("spoolss_io_r_setjob: unable to marshall SPOOL_R_SETJOB.\n"));
721                 return False;
722         }
723
724         return True;
725 }
726
727 /****************************************************************************
728 ****************************************************************************/
729
730 static BOOL api_spoolss_enumprinterdrivers(pipes_struct *p)
731 {
732         SPOOL_Q_ENUMPRINTERDRIVERS q_u;
733         SPOOL_R_ENUMPRINTERDRIVERS r_u;
734         prs_struct *data = &p->in_data.data;
735         prs_struct *rdata = &p->out_data.rdata;
736
737         ZERO_STRUCT(q_u);
738         ZERO_STRUCT(r_u);
739
740         if (!spoolss_io_q_enumprinterdrivers("", &q_u, data, 0)) {
741                 DEBUG(0,("spoolss_io_q_enumprinterdrivers: unable to unmarshall SPOOL_Q_ENUMPRINTERDRIVERS.\n"));
742                 return False;
743         }
744
745         r_u.status = _spoolss_enumprinterdrivers(p, &q_u, &r_u);
746
747         if (!spoolss_io_r_enumprinterdrivers("",&r_u,rdata,0)) {
748                 DEBUG(0,("spoolss_io_r_enumprinterdrivers: unable to marshall SPOOL_R_ENUMPRINTERDRIVERS.\n"));
749                 return False;
750         }
751
752         return True;
753 }
754
755 /****************************************************************************
756 ****************************************************************************/
757
758 static BOOL api_spoolss_getform(pipes_struct *p)
759 {
760         SPOOL_Q_GETFORM q_u;
761         SPOOL_R_GETFORM r_u;
762         prs_struct *data = &p->in_data.data;
763         prs_struct *rdata = &p->out_data.rdata;
764
765         ZERO_STRUCT(q_u);
766         ZERO_STRUCT(r_u);
767
768         if (!spoolss_io_q_getform("", &q_u, data, 0)) {
769                 DEBUG(0,("spoolss_io_q_getform: unable to unmarshall SPOOL_Q_GETFORM.\n"));
770                 return False;
771         }
772
773         r_u.status = _spoolss_getform(p, &q_u, &r_u);
774
775         if (!spoolss_io_r_getform("",&r_u,rdata,0)) {
776                 DEBUG(0,("spoolss_io_r_getform: unable to marshall SPOOL_R_GETFORM.\n"));
777                 return False;
778         }
779
780         return True;
781 }
782
783 /****************************************************************************
784 ****************************************************************************/
785
786 static BOOL api_spoolss_enumforms(pipes_struct *p)
787 {
788         SPOOL_Q_ENUMFORMS q_u;
789         SPOOL_R_ENUMFORMS r_u;
790         prs_struct *data = &p->in_data.data;
791         prs_struct *rdata = &p->out_data.rdata;
792
793         ZERO_STRUCT(q_u);
794         ZERO_STRUCT(r_u);
795
796         if (!spoolss_io_q_enumforms("", &q_u, data, 0)) {
797                 DEBUG(0,("spoolss_io_q_enumforms: unable to unmarshall SPOOL_Q_ENUMFORMS.\n"));
798                 return False;
799         }
800
801         r_u.status = _spoolss_enumforms(p, &q_u, &r_u);
802
803         if (!spoolss_io_r_enumforms("",&r_u,rdata,0)) {
804                 DEBUG(0,("spoolss_io_r_enumforms: unable to marshall SPOOL_R_ENUMFORMS.\n"));
805                 return False;
806         }
807
808         return True;
809 }
810
811 /****************************************************************************
812 ****************************************************************************/
813
814 static BOOL api_spoolss_enumports(pipes_struct *p)
815 {
816         SPOOL_Q_ENUMPORTS q_u;
817         SPOOL_R_ENUMPORTS r_u;
818         prs_struct *data = &p->in_data.data;
819         prs_struct *rdata = &p->out_data.rdata;
820
821         ZERO_STRUCT(q_u);
822         ZERO_STRUCT(r_u);
823
824         if(!spoolss_io_q_enumports("", &q_u, data, 0)) {
825                 DEBUG(0,("spoolss_io_q_enumports: unable to unmarshall SPOOL_Q_ENUMPORTS.\n"));
826                 return False;
827         }
828
829         r_u.status = _spoolss_enumports(p, &q_u, &r_u);
830
831         if (!spoolss_io_r_enumports("",&r_u,rdata,0)) {
832                 DEBUG(0,("spoolss_io_r_enumports: unable to marshall SPOOL_R_ENUMPORTS.\n"));
833                 return False;
834         }
835
836         return True;
837 }
838
839 /****************************************************************************
840 ****************************************************************************/
841
842 static BOOL api_spoolss_addprinterex(pipes_struct *p)
843 {
844         SPOOL_Q_ADDPRINTEREX q_u;
845         SPOOL_R_ADDPRINTEREX r_u;
846         prs_struct *data = &p->in_data.data;
847         prs_struct *rdata = &p->out_data.rdata;
848         
849         ZERO_STRUCT(q_u);
850         ZERO_STRUCT(r_u);
851         
852         if(!spoolss_io_q_addprinterex("", &q_u, data, 0)) {
853                 DEBUG(0,("spoolss_io_q_addprinterex: unable to unmarshall SPOOL_Q_ADDPRINTEREX.\n"));
854                 return False;
855         }
856         
857         r_u.status = _spoolss_addprinterex(p, &q_u, &r_u);
858                                 
859         if(!spoolss_io_r_addprinterex("", &r_u, rdata, 0)) {
860                 DEBUG(0,("spoolss_io_r_addprinterex: unable to marshall SPOOL_R_ADDPRINTEREX.\n"));
861                 return False;
862         }
863         
864         return True;
865 }
866
867 /****************************************************************************
868 ****************************************************************************/
869
870 static BOOL api_spoolss_addprinterdriver(pipes_struct *p)
871 {
872         SPOOL_Q_ADDPRINTERDRIVER q_u;
873         SPOOL_R_ADDPRINTERDRIVER r_u;
874         prs_struct *data = &p->in_data.data;
875         prs_struct *rdata = &p->out_data.rdata;
876         
877         ZERO_STRUCT(q_u);
878         ZERO_STRUCT(r_u);
879         
880         if(!spoolss_io_q_addprinterdriver("", &q_u, data, 0)) {
881                 DEBUG(0,("spoolss_io_q_addprinterdriver: unable to unmarshall SPOOL_Q_ADDPRINTERDRIVER.\n"));
882                 return False;
883         }
884         
885         r_u.status = _spoolss_addprinterdriver(p, &q_u, &r_u);
886                                 
887         if(!spoolss_io_r_addprinterdriver("", &r_u, rdata, 0)) {
888                 DEBUG(0,("spoolss_io_r_addprinterdriver: unable to marshall SPOOL_R_ADDPRINTERDRIVER.\n"));
889                 return False;
890         }
891         
892         return True;
893 }
894
895 /****************************************************************************
896 ****************************************************************************/
897
898 static BOOL api_spoolss_getprinterdriverdirectory(pipes_struct *p)
899 {
900         SPOOL_Q_GETPRINTERDRIVERDIR q_u;
901         SPOOL_R_GETPRINTERDRIVERDIR r_u;
902         prs_struct *data = &p->in_data.data;
903         prs_struct *rdata = &p->out_data.rdata;
904
905         ZERO_STRUCT(q_u);
906         ZERO_STRUCT(r_u);
907
908         if(!spoolss_io_q_getprinterdriverdir("", &q_u, data, 0)) {
909                 DEBUG(0,("spoolss_io_q_getprinterdriverdir: unable to unmarshall SPOOL_Q_GETPRINTERDRIVERDIR.\n"));
910                 return False;
911         }
912
913         r_u.status = _spoolss_getprinterdriverdirectory(p, &q_u, &r_u);
914
915         if(!spoolss_io_r_getprinterdriverdir("", &r_u, rdata, 0)) {
916                 DEBUG(0,("spoolss_io_r_getprinterdriverdir: unable to marshall SPOOL_R_GETPRINTERDRIVERDIR.\n"));
917                 return False;
918         }
919
920         return True;
921 }
922
923 /****************************************************************************
924 ****************************************************************************/
925
926 static BOOL api_spoolss_enumprinterdata(pipes_struct *p)
927 {
928         SPOOL_Q_ENUMPRINTERDATA q_u;
929         SPOOL_R_ENUMPRINTERDATA r_u;
930         prs_struct *data = &p->in_data.data;
931         prs_struct *rdata = &p->out_data.rdata;
932         
933         ZERO_STRUCT(q_u);
934         ZERO_STRUCT(r_u);
935         
936         if(!spoolss_io_q_enumprinterdata("", &q_u, data, 0)) {
937                 DEBUG(0,("spoolss_io_q_enumprinterdata: unable to unmarshall SPOOL_Q_ENUMPRINTERDATA.\n"));
938                 return False;
939         }
940         
941         r_u.status = _spoolss_enumprinterdata(p, &q_u, &r_u);
942                                 
943         if(!spoolss_io_r_enumprinterdata("", &r_u, rdata, 0)) {
944                 DEBUG(0,("spoolss_io_r_enumprinterdata: unable to marshall SPOOL_R_ENUMPRINTERDATA.\n"));
945                 return False;
946         }
947
948         return True;
949 }
950
951 /****************************************************************************
952 ****************************************************************************/
953
954 static BOOL api_spoolss_setprinterdata(pipes_struct *p)
955 {
956         SPOOL_Q_SETPRINTERDATA q_u;
957         SPOOL_R_SETPRINTERDATA r_u;
958         prs_struct *data = &p->in_data.data;
959         prs_struct *rdata = &p->out_data.rdata;
960         
961         ZERO_STRUCT(q_u);
962         ZERO_STRUCT(r_u);
963         
964         if(!spoolss_io_q_setprinterdata("", &q_u, data, 0)) {
965                 DEBUG(0,("spoolss_io_q_setprinterdata: unable to unmarshall SPOOL_Q_SETPRINTERDATA.\n"));
966                 return False;
967         }
968         
969         r_u.status = _spoolss_setprinterdata(p, &q_u, &r_u);
970                                 
971         if(!spoolss_io_r_setprinterdata("", &r_u, rdata, 0)) {
972                 DEBUG(0,("spoolss_io_r_setprinterdata: unable to marshall SPOOL_R_SETPRINTERDATA.\n"));
973                 return False;
974         }
975
976         return True;
977 }
978
979 /****************************************************************************
980 ****************************************************************************/
981
982 static BOOL api_spoolss_addform(pipes_struct *p)
983 {
984         SPOOL_Q_ADDFORM q_u;
985         SPOOL_R_ADDFORM r_u;
986         prs_struct *data = &p->in_data.data;
987         prs_struct *rdata = &p->out_data.rdata;
988
989         ZERO_STRUCT(q_u);
990         ZERO_STRUCT(r_u);
991         
992         if(!spoolss_io_q_addform("", &q_u, data, 0)) {
993                 DEBUG(0,("spoolss_io_q_addform: unable to unmarshall SPOOL_Q_ADDFORM.\n"));
994                 return False;
995         }
996         
997         r_u.status = _spoolss_addform(p, &q_u, &r_u);
998         
999         if(!spoolss_io_r_addform("", &r_u, rdata, 0)) {
1000                 DEBUG(0,("spoolss_io_r_addform: unable to marshall SPOOL_R_ADDFORM.\n"));
1001                 return False;
1002         }
1003
1004         return True;
1005 }
1006
1007 /****************************************************************************
1008 ****************************************************************************/
1009
1010 static BOOL api_spoolss_deleteform(pipes_struct *p)
1011 {
1012         SPOOL_Q_DELETEFORM q_u;
1013         SPOOL_R_DELETEFORM r_u;
1014         prs_struct *data = &p->in_data.data;
1015         prs_struct *rdata = &p->out_data.rdata;
1016
1017         ZERO_STRUCT(q_u);
1018         ZERO_STRUCT(r_u);
1019         
1020         if(!spoolss_io_q_deleteform("", &q_u, data, 0)) {
1021                 DEBUG(0,("spoolss_io_q_deleteform: unable to unmarshall SPOOL_Q_DELETEFORM.\n"));
1022                 return False;
1023         }
1024         
1025         r_u.status = _spoolss_deleteform(p, &q_u, &r_u);
1026         
1027         if(!spoolss_io_r_deleteform("", &r_u, rdata, 0)) {
1028                 DEBUG(0,("spoolss_io_r_deleteform: unable to marshall SPOOL_R_DELETEFORM.\n"));
1029                 return False;
1030         }
1031
1032         return True;
1033 }
1034
1035 /****************************************************************************
1036 ****************************************************************************/
1037
1038 static BOOL api_spoolss_setform(pipes_struct *p)
1039 {
1040         SPOOL_Q_SETFORM q_u;
1041         SPOOL_R_SETFORM r_u;
1042         prs_struct *data = &p->in_data.data;
1043         prs_struct *rdata = &p->out_data.rdata;
1044
1045         ZERO_STRUCT(q_u);
1046         ZERO_STRUCT(r_u);
1047         
1048         if(!spoolss_io_q_setform("", &q_u, data, 0)) {
1049                 DEBUG(0,("spoolss_io_q_setform: unable to unmarshall SPOOL_Q_SETFORM.\n"));
1050                 return False;
1051         }
1052         
1053         r_u.status = _spoolss_setform(p, &q_u, &r_u);
1054                                       
1055         if(!spoolss_io_r_setform("", &r_u, rdata, 0)) {
1056                 DEBUG(0,("spoolss_io_r_setform: unable to marshall SPOOL_R_SETFORM.\n"));
1057                 return False;
1058         }
1059
1060         return True;
1061 }
1062
1063 /****************************************************************************
1064 ****************************************************************************/
1065
1066 static BOOL api_spoolss_enumprintprocessors(pipes_struct *p)
1067 {
1068         SPOOL_Q_ENUMPRINTPROCESSORS q_u;
1069         SPOOL_R_ENUMPRINTPROCESSORS r_u;
1070         prs_struct *data = &p->in_data.data;
1071         prs_struct *rdata = &p->out_data.rdata;
1072
1073         ZERO_STRUCT(q_u);
1074         ZERO_STRUCT(r_u);
1075         
1076         if(!spoolss_io_q_enumprintprocessors("", &q_u, data, 0)) {
1077                 DEBUG(0,("spoolss_io_q_enumprintprocessors: unable to unmarshall SPOOL_Q_ENUMPRINTPROCESSORS.\n"));
1078                 return False;
1079         }
1080         
1081         r_u.status = _spoolss_enumprintprocessors(p, &q_u, &r_u);
1082
1083         if(!spoolss_io_r_enumprintprocessors("", &r_u, rdata, 0)) {
1084                 DEBUG(0,("spoolss_io_r_enumprintprocessors: unable to marshall SPOOL_R_ENUMPRINTPROCESSORS.\n"));
1085                 return False;
1086         }
1087         
1088         return True;
1089 }
1090
1091 /****************************************************************************
1092 ****************************************************************************/
1093
1094 static BOOL api_spoolss_addprintprocessor(pipes_struct *p)
1095 {
1096         SPOOL_Q_ADDPRINTPROCESSOR q_u;
1097         SPOOL_R_ADDPRINTPROCESSOR r_u;
1098         prs_struct *data = &p->in_data.data;
1099         prs_struct *rdata = &p->out_data.rdata;
1100
1101         ZERO_STRUCT(q_u);
1102         ZERO_STRUCT(r_u);
1103         
1104         if(!spoolss_io_q_addprintprocessor("", &q_u, data, 0)) {
1105                 DEBUG(0,("spoolss_io_q_addprintprocessor: unable to unmarshall SPOOL_Q_ADDPRINTPROCESSOR.\n"));
1106                 return False;
1107         }
1108         
1109         /* for now, just indicate success and ignore the add.  We'll
1110            automatically set the winprint processor for printer
1111            entries later.  Used to debug the LexMark Optra S 1855 PCL
1112            driver --jerry */
1113         r_u.status = WERR_OK;
1114
1115         if(!spoolss_io_r_addprintprocessor("", &r_u, rdata, 0)) {
1116                 DEBUG(0,("spoolss_io_r_addprintprocessor: unable to marshall SPOOL_R_ADDPRINTPROCESSOR.\n"));
1117                 return False;
1118         }
1119         
1120         return True;
1121 }
1122
1123 /****************************************************************************
1124 ****************************************************************************/
1125
1126 static BOOL api_spoolss_enumprintprocdatatypes(pipes_struct *p)
1127 {
1128         SPOOL_Q_ENUMPRINTPROCDATATYPES q_u;
1129         SPOOL_R_ENUMPRINTPROCDATATYPES r_u;
1130         prs_struct *data = &p->in_data.data;
1131         prs_struct *rdata = &p->out_data.rdata;
1132
1133         ZERO_STRUCT(q_u);
1134         ZERO_STRUCT(r_u);
1135         
1136         if(!spoolss_io_q_enumprintprocdatatypes("", &q_u, data, 0)) {
1137                 DEBUG(0,("spoolss_io_q_enumprintprocdatatypes: unable to unmarshall SPOOL_Q_ENUMPRINTPROCDATATYPES.\n"));
1138                 return False;
1139         }
1140         
1141         r_u.status = _spoolss_enumprintprocdatatypes(p, &q_u, &r_u);
1142
1143         if(!spoolss_io_r_enumprintprocdatatypes("", &r_u, rdata, 0)) {
1144                 DEBUG(0,("spoolss_io_r_enumprintprocdatatypes: unable to marshall SPOOL_R_ENUMPRINTPROCDATATYPES.\n"));
1145                 return False;
1146         }
1147         
1148         return True;
1149 }
1150
1151 /****************************************************************************
1152 ****************************************************************************/
1153
1154 static BOOL api_spoolss_enumprintmonitors(pipes_struct *p)
1155 {
1156         SPOOL_Q_ENUMPRINTMONITORS q_u;
1157         SPOOL_R_ENUMPRINTMONITORS r_u;
1158         prs_struct *data = &p->in_data.data;
1159         prs_struct *rdata = &p->out_data.rdata;
1160
1161         ZERO_STRUCT(q_u);
1162         ZERO_STRUCT(r_u);
1163         
1164         if (!spoolss_io_q_enumprintmonitors("", &q_u, data, 0)) {
1165                 DEBUG(0,("spoolss_io_q_enumprintmonitors: unable to unmarshall SPOOL_Q_ENUMPRINTMONITORS.\n"));
1166                 return False;
1167         }
1168                 
1169         r_u.status = _spoolss_enumprintmonitors(p, &q_u, &r_u);
1170
1171         if (!spoolss_io_r_enumprintmonitors("", &r_u, rdata, 0)) {
1172                 DEBUG(0,("spoolss_io_r_enumprintmonitors: unable to marshall SPOOL_R_ENUMPRINTMONITORS.\n"));
1173                 return False;
1174         }
1175         
1176         return True;
1177 }
1178
1179 /****************************************************************************
1180 ****************************************************************************/
1181
1182 static BOOL api_spoolss_getjob(pipes_struct *p)
1183 {
1184         SPOOL_Q_GETJOB q_u;
1185         SPOOL_R_GETJOB r_u;
1186         prs_struct *data = &p->in_data.data;
1187         prs_struct *rdata = &p->out_data.rdata;
1188         
1189         if(!spoolss_io_q_getjob("", &q_u, data, 0)) {
1190                 DEBUG(0,("spoolss_io_q_getjob: unable to unmarshall SPOOL_Q_GETJOB.\n"));
1191                 return False;
1192         }
1193
1194         r_u.status = _spoolss_getjob(p, &q_u, &r_u);
1195         
1196         if(!spoolss_io_r_getjob("",&r_u,rdata,0)) {
1197                 DEBUG(0,("spoolss_io_r_getjob: unable to marshall SPOOL_R_GETJOB.\n"));
1198                 return False;
1199         }
1200                 
1201         return True;
1202 }
1203
1204 /*******************************************************************
1205 \pipe\spoolss commands
1206 ********************************************************************/
1207
1208 struct api_struct api_spoolss_cmds[] = 
1209 {
1210  {"SPOOLSS_OPENPRINTEREX",             SPOOLSS_OPENPRINTEREX,             api_spoolss_open_printer_ex           },
1211  {"SPOOLSS_GETPRINTERDATA",            SPOOLSS_GETPRINTERDATA,            api_spoolss_getprinterdata            },
1212  {"SPOOLSS_CLOSEPRINTER",              SPOOLSS_CLOSEPRINTER,              api_spoolss_closeprinter              },
1213  {"SPOOLSS_DELETEPRINTER",             SPOOLSS_DELETEPRINTER,             api_spoolss_deleteprinter             },
1214  {"SPOOLSS_ABORTPRINTER",              SPOOLSS_ABORTPRINTER,              api_spoolss_abortprinter              },
1215  {"SPOOLSS_RFFPCNEX",                  SPOOLSS_RFFPCNEX,                  api_spoolss_rffpcnex                  },
1216  {"SPOOLSS_RFNPCNEX",                  SPOOLSS_RFNPCNEX,                  api_spoolss_rfnpcnex                  },
1217  {"SPOOLSS_ENUMPRINTERS",              SPOOLSS_ENUMPRINTERS,              api_spoolss_enumprinters              },
1218  {"SPOOLSS_GETPRINTER",                SPOOLSS_GETPRINTER,                api_spoolss_getprinter                },
1219  {"SPOOLSS_GETPRINTERDRIVER2",         SPOOLSS_GETPRINTERDRIVER2,         api_spoolss_getprinterdriver2         }, 
1220  {"SPOOLSS_STARTPAGEPRINTER",          SPOOLSS_STARTPAGEPRINTER,          api_spoolss_startpageprinter          },
1221  {"SPOOLSS_ENDPAGEPRINTER",            SPOOLSS_ENDPAGEPRINTER,            api_spoolss_endpageprinter            }, 
1222  {"SPOOLSS_STARTDOCPRINTER",           SPOOLSS_STARTDOCPRINTER,           api_spoolss_startdocprinter           },
1223  {"SPOOLSS_ENDDOCPRINTER",             SPOOLSS_ENDDOCPRINTER,             api_spoolss_enddocprinter             },
1224  {"SPOOLSS_WRITEPRINTER",              SPOOLSS_WRITEPRINTER,              api_spoolss_writeprinter              },
1225  {"SPOOLSS_SETPRINTER",                SPOOLSS_SETPRINTER,                api_spoolss_setprinter                },
1226  {"SPOOLSS_FCPN",                      SPOOLSS_FCPN,                      api_spoolss_fcpn                      },
1227  {"SPOOLSS_ADDJOB",                    SPOOLSS_ADDJOB,                    api_spoolss_addjob                    },
1228  {"SPOOLSS_ENUMJOBS",                  SPOOLSS_ENUMJOBS,                  api_spoolss_enumjobs                  },
1229  {"SPOOLSS_SCHEDULEJOB",               SPOOLSS_SCHEDULEJOB,               api_spoolss_schedulejob               },
1230  {"SPOOLSS_SETJOB",                    SPOOLSS_SETJOB,                    api_spoolss_setjob                    },
1231  {"SPOOLSS_ENUMFORMS",                 SPOOLSS_ENUMFORMS,                 api_spoolss_enumforms                 },
1232  {"SPOOLSS_ENUMPORTS",                 SPOOLSS_ENUMPORTS,                 api_spoolss_enumports                 },
1233  {"SPOOLSS_ENUMPRINTERDRIVERS",        SPOOLSS_ENUMPRINTERDRIVERS,        api_spoolss_enumprinterdrivers        },
1234  {"SPOOLSS_ADDPRINTEREX",              SPOOLSS_ADDPRINTEREX,              api_spoolss_addprinterex              },
1235  {"SPOOLSS_ADDPRINTERDRIVER",          SPOOLSS_ADDPRINTERDRIVER,          api_spoolss_addprinterdriver          },
1236  {"SPOOLSS_DELETEPRINTERDRIVER",       SPOOLSS_DELETEPRINTERDRIVER,       api_spoolss_deleteprinterdriver       },
1237  {"SPOOLSS_GETPRINTERDRIVERDIRECTORY", SPOOLSS_GETPRINTERDRIVERDIRECTORY, api_spoolss_getprinterdriverdirectory },
1238  {"SPOOLSS_ENUMPRINTERDATA",           SPOOLSS_ENUMPRINTERDATA,           api_spoolss_enumprinterdata           },
1239  {"SPOOLSS_SETPRINTERDATA",            SPOOLSS_SETPRINTERDATA,            api_spoolss_setprinterdata            },
1240  {"SPOOLSS_DELETEPRINTERDATA",         SPOOLSS_DELETEPRINTERDATA,         api_spoolss_deleteprinterdata         },
1241  {"SPOOLSS_ADDFORM",                   SPOOLSS_ADDFORM,                   api_spoolss_addform                   },
1242  {"SPOOLSS_DELETEFORM",                SPOOLSS_DELETEFORM,                api_spoolss_deleteform                },
1243  {"SPOOLSS_GETFORM",                   SPOOLSS_GETFORM,                   api_spoolss_getform                   },
1244  {"SPOOLSS_SETFORM",                   SPOOLSS_SETFORM,                   api_spoolss_setform                   },
1245  {"SPOOLSS_ADDPRINTPROCESSOR",         SPOOLSS_ADDPRINTPROCESSOR,         api_spoolss_addprintprocessor         },
1246  {"SPOOLSS_ENUMPRINTPROCESSORS",       SPOOLSS_ENUMPRINTPROCESSORS,       api_spoolss_enumprintprocessors       },
1247  {"SPOOLSS_ENUMMONITORS",              SPOOLSS_ENUMMONITORS,              api_spoolss_enumprintmonitors         },
1248  {"SPOOLSS_GETJOB",                    SPOOLSS_GETJOB,                    api_spoolss_getjob                    },
1249  {"SPOOLSS_ENUMPRINTPROCDATATYPES",    SPOOLSS_ENUMPRINTPROCDATATYPES,    api_spoolss_enumprintprocdatatypes    },
1250  { NULL,                               0,                                 NULL                                  }
1251 };
1252
1253 /*******************************************************************
1254 receives a spoolss pipe and responds.
1255 ********************************************************************/
1256 BOOL api_spoolss_rpc(pipes_struct *p)
1257 {
1258         return api_rpcTNP(p, "api_spoolss_rpc", api_spoolss_cmds);
1259 }