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