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