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