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