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