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