b257d3dbcc90f4435f23760c140e86eae3611890
[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_CONTROL_UNPAUSE         0x00000000
126 #define PRINTER_CONTROL_PAUSE           0x00000001
127 #define PRINTER_CONTROL_RESUME          0x00000002
128 #define PRINTER_CONTROL_PURGE           0x00000003
129 #define PRINTER_CONTROL_SET_STATUS      0x00000004
130
131 #define PRINTER_STATUS_OK               0x00000000
132 #define JOB_ACCESS_READ                 0x00000020
133
134 /* JOB status codes. */
135
136 #define JOB_STATUS_QUEUED               0x0000
137 #define JOB_STATUS_PAUSED               0x0001
138 #define JOB_STATUS_ERROR                0x0002
139 #define JOB_STATUS_DELETING             0x0004
140 #define JOB_STATUS_SPOOLING             0x0008
141 #define JOB_STATUS_PRINTING             0x0010
142 #define JOB_STATUS_OFFLINE              0x0020
143 #define JOB_STATUS_PAPEROUT             0x0040
144 #define JOB_STATUS_PRINTED              0x0080
145 #define JOB_STATUS_DELETED              0x0100
146 #define JOB_STATUS_BLOCKED              0x0200
147 #define JOB_STATUS_USER_INTERVENTION    0x0400
148
149 /* Notify field types */
150
151 #define NOTIFY_ONE_VALUE 1              /* Notify data is stored in value1 */
152 #define NOTIFY_TWO_VALUE 2              /* Notify data is stored in value2 */
153 #define NOTIFY_POINTER   3              /* Data is a pointer to a buffer */
154 #define NOTIFY_STRING    4              /* Data is a pointer to a buffer w/length */
155 #define NOTIFY_SECDESC   5              /* Data is a security descriptor */
156
157 #define PRINTER_NOTIFY_TYPE 0x00
158 #define JOB_NOTIFY_TYPE     0x01
159 #define PRINT_TABLE_END     0xFF
160
161 #define MAX_PRINTER_NOTIFY 26
162 #define MAX_JOB_NOTIFY 24
163
164 #define MAX_NOTIFY_TYPE_FOR_NOW 26
165
166 #define PRINTER_NOTIFY_SERVER_NAME              0x00
167 #define PRINTER_NOTIFY_PRINTER_NAME             0x01
168 #define PRINTER_NOTIFY_SHARE_NAME               0x02
169 #define PRINTER_NOTIFY_PORT_NAME                0x03
170 #define PRINTER_NOTIFY_DRIVER_NAME              0x04
171 #define PRINTER_NOTIFY_COMMENT                  0x05
172 #define PRINTER_NOTIFY_LOCATION                 0x06
173 #define PRINTER_NOTIFY_DEVMODE                  0x07
174 #define PRINTER_NOTIFY_SEPFILE                  0x08
175 #define PRINTER_NOTIFY_PRINT_PROCESSOR          0x09
176 #define PRINTER_NOTIFY_PARAMETERS               0x0A
177 #define PRINTER_NOTIFY_DATATYPE                 0x0B
178 #define PRINTER_NOTIFY_SECURITY_DESCRIPTOR      0x0C
179 #define PRINTER_NOTIFY_ATTRIBUTES               0x0D
180 #define PRINTER_NOTIFY_PRIORITY                 0x0E
181 #define PRINTER_NOTIFY_DEFAULT_PRIORITY         0x0F
182 #define PRINTER_NOTIFY_START_TIME               0x10
183 #define PRINTER_NOTIFY_UNTIL_TIME               0x11
184 #define PRINTER_NOTIFY_STATUS                   0x12
185 #define PRINTER_NOTIFY_STATUS_STRING            0x13
186 #define PRINTER_NOTIFY_CJOBS                    0x14
187 #define PRINTER_NOTIFY_AVERAGE_PPM              0x15
188 #define PRINTER_NOTIFY_TOTAL_PAGES              0x16
189 #define PRINTER_NOTIFY_PAGES_PRINTED            0x17
190 #define PRINTER_NOTIFY_TOTAL_BYTES              0x18
191 #define PRINTER_NOTIFY_BYTES_PRINTED            0x19
192
193 #define JOB_NOTIFY_PRINTER_NAME                 0x00
194 #define JOB_NOTIFY_MACHINE_NAME                 0x01
195 #define JOB_NOTIFY_PORT_NAME                    0x02
196 #define JOB_NOTIFY_USER_NAME                    0x03
197 #define JOB_NOTIFY_NOTIFY_NAME                  0x04
198 #define JOB_NOTIFY_DATATYPE                     0x05
199 #define JOB_NOTIFY_PRINT_PROCESSOR              0x06
200 #define JOB_NOTIFY_PARAMETERS                   0x07
201 #define JOB_NOTIFY_DRIVER_NAME                  0x08
202 #define JOB_NOTIFY_DEVMODE                      0x09
203 #define JOB_NOTIFY_STATUS                       0x0A
204 #define JOB_NOTIFY_STATUS_STRING                0x0B
205 #define JOB_NOTIFY_SECURITY_DESCRIPTOR          0x0C
206 #define JOB_NOTIFY_DOCUMENT                     0x0D
207 #define JOB_NOTIFY_PRIORITY                     0x0E
208 #define JOB_NOTIFY_POSITION                     0x0F
209 #define JOB_NOTIFY_SUBMITTED                    0x10
210 #define JOB_NOTIFY_START_TIME                   0x11
211 #define JOB_NOTIFY_UNTIL_TIME                   0x12
212 #define JOB_NOTIFY_TIME                         0x13
213 #define JOB_NOTIFY_TOTAL_PAGES                  0x14
214 #define JOB_NOTIFY_PAGES_PRINTED                0x15
215 #define JOB_NOTIFY_TOTAL_BYTES                  0x16
216 #define JOB_NOTIFY_BYTES_PRINTED                0x17
217
218 #define PRINTER_NOTIFY_OPTIONS_REFRESH          0x01
219
220 #define PRINTER_NOTIFY_INFO_DISCARDED   0x1
221
222 /*
223  * Set of macros for flagging what changed in the PRINTER_INFO_2 struct
224  * when sending messages to other smbd's
225  */
226 #define PRINTER_MESSAGE_NULL            0x00000000
227 #define PRINTER_MESSAGE_DRIVER          0x00000001
228 #define PRINTER_MESSAGE_COMMENT         0x00000002
229 #define PRINTER_MESSAGE_PRINTERNAME     0x00000004
230 #define PRINTER_MESSAGE_LOCATION        0x00000008
231 #define PRINTER_MESSAGE_DEVMODE         0x00000010      /* not curently supported */
232 #define PRINTER_MESSAGE_SEPFILE         0x00000020
233 #define PRINTER_MESSAGE_PRINTPROC       0x00000040
234 #define PRINTER_MESSAGE_PARAMS          0x00000080
235 #define PRINTER_MESSAGE_DATATYPE        0x00000100
236 #define PRINTER_MESSAGE_SECDESC         0x00000200
237 #define PRINTER_MESSAGE_CJOBS           0x00000400
238 #define PRINTER_MESSAGE_PORT            0x00000800
239 #define PRINTER_MESSAGE_SHARENAME       0x00001000
240 #define PRINTER_MESSAGE_ATTRIBUTES      0x00002000
241
242 typedef struct printer_message_info {
243         uint32 low;             /* PRINTER_CHANGE_XXX */
244         uint32 high;            /* PRINTER_CHANGE_XXX */
245         fstring printer_name;
246         uint32 flags;           /* PRINTER_MESSAGE_XXX */
247 }
248 PRINTER_MESSAGE_INFO;
249
250 /*
251  * The printer attributes.
252  * I #defined all of them (grabbed form MSDN)
253  * I'm only using:
254  * ( SHARED | NETWORK | RAW_ONLY )
255  * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
256  */
257
258 #define PRINTER_ATTRIBUTE_SAMBA                 (PRINTER_ATTRIBUTE_RAW_ONLY|\
259                                                  PRINTER_ATTRIBUTE_SHARED|\
260                                                  PRINTER_ATTRIBUTE_LOCAL)
261 #define PRINTER_ATTRIBUTE_NOT_SAMBA             (PRINTER_ATTRIBUTE_NETWORK)
262
263 #define NO_PRIORITY      0
264 #define MAX_PRIORITY    99
265 #define MIN_PRIORITY     1
266 #define DEF_PRIORITY     1
267
268 /* the flags of each printers */
269
270 #define DRIVER_ANY_VERSION              0xffffffff
271 #define DRIVER_MAX_VERSION              4
272
273 /* FLAGS for SPOOLSS_ADDPRINTERDRIVEREX */
274
275 #define APD_STRICT_UPGRADE              0x00000001
276 #define APD_STRICT_DOWNGRADE            0x00000002
277 #define APD_COPY_ALL_FILES              0x00000004
278 #define APD_COPY_NEW_FILES              0x00000008
279
280
281 /* this struct is undocumented */
282 /* thanks to the ddk ... */
283 typedef struct {
284         uint32 size;            /* length of user_name & client_name + 2? */
285         UNISTR2 *client_name;
286         UNISTR2 *user_name;
287         uint32 build;
288         uint32 major;
289         uint32 minor;
290         uint32 processor;
291 } SPOOL_USER_1;
292
293 typedef struct {
294         uint32 level;
295         union {
296                 SPOOL_USER_1 *user1;
297         } user;
298 } SPOOL_USER_CTR;
299
300 /*
301  * various bits in the DEVICEMODE.fields member
302  */
303
304 #define DEVMODE_ORIENTATION             0x00000001
305 #define DEVMODE_PAPERSIZE               0x00000002
306 #define DEVMODE_PAPERLENGTH             0x00000004
307 #define DEVMODE_PAPERWIDTH              0x00000008
308 #define DEVMODE_SCALE                   0x00000010
309 #define DEVMODE_POSITION                0x00000020
310 #define DEVMODE_NUP                     0x00000040
311 #define DEVMODE_COPIES                  0x00000100
312 #define DEVMODE_DEFAULTSOURCE           0x00000200
313 #define DEVMODE_PRINTQUALITY            0x00000400
314 #define DEVMODE_COLOR                   0x00000800
315 #define DEVMODE_DUPLEX                  0x00001000
316 #define DEVMODE_YRESOLUTION             0x00002000
317 #define DEVMODE_TTOPTION                0x00004000
318 #define DEVMODE_COLLATE                 0x00008000
319 #define DEVMODE_FORMNAME                0x00010000
320 #define DEVMODE_LOGPIXELS               0x00020000
321 #define DEVMODE_BITSPERPEL              0x00040000
322 #define DEVMODE_PELSWIDTH               0x00080000
323 #define DEVMODE_PELSHEIGHT              0x00100000
324 #define DEVMODE_DISPLAYFLAGS            0x00200000
325 #define DEVMODE_DISPLAYFREQUENCY        0x00400000
326 #define DEVMODE_ICMMETHOD               0x00800000
327 #define DEVMODE_ICMINTENT               0x01000000
328 #define DEVMODE_MEDIATYPE               0x02000000
329 #define DEVMODE_DITHERTYPE              0x04000000
330 #define DEVMODE_PANNINGWIDTH            0x08000000
331 #define DEVMODE_PANNINGHEIGHT           0x10000000
332
333
334 /* 
335  * Devicemode structure
336  */
337
338 typedef struct devicemode
339 {
340         UNISTR devicename;
341         uint16 specversion;
342         uint16 driverversion;
343         uint16 size;
344         uint16 driverextra;
345         uint32 fields;
346         uint16 orientation;
347         uint16 papersize;
348         uint16 paperlength;
349         uint16 paperwidth;
350         uint16 scale;
351         uint16 copies;
352         uint16 defaultsource;
353         uint16 printquality;
354         uint16 color;
355         uint16 duplex;
356         uint16 yresolution;
357         uint16 ttoption;
358         uint16 collate;
359         UNISTR formname;
360         uint16 logpixels;
361         uint32 bitsperpel;
362         uint32 pelswidth;
363         uint32 pelsheight;
364         uint32 displayflags;
365         uint32 displayfrequency;
366         uint32 icmmethod;
367         uint32 icmintent;
368         uint32 mediatype;
369         uint32 dithertype;
370         uint32 reserved1;
371         uint32 reserved2;
372         uint32 panningwidth;
373         uint32 panningheight;
374         uint8 *dev_private;
375 }
376 DEVICEMODE;
377
378 typedef struct _devmode_cont
379 {
380         uint32 size;
381         uint32 devmode_ptr;
382         DEVICEMODE *devmode;
383 }
384 DEVMODE_CTR;
385
386 typedef struct _printer_default
387 {
388         uint32 datatype_ptr;
389         UNISTR2 datatype;
390         DEVMODE_CTR devmode_cont;
391         uint32 access_required;
392 }
393 PRINTER_DEFAULT;
394
395 /********************************************/
396
397 typedef struct {
398         UNISTR2 *printername;
399         PRINTER_DEFAULT printer_default;
400 } SPOOL_Q_OPEN_PRINTER;
401
402 typedef struct {
403         POLICY_HND handle;      /* handle used along all transactions (20*uint8) */
404         WERROR status;
405 } SPOOL_R_OPEN_PRINTER;
406
407 /********************************************/
408
409 typedef struct {
410         UNISTR2 *printername;
411         PRINTER_DEFAULT printer_default;
412         uint32 user_switch;
413         SPOOL_USER_CTR user_ctr;
414 } SPOOL_Q_OPEN_PRINTER_EX;
415
416 typedef struct {
417         POLICY_HND handle;      /* handle used along all transactions (20*uint8) */
418         WERROR status;
419 } SPOOL_R_OPEN_PRINTER_EX;
420
421 /********************************************/
422
423 typedef struct spool_notify_option_type
424 {
425         uint16 type;
426         uint16 reserved0;
427         uint32 reserved1;
428         uint32 reserved2;
429         uint32 count;
430         uint32 fields_ptr;
431         uint32 count2;
432         uint16 fields[MAX_NOTIFY_TYPE_FOR_NOW];
433 }
434 SPOOL_NOTIFY_OPTION_TYPE;
435
436 typedef struct spool_notify_option_type_ctr
437 {
438         uint32 count;
439         SPOOL_NOTIFY_OPTION_TYPE *type;
440 }
441 SPOOL_NOTIFY_OPTION_TYPE_CTR;
442
443
444
445 typedef struct s_header_type
446 {
447         uint32 type;
448         union
449         {
450                 uint32 value;
451                 UNISTR string;
452         }
453         data;
454 }
455 HEADER_TYPE;
456
457
458 typedef struct spool_q_getprinterdata
459 {
460         POLICY_HND handle;
461         UNISTR2 valuename;
462         uint32 size;
463 }
464 SPOOL_Q_GETPRINTERDATA;
465
466 typedef struct spool_r_getprinterdata
467 {
468         uint32 type;
469         uint32 size;
470         uint8 *data;
471         uint32 needed;
472         WERROR status;
473 }
474 SPOOL_R_GETPRINTERDATA;
475
476 typedef struct spool_notify_option
477 {
478         uint32 version;
479         uint32 flags;
480         uint32 count;
481         uint32 option_type_ptr;
482         SPOOL_NOTIFY_OPTION_TYPE_CTR ctr;
483 }
484 SPOOL_NOTIFY_OPTION;
485
486 typedef struct spool_notify_info_data
487 {
488         uint16 type;
489         uint16 field;
490         uint32 reserved;
491         uint32 id;
492         union {
493                 uint32 value[2];
494                 struct {
495                         uint32 length;
496                         uint16 *string;
497                 } data;
498                 struct {
499                         uint32  size;
500                         SEC_DESC *desc;
501                 } sd;
502         }
503         notify_data;
504         uint32 size;
505         uint32 enc_type;
506 } SPOOL_NOTIFY_INFO_DATA;
507
508 typedef struct spool_notify_info
509 {
510         uint32 version;
511         uint32 flags;
512         uint32 count;
513         SPOOL_NOTIFY_INFO_DATA *data;
514 }
515 SPOOL_NOTIFY_INFO;
516
517 /* If the struct name looks obscure, yes it is ! */
518 /* RemoteFindFirstPrinterChangeNotificationEx query struct */
519 typedef struct spoolss_q_rffpcnex
520 {
521         POLICY_HND handle;
522         uint32 flags;
523         uint32 options;
524         uint32 localmachine_ptr;
525         UNISTR2 localmachine;
526         uint32 printerlocal;
527         uint32 option_ptr;
528         SPOOL_NOTIFY_OPTION *option;
529 }
530 SPOOL_Q_RFFPCNEX;
531
532 typedef struct spool_r_rffpcnex
533 {
534         WERROR status;
535 }
536 SPOOL_R_RFFPCNEX;
537
538 /* Remote Find Next Printer Change Notify Ex */
539 typedef struct spool_q_rfnpcnex
540 {
541         POLICY_HND handle;
542         uint32 change;
543         uint32 option_ptr;
544         SPOOL_NOTIFY_OPTION *option;
545 }
546 SPOOL_Q_RFNPCNEX;
547
548 typedef struct spool_r_rfnpcnex
549 {
550         uint32 info_ptr;
551         SPOOL_NOTIFY_INFO info;
552         WERROR status;
553 }
554 SPOOL_R_RFNPCNEX;
555
556 typedef struct printer_info_0
557 {
558         UNISTR printername;
559         UNISTR servername;
560         uint32 cjobs;
561         uint32 total_jobs;
562         uint32 total_bytes;
563         
564         uint16 year;
565         uint16 month;
566         uint16 dayofweek;
567         uint16 day;
568         uint16 hour;
569         uint16 minute;
570         uint16 second;
571         uint16 milliseconds;
572
573         uint32 global_counter;
574         uint32 total_pages;
575
576         uint16 major_version;
577         uint16 build_version;
578
579         uint32 unknown7;
580         uint32 unknown8;
581         uint32 unknown9;
582         uint32 session_counter;
583         uint32 unknown11;
584         uint32 printer_errors;
585         uint32 unknown13;
586         uint32 unknown14;
587         uint32 unknown15;
588         uint32 unknown16;
589         uint32 change_id;
590         uint32 unknown18;
591         uint32 status;
592         uint32 unknown20;
593         uint32 c_setprinter;
594
595         uint16 unknown22;
596         uint16 unknown23;
597         uint16 unknown24;
598         uint16 unknown25;
599         uint16 unknown26;
600         uint16 unknown27;
601         uint16 unknown28;
602         uint16 unknown29;
603 } PRINTER_INFO_0;
604
605 typedef struct printer_info_1
606 {
607         uint32 flags;
608         UNISTR description;
609         UNISTR name;
610         UNISTR comment;
611 }
612 PRINTER_INFO_1;
613
614 typedef struct printer_info_2
615 {
616         UNISTR servername;
617         UNISTR printername;
618         UNISTR sharename;
619         UNISTR portname;
620         UNISTR drivername;
621         UNISTR comment;
622         UNISTR location;
623         DEVICEMODE *devmode;
624         UNISTR sepfile;
625         UNISTR printprocessor;
626         UNISTR datatype;
627         UNISTR parameters;
628         SEC_DESC *secdesc;
629         uint32 attributes;
630         uint32 priority;
631         uint32 defaultpriority;
632         uint32 starttime;
633         uint32 untiltime;
634         uint32 status;
635         uint32 cjobs;
636         uint32 averageppm;
637 }
638 PRINTER_INFO_2;
639
640 typedef struct printer_info_3
641 {
642         SEC_DESC *secdesc;
643 }
644 PRINTER_INFO_3;
645
646 typedef struct printer_info_4
647 {
648         UNISTR printername;
649         UNISTR servername;
650         uint32 attributes;
651 }
652 PRINTER_INFO_4;
653
654 typedef struct printer_info_5
655 {
656         UNISTR printername;
657         UNISTR portname;
658         uint32 attributes;
659         uint32 device_not_selected_timeout;
660         uint32 transmission_retry_timeout;
661 }
662 PRINTER_INFO_5;
663
664 typedef struct printer_info_6
665 {
666         uint32 status;
667 }
668 PRINTER_INFO_6;
669
670 #define SPOOL_DS_PUBLISH        1
671 #define SPOOL_DS_UPDATE         2
672 #define SPOOL_DS_UNPUBLISH      4
673 #define SPOOL_DS_PENDING        0x80000000
674
675 typedef struct printer_info_7
676 {
677         UNISTR guid; /* text form of printer guid */
678         uint32 action;
679 }
680 PRINTER_INFO_7;
681
682 typedef struct spool_q_enumprinters
683 {
684         uint32 flags;
685         uint32 servername_ptr;
686         UNISTR2 servername;
687         uint32 level;
688         RPC_BUFFER *buffer;
689         uint32 offered;
690 }
691 SPOOL_Q_ENUMPRINTERS;
692
693 typedef struct printer_info_ctr_info
694 {
695         PRINTER_INFO_0 *printers_0;
696         PRINTER_INFO_1 *printers_1;
697         PRINTER_INFO_2 *printers_2;
698         PRINTER_INFO_3 *printers_3;
699         PRINTER_INFO_4 *printers_4;
700         PRINTER_INFO_5 *printers_5;
701         PRINTER_INFO_7 *printers_7;
702 }
703 PRINTER_INFO_CTR;
704
705 typedef struct spool_r_enumprinters
706 {
707         RPC_BUFFER *buffer;
708         uint32 needed;          /* bytes needed */
709         uint32 returned;        /* number of printers */
710         WERROR status;
711 }
712 SPOOL_R_ENUMPRINTERS;
713
714
715 typedef struct spool_q_getprinter
716 {
717         POLICY_HND handle;
718         uint32 level;
719         RPC_BUFFER *buffer;
720         uint32 offered;
721 }
722 SPOOL_Q_GETPRINTER;
723
724 typedef struct printer_info_info
725 {
726         union
727         {
728                 PRINTER_INFO_0 *info0;
729                 PRINTER_INFO_1 *info1;
730                 PRINTER_INFO_2 *info2;
731                 void *info;
732         } printer;
733 } PRINTER_INFO;
734
735 typedef struct spool_r_getprinter
736 {
737         RPC_BUFFER *buffer;
738         uint32 needed;
739         WERROR status;
740 } SPOOL_R_GETPRINTER;
741
742 typedef struct driver_info_1
743 {
744         UNISTR name;
745 } DRIVER_INFO_1;
746
747 typedef struct driver_info_2
748 {
749         uint32 version;
750         UNISTR name;
751         UNISTR architecture;
752         UNISTR driverpath;
753         UNISTR datafile;
754         UNISTR configfile;
755 } DRIVER_INFO_2;
756
757 typedef struct driver_info_3
758 {
759         uint32 version;
760         UNISTR name;
761         UNISTR architecture;
762         UNISTR driverpath;
763         UNISTR datafile;
764         UNISTR configfile;
765         UNISTR helpfile;
766         uint16 *dependentfiles;
767         UNISTR monitorname;
768         UNISTR defaultdatatype;
769 }
770 DRIVER_INFO_3;
771
772 typedef struct driver_info_6
773 {
774         uint32 version;
775         UNISTR name;
776         UNISTR architecture;
777         UNISTR driverpath;
778         UNISTR datafile;
779         UNISTR configfile;
780         UNISTR helpfile;
781         uint16 *dependentfiles;
782         UNISTR monitorname;
783         UNISTR defaultdatatype;
784         uint16* previousdrivernames;
785         NTTIME driver_date;
786         uint32 padding;
787         uint32 driver_version_low;
788         uint32 driver_version_high;
789         UNISTR mfgname;
790         UNISTR oem_url;
791         UNISTR hardware_id;
792         UNISTR provider;
793 }
794 DRIVER_INFO_6;
795
796 typedef struct driver_info_info
797 {
798         DRIVER_INFO_1 *info1;
799         DRIVER_INFO_2 *info2;
800         DRIVER_INFO_3 *info3;
801         DRIVER_INFO_6 *info6;
802 }
803 PRINTER_DRIVER_CTR;
804
805 typedef struct spool_q_getprinterdriver2
806 {
807         POLICY_HND handle;
808         uint32 architecture_ptr;
809         UNISTR2 architecture;
810         uint32 level;
811         RPC_BUFFER *buffer;
812         uint32 offered;
813         uint32 clientmajorversion;
814         uint32 clientminorversion;
815 }
816 SPOOL_Q_GETPRINTERDRIVER2;
817
818 typedef struct spool_r_getprinterdriver2
819 {
820         RPC_BUFFER *buffer;
821         uint32 needed;
822         uint32 servermajorversion;
823         uint32 serverminorversion;
824         WERROR status;
825 }
826 SPOOL_R_GETPRINTERDRIVER2;
827
828
829 typedef struct add_jobinfo_1
830 {
831         UNISTR path;
832         uint32 job_number;
833 }
834 ADD_JOBINFO_1;
835
836
837 /*
838  * I'm really wondering how many different time formats
839  * I will have to cope with
840  *
841  * JFM, 09/13/98 In a mad mood ;-(
842 */
843 typedef struct systemtime
844 {
845         uint16 year;
846         uint16 month;
847         uint16 dayofweek;
848         uint16 day;
849         uint16 hour;
850         uint16 minute;
851         uint16 second;
852         uint16 milliseconds;
853 }
854 SYSTEMTIME;
855
856 typedef struct s_job_info_1
857 {
858         uint32 jobid;
859         UNISTR printername;
860         UNISTR machinename;
861         UNISTR username;
862         UNISTR document;
863         UNISTR datatype;
864         UNISTR text_status;
865         uint32 status;
866         uint32 priority;
867         uint32 position;
868         uint32 totalpages;
869         uint32 pagesprinted;
870         SYSTEMTIME submitted;
871 }
872 JOB_INFO_1;
873
874 typedef struct s_job_info_2
875 {
876         uint32 jobid;
877         UNISTR printername;
878         UNISTR machinename;
879         UNISTR username;
880         UNISTR document;
881         UNISTR notifyname;
882         UNISTR datatype;
883         UNISTR printprocessor;
884         UNISTR parameters;
885         UNISTR drivername;
886         DEVICEMODE *devmode;
887         UNISTR text_status;
888 /*      SEC_DESC sec_desc;*/
889         uint32 status;
890         uint32 priority;
891         uint32 position;
892         uint32 starttime;
893         uint32 untiltime;
894         uint32 totalpages;
895         uint32 size;
896         SYSTEMTIME submitted;
897         uint32 timeelapsed;
898         uint32 pagesprinted;
899 }
900 JOB_INFO_2;
901
902 typedef struct spool_q_enumjobs
903 {
904         POLICY_HND handle;
905         uint32 firstjob;
906         uint32 numofjobs;
907         uint32 level;
908         RPC_BUFFER *buffer;
909         uint32 offered;
910 }
911 SPOOL_Q_ENUMJOBS;
912
913 typedef struct job_info_ctr_info
914 {
915         union
916         {
917                 JOB_INFO_1 *job_info_1;
918                 JOB_INFO_2 *job_info_2;
919                 void *info;
920         } job;
921
922 } JOB_INFO_CTR;
923
924 typedef struct spool_r_enumjobs
925 {
926         RPC_BUFFER *buffer;
927         uint32 needed;
928         uint32 returned;
929         WERROR status;
930 }
931 SPOOL_R_ENUMJOBS;
932
933 typedef struct s_port_info_1
934 {
935         UNISTR port_name;
936 }
937 PORT_INFO_1;
938
939 typedef struct s_port_info_2
940 {
941         UNISTR port_name;
942         UNISTR monitor_name;
943         UNISTR description;
944         uint32 port_type;
945         uint32 reserved;
946 }
947 PORT_INFO_2;
948
949 /* Port Type bits */
950 #define PORT_TYPE_WRITE         0x0001
951 #define PORT_TYPE_READ          0x0002
952 #define PORT_TYPE_REDIRECTED    0x0004
953 #define PORT_TYPE_NET_ATTACHED  0x0008
954
955 typedef struct spool_q_enumports
956 {
957         uint32 name_ptr;
958         UNISTR2 name;
959         uint32 level;
960         RPC_BUFFER *buffer;
961         uint32 offered;
962 }
963 SPOOL_Q_ENUMPORTS;
964
965 typedef struct port_info_ctr_info
966 {
967         union
968         {
969                 PORT_INFO_1 *info_1;
970                 PORT_INFO_2 *info_2;
971         }
972         port;
973
974 }
975 PORT_INFO_CTR;
976
977 typedef struct spool_r_enumports
978 {
979         RPC_BUFFER *buffer;
980         uint32 needed;          /* bytes needed */
981         uint32 returned;        /* number of printers */
982         WERROR status;
983 }
984 SPOOL_R_ENUMPORTS;
985
986 typedef struct job_info_info
987 {
988         union
989         {
990                 JOB_INFO_1 job_info_1;
991                 JOB_INFO_2 job_info_2;
992         }
993         job;
994
995 }
996 JOB_INFO;
997
998 typedef struct spool_q_setjob
999 {
1000         POLICY_HND handle;
1001         uint32 jobid;
1002         uint32 level;
1003         JOB_INFO ctr;
1004         uint32 command;
1005
1006 }
1007 SPOOL_Q_SETJOB;
1008
1009 typedef struct spool_r_setjob
1010 {
1011         WERROR status;
1012
1013 }
1014 SPOOL_R_SETJOB;
1015
1016 typedef struct spool_q_enumprinterdrivers
1017 {
1018         uint32 name_ptr;
1019         UNISTR2 name;
1020         uint32 environment_ptr;
1021         UNISTR2 environment;
1022         uint32 level;
1023         RPC_BUFFER *buffer;
1024         uint32 offered;
1025 }
1026 SPOOL_Q_ENUMPRINTERDRIVERS;
1027
1028 typedef struct spool_r_enumprinterdrivers
1029 {
1030         RPC_BUFFER *buffer;
1031         uint32 needed;
1032         uint32 returned;
1033         WERROR status;
1034 }
1035 SPOOL_R_ENUMPRINTERDRIVERS;
1036
1037 #define FORM_USER    0
1038 #define FORM_BUILTIN 1
1039 #define FORM_PRINTER 2
1040
1041 typedef struct spool_form_1
1042 {
1043         uint32 flag;
1044         UNISTR name;
1045         uint32 width;
1046         uint32 length;
1047         uint32 left;
1048         uint32 top;
1049         uint32 right;
1050         uint32 bottom;
1051 }
1052 FORM_1;
1053
1054 typedef struct spool_q_enumforms
1055 {
1056         POLICY_HND handle;
1057         uint32 level;
1058         RPC_BUFFER *buffer;
1059         uint32 offered;
1060 }
1061 SPOOL_Q_ENUMFORMS;
1062
1063 typedef struct spool_r_enumforms
1064 {
1065         RPC_BUFFER *buffer;
1066         uint32 needed;
1067         uint32 numofforms;
1068         WERROR status;
1069 }
1070 SPOOL_R_ENUMFORMS;
1071
1072 typedef struct spool_printer_info_level_1
1073 {
1074         uint32 flags;
1075         uint32 description_ptr;
1076         uint32 name_ptr;
1077         uint32 comment_ptr;
1078         UNISTR2 description;
1079         UNISTR2 name;
1080         UNISTR2 comment;        
1081 } SPOOL_PRINTER_INFO_LEVEL_1;
1082
1083 typedef struct spool_printer_info_level_2
1084 {
1085         uint32 servername_ptr;
1086         uint32 printername_ptr;
1087         uint32 sharename_ptr;
1088         uint32 portname_ptr;
1089         uint32 drivername_ptr;
1090         uint32 comment_ptr;
1091         uint32 location_ptr;
1092         uint32 devmode_ptr;
1093         uint32 sepfile_ptr;
1094         uint32 printprocessor_ptr;
1095         uint32 datatype_ptr;
1096         uint32 parameters_ptr;
1097         uint32 secdesc_ptr;
1098         uint32 attributes;
1099         uint32 priority;
1100         uint32 default_priority;
1101         uint32 starttime;
1102         uint32 untiltime;
1103         uint32 status;
1104         uint32 cjobs;
1105         uint32 averageppm;
1106         UNISTR2 servername;
1107         UNISTR2 printername;
1108         UNISTR2 sharename;
1109         UNISTR2 portname;
1110         UNISTR2 drivername;
1111         UNISTR2 comment;
1112         UNISTR2 location;
1113         UNISTR2 sepfile;
1114         UNISTR2 printprocessor;
1115         UNISTR2 datatype;
1116         UNISTR2 parameters;
1117 }
1118 SPOOL_PRINTER_INFO_LEVEL_2;
1119
1120 typedef struct spool_printer_info_level_3
1121 {
1122         uint32 secdesc_ptr;
1123 }
1124 SPOOL_PRINTER_INFO_LEVEL_3;
1125
1126 typedef struct spool_printer_info_level_7
1127 {
1128         uint32 guid_ptr;
1129         uint32 action;
1130         UNISTR2 guid;
1131 }
1132 SPOOL_PRINTER_INFO_LEVEL_7;
1133
1134 typedef struct spool_printer_info_level
1135 {
1136         uint32 level;
1137         uint32 info_ptr;
1138         SPOOL_PRINTER_INFO_LEVEL_1 *info_1;
1139         SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
1140         SPOOL_PRINTER_INFO_LEVEL_3 *info_3;
1141         SPOOL_PRINTER_INFO_LEVEL_7 *info_7;
1142 }
1143 SPOOL_PRINTER_INFO_LEVEL;
1144
1145 typedef struct spool_printer_driver_info_level_3
1146 {
1147         uint32 cversion;
1148         uint32 name_ptr;
1149         uint32 environment_ptr;
1150         uint32 driverpath_ptr;
1151         uint32 datafile_ptr;
1152         uint32 configfile_ptr;
1153         uint32 helpfile_ptr;
1154         uint32 monitorname_ptr;
1155         uint32 defaultdatatype_ptr;
1156         uint32 dependentfilessize;
1157         uint32 dependentfiles_ptr;
1158
1159         UNISTR2 name;
1160         UNISTR2 environment;
1161         UNISTR2 driverpath;
1162         UNISTR2 datafile;
1163         UNISTR2 configfile;
1164         UNISTR2 helpfile;
1165         UNISTR2 monitorname;
1166         UNISTR2 defaultdatatype;
1167         BUFFER5 dependentfiles;
1168
1169 }
1170 SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;
1171
1172 /* SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 structure */
1173 typedef struct {
1174         uint32 version;
1175         uint32 name_ptr;
1176         uint32 environment_ptr;
1177         uint32 driverpath_ptr;
1178         uint32 datafile_ptr;
1179         uint32 configfile_ptr;
1180         uint32 helpfile_ptr;
1181         uint32 monitorname_ptr;
1182         uint32 defaultdatatype_ptr;
1183         uint32 dependentfiles_len;
1184         uint32 dependentfiles_ptr;
1185         uint32 previousnames_len;
1186         uint32 previousnames_ptr;
1187         NTTIME  driverdate;
1188         uint64  driverversion;
1189         uint32  dummy4;
1190         uint32 mfgname_ptr;
1191         uint32 oemurl_ptr;
1192         uint32 hardwareid_ptr;
1193         uint32 provider_ptr;
1194         UNISTR2 name;
1195         UNISTR2 environment;
1196         UNISTR2 driverpath;
1197         UNISTR2 datafile;
1198         UNISTR2 configfile;
1199         UNISTR2 helpfile;
1200         UNISTR2 monitorname;
1201         UNISTR2 defaultdatatype;
1202         BUFFER5 dependentfiles;
1203         BUFFER5 previousnames;
1204         UNISTR2 mfgname;
1205         UNISTR2 oemurl;
1206         UNISTR2 hardwareid;
1207         UNISTR2 provider;
1208 } SPOOL_PRINTER_DRIVER_INFO_LEVEL_6;
1209
1210
1211 typedef struct spool_printer_driver_info_level
1212 {
1213         uint32 level;
1214         uint32 ptr;
1215         SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
1216         SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *info_6;
1217 }
1218 SPOOL_PRINTER_DRIVER_INFO_LEVEL;
1219
1220
1221 typedef struct spool_q_setprinter
1222 {
1223         POLICY_HND handle;
1224         uint32 level;
1225         SPOOL_PRINTER_INFO_LEVEL info;
1226         SEC_DESC_BUF *secdesc_ctr;
1227         DEVMODE_CTR devmode_ctr;
1228
1229         uint32 command;
1230
1231 }
1232 SPOOL_Q_SETPRINTER;
1233
1234 typedef struct spool_r_setprinter
1235 {
1236         WERROR status;
1237 }
1238 SPOOL_R_SETPRINTER;
1239
1240 /********************************************/
1241
1242 typedef struct {
1243         UNISTR2 *server_name;
1244         uint32 level;
1245         SPOOL_PRINTER_INFO_LEVEL info;
1246         DEVMODE_CTR devmode_ctr;
1247         SEC_DESC_BUF *secdesc_ctr;
1248         uint32 user_switch;
1249         SPOOL_USER_CTR user_ctr;
1250 } SPOOL_Q_ADDPRINTEREX;
1251
1252 typedef struct {
1253         POLICY_HND handle;
1254         WERROR status;
1255 } SPOOL_R_ADDPRINTEREX;
1256
1257 /********************************************/
1258
1259 typedef struct spool_q_addprinterdriver
1260 {
1261         uint32 server_name_ptr;
1262         UNISTR2 server_name;
1263         uint32 level;
1264         SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1265 }
1266 SPOOL_Q_ADDPRINTERDRIVER;
1267
1268 typedef struct spool_r_addprinterdriver
1269 {
1270         WERROR status;
1271 }
1272 SPOOL_R_ADDPRINTERDRIVER;
1273
1274 typedef struct spool_q_addprinterdriverex
1275 {
1276         uint32 server_name_ptr;
1277         UNISTR2 server_name;
1278         uint32 level;
1279         SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1280         uint32 copy_flags;
1281 }
1282 SPOOL_Q_ADDPRINTERDRIVEREX;
1283
1284 typedef struct spool_r_addprinterdriverex
1285 {
1286         WERROR status;
1287 }
1288 SPOOL_R_ADDPRINTERDRIVEREX;
1289
1290
1291 typedef struct driver_directory_1
1292 {
1293         UNISTR name;
1294 }
1295 DRIVER_DIRECTORY_1;
1296
1297 typedef struct driver_info_ctr_info
1298 {
1299         DRIVER_DIRECTORY_1 *info1;
1300 }
1301 DRIVER_DIRECTORY_CTR;
1302
1303 typedef struct spool_q_getprinterdriverdirectory
1304 {
1305         uint32 name_ptr;
1306         UNISTR2 name;
1307         uint32 environment_ptr;
1308         UNISTR2 environment;
1309         uint32 level;
1310         RPC_BUFFER *buffer;
1311         uint32 offered;
1312 }
1313 SPOOL_Q_GETPRINTERDRIVERDIR;
1314
1315 typedef struct spool_r_getprinterdriverdirectory
1316 {
1317         RPC_BUFFER *buffer;
1318         uint32 needed;
1319         WERROR status;
1320 }
1321 SPOOL_R_GETPRINTERDRIVERDIR;
1322
1323 typedef struct spool_q_enumprintprocessors
1324 {
1325         uint32 name_ptr;
1326         UNISTR2 name;
1327         uint32 environment_ptr;
1328         UNISTR2 environment;
1329         uint32 level;
1330         RPC_BUFFER *buffer;
1331         uint32 offered;
1332 }
1333 SPOOL_Q_ENUMPRINTPROCESSORS;
1334
1335 typedef struct printprocessor_1
1336 {
1337         UNISTR name;
1338 }
1339 PRINTPROCESSOR_1;
1340
1341 typedef struct spool_r_enumprintprocessors
1342 {
1343         RPC_BUFFER *buffer;
1344         uint32 needed;
1345         uint32 returned;
1346         WERROR status;
1347 }
1348 SPOOL_R_ENUMPRINTPROCESSORS;
1349
1350 typedef struct spool_q_enumprintprocdatatypes
1351 {
1352         uint32 name_ptr;
1353         UNISTR2 name;
1354         uint32 processor_ptr;
1355         UNISTR2 processor;
1356         uint32 level;
1357         RPC_BUFFER *buffer;
1358         uint32 offered;
1359 }
1360 SPOOL_Q_ENUMPRINTPROCDATATYPES;
1361
1362 typedef struct ppdatatype_1
1363 {
1364         UNISTR name;
1365 }
1366 PRINTPROCDATATYPE_1;
1367
1368 typedef struct spool_r_enumprintprocdatatypes
1369 {
1370         RPC_BUFFER *buffer;
1371         uint32 needed;
1372         uint32 returned;
1373         WERROR status;
1374 }
1375 SPOOL_R_ENUMPRINTPROCDATATYPES;
1376
1377 typedef struct printmonitor_1
1378 {
1379         UNISTR name;
1380 }
1381 PRINTMONITOR_1;
1382
1383 typedef struct printmonitor_2
1384 {
1385         UNISTR name;
1386         UNISTR environment;
1387         UNISTR dll_name;
1388 }
1389 PRINTMONITOR_2;
1390
1391 typedef struct spool_q_enumprintmonitors
1392 {
1393         uint32 name_ptr;
1394         UNISTR2 name;
1395         uint32 level;
1396         RPC_BUFFER *buffer;
1397         uint32 offered;
1398 }
1399 SPOOL_Q_ENUMPRINTMONITORS;
1400
1401 typedef struct spool_r_enumprintmonitors
1402 {
1403         RPC_BUFFER *buffer;
1404         uint32 needed;
1405         uint32 returned;
1406         WERROR status;
1407 }
1408 SPOOL_R_ENUMPRINTMONITORS;
1409
1410
1411 typedef struct spool_q_enumprinterdata
1412 {
1413         POLICY_HND handle;
1414         uint32 index;
1415         uint32 valuesize;
1416         uint32 datasize;
1417 }
1418 SPOOL_Q_ENUMPRINTERDATA;
1419
1420 typedef struct spool_r_enumprinterdata
1421 {
1422         uint32 valuesize;
1423         uint16 *value;
1424         uint32 realvaluesize;
1425         uint32 type;
1426         uint32 datasize;
1427         uint8 *data;
1428         uint32 realdatasize;
1429         WERROR status;
1430 }
1431 SPOOL_R_ENUMPRINTERDATA;
1432
1433 typedef struct spool_q_setprinterdata
1434 {
1435         POLICY_HND handle;
1436         UNISTR2 value;
1437         uint32 type;
1438         uint32 max_len;
1439         uint8 *data;
1440         uint32 real_len;
1441         uint32 numeric_data;
1442 }
1443 SPOOL_Q_SETPRINTERDATA;
1444
1445 typedef struct spool_r_setprinterdata
1446 {
1447         WERROR status;
1448 }
1449 SPOOL_R_SETPRINTERDATA;
1450
1451 typedef struct spool_q_resetprinter
1452 {
1453         POLICY_HND handle;
1454         uint32 datatype_ptr;
1455         UNISTR2 datatype;
1456         DEVMODE_CTR devmode_ctr;
1457
1458 } SPOOL_Q_RESETPRINTER;
1459
1460 typedef struct spool_r_resetprinter
1461 {
1462         WERROR status;
1463
1464 SPOOL_R_RESETPRINTER;
1465
1466
1467
1468 typedef struct _form
1469 {
1470         uint32 flags;
1471         uint32 name_ptr;
1472         uint32 size_x;
1473         uint32 size_y;
1474         uint32 left;
1475         uint32 top;
1476         uint32 right;
1477         uint32 bottom;
1478         UNISTR2 name;
1479 }
1480 FORM;
1481
1482 typedef struct spool_q_getjob
1483 {
1484         POLICY_HND handle;
1485         uint32 jobid;
1486         uint32 level;
1487         RPC_BUFFER *buffer;
1488         uint32 offered;
1489 }
1490 SPOOL_Q_GETJOB;
1491
1492 typedef struct pjob_info_info
1493 {
1494         union
1495         {
1496                 JOB_INFO_1 *job_info_1;
1497                 JOB_INFO_2 *job_info_2;
1498                 void *info;
1499         }
1500         job;
1501
1502 }
1503 PJOB_INFO;
1504
1505 typedef struct spool_r_getjob
1506 {
1507         RPC_BUFFER *buffer;
1508         uint32 needed;
1509         WERROR status;
1510 }
1511 SPOOL_R_GETJOB;
1512
1513 typedef struct spool_q_replyopenprinter
1514 {
1515         UNISTR2 string;
1516         uint32 printer;
1517         uint32 type;
1518         uint32 unknown0;
1519         uint32 unknown1;
1520 }
1521 SPOOL_Q_REPLYOPENPRINTER;
1522
1523 typedef struct spool_r_replyopenprinter
1524 {
1525         POLICY_HND handle;
1526         WERROR status;
1527 }
1528 SPOOL_R_REPLYOPENPRINTER;
1529
1530 typedef struct spool_q_rrpcn
1531 {
1532         POLICY_HND handle;
1533         uint32 change_low;
1534         uint32 change_high;
1535         uint32 unknown0;
1536         uint32 unknown1;
1537         uint32 info_ptr;
1538         SPOOL_NOTIFY_INFO info; 
1539 }
1540 SPOOL_Q_REPLY_RRPCN;
1541
1542 typedef struct spool_r_rrpcn
1543 {
1544         uint32 unknown0;
1545         WERROR status;
1546 }
1547 SPOOL_R_REPLY_RRPCN;
1548
1549 typedef struct spool_q_getprinterdataex
1550 {
1551         POLICY_HND handle;
1552         UNISTR2 keyname;
1553         UNISTR2 valuename;
1554         uint32 size;
1555 }
1556 SPOOL_Q_GETPRINTERDATAEX;
1557
1558 typedef struct spool_r_getprinterdataex
1559 {
1560         uint32 type;
1561         uint32 size;
1562         uint8 *data;
1563         uint32 needed;
1564         WERROR status;
1565 }
1566 SPOOL_R_GETPRINTERDATAEX;
1567
1568 typedef struct spool_q_setprinterdataex
1569 {
1570         POLICY_HND handle;
1571         UNISTR2 key;
1572         UNISTR2 value;
1573         uint32 type;
1574         uint32 max_len;
1575         uint8 *data;
1576         uint32 real_len;
1577         uint32 numeric_data;
1578 }
1579 SPOOL_Q_SETPRINTERDATAEX;
1580
1581 typedef struct spool_r_setprinterdataex
1582 {
1583         WERROR status;
1584 }
1585 SPOOL_R_SETPRINTERDATAEX;
1586
1587
1588 typedef struct spool_q_enumprinterkey
1589 {
1590         POLICY_HND handle;
1591         UNISTR2 key;
1592         uint32 size;
1593 }
1594 SPOOL_Q_ENUMPRINTERKEY;
1595
1596 typedef struct spool_r_enumprinterkey
1597 {
1598         BUFFER5 keys;
1599         uint32 needed;  /* in bytes */
1600         WERROR status;
1601 }
1602 SPOOL_R_ENUMPRINTERKEY;
1603
1604 typedef struct printer_enum_values
1605 {
1606         UNISTR valuename;
1607         uint32 value_len;
1608         uint32 type;
1609         uint8  *data;
1610         uint32 data_len; 
1611         
1612 }
1613 PRINTER_ENUM_VALUES;
1614
1615 typedef struct printer_enum_values_ctr
1616 {
1617         uint32 size;
1618         uint32 size_of_array;
1619         PRINTER_ENUM_VALUES *values;
1620 }
1621 PRINTER_ENUM_VALUES_CTR;
1622
1623 typedef struct spool_q_enumprinterdataex
1624 {
1625         POLICY_HND handle;
1626         UNISTR2 key;
1627         uint32 size;
1628 }
1629 SPOOL_Q_ENUMPRINTERDATAEX;
1630
1631 typedef struct spool_r_enumprinterdataex
1632 {
1633         PRINTER_ENUM_VALUES_CTR ctr;
1634         uint32 needed;
1635         uint32 returned;
1636         WERROR status;
1637 }
1638 SPOOL_R_ENUMPRINTERDATAEX;
1639
1640 typedef struct printprocessor_directory_1
1641 {
1642         UNISTR name;
1643 }
1644 PRINTPROCESSOR_DIRECTORY_1;
1645
1646 typedef struct spool_q_getprintprocessordirectory
1647 {
1648         UNISTR2 name;
1649         UNISTR2 environment;
1650         uint32 level;
1651         RPC_BUFFER *buffer;
1652         uint32 offered;
1653 }
1654 SPOOL_Q_GETPRINTPROCESSORDIRECTORY;
1655
1656 typedef struct spool_r_getprintprocessordirectory
1657 {
1658         RPC_BUFFER *buffer;
1659         uint32 needed;
1660         WERROR status;
1661 }
1662 SPOOL_R_GETPRINTPROCESSORDIRECTORY;
1663
1664 /**************************************/
1665
1666 #define MAX_PORTNAME            64
1667 #define MAX_NETWORK_NAME        49
1668 #define MAX_SNMP_COMM_NAME      33
1669 #define MAX_QUEUE_NAME          33
1670 #define MAX_IPADDR_STRING       17
1671                 
1672 typedef struct {
1673         uint16 portname[MAX_PORTNAME];
1674         uint32 version;
1675         uint32 protocol;
1676         uint32 size;
1677         uint32 reserved;
1678         uint16 hostaddress[MAX_NETWORK_NAME];
1679         uint16 snmpcommunity[MAX_SNMP_COMM_NAME];
1680         uint32 dblspool;
1681         uint16 queue[MAX_QUEUE_NAME];
1682         uint16 ipaddress[MAX_IPADDR_STRING];
1683         uint32 port;
1684         uint32 snmpenabled;
1685         uint32 snmpdevindex;
1686 } SPOOL_PORT_DATA_1;
1687
1688 typedef struct {
1689         POLICY_HND handle;
1690         UNISTR2 dataname;
1691         RPC_BUFFER indata;
1692         uint32 indata_len;
1693         uint32 offered;
1694         uint32 unknown;
1695 } SPOOL_Q_XCVDATAPORT;
1696
1697 typedef struct {
1698         RPC_BUFFER outdata;
1699         uint32 needed;
1700         uint32 unknown;
1701         WERROR status;
1702 } SPOOL_R_XCVDATAPORT;
1703
1704 #define PRINTER_DRIVER_VERSION 2
1705 #define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
1706
1707 #endif /* _RPC_SPOOLSS_H */
1708