33541c12fe06e4585dae920f7fd8d890e5b4dbb0
[ira/wip.git] / source3 / include / rpc_spoolss.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell              1992-2000,
6    Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
7    Copyright (C) Jean Francois Micouleau      1998-2000.
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 2 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, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #ifndef _RPC_SPOOLSS_H          /* _RPC_SPOOLSS_H */
25 #define _RPC_SPOOLSS_H
26
27 #define INTEGER 1
28 #define STRING 2
29
30 /* spoolss pipe: this are the calls which are not implemented ...
31 #define SPOOLSS_OPENPRINTER                             0x01
32 #define SPOOLSS_GETPRINTERDRIVER                        0x0b
33 #define SPOOLSS_DELETEPRINTERDRIVER                     0x0d
34 #define SPOOLSS_ADDPRINTPROCESSOR                       0x0e
35 #define SPOOLSS_GETPRINTPROCESSORDIRECTORY              0x10
36 #define SPOOLSS_READPRINTER                             0x16
37 #define SPOOLSS_WAITFORPRINTERCHANGE                    0x1c
38 #define SPOOLSS_ADDPORT                                 0x25
39 #define SPOOLSS_CONFIGUREPORT                           0x26
40 #define SPOOLSS_DELETEPORT                              0x27
41 #define SPOOLSS_CREATEPRINTERIC                         0x28
42 #define SPOOLSS_PLAYGDISCRIPTONPRINTERIC                0x29
43 #define SPOOLSS_DELETEPRINTERIC                         0x2a
44 #define SPOOLSS_ADDPRINTERCONNECTION                    0x2b
45 #define SPOOLSS_DELETEPRINTERCONNECTION                 0x2c
46 #define SPOOLSS_PRINTERMESSAGEBOX                       0x2d
47 #define SPOOLSS_ADDMONITOR                              0x2e
48 #define SPOOLSS_DELETEMONITOR                           0x2f
49 #define SPOOLSS_DELETEPRINTPROCESSOR                    0x30
50 #define SPOOLSS_ADDPRINTPROVIDOR                        0x31
51 #define SPOOLSS_DELETEPRINTPROVIDOR                     0x32
52 #define SPOOLSS_RESETPRINTER                            0x34
53 #define SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION      0x36
54 #define SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION       0x37
55 #define SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD   0x39
56 #define SPOOLSS_ROUTERREPLYPRINTER                      0x3b
57 #define SPOOLSS_ADDPORTEX                               0x3d
58 #define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION0x3e
59 #define SPOOLSS_SPOOLERINIT                             0x3f
60 #define SPOOLSS_RESETPRINTEREX                          0x40
61 #define SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION  0x42
62 #define SPOOLSS_GETPRINTERDATAEX                        0x4e
63 */
64
65 /* those are implemented */
66 #define SPOOLSS_ENUMPRINTERS                            0x00
67 #define SPOOLSS_SETJOB                                  0x02
68 #define SPOOLSS_GETJOB                                  0x03
69 #define SPOOLSS_ENUMJOBS                                0x04
70 #define SPOOLSS_ADDPRINTER                              0x05
71 #define SPOOLSS_DELETEPRINTER                           0x06
72 #define SPOOLSS_SETPRINTER                              0x07
73 #define SPOOLSS_GETPRINTER                              0x08
74 #define SPOOLSS_ADDPRINTERDRIVER                        0x09
75 #define SPOOLSS_ENUMPRINTERDRIVERS                      0x0a
76 #define SPOOLSS_GETPRINTERDRIVERDIRECTORY               0x0c
77 #define SPOOLSS_ENUMPRINTPROCESSORS                     0x0f
78 #define SPOOLSS_STARTDOCPRINTER                         0x11
79 #define SPOOLSS_STARTPAGEPRINTER                        0x12
80 #define SPOOLSS_WRITEPRINTER                            0x13
81 #define SPOOLSS_ENDPAGEPRINTER                          0x14
82 #define SPOOLSS_ABORTPRINTER                            0x15
83 #define SPOOLSS_ENDDOCPRINTER                           0x17
84 #define SPOOLSS_ADDJOB                                  0x18
85 #define SPOOLSS_SCHEDULEJOB                             0x19
86 #define SPOOLSS_GETPRINTERDATA                          0x1a
87 #define SPOOLSS_SETPRINTERDATA                          0x1b
88 #define SPOOLSS_CLOSEPRINTER                            0x1d
89 #define SPOOLSS_ADDFORM                                 0x1e
90 #define SPOOLSS_DELETEFORM                              0x1f
91 #define SPOOLSS_GETFORM                                 0x20
92 #define SPOOLSS_SETFORM                                 0x21
93 #define SPOOLSS_ENUMFORMS                               0x22
94 #define SPOOLSS_ENUMPORTS                               0x23
95 #define SPOOLSS_ENUMMONITORS                            0x24
96 #define SPOOLSS_ENUMPRINTPROCDATATYPES                  0x33
97 #define SPOOLSS_GETPRINTERDRIVER2                       0x35
98 /* find close printer notification */
99 #define SPOOLSS_FCPN                                    0x38
100 #define SPOOLSS_REPLYOPENPRINTER                        0x3a
101 #define SPOOLSS_REPLYCLOSEPRINTER                       0x3c
102 /* remote find first printer change notifyEx */
103 #define SPOOLSS_RFFPCNEX                                0x41
104 /*SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION */
105 #define SPOOLSS_RRPCN                                   0x42
106 /* remote find next printer change notifyEx */
107 #define SPOOLSS_RFNPCNEX                                0x43
108 #define SPOOLSS_OPENPRINTEREX                           0x45
109 #define SPOOLSS_ADDPRINTEREX                            0x46
110 #define SPOOLSS_ENUMPRINTERDATA                         0x48
111 #define SPOOLSS_DELETEPRINTERDATA                       0x49
112
113 #define PRINTER_CONTROL_UNPAUSE         0x00000000
114 #define PRINTER_CONTROL_PAUSE           0x00000001
115 #define PRINTER_CONTROL_RESUME          0x00000002
116 #define PRINTER_CONTROL_PURGE           0x00000003
117 #define PRINTER_CONTROL_SET_STATUS      0x00000004
118
119 #define PRINTER_STATUS_PAUSED           0x00000001
120 #define PRINTER_STATUS_ERROR            0x00000002
121 #define PRINTER_STATUS_PENDING_DELETION 0x00000004
122 #define PRINTER_STATUS_PAPER_JAM        0x00000008
123
124 #define PRINTER_STATUS_PAPER_OUT        0x00000010
125 #define PRINTER_STATUS_MANUAL_FEED      0x00000020
126 #define PRINTER_STATUS_PAPER_PROBLEM    0x00000040
127 #define PRINTER_STATUS_OFFLINE          0x00000080
128
129 #define PRINTER_STATUS_IO_ACTIVE        0x00000100
130 #define PRINTER_STATUS_BUSY             0x00000200
131 #define PRINTER_STATUS_PRINTING         0x00000400
132 #define PRINTER_STATUS_OUTPUT_BIN_FULL  0x00000800
133
134 #define PRINTER_STATUS_NOT_AVAILABLE    0x00001000
135 #define PRINTER_STATUS_WAITING          0x00002000
136 #define PRINTER_STATUS_PROCESSING       0x00004000
137 #define PRINTER_STATUS_INITIALIZING     0x00008000
138
139 #define PRINTER_STATUS_WARMING_UP       0x00010000
140 #define PRINTER_STATUS_TONER_LOW        0x00020000
141 #define PRINTER_STATUS_NO_TONER         0x00040000
142 #define PRINTER_STATUS_PAGE_PUNT        0x00080000
143
144 #define PRINTER_STATUS_USER_INTERVENTION        0x00100000
145 #define PRINTER_STATUS_OUT_OF_MEMORY    0x00200000
146 #define PRINTER_STATUS_DOOR_OPEN        0x00400000
147 #define PRINTER_STATUS_SERVER_UNKNOWN   0x00800000
148
149 #define PRINTER_STATUS_POWER_SAVE       0x01000000
150
151 #define SERVER_ACCESS_ADMINISTER        0x00000001
152 #define SERVER_ACCESS_ENUMERATE         0x00000002
153 #define PRINTER_ACCESS_ADMINISTER       0x00000004
154 #define PRINTER_ACCESS_USE              0x00000008
155 #define JOB_ACCESS_ADMINISTER           0x00000010
156
157 /* ACE masks for the various print permissions */
158
159 #define PRINTER_ACE_FULL_CONTROL      GENERIC_ALL_ACCESS
160 #define PRINTER_ACE_MANAGE_DOCUMENTS  READ_CONTROL_ACCESS
161 #define PRINTER_ACE_PRINT             \
162     (GENERIC_READ_ACCESS | GENERIC_WRITE_ACCESS | GENERIC_EXECUTE_ACCESS)
163
164 /* Access rights for print servers */
165 #define SERVER_ALL_ACCESS       STANDARD_RIGHTS_REQUIRED_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
166 #define SERVER_READ             STANDARD_RIGHTS_READ_ACCESS|SERVER_ACCESS_ENUMERATE
167 #define SERVER_WRITE            STANDARD_RIGHTS_WRITE_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
168 #define SERVER_EXECUTE          STANDARD_RIGHTS_EXECUTE_ACCESS|SERVER_ACCESS_ENUMERATE
169
170 /* Access rights for printers */
171 #define PRINTER_ALL_ACCESS      STANDARD_RIGHTS_REQUIRED_ACCESS|PRINTER_ACCESS_ADMINISTER|PRINTER_ACCESS_USE
172 #define PRINTER_READ          STANDARD_RIGHTS_READ_ACCESS|PRINTER_ACCESS_USE
173 #define PRINTER_WRITE         STANDARD_RIGHTS_WRITE_ACCESS|PRINTER_ACCESS_USE
174 #define PRINTER_EXECUTE       STANDARD_RIGHTS_EXECUTE_ACCESS|PRINTER_ACCESS_USE
175
176 /* Access rights for jobs */
177 #define JOB_ALL_ACCESS  STANDARD_RIGHTS_REQUIRED_ACCESS|JOB_ACCESS_ADMINISTER
178 #define JOB_READ        STANDARD_RIGHTS_READ_ACCESS|JOB_ACCESS_ADMINISTER
179 #define JOB_WRITE       STANDARD_RIGHTS_WRITE_ACCESS|JOB_ACCESS_ADMINISTER
180 #define JOB_EXECUTE     STANDARD_RIGHTS_EXECUTE_ACCESS|JOB_ACCESS_ADMINISTER
181
182 #define POLICY_HND_SIZE 20
183
184 #define ONE_VALUE 01
185 #define TWO_VALUE 02
186 #define POINTER   03
187
188 #define PRINTER_NOTIFY_TYPE 0x00
189 #define JOB_NOTIFY_TYPE     0x01
190
191 #define MAX_PRINTER_NOTIFY 26
192 #define MAX_JOB_NOTIFY 24
193
194 #define MAX_NOTIFY_TYPE_FOR_NOW 26
195
196 #define PRINTER_NOTIFY_SERVER_NAME              0x00
197 #define PRINTER_NOTIFY_PRINTER_NAME             0x01
198 #define PRINTER_NOTIFY_SHARE_NAME               0x02
199 #define PRINTER_NOTIFY_PORT_NAME                0x03
200 #define PRINTER_NOTIFY_DRIVER_NAME              0x04
201 #define PRINTER_NOTIFY_COMMENT                  0x05
202 #define PRINTER_NOTIFY_LOCATION                 0x06
203 #define PRINTER_NOTIFY_DEVMODE                  0x07
204 #define PRINTER_NOTIFY_SEPFILE                  0x08
205 #define PRINTER_NOTIFY_PRINT_PROCESSOR          0x09
206 #define PRINTER_NOTIFY_PARAMETERS               0x0A
207 #define PRINTER_NOTIFY_DATATYPE                 0x0B
208 #define PRINTER_NOTIFY_SECURITY_DESCRIPTOR      0x0C
209 #define PRINTER_NOTIFY_ATTRIBUTES               0x0D
210 #define PRINTER_NOTIFY_PRIORITY                 0x0E
211 #define PRINTER_NOTIFY_DEFAULT_PRIORITY         0x0F
212 #define PRINTER_NOTIFY_START_TIME               0x10
213 #define PRINTER_NOTIFY_UNTIL_TIME               0x11
214 #define PRINTER_NOTIFY_STATUS                   0x12
215 #define PRINTER_NOTIFY_STATUS_STRING            0x13
216 #define PRINTER_NOTIFY_CJOBS                    0x14
217 #define PRINTER_NOTIFY_AVERAGE_PPM              0x15
218 #define PRINTER_NOTIFY_TOTAL_PAGES              0x16
219 #define PRINTER_NOTIFY_PAGES_PRINTED            0x17
220 #define PRINTER_NOTIFY_TOTAL_BYTES              0x18
221 #define PRINTER_NOTIFY_BYTES_PRINTED            0x19
222
223 #define JOB_NOTIFY_PRINTER_NAME                 0x00
224 #define JOB_NOTIFY_MACHINE_NAME                 0x01
225 #define JOB_NOTIFY_PORT_NAME                    0x02
226 #define JOB_NOTIFY_USER_NAME                    0x03
227 #define JOB_NOTIFY_NOTIFY_NAME                  0x04
228 #define JOB_NOTIFY_DATATYPE                     0x05
229 #define JOB_NOTIFY_PRINT_PROCESSOR              0x06
230 #define JOB_NOTIFY_PARAMETERS                   0x07
231 #define JOB_NOTIFY_DRIVER_NAME                  0x08
232 #define JOB_NOTIFY_DEVMODE                      0x09
233 #define JOB_NOTIFY_STATUS                       0x0A
234 #define JOB_NOTIFY_STATUS_STRING                0x0B
235 #define JOB_NOTIFY_SECURITY_DESCRIPTOR          0x0C
236 #define JOB_NOTIFY_DOCUMENT                     0x0D
237 #define JOB_NOTIFY_PRIORITY                     0x0E
238 #define JOB_NOTIFY_POSITION                     0x0F
239 #define JOB_NOTIFY_SUBMITTED                    0x10
240 #define JOB_NOTIFY_START_TIME                   0x11
241 #define JOB_NOTIFY_UNTIL_TIME                   0x12
242 #define JOB_NOTIFY_TIME                         0x13
243 #define JOB_NOTIFY_TOTAL_PAGES                  0x14
244 #define JOB_NOTIFY_PAGES_PRINTED                0x15
245 #define JOB_NOTIFY_TOTAL_BYTES                  0x16
246 #define JOB_NOTIFY_BYTES_PRINTED                0x17
247
248 #define PRINTER_CHANGE_ADD_PRINTER                      0x00000001
249 #define PRINTER_CHANGE_SET_PRINTER                      0x00000002
250 #define PRINTER_CHANGE_DELETE_PRINTER                   0x00000004
251 #define PRINTER_CHANGE_FAILED_CONNECTION_PRINTER        0x00000008
252 #define PRINTER_CHANGE_PRINTER  (PRINTER_CHANGE_ADD_PRINTER | \
253                                  PRINTER_CHANGE_SET_PRINTER | \
254                                  PRINTER_CHANGE_DELETE_PRINTER | \
255                                  PRINTER_CHANGE_FAILED_CONNECTION_PRINTER )
256
257 #define PRINTER_CHANGE_ADD_JOB                          0x00000100
258 #define PRINTER_CHANGE_SET_JOB                          0x00000200
259 #define PRINTER_CHANGE_DELETE_JOB                       0x00000400
260 #define PRINTER_CHANGE_WRITE_JOB                        0x00000800
261 #define PRINTER_CHANGE_JOB      (PRINTER_CHANGE_ADD_JOB | \
262                                  PRINTER_CHANGE_SET_JOB | \
263                                  PRINTER_CHANGE_DELETE_JOB | \
264                                  PRINTER_CHANGE_WRITE_JOB )
265
266 #define PRINTER_CHANGE_ADD_FORM                         0x00010000
267 #define PRINTER_CHANGE_SET_FORM                         0x00020000
268 #define PRINTER_CHANGE_DELETE_FORM                      0x00040000
269 #define PRINTER_CHANGE_FORM     (PRINTER_CHANGE_ADD_FORM | \
270                                  PRINTER_CHANGE_SET_FORM | \
271                                  PRINTER_CHANGE_DELETE_FORM )
272
273 #define PRINTER_CHANGE_ADD_PORT                         0x00100000
274 #define PRINTER_CHANGE_CONFIGURE_PORT                   0x00200000
275 #define PRINTER_CHANGE_DELETE_PORT                      0x00400000
276 #define PRINTER_CHANGE_PORT     (PRINTER_CHANGE_ADD_PORT | \
277                                  PRINTER_CHANGE_CONFIGURE_PORT | \
278                                  PRINTER_CHANGE_DELETE_PORT )
279
280 #define PRINTER_CHANGE_ADD_PRINT_PROCESSOR              0x01000000
281 #define PRINTER_CHANGE_DELETE_PRINT_PROCESSOR           0x04000000
282 #define PRINTER_CHANGE_PRINT_PROCESSOR  (PRINTER_CHANGE_ADD_PRINT_PROCESSOR | \
283                                          PRINTER_CHANGE_DELETE_PRINT_PROCESSOR )
284
285 #define PRINTER_CHANGE_ADD_PRINTER_DRIVER               0x10000000
286 #define PRINTER_CHANGE_SET_PRINTER_DRIVER               0x20000000
287 #define PRINTER_CHANGE_DELETE_PRINTER_DRIVER            0x40000000
288 #define PRINTER_CHANGE_PRINTER_DRIVER   (PRINTER_CHANGE_ADD_PRINTER_DRIVER | \
289                                          PRINTER_CHANGE_SET_PRINTER_DRIVER | \
290                                          PRINTER_CHANGE_DELETE_PRINTER_DRIVER )
291
292 #define PRINTER_CHANGE_TIMEOUT                          0x80000000
293 #define PRINTER_CHANGE_ALL      (PRINTER_CHANGE_JOB | \
294                                  PRINTER_CHANGE_FORM | \
295                                  PRINTER_CHANGE_PORT | \
296                                  PRINTER_CHANGE_PRINT_PROCESSOR | \
297                                  PRINTER_CHANGE_PRINTER_DRIVER )
298
299 #define PRINTER_NOTIFY_INFO_DISCARDED   0x1
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_QUEUED                0x00000001
310 #define PRINTER_ATTRIBUTE_DIRECT                0x00000002
311 #define PRINTER_ATTRIBUTE_DEFAULT               0x00000004
312 #define PRINTER_ATTRIBUTE_SHARED                0x00000008
313
314 #define PRINTER_ATTRIBUTE_NETWORK               0x00000010
315 #define PRINTER_ATTRIBUTE_HIDDEN                0x00000020
316 #define PRINTER_ATTRIBUTE_LOCAL                 0x00000040
317 #define PRINTER_ATTRIBUTE_ENABLE_DEVQ           0x00000080
318
319 #define PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS       0x00000100
320 #define PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST     0x00000200
321 #define PRINTER_ATTRIBUTE_WORK_OFFLINE          0x00000400
322 #define PRINTER_ATTRIBUTE_ENABLE_BIDI           0x00000800
323
324 #define PRINTER_ATTRIBUTE_RAW_ONLY              0x00001000
325
326 #define NO_PRIORITY      0
327 #define MAX_PRIORITY    99
328 #define MIN_PRIORITY     1
329 #define DEF_PRIORITY     1
330
331 /* the flags of the query */
332 #define PRINTER_ENUM_DEFAULT            0x00000001
333 #define PRINTER_ENUM_LOCAL              0x00000002
334 #define PRINTER_ENUM_CONNECTIONS        0x00000004
335 #define PRINTER_ENUM_FAVORITE           0x00000004
336 #define PRINTER_ENUM_NAME               0x00000008
337 #define PRINTER_ENUM_REMOTE             0x00000010
338 #define PRINTER_ENUM_SHARED             0x00000020
339 #define PRINTER_ENUM_NETWORK            0x00000040
340
341 /* the flags of each printers */
342 #define PRINTER_ENUM_UNKNOWN_8          0x00000008
343 #define PRINTER_ENUM_EXPAND             0x00004000
344 #define PRINTER_ENUM_CONTAINER          0x00008000
345 #define PRINTER_ENUM_ICONMASK           0x00ff0000
346 #define PRINTER_ENUM_ICON1              0x00010000
347 #define PRINTER_ENUM_ICON2              0x00020000
348 #define PRINTER_ENUM_ICON3              0x00040000
349 #define PRINTER_ENUM_ICON4              0x00080000
350 #define PRINTER_ENUM_ICON5              0x00100000
351 #define PRINTER_ENUM_ICON6              0x00200000
352 #define PRINTER_ENUM_ICON7              0x00400000
353 #define PRINTER_ENUM_ICON8              0x00800000
354
355 /* this struct is undocumented */
356 /* thanks to the ddk ... */
357 typedef struct spool_user_1
358 {
359         uint32 size;            /* length of user_name & client_name + 2? */
360         uint32 client_name_ptr;
361         uint32 user_name_ptr;
362         uint32 build;
363         uint32 major;
364         uint32 minor;
365         uint32 processor;
366         UNISTR2 client_name;
367         UNISTR2 user_name;
368 }
369 SPOOL_USER_1;
370
371 typedef struct spool_user_ctr_info
372 {
373         uint32 level;
374         uint32 ptr;
375         SPOOL_USER_1 user1;
376 }
377 SPOOL_USER_CTR;
378
379 typedef struct devicemode
380 {
381         UNISTR devicename;
382         uint16 specversion;
383         uint16 driverversion;
384         uint16 size;
385         uint16 driverextra;
386         uint32 fields;
387         uint16 orientation;
388         uint16 papersize;
389         uint16 paperlength;
390         uint16 paperwidth;
391         uint16 scale;
392         uint16 copies;
393         uint16 defaultsource;
394         uint16 printquality;
395         uint16 color;
396         uint16 duplex;
397         uint16 yresolution;
398         uint16 ttoption;
399         uint16 collate;
400         UNISTR formname;
401         uint16 logpixels;
402         uint32 bitsperpel;
403         uint32 pelswidth;
404         uint32 pelsheight;
405         uint32 displayflags;
406         uint32 displayfrequency;
407         uint32 icmmethod;
408         uint32 icmintent;
409         uint32 mediatype;
410         uint32 dithertype;
411         uint32 reserved1;
412         uint32 reserved2;
413         uint32 panningwidth;
414         uint32 panningheight;
415         uint8 *private;
416 }
417 DEVICEMODE;
418
419 typedef struct _devmode_cont
420 {
421         uint32 size;
422         uint32 devmode_ptr;
423         DEVICEMODE *devmode;
424 }
425 DEVMODE_CTR;
426
427 typedef struct _printer_default
428 {
429         uint32 datatype_ptr;
430         UNISTR2 datatype;
431         DEVMODE_CTR devmode_cont;
432         uint32 access_required;
433 }
434 PRINTER_DEFAULT;
435
436 /* SPOOL_Q_OPEN_PRINTER_EX request to open a printer */
437 typedef struct spool_q_open_printer_ex
438 {
439         uint32 printername_ptr;
440         UNISTR2 printername;
441         PRINTER_DEFAULT printer_default;
442         uint32 user_switch;
443         SPOOL_USER_CTR user_ctr;
444 }
445 SPOOL_Q_OPEN_PRINTER_EX;
446
447 /* SPOOL_R_OPEN_PRINTER_EX reply to an open printer */
448 typedef struct spool_r_open_printer_ex
449 {
450         POLICY_HND handle;      /* handle used along all transactions (20*uint8) */
451         uint32 status;
452
453 }
454 SPOOL_R_OPEN_PRINTER_EX;
455
456 typedef struct spool_notify_option_type
457 {
458         uint16 type;
459         uint16 reserved0;
460         uint32 reserved1;
461         uint32 reserved2;
462         uint32 count;
463         uint32 fields_ptr;
464         uint32 count2;
465         uint16 fields[MAX_NOTIFY_TYPE_FOR_NOW];
466 }
467 SPOOL_NOTIFY_OPTION_TYPE;
468
469 typedef struct spool_notify_option_type_ctr
470 {
471         uint32 count;
472         SPOOL_NOTIFY_OPTION_TYPE *type;
473 }
474 SPOOL_NOTIFY_OPTION_TYPE_CTR;
475
476
477
478 typedef struct s_header_type
479 {
480         uint32 type;
481         union
482         {
483                 uint32 value;
484                 UNISTR string;
485         }
486         data;
487 }
488 HEADER_TYPE;
489
490 typedef struct new_buffer
491 {
492         uint32 ptr;
493         uint32 size;
494         prs_struct prs;
495         uint32 struct_start;
496         uint32 string_at_end;
497 }
498 NEW_BUFFER;
499
500 typedef struct spool_q_getprinterdata
501 {
502         POLICY_HND handle;
503         UNISTR2 valuename;
504         uint32 size;
505 }
506 SPOOL_Q_GETPRINTERDATA;
507
508 typedef struct spool_r_getprinterdata
509 {
510         uint32 type;
511         uint32 size;
512         uint8 *data;
513         uint32 needed;
514         uint32 status;
515 }
516 SPOOL_R_GETPRINTERDATA;
517
518 typedef struct spool_q_deleteprinterdata
519 {
520         POLICY_HND handle;
521         UNISTR2 valuename;
522 }
523 SPOOL_Q_DELETEPRINTERDATA;
524
525 typedef struct spool_r_deleteprinterdata
526 {
527         uint32 status;
528 }
529 SPOOL_R_DELETEPRINTERDATA;
530
531 typedef struct spool_q_closeprinter
532 {
533         POLICY_HND handle;
534 }
535 SPOOL_Q_CLOSEPRINTER;
536
537 typedef struct spool_r_closeprinter
538 {
539         POLICY_HND handle;
540         uint32 status;
541 }
542 SPOOL_R_CLOSEPRINTER;
543
544 typedef struct spool_q_startpageprinter
545 {
546         POLICY_HND handle;
547 }
548 SPOOL_Q_STARTPAGEPRINTER;
549
550 typedef struct spool_r_startpageprinter
551 {
552         uint32 status;
553 }
554 SPOOL_R_STARTPAGEPRINTER;
555
556 typedef struct spool_q_endpageprinter
557 {
558         POLICY_HND handle;
559 }
560 SPOOL_Q_ENDPAGEPRINTER;
561
562 typedef struct spool_r_endpageprinter
563 {
564         uint32 status;
565 }
566 SPOOL_R_ENDPAGEPRINTER;
567
568 typedef struct spool_doc_info_1
569 {
570         uint32 p_docname;
571         uint32 p_outputfile;
572         uint32 p_datatype;
573         UNISTR2 docname;
574         UNISTR2 outputfile;
575         UNISTR2 datatype;
576 }
577 DOC_INFO_1;
578
579 typedef struct spool_doc_info
580 {
581         uint32 switch_value;
582         DOC_INFO_1 doc_info_1;
583 }
584 DOC_INFO;
585
586 typedef struct spool_doc_info_container
587 {
588         uint32 level;
589         DOC_INFO docinfo;
590 }
591 DOC_INFO_CONTAINER;
592
593 typedef struct spool_q_startdocprinter
594 {
595         POLICY_HND handle;
596         DOC_INFO_CONTAINER doc_info_container;
597 }
598 SPOOL_Q_STARTDOCPRINTER;
599
600 typedef struct spool_r_startdocprinter
601 {
602         uint32 jobid;
603         uint32 status;
604 }
605 SPOOL_R_STARTDOCPRINTER;
606
607 typedef struct spool_q_enddocprinter
608 {
609         POLICY_HND handle;
610 }
611 SPOOL_Q_ENDDOCPRINTER;
612
613 typedef struct spool_r_enddocprinter
614 {
615         uint32 status;
616 }
617 SPOOL_R_ENDDOCPRINTER;
618
619 typedef struct spool_q_writeprinter
620 {
621         POLICY_HND handle;
622         uint32 buffer_size;
623         uint8 *buffer;
624         uint32 buffer_size2;
625 }
626 SPOOL_Q_WRITEPRINTER;
627
628 typedef struct spool_r_writeprinter
629 {
630         uint32 buffer_written;
631         uint32 status;
632 }
633 SPOOL_R_WRITEPRINTER;
634
635 typedef struct spool_notify_option
636 {
637         uint32 version;
638         uint32 flags;
639         uint32 count;
640         uint32 option_type_ptr;
641         SPOOL_NOTIFY_OPTION_TYPE_CTR ctr;
642 }
643 SPOOL_NOTIFY_OPTION;
644
645 typedef struct spool_notify_info_data
646 {
647         uint16 type;
648         uint16 field;
649         uint32 reserved;
650         uint32 id;
651         union
652         {
653                 uint32 value[2];
654                 struct
655                 {
656                         uint32 length;
657                         uint16 string[1024];
658                 }
659                 data;
660         }
661         notify_data;
662         uint32 size;
663         BOOL enc_type;
664 } SPOOL_NOTIFY_INFO_DATA;
665
666 typedef struct spool_notify_info
667 {
668         uint32 version;
669         uint32 flags;
670         uint32 count;
671         SPOOL_NOTIFY_INFO_DATA *data;
672 }
673 SPOOL_NOTIFY_INFO;
674
675 /* If the struct name looks obscure, yes it is ! */
676 /* RemoteFindFirstPrinterChangeNotificationEx query struct */
677 typedef struct spoolss_q_rffpcnex
678 {
679         POLICY_HND handle;
680         uint32 flags;
681         uint32 options;
682         uint32 localmachine_ptr;
683         UNISTR2 localmachine;
684         uint32 printerlocal;
685         uint32 option_ptr;
686         SPOOL_NOTIFY_OPTION *option;
687 }
688 SPOOL_Q_RFFPCNEX;
689
690 typedef struct spool_r_rffpcnex
691 {
692         uint32 status;
693 }
694 SPOOL_R_RFFPCNEX;
695
696 /* Remote Find Next Printer Change Notify Ex */
697 typedef struct spool_q_rfnpcnex
698 {
699         POLICY_HND handle;
700         uint32 change;
701         uint32 option_ptr;
702         SPOOL_NOTIFY_OPTION *option;
703 }
704 SPOOL_Q_RFNPCNEX;
705
706 typedef struct spool_r_rfnpcnex
707 {
708         uint32 info_ptr;
709         SPOOL_NOTIFY_INFO info;
710         uint32 status;
711 }
712 SPOOL_R_RFNPCNEX;
713
714 /* Find Close Printer Notify */
715 typedef struct spool_q_fcpn
716 {
717         POLICY_HND handle;
718 }
719 SPOOL_Q_FCPN;
720
721 typedef struct spool_r_fcpn
722 {
723         uint32 status;
724 }
725 SPOOL_R_FCPN;
726
727
728 typedef struct printer_info_0
729 {
730         UNISTR printername;
731         UNISTR servername;
732         uint32 cjobs;
733         uint32 total_jobs;
734         uint32 total_bytes;
735         
736         uint16 year;
737         uint16 month;
738         uint16 dayofweek;
739         uint16 day;
740         uint16 hour;
741         uint16 minute;
742         uint16 second;
743         uint16 milliseconds;
744
745         uint32 global_counter;
746         uint32 total_pages;
747
748         uint16 major_version;
749         uint16 build_version;
750
751         uint32 unknown7;
752         uint32 unknown8;
753         uint32 unknown9;
754         uint32 session_counter;
755         uint32 unknown11;
756         uint32 printer_errors;
757         uint32 unknown13;
758         uint32 unknown14;
759         uint32 unknown15;
760         uint32 unknown16;
761         uint32 change_id;
762         uint32 unknown18;
763         uint32 status;
764         uint32 unknown20;
765         uint32 c_setprinter;
766
767         uint16 unknown22;
768         uint16 unknown23;
769         uint16 unknown24;
770         uint16 unknown25;
771         uint16 unknown26;
772         uint16 unknown27;
773         uint16 unknown28;
774         uint16 unknown29;
775 } PRINTER_INFO_0;
776
777 typedef struct printer_info_1
778 {
779         uint32 flags;
780         UNISTR description;
781         UNISTR name;
782         UNISTR comment;
783 }
784 PRINTER_INFO_1;
785
786 typedef struct printer_info_2
787 {
788         UNISTR servername;
789         UNISTR printername;
790         UNISTR sharename;
791         UNISTR portname;
792         UNISTR drivername;
793         UNISTR comment;
794         UNISTR location;
795         DEVICEMODE *devmode;
796         UNISTR sepfile;
797         UNISTR printprocessor;
798         UNISTR datatype;
799         UNISTR parameters;
800         SEC_DESC *secdesc;
801         uint32 attributes;
802         uint32 priority;
803         uint32 defaultpriority;
804         uint32 starttime;
805         uint32 untiltime;
806         uint32 status;
807         uint32 cjobs;
808         uint32 averageppm;
809 }
810 PRINTER_INFO_2;
811
812 typedef struct printer_info_3
813 {
814         uint32 flags;
815         SEC_DESC *secdesc;
816 }
817 PRINTER_INFO_3;
818
819 typedef struct spool_q_enumprinters
820 {
821         uint32 flags;
822         uint32 servername_ptr;
823         UNISTR2 servername;
824         uint32 level;
825         NEW_BUFFER *buffer;
826         uint32 offered;
827 }
828 SPOOL_Q_ENUMPRINTERS;
829
830 typedef struct printer_info_ctr_info
831 {
832         PRINTER_INFO_0 *printers_0;
833         PRINTER_INFO_1 *printers_1;
834         PRINTER_INFO_2 *printers_2;
835         PRINTER_INFO_3 *printers_3;
836 }
837 PRINTER_INFO_CTR;
838
839 typedef struct spool_r_enumprinters
840 {
841         NEW_BUFFER *buffer;
842         uint32 needed;          /* bytes needed */
843         uint32 returned;        /* number of printers */
844         uint32 status;
845 }
846 SPOOL_R_ENUMPRINTERS;
847
848
849 typedef struct spool_q_getprinter
850 {
851         POLICY_HND handle;
852         uint32 level;
853         NEW_BUFFER *buffer;
854         uint32 offered;
855 }
856 SPOOL_Q_GETPRINTER;
857
858 typedef struct printer_info_info
859 {
860         union
861         {
862                 PRINTER_INFO_0 *info0;
863                 PRINTER_INFO_1 *info1;
864                 PRINTER_INFO_2 *info2;
865                 void *info;
866         } printer;
867 } PRINTER_INFO;
868
869 typedef struct spool_r_getprinter
870 {
871         NEW_BUFFER *buffer;
872         uint32 needed;
873         uint32 status;
874 } SPOOL_R_GETPRINTER;
875
876 typedef struct driver_info_1
877 {
878         UNISTR name;
879 } DRIVER_INFO_1;
880
881 typedef struct driver_info_2
882 {
883         uint32 version;
884         UNISTR name;
885         UNISTR architecture;
886         UNISTR driverpath;
887         UNISTR datafile;
888         UNISTR configfile;
889 } DRIVER_INFO_2;
890
891 typedef struct driver_info_3
892 {
893         uint32 version;
894         UNISTR name;
895         UNISTR architecture;
896         UNISTR driverpath;
897         UNISTR datafile;
898         UNISTR configfile;
899         UNISTR helpfile;
900         uint16 *dependentfiles;
901         UNISTR monitorname;
902         UNISTR defaultdatatype;
903 }
904 DRIVER_INFO_3;
905
906 typedef struct driver_info_6
907 {
908         uint32 version;
909         UNISTR name;
910         UNISTR architecture;
911         UNISTR driverpath;
912         UNISTR datafile;
913         UNISTR configfile;
914         UNISTR helpfile;
915         uint16 *dependentfiles;
916         UNISTR monitorname;
917         UNISTR defaultdatatype;
918         uint16* previousdrivernames;
919         NTTIME driver_date;
920         uint32 padding;
921         uint32 driver_version_low;
922         uint32 driver_version_high;
923         UNISTR mfgname;
924         UNISTR oem_url;
925         UNISTR hardware_id;
926         UNISTR provider;
927 }
928 DRIVER_INFO_6;
929
930 typedef struct driver_info_info
931 {
932         DRIVER_INFO_1 *info1;
933         DRIVER_INFO_2 *info2;
934         DRIVER_INFO_3 *info3;
935         DRIVER_INFO_6 *info6;
936 }
937 PRINTER_DRIVER_CTR;
938
939 typedef struct spool_q_getprinterdriver2
940 {
941         POLICY_HND handle;
942         uint32 architecture_ptr;
943         UNISTR2 architecture;
944         uint32 level;
945         NEW_BUFFER *buffer;
946         uint32 offered;
947         uint32 clientmajorversion;
948         uint32 clientminorversion;
949 }
950 SPOOL_Q_GETPRINTERDRIVER2;
951
952 typedef struct spool_r_getprinterdriver2
953 {
954         NEW_BUFFER *buffer;
955         uint32 needed;
956         uint32 servermajorversion;
957         uint32 serverminorversion;
958         uint32 status;
959 }
960 SPOOL_R_GETPRINTERDRIVER2;
961
962
963 typedef struct add_jobinfo_1
964 {
965         UNISTR path;
966         uint32 job_number;
967 }
968 ADD_JOBINFO_1;
969
970
971 typedef struct spool_q_addjob
972 {
973         POLICY_HND handle;
974         uint32 level;
975         NEW_BUFFER *buffer;
976         uint32 offered;
977 }
978 SPOOL_Q_ADDJOB;
979
980 typedef struct spool_r_addjob
981 {
982         NEW_BUFFER *buffer;
983         uint32 needed;
984         uint32 status;
985 }
986 SPOOL_R_ADDJOB;
987
988 /*
989  * I'm really wondering how many different time formats
990  * I will have to cope with
991  *
992  * JFM, 09/13/98 In a mad mood ;-(
993 */
994 typedef struct systemtime
995 {
996         uint16 year;
997         uint16 month;
998         uint16 dayofweek;
999         uint16 day;
1000         uint16 hour;
1001         uint16 minute;
1002         uint16 second;
1003         uint16 milliseconds;
1004 }
1005 SYSTEMTIME;
1006
1007 typedef struct s_job_info_1
1008 {
1009         uint32 jobid;
1010         UNISTR printername;
1011         UNISTR machinename;
1012         UNISTR username;
1013         UNISTR document;
1014         UNISTR datatype;
1015         UNISTR text_status;
1016         uint32 status;
1017         uint32 priority;
1018         uint32 position;
1019         uint32 totalpages;
1020         uint32 pagesprinted;
1021         SYSTEMTIME submitted;
1022 }
1023 JOB_INFO_1;
1024
1025 typedef struct s_job_info_2
1026 {
1027         uint32 jobid;
1028         UNISTR printername;
1029         UNISTR machinename;
1030         UNISTR username;
1031         UNISTR document;
1032         UNISTR notifyname;
1033         UNISTR datatype;
1034         UNISTR printprocessor;
1035         UNISTR parameters;
1036         UNISTR drivername;
1037         DEVICEMODE *devmode;
1038         UNISTR text_status;
1039 /*      SEC_DESC sec_desc;*/
1040         uint32 status;
1041         uint32 priority;
1042         uint32 position;
1043         uint32 starttime;
1044         uint32 untiltime;
1045         uint32 totalpages;
1046         uint32 size;
1047         SYSTEMTIME submitted;
1048         uint32 timeelapsed;
1049         uint32 pagesprinted;
1050 }
1051 JOB_INFO_2;
1052
1053 typedef struct spool_q_enumjobs
1054 {
1055         POLICY_HND handle;
1056         uint32 firstjob;
1057         uint32 numofjobs;
1058         uint32 level;
1059         NEW_BUFFER *buffer;
1060         uint32 offered;
1061 }
1062 SPOOL_Q_ENUMJOBS;
1063
1064 typedef struct job_info_ctr_info
1065 {
1066         union
1067         {
1068                 JOB_INFO_1 **job_info_1;
1069                 JOB_INFO_2 **job_info_2;
1070                 void *info;
1071         } job;
1072
1073 } JOB_INFO_CTR;
1074
1075 typedef struct spool_r_enumjobs
1076 {
1077         NEW_BUFFER *buffer;
1078         uint32 needed;
1079         uint32 returned;
1080         uint32 status;
1081 }
1082 SPOOL_R_ENUMJOBS;
1083
1084 typedef struct spool_q_schedulejob
1085 {
1086         POLICY_HND handle;
1087         uint32 jobid;
1088 }
1089 SPOOL_Q_SCHEDULEJOB;
1090
1091 typedef struct spool_r_schedulejob
1092 {
1093         uint32 status;
1094 }
1095 SPOOL_R_SCHEDULEJOB;
1096
1097 typedef struct s_port_info_1
1098 {
1099         UNISTR port_name;
1100 }
1101 PORT_INFO_1;
1102
1103 typedef struct s_port_info_2
1104 {
1105         UNISTR port_name;
1106         UNISTR monitor_name;
1107         UNISTR description;
1108         uint32 port_type;
1109         uint32 reserved;
1110 }
1111 PORT_INFO_2;
1112
1113 typedef struct spool_q_enumports
1114 {
1115         uint32 name_ptr;
1116         UNISTR2 name;
1117         uint32 level;
1118         NEW_BUFFER *buffer;
1119         uint32 offered;
1120 }
1121 SPOOL_Q_ENUMPORTS;
1122
1123 typedef struct port_info_ctr_info
1124 {
1125         union
1126         {
1127                 PORT_INFO_1 *info_1;
1128                 PORT_INFO_2 *info_2;
1129         }
1130         port;
1131
1132 }
1133 PORT_INFO_CTR;
1134
1135 typedef struct spool_r_enumports
1136 {
1137         NEW_BUFFER *buffer;
1138         uint32 needed;          /* bytes needed */
1139         uint32 returned;        /* number of printers */
1140         uint32 status;
1141 }
1142 SPOOL_R_ENUMPORTS;
1143
1144 #define JOB_CONTROL_PAUSE              1
1145 #define JOB_CONTROL_RESUME             2
1146 #define JOB_CONTROL_CANCEL             3
1147 #define JOB_CONTROL_RESTART            4
1148 #define JOB_CONTROL_DELETE             5
1149
1150 typedef struct job_info_info
1151 {
1152         union
1153         {
1154                 JOB_INFO_1 job_info_1;
1155                 JOB_INFO_2 job_info_2;
1156         }
1157         job;
1158
1159 }
1160 JOB_INFO;
1161
1162 typedef struct spool_q_setjob
1163 {
1164         POLICY_HND handle;
1165         uint32 jobid;
1166         uint32 level;
1167         JOB_INFO ctr;
1168         uint32 command;
1169
1170 }
1171 SPOOL_Q_SETJOB;
1172
1173 typedef struct spool_r_setjob
1174 {
1175         uint32 status;
1176
1177 }
1178 SPOOL_R_SETJOB;
1179
1180 typedef struct spool_q_enumprinterdrivers
1181 {
1182         uint32 name_ptr;
1183         UNISTR2 name;
1184         uint32 environment_ptr;
1185         UNISTR2 environment;
1186         uint32 level;
1187         NEW_BUFFER *buffer;
1188         uint32 offered;
1189 }
1190 SPOOL_Q_ENUMPRINTERDRIVERS;
1191
1192 typedef struct spool_r_enumprinterdrivers
1193 {
1194         NEW_BUFFER *buffer;
1195         uint32 needed;
1196         uint32 returned;
1197         uint32 status;
1198 }
1199 SPOOL_R_ENUMPRINTERDRIVERS;
1200
1201 typedef struct spool_form_1
1202 {
1203         uint32 flag;
1204         UNISTR name;
1205         uint32 width;
1206         uint32 length;
1207         uint32 left;
1208         uint32 top;
1209         uint32 right;
1210         uint32 bottom;
1211 }
1212 FORM_1;
1213
1214 typedef struct spool_q_enumforms
1215 {
1216         POLICY_HND handle;
1217         uint32 level;
1218         NEW_BUFFER *buffer;
1219         uint32 offered;
1220 }
1221 SPOOL_Q_ENUMFORMS;
1222
1223 typedef struct spool_r_enumforms
1224 {
1225         NEW_BUFFER *buffer;
1226         uint32 needed;
1227         uint32 numofforms;
1228         uint32 status;
1229 }
1230 SPOOL_R_ENUMFORMS;
1231
1232 typedef struct spool_q_getform
1233 {
1234         POLICY_HND handle;
1235         UNISTR2 formname;
1236         uint32 level;
1237         NEW_BUFFER *buffer;
1238         uint32 offered;
1239 }
1240 SPOOL_Q_GETFORM;
1241
1242 typedef struct spool_r_getform
1243 {
1244         NEW_BUFFER *buffer;
1245         uint32 needed;
1246         uint32 status;
1247 }
1248 SPOOL_R_GETFORM;
1249
1250 typedef struct spool_printer_info_level_1
1251 {
1252         uint32 flags;
1253         uint32 description_ptr;
1254         uint32 name_ptr;
1255         uint32 comment_ptr;
1256         UNISTR2 description;
1257         UNISTR2 name;
1258         UNISTR2 comment;        
1259 } SPOOL_PRINTER_INFO_LEVEL_1;
1260
1261 typedef struct spool_printer_info_level_2
1262 {
1263         uint32 servername_ptr;
1264         uint32 printername_ptr;
1265         uint32 sharename_ptr;
1266         uint32 portname_ptr;
1267         uint32 drivername_ptr;
1268         uint32 comment_ptr;
1269         uint32 location_ptr;
1270         uint32 devmode_ptr;
1271         uint32 sepfile_ptr;
1272         uint32 printprocessor_ptr;
1273         uint32 datatype_ptr;
1274         uint32 parameters_ptr;
1275         uint32 secdesc_ptr;
1276         uint32 attributes;
1277         uint32 priority;
1278         uint32 default_priority;
1279         uint32 starttime;
1280         uint32 untiltime;
1281         uint32 status;
1282         uint32 cjobs;
1283         uint32 averageppm;
1284         UNISTR2 servername;
1285         UNISTR2 printername;
1286         UNISTR2 sharename;
1287         UNISTR2 portname;
1288         UNISTR2 drivername;
1289         UNISTR2 comment;
1290         UNISTR2 location;
1291         UNISTR2 sepfile;
1292         UNISTR2 printprocessor;
1293         UNISTR2 datatype;
1294         UNISTR2 parameters;
1295         SEC_DESC_BUF *secdesc;
1296 }
1297 SPOOL_PRINTER_INFO_LEVEL_2;
1298
1299 typedef struct spool_printer_info_level_3
1300 {
1301         uint32 secdesc_ptr;
1302 }
1303 SPOOL_PRINTER_INFO_LEVEL_3;
1304
1305 typedef struct spool_printer_info_level
1306 {
1307         uint32 level;
1308         uint32 info_ptr;
1309         SPOOL_PRINTER_INFO_LEVEL_1 *info_1;
1310         SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
1311         SPOOL_PRINTER_INFO_LEVEL_3 *info_3;
1312 }
1313 SPOOL_PRINTER_INFO_LEVEL;
1314
1315 typedef struct spool_printer_driver_info_level_3
1316 {
1317         uint32 cversion;
1318         uint32 name_ptr;
1319         uint32 environment_ptr;
1320         uint32 driverpath_ptr;
1321         uint32 datafile_ptr;
1322         uint32 configfile_ptr;
1323         uint32 helpfile_ptr;
1324         uint32 monitorname_ptr;
1325         uint32 defaultdatatype_ptr;
1326         uint32 dependentfilessize;
1327         uint32 dependentfiles_ptr;
1328
1329         UNISTR2 name;
1330         UNISTR2 environment;
1331         UNISTR2 driverpath;
1332         UNISTR2 datafile;
1333         UNISTR2 configfile;
1334         UNISTR2 helpfile;
1335         UNISTR2 monitorname;
1336         UNISTR2 defaultdatatype;
1337         BUFFER5 dependentfiles;
1338
1339 }
1340 SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;
1341
1342 /* SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 structure */
1343 typedef struct {
1344         uint32 version;
1345         uint32 name_ptr;
1346         uint32 environment_ptr;
1347         uint32 driverpath_ptr;
1348         uint32 datafile_ptr;
1349         uint32 configfile_ptr;
1350         uint32 helpfile_ptr;
1351         uint32 monitorname_ptr;
1352         uint32 defaultdatatype_ptr;
1353         uint32 dependentfiles_len;
1354         uint32 dependentfiles_ptr;
1355         uint32 previousnames_len;
1356         uint32 previousnames_ptr;
1357         NTTIME  driverdate;
1358         UINT64_S        driverversion;
1359         uint32  dummy4;
1360         uint32 mfgname_ptr;
1361         uint32 oemurl_ptr;
1362         uint32 hardwareid_ptr;
1363         uint32 provider_ptr;
1364         UNISTR2 name;
1365         UNISTR2 environment;
1366         UNISTR2 driverpath;
1367         UNISTR2 datafile;
1368         UNISTR2 configfile;
1369         UNISTR2 helpfile;
1370         UNISTR2 monitorname;
1371         UNISTR2 defaultdatatype;
1372         BUFFER5 dependentfiles;
1373         BUFFER5 previousnames;
1374         UNISTR2 mfgname;
1375         UNISTR2 oemurl;
1376         UNISTR2 hardwareid;
1377         UNISTR2 provider;
1378 } SPOOL_PRINTER_DRIVER_INFO_LEVEL_6;
1379
1380
1381 typedef struct spool_printer_driver_info_level
1382 {
1383         uint32 level;
1384         uint32 ptr;
1385         SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
1386         SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *info_6;
1387 }
1388 SPOOL_PRINTER_DRIVER_INFO_LEVEL;
1389
1390
1391 /* this struct is undocumented */
1392 /* thanks to the ddk ... */
1393 typedef struct spool_user_level_1
1394 {
1395         uint32 size;
1396         uint32 client_name_ptr;
1397         uint32 user_name_ptr;
1398         uint32 build;
1399         uint32 major;
1400         uint32 minor;
1401         uint32 processor;
1402         UNISTR2 client_name;
1403         UNISTR2 user_name;
1404 }
1405 SPOOL_USER_LEVEL_1;
1406
1407 typedef struct spool_user_level
1408 {
1409         SPOOL_USER_LEVEL_1 *user_level_1;
1410 }
1411 SPOOL_USER_LEVEL;
1412
1413 typedef struct spool_q_setprinter
1414 {
1415         POLICY_HND handle;
1416         uint32 level;
1417         SPOOL_PRINTER_INFO_LEVEL info;
1418         SEC_DESC_BUF *secdesc_ctr;
1419         DEVMODE_CTR devmode_ctr;
1420
1421         uint32 command;
1422
1423 }
1424 SPOOL_Q_SETPRINTER;
1425
1426 typedef struct spool_r_setprinter
1427 {
1428         uint32 status;
1429 }
1430 SPOOL_R_SETPRINTER;
1431
1432 typedef struct spool_q_addprinter
1433 {
1434         UNISTR2 server_name;
1435         uint32 level;
1436         SPOOL_PRINTER_INFO_LEVEL info;
1437         uint32 unk0;
1438         uint32 unk1;
1439         uint32 unk2;
1440         uint32 unk3;
1441         uint32 user_level;
1442         SPOOL_USER_LEVEL user;
1443 }
1444 SPOOL_Q_ADDPRINTER;
1445
1446 typedef struct spool_r_addprinter
1447 {
1448         uint32 status;
1449 }
1450 SPOOL_R_ADDPRINTER;
1451
1452 typedef struct spool_q_deleteprinter
1453 {
1454         POLICY_HND handle;
1455 }
1456 SPOOL_Q_DELETEPRINTER;
1457
1458 typedef struct spool_r_deleteprinter
1459 {
1460         POLICY_HND handle;
1461         uint32 status;
1462 }
1463 SPOOL_R_DELETEPRINTER;
1464
1465 typedef struct spool_q_abortprinter
1466 {
1467         POLICY_HND handle;
1468 }
1469 SPOOL_Q_ABORTPRINTER;
1470
1471 typedef struct spool_r_abortprinter
1472 {
1473         uint32 status;
1474 }
1475 SPOOL_R_ABORTPRINTER;
1476
1477
1478 typedef struct spool_q_addprinterex
1479 {
1480         uint32 server_name_ptr;
1481         UNISTR2 server_name;
1482         uint32 level;
1483         SPOOL_PRINTER_INFO_LEVEL info;
1484         uint32 unk0;
1485         uint32 unk1;
1486         uint32 unk2;
1487         uint32 unk3;
1488         uint32 user_switch;
1489         SPOOL_USER_CTR user_ctr;
1490 }
1491 SPOOL_Q_ADDPRINTEREX;
1492
1493 typedef struct spool_r_addprinterex
1494 {
1495         POLICY_HND handle;
1496         uint32 status;
1497 }
1498 SPOOL_R_ADDPRINTEREX;
1499
1500
1501 typedef struct spool_q_addprinterdriver
1502 {
1503         uint32 server_name_ptr;
1504         UNISTR2 server_name;
1505         uint32 level;
1506         SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1507 }
1508 SPOOL_Q_ADDPRINTERDRIVER;
1509
1510 typedef struct spool_r_addprinterdriver
1511 {
1512         uint32 status;
1513 }
1514 SPOOL_R_ADDPRINTERDRIVER;
1515
1516
1517 typedef struct driver_directory_1
1518 {
1519         UNISTR name;
1520 }
1521 DRIVER_DIRECTORY_1;
1522
1523 typedef struct driver_info_ctr_info
1524 {
1525         union
1526         {
1527                 DRIVER_DIRECTORY_1 info_1;
1528         }
1529         driver;
1530 }
1531 DRIVER_DIRECTORY_CTR;
1532
1533 typedef struct spool_q_getprinterdriverdirectory
1534 {
1535         uint32 name_ptr;
1536         UNISTR2 name;
1537         uint32 environment_ptr;
1538         UNISTR2 environment;
1539         uint32 level;
1540         NEW_BUFFER *buffer;
1541         uint32 offered;
1542 }
1543 SPOOL_Q_GETPRINTERDRIVERDIR;
1544
1545 typedef struct spool_r_getprinterdriverdirectory
1546 {
1547         NEW_BUFFER *buffer;
1548         uint32 needed;
1549         uint32 status;
1550 }
1551 SPOOL_R_GETPRINTERDRIVERDIR;
1552
1553 typedef struct spool_q_enumprintprocessors
1554 {
1555         uint32 name_ptr;
1556         UNISTR2 name;
1557         uint32 environment_ptr;
1558         UNISTR2 environment;
1559         uint32 level;
1560         NEW_BUFFER *buffer;
1561         uint32 offered;
1562 }
1563 SPOOL_Q_ENUMPRINTPROCESSORS;
1564
1565 typedef struct printprocessor_1
1566 {
1567         UNISTR name;
1568 }
1569 PRINTPROCESSOR_1;
1570
1571 typedef struct spool_r_enumprintprocessors
1572 {
1573         NEW_BUFFER *buffer;
1574         uint32 needed;
1575         uint32 returned;
1576         uint32 status;
1577 }
1578 SPOOL_R_ENUMPRINTPROCESSORS;
1579
1580 typedef struct spool_q_enumprintprocdatatypes
1581 {
1582         uint32 name_ptr;
1583         UNISTR2 name;
1584         uint32 processor_ptr;
1585         UNISTR2 processor;
1586         uint32 level;
1587         NEW_BUFFER *buffer;
1588         uint32 offered;
1589 }
1590 SPOOL_Q_ENUMPRINTPROCDATATYPES;
1591
1592 typedef struct ppdatatype_1
1593 {
1594         UNISTR name;
1595 }
1596 PRINTPROCDATATYPE_1;
1597
1598 typedef struct spool_r_enumprintprocdatatypes
1599 {
1600         NEW_BUFFER *buffer;
1601         uint32 needed;
1602         uint32 returned;
1603         uint32 status;
1604 }
1605 SPOOL_R_ENUMPRINTPROCDATATYPES;
1606
1607 typedef struct printmonitor_1
1608 {
1609         UNISTR name;
1610 }
1611 PRINTMONITOR_1;
1612
1613 typedef struct printmonitor_2
1614 {
1615         UNISTR name;
1616         UNISTR environment;
1617         UNISTR dll_name;
1618 }
1619 PRINTMONITOR_2;
1620
1621 typedef struct spool_q_enumprintmonitors
1622 {
1623         uint32 name_ptr;
1624         UNISTR2 name;
1625         uint32 level;
1626         NEW_BUFFER *buffer;
1627         uint32 offered;
1628 }
1629 SPOOL_Q_ENUMPRINTMONITORS;
1630
1631 typedef struct spool_r_enumprintmonitors
1632 {
1633         NEW_BUFFER *buffer;
1634         uint32 needed;
1635         uint32 returned;
1636         uint32 status;
1637 }
1638 SPOOL_R_ENUMPRINTMONITORS;
1639
1640
1641 typedef struct spool_q_enumprinterdata
1642 {
1643         POLICY_HND handle;
1644         uint32 index;
1645         uint32 valuesize;
1646         uint32 datasize;
1647 }
1648 SPOOL_Q_ENUMPRINTERDATA;
1649
1650 typedef struct spool_r_enumprinterdata
1651 {
1652         uint32 valuesize;
1653         uint16 *value;
1654         uint32 realvaluesize;
1655         uint32 type;
1656         uint32 datasize;
1657         uint8 *data;
1658         uint32 realdatasize;
1659         uint32 status;
1660 }
1661 SPOOL_R_ENUMPRINTERDATA;
1662
1663 typedef struct spool_q_setprinterdata
1664 {
1665         POLICY_HND handle;
1666         UNISTR2 value;
1667         uint32 type;
1668         uint32 max_len;
1669         uint8 *data;
1670         uint32 real_len;
1671         uint32 numeric_data;
1672 }
1673 SPOOL_Q_SETPRINTERDATA;
1674
1675 typedef struct spool_r_setprinterdata
1676 {
1677         uint32 status;
1678 }
1679 SPOOL_R_SETPRINTERDATA;
1680
1681 typedef struct _form
1682 {
1683         uint32 flags;
1684         uint32 name_ptr;
1685         uint32 size_x;
1686         uint32 size_y;
1687         uint32 left;
1688         uint32 top;
1689         uint32 right;
1690         uint32 bottom;
1691         UNISTR2 name;
1692 }
1693 FORM;
1694
1695 typedef struct spool_q_addform
1696 {
1697         POLICY_HND handle;
1698         uint32 level;
1699         uint32 level2;
1700         FORM form;
1701 }
1702 SPOOL_Q_ADDFORM;
1703
1704 typedef struct spool_r_addform
1705 {
1706         uint32 status;
1707 }
1708 SPOOL_R_ADDFORM;
1709
1710 typedef struct spool_q_setform
1711 {
1712         POLICY_HND handle;
1713         UNISTR2 name;
1714         uint32 level;
1715         uint32 level2;
1716         FORM form;
1717 }
1718 SPOOL_Q_SETFORM;
1719
1720 typedef struct spool_r_setform
1721 {
1722         uint32 status;
1723 }
1724 SPOOL_R_SETFORM;
1725
1726 typedef struct spool_q_deleteform
1727 {
1728         POLICY_HND handle;
1729         UNISTR2 name;
1730 }
1731 SPOOL_Q_DELETEFORM;
1732
1733 typedef struct spool_r_deleteform
1734 {
1735         uint32 status;
1736 }
1737 SPOOL_R_DELETEFORM;
1738
1739 typedef struct spool_q_getjob
1740 {
1741         POLICY_HND handle;
1742         uint32 jobid;
1743         uint32 level;
1744         NEW_BUFFER *buffer;
1745         uint32 offered;
1746 }
1747 SPOOL_Q_GETJOB;
1748
1749 typedef struct pjob_info_info
1750 {
1751         union
1752         {
1753                 JOB_INFO_1 *job_info_1;
1754                 JOB_INFO_2 *job_info_2;
1755                 void *info;
1756         }
1757         job;
1758
1759 }
1760 PJOB_INFO;
1761
1762 typedef struct spool_r_getjob
1763 {
1764         NEW_BUFFER *buffer;
1765         uint32 needed;
1766         uint32 status;
1767 }
1768 SPOOL_R_GETJOB;
1769
1770 typedef struct spool_q_replyopenprinter
1771 {
1772         UNISTR2 string;
1773         uint32 printer;
1774         uint32 type;
1775         uint32 unknown0;
1776         uint32 unknown1;
1777 }
1778 SPOOL_Q_REPLYOPENPRINTER;
1779
1780 typedef struct spool_r_replyopenprinter
1781 {
1782         POLICY_HND handle;
1783         uint32 status;
1784 }
1785 SPOOL_R_REPLYOPENPRINTER;
1786
1787 typedef struct spool_q_replycloseprinter
1788 {
1789         POLICY_HND handle;
1790 }
1791 SPOOL_Q_REPLYCLOSEPRINTER;
1792
1793 typedef struct spool_r_replycloseprinter
1794 {
1795         POLICY_HND handle;
1796         uint32 status;
1797 }
1798 SPOOL_R_REPLYCLOSEPRINTER;
1799
1800 typedef struct spool_q_rrpcn
1801 {
1802         POLICY_HND handle;
1803         uint32 change_low;
1804         uint32 change_high;
1805         uint32 unknown0;
1806         uint32 unknown1;
1807         uint32 info_ptr;
1808         SPOOL_NOTIFY_INFO info; 
1809 }
1810 SPOOL_Q_REPLY_RRPCN;
1811
1812 typedef struct spool_r_rrpcn
1813 {
1814         uint32 unknown0;
1815         uint32 status;
1816 }
1817 SPOOL_R_REPLY_RRPCN;
1818
1819 #define PRINTER_DRIVER_VERSION 2
1820 #define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
1821
1822 #endif /* _RPC_SPOOLSS_H */