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