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