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