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