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