65fab7d319ac897292f5a4bcfb2e72bbefa648d6
[tprouty/samba.git] / source3 / include / rpc_spoolss.h
1 /* 
2    Unix SMB/Netbios implementation.
3
4    Copyright (C) Andrew Tridgell              1992-2000,
5    Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
6    Copyright (C) Jean Francois Micouleau      1998-2000.
7    Copyright (C) Gerald Carter                2001-2006.
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 3 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, see <http://www.gnu.org/licenses/>.
21 */
22
23 #include "librpc/gen_ndr/spoolss.h"
24
25 #ifndef _RPC_SPOOLSS_H          /* _RPC_SPOOLSS_H */
26 #define _RPC_SPOOLSS_H
27
28 /* spoolss pipe: this are the calls which are not implemented ...
29 #define SPOOLSS_GETPRINTERDRIVER                        0x0b
30 #define SPOOLSS_READPRINTER                             0x16
31 #define SPOOLSS_WAITFORPRINTERCHANGE                    0x1c
32 #define SPOOLSS_ADDPORT                                 0x25
33 #define SPOOLSS_CONFIGUREPORT                           0x26
34 #define SPOOLSS_DELETEPORT                              0x27
35 #define SPOOLSS_CREATEPRINTERIC                         0x28
36 #define SPOOLSS_PLAYGDISCRIPTONPRINTERIC                0x29
37 #define SPOOLSS_DELETEPRINTERIC                         0x2a
38 #define SPOOLSS_ADDPRINTERCONNECTION                    0x2b
39 #define SPOOLSS_DELETEPRINTERCONNECTION                 0x2c
40 #define SPOOLSS_PRINTERMESSAGEBOX                       0x2d
41 #define SPOOLSS_ADDMONITOR                              0x2e
42 #define SPOOLSS_DELETEMONITOR                           0x2f
43 #define SPOOLSS_DELETEPRINTPROCESSOR                    0x30
44 #define SPOOLSS_ADDPRINTPROVIDOR                        0x31
45 #define SPOOLSS_DELETEPRINTPROVIDOR                     0x32
46 #define SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION      0x36
47 #define SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION       0x37
48 #define SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD   0x39
49 #define SPOOLSS_ADDPORTEX                               0x3d
50 #define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION0x3e
51 #define SPOOLSS_SPOOLERINIT                             0x3f
52 #define SPOOLSS_RESETPRINTEREX                          0x40
53 */
54
55 /* those are implemented */
56 #define SPOOLSS_ENUMPRINTERS                            0x00
57 #define SPOOLSS_OPENPRINTER                             0x01
58 #define SPOOLSS_SETJOB                                  0x02
59 #define SPOOLSS_GETJOB                                  0x03
60 #define SPOOLSS_ENUMJOBS                                0x04
61 #define SPOOLSS_ADDPRINTER                              0x05
62 #define SPOOLSS_DELETEPRINTER                           0x06
63 #define SPOOLSS_SETPRINTER                              0x07
64 #define SPOOLSS_GETPRINTER                              0x08
65 #define SPOOLSS_ADDPRINTERDRIVER                        0x09
66 #define SPOOLSS_ENUMPRINTERDRIVERS                      0x0a
67 #define SPOOLSS_GETPRINTERDRIVERDIRECTORY               0x0c
68 #define SPOOLSS_DELETEPRINTERDRIVER                     0x0d
69 #define SPOOLSS_ADDPRINTPROCESSOR                       0x0e
70 #define SPOOLSS_ENUMPRINTPROCESSORS                     0x0f
71 #define SPOOLSS_GETPRINTPROCESSORDIRECTORY              0x10
72 #define SPOOLSS_STARTDOCPRINTER                         0x11
73 #define SPOOLSS_STARTPAGEPRINTER                        0x12
74 #define SPOOLSS_WRITEPRINTER                            0x13
75 #define SPOOLSS_ENDPAGEPRINTER                          0x14
76 #define SPOOLSS_ABORTPRINTER                            0x15
77 #define SPOOLSS_ENDDOCPRINTER                           0x17
78 #define SPOOLSS_ADDJOB                                  0x18
79 #define SPOOLSS_SCHEDULEJOB                             0x19
80 #define SPOOLSS_GETPRINTERDATA                          0x1a
81 #define SPOOLSS_SETPRINTERDATA                          0x1b
82 #define SPOOLSS_CLOSEPRINTER                            0x1d
83 #define SPOOLSS_ADDFORM                                 0x1e
84 #define SPOOLSS_DELETEFORM                              0x1f
85 #define SPOOLSS_GETFORM                                 0x20
86 #define SPOOLSS_SETFORM                                 0x21
87 #define SPOOLSS_ENUMFORMS                               0x22
88 #define SPOOLSS_ENUMPORTS                               0x23
89 #define SPOOLSS_ENUMMONITORS                            0x24
90 #define SPOOLSS_ENUMPRINTPROCDATATYPES                  0x33
91 #define SPOOLSS_RESETPRINTER                            0x34
92 #define SPOOLSS_GETPRINTERDRIVER2                       0x35
93 #define SPOOLSS_FCPN                                    0x38    /* FindClosePrinterNotify */
94 #define SPOOLSS_REPLYOPENPRINTER                        0x3a
95 #define SPOOLSS_ROUTERREPLYPRINTER                      0x3b
96 #define SPOOLSS_REPLYCLOSEPRINTER                       0x3c
97 #define SPOOLSS_RFFPCNEX                                0x41    /* RemoteFindFirstPrinterChangeNotifyEx */
98 #define SPOOLSS_RRPCN                                   0x42    /* RouteRefreshPrinterChangeNotification */
99 #define SPOOLSS_RFNPCNEX                                0x43    /* RemoteFindNextPrinterChangeNotifyEx */
100 #define SPOOLSS_OPENPRINTEREX                           0x45
101 #define SPOOLSS_ADDPRINTEREX                            0x46
102 #define SPOOLSS_ENUMPRINTERDATA                         0x48
103 #define SPOOLSS_DELETEPRINTERDATA                       0x49
104 #define SPOOLSS_SETPRINTERDATAEX                        0x4d
105 #define SPOOLSS_GETPRINTERDATAEX                        0x4e
106 #define SPOOLSS_ENUMPRINTERDATAEX                       0x4f
107 #define SPOOLSS_ENUMPRINTERKEY                          0x50
108 #define SPOOLSS_DELETEPRINTERDATAEX                     0x51
109 #define SPOOLSS_DELETEPRINTERKEY                        0x52
110 #define SPOOLSS_DELETEPRINTERDRIVEREX                   0x54
111 #define SPOOLSS_XCVDATAPORT                             0x58
112 #define SPOOLSS_ADDPRINTERDRIVEREX                      0x59
113
114 /* 
115  * Special strings for the OpenPrinter() call.  See the MSDN DDK
116  * docs on the XcvDataPort() for more details.
117  */
118
119 #define SPL_LOCAL_PORT            "Local Port"
120 #define SPL_TCPIP_PORT            "Standard TCP/IP Port"
121 #define SPL_XCV_MONITOR_LOCALMON  ",XcvMonitor Local Port"
122 #define SPL_XCV_MONITOR_TCPMON    ",XcvMonitor Standard TCP/IP Port"
123
124
125 #define PRINTER_STATUS_OK               0x00000000
126 #define JOB_ACCESS_READ                 0x00000020
127
128 /* JOB status codes. */
129
130 #define JOB_STATUS_QUEUED               0x0000
131 #define JOB_STATUS_PAUSED               0x0001
132 #define JOB_STATUS_ERROR                0x0002
133 #define JOB_STATUS_DELETING             0x0004
134 #define JOB_STATUS_SPOOLING             0x0008
135 #define JOB_STATUS_PRINTING             0x0010
136 #define JOB_STATUS_OFFLINE              0x0020
137 #define JOB_STATUS_PAPEROUT             0x0040
138 #define JOB_STATUS_PRINTED              0x0080
139 #define JOB_STATUS_DELETED              0x0100
140 #define JOB_STATUS_BLOCKED              0x0200
141 #define JOB_STATUS_USER_INTERVENTION    0x0400
142
143 /* Notify field types */
144
145 #define NOTIFY_ONE_VALUE 1              /* Notify data is stored in value1 */
146 #define NOTIFY_TWO_VALUE 2              /* Notify data is stored in value2 */
147 #define NOTIFY_POINTER   3              /* Data is a pointer to a buffer */
148 #define NOTIFY_STRING    4              /* Data is a pointer to a buffer w/length */
149 #define NOTIFY_SECDESC   5              /* Data is a security descriptor */
150
151 #define PRINTER_NOTIFY_TYPE 0x00
152 #define JOB_NOTIFY_TYPE     0x01
153 #define PRINT_TABLE_END     0xFF
154
155 #define MAX_PRINTER_NOTIFY 26
156 #define MAX_JOB_NOTIFY 24
157
158 #define MAX_NOTIFY_TYPE_FOR_NOW 26
159
160 #define PRINTER_NOTIFY_SERVER_NAME              0x00
161 #define PRINTER_NOTIFY_PRINTER_NAME             0x01
162 #define PRINTER_NOTIFY_SHARE_NAME               0x02
163 #define PRINTER_NOTIFY_PORT_NAME                0x03
164 #define PRINTER_NOTIFY_DRIVER_NAME              0x04
165 #define PRINTER_NOTIFY_COMMENT                  0x05
166 #define PRINTER_NOTIFY_LOCATION                 0x06
167 #define PRINTER_NOTIFY_DEVMODE                  0x07
168 #define PRINTER_NOTIFY_SEPFILE                  0x08
169 #define PRINTER_NOTIFY_PRINT_PROCESSOR          0x09
170 #define PRINTER_NOTIFY_PARAMETERS               0x0A
171 #define PRINTER_NOTIFY_DATATYPE                 0x0B
172 #define PRINTER_NOTIFY_SECURITY_DESCRIPTOR      0x0C
173 #define PRINTER_NOTIFY_ATTRIBUTES               0x0D
174 #define PRINTER_NOTIFY_PRIORITY                 0x0E
175 #define PRINTER_NOTIFY_DEFAULT_PRIORITY         0x0F
176 #define PRINTER_NOTIFY_START_TIME               0x10
177 #define PRINTER_NOTIFY_UNTIL_TIME               0x11
178 #define PRINTER_NOTIFY_STATUS                   0x12
179 #define PRINTER_NOTIFY_STATUS_STRING            0x13
180 #define PRINTER_NOTIFY_CJOBS                    0x14
181 #define PRINTER_NOTIFY_AVERAGE_PPM              0x15
182 #define PRINTER_NOTIFY_TOTAL_PAGES              0x16
183 #define PRINTER_NOTIFY_PAGES_PRINTED            0x17
184 #define PRINTER_NOTIFY_TOTAL_BYTES              0x18
185 #define PRINTER_NOTIFY_BYTES_PRINTED            0x19
186
187 #define JOB_NOTIFY_PRINTER_NAME                 0x00
188 #define JOB_NOTIFY_MACHINE_NAME                 0x01
189 #define JOB_NOTIFY_PORT_NAME                    0x02
190 #define JOB_NOTIFY_USER_NAME                    0x03
191 #define JOB_NOTIFY_NOTIFY_NAME                  0x04
192 #define JOB_NOTIFY_DATATYPE                     0x05
193 #define JOB_NOTIFY_PRINT_PROCESSOR              0x06
194 #define JOB_NOTIFY_PARAMETERS                   0x07
195 #define JOB_NOTIFY_DRIVER_NAME                  0x08
196 #define JOB_NOTIFY_DEVMODE                      0x09
197 #define JOB_NOTIFY_STATUS                       0x0A
198 #define JOB_NOTIFY_STATUS_STRING                0x0B
199 #define JOB_NOTIFY_SECURITY_DESCRIPTOR          0x0C
200 #define JOB_NOTIFY_DOCUMENT                     0x0D
201 #define JOB_NOTIFY_PRIORITY                     0x0E
202 #define JOB_NOTIFY_POSITION                     0x0F
203 #define JOB_NOTIFY_SUBMITTED                    0x10
204 #define JOB_NOTIFY_START_TIME                   0x11
205 #define JOB_NOTIFY_UNTIL_TIME                   0x12
206 #define JOB_NOTIFY_TIME                         0x13
207 #define JOB_NOTIFY_TOTAL_PAGES                  0x14
208 #define JOB_NOTIFY_PAGES_PRINTED                0x15
209 #define JOB_NOTIFY_TOTAL_BYTES                  0x16
210 #define JOB_NOTIFY_BYTES_PRINTED                0x17
211
212 /*
213  * Set of macros for flagging what changed in the PRINTER_INFO_2 struct
214  * when sending messages to other smbd's
215  */
216 #define PRINTER_MESSAGE_NULL            0x00000000
217 #define PRINTER_MESSAGE_DRIVER          0x00000001
218 #define PRINTER_MESSAGE_COMMENT         0x00000002
219 #define PRINTER_MESSAGE_PRINTERNAME     0x00000004
220 #define PRINTER_MESSAGE_LOCATION        0x00000008
221 #define PRINTER_MESSAGE_DEVMODE         0x00000010      /* not curently supported */
222 #define PRINTER_MESSAGE_SEPFILE         0x00000020
223 #define PRINTER_MESSAGE_PRINTPROC       0x00000040
224 #define PRINTER_MESSAGE_PARAMS          0x00000080
225 #define PRINTER_MESSAGE_DATATYPE        0x00000100
226 #define PRINTER_MESSAGE_SECDESC         0x00000200
227 #define PRINTER_MESSAGE_CJOBS           0x00000400
228 #define PRINTER_MESSAGE_PORT            0x00000800
229 #define PRINTER_MESSAGE_SHARENAME       0x00001000
230 #define PRINTER_MESSAGE_ATTRIBUTES      0x00002000
231
232 typedef struct printer_message_info {
233         uint32 low;             /* PRINTER_CHANGE_XXX */
234         uint32 high;            /* PRINTER_CHANGE_XXX */
235         fstring printer_name;
236         uint32 flags;           /* PRINTER_MESSAGE_XXX */
237 }
238 PRINTER_MESSAGE_INFO;
239
240 /*
241  * The printer attributes.
242  * I #defined all of them (grabbed form MSDN)
243  * I'm only using:
244  * ( SHARED | NETWORK | RAW_ONLY )
245  * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
246  */
247
248 #define PRINTER_ATTRIBUTE_SAMBA                 (PRINTER_ATTRIBUTE_RAW_ONLY|\
249                                                  PRINTER_ATTRIBUTE_SHARED|\
250                                                  PRINTER_ATTRIBUTE_LOCAL)
251 #define PRINTER_ATTRIBUTE_NOT_SAMBA             (PRINTER_ATTRIBUTE_NETWORK)
252
253 #define NO_PRIORITY      0
254 #define MAX_PRIORITY    99
255 #define MIN_PRIORITY     1
256 #define DEF_PRIORITY     1
257
258 /* the flags of each printers */
259
260 #define DRIVER_ANY_VERSION              0xffffffff
261 #define DRIVER_MAX_VERSION              4
262
263
264 /* 
265  * Devicemode structure
266  */
267
268 typedef struct devicemode
269 {
270         UNISTR devicename;
271         uint16 specversion;
272         uint16 driverversion;
273         uint16 size;
274         uint16 driverextra;
275         uint32 fields;
276         uint16 orientation;
277         uint16 papersize;
278         uint16 paperlength;
279         uint16 paperwidth;
280         uint16 scale;
281         uint16 copies;
282         uint16 defaultsource;
283         uint16 printquality;
284         uint16 color;
285         uint16 duplex;
286         uint16 yresolution;
287         uint16 ttoption;
288         uint16 collate;
289         UNISTR formname;
290         uint16 logpixels;
291         uint32 bitsperpel;
292         uint32 pelswidth;
293         uint32 pelsheight;
294         uint32 displayflags;
295         uint32 displayfrequency;
296         uint32 icmmethod;
297         uint32 icmintent;
298         uint32 mediatype;
299         uint32 dithertype;
300         uint32 reserved1;
301         uint32 reserved2;
302         uint32 panningwidth;
303         uint32 panningheight;
304         uint8 *dev_private;
305 }
306 DEVICEMODE;
307
308 typedef struct _devmode_cont
309 {
310         uint32 size;
311         uint32 devmode_ptr;
312         DEVICEMODE *devmode;
313 }
314 DEVMODE_CTR;
315
316 typedef struct _printer_default
317 {
318         uint32 datatype_ptr;
319         UNISTR2 datatype;
320         DEVMODE_CTR devmode_cont;
321         uint32 access_required;
322 }
323 PRINTER_DEFAULT;
324
325 /********************************************/
326
327 typedef struct s_header_type
328 {
329         uint32 type;
330         union
331         {
332                 uint32 value;
333                 UNISTR string;
334         }
335         data;
336 }
337 HEADER_TYPE;
338
339
340 typedef struct spool_q_getprinterdata
341 {
342         POLICY_HND handle;
343         UNISTR2 valuename;
344         uint32 size;
345 }
346 SPOOL_Q_GETPRINTERDATA;
347
348 typedef struct spool_r_getprinterdata
349 {
350         uint32 type;
351         uint32 size;
352         uint8 *data;
353         uint32 needed;
354         WERROR status;
355 }
356 SPOOL_R_GETPRINTERDATA;
357
358 typedef struct printer_info_0
359 {
360         UNISTR printername;
361         UNISTR servername;
362         uint32 cjobs;
363         uint32 total_jobs;
364         uint32 total_bytes;
365         
366         uint16 year;
367         uint16 month;
368         uint16 dayofweek;
369         uint16 day;
370         uint16 hour;
371         uint16 minute;
372         uint16 second;
373         uint16 milliseconds;
374
375         uint32 global_counter;
376         uint32 total_pages;
377
378         uint16 major_version;
379         uint16 build_version;
380
381         uint32 unknown7;
382         uint32 unknown8;
383         uint32 unknown9;
384         uint32 session_counter;
385         uint32 unknown11;
386         uint32 printer_errors;
387         uint32 unknown13;
388         uint32 unknown14;
389         uint32 unknown15;
390         uint32 unknown16;
391         uint32 change_id;
392         uint32 unknown18;
393         uint32 status;
394         uint32 unknown20;
395         uint32 c_setprinter;
396
397         uint16 unknown22;
398         uint16 unknown23;
399         uint16 unknown24;
400         uint16 unknown25;
401         uint16 unknown26;
402         uint16 unknown27;
403         uint16 unknown28;
404         uint16 unknown29;
405 } PRINTER_INFO_0;
406
407 typedef struct printer_info_1
408 {
409         uint32 flags;
410         UNISTR description;
411         UNISTR name;
412         UNISTR comment;
413 }
414 PRINTER_INFO_1;
415
416 typedef struct printer_info_2
417 {
418         UNISTR servername;
419         UNISTR printername;
420         UNISTR sharename;
421         UNISTR portname;
422         UNISTR drivername;
423         UNISTR comment;
424         UNISTR location;
425         DEVICEMODE *devmode;
426         UNISTR sepfile;
427         UNISTR printprocessor;
428         UNISTR datatype;
429         UNISTR parameters;
430         SEC_DESC *secdesc;
431         uint32 attributes;
432         uint32 priority;
433         uint32 defaultpriority;
434         uint32 starttime;
435         uint32 untiltime;
436         uint32 status;
437         uint32 cjobs;
438         uint32 averageppm;
439 }
440 PRINTER_INFO_2;
441
442 typedef struct printer_info_3
443 {
444         SEC_DESC *secdesc;
445 }
446 PRINTER_INFO_3;
447
448 typedef struct printer_info_4
449 {
450         UNISTR printername;
451         UNISTR servername;
452         uint32 attributes;
453 }
454 PRINTER_INFO_4;
455
456 typedef struct printer_info_5
457 {
458         UNISTR printername;
459         UNISTR portname;
460         uint32 attributes;
461         uint32 device_not_selected_timeout;
462         uint32 transmission_retry_timeout;
463 }
464 PRINTER_INFO_5;
465
466 typedef struct printer_info_6
467 {
468         uint32 status;
469 }
470 PRINTER_INFO_6;
471
472 #define SPOOL_DS_PUBLISH        1
473 #define SPOOL_DS_UPDATE         2
474 #define SPOOL_DS_UNPUBLISH      4
475 #define SPOOL_DS_PENDING        0x80000000
476
477 typedef struct printer_info_7
478 {
479         UNISTR guid; /* text form of printer guid */
480         uint32 action;
481 }
482 PRINTER_INFO_7;
483
484 typedef struct spool_q_enumprinters
485 {
486         uint32 flags;
487         uint32 servername_ptr;
488         UNISTR2 servername;
489         uint32 level;
490         RPC_BUFFER *buffer;
491         uint32 offered;
492 }
493 SPOOL_Q_ENUMPRINTERS;
494
495 typedef struct printer_info_ctr_info
496 {
497         PRINTER_INFO_0 *printers_0;
498         PRINTER_INFO_1 *printers_1;
499         PRINTER_INFO_2 *printers_2;
500         PRINTER_INFO_3 *printers_3;
501         PRINTER_INFO_4 *printers_4;
502         PRINTER_INFO_5 *printers_5;
503         PRINTER_INFO_7 *printers_7;
504 }
505 PRINTER_INFO_CTR;
506
507 typedef struct spool_r_enumprinters
508 {
509         RPC_BUFFER *buffer;
510         uint32 needed;          /* bytes needed */
511         uint32 returned;        /* number of printers */
512         WERROR status;
513 }
514 SPOOL_R_ENUMPRINTERS;
515
516
517 typedef struct spool_q_getprinter
518 {
519         POLICY_HND handle;
520         uint32 level;
521         RPC_BUFFER *buffer;
522         uint32 offered;
523 }
524 SPOOL_Q_GETPRINTER;
525
526 typedef struct printer_info_info
527 {
528         union
529         {
530                 PRINTER_INFO_0 *info0;
531                 PRINTER_INFO_1 *info1;
532                 PRINTER_INFO_2 *info2;
533                 void *info;
534         } printer;
535 } PRINTER_INFO;
536
537 typedef struct spool_r_getprinter
538 {
539         RPC_BUFFER *buffer;
540         uint32 needed;
541         WERROR status;
542 } SPOOL_R_GETPRINTER;
543
544 typedef struct driver_info_1
545 {
546         UNISTR name;
547 } DRIVER_INFO_1;
548
549 typedef struct driver_info_2
550 {
551         uint32 version;
552         UNISTR name;
553         UNISTR architecture;
554         UNISTR driverpath;
555         UNISTR datafile;
556         UNISTR configfile;
557 } DRIVER_INFO_2;
558
559 typedef struct driver_info_3
560 {
561         uint32 version;
562         UNISTR name;
563         UNISTR architecture;
564         UNISTR driverpath;
565         UNISTR datafile;
566         UNISTR configfile;
567         UNISTR helpfile;
568         uint16 *dependentfiles;
569         UNISTR monitorname;
570         UNISTR defaultdatatype;
571 }
572 DRIVER_INFO_3;
573
574 typedef struct driver_info_6
575 {
576         uint32 version;
577         UNISTR name;
578         UNISTR architecture;
579         UNISTR driverpath;
580         UNISTR datafile;
581         UNISTR configfile;
582         UNISTR helpfile;
583         uint16 *dependentfiles;
584         UNISTR monitorname;
585         UNISTR defaultdatatype;
586         uint16* previousdrivernames;
587         NTTIME driver_date;
588         uint32 padding;
589         uint32 driver_version_low;
590         uint32 driver_version_high;
591         UNISTR mfgname;
592         UNISTR oem_url;
593         UNISTR hardware_id;
594         UNISTR provider;
595 }
596 DRIVER_INFO_6;
597
598 typedef struct driver_info_info
599 {
600         DRIVER_INFO_1 *info1;
601         DRIVER_INFO_2 *info2;
602         DRIVER_INFO_3 *info3;
603         DRIVER_INFO_6 *info6;
604 }
605 PRINTER_DRIVER_CTR;
606
607 typedef struct spool_q_getprinterdriver2
608 {
609         POLICY_HND handle;
610         uint32 architecture_ptr;
611         UNISTR2 architecture;
612         uint32 level;
613         RPC_BUFFER *buffer;
614         uint32 offered;
615         uint32 clientmajorversion;
616         uint32 clientminorversion;
617 }
618 SPOOL_Q_GETPRINTERDRIVER2;
619
620 typedef struct spool_r_getprinterdriver2
621 {
622         RPC_BUFFER *buffer;
623         uint32 needed;
624         uint32 servermajorversion;
625         uint32 serverminorversion;
626         WERROR status;
627 }
628 SPOOL_R_GETPRINTERDRIVER2;
629
630
631 typedef struct add_jobinfo_1
632 {
633         UNISTR path;
634         uint32 job_number;
635 }
636 ADD_JOBINFO_1;
637
638
639 /*
640  * I'm really wondering how many different time formats
641  * I will have to cope with
642  *
643  * JFM, 09/13/98 In a mad mood ;-(
644 */
645 typedef struct systemtime
646 {
647         uint16 year;
648         uint16 month;
649         uint16 dayofweek;
650         uint16 day;
651         uint16 hour;
652         uint16 minute;
653         uint16 second;
654         uint16 milliseconds;
655 }
656 SYSTEMTIME;
657
658 typedef struct s_job_info_1
659 {
660         uint32 jobid;
661         UNISTR printername;
662         UNISTR machinename;
663         UNISTR username;
664         UNISTR document;
665         UNISTR datatype;
666         UNISTR text_status;
667         uint32 status;
668         uint32 priority;
669         uint32 position;
670         uint32 totalpages;
671         uint32 pagesprinted;
672         SYSTEMTIME submitted;
673 }
674 JOB_INFO_1;
675
676 typedef struct s_job_info_2
677 {
678         uint32 jobid;
679         UNISTR printername;
680         UNISTR machinename;
681         UNISTR username;
682         UNISTR document;
683         UNISTR notifyname;
684         UNISTR datatype;
685         UNISTR printprocessor;
686         UNISTR parameters;
687         UNISTR drivername;
688         DEVICEMODE *devmode;
689         UNISTR text_status;
690 /*      SEC_DESC sec_desc;*/
691         uint32 status;
692         uint32 priority;
693         uint32 position;
694         uint32 starttime;
695         uint32 untiltime;
696         uint32 totalpages;
697         uint32 size;
698         SYSTEMTIME submitted;
699         uint32 timeelapsed;
700         uint32 pagesprinted;
701 }
702 JOB_INFO_2;
703
704 typedef struct spool_q_enumjobs
705 {
706         POLICY_HND handle;
707         uint32 firstjob;
708         uint32 numofjobs;
709         uint32 level;
710         RPC_BUFFER *buffer;
711         uint32 offered;
712 }
713 SPOOL_Q_ENUMJOBS;
714
715 typedef struct job_info_ctr_info
716 {
717         union
718         {
719                 JOB_INFO_1 *job_info_1;
720                 JOB_INFO_2 *job_info_2;
721                 void *info;
722         } job;
723
724 } JOB_INFO_CTR;
725
726 typedef struct spool_r_enumjobs
727 {
728         RPC_BUFFER *buffer;
729         uint32 needed;
730         uint32 returned;
731         WERROR status;
732 }
733 SPOOL_R_ENUMJOBS;
734
735 typedef struct s_port_info_1
736 {
737         UNISTR port_name;
738 }
739 PORT_INFO_1;
740
741 typedef struct s_port_info_2
742 {
743         UNISTR port_name;
744         UNISTR monitor_name;
745         UNISTR description;
746         uint32 port_type;
747         uint32 reserved;
748 }
749 PORT_INFO_2;
750
751 /* Port Type bits */
752 #define PORT_TYPE_WRITE         0x0001
753 #define PORT_TYPE_READ          0x0002
754 #define PORT_TYPE_REDIRECTED    0x0004
755 #define PORT_TYPE_NET_ATTACHED  0x0008
756
757 typedef struct spool_q_enumports
758 {
759         uint32 name_ptr;
760         UNISTR2 name;
761         uint32 level;
762         RPC_BUFFER *buffer;
763         uint32 offered;
764 }
765 SPOOL_Q_ENUMPORTS;
766
767 typedef struct port_info_ctr_info
768 {
769         union
770         {
771                 PORT_INFO_1 *info_1;
772                 PORT_INFO_2 *info_2;
773         }
774         port;
775
776 }
777 PORT_INFO_CTR;
778
779 typedef struct spool_r_enumports
780 {
781         RPC_BUFFER *buffer;
782         uint32 needed;          /* bytes needed */
783         uint32 returned;        /* number of printers */
784         WERROR status;
785 }
786 SPOOL_R_ENUMPORTS;
787
788 typedef struct job_info_info
789 {
790         union
791         {
792                 JOB_INFO_1 job_info_1;
793                 JOB_INFO_2 job_info_2;
794         }
795         job;
796
797 }
798 JOB_INFO;
799
800 typedef struct spool_q_enumprinterdrivers
801 {
802         uint32 name_ptr;
803         UNISTR2 name;
804         uint32 environment_ptr;
805         UNISTR2 environment;
806         uint32 level;
807         RPC_BUFFER *buffer;
808         uint32 offered;
809 }
810 SPOOL_Q_ENUMPRINTERDRIVERS;
811
812 typedef struct spool_r_enumprinterdrivers
813 {
814         RPC_BUFFER *buffer;
815         uint32 needed;
816         uint32 returned;
817         WERROR status;
818 }
819 SPOOL_R_ENUMPRINTERDRIVERS;
820
821 #define FORM_USER    0
822 #define FORM_BUILTIN 1
823 #define FORM_PRINTER 2
824
825 typedef struct spool_form_1
826 {
827         uint32 flag;
828         UNISTR name;
829         uint32 width;
830         uint32 length;
831         uint32 left;
832         uint32 top;
833         uint32 right;
834         uint32 bottom;
835 }
836 FORM_1;
837
838 typedef struct spool_q_enumforms
839 {
840         POLICY_HND handle;
841         uint32 level;
842         RPC_BUFFER *buffer;
843         uint32 offered;
844 }
845 SPOOL_Q_ENUMFORMS;
846
847 typedef struct spool_r_enumforms
848 {
849         RPC_BUFFER *buffer;
850         uint32 needed;
851         uint32 numofforms;
852         WERROR status;
853 }
854 SPOOL_R_ENUMFORMS;
855
856 typedef struct spool_printer_info_level_1
857 {
858         uint32 flags;
859         uint32 description_ptr;
860         uint32 name_ptr;
861         uint32 comment_ptr;
862         UNISTR2 description;
863         UNISTR2 name;
864         UNISTR2 comment;        
865 } SPOOL_PRINTER_INFO_LEVEL_1;
866
867 typedef struct spool_printer_info_level_2
868 {
869         uint32 servername_ptr;
870         uint32 printername_ptr;
871         uint32 sharename_ptr;
872         uint32 portname_ptr;
873         uint32 drivername_ptr;
874         uint32 comment_ptr;
875         uint32 location_ptr;
876         uint32 devmode_ptr;
877         uint32 sepfile_ptr;
878         uint32 printprocessor_ptr;
879         uint32 datatype_ptr;
880         uint32 parameters_ptr;
881         uint32 secdesc_ptr;
882         uint32 attributes;
883         uint32 priority;
884         uint32 default_priority;
885         uint32 starttime;
886         uint32 untiltime;
887         uint32 status;
888         uint32 cjobs;
889         uint32 averageppm;
890         UNISTR2 servername;
891         UNISTR2 printername;
892         UNISTR2 sharename;
893         UNISTR2 portname;
894         UNISTR2 drivername;
895         UNISTR2 comment;
896         UNISTR2 location;
897         UNISTR2 sepfile;
898         UNISTR2 printprocessor;
899         UNISTR2 datatype;
900         UNISTR2 parameters;
901 }
902 SPOOL_PRINTER_INFO_LEVEL_2;
903
904 typedef struct spool_printer_info_level_3
905 {
906         uint32 secdesc_ptr;
907 }
908 SPOOL_PRINTER_INFO_LEVEL_3;
909
910 typedef struct spool_printer_info_level_7
911 {
912         uint32 guid_ptr;
913         uint32 action;
914         UNISTR2 guid;
915 }
916 SPOOL_PRINTER_INFO_LEVEL_7;
917
918 typedef struct spool_printer_info_level
919 {
920         uint32 level;
921         uint32 info_ptr;
922         SPOOL_PRINTER_INFO_LEVEL_1 *info_1;
923         SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
924         SPOOL_PRINTER_INFO_LEVEL_3 *info_3;
925         SPOOL_PRINTER_INFO_LEVEL_7 *info_7;
926 }
927 SPOOL_PRINTER_INFO_LEVEL;
928
929 typedef struct spool_q_setprinter
930 {
931         POLICY_HND handle;
932         uint32 level;
933         SPOOL_PRINTER_INFO_LEVEL info;
934         SEC_DESC_BUF *secdesc_ctr;
935         DEVMODE_CTR devmode_ctr;
936
937         uint32 command;
938
939 }
940 SPOOL_Q_SETPRINTER;
941
942 typedef struct spool_r_setprinter
943 {
944         WERROR status;
945 }
946 SPOOL_R_SETPRINTER;
947
948 /********************************************/
949
950 typedef struct spool_q_enumprintprocessors
951 {
952         uint32 name_ptr;
953         UNISTR2 name;
954         uint32 environment_ptr;
955         UNISTR2 environment;
956         uint32 level;
957         RPC_BUFFER *buffer;
958         uint32 offered;
959 }
960 SPOOL_Q_ENUMPRINTPROCESSORS;
961
962 typedef struct printprocessor_1
963 {
964         UNISTR name;
965 }
966 PRINTPROCESSOR_1;
967
968 typedef struct spool_r_enumprintprocessors
969 {
970         RPC_BUFFER *buffer;
971         uint32 needed;
972         uint32 returned;
973         WERROR status;
974 }
975 SPOOL_R_ENUMPRINTPROCESSORS;
976
977 typedef struct spool_q_enumprintprocdatatypes
978 {
979         uint32 name_ptr;
980         UNISTR2 name;
981         uint32 processor_ptr;
982         UNISTR2 processor;
983         uint32 level;
984         RPC_BUFFER *buffer;
985         uint32 offered;
986 }
987 SPOOL_Q_ENUMPRINTPROCDATATYPES;
988
989 typedef struct ppdatatype_1
990 {
991         UNISTR name;
992 }
993 PRINTPROCDATATYPE_1;
994
995 typedef struct spool_r_enumprintprocdatatypes
996 {
997         RPC_BUFFER *buffer;
998         uint32 needed;
999         uint32 returned;
1000         WERROR status;
1001 }
1002 SPOOL_R_ENUMPRINTPROCDATATYPES;
1003
1004 typedef struct printmonitor_1
1005 {
1006         UNISTR name;
1007 }
1008 PRINTMONITOR_1;
1009
1010 typedef struct printmonitor_2
1011 {
1012         UNISTR name;
1013         UNISTR environment;
1014         UNISTR dll_name;
1015 }
1016 PRINTMONITOR_2;
1017
1018 typedef struct spool_q_enumprintmonitors
1019 {
1020         uint32 name_ptr;
1021         UNISTR2 name;
1022         uint32 level;
1023         RPC_BUFFER *buffer;
1024         uint32 offered;
1025 }
1026 SPOOL_Q_ENUMPRINTMONITORS;
1027
1028 typedef struct spool_r_enumprintmonitors
1029 {
1030         RPC_BUFFER *buffer;
1031         uint32 needed;
1032         uint32 returned;
1033         WERROR status;
1034 }
1035 SPOOL_R_ENUMPRINTMONITORS;
1036
1037
1038 typedef struct spool_q_enumprinterdata
1039 {
1040         POLICY_HND handle;
1041         uint32 index;
1042         uint32 valuesize;
1043         uint32 datasize;
1044 }
1045 SPOOL_Q_ENUMPRINTERDATA;
1046
1047 typedef struct spool_r_enumprinterdata
1048 {
1049         uint32 valuesize;
1050         uint16 *value;
1051         uint32 realvaluesize;
1052         uint32 type;
1053         uint32 datasize;
1054         uint8 *data;
1055         uint32 realdatasize;
1056         WERROR status;
1057 }
1058 SPOOL_R_ENUMPRINTERDATA;
1059
1060 typedef struct spool_q_setprinterdata
1061 {
1062         POLICY_HND handle;
1063         UNISTR2 value;
1064         uint32 type;
1065         uint32 max_len;
1066         uint8 *data;
1067         uint32 real_len;
1068         uint32 numeric_data;
1069 }
1070 SPOOL_Q_SETPRINTERDATA;
1071
1072 typedef struct spool_r_setprinterdata
1073 {
1074         WERROR status;
1075 }
1076 SPOOL_R_SETPRINTERDATA;
1077
1078 typedef struct _form
1079 {
1080         uint32 flags;
1081         uint32 name_ptr;
1082         uint32 size_x;
1083         uint32 size_y;
1084         uint32 left;
1085         uint32 top;
1086         uint32 right;
1087         uint32 bottom;
1088         UNISTR2 name;
1089 }
1090 FORM;
1091
1092 typedef struct spool_q_getjob
1093 {
1094         POLICY_HND handle;
1095         uint32 jobid;
1096         uint32 level;
1097         RPC_BUFFER *buffer;
1098         uint32 offered;
1099 }
1100 SPOOL_Q_GETJOB;
1101
1102 typedef struct pjob_info_info
1103 {
1104         union
1105         {
1106                 JOB_INFO_1 *job_info_1;
1107                 JOB_INFO_2 *job_info_2;
1108                 void *info;
1109         }
1110         job;
1111
1112 }
1113 PJOB_INFO;
1114
1115 typedef struct spool_r_getjob
1116 {
1117         RPC_BUFFER *buffer;
1118         uint32 needed;
1119         WERROR status;
1120 }
1121 SPOOL_R_GETJOB;
1122
1123 typedef struct spool_q_enumprinterkey
1124 {
1125         POLICY_HND handle;
1126         UNISTR2 key;
1127         uint32 size;
1128 }
1129 SPOOL_Q_ENUMPRINTERKEY;
1130
1131 typedef struct spool_r_enumprinterkey
1132 {
1133         BUFFER5 keys;
1134         uint32 needed;  /* in bytes */
1135         WERROR status;
1136 }
1137 SPOOL_R_ENUMPRINTERKEY;
1138
1139 typedef struct printer_enum_values
1140 {
1141         UNISTR valuename;
1142         uint32 value_len;
1143         uint32 type;
1144         uint8  *data;
1145         uint32 data_len; 
1146         
1147 }
1148 PRINTER_ENUM_VALUES;
1149
1150 typedef struct printer_enum_values_ctr
1151 {
1152         uint32 size;
1153         uint32 size_of_array;
1154         PRINTER_ENUM_VALUES *values;
1155 }
1156 PRINTER_ENUM_VALUES_CTR;
1157
1158 typedef struct spool_q_enumprinterdataex
1159 {
1160         POLICY_HND handle;
1161         UNISTR2 key;
1162         uint32 size;
1163 }
1164 SPOOL_Q_ENUMPRINTERDATAEX;
1165
1166 typedef struct spool_r_enumprinterdataex
1167 {
1168         PRINTER_ENUM_VALUES_CTR ctr;
1169         uint32 needed;
1170         uint32 returned;
1171         WERROR status;
1172 }
1173 SPOOL_R_ENUMPRINTERDATAEX;
1174
1175 #endif /* _RPC_SPOOLSS_H */
1176