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