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