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