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