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