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