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