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