import HEAD into svn+ssh://svn.samba.org/home/svn/samba/trunk
[metze/old/v3-2-winbind-ndr.git] / source / include / rpc_spoolss.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell              1992-2000,
6    Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
7    Copyright (C) Jean Francois Micouleau      1998-2000.
8    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 #define NOTIFY_SECDESC   5              /* Data is a security descriptor */
206
207 #define PRINTER_NOTIFY_TYPE 0x00
208 #define JOB_NOTIFY_TYPE     0x01
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
380 #define NO_PRIORITY      0
381 #define MAX_PRIORITY    99
382 #define MIN_PRIORITY     1
383 #define DEF_PRIORITY     1
384
385 /* the flags of the query */
386 #define PRINTER_ENUM_DEFAULT            0x00000001
387 #define PRINTER_ENUM_LOCAL              0x00000002
388 #define PRINTER_ENUM_CONNECTIONS        0x00000004
389 #define PRINTER_ENUM_FAVORITE           0x00000004
390 #define PRINTER_ENUM_NAME               0x00000008
391 #define PRINTER_ENUM_REMOTE             0x00000010
392 #define PRINTER_ENUM_SHARED             0x00000020
393 #define PRINTER_ENUM_NETWORK            0x00000040
394
395 /* the flags of each printers */
396 #define PRINTER_ENUM_UNKNOWN_8          0x00000008
397 #define PRINTER_ENUM_EXPAND             0x00004000
398 #define PRINTER_ENUM_CONTAINER          0x00008000
399 #define PRINTER_ENUM_ICONMASK           0x00ff0000
400 #define PRINTER_ENUM_ICON1              0x00010000
401 #define PRINTER_ENUM_ICON2              0x00020000
402 #define PRINTER_ENUM_ICON3              0x00040000
403 #define PRINTER_ENUM_ICON4              0x00080000
404 #define PRINTER_ENUM_ICON5              0x00100000
405 #define PRINTER_ENUM_ICON6              0x00200000
406 #define PRINTER_ENUM_ICON7              0x00400000
407 #define PRINTER_ENUM_ICON8              0x00800000
408
409 /* FLAGS for SPOOLSS_DELETEPRINTERDRIVEREX */
410
411 #define DPD_DELETE_UNUSED_FILES         0x00000001
412 #define DPD_DELETE_SPECIFIC_VERSION     0x00000002
413 #define DPD_DELETE_ALL_FILES            0x00000004
414
415 #define DRIVER_ANY_VERSION              0xffffffff
416 #define DRIVER_MAX_VERSION              4
417
418 /* FLAGS for SPOOLSS_ADDPRINTERDRIVEREX */
419
420 #define APD_STRICT_UPGRADE              0x00000001
421 #define APD_STRICT_DOWNGRADE            0x00000002
422 #define APD_COPY_ALL_FILES              0x00000004
423 #define APD_COPY_NEW_FILES              0x00000008
424
425
426 /* this struct is undocumented */
427 /* thanks to the ddk ... */
428 typedef struct spool_user_1
429 {
430         uint32 size;            /* length of user_name & client_name + 2? */
431         uint32 client_name_ptr;
432         uint32 user_name_ptr;
433         uint32 build;
434         uint32 major;
435         uint32 minor;
436         uint32 processor;
437         UNISTR2 client_name;
438         UNISTR2 user_name;
439 }
440 SPOOL_USER_1;
441
442 typedef struct spool_user_ctr_info
443 {
444         uint32 level;
445         uint32 ptr;
446         SPOOL_USER_1 user1;
447 }
448 SPOOL_USER_CTR;
449
450 /*
451  * various bits in the DEVICEMODE.fields member
452  */
453
454 #define DEVMODE_ORIENTATION             0x00000001
455 #define DEVMODE_PAPERSIZE               0x00000002
456 #define DEVMODE_PAPERLENGTH             0x00000004
457 #define DEVMODE_PAPERWIDTH              0x00000008
458 #define DEVMODE_SCALE                   0x00000010
459 #define DEVMODE_POSITION                0x00000020
460 #define DEVMODE_NUP                     0x00000040
461 #define DEVMODE_COPIES                  0x00000100
462 #define DEVMODE_DEFAULTSOURCE           0x00000200
463 #define DEVMODE_PRINTQUALITY            0x00000400
464 #define DEVMODE_COLOR                   0x00000800
465 #define DEVMODE_DUPLEX                  0x00001000
466 #define DEVMODE_YRESOLUTION             0x00002000
467 #define DEVMODE_TTOPTION                0x00004000
468 #define DEVMODE_COLLATE                 0x00008000
469 #define DEVMODE_FORMNAME                0x00010000
470 #define DEVMODE_LOGPIXELS               0x00020000
471 #define DEVMODE_BITSPERPEL              0x00040000
472 #define DEVMODE_PELSWIDTH               0x00080000
473 #define DEVMODE_PELSHEIGHT              0x00100000
474 #define DEVMODE_DISPLAYFLAGS            0x00200000
475 #define DEVMODE_DISPLAYFREQUENCY        0x00400000
476 #define DEVMODE_ICMMETHOD               0x00800000
477 #define DEVMODE_ICMINTENT               0x01000000
478 #define DEVMODE_MEDIATYPE               0x02000000
479 #define DEVMODE_DITHERTYPE              0x04000000
480 #define DEVMODE_PANNINGWIDTH            0x08000000
481 #define DEVMODE_PANNINGHEIGHT           0x10000000
482
483
484 /* 
485  * Devicemode structure
486  */
487
488 typedef struct devicemode
489 {
490         UNISTR devicename;
491         uint16 specversion;
492         uint16 driverversion;
493         uint16 size;
494         uint16 driverextra;
495         uint32 fields;
496         uint16 orientation;
497         uint16 papersize;
498         uint16 paperlength;
499         uint16 paperwidth;
500         uint16 scale;
501         uint16 copies;
502         uint16 defaultsource;
503         uint16 printquality;
504         uint16 color;
505         uint16 duplex;
506         uint16 yresolution;
507         uint16 ttoption;
508         uint16 collate;
509         UNISTR formname;
510         uint16 logpixels;
511         uint32 bitsperpel;
512         uint32 pelswidth;
513         uint32 pelsheight;
514         uint32 displayflags;
515         uint32 displayfrequency;
516         uint32 icmmethod;
517         uint32 icmintent;
518         uint32 mediatype;
519         uint32 dithertype;
520         uint32 reserved1;
521         uint32 reserved2;
522         uint32 panningwidth;
523         uint32 panningheight;
524         uint8 *private;
525 }
526 DEVICEMODE;
527
528 typedef struct _devmode_cont
529 {
530         uint32 size;
531         uint32 devmode_ptr;
532         DEVICEMODE *devmode;
533 }
534 DEVMODE_CTR;
535
536 typedef struct _printer_default
537 {
538         uint32 datatype_ptr;
539         UNISTR2 datatype;
540         DEVMODE_CTR devmode_cont;
541         uint32 access_required;
542 }
543 PRINTER_DEFAULT;
544
545 /* SPOOL_Q_OPEN_PRINTER request to open a printer */
546 typedef struct spool_q_open_printer
547 {
548         uint32 printername_ptr;
549         UNISTR2 printername;
550         PRINTER_DEFAULT printer_default;
551 }
552 SPOOL_Q_OPEN_PRINTER;
553
554 /* SPOOL_R_OPEN_PRINTER reply to an open printer */
555 typedef struct spool_r_open_printer
556 {
557         POLICY_HND handle;      /* handle used along all transactions (20*uint8) */
558         WERROR status;
559 }
560 SPOOL_R_OPEN_PRINTER;
561
562 /* SPOOL_Q_OPEN_PRINTER_EX request to open a printer */
563 typedef struct spool_q_open_printer_ex
564 {
565         uint32 printername_ptr;
566         UNISTR2 printername;
567         PRINTER_DEFAULT printer_default;
568         uint32 user_switch;
569         SPOOL_USER_CTR user_ctr;
570 }
571 SPOOL_Q_OPEN_PRINTER_EX;
572
573 /* SPOOL_R_OPEN_PRINTER_EX reply to an open printer */
574 typedef struct spool_r_open_printer_ex
575 {
576         POLICY_HND handle;      /* handle used along all transactions (20*uint8) */
577         WERROR status;
578 }
579 SPOOL_R_OPEN_PRINTER_EX;
580
581 typedef struct spool_notify_option_type
582 {
583         uint16 type;
584         uint16 reserved0;
585         uint32 reserved1;
586         uint32 reserved2;
587         uint32 count;
588         uint32 fields_ptr;
589         uint32 count2;
590         uint16 fields[MAX_NOTIFY_TYPE_FOR_NOW];
591 }
592 SPOOL_NOTIFY_OPTION_TYPE;
593
594 typedef struct spool_notify_option_type_ctr
595 {
596         uint32 count;
597         SPOOL_NOTIFY_OPTION_TYPE *type;
598 }
599 SPOOL_NOTIFY_OPTION_TYPE_CTR;
600
601
602
603 typedef struct s_header_type
604 {
605         uint32 type;
606         union
607         {
608                 uint32 value;
609                 UNISTR string;
610         }
611         data;
612 }
613 HEADER_TYPE;
614
615 typedef struct new_buffer
616 {
617         uint32 ptr;
618         uint32 size;
619         prs_struct prs;
620         uint32 struct_start;
621         uint32 string_at_end;
622 }
623 NEW_BUFFER;
624
625 typedef struct spool_q_getprinterdata
626 {
627         POLICY_HND handle;
628         UNISTR2 valuename;
629         uint32 size;
630 }
631 SPOOL_Q_GETPRINTERDATA;
632
633 typedef struct spool_r_getprinterdata
634 {
635         uint32 type;
636         uint32 size;
637         uint8 *data;
638         uint32 needed;
639         WERROR status;
640 }
641 SPOOL_R_GETPRINTERDATA;
642
643 typedef struct spool_q_deleteprinterdata
644 {
645         POLICY_HND handle;
646         UNISTR2 valuename;
647 }
648 SPOOL_Q_DELETEPRINTERDATA;
649
650 typedef struct spool_r_deleteprinterdata
651 {
652         WERROR status;
653 }
654 SPOOL_R_DELETEPRINTERDATA;
655
656 typedef struct spool_q_closeprinter
657 {
658         POLICY_HND handle;
659 }
660 SPOOL_Q_CLOSEPRINTER;
661
662 typedef struct spool_r_closeprinter
663 {
664         POLICY_HND handle;
665         WERROR status;
666 }
667 SPOOL_R_CLOSEPRINTER;
668
669 typedef struct spool_q_startpageprinter
670 {
671         POLICY_HND handle;
672 }
673 SPOOL_Q_STARTPAGEPRINTER;
674
675 typedef struct spool_r_startpageprinter
676 {
677         WERROR status;
678 }
679 SPOOL_R_STARTPAGEPRINTER;
680
681 typedef struct spool_q_endpageprinter
682 {
683         POLICY_HND handle;
684 }
685 SPOOL_Q_ENDPAGEPRINTER;
686
687 typedef struct spool_r_endpageprinter
688 {
689         WERROR status;
690 }
691 SPOOL_R_ENDPAGEPRINTER;
692
693
694 typedef struct spool_q_deleteprinterdriver
695 {
696         uint32 server_ptr;
697         UNISTR2 server;
698         UNISTR2 arch;
699         UNISTR2 driver;
700 }
701 SPOOL_Q_DELETEPRINTERDRIVER;
702
703 typedef struct spool_r_deleteprinterdriver
704 {
705         WERROR status;
706 }
707 SPOOL_R_DELETEPRINTERDRIVER;
708
709 typedef struct spool_q_deleteprinterdriverex
710 {
711         uint32 server_ptr;
712         UNISTR2 server;
713         UNISTR2 arch;
714         UNISTR2 driver;
715         uint32 delete_flags;
716         uint32 version;
717 }
718 SPOOL_Q_DELETEPRINTERDRIVEREX;
719
720 typedef struct spool_r_deleteprinterdriverex
721 {
722         WERROR status;
723 }
724 SPOOL_R_DELETEPRINTERDRIVEREX;
725
726
727 typedef struct spool_doc_info_1
728 {
729         uint32 p_docname;
730         uint32 p_outputfile;
731         uint32 p_datatype;
732         UNISTR2 docname;
733         UNISTR2 outputfile;
734         UNISTR2 datatype;
735 }
736 DOC_INFO_1;
737
738 typedef struct spool_doc_info
739 {
740         uint32 switch_value;
741         DOC_INFO_1 doc_info_1;
742 }
743 DOC_INFO;
744
745 typedef struct spool_doc_info_container
746 {
747         uint32 level;
748         DOC_INFO docinfo;
749 }
750 DOC_INFO_CONTAINER;
751
752 typedef struct spool_q_startdocprinter
753 {
754         POLICY_HND handle;
755         DOC_INFO_CONTAINER doc_info_container;
756 }
757 SPOOL_Q_STARTDOCPRINTER;
758
759 typedef struct spool_r_startdocprinter
760 {
761         uint32 jobid;
762         WERROR status;
763 }
764 SPOOL_R_STARTDOCPRINTER;
765
766 typedef struct spool_q_enddocprinter
767 {
768         POLICY_HND handle;
769 }
770 SPOOL_Q_ENDDOCPRINTER;
771
772 typedef struct spool_r_enddocprinter
773 {
774         WERROR status;
775 }
776 SPOOL_R_ENDDOCPRINTER;
777
778 typedef struct spool_q_writeprinter
779 {
780         POLICY_HND handle;
781         uint32 buffer_size;
782         uint8 *buffer;
783         uint32 buffer_size2;
784 }
785 SPOOL_Q_WRITEPRINTER;
786
787 typedef struct spool_r_writeprinter
788 {
789         uint32 buffer_written;
790         WERROR status;
791 }
792 SPOOL_R_WRITEPRINTER;
793
794 typedef struct spool_notify_option
795 {
796         uint32 version;
797         uint32 flags;
798         uint32 count;
799         uint32 option_type_ptr;
800         SPOOL_NOTIFY_OPTION_TYPE_CTR ctr;
801 }
802 SPOOL_NOTIFY_OPTION;
803
804 typedef struct spool_notify_info_data
805 {
806         uint16 type;
807         uint16 field;
808         uint32 reserved;
809         uint32 id;
810         union {
811                 uint32 value[2];
812                 struct {
813                         uint32 length;
814                         uint16 *string;
815                 } data;
816                 struct {
817                         uint32  size;
818                         SEC_DESC *desc;
819                 } sd;
820         }
821         notify_data;
822         uint32 size;
823         BOOL enc_type;
824 } SPOOL_NOTIFY_INFO_DATA;
825
826 typedef struct spool_notify_info
827 {
828         uint32 version;
829         uint32 flags;
830         uint32 count;
831         SPOOL_NOTIFY_INFO_DATA *data;
832 }
833 SPOOL_NOTIFY_INFO;
834
835 /* If the struct name looks obscure, yes it is ! */
836 /* RemoteFindFirstPrinterChangeNotificationEx query struct */
837 typedef struct spoolss_q_rffpcnex
838 {
839         POLICY_HND handle;
840         uint32 flags;
841         uint32 options;
842         uint32 localmachine_ptr;
843         UNISTR2 localmachine;
844         uint32 printerlocal;
845         uint32 option_ptr;
846         SPOOL_NOTIFY_OPTION *option;
847 }
848 SPOOL_Q_RFFPCNEX;
849
850 typedef struct spool_r_rffpcnex
851 {
852         WERROR status;
853 }
854 SPOOL_R_RFFPCNEX;
855
856 /* Remote Find Next Printer Change Notify Ex */
857 typedef struct spool_q_rfnpcnex
858 {
859         POLICY_HND handle;
860         uint32 change;
861         uint32 option_ptr;
862         SPOOL_NOTIFY_OPTION *option;
863 }
864 SPOOL_Q_RFNPCNEX;
865
866 typedef struct spool_r_rfnpcnex
867 {
868         uint32 info_ptr;
869         SPOOL_NOTIFY_INFO info;
870         WERROR status;
871 }
872 SPOOL_R_RFNPCNEX;
873
874 /* Find Close Printer Notify */
875 typedef struct spool_q_fcpn
876 {
877         POLICY_HND handle;
878 }
879 SPOOL_Q_FCPN;
880
881 typedef struct spool_r_fcpn
882 {
883         WERROR status;
884 }
885 SPOOL_R_FCPN;
886
887
888 typedef struct printer_info_0
889 {
890         UNISTR printername;
891         UNISTR servername;
892         uint32 cjobs;
893         uint32 total_jobs;
894         uint32 total_bytes;
895         
896         uint16 year;
897         uint16 month;
898         uint16 dayofweek;
899         uint16 day;
900         uint16 hour;
901         uint16 minute;
902         uint16 second;
903         uint16 milliseconds;
904
905         uint32 global_counter;
906         uint32 total_pages;
907
908         uint16 major_version;
909         uint16 build_version;
910
911         uint32 unknown7;
912         uint32 unknown8;
913         uint32 unknown9;
914         uint32 session_counter;
915         uint32 unknown11;
916         uint32 printer_errors;
917         uint32 unknown13;
918         uint32 unknown14;
919         uint32 unknown15;
920         uint32 unknown16;
921         uint32 change_id;
922         uint32 unknown18;
923         uint32 status;
924         uint32 unknown20;
925         uint32 c_setprinter;
926
927         uint16 unknown22;
928         uint16 unknown23;
929         uint16 unknown24;
930         uint16 unknown25;
931         uint16 unknown26;
932         uint16 unknown27;
933         uint16 unknown28;
934         uint16 unknown29;
935 } PRINTER_INFO_0;
936
937 typedef struct printer_info_1
938 {
939         uint32 flags;
940         UNISTR description;
941         UNISTR name;
942         UNISTR comment;
943 }
944 PRINTER_INFO_1;
945
946 typedef struct printer_info_2
947 {
948         UNISTR servername;
949         UNISTR printername;
950         UNISTR sharename;
951         UNISTR portname;
952         UNISTR drivername;
953         UNISTR comment;
954         UNISTR location;
955         DEVICEMODE *devmode;
956         UNISTR sepfile;
957         UNISTR printprocessor;
958         UNISTR datatype;
959         UNISTR parameters;
960         SEC_DESC *secdesc;
961         uint32 attributes;
962         uint32 priority;
963         uint32 defaultpriority;
964         uint32 starttime;
965         uint32 untiltime;
966         uint32 status;
967         uint32 cjobs;
968         uint32 averageppm;
969 }
970 PRINTER_INFO_2;
971
972 typedef struct printer_info_3
973 {
974         uint32 flags;
975         SEC_DESC *secdesc;
976 }
977 PRINTER_INFO_3;
978
979 typedef struct printer_info_4
980 {
981         UNISTR printername;
982         UNISTR servername;
983         uint32 attributes;
984 }
985 PRINTER_INFO_4;
986
987 typedef struct printer_info_5
988 {
989         UNISTR printername;
990         UNISTR portname;
991         uint32 attributes;
992         uint32 device_not_selected_timeout;
993         uint32 transmission_retry_timeout;
994 }
995 PRINTER_INFO_5;
996
997 #define SPOOL_DS_PUBLISH        1
998 #define SPOOL_DS_UPDATE         2
999 #define SPOOL_DS_UNPUBLISH      4
1000 #define SPOOL_DS_PENDING        0x80000000
1001
1002 typedef struct printer_info_7
1003 {
1004         UNISTR guid; /* text form of printer guid */
1005         uint32 action;
1006 }
1007 PRINTER_INFO_7;
1008
1009 typedef struct spool_q_enumprinters
1010 {
1011         uint32 flags;
1012         uint32 servername_ptr;
1013         UNISTR2 servername;
1014         uint32 level;
1015         NEW_BUFFER *buffer;
1016         uint32 offered;
1017 }
1018 SPOOL_Q_ENUMPRINTERS;
1019
1020 typedef struct printer_info_ctr_info
1021 {
1022         PRINTER_INFO_0 *printers_0;
1023         PRINTER_INFO_1 *printers_1;
1024         PRINTER_INFO_2 *printers_2;
1025         PRINTER_INFO_3 *printers_3;
1026         PRINTER_INFO_4 *printers_4;
1027         PRINTER_INFO_5 *printers_5;
1028 }
1029 PRINTER_INFO_CTR;
1030
1031 typedef struct spool_r_enumprinters
1032 {
1033         NEW_BUFFER *buffer;
1034         uint32 needed;          /* bytes needed */
1035         uint32 returned;        /* number of printers */
1036         WERROR status;
1037 }
1038 SPOOL_R_ENUMPRINTERS;
1039
1040
1041 typedef struct spool_q_getprinter
1042 {
1043         POLICY_HND handle;
1044         uint32 level;
1045         NEW_BUFFER *buffer;
1046         uint32 offered;
1047 }
1048 SPOOL_Q_GETPRINTER;
1049
1050 typedef struct printer_info_info
1051 {
1052         union
1053         {
1054                 PRINTER_INFO_0 *info0;
1055                 PRINTER_INFO_1 *info1;
1056                 PRINTER_INFO_2 *info2;
1057                 void *info;
1058         } printer;
1059 } PRINTER_INFO;
1060
1061 typedef struct spool_r_getprinter
1062 {
1063         NEW_BUFFER *buffer;
1064         uint32 needed;
1065         WERROR status;
1066 } SPOOL_R_GETPRINTER;
1067
1068 typedef struct driver_info_1
1069 {
1070         UNISTR name;
1071 } DRIVER_INFO_1;
1072
1073 typedef struct driver_info_2
1074 {
1075         uint32 version;
1076         UNISTR name;
1077         UNISTR architecture;
1078         UNISTR driverpath;
1079         UNISTR datafile;
1080         UNISTR configfile;
1081 } DRIVER_INFO_2;
1082
1083 typedef struct driver_info_3
1084 {
1085         uint32 version;
1086         UNISTR name;
1087         UNISTR architecture;
1088         UNISTR driverpath;
1089         UNISTR datafile;
1090         UNISTR configfile;
1091         UNISTR helpfile;
1092         uint16 *dependentfiles;
1093         UNISTR monitorname;
1094         UNISTR defaultdatatype;
1095 }
1096 DRIVER_INFO_3;
1097
1098 typedef struct driver_info_6
1099 {
1100         uint32 version;
1101         UNISTR name;
1102         UNISTR architecture;
1103         UNISTR driverpath;
1104         UNISTR datafile;
1105         UNISTR configfile;
1106         UNISTR helpfile;
1107         uint16 *dependentfiles;
1108         UNISTR monitorname;
1109         UNISTR defaultdatatype;
1110         uint16* previousdrivernames;
1111         NTTIME driver_date;
1112         uint32 padding;
1113         uint32 driver_version_low;
1114         uint32 driver_version_high;
1115         UNISTR mfgname;
1116         UNISTR oem_url;
1117         UNISTR hardware_id;
1118         UNISTR provider;
1119 }
1120 DRIVER_INFO_6;
1121
1122 typedef struct driver_info_info
1123 {
1124         DRIVER_INFO_1 *info1;
1125         DRIVER_INFO_2 *info2;
1126         DRIVER_INFO_3 *info3;
1127         DRIVER_INFO_6 *info6;
1128 }
1129 PRINTER_DRIVER_CTR;
1130
1131 typedef struct spool_q_getprinterdriver2
1132 {
1133         POLICY_HND handle;
1134         uint32 architecture_ptr;
1135         UNISTR2 architecture;
1136         uint32 level;
1137         NEW_BUFFER *buffer;
1138         uint32 offered;
1139         uint32 clientmajorversion;
1140         uint32 clientminorversion;
1141 }
1142 SPOOL_Q_GETPRINTERDRIVER2;
1143
1144 typedef struct spool_r_getprinterdriver2
1145 {
1146         NEW_BUFFER *buffer;
1147         uint32 needed;
1148         uint32 servermajorversion;
1149         uint32 serverminorversion;
1150         WERROR status;
1151 }
1152 SPOOL_R_GETPRINTERDRIVER2;
1153
1154
1155 typedef struct add_jobinfo_1
1156 {
1157         UNISTR path;
1158         uint32 job_number;
1159 }
1160 ADD_JOBINFO_1;
1161
1162
1163 typedef struct spool_q_addjob
1164 {
1165         POLICY_HND handle;
1166         uint32 level;
1167         NEW_BUFFER *buffer;
1168         uint32 offered;
1169 }
1170 SPOOL_Q_ADDJOB;
1171
1172 typedef struct spool_r_addjob
1173 {
1174         NEW_BUFFER *buffer;
1175         uint32 needed;
1176         WERROR status;
1177 }
1178 SPOOL_R_ADDJOB;
1179
1180 /*
1181  * I'm really wondering how many different time formats
1182  * I will have to cope with
1183  *
1184  * JFM, 09/13/98 In a mad mood ;-(
1185 */
1186 typedef struct systemtime
1187 {
1188         uint16 year;
1189         uint16 month;
1190         uint16 dayofweek;
1191         uint16 day;
1192         uint16 hour;
1193         uint16 minute;
1194         uint16 second;
1195         uint16 milliseconds;
1196 }
1197 SYSTEMTIME;
1198
1199 typedef struct s_job_info_1
1200 {
1201         uint32 jobid;
1202         UNISTR printername;
1203         UNISTR machinename;
1204         UNISTR username;
1205         UNISTR document;
1206         UNISTR datatype;
1207         UNISTR text_status;
1208         uint32 status;
1209         uint32 priority;
1210         uint32 position;
1211         uint32 totalpages;
1212         uint32 pagesprinted;
1213         SYSTEMTIME submitted;
1214 }
1215 JOB_INFO_1;
1216
1217 typedef struct s_job_info_2
1218 {
1219         uint32 jobid;
1220         UNISTR printername;
1221         UNISTR machinename;
1222         UNISTR username;
1223         UNISTR document;
1224         UNISTR notifyname;
1225         UNISTR datatype;
1226         UNISTR printprocessor;
1227         UNISTR parameters;
1228         UNISTR drivername;
1229         DEVICEMODE *devmode;
1230         UNISTR text_status;
1231 /*      SEC_DESC sec_desc;*/
1232         uint32 status;
1233         uint32 priority;
1234         uint32 position;
1235         uint32 starttime;
1236         uint32 untiltime;
1237         uint32 totalpages;
1238         uint32 size;
1239         SYSTEMTIME submitted;
1240         uint32 timeelapsed;
1241         uint32 pagesprinted;
1242 }
1243 JOB_INFO_2;
1244
1245 typedef struct spool_q_enumjobs
1246 {
1247         POLICY_HND handle;
1248         uint32 firstjob;
1249         uint32 numofjobs;
1250         uint32 level;
1251         NEW_BUFFER *buffer;
1252         uint32 offered;
1253 }
1254 SPOOL_Q_ENUMJOBS;
1255
1256 typedef struct job_info_ctr_info
1257 {
1258         union
1259         {
1260                 JOB_INFO_1 *job_info_1;
1261                 JOB_INFO_2 *job_info_2;
1262                 void *info;
1263         } job;
1264
1265 } JOB_INFO_CTR;
1266
1267 typedef struct spool_r_enumjobs
1268 {
1269         NEW_BUFFER *buffer;
1270         uint32 needed;
1271         uint32 returned;
1272         WERROR status;
1273 }
1274 SPOOL_R_ENUMJOBS;
1275
1276 typedef struct spool_q_schedulejob
1277 {
1278         POLICY_HND handle;
1279         uint32 jobid;
1280 }
1281 SPOOL_Q_SCHEDULEJOB;
1282
1283 typedef struct spool_r_schedulejob
1284 {
1285         WERROR status;
1286 }
1287 SPOOL_R_SCHEDULEJOB;
1288
1289 typedef struct s_port_info_1
1290 {
1291         UNISTR port_name;
1292 }
1293 PORT_INFO_1;
1294
1295 typedef struct s_port_info_2
1296 {
1297         UNISTR port_name;
1298         UNISTR monitor_name;
1299         UNISTR description;
1300         uint32 port_type;
1301         uint32 reserved;
1302 }
1303 PORT_INFO_2;
1304
1305 /* Port Type bits */
1306 #define PORT_TYPE_WRITE         0x0001
1307 #define PORT_TYPE_READ          0x0002
1308 #define PORT_TYPE_REDIRECTED    0x0004
1309 #define PORT_TYPE_NET_ATTACHED  0x0008
1310
1311 typedef struct spool_q_enumports
1312 {
1313         uint32 name_ptr;
1314         UNISTR2 name;
1315         uint32 level;
1316         NEW_BUFFER *buffer;
1317         uint32 offered;
1318 }
1319 SPOOL_Q_ENUMPORTS;
1320
1321 typedef struct port_info_ctr_info
1322 {
1323         union
1324         {
1325                 PORT_INFO_1 *info_1;
1326                 PORT_INFO_2 *info_2;
1327         }
1328         port;
1329
1330 }
1331 PORT_INFO_CTR;
1332
1333 typedef struct spool_r_enumports
1334 {
1335         NEW_BUFFER *buffer;
1336         uint32 needed;          /* bytes needed */
1337         uint32 returned;        /* number of printers */
1338         WERROR status;
1339 }
1340 SPOOL_R_ENUMPORTS;
1341
1342 #define JOB_CONTROL_PAUSE              1
1343 #define JOB_CONTROL_RESUME             2
1344 #define JOB_CONTROL_CANCEL             3
1345 #define JOB_CONTROL_RESTART            4
1346 #define JOB_CONTROL_DELETE             5
1347
1348 typedef struct job_info_info
1349 {
1350         union
1351         {
1352                 JOB_INFO_1 job_info_1;
1353                 JOB_INFO_2 job_info_2;
1354         }
1355         job;
1356
1357 }
1358 JOB_INFO;
1359
1360 typedef struct spool_q_setjob
1361 {
1362         POLICY_HND handle;
1363         uint32 jobid;
1364         uint32 level;
1365         JOB_INFO ctr;
1366         uint32 command;
1367
1368 }
1369 SPOOL_Q_SETJOB;
1370
1371 typedef struct spool_r_setjob
1372 {
1373         WERROR status;
1374
1375 }
1376 SPOOL_R_SETJOB;
1377
1378 typedef struct spool_q_enumprinterdrivers
1379 {
1380         uint32 name_ptr;
1381         UNISTR2 name;
1382         uint32 environment_ptr;
1383         UNISTR2 environment;
1384         uint32 level;
1385         NEW_BUFFER *buffer;
1386         uint32 offered;
1387 }
1388 SPOOL_Q_ENUMPRINTERDRIVERS;
1389
1390 typedef struct spool_r_enumprinterdrivers
1391 {
1392         NEW_BUFFER *buffer;
1393         uint32 needed;
1394         uint32 returned;
1395         WERROR status;
1396 }
1397 SPOOL_R_ENUMPRINTERDRIVERS;
1398
1399 #define FORM_USER    0
1400 #define FORM_BUILTIN 1
1401 #define FORM_PRINTER 2
1402
1403 typedef struct spool_form_1
1404 {
1405         uint32 flag;
1406         UNISTR name;
1407         uint32 width;
1408         uint32 length;
1409         uint32 left;
1410         uint32 top;
1411         uint32 right;
1412         uint32 bottom;
1413 }
1414 FORM_1;
1415
1416 typedef struct spool_q_enumforms
1417 {
1418         POLICY_HND handle;
1419         uint32 level;
1420         NEW_BUFFER *buffer;
1421         uint32 offered;
1422 }
1423 SPOOL_Q_ENUMFORMS;
1424
1425 typedef struct spool_r_enumforms
1426 {
1427         NEW_BUFFER *buffer;
1428         uint32 needed;
1429         uint32 numofforms;
1430         WERROR status;
1431 }
1432 SPOOL_R_ENUMFORMS;
1433
1434 typedef struct spool_q_getform
1435 {
1436         POLICY_HND handle;
1437         UNISTR2 formname;
1438         uint32 level;
1439         NEW_BUFFER *buffer;
1440         uint32 offered;
1441 }
1442 SPOOL_Q_GETFORM;
1443
1444 typedef struct spool_r_getform
1445 {
1446         NEW_BUFFER *buffer;
1447         uint32 needed;
1448         WERROR status;
1449 }
1450 SPOOL_R_GETFORM;
1451
1452 typedef struct spool_printer_info_level_1
1453 {
1454         uint32 flags;
1455         uint32 description_ptr;
1456         uint32 name_ptr;
1457         uint32 comment_ptr;
1458         UNISTR2 description;
1459         UNISTR2 name;
1460         UNISTR2 comment;        
1461 } SPOOL_PRINTER_INFO_LEVEL_1;
1462
1463 typedef struct spool_printer_info_level_2
1464 {
1465         uint32 servername_ptr;
1466         uint32 printername_ptr;
1467         uint32 sharename_ptr;
1468         uint32 portname_ptr;
1469         uint32 drivername_ptr;
1470         uint32 comment_ptr;
1471         uint32 location_ptr;
1472         uint32 devmode_ptr;
1473         uint32 sepfile_ptr;
1474         uint32 printprocessor_ptr;
1475         uint32 datatype_ptr;
1476         uint32 parameters_ptr;
1477         uint32 secdesc_ptr;
1478         uint32 attributes;
1479         uint32 priority;
1480         uint32 default_priority;
1481         uint32 starttime;
1482         uint32 untiltime;
1483         uint32 status;
1484         uint32 cjobs;
1485         uint32 averageppm;
1486         UNISTR2 servername;
1487         UNISTR2 printername;
1488         UNISTR2 sharename;
1489         UNISTR2 portname;
1490         UNISTR2 drivername;
1491         UNISTR2 comment;
1492         UNISTR2 location;
1493         UNISTR2 sepfile;
1494         UNISTR2 printprocessor;
1495         UNISTR2 datatype;
1496         UNISTR2 parameters;
1497 }
1498 SPOOL_PRINTER_INFO_LEVEL_2;
1499
1500 typedef struct spool_printer_info_level_3
1501 {
1502         uint32 secdesc_ptr;
1503 }
1504 SPOOL_PRINTER_INFO_LEVEL_3;
1505
1506 typedef struct spool_printer_info_level_7
1507 {
1508         uint32 guid_ptr;
1509         uint32 action;
1510         UNISTR2 guid;
1511 }
1512 SPOOL_PRINTER_INFO_LEVEL_7;
1513
1514 typedef struct spool_printer_info_level
1515 {
1516         uint32 level;
1517         uint32 info_ptr;
1518         SPOOL_PRINTER_INFO_LEVEL_1 *info_1;
1519         SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
1520         SPOOL_PRINTER_INFO_LEVEL_3 *info_3;
1521         SPOOL_PRINTER_INFO_LEVEL_7 *info_7;
1522 }
1523 SPOOL_PRINTER_INFO_LEVEL;
1524
1525 typedef struct spool_printer_driver_info_level_3
1526 {
1527         uint32 cversion;
1528         uint32 name_ptr;
1529         uint32 environment_ptr;
1530         uint32 driverpath_ptr;
1531         uint32 datafile_ptr;
1532         uint32 configfile_ptr;
1533         uint32 helpfile_ptr;
1534         uint32 monitorname_ptr;
1535         uint32 defaultdatatype_ptr;
1536         uint32 dependentfilessize;
1537         uint32 dependentfiles_ptr;
1538
1539         UNISTR2 name;
1540         UNISTR2 environment;
1541         UNISTR2 driverpath;
1542         UNISTR2 datafile;
1543         UNISTR2 configfile;
1544         UNISTR2 helpfile;
1545         UNISTR2 monitorname;
1546         UNISTR2 defaultdatatype;
1547         BUFFER5 dependentfiles;
1548
1549 }
1550 SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;
1551
1552 /* SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 structure */
1553 typedef struct {
1554         uint32 version;
1555         uint32 name_ptr;
1556         uint32 environment_ptr;
1557         uint32 driverpath_ptr;
1558         uint32 datafile_ptr;
1559         uint32 configfile_ptr;
1560         uint32 helpfile_ptr;
1561         uint32 monitorname_ptr;
1562         uint32 defaultdatatype_ptr;
1563         uint32 dependentfiles_len;
1564         uint32 dependentfiles_ptr;
1565         uint32 previousnames_len;
1566         uint32 previousnames_ptr;
1567         NTTIME  driverdate;
1568         UINT64_S        driverversion;
1569         uint32  dummy4;
1570         uint32 mfgname_ptr;
1571         uint32 oemurl_ptr;
1572         uint32 hardwareid_ptr;
1573         uint32 provider_ptr;
1574         UNISTR2 name;
1575         UNISTR2 environment;
1576         UNISTR2 driverpath;
1577         UNISTR2 datafile;
1578         UNISTR2 configfile;
1579         UNISTR2 helpfile;
1580         UNISTR2 monitorname;
1581         UNISTR2 defaultdatatype;
1582         BUFFER5 dependentfiles;
1583         BUFFER5 previousnames;
1584         UNISTR2 mfgname;
1585         UNISTR2 oemurl;
1586         UNISTR2 hardwareid;
1587         UNISTR2 provider;
1588 } SPOOL_PRINTER_DRIVER_INFO_LEVEL_6;
1589
1590
1591 typedef struct spool_printer_driver_info_level
1592 {
1593         uint32 level;
1594         uint32 ptr;
1595         SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
1596         SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *info_6;
1597 }
1598 SPOOL_PRINTER_DRIVER_INFO_LEVEL;
1599
1600
1601 /* this struct is undocumented */
1602 /* thanks to the ddk ... */
1603 typedef struct spool_user_level_1
1604 {
1605         uint32 size;
1606         uint32 client_name_ptr;
1607         uint32 user_name_ptr;
1608         uint32 build;
1609         uint32 major;
1610         uint32 minor;
1611         uint32 processor;
1612         UNISTR2 client_name;
1613         UNISTR2 user_name;
1614 }
1615 SPOOL_USER_LEVEL_1;
1616
1617 typedef struct spool_user_level
1618 {
1619         SPOOL_USER_LEVEL_1 *user_level_1;
1620 }
1621 SPOOL_USER_LEVEL;
1622
1623 typedef struct spool_q_setprinter
1624 {
1625         POLICY_HND handle;
1626         uint32 level;
1627         SPOOL_PRINTER_INFO_LEVEL info;
1628         SEC_DESC_BUF *secdesc_ctr;
1629         DEVMODE_CTR devmode_ctr;
1630
1631         uint32 command;
1632
1633 }
1634 SPOOL_Q_SETPRINTER;
1635
1636 typedef struct spool_r_setprinter
1637 {
1638         WERROR status;
1639 }
1640 SPOOL_R_SETPRINTER;
1641
1642 typedef struct spool_q_addprinter
1643 {
1644         UNISTR2 server_name;
1645         uint32 level;
1646         SPOOL_PRINTER_INFO_LEVEL info;
1647         DEVMODE_CTR devmode_ctr;
1648         SEC_DESC_BUF *secdesc_ctr;
1649         uint32 user_level;
1650         SPOOL_USER_LEVEL user;
1651 }
1652 SPOOL_Q_ADDPRINTER;
1653
1654 typedef struct spool_r_addprinter
1655 {
1656         WERROR status;
1657 }
1658 SPOOL_R_ADDPRINTER;
1659
1660 typedef struct spool_q_deleteprinter
1661 {
1662         POLICY_HND handle;
1663 }
1664 SPOOL_Q_DELETEPRINTER;
1665
1666 typedef struct spool_r_deleteprinter
1667 {
1668         POLICY_HND handle;
1669         WERROR status;
1670 }
1671 SPOOL_R_DELETEPRINTER;
1672
1673 typedef struct spool_q_abortprinter
1674 {
1675         POLICY_HND handle;
1676 }
1677 SPOOL_Q_ABORTPRINTER;
1678
1679 typedef struct spool_r_abortprinter
1680 {
1681         WERROR status;
1682 }
1683 SPOOL_R_ABORTPRINTER;
1684
1685
1686 typedef struct spool_q_addprinterex
1687 {
1688         uint32 server_name_ptr;
1689         UNISTR2 server_name;
1690         uint32 level;
1691         SPOOL_PRINTER_INFO_LEVEL info;
1692         DEVMODE_CTR devmode_ctr;
1693         SEC_DESC_BUF *secdesc_ctr;
1694         uint32 user_switch;
1695         SPOOL_USER_CTR user_ctr;
1696 }
1697 SPOOL_Q_ADDPRINTEREX;
1698
1699 typedef struct spool_r_addprinterex
1700 {
1701         POLICY_HND handle;
1702         WERROR status;
1703 }
1704 SPOOL_R_ADDPRINTEREX;
1705
1706
1707 typedef struct spool_q_addprinterdriver
1708 {
1709         uint32 server_name_ptr;
1710         UNISTR2 server_name;
1711         uint32 level;
1712         SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1713 }
1714 SPOOL_Q_ADDPRINTERDRIVER;
1715
1716 typedef struct spool_r_addprinterdriver
1717 {
1718         WERROR status;
1719 }
1720 SPOOL_R_ADDPRINTERDRIVER;
1721
1722 typedef struct spool_q_addprinterdriverex
1723 {
1724         uint32 server_name_ptr;
1725         UNISTR2 server_name;
1726         uint32 level;
1727         SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1728         uint32 copy_flags;
1729 }
1730 SPOOL_Q_ADDPRINTERDRIVEREX;
1731
1732 typedef struct spool_r_addprinterdriverex
1733 {
1734         WERROR status;
1735 }
1736 SPOOL_R_ADDPRINTERDRIVEREX;
1737
1738
1739 typedef struct driver_directory_1
1740 {
1741         UNISTR name;
1742 }
1743 DRIVER_DIRECTORY_1;
1744
1745 typedef struct driver_info_ctr_info
1746 {
1747         DRIVER_DIRECTORY_1 *info1;
1748 }
1749 DRIVER_DIRECTORY_CTR;
1750
1751 typedef struct spool_q_getprinterdriverdirectory
1752 {
1753         uint32 name_ptr;
1754         UNISTR2 name;
1755         uint32 environment_ptr;
1756         UNISTR2 environment;
1757         uint32 level;
1758         NEW_BUFFER *buffer;
1759         uint32 offered;
1760 }
1761 SPOOL_Q_GETPRINTERDRIVERDIR;
1762
1763 typedef struct spool_r_getprinterdriverdirectory
1764 {
1765         NEW_BUFFER *buffer;
1766         uint32 needed;
1767         WERROR status;
1768 }
1769 SPOOL_R_GETPRINTERDRIVERDIR;
1770
1771 typedef struct spool_q_addprintprocessor
1772 {
1773         uint32 server_ptr;
1774         UNISTR2 server;
1775         UNISTR2 environment;
1776         UNISTR2 path;
1777         UNISTR2 name;
1778 }
1779 SPOOL_Q_ADDPRINTPROCESSOR;
1780
1781 typedef struct spool_r_addprintprocessor
1782 {
1783         WERROR status;
1784 }
1785 SPOOL_R_ADDPRINTPROCESSOR;
1786
1787
1788 typedef struct spool_q_enumprintprocessors
1789 {
1790         uint32 name_ptr;
1791         UNISTR2 name;
1792         uint32 environment_ptr;
1793         UNISTR2 environment;
1794         uint32 level;
1795         NEW_BUFFER *buffer;
1796         uint32 offered;
1797 }
1798 SPOOL_Q_ENUMPRINTPROCESSORS;
1799
1800 typedef struct printprocessor_1
1801 {
1802         UNISTR name;
1803 }
1804 PRINTPROCESSOR_1;
1805
1806 typedef struct spool_r_enumprintprocessors
1807 {
1808         NEW_BUFFER *buffer;
1809         uint32 needed;
1810         uint32 returned;
1811         WERROR status;
1812 }
1813 SPOOL_R_ENUMPRINTPROCESSORS;
1814
1815 typedef struct spool_q_enumprintprocdatatypes
1816 {
1817         uint32 name_ptr;
1818         UNISTR2 name;
1819         uint32 processor_ptr;
1820         UNISTR2 processor;
1821         uint32 level;
1822         NEW_BUFFER *buffer;
1823         uint32 offered;
1824 }
1825 SPOOL_Q_ENUMPRINTPROCDATATYPES;
1826
1827 typedef struct ppdatatype_1
1828 {
1829         UNISTR name;
1830 }
1831 PRINTPROCDATATYPE_1;
1832
1833 typedef struct spool_r_enumprintprocdatatypes
1834 {
1835         NEW_BUFFER *buffer;
1836         uint32 needed;
1837         uint32 returned;
1838         WERROR status;
1839 }
1840 SPOOL_R_ENUMPRINTPROCDATATYPES;
1841
1842 typedef struct printmonitor_1
1843 {
1844         UNISTR name;
1845 }
1846 PRINTMONITOR_1;
1847
1848 typedef struct printmonitor_2
1849 {
1850         UNISTR name;
1851         UNISTR environment;
1852         UNISTR dll_name;
1853 }
1854 PRINTMONITOR_2;
1855
1856 typedef struct spool_q_enumprintmonitors
1857 {
1858         uint32 name_ptr;
1859         UNISTR2 name;
1860         uint32 level;
1861         NEW_BUFFER *buffer;
1862         uint32 offered;
1863 }
1864 SPOOL_Q_ENUMPRINTMONITORS;
1865
1866 typedef struct spool_r_enumprintmonitors
1867 {
1868         NEW_BUFFER *buffer;
1869         uint32 needed;
1870         uint32 returned;
1871         WERROR status;
1872 }
1873 SPOOL_R_ENUMPRINTMONITORS;
1874
1875
1876 typedef struct spool_q_enumprinterdata
1877 {
1878         POLICY_HND handle;
1879         uint32 index;
1880         uint32 valuesize;
1881         uint32 datasize;
1882 }
1883 SPOOL_Q_ENUMPRINTERDATA;
1884
1885 typedef struct spool_r_enumprinterdata
1886 {
1887         uint32 valuesize;
1888         uint16 *value;
1889         uint32 realvaluesize;
1890         uint32 type;
1891         uint32 datasize;
1892         uint8 *data;
1893         uint32 realdatasize;
1894         WERROR status;
1895 }
1896 SPOOL_R_ENUMPRINTERDATA;
1897
1898 typedef struct spool_q_setprinterdata
1899 {
1900         POLICY_HND handle;
1901         UNISTR2 value;
1902         uint32 type;
1903         uint32 max_len;
1904         uint8 *data;
1905         uint32 real_len;
1906         uint32 numeric_data;
1907 }
1908 SPOOL_Q_SETPRINTERDATA;
1909
1910 typedef struct spool_r_setprinterdata
1911 {
1912         WERROR status;
1913 }
1914 SPOOL_R_SETPRINTERDATA;
1915
1916 typedef struct spool_q_resetprinter
1917 {
1918         POLICY_HND handle;
1919         uint32 datatype_ptr;
1920         UNISTR2 datatype;
1921         DEVMODE_CTR devmode_ctr;
1922
1923 } SPOOL_Q_RESETPRINTER;
1924
1925 typedef struct spool_r_resetprinter
1926 {
1927         WERROR status;
1928
1929 SPOOL_R_RESETPRINTER;
1930
1931
1932
1933 typedef struct _form
1934 {
1935         uint32 flags;
1936         uint32 name_ptr;
1937         uint32 size_x;
1938         uint32 size_y;
1939         uint32 left;
1940         uint32 top;
1941         uint32 right;
1942         uint32 bottom;
1943         UNISTR2 name;
1944 }
1945 FORM;
1946
1947 typedef struct spool_q_addform
1948 {
1949         POLICY_HND handle;
1950         uint32 level;
1951         uint32 level2;          /* This should really be part of the FORM structure */
1952         FORM form;
1953 }
1954 SPOOL_Q_ADDFORM;
1955
1956 typedef struct spool_r_addform
1957 {
1958         WERROR status;
1959 }
1960 SPOOL_R_ADDFORM;
1961
1962 typedef struct spool_q_setform
1963 {
1964         POLICY_HND handle;
1965         UNISTR2 name;
1966         uint32 level;
1967         uint32 level2;
1968         FORM form;
1969 }
1970 SPOOL_Q_SETFORM;
1971
1972 typedef struct spool_r_setform
1973 {
1974         WERROR status;
1975 }
1976 SPOOL_R_SETFORM;
1977
1978 typedef struct spool_q_deleteform
1979 {
1980         POLICY_HND handle;
1981         UNISTR2 name;
1982 }
1983 SPOOL_Q_DELETEFORM;
1984
1985 typedef struct spool_r_deleteform
1986 {
1987         WERROR status;
1988 }
1989 SPOOL_R_DELETEFORM;
1990
1991 typedef struct spool_q_getjob
1992 {
1993         POLICY_HND handle;
1994         uint32 jobid;
1995         uint32 level;
1996         NEW_BUFFER *buffer;
1997         uint32 offered;
1998 }
1999 SPOOL_Q_GETJOB;
2000
2001 typedef struct pjob_info_info
2002 {
2003         union
2004         {
2005                 JOB_INFO_1 *job_info_1;
2006                 JOB_INFO_2 *job_info_2;
2007                 void *info;
2008         }
2009         job;
2010
2011 }
2012 PJOB_INFO;
2013
2014 typedef struct spool_r_getjob
2015 {
2016         NEW_BUFFER *buffer;
2017         uint32 needed;
2018         WERROR status;
2019 }
2020 SPOOL_R_GETJOB;
2021
2022 typedef struct spool_q_replyopenprinter
2023 {
2024         UNISTR2 string;
2025         uint32 printer;
2026         uint32 type;
2027         uint32 unknown0;
2028         uint32 unknown1;
2029 }
2030 SPOOL_Q_REPLYOPENPRINTER;
2031
2032 typedef struct spool_r_replyopenprinter
2033 {
2034         POLICY_HND handle;
2035         WERROR status;
2036 }
2037 SPOOL_R_REPLYOPENPRINTER;
2038
2039 typedef struct spool_q_routerreplyprinter
2040 {
2041         POLICY_HND handle;
2042         uint32 condition;
2043         uint32 unknown1;        /* 0x00000001 */
2044         uint32 change_id;
2045         uint8  unknown2[5];     /* 0x0000000001 */
2046 }
2047 SPOOL_Q_ROUTERREPLYPRINTER;
2048
2049 typedef struct spool_r_routerreplyprinter
2050 {
2051         WERROR status;
2052 }
2053 SPOOL_R_ROUTERREPLYPRINTER;
2054
2055 typedef struct spool_q_replycloseprinter
2056 {
2057         POLICY_HND handle;
2058 }
2059 SPOOL_Q_REPLYCLOSEPRINTER;
2060
2061 typedef struct spool_r_replycloseprinter
2062 {
2063         POLICY_HND handle;
2064         WERROR status;
2065 }
2066 SPOOL_R_REPLYCLOSEPRINTER;
2067
2068 typedef struct spool_q_rrpcn
2069 {
2070         POLICY_HND handle;
2071         uint32 change_low;
2072         uint32 change_high;
2073         uint32 unknown0;
2074         uint32 unknown1;
2075         uint32 info_ptr;
2076         SPOOL_NOTIFY_INFO info; 
2077 }
2078 SPOOL_Q_REPLY_RRPCN;
2079
2080 typedef struct spool_r_rrpcn
2081 {
2082         uint32 unknown0;
2083         WERROR status;
2084 }
2085 SPOOL_R_REPLY_RRPCN;
2086
2087 typedef struct spool_q_getprinterdataex
2088 {
2089         POLICY_HND handle;
2090         UNISTR2 keyname;
2091         UNISTR2 valuename;
2092         uint32 size;
2093 }
2094 SPOOL_Q_GETPRINTERDATAEX;
2095
2096 typedef struct spool_r_getprinterdataex
2097 {
2098         uint32 type;
2099         uint32 size;
2100         uint8 *data;
2101         uint32 needed;
2102         WERROR status;
2103 }
2104 SPOOL_R_GETPRINTERDATAEX;
2105
2106 typedef struct spool_q_setprinterdataex
2107 {
2108         POLICY_HND handle;
2109         UNISTR2 key;
2110         UNISTR2 value;
2111         uint32 type;
2112         uint32 max_len;
2113         uint8 *data;
2114         uint32 real_len;
2115         uint32 numeric_data;
2116 }
2117 SPOOL_Q_SETPRINTERDATAEX;
2118
2119 typedef struct spool_r_setprinterdataex
2120 {
2121         WERROR status;
2122 }
2123 SPOOL_R_SETPRINTERDATAEX;
2124
2125
2126 typedef struct spool_q_deleteprinterdataex
2127 {
2128         POLICY_HND handle;
2129         UNISTR2 keyname;
2130         UNISTR2 valuename;
2131 }
2132 SPOOL_Q_DELETEPRINTERDATAEX;
2133
2134 typedef struct spool_r_deleteprinterdataex
2135 {
2136         WERROR status;
2137 }
2138 SPOOL_R_DELETEPRINTERDATAEX;
2139
2140
2141 typedef struct spool_q_enumprinterkey
2142 {
2143         POLICY_HND handle;
2144         UNISTR2 key;
2145         uint32 size;
2146 }
2147 SPOOL_Q_ENUMPRINTERKEY;
2148
2149 typedef struct spool_r_enumprinterkey
2150 {
2151         BUFFER5 keys;
2152         uint32 needed;  /* in bytes */
2153         WERROR status;
2154 }
2155 SPOOL_R_ENUMPRINTERKEY;
2156
2157 typedef struct spool_q_deleteprinterkey
2158 {
2159         POLICY_HND handle;
2160         UNISTR2 keyname;
2161 }
2162 SPOOL_Q_DELETEPRINTERKEY;
2163
2164 typedef struct spool_r_deleteprinterkey
2165 {
2166         WERROR status;
2167 }
2168 SPOOL_R_DELETEPRINTERKEY;
2169
2170 typedef struct printer_enum_values
2171 {
2172         UNISTR valuename;
2173         uint32 value_len;
2174         uint32 type;
2175         uint8  *data;
2176         uint32 data_len; 
2177         
2178 }
2179 PRINTER_ENUM_VALUES;
2180
2181 typedef struct printer_enum_values_ctr
2182 {
2183         uint32 size;
2184         uint32 size_of_array;
2185         PRINTER_ENUM_VALUES *values;
2186 }
2187 PRINTER_ENUM_VALUES_CTR;
2188
2189 typedef struct spool_q_enumprinterdataex
2190 {
2191         POLICY_HND handle;
2192         UNISTR2 key;
2193         uint32 size;
2194 }
2195 SPOOL_Q_ENUMPRINTERDATAEX;
2196
2197 typedef struct spool_r_enumprinterdataex
2198 {
2199         PRINTER_ENUM_VALUES_CTR ctr;
2200         uint32 needed;
2201         uint32 returned;
2202         WERROR status;
2203 }
2204 SPOOL_R_ENUMPRINTERDATAEX;
2205
2206 typedef struct printprocessor_directory_1
2207 {
2208         UNISTR name;
2209 }
2210 PRINTPROCESSOR_DIRECTORY_1;
2211
2212 typedef struct spool_q_getprintprocessordirectory
2213 {
2214         UNISTR2 name;
2215         UNISTR2 environment;
2216         uint32 level;
2217         NEW_BUFFER *buffer;
2218         uint32 offered;
2219 }
2220 SPOOL_Q_GETPRINTPROCESSORDIRECTORY;
2221
2222 typedef struct spool_r_getprintprocessordirectory
2223 {
2224         NEW_BUFFER *buffer;
2225         uint32 needed;
2226         WERROR status;
2227 }
2228 SPOOL_R_GETPRINTPROCESSORDIRECTORY;
2229
2230 #define PRINTER_DRIVER_VERSION 2
2231 #define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
2232
2233 #endif /* _RPC_SPOOLSS_H */
2234