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