fix for bad check spotted by Ray Simard <ray@sylvan-glade.com>
[Samba.git] / source3 / include / rpc_spoolss.h
blob249053403d17de0d74a1e0ff9fa93bbb14b27e51
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.
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.
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.
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.
25 #ifndef _RPC_SPOOLSS_H /* _RPC_SPOOLSS_H */
26 #define _RPC_SPOOLSS_H
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
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
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
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
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
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
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
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
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
151 #define PRINTER_STATUS_POWER_SAVE 0x01000000
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
159 /* JOB status codes. */
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
174 /* ACE masks for the various print permissions */
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)
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
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
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
199 /* Notify field types */
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 */
207 #define PRINTER_NOTIFY_TYPE 0x00
208 #define JOB_NOTIFY_TYPE 0x01
210 #define MAX_PRINTER_NOTIFY 26
211 #define MAX_JOB_NOTIFY 24
213 #define MAX_NOTIFY_TYPE_FOR_NOW 26
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
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
267 #define PRINTER_NOTIFY_OPTIONS_REFRESH 0x01
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 )
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 )
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 )
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 )
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 )
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 )
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 )
320 #define PRINTER_NOTIFY_INFO_DISCARDED 0x1
323 * Set of macros for flagging what changed in the PRINTER_INFO_2 struct
324 * when sending messages to other smbd's
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
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 */
348 PRINTER_MESSAGE_INFO;
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
358 #define PRINTER_ATTRIBUTE_QUEUED 0x00000001
359 #define PRINTER_ATTRIBUTE_DIRECT 0x00000002
360 #define PRINTER_ATTRIBUTE_DEFAULT 0x00000004
361 #define PRINTER_ATTRIBUTE_SHARED 0x00000008
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
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
373 #define PRINTER_ATTRIBUTE_RAW_ONLY 0x00001000
374 #define PRINTER_ATTRIBUTE_PUBLISHED 0x00002000
376 #define NO_PRIORITY 0
377 #define MAX_PRIORITY 99
378 #define MIN_PRIORITY 1
379 #define DEF_PRIORITY 1
381 /* the flags of the query */
382 #define PRINTER_ENUM_DEFAULT 0x00000001
383 #define PRINTER_ENUM_LOCAL 0x00000002
384 #define PRINTER_ENUM_CONNECTIONS 0x00000004
385 #define PRINTER_ENUM_FAVORITE 0x00000004
386 #define PRINTER_ENUM_NAME 0x00000008
387 #define PRINTER_ENUM_REMOTE 0x00000010
388 #define PRINTER_ENUM_SHARED 0x00000020
389 #define PRINTER_ENUM_NETWORK 0x00000040
391 /* the flags of each printers */
392 #define PRINTER_ENUM_UNKNOWN_8 0x00000008
393 #define PRINTER_ENUM_EXPAND 0x00004000
394 #define PRINTER_ENUM_CONTAINER 0x00008000
395 #define PRINTER_ENUM_ICONMASK 0x00ff0000
396 #define PRINTER_ENUM_ICON1 0x00010000
397 #define PRINTER_ENUM_ICON2 0x00020000
398 #define PRINTER_ENUM_ICON3 0x00040000
399 #define PRINTER_ENUM_ICON4 0x00080000
400 #define PRINTER_ENUM_ICON5 0x00100000
401 #define PRINTER_ENUM_ICON6 0x00200000
402 #define PRINTER_ENUM_ICON7 0x00400000
403 #define PRINTER_ENUM_ICON8 0x00800000
405 /* FLAGS for SPOOLSS_DELETEPRINTERDRIVEREX */
407 #define DPD_DELETE_UNUSED_FILES 0x00000001
408 #define DPD_DELETE_SPECIFIC_VERSION 0x00000002
409 #define DPD_DELETE_ALL_FILES 0x00000004
411 #define DRIVER_ANY_VERSION 0xffffffff
412 #define DRIVER_MAX_VERSION 4
414 /* FLAGS for SPOOLSS_ADDPRINTERDRIVEREX */
416 #define APD_STRICT_UPGRADE 0x00000001
417 #define APD_STRICT_DOWNGRADE 0x00000002
418 #define APD_COPY_ALL_FILES 0x00000004
419 #define APD_COPY_NEW_FILES 0x00000008
422 /* this struct is undocumented */
423 /* thanks to the ddk ... */
424 typedef struct spool_user_1
426 uint32 size; /* length of user_name & client_name + 2? */
427 uint32 client_name_ptr;
428 uint32 user_name_ptr;
429 uint32 build;
430 uint32 major;
431 uint32 minor;
432 uint32 processor;
433 UNISTR2 client_name;
434 UNISTR2 user_name;
436 SPOOL_USER_1;
438 typedef struct spool_user_ctr_info
440 uint32 level;
441 uint32 ptr;
442 SPOOL_USER_1 user1;
444 SPOOL_USER_CTR;
447 * various bits in the DEVICEMODE.fields member
450 #define DEVMODE_ORIENTATION 0x00000001
451 #define DEVMODE_PAPERSIZE 0x00000002
452 #define DEVMODE_PAPERLENGTH 0x00000004
453 #define DEVMODE_PAPERWIDTH 0x00000008
454 #define DEVMODE_SCALE 0x00000010
455 #define DEVMODE_POSITION 0x00000020
456 #define DEVMODE_NUP 0x00000040
457 #define DEVMODE_COPIES 0x00000100
458 #define DEVMODE_DEFAULTSOURCE 0x00000200
459 #define DEVMODE_PRINTQUALITY 0x00000400
460 #define DEVMODE_COLOR 0x00000800
461 #define DEVMODE_DUPLEX 0x00001000
462 #define DEVMODE_YRESOLUTION 0x00002000
463 #define DEVMODE_TTOPTION 0x00004000
464 #define DEVMODE_COLLATE 0x00008000
465 #define DEVMODE_FORMNAME 0x00010000
466 #define DEVMODE_LOGPIXELS 0x00020000
467 #define DEVMODE_BITSPERPEL 0x00040000
468 #define DEVMODE_PELSWIDTH 0x00080000
469 #define DEVMODE_PELSHEIGHT 0x00100000
470 #define DEVMODE_DISPLAYFLAGS 0x00200000
471 #define DEVMODE_DISPLAYFREQUENCY 0x00400000
472 #define DEVMODE_ICMMETHOD 0x00800000
473 #define DEVMODE_ICMINTENT 0x01000000
474 #define DEVMODE_MEDIATYPE 0x02000000
475 #define DEVMODE_DITHERTYPE 0x04000000
476 #define DEVMODE_PANNINGWIDTH 0x08000000
477 #define DEVMODE_PANNINGHEIGHT 0x10000000
481 * Devicemode structure
484 typedef struct devicemode
486 UNISTR devicename;
487 uint16 specversion;
488 uint16 driverversion;
489 uint16 size;
490 uint16 driverextra;
491 uint32 fields;
492 uint16 orientation;
493 uint16 papersize;
494 uint16 paperlength;
495 uint16 paperwidth;
496 uint16 scale;
497 uint16 copies;
498 uint16 defaultsource;
499 uint16 printquality;
500 uint16 color;
501 uint16 duplex;
502 uint16 yresolution;
503 uint16 ttoption;
504 uint16 collate;
505 UNISTR formname;
506 uint16 logpixels;
507 uint32 bitsperpel;
508 uint32 pelswidth;
509 uint32 pelsheight;
510 uint32 displayflags;
511 uint32 displayfrequency;
512 uint32 icmmethod;
513 uint32 icmintent;
514 uint32 mediatype;
515 uint32 dithertype;
516 uint32 reserved1;
517 uint32 reserved2;
518 uint32 panningwidth;
519 uint32 panningheight;
520 uint8 *private;
522 DEVICEMODE;
524 typedef struct _devmode_cont
526 uint32 size;
527 uint32 devmode_ptr;
528 DEVICEMODE *devmode;
530 DEVMODE_CTR;
532 typedef struct _printer_default
534 uint32 datatype_ptr;
535 UNISTR2 datatype;
536 DEVMODE_CTR devmode_cont;
537 uint32 access_required;
539 PRINTER_DEFAULT;
541 /* SPOOL_Q_OPEN_PRINTER request to open a printer */
542 typedef struct spool_q_open_printer
544 uint32 printername_ptr;
545 UNISTR2 printername;
546 PRINTER_DEFAULT printer_default;
548 SPOOL_Q_OPEN_PRINTER;
550 /* SPOOL_R_OPEN_PRINTER reply to an open printer */
551 typedef struct spool_r_open_printer
553 POLICY_HND handle; /* handle used along all transactions (20*uint8) */
554 WERROR status;
556 SPOOL_R_OPEN_PRINTER;
558 /* SPOOL_Q_OPEN_PRINTER_EX request to open a printer */
559 typedef struct spool_q_open_printer_ex
561 uint32 printername_ptr;
562 UNISTR2 printername;
563 PRINTER_DEFAULT printer_default;
564 uint32 user_switch;
565 SPOOL_USER_CTR user_ctr;
567 SPOOL_Q_OPEN_PRINTER_EX;
569 /* SPOOL_R_OPEN_PRINTER_EX reply to an open printer */
570 typedef struct spool_r_open_printer_ex
572 POLICY_HND handle; /* handle used along all transactions (20*uint8) */
573 WERROR status;
575 SPOOL_R_OPEN_PRINTER_EX;
577 typedef struct spool_notify_option_type
579 uint16 type;
580 uint16 reserved0;
581 uint32 reserved1;
582 uint32 reserved2;
583 uint32 count;
584 uint32 fields_ptr;
585 uint32 count2;
586 uint16 fields[MAX_NOTIFY_TYPE_FOR_NOW];
588 SPOOL_NOTIFY_OPTION_TYPE;
590 typedef struct spool_notify_option_type_ctr
592 uint32 count;
593 SPOOL_NOTIFY_OPTION_TYPE *type;
595 SPOOL_NOTIFY_OPTION_TYPE_CTR;
599 typedef struct s_header_type
601 uint32 type;
602 union
604 uint32 value;
605 UNISTR string;
607 data;
609 HEADER_TYPE;
611 typedef struct new_buffer
613 uint32 ptr;
614 uint32 size;
615 prs_struct prs;
616 uint32 struct_start;
617 uint32 string_at_end;
619 NEW_BUFFER;
621 typedef struct spool_q_getprinterdata
623 POLICY_HND handle;
624 UNISTR2 valuename;
625 uint32 size;
627 SPOOL_Q_GETPRINTERDATA;
629 typedef struct spool_r_getprinterdata
631 uint32 type;
632 uint32 size;
633 uint8 *data;
634 uint32 needed;
635 WERROR status;
637 SPOOL_R_GETPRINTERDATA;
639 typedef struct spool_q_deleteprinterdata
641 POLICY_HND handle;
642 UNISTR2 valuename;
644 SPOOL_Q_DELETEPRINTERDATA;
646 typedef struct spool_r_deleteprinterdata
648 WERROR status;
650 SPOOL_R_DELETEPRINTERDATA;
652 typedef struct spool_q_closeprinter
654 POLICY_HND handle;
656 SPOOL_Q_CLOSEPRINTER;
658 typedef struct spool_r_closeprinter
660 POLICY_HND handle;
661 WERROR status;
663 SPOOL_R_CLOSEPRINTER;
665 typedef struct spool_q_startpageprinter
667 POLICY_HND handle;
669 SPOOL_Q_STARTPAGEPRINTER;
671 typedef struct spool_r_startpageprinter
673 WERROR status;
675 SPOOL_R_STARTPAGEPRINTER;
677 typedef struct spool_q_endpageprinter
679 POLICY_HND handle;
681 SPOOL_Q_ENDPAGEPRINTER;
683 typedef struct spool_r_endpageprinter
685 WERROR status;
687 SPOOL_R_ENDPAGEPRINTER;
690 typedef struct spool_q_deleteprinterdriver
692 uint32 server_ptr;
693 UNISTR2 server;
694 UNISTR2 arch;
695 UNISTR2 driver;
697 SPOOL_Q_DELETEPRINTERDRIVER;
699 typedef struct spool_r_deleteprinterdriver
701 WERROR status;
703 SPOOL_R_DELETEPRINTERDRIVER;
705 typedef struct spool_q_deleteprinterdriverex
707 uint32 server_ptr;
708 UNISTR2 server;
709 UNISTR2 arch;
710 UNISTR2 driver;
711 uint32 delete_flags;
712 uint32 version;
714 SPOOL_Q_DELETEPRINTERDRIVEREX;
716 typedef struct spool_r_deleteprinterdriverex
718 WERROR status;
720 SPOOL_R_DELETEPRINTERDRIVEREX;
723 typedef struct spool_doc_info_1
725 uint32 p_docname;
726 uint32 p_outputfile;
727 uint32 p_datatype;
728 UNISTR2 docname;
729 UNISTR2 outputfile;
730 UNISTR2 datatype;
732 DOC_INFO_1;
734 typedef struct spool_doc_info
736 uint32 switch_value;
737 DOC_INFO_1 doc_info_1;
739 DOC_INFO;
741 typedef struct spool_doc_info_container
743 uint32 level;
744 DOC_INFO docinfo;
746 DOC_INFO_CONTAINER;
748 typedef struct spool_q_startdocprinter
750 POLICY_HND handle;
751 DOC_INFO_CONTAINER doc_info_container;
753 SPOOL_Q_STARTDOCPRINTER;
755 typedef struct spool_r_startdocprinter
757 uint32 jobid;
758 WERROR status;
760 SPOOL_R_STARTDOCPRINTER;
762 typedef struct spool_q_enddocprinter
764 POLICY_HND handle;
766 SPOOL_Q_ENDDOCPRINTER;
768 typedef struct spool_r_enddocprinter
770 WERROR status;
772 SPOOL_R_ENDDOCPRINTER;
774 typedef struct spool_q_writeprinter
776 POLICY_HND handle;
777 uint32 buffer_size;
778 uint8 *buffer;
779 uint32 buffer_size2;
781 SPOOL_Q_WRITEPRINTER;
783 typedef struct spool_r_writeprinter
785 uint32 buffer_written;
786 WERROR status;
788 SPOOL_R_WRITEPRINTER;
790 typedef struct spool_notify_option
792 uint32 version;
793 uint32 flags;
794 uint32 count;
795 uint32 option_type_ptr;
796 SPOOL_NOTIFY_OPTION_TYPE_CTR ctr;
798 SPOOL_NOTIFY_OPTION;
800 typedef struct spool_notify_info_data
802 uint16 type;
803 uint16 field;
804 uint32 reserved;
805 uint32 id;
806 union {
807 uint32 value[2];
808 struct {
809 uint32 length;
810 uint16 *string;
811 } data;
812 struct {
813 uint32 size;
814 SEC_DESC *desc;
815 } sd;
817 notify_data;
818 uint32 size;
819 BOOL enc_type;
820 } SPOOL_NOTIFY_INFO_DATA;
822 typedef struct spool_notify_info
824 uint32 version;
825 uint32 flags;
826 uint32 count;
827 SPOOL_NOTIFY_INFO_DATA *data;
829 SPOOL_NOTIFY_INFO;
831 /* If the struct name looks obscure, yes it is ! */
832 /* RemoteFindFirstPrinterChangeNotificationEx query struct */
833 typedef struct spoolss_q_rffpcnex
835 POLICY_HND handle;
836 uint32 flags;
837 uint32 options;
838 uint32 localmachine_ptr;
839 UNISTR2 localmachine;
840 uint32 printerlocal;
841 uint32 option_ptr;
842 SPOOL_NOTIFY_OPTION *option;
844 SPOOL_Q_RFFPCNEX;
846 typedef struct spool_r_rffpcnex
848 WERROR status;
850 SPOOL_R_RFFPCNEX;
852 /* Remote Find Next Printer Change Notify Ex */
853 typedef struct spool_q_rfnpcnex
855 POLICY_HND handle;
856 uint32 change;
857 uint32 option_ptr;
858 SPOOL_NOTIFY_OPTION *option;
860 SPOOL_Q_RFNPCNEX;
862 typedef struct spool_r_rfnpcnex
864 uint32 info_ptr;
865 SPOOL_NOTIFY_INFO info;
866 WERROR status;
868 SPOOL_R_RFNPCNEX;
870 /* Find Close Printer Notify */
871 typedef struct spool_q_fcpn
873 POLICY_HND handle;
875 SPOOL_Q_FCPN;
877 typedef struct spool_r_fcpn
879 WERROR status;
881 SPOOL_R_FCPN;
884 typedef struct printer_info_0
886 UNISTR printername;
887 UNISTR servername;
888 uint32 cjobs;
889 uint32 total_jobs;
890 uint32 total_bytes;
892 uint16 year;
893 uint16 month;
894 uint16 dayofweek;
895 uint16 day;
896 uint16 hour;
897 uint16 minute;
898 uint16 second;
899 uint16 milliseconds;
901 uint32 global_counter;
902 uint32 total_pages;
904 uint16 major_version;
905 uint16 build_version;
907 uint32 unknown7;
908 uint32 unknown8;
909 uint32 unknown9;
910 uint32 session_counter;
911 uint32 unknown11;
912 uint32 printer_errors;
913 uint32 unknown13;
914 uint32 unknown14;
915 uint32 unknown15;
916 uint32 unknown16;
917 uint32 change_id;
918 uint32 unknown18;
919 uint32 status;
920 uint32 unknown20;
921 uint32 c_setprinter;
923 uint16 unknown22;
924 uint16 unknown23;
925 uint16 unknown24;
926 uint16 unknown25;
927 uint16 unknown26;
928 uint16 unknown27;
929 uint16 unknown28;
930 uint16 unknown29;
931 } PRINTER_INFO_0;
933 typedef struct printer_info_1
935 uint32 flags;
936 UNISTR description;
937 UNISTR name;
938 UNISTR comment;
940 PRINTER_INFO_1;
942 typedef struct printer_info_2
944 UNISTR servername;
945 UNISTR printername;
946 UNISTR sharename;
947 UNISTR portname;
948 UNISTR drivername;
949 UNISTR comment;
950 UNISTR location;
951 DEVICEMODE *devmode;
952 UNISTR sepfile;
953 UNISTR printprocessor;
954 UNISTR datatype;
955 UNISTR parameters;
956 SEC_DESC *secdesc;
957 uint32 attributes;
958 uint32 priority;
959 uint32 defaultpriority;
960 uint32 starttime;
961 uint32 untiltime;
962 uint32 status;
963 uint32 cjobs;
964 uint32 averageppm;
966 PRINTER_INFO_2;
968 typedef struct printer_info_3
970 uint32 flags;
971 SEC_DESC *secdesc;
973 PRINTER_INFO_3;
975 typedef struct printer_info_4
977 UNISTR printername;
978 UNISTR servername;
979 uint32 attributes;
981 PRINTER_INFO_4;
983 typedef struct printer_info_5
985 UNISTR printername;
986 UNISTR portname;
987 uint32 attributes;
988 uint32 device_not_selected_timeout;
989 uint32 transmission_retry_timeout;
991 PRINTER_INFO_5;
993 #define SPOOL_DS_PUBLISH 1
994 #define SPOOL_DS_UPDATE 2
995 #define SPOOL_DS_UNPUBLISH 4
996 #define SPOOL_DS_PENDING 0x80000000
998 typedef struct printer_info_7
1000 UNISTR guid; /* text form of printer guid */
1001 uint32 action;
1003 PRINTER_INFO_7;
1005 typedef struct spool_q_enumprinters
1007 uint32 flags;
1008 uint32 servername_ptr;
1009 UNISTR2 servername;
1010 uint32 level;
1011 NEW_BUFFER *buffer;
1012 uint32 offered;
1014 SPOOL_Q_ENUMPRINTERS;
1016 typedef struct printer_info_ctr_info
1018 PRINTER_INFO_0 *printers_0;
1019 PRINTER_INFO_1 *printers_1;
1020 PRINTER_INFO_2 *printers_2;
1021 PRINTER_INFO_3 *printers_3;
1022 PRINTER_INFO_4 *printers_4;
1023 PRINTER_INFO_5 *printers_5;
1025 PRINTER_INFO_CTR;
1027 typedef struct spool_r_enumprinters
1029 NEW_BUFFER *buffer;
1030 uint32 needed; /* bytes needed */
1031 uint32 returned; /* number of printers */
1032 WERROR status;
1034 SPOOL_R_ENUMPRINTERS;
1037 typedef struct spool_q_getprinter
1039 POLICY_HND handle;
1040 uint32 level;
1041 NEW_BUFFER *buffer;
1042 uint32 offered;
1044 SPOOL_Q_GETPRINTER;
1046 typedef struct printer_info_info
1048 union
1050 PRINTER_INFO_0 *info0;
1051 PRINTER_INFO_1 *info1;
1052 PRINTER_INFO_2 *info2;
1053 void *info;
1054 } printer;
1055 } PRINTER_INFO;
1057 typedef struct spool_r_getprinter
1059 NEW_BUFFER *buffer;
1060 uint32 needed;
1061 WERROR status;
1062 } SPOOL_R_GETPRINTER;
1064 typedef struct driver_info_1
1066 UNISTR name;
1067 } DRIVER_INFO_1;
1069 typedef struct driver_info_2
1071 uint32 version;
1072 UNISTR name;
1073 UNISTR architecture;
1074 UNISTR driverpath;
1075 UNISTR datafile;
1076 UNISTR configfile;
1077 } DRIVER_INFO_2;
1079 typedef struct driver_info_3
1081 uint32 version;
1082 UNISTR name;
1083 UNISTR architecture;
1084 UNISTR driverpath;
1085 UNISTR datafile;
1086 UNISTR configfile;
1087 UNISTR helpfile;
1088 uint16 *dependentfiles;
1089 UNISTR monitorname;
1090 UNISTR defaultdatatype;
1092 DRIVER_INFO_3;
1094 typedef struct driver_info_6
1096 uint32 version;
1097 UNISTR name;
1098 UNISTR architecture;
1099 UNISTR driverpath;
1100 UNISTR datafile;
1101 UNISTR configfile;
1102 UNISTR helpfile;
1103 uint16 *dependentfiles;
1104 UNISTR monitorname;
1105 UNISTR defaultdatatype;
1106 uint16* previousdrivernames;
1107 NTTIME driver_date;
1108 uint32 padding;
1109 uint32 driver_version_low;
1110 uint32 driver_version_high;
1111 UNISTR mfgname;
1112 UNISTR oem_url;
1113 UNISTR hardware_id;
1114 UNISTR provider;
1116 DRIVER_INFO_6;
1118 typedef struct driver_info_info
1120 DRIVER_INFO_1 *info1;
1121 DRIVER_INFO_2 *info2;
1122 DRIVER_INFO_3 *info3;
1123 DRIVER_INFO_6 *info6;
1125 PRINTER_DRIVER_CTR;
1127 typedef struct spool_q_getprinterdriver2
1129 POLICY_HND handle;
1130 uint32 architecture_ptr;
1131 UNISTR2 architecture;
1132 uint32 level;
1133 NEW_BUFFER *buffer;
1134 uint32 offered;
1135 uint32 clientmajorversion;
1136 uint32 clientminorversion;
1138 SPOOL_Q_GETPRINTERDRIVER2;
1140 typedef struct spool_r_getprinterdriver2
1142 NEW_BUFFER *buffer;
1143 uint32 needed;
1144 uint32 servermajorversion;
1145 uint32 serverminorversion;
1146 WERROR status;
1148 SPOOL_R_GETPRINTERDRIVER2;
1151 typedef struct add_jobinfo_1
1153 UNISTR path;
1154 uint32 job_number;
1156 ADD_JOBINFO_1;
1159 typedef struct spool_q_addjob
1161 POLICY_HND handle;
1162 uint32 level;
1163 NEW_BUFFER *buffer;
1164 uint32 offered;
1166 SPOOL_Q_ADDJOB;
1168 typedef struct spool_r_addjob
1170 NEW_BUFFER *buffer;
1171 uint32 needed;
1172 WERROR status;
1174 SPOOL_R_ADDJOB;
1177 * I'm really wondering how many different time formats
1178 * I will have to cope with
1180 * JFM, 09/13/98 In a mad mood ;-(
1182 typedef struct systemtime
1184 uint16 year;
1185 uint16 month;
1186 uint16 dayofweek;
1187 uint16 day;
1188 uint16 hour;
1189 uint16 minute;
1190 uint16 second;
1191 uint16 milliseconds;
1193 SYSTEMTIME;
1195 typedef struct s_job_info_1
1197 uint32 jobid;
1198 UNISTR printername;
1199 UNISTR machinename;
1200 UNISTR username;
1201 UNISTR document;
1202 UNISTR datatype;
1203 UNISTR text_status;
1204 uint32 status;
1205 uint32 priority;
1206 uint32 position;
1207 uint32 totalpages;
1208 uint32 pagesprinted;
1209 SYSTEMTIME submitted;
1211 JOB_INFO_1;
1213 typedef struct s_job_info_2
1215 uint32 jobid;
1216 UNISTR printername;
1217 UNISTR machinename;
1218 UNISTR username;
1219 UNISTR document;
1220 UNISTR notifyname;
1221 UNISTR datatype;
1222 UNISTR printprocessor;
1223 UNISTR parameters;
1224 UNISTR drivername;
1225 DEVICEMODE *devmode;
1226 UNISTR text_status;
1227 /* SEC_DESC sec_desc;*/
1228 uint32 status;
1229 uint32 priority;
1230 uint32 position;
1231 uint32 starttime;
1232 uint32 untiltime;
1233 uint32 totalpages;
1234 uint32 size;
1235 SYSTEMTIME submitted;
1236 uint32 timeelapsed;
1237 uint32 pagesprinted;
1239 JOB_INFO_2;
1241 typedef struct spool_q_enumjobs
1243 POLICY_HND handle;
1244 uint32 firstjob;
1245 uint32 numofjobs;
1246 uint32 level;
1247 NEW_BUFFER *buffer;
1248 uint32 offered;
1250 SPOOL_Q_ENUMJOBS;
1252 typedef struct job_info_ctr_info
1254 union
1256 JOB_INFO_1 *job_info_1;
1257 JOB_INFO_2 *job_info_2;
1258 void *info;
1259 } job;
1261 } JOB_INFO_CTR;
1263 typedef struct spool_r_enumjobs
1265 NEW_BUFFER *buffer;
1266 uint32 needed;
1267 uint32 returned;
1268 WERROR status;
1270 SPOOL_R_ENUMJOBS;
1272 typedef struct spool_q_schedulejob
1274 POLICY_HND handle;
1275 uint32 jobid;
1277 SPOOL_Q_SCHEDULEJOB;
1279 typedef struct spool_r_schedulejob
1281 WERROR status;
1283 SPOOL_R_SCHEDULEJOB;
1285 typedef struct s_port_info_1
1287 UNISTR port_name;
1289 PORT_INFO_1;
1291 typedef struct s_port_info_2
1293 UNISTR port_name;
1294 UNISTR monitor_name;
1295 UNISTR description;
1296 uint32 port_type;
1297 uint32 reserved;
1299 PORT_INFO_2;
1301 typedef struct spool_q_enumports
1303 uint32 name_ptr;
1304 UNISTR2 name;
1305 uint32 level;
1306 NEW_BUFFER *buffer;
1307 uint32 offered;
1309 SPOOL_Q_ENUMPORTS;
1311 typedef struct port_info_ctr_info
1313 union
1315 PORT_INFO_1 *info_1;
1316 PORT_INFO_2 *info_2;
1318 port;
1321 PORT_INFO_CTR;
1323 typedef struct spool_r_enumports
1325 NEW_BUFFER *buffer;
1326 uint32 needed; /* bytes needed */
1327 uint32 returned; /* number of printers */
1328 WERROR status;
1330 SPOOL_R_ENUMPORTS;
1332 #define JOB_CONTROL_PAUSE 1
1333 #define JOB_CONTROL_RESUME 2
1334 #define JOB_CONTROL_CANCEL 3
1335 #define JOB_CONTROL_RESTART 4
1336 #define JOB_CONTROL_DELETE 5
1338 typedef struct job_info_info
1340 union
1342 JOB_INFO_1 job_info_1;
1343 JOB_INFO_2 job_info_2;
1345 job;
1348 JOB_INFO;
1350 typedef struct spool_q_setjob
1352 POLICY_HND handle;
1353 uint32 jobid;
1354 uint32 level;
1355 JOB_INFO ctr;
1356 uint32 command;
1359 SPOOL_Q_SETJOB;
1361 typedef struct spool_r_setjob
1363 WERROR status;
1366 SPOOL_R_SETJOB;
1368 typedef struct spool_q_enumprinterdrivers
1370 uint32 name_ptr;
1371 UNISTR2 name;
1372 uint32 environment_ptr;
1373 UNISTR2 environment;
1374 uint32 level;
1375 NEW_BUFFER *buffer;
1376 uint32 offered;
1378 SPOOL_Q_ENUMPRINTERDRIVERS;
1380 typedef struct spool_r_enumprinterdrivers
1382 NEW_BUFFER *buffer;
1383 uint32 needed;
1384 uint32 returned;
1385 WERROR status;
1387 SPOOL_R_ENUMPRINTERDRIVERS;
1389 #define FORM_USER 0
1390 #define FORM_BUILTIN 1
1391 #define FORM_PRINTER 2
1393 typedef struct spool_form_1
1395 uint32 flag;
1396 UNISTR name;
1397 uint32 width;
1398 uint32 length;
1399 uint32 left;
1400 uint32 top;
1401 uint32 right;
1402 uint32 bottom;
1404 FORM_1;
1406 typedef struct spool_q_enumforms
1408 POLICY_HND handle;
1409 uint32 level;
1410 NEW_BUFFER *buffer;
1411 uint32 offered;
1413 SPOOL_Q_ENUMFORMS;
1415 typedef struct spool_r_enumforms
1417 NEW_BUFFER *buffer;
1418 uint32 needed;
1419 uint32 numofforms;
1420 WERROR status;
1422 SPOOL_R_ENUMFORMS;
1424 typedef struct spool_q_getform
1426 POLICY_HND handle;
1427 UNISTR2 formname;
1428 uint32 level;
1429 NEW_BUFFER *buffer;
1430 uint32 offered;
1432 SPOOL_Q_GETFORM;
1434 typedef struct spool_r_getform
1436 NEW_BUFFER *buffer;
1437 uint32 needed;
1438 WERROR status;
1440 SPOOL_R_GETFORM;
1442 typedef struct spool_printer_info_level_1
1444 uint32 flags;
1445 uint32 description_ptr;
1446 uint32 name_ptr;
1447 uint32 comment_ptr;
1448 UNISTR2 description;
1449 UNISTR2 name;
1450 UNISTR2 comment;
1451 } SPOOL_PRINTER_INFO_LEVEL_1;
1453 typedef struct spool_printer_info_level_2
1455 uint32 servername_ptr;
1456 uint32 printername_ptr;
1457 uint32 sharename_ptr;
1458 uint32 portname_ptr;
1459 uint32 drivername_ptr;
1460 uint32 comment_ptr;
1461 uint32 location_ptr;
1462 uint32 devmode_ptr;
1463 uint32 sepfile_ptr;
1464 uint32 printprocessor_ptr;
1465 uint32 datatype_ptr;
1466 uint32 parameters_ptr;
1467 uint32 secdesc_ptr;
1468 uint32 attributes;
1469 uint32 priority;
1470 uint32 default_priority;
1471 uint32 starttime;
1472 uint32 untiltime;
1473 uint32 status;
1474 uint32 cjobs;
1475 uint32 averageppm;
1476 UNISTR2 servername;
1477 UNISTR2 printername;
1478 UNISTR2 sharename;
1479 UNISTR2 portname;
1480 UNISTR2 drivername;
1481 UNISTR2 comment;
1482 UNISTR2 location;
1483 UNISTR2 sepfile;
1484 UNISTR2 printprocessor;
1485 UNISTR2 datatype;
1486 UNISTR2 parameters;
1488 SPOOL_PRINTER_INFO_LEVEL_2;
1490 typedef struct spool_printer_info_level_3
1492 uint32 secdesc_ptr;
1494 SPOOL_PRINTER_INFO_LEVEL_3;
1496 typedef struct spool_printer_info_level_7
1498 uint32 guid_ptr;
1499 uint32 action;
1500 UNISTR2 guid;
1502 SPOOL_PRINTER_INFO_LEVEL_7;
1504 typedef struct spool_printer_info_level
1506 uint32 level;
1507 uint32 info_ptr;
1508 SPOOL_PRINTER_INFO_LEVEL_1 *info_1;
1509 SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
1510 SPOOL_PRINTER_INFO_LEVEL_3 *info_3;
1511 SPOOL_PRINTER_INFO_LEVEL_7 *info_7;
1513 SPOOL_PRINTER_INFO_LEVEL;
1515 typedef struct spool_printer_driver_info_level_3
1517 uint32 cversion;
1518 uint32 name_ptr;
1519 uint32 environment_ptr;
1520 uint32 driverpath_ptr;
1521 uint32 datafile_ptr;
1522 uint32 configfile_ptr;
1523 uint32 helpfile_ptr;
1524 uint32 monitorname_ptr;
1525 uint32 defaultdatatype_ptr;
1526 uint32 dependentfilessize;
1527 uint32 dependentfiles_ptr;
1529 UNISTR2 name;
1530 UNISTR2 environment;
1531 UNISTR2 driverpath;
1532 UNISTR2 datafile;
1533 UNISTR2 configfile;
1534 UNISTR2 helpfile;
1535 UNISTR2 monitorname;
1536 UNISTR2 defaultdatatype;
1537 BUFFER5 dependentfiles;
1540 SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;
1542 /* SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 structure */
1543 typedef struct {
1544 uint32 version;
1545 uint32 name_ptr;
1546 uint32 environment_ptr;
1547 uint32 driverpath_ptr;
1548 uint32 datafile_ptr;
1549 uint32 configfile_ptr;
1550 uint32 helpfile_ptr;
1551 uint32 monitorname_ptr;
1552 uint32 defaultdatatype_ptr;
1553 uint32 dependentfiles_len;
1554 uint32 dependentfiles_ptr;
1555 uint32 previousnames_len;
1556 uint32 previousnames_ptr;
1557 NTTIME driverdate;
1558 UINT64_S driverversion;
1559 uint32 dummy4;
1560 uint32 mfgname_ptr;
1561 uint32 oemurl_ptr;
1562 uint32 hardwareid_ptr;
1563 uint32 provider_ptr;
1564 UNISTR2 name;
1565 UNISTR2 environment;
1566 UNISTR2 driverpath;
1567 UNISTR2 datafile;
1568 UNISTR2 configfile;
1569 UNISTR2 helpfile;
1570 UNISTR2 monitorname;
1571 UNISTR2 defaultdatatype;
1572 BUFFER5 dependentfiles;
1573 BUFFER5 previousnames;
1574 UNISTR2 mfgname;
1575 UNISTR2 oemurl;
1576 UNISTR2 hardwareid;
1577 UNISTR2 provider;
1578 } SPOOL_PRINTER_DRIVER_INFO_LEVEL_6;
1581 typedef struct spool_printer_driver_info_level
1583 uint32 level;
1584 uint32 ptr;
1585 SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
1586 SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *info_6;
1588 SPOOL_PRINTER_DRIVER_INFO_LEVEL;
1591 /* this struct is undocumented */
1592 /* thanks to the ddk ... */
1593 typedef struct spool_user_level_1
1595 uint32 size;
1596 uint32 client_name_ptr;
1597 uint32 user_name_ptr;
1598 uint32 build;
1599 uint32 major;
1600 uint32 minor;
1601 uint32 processor;
1602 UNISTR2 client_name;
1603 UNISTR2 user_name;
1605 SPOOL_USER_LEVEL_1;
1607 typedef struct spool_user_level
1609 SPOOL_USER_LEVEL_1 *user_level_1;
1611 SPOOL_USER_LEVEL;
1613 typedef struct spool_q_setprinter
1615 POLICY_HND handle;
1616 uint32 level;
1617 SPOOL_PRINTER_INFO_LEVEL info;
1618 SEC_DESC_BUF *secdesc_ctr;
1619 DEVMODE_CTR devmode_ctr;
1621 uint32 command;
1624 SPOOL_Q_SETPRINTER;
1626 typedef struct spool_r_setprinter
1628 WERROR status;
1630 SPOOL_R_SETPRINTER;
1632 typedef struct spool_q_addprinter
1634 UNISTR2 server_name;
1635 uint32 level;
1636 SPOOL_PRINTER_INFO_LEVEL info;
1637 DEVMODE_CTR devmode_ctr;
1638 SEC_DESC_BUF *secdesc_ctr;
1639 uint32 user_level;
1640 SPOOL_USER_LEVEL user;
1642 SPOOL_Q_ADDPRINTER;
1644 typedef struct spool_r_addprinter
1646 WERROR status;
1648 SPOOL_R_ADDPRINTER;
1650 typedef struct spool_q_deleteprinter
1652 POLICY_HND handle;
1654 SPOOL_Q_DELETEPRINTER;
1656 typedef struct spool_r_deleteprinter
1658 POLICY_HND handle;
1659 WERROR status;
1661 SPOOL_R_DELETEPRINTER;
1663 typedef struct spool_q_abortprinter
1665 POLICY_HND handle;
1667 SPOOL_Q_ABORTPRINTER;
1669 typedef struct spool_r_abortprinter
1671 WERROR status;
1673 SPOOL_R_ABORTPRINTER;
1676 typedef struct spool_q_addprinterex
1678 uint32 server_name_ptr;
1679 UNISTR2 server_name;
1680 uint32 level;
1681 SPOOL_PRINTER_INFO_LEVEL info;
1682 DEVMODE_CTR devmode_ctr;
1683 SEC_DESC_BUF *secdesc_ctr;
1684 uint32 user_switch;
1685 SPOOL_USER_CTR user_ctr;
1687 SPOOL_Q_ADDPRINTEREX;
1689 typedef struct spool_r_addprinterex
1691 POLICY_HND handle;
1692 WERROR status;
1694 SPOOL_R_ADDPRINTEREX;
1697 typedef struct spool_q_addprinterdriver
1699 uint32 server_name_ptr;
1700 UNISTR2 server_name;
1701 uint32 level;
1702 SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1704 SPOOL_Q_ADDPRINTERDRIVER;
1706 typedef struct spool_r_addprinterdriver
1708 WERROR status;
1710 SPOOL_R_ADDPRINTERDRIVER;
1712 typedef struct spool_q_addprinterdriverex
1714 uint32 server_name_ptr;
1715 UNISTR2 server_name;
1716 uint32 level;
1717 SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1718 uint32 copy_flags;
1720 SPOOL_Q_ADDPRINTERDRIVEREX;
1722 typedef struct spool_r_addprinterdriverex
1724 WERROR status;
1726 SPOOL_R_ADDPRINTERDRIVEREX;
1729 typedef struct driver_directory_1
1731 UNISTR name;
1733 DRIVER_DIRECTORY_1;
1735 typedef struct driver_info_ctr_info
1737 DRIVER_DIRECTORY_1 *info1;
1739 DRIVER_DIRECTORY_CTR;
1741 typedef struct spool_q_getprinterdriverdirectory
1743 uint32 name_ptr;
1744 UNISTR2 name;
1745 uint32 environment_ptr;
1746 UNISTR2 environment;
1747 uint32 level;
1748 NEW_BUFFER *buffer;
1749 uint32 offered;
1751 SPOOL_Q_GETPRINTERDRIVERDIR;
1753 typedef struct spool_r_getprinterdriverdirectory
1755 NEW_BUFFER *buffer;
1756 uint32 needed;
1757 WERROR status;
1759 SPOOL_R_GETPRINTERDRIVERDIR;
1761 typedef struct spool_q_addprintprocessor
1763 uint32 server_ptr;
1764 UNISTR2 server;
1765 UNISTR2 environment;
1766 UNISTR2 path;
1767 UNISTR2 name;
1769 SPOOL_Q_ADDPRINTPROCESSOR;
1771 typedef struct spool_r_addprintprocessor
1773 WERROR status;
1775 SPOOL_R_ADDPRINTPROCESSOR;
1778 typedef struct spool_q_enumprintprocessors
1780 uint32 name_ptr;
1781 UNISTR2 name;
1782 uint32 environment_ptr;
1783 UNISTR2 environment;
1784 uint32 level;
1785 NEW_BUFFER *buffer;
1786 uint32 offered;
1788 SPOOL_Q_ENUMPRINTPROCESSORS;
1790 typedef struct printprocessor_1
1792 UNISTR name;
1794 PRINTPROCESSOR_1;
1796 typedef struct spool_r_enumprintprocessors
1798 NEW_BUFFER *buffer;
1799 uint32 needed;
1800 uint32 returned;
1801 WERROR status;
1803 SPOOL_R_ENUMPRINTPROCESSORS;
1805 typedef struct spool_q_enumprintprocdatatypes
1807 uint32 name_ptr;
1808 UNISTR2 name;
1809 uint32 processor_ptr;
1810 UNISTR2 processor;
1811 uint32 level;
1812 NEW_BUFFER *buffer;
1813 uint32 offered;
1815 SPOOL_Q_ENUMPRINTPROCDATATYPES;
1817 typedef struct ppdatatype_1
1819 UNISTR name;
1821 PRINTPROCDATATYPE_1;
1823 typedef struct spool_r_enumprintprocdatatypes
1825 NEW_BUFFER *buffer;
1826 uint32 needed;
1827 uint32 returned;
1828 WERROR status;
1830 SPOOL_R_ENUMPRINTPROCDATATYPES;
1832 typedef struct printmonitor_1
1834 UNISTR name;
1836 PRINTMONITOR_1;
1838 typedef struct printmonitor_2
1840 UNISTR name;
1841 UNISTR environment;
1842 UNISTR dll_name;
1844 PRINTMONITOR_2;
1846 typedef struct spool_q_enumprintmonitors
1848 uint32 name_ptr;
1849 UNISTR2 name;
1850 uint32 level;
1851 NEW_BUFFER *buffer;
1852 uint32 offered;
1854 SPOOL_Q_ENUMPRINTMONITORS;
1856 typedef struct spool_r_enumprintmonitors
1858 NEW_BUFFER *buffer;
1859 uint32 needed;
1860 uint32 returned;
1861 WERROR status;
1863 SPOOL_R_ENUMPRINTMONITORS;
1866 typedef struct spool_q_enumprinterdata
1868 POLICY_HND handle;
1869 uint32 index;
1870 uint32 valuesize;
1871 uint32 datasize;
1873 SPOOL_Q_ENUMPRINTERDATA;
1875 typedef struct spool_r_enumprinterdata
1877 uint32 valuesize;
1878 uint16 *value;
1879 uint32 realvaluesize;
1880 uint32 type;
1881 uint32 datasize;
1882 uint8 *data;
1883 uint32 realdatasize;
1884 WERROR status;
1886 SPOOL_R_ENUMPRINTERDATA;
1888 typedef struct spool_q_setprinterdata
1890 POLICY_HND handle;
1891 UNISTR2 value;
1892 uint32 type;
1893 uint32 max_len;
1894 uint8 *data;
1895 uint32 real_len;
1896 uint32 numeric_data;
1898 SPOOL_Q_SETPRINTERDATA;
1900 typedef struct spool_r_setprinterdata
1902 WERROR status;
1904 SPOOL_R_SETPRINTERDATA;
1906 typedef struct spool_q_resetprinter
1908 POLICY_HND handle;
1909 uint32 datatype_ptr;
1910 UNISTR2 datatype;
1911 DEVMODE_CTR devmode_ctr;
1913 } SPOOL_Q_RESETPRINTER;
1915 typedef struct spool_r_resetprinter
1917 WERROR status;
1919 SPOOL_R_RESETPRINTER;
1923 typedef struct _form
1925 uint32 flags;
1926 uint32 name_ptr;
1927 uint32 size_x;
1928 uint32 size_y;
1929 uint32 left;
1930 uint32 top;
1931 uint32 right;
1932 uint32 bottom;
1933 UNISTR2 name;
1935 FORM;
1937 typedef struct spool_q_addform
1939 POLICY_HND handle;
1940 uint32 level;
1941 uint32 level2; /* This should really be part of the FORM structure */
1942 FORM form;
1944 SPOOL_Q_ADDFORM;
1946 typedef struct spool_r_addform
1948 WERROR status;
1950 SPOOL_R_ADDFORM;
1952 typedef struct spool_q_setform
1954 POLICY_HND handle;
1955 UNISTR2 name;
1956 uint32 level;
1957 uint32 level2;
1958 FORM form;
1960 SPOOL_Q_SETFORM;
1962 typedef struct spool_r_setform
1964 WERROR status;
1966 SPOOL_R_SETFORM;
1968 typedef struct spool_q_deleteform
1970 POLICY_HND handle;
1971 UNISTR2 name;
1973 SPOOL_Q_DELETEFORM;
1975 typedef struct spool_r_deleteform
1977 WERROR status;
1979 SPOOL_R_DELETEFORM;
1981 typedef struct spool_q_getjob
1983 POLICY_HND handle;
1984 uint32 jobid;
1985 uint32 level;
1986 NEW_BUFFER *buffer;
1987 uint32 offered;
1989 SPOOL_Q_GETJOB;
1991 typedef struct pjob_info_info
1993 union
1995 JOB_INFO_1 *job_info_1;
1996 JOB_INFO_2 *job_info_2;
1997 void *info;
1999 job;
2002 PJOB_INFO;
2004 typedef struct spool_r_getjob
2006 NEW_BUFFER *buffer;
2007 uint32 needed;
2008 WERROR status;
2010 SPOOL_R_GETJOB;
2012 typedef struct spool_q_replyopenprinter
2014 UNISTR2 string;
2015 uint32 printer;
2016 uint32 type;
2017 uint32 unknown0;
2018 uint32 unknown1;
2020 SPOOL_Q_REPLYOPENPRINTER;
2022 typedef struct spool_r_replyopenprinter
2024 POLICY_HND handle;
2025 WERROR status;
2027 SPOOL_R_REPLYOPENPRINTER;
2029 typedef struct spool_q_routerreplyprinter
2031 POLICY_HND handle;
2032 uint32 condition;
2033 uint32 unknown1; /* 0x00000001 */
2034 uint32 change_id;
2035 uint8 unknown2[5]; /* 0x0000000001 */
2037 SPOOL_Q_ROUTERREPLYPRINTER;
2039 typedef struct spool_r_routerreplyprinter
2041 WERROR status;
2043 SPOOL_R_ROUTERREPLYPRINTER;
2045 typedef struct spool_q_replycloseprinter
2047 POLICY_HND handle;
2049 SPOOL_Q_REPLYCLOSEPRINTER;
2051 typedef struct spool_r_replycloseprinter
2053 POLICY_HND handle;
2054 WERROR status;
2056 SPOOL_R_REPLYCLOSEPRINTER;
2058 typedef struct spool_q_rrpcn
2060 POLICY_HND handle;
2061 uint32 change_low;
2062 uint32 change_high;
2063 uint32 unknown0;
2064 uint32 unknown1;
2065 uint32 info_ptr;
2066 SPOOL_NOTIFY_INFO info;
2068 SPOOL_Q_REPLY_RRPCN;
2070 typedef struct spool_r_rrpcn
2072 uint32 unknown0;
2073 WERROR status;
2075 SPOOL_R_REPLY_RRPCN;
2077 typedef struct spool_q_getprinterdataex
2079 POLICY_HND handle;
2080 UNISTR2 keyname;
2081 UNISTR2 valuename;
2082 uint32 size;
2084 SPOOL_Q_GETPRINTERDATAEX;
2086 typedef struct spool_r_getprinterdataex
2088 uint32 type;
2089 uint32 size;
2090 uint8 *data;
2091 uint32 needed;
2092 WERROR status;
2094 SPOOL_R_GETPRINTERDATAEX;
2096 typedef struct spool_q_setprinterdataex
2098 POLICY_HND handle;
2099 UNISTR2 key;
2100 UNISTR2 value;
2101 uint32 type;
2102 uint32 max_len;
2103 uint8 *data;
2104 uint32 real_len;
2105 uint32 numeric_data;
2107 SPOOL_Q_SETPRINTERDATAEX;
2109 typedef struct spool_r_setprinterdataex
2111 WERROR status;
2113 SPOOL_R_SETPRINTERDATAEX;
2116 typedef struct spool_q_deleteprinterdataex
2118 POLICY_HND handle;
2119 UNISTR2 keyname;
2120 UNISTR2 valuename;
2122 SPOOL_Q_DELETEPRINTERDATAEX;
2124 typedef struct spool_r_deleteprinterdataex
2126 WERROR status;
2128 SPOOL_R_DELETEPRINTERDATAEX;
2131 typedef struct spool_q_enumprinterkey
2133 POLICY_HND handle;
2134 UNISTR2 key;
2135 uint32 size;
2137 SPOOL_Q_ENUMPRINTERKEY;
2139 typedef struct spool_r_enumprinterkey
2141 BUFFER5 keys;
2142 uint32 needed; /* in bytes */
2143 WERROR status;
2145 SPOOL_R_ENUMPRINTERKEY;
2147 typedef struct spool_q_deleteprinterkey
2149 POLICY_HND handle;
2150 UNISTR2 keyname;
2152 SPOOL_Q_DELETEPRINTERKEY;
2154 typedef struct spool_r_deleteprinterkey
2156 WERROR status;
2158 SPOOL_R_DELETEPRINTERKEY;
2160 typedef struct printer_enum_values
2162 UNISTR valuename;
2163 uint32 value_len;
2164 uint32 type;
2165 uint8 *data;
2166 uint32 data_len;
2169 PRINTER_ENUM_VALUES;
2171 typedef struct printer_enum_values_ctr
2173 uint32 size;
2174 uint32 size_of_array;
2175 PRINTER_ENUM_VALUES *values;
2177 PRINTER_ENUM_VALUES_CTR;
2179 typedef struct spool_q_enumprinterdataex
2181 POLICY_HND handle;
2182 UNISTR2 key;
2183 uint32 size;
2185 SPOOL_Q_ENUMPRINTERDATAEX;
2187 typedef struct spool_r_enumprinterdataex
2189 PRINTER_ENUM_VALUES_CTR ctr;
2190 uint32 needed;
2191 uint32 returned;
2192 WERROR status;
2194 SPOOL_R_ENUMPRINTERDATAEX;
2196 typedef struct printprocessor_directory_1
2198 UNISTR name;
2200 PRINTPROCESSOR_DIRECTORY_1;
2202 typedef struct spool_q_getprintprocessordirectory
2204 UNISTR2 name;
2205 UNISTR2 environment;
2206 uint32 level;
2207 NEW_BUFFER *buffer;
2208 uint32 offered;
2210 SPOOL_Q_GETPRINTPROCESSORDIRECTORY;
2212 typedef struct spool_r_getprintprocessordirectory
2214 NEW_BUFFER *buffer;
2215 uint32 needed;
2216 WERROR status;
2218 SPOOL_R_GETPRINTPROCESSORDIRECTORY;
2220 #define PRINTER_DRIVER_VERSION 2
2221 #define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
2223 #endif /* _RPC_SPOOLSS_H */