r24744: Increase length by what we got from recv, not from ioctl
[Samba.git] / source / include / rpc_spoolss.h
blobaff0bba444514b079338e6a9766253161acff026
1 /*
2 Unix SMB/Netbios implementation.
4 Copyright (C) Andrew Tridgell 1992-2000,
5 Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
6 Copyright (C) Jean Francois Micouleau 1998-2000.
7 Copyright (C) Gerald Carter 2001-2006.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef _RPC_SPOOLSS_H /* _RPC_SPOOLSS_H */
24 #define _RPC_SPOOLSS_H
26 /* spoolss pipe: this are the calls which are not implemented ...
27 #define SPOOLSS_GETPRINTERDRIVER 0x0b
28 #define SPOOLSS_READPRINTER 0x16
29 #define SPOOLSS_WAITFORPRINTERCHANGE 0x1c
30 #define SPOOLSS_ADDPORT 0x25
31 #define SPOOLSS_CONFIGUREPORT 0x26
32 #define SPOOLSS_DELETEPORT 0x27
33 #define SPOOLSS_CREATEPRINTERIC 0x28
34 #define SPOOLSS_PLAYGDISCRIPTONPRINTERIC 0x29
35 #define SPOOLSS_DELETEPRINTERIC 0x2a
36 #define SPOOLSS_ADDPRINTERCONNECTION 0x2b
37 #define SPOOLSS_DELETEPRINTERCONNECTION 0x2c
38 #define SPOOLSS_PRINTERMESSAGEBOX 0x2d
39 #define SPOOLSS_ADDMONITOR 0x2e
40 #define SPOOLSS_DELETEMONITOR 0x2f
41 #define SPOOLSS_DELETEPRINTPROCESSOR 0x30
42 #define SPOOLSS_ADDPRINTPROVIDOR 0x31
43 #define SPOOLSS_DELETEPRINTPROVIDOR 0x32
44 #define SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION 0x36
45 #define SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION 0x37
46 #define SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD 0x39
47 #define SPOOLSS_ADDPORTEX 0x3d
48 #define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION0x3e
49 #define SPOOLSS_SPOOLERINIT 0x3f
50 #define SPOOLSS_RESETPRINTEREX 0x40
53 /* those are implemented */
54 #define SPOOLSS_ENUMPRINTERS 0x00
55 #define SPOOLSS_OPENPRINTER 0x01
56 #define SPOOLSS_SETJOB 0x02
57 #define SPOOLSS_GETJOB 0x03
58 #define SPOOLSS_ENUMJOBS 0x04
59 #define SPOOLSS_ADDPRINTER 0x05
60 #define SPOOLSS_DELETEPRINTER 0x06
61 #define SPOOLSS_SETPRINTER 0x07
62 #define SPOOLSS_GETPRINTER 0x08
63 #define SPOOLSS_ADDPRINTERDRIVER 0x09
64 #define SPOOLSS_ENUMPRINTERDRIVERS 0x0a
65 #define SPOOLSS_GETPRINTERDRIVERDIRECTORY 0x0c
66 #define SPOOLSS_DELETEPRINTERDRIVER 0x0d
67 #define SPOOLSS_ADDPRINTPROCESSOR 0x0e
68 #define SPOOLSS_ENUMPRINTPROCESSORS 0x0f
69 #define SPOOLSS_GETPRINTPROCESSORDIRECTORY 0x10
70 #define SPOOLSS_STARTDOCPRINTER 0x11
71 #define SPOOLSS_STARTPAGEPRINTER 0x12
72 #define SPOOLSS_WRITEPRINTER 0x13
73 #define SPOOLSS_ENDPAGEPRINTER 0x14
74 #define SPOOLSS_ABORTPRINTER 0x15
75 #define SPOOLSS_ENDDOCPRINTER 0x17
76 #define SPOOLSS_ADDJOB 0x18
77 #define SPOOLSS_SCHEDULEJOB 0x19
78 #define SPOOLSS_GETPRINTERDATA 0x1a
79 #define SPOOLSS_SETPRINTERDATA 0x1b
80 #define SPOOLSS_CLOSEPRINTER 0x1d
81 #define SPOOLSS_ADDFORM 0x1e
82 #define SPOOLSS_DELETEFORM 0x1f
83 #define SPOOLSS_GETFORM 0x20
84 #define SPOOLSS_SETFORM 0x21
85 #define SPOOLSS_ENUMFORMS 0x22
86 #define SPOOLSS_ENUMPORTS 0x23
87 #define SPOOLSS_ENUMMONITORS 0x24
88 #define SPOOLSS_ENUMPRINTPROCDATATYPES 0x33
89 #define SPOOLSS_RESETPRINTER 0x34
90 #define SPOOLSS_GETPRINTERDRIVER2 0x35
91 #define SPOOLSS_FCPN 0x38 /* FindClosePrinterNotify */
92 #define SPOOLSS_REPLYOPENPRINTER 0x3a
93 #define SPOOLSS_ROUTERREPLYPRINTER 0x3b
94 #define SPOOLSS_REPLYCLOSEPRINTER 0x3c
95 #define SPOOLSS_RFFPCNEX 0x41 /* RemoteFindFirstPrinterChangeNotifyEx */
96 #define SPOOLSS_RRPCN 0x42 /* RouteRefreshPrinterChangeNotification */
97 #define SPOOLSS_RFNPCNEX 0x43 /* RemoteFindNextPrinterChangeNotifyEx */
98 #define SPOOLSS_OPENPRINTEREX 0x45
99 #define SPOOLSS_ADDPRINTEREX 0x46
100 #define SPOOLSS_ENUMPRINTERDATA 0x48
101 #define SPOOLSS_DELETEPRINTERDATA 0x49
102 #define SPOOLSS_SETPRINTERDATAEX 0x4d
103 #define SPOOLSS_GETPRINTERDATAEX 0x4e
104 #define SPOOLSS_ENUMPRINTERDATAEX 0x4f
105 #define SPOOLSS_ENUMPRINTERKEY 0x50
106 #define SPOOLSS_DELETEPRINTERDATAEX 0x51
107 #define SPOOLSS_DELETEPRINTERKEY 0x52
108 #define SPOOLSS_DELETEPRINTERDRIVEREX 0x54
109 #define SPOOLSS_XCVDATAPORT 0x58
110 #define SPOOLSS_ADDPRINTERDRIVEREX 0x59
113 * Special strings for the OpenPrinter() call. See the MSDN DDK
114 * docs on the XcvDataPort() for more details.
117 #define SPL_LOCAL_PORT "Local Port"
118 #define SPL_TCPIP_PORT "Standard TCP/IP Port"
119 #define SPL_XCV_MONITOR_LOCALMON ",XcvMonitor Local Port"
120 #define SPL_XCV_MONITOR_TCPMON ",XcvMonitor Standard TCP/IP Port"
123 #define PRINTER_CONTROL_UNPAUSE 0x00000000
124 #define PRINTER_CONTROL_PAUSE 0x00000001
125 #define PRINTER_CONTROL_RESUME 0x00000002
126 #define PRINTER_CONTROL_PURGE 0x00000003
127 #define PRINTER_CONTROL_SET_STATUS 0x00000004
129 #define PRINTER_STATUS_OK 0x00000000
130 #define PRINTER_STATUS_PAUSED 0x00000001
131 #define PRINTER_STATUS_ERROR 0x00000002
132 #define PRINTER_STATUS_PENDING_DELETION 0x00000004
133 #define PRINTER_STATUS_PAPER_JAM 0x00000008
135 #define PRINTER_STATUS_PAPER_OUT 0x00000010
136 #define PRINTER_STATUS_MANUAL_FEED 0x00000020
137 #define PRINTER_STATUS_PAPER_PROBLEM 0x00000040
138 #define PRINTER_STATUS_OFFLINE 0x00000080
140 #define PRINTER_STATUS_IO_ACTIVE 0x00000100
141 #define PRINTER_STATUS_BUSY 0x00000200
142 #define PRINTER_STATUS_PRINTING 0x00000400
143 #define PRINTER_STATUS_OUTPUT_BIN_FULL 0x00000800
145 #define PRINTER_STATUS_NOT_AVAILABLE 0x00001000
146 #define PRINTER_STATUS_WAITING 0x00002000
147 #define PRINTER_STATUS_PROCESSING 0x00004000
148 #define PRINTER_STATUS_INITIALIZING 0x00008000
150 #define PRINTER_STATUS_WARMING_UP 0x00010000
151 #define PRINTER_STATUS_TONER_LOW 0x00020000
152 #define PRINTER_STATUS_NO_TONER 0x00040000
153 #define PRINTER_STATUS_PAGE_PUNT 0x00080000
155 #define PRINTER_STATUS_USER_INTERVENTION 0x00100000
156 #define PRINTER_STATUS_OUT_OF_MEMORY 0x00200000
157 #define PRINTER_STATUS_DOOR_OPEN 0x00400000
158 #define PRINTER_STATUS_SERVER_UNKNOWN 0x00800000
160 #define PRINTER_STATUS_POWER_SAVE 0x01000000
162 #define SERVER_ACCESS_ADMINISTER 0x00000001
163 #define SERVER_ACCESS_ENUMERATE 0x00000002
164 #define PRINTER_ACCESS_ADMINISTER 0x00000004
165 #define PRINTER_ACCESS_USE 0x00000008
166 #define JOB_ACCESS_ADMINISTER 0x00000010
168 /* JOB status codes. */
170 #define JOB_STATUS_QUEUED 0x0000
171 #define JOB_STATUS_PAUSED 0x0001
172 #define JOB_STATUS_ERROR 0x0002
173 #define JOB_STATUS_DELETING 0x0004
174 #define JOB_STATUS_SPOOLING 0x0008
175 #define JOB_STATUS_PRINTING 0x0010
176 #define JOB_STATUS_OFFLINE 0x0020
177 #define JOB_STATUS_PAPEROUT 0x0040
178 #define JOB_STATUS_PRINTED 0x0080
179 #define JOB_STATUS_DELETED 0x0100
180 #define JOB_STATUS_BLOCKED 0x0200
181 #define JOB_STATUS_USER_INTERVENTION 0x0400
183 /* Access rights for print servers */
184 #define SERVER_ALL_ACCESS STANDARD_RIGHTS_REQUIRED_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
185 #define SERVER_READ STANDARD_RIGHTS_READ_ACCESS|SERVER_ACCESS_ENUMERATE
186 #define SERVER_WRITE STANDARD_RIGHTS_WRITE_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
187 #define SERVER_EXECUTE STANDARD_RIGHTS_EXECUTE_ACCESS|SERVER_ACCESS_ENUMERATE
189 /* Access rights for printers */
190 #define PRINTER_ALL_ACCESS STANDARD_RIGHTS_REQUIRED_ACCESS|PRINTER_ACCESS_ADMINISTER|PRINTER_ACCESS_USE
191 #define PRINTER_READ STANDARD_RIGHTS_READ_ACCESS|PRINTER_ACCESS_USE
192 #define PRINTER_WRITE STANDARD_RIGHTS_WRITE_ACCESS|PRINTER_ACCESS_USE
193 #define PRINTER_EXECUTE STANDARD_RIGHTS_EXECUTE_ACCESS|PRINTER_ACCESS_USE
195 /* Access rights for jobs */
196 #define JOB_ALL_ACCESS STANDARD_RIGHTS_REQUIRED_ACCESS|JOB_ACCESS_ADMINISTER
197 #define JOB_READ STANDARD_RIGHTS_READ_ACCESS|JOB_ACCESS_ADMINISTER
198 #define JOB_WRITE STANDARD_RIGHTS_WRITE_ACCESS|JOB_ACCESS_ADMINISTER
199 #define JOB_EXECUTE STANDARD_RIGHTS_EXECUTE_ACCESS|JOB_ACCESS_ADMINISTER
201 /* ACE masks for the various print permissions */
203 #define PRINTER_ACE_FULL_CONTROL (GENERIC_ALL_ACCESS|PRINTER_ALL_ACCESS)
204 #define PRINTER_ACE_MANAGE_DOCUMENTS (GENERIC_ALL_ACCESS|READ_CONTROL_ACCESS)
205 #define PRINTER_ACE_PRINT (GENERIC_EXECUTE_ACCESS|READ_CONTROL_ACCESS|PRINTER_ACCESS_USE)
208 /* Notify field types */
210 #define NOTIFY_ONE_VALUE 1 /* Notify data is stored in value1 */
211 #define NOTIFY_TWO_VALUE 2 /* Notify data is stored in value2 */
212 #define NOTIFY_POINTER 3 /* Data is a pointer to a buffer */
213 #define NOTIFY_STRING 4 /* Data is a pointer to a buffer w/length */
214 #define NOTIFY_SECDESC 5 /* Data is a security descriptor */
216 #define PRINTER_NOTIFY_TYPE 0x00
217 #define JOB_NOTIFY_TYPE 0x01
218 #define PRINT_TABLE_END 0xFF
220 #define MAX_PRINTER_NOTIFY 26
221 #define MAX_JOB_NOTIFY 24
223 #define MAX_NOTIFY_TYPE_FOR_NOW 26
225 #define PRINTER_NOTIFY_SERVER_NAME 0x00
226 #define PRINTER_NOTIFY_PRINTER_NAME 0x01
227 #define PRINTER_NOTIFY_SHARE_NAME 0x02
228 #define PRINTER_NOTIFY_PORT_NAME 0x03
229 #define PRINTER_NOTIFY_DRIVER_NAME 0x04
230 #define PRINTER_NOTIFY_COMMENT 0x05
231 #define PRINTER_NOTIFY_LOCATION 0x06
232 #define PRINTER_NOTIFY_DEVMODE 0x07
233 #define PRINTER_NOTIFY_SEPFILE 0x08
234 #define PRINTER_NOTIFY_PRINT_PROCESSOR 0x09
235 #define PRINTER_NOTIFY_PARAMETERS 0x0A
236 #define PRINTER_NOTIFY_DATATYPE 0x0B
237 #define PRINTER_NOTIFY_SECURITY_DESCRIPTOR 0x0C
238 #define PRINTER_NOTIFY_ATTRIBUTES 0x0D
239 #define PRINTER_NOTIFY_PRIORITY 0x0E
240 #define PRINTER_NOTIFY_DEFAULT_PRIORITY 0x0F
241 #define PRINTER_NOTIFY_START_TIME 0x10
242 #define PRINTER_NOTIFY_UNTIL_TIME 0x11
243 #define PRINTER_NOTIFY_STATUS 0x12
244 #define PRINTER_NOTIFY_STATUS_STRING 0x13
245 #define PRINTER_NOTIFY_CJOBS 0x14
246 #define PRINTER_NOTIFY_AVERAGE_PPM 0x15
247 #define PRINTER_NOTIFY_TOTAL_PAGES 0x16
248 #define PRINTER_NOTIFY_PAGES_PRINTED 0x17
249 #define PRINTER_NOTIFY_TOTAL_BYTES 0x18
250 #define PRINTER_NOTIFY_BYTES_PRINTED 0x19
252 #define JOB_NOTIFY_PRINTER_NAME 0x00
253 #define JOB_NOTIFY_MACHINE_NAME 0x01
254 #define JOB_NOTIFY_PORT_NAME 0x02
255 #define JOB_NOTIFY_USER_NAME 0x03
256 #define JOB_NOTIFY_NOTIFY_NAME 0x04
257 #define JOB_NOTIFY_DATATYPE 0x05
258 #define JOB_NOTIFY_PRINT_PROCESSOR 0x06
259 #define JOB_NOTIFY_PARAMETERS 0x07
260 #define JOB_NOTIFY_DRIVER_NAME 0x08
261 #define JOB_NOTIFY_DEVMODE 0x09
262 #define JOB_NOTIFY_STATUS 0x0A
263 #define JOB_NOTIFY_STATUS_STRING 0x0B
264 #define JOB_NOTIFY_SECURITY_DESCRIPTOR 0x0C
265 #define JOB_NOTIFY_DOCUMENT 0x0D
266 #define JOB_NOTIFY_PRIORITY 0x0E
267 #define JOB_NOTIFY_POSITION 0x0F
268 #define JOB_NOTIFY_SUBMITTED 0x10
269 #define JOB_NOTIFY_START_TIME 0x11
270 #define JOB_NOTIFY_UNTIL_TIME 0x12
271 #define JOB_NOTIFY_TIME 0x13
272 #define JOB_NOTIFY_TOTAL_PAGES 0x14
273 #define JOB_NOTIFY_PAGES_PRINTED 0x15
274 #define JOB_NOTIFY_TOTAL_BYTES 0x16
275 #define JOB_NOTIFY_BYTES_PRINTED 0x17
277 #define PRINTER_NOTIFY_OPTIONS_REFRESH 0x01
279 #define PRINTER_CHANGE_ADD_PRINTER 0x00000001
280 #define PRINTER_CHANGE_SET_PRINTER 0x00000002
281 #define PRINTER_CHANGE_DELETE_PRINTER 0x00000004
282 #define PRINTER_CHANGE_FAILED_CONNECTION_PRINTER 0x00000008
283 #define PRINTER_CHANGE_PRINTER (PRINTER_CHANGE_ADD_PRINTER | \
284 PRINTER_CHANGE_SET_PRINTER | \
285 PRINTER_CHANGE_DELETE_PRINTER | \
286 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER )
288 #define PRINTER_CHANGE_ADD_JOB 0x00000100
289 #define PRINTER_CHANGE_SET_JOB 0x00000200
290 #define PRINTER_CHANGE_DELETE_JOB 0x00000400
291 #define PRINTER_CHANGE_WRITE_JOB 0x00000800
292 #define PRINTER_CHANGE_JOB (PRINTER_CHANGE_ADD_JOB | \
293 PRINTER_CHANGE_SET_JOB | \
294 PRINTER_CHANGE_DELETE_JOB | \
295 PRINTER_CHANGE_WRITE_JOB )
297 #define PRINTER_CHANGE_ADD_FORM 0x00010000
298 #define PRINTER_CHANGE_SET_FORM 0x00020000
299 #define PRINTER_CHANGE_DELETE_FORM 0x00040000
300 #define PRINTER_CHANGE_FORM (PRINTER_CHANGE_ADD_FORM | \
301 PRINTER_CHANGE_SET_FORM | \
302 PRINTER_CHANGE_DELETE_FORM )
304 #define PRINTER_CHANGE_ADD_PORT 0x00100000
305 #define PRINTER_CHANGE_CONFIGURE_PORT 0x00200000
306 #define PRINTER_CHANGE_DELETE_PORT 0x00400000
307 #define PRINTER_CHANGE_PORT (PRINTER_CHANGE_ADD_PORT | \
308 PRINTER_CHANGE_CONFIGURE_PORT | \
309 PRINTER_CHANGE_DELETE_PORT )
311 #define PRINTER_CHANGE_ADD_PRINT_PROCESSOR 0x01000000
312 #define PRINTER_CHANGE_DELETE_PRINT_PROCESSOR 0x04000000
313 #define PRINTER_CHANGE_PRINT_PROCESSOR (PRINTER_CHANGE_ADD_PRINT_PROCESSOR | \
314 PRINTER_CHANGE_DELETE_PRINT_PROCESSOR )
316 #define PRINTER_CHANGE_ADD_PRINTER_DRIVER 0x10000000
317 #define PRINTER_CHANGE_SET_PRINTER_DRIVER 0x20000000
318 #define PRINTER_CHANGE_DELETE_PRINTER_DRIVER 0x40000000
319 #define PRINTER_CHANGE_PRINTER_DRIVER (PRINTER_CHANGE_ADD_PRINTER_DRIVER | \
320 PRINTER_CHANGE_SET_PRINTER_DRIVER | \
321 PRINTER_CHANGE_DELETE_PRINTER_DRIVER )
323 #define PRINTER_CHANGE_TIMEOUT 0x80000000
324 #define PRINTER_CHANGE_ALL (PRINTER_CHANGE_JOB | \
325 PRINTER_CHANGE_FORM | \
326 PRINTER_CHANGE_PORT | \
327 PRINTER_CHANGE_PRINT_PROCESSOR | \
328 PRINTER_CHANGE_PRINTER_DRIVER )
330 #define PRINTER_NOTIFY_INFO_DISCARDED 0x1
333 * Set of macros for flagging what changed in the PRINTER_INFO_2 struct
334 * when sending messages to other smbd's
336 #define PRINTER_MESSAGE_NULL 0x00000000
337 #define PRINTER_MESSAGE_DRIVER 0x00000001
338 #define PRINTER_MESSAGE_COMMENT 0x00000002
339 #define PRINTER_MESSAGE_PRINTERNAME 0x00000004
340 #define PRINTER_MESSAGE_LOCATION 0x00000008
341 #define PRINTER_MESSAGE_DEVMODE 0x00000010 /* not curently supported */
342 #define PRINTER_MESSAGE_SEPFILE 0x00000020
343 #define PRINTER_MESSAGE_PRINTPROC 0x00000040
344 #define PRINTER_MESSAGE_PARAMS 0x00000080
345 #define PRINTER_MESSAGE_DATATYPE 0x00000100
346 #define PRINTER_MESSAGE_SECDESC 0x00000200
347 #define PRINTER_MESSAGE_CJOBS 0x00000400
348 #define PRINTER_MESSAGE_PORT 0x00000800
349 #define PRINTER_MESSAGE_SHARENAME 0x00001000
350 #define PRINTER_MESSAGE_ATTRIBUTES 0x00002000
352 typedef struct printer_message_info {
353 uint32 low; /* PRINTER_CHANGE_XXX */
354 uint32 high; /* PRINTER_CHANGE_XXX */
355 fstring printer_name;
356 uint32 flags; /* PRINTER_MESSAGE_XXX */
358 PRINTER_MESSAGE_INFO;
361 * The printer attributes.
362 * I #defined all of them (grabbed form MSDN)
363 * I'm only using:
364 * ( SHARED | NETWORK | RAW_ONLY )
365 * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
368 #define PRINTER_ATTRIBUTE_QUEUED 0x00000001
369 #define PRINTER_ATTRIBUTE_DIRECT 0x00000002
370 #define PRINTER_ATTRIBUTE_DEFAULT 0x00000004
371 #define PRINTER_ATTRIBUTE_SHARED 0x00000008
373 #define PRINTER_ATTRIBUTE_NETWORK 0x00000010
374 #define PRINTER_ATTRIBUTE_HIDDEN 0x00000020
375 #define PRINTER_ATTRIBUTE_LOCAL 0x00000040
376 #define PRINTER_ATTRIBUTE_ENABLE_DEVQ 0x00000080
378 #define PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS 0x00000100
379 #define PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST 0x00000200
380 #define PRINTER_ATTRIBUTE_WORK_OFFLINE 0x00000400
381 #define PRINTER_ATTRIBUTE_ENABLE_BIDI 0x00000800
383 #define PRINTER_ATTRIBUTE_RAW_ONLY 0x00001000
384 #define PRINTER_ATTRIBUTE_PUBLISHED 0x00002000
386 #define PRINTER_ATTRIBUTE_SAMBA (PRINTER_ATTRIBUTE_RAW_ONLY|\
387 PRINTER_ATTRIBUTE_SHARED|\
388 PRINTER_ATTRIBUTE_LOCAL)
389 #define PRINTER_ATTRIBUTE_NOT_SAMBA (PRINTER_ATTRIBUTE_NETWORK)
391 #define NO_PRIORITY 0
392 #define MAX_PRIORITY 99
393 #define MIN_PRIORITY 1
394 #define DEF_PRIORITY 1
396 /* the flags of the query */
397 #define PRINTER_ENUM_DEFAULT 0x00000001
398 #define PRINTER_ENUM_LOCAL 0x00000002
399 #define PRINTER_ENUM_CONNECTIONS 0x00000004
400 #define PRINTER_ENUM_FAVORITE 0x00000004
401 #define PRINTER_ENUM_NAME 0x00000008
402 #define PRINTER_ENUM_REMOTE 0x00000010
403 #define PRINTER_ENUM_SHARED 0x00000020
404 #define PRINTER_ENUM_NETWORK 0x00000040
406 /* the flags of each printers */
407 #define PRINTER_ENUM_UNKNOWN_8 0x00000008
408 #define PRINTER_ENUM_EXPAND 0x00004000
409 #define PRINTER_ENUM_CONTAINER 0x00008000
410 #define PRINTER_ENUM_ICONMASK 0x00ff0000
411 #define PRINTER_ENUM_ICON1 0x00010000
412 #define PRINTER_ENUM_ICON2 0x00020000
413 #define PRINTER_ENUM_ICON3 0x00040000
414 #define PRINTER_ENUM_ICON4 0x00080000
415 #define PRINTER_ENUM_ICON5 0x00100000
416 #define PRINTER_ENUM_ICON6 0x00200000
417 #define PRINTER_ENUM_ICON7 0x00400000
418 #define PRINTER_ENUM_ICON8 0x00800000
420 /* FLAGS for SPOOLSS_DELETEPRINTERDRIVEREX */
422 #define DPD_DELETE_UNUSED_FILES 0x00000001
423 #define DPD_DELETE_SPECIFIC_VERSION 0x00000002
424 #define DPD_DELETE_ALL_FILES 0x00000004
426 #define DRIVER_ANY_VERSION 0xffffffff
427 #define DRIVER_MAX_VERSION 4
429 /* FLAGS for SPOOLSS_ADDPRINTERDRIVEREX */
431 #define APD_STRICT_UPGRADE 0x00000001
432 #define APD_STRICT_DOWNGRADE 0x00000002
433 #define APD_COPY_ALL_FILES 0x00000004
434 #define APD_COPY_NEW_FILES 0x00000008
437 /* this struct is undocumented */
438 /* thanks to the ddk ... */
439 typedef struct {
440 uint32 size; /* length of user_name & client_name + 2? */
441 UNISTR2 *client_name;
442 UNISTR2 *user_name;
443 uint32 build;
444 uint32 major;
445 uint32 minor;
446 uint32 processor;
447 } SPOOL_USER_1;
449 typedef struct {
450 uint32 level;
451 union {
452 SPOOL_USER_1 *user1;
453 } user;
454 } SPOOL_USER_CTR;
457 * various bits in the DEVICEMODE.fields member
460 #define DEVMODE_ORIENTATION 0x00000001
461 #define DEVMODE_PAPERSIZE 0x00000002
462 #define DEVMODE_PAPERLENGTH 0x00000004
463 #define DEVMODE_PAPERWIDTH 0x00000008
464 #define DEVMODE_SCALE 0x00000010
465 #define DEVMODE_POSITION 0x00000020
466 #define DEVMODE_NUP 0x00000040
467 #define DEVMODE_COPIES 0x00000100
468 #define DEVMODE_DEFAULTSOURCE 0x00000200
469 #define DEVMODE_PRINTQUALITY 0x00000400
470 #define DEVMODE_COLOR 0x00000800
471 #define DEVMODE_DUPLEX 0x00001000
472 #define DEVMODE_YRESOLUTION 0x00002000
473 #define DEVMODE_TTOPTION 0x00004000
474 #define DEVMODE_COLLATE 0x00008000
475 #define DEVMODE_FORMNAME 0x00010000
476 #define DEVMODE_LOGPIXELS 0x00020000
477 #define DEVMODE_BITSPERPEL 0x00040000
478 #define DEVMODE_PELSWIDTH 0x00080000
479 #define DEVMODE_PELSHEIGHT 0x00100000
480 #define DEVMODE_DISPLAYFLAGS 0x00200000
481 #define DEVMODE_DISPLAYFREQUENCY 0x00400000
482 #define DEVMODE_ICMMETHOD 0x00800000
483 #define DEVMODE_ICMINTENT 0x01000000
484 #define DEVMODE_MEDIATYPE 0x02000000
485 #define DEVMODE_DITHERTYPE 0x04000000
486 #define DEVMODE_PANNINGWIDTH 0x08000000
487 #define DEVMODE_PANNINGHEIGHT 0x10000000
491 * Devicemode structure
494 typedef struct devicemode
496 UNISTR devicename;
497 uint16 specversion;
498 uint16 driverversion;
499 uint16 size;
500 uint16 driverextra;
501 uint32 fields;
502 uint16 orientation;
503 uint16 papersize;
504 uint16 paperlength;
505 uint16 paperwidth;
506 uint16 scale;
507 uint16 copies;
508 uint16 defaultsource;
509 uint16 printquality;
510 uint16 color;
511 uint16 duplex;
512 uint16 yresolution;
513 uint16 ttoption;
514 uint16 collate;
515 UNISTR formname;
516 uint16 logpixels;
517 uint32 bitsperpel;
518 uint32 pelswidth;
519 uint32 pelsheight;
520 uint32 displayflags;
521 uint32 displayfrequency;
522 uint32 icmmethod;
523 uint32 icmintent;
524 uint32 mediatype;
525 uint32 dithertype;
526 uint32 reserved1;
527 uint32 reserved2;
528 uint32 panningwidth;
529 uint32 panningheight;
530 uint8 *dev_private;
532 DEVICEMODE;
534 typedef struct _devmode_cont
536 uint32 size;
537 uint32 devmode_ptr;
538 DEVICEMODE *devmode;
540 DEVMODE_CTR;
542 typedef struct _printer_default
544 uint32 datatype_ptr;
545 UNISTR2 datatype;
546 DEVMODE_CTR devmode_cont;
547 uint32 access_required;
549 PRINTER_DEFAULT;
551 /********************************************/
553 typedef struct {
554 UNISTR2 *printername;
555 PRINTER_DEFAULT printer_default;
556 } SPOOL_Q_OPEN_PRINTER;
558 typedef struct {
559 POLICY_HND handle; /* handle used along all transactions (20*uint8) */
560 WERROR status;
561 } SPOOL_R_OPEN_PRINTER;
563 /********************************************/
565 typedef struct {
566 UNISTR2 *printername;
567 PRINTER_DEFAULT printer_default;
568 uint32 user_switch;
569 SPOOL_USER_CTR user_ctr;
570 } SPOOL_Q_OPEN_PRINTER_EX;
572 typedef struct {
573 POLICY_HND handle; /* handle used along all transactions (20*uint8) */
574 WERROR status;
575 } SPOOL_R_OPEN_PRINTER_EX;
577 /********************************************/
579 typedef struct spool_notify_option_type
581 uint16 type;
582 uint16 reserved0;
583 uint32 reserved1;
584 uint32 reserved2;
585 uint32 count;
586 uint32 fields_ptr;
587 uint32 count2;
588 uint16 fields[MAX_NOTIFY_TYPE_FOR_NOW];
590 SPOOL_NOTIFY_OPTION_TYPE;
592 typedef struct spool_notify_option_type_ctr
594 uint32 count;
595 SPOOL_NOTIFY_OPTION_TYPE *type;
597 SPOOL_NOTIFY_OPTION_TYPE_CTR;
601 typedef struct s_header_type
603 uint32 type;
604 union
606 uint32 value;
607 UNISTR string;
609 data;
611 HEADER_TYPE;
614 typedef struct spool_q_getprinterdata
616 POLICY_HND handle;
617 UNISTR2 valuename;
618 uint32 size;
620 SPOOL_Q_GETPRINTERDATA;
622 typedef struct spool_r_getprinterdata
624 uint32 type;
625 uint32 size;
626 uint8 *data;
627 uint32 needed;
628 WERROR status;
630 SPOOL_R_GETPRINTERDATA;
632 typedef struct spool_q_deleteprinterdata
634 POLICY_HND handle;
635 UNISTR2 valuename;
637 SPOOL_Q_DELETEPRINTERDATA;
639 typedef struct spool_r_deleteprinterdata
641 WERROR status;
643 SPOOL_R_DELETEPRINTERDATA;
645 typedef struct spool_q_closeprinter
647 POLICY_HND handle;
649 SPOOL_Q_CLOSEPRINTER;
651 typedef struct spool_r_closeprinter
653 POLICY_HND handle;
654 WERROR status;
656 SPOOL_R_CLOSEPRINTER;
658 typedef struct spool_q_startpageprinter
660 POLICY_HND handle;
662 SPOOL_Q_STARTPAGEPRINTER;
664 typedef struct spool_r_startpageprinter
666 WERROR status;
668 SPOOL_R_STARTPAGEPRINTER;
670 typedef struct spool_q_endpageprinter
672 POLICY_HND handle;
674 SPOOL_Q_ENDPAGEPRINTER;
676 typedef struct spool_r_endpageprinter
678 WERROR status;
680 SPOOL_R_ENDPAGEPRINTER;
683 typedef struct spool_q_deleteprinterdriver
685 uint32 server_ptr;
686 UNISTR2 server;
687 UNISTR2 arch;
688 UNISTR2 driver;
690 SPOOL_Q_DELETEPRINTERDRIVER;
692 typedef struct spool_r_deleteprinterdriver
694 WERROR status;
696 SPOOL_R_DELETEPRINTERDRIVER;
698 typedef struct spool_q_deleteprinterdriverex
700 uint32 server_ptr;
701 UNISTR2 server;
702 UNISTR2 arch;
703 UNISTR2 driver;
704 uint32 delete_flags;
705 uint32 version;
707 SPOOL_Q_DELETEPRINTERDRIVEREX;
709 typedef struct spool_r_deleteprinterdriverex
711 WERROR status;
713 SPOOL_R_DELETEPRINTERDRIVEREX;
716 typedef struct spool_doc_info_1
718 uint32 p_docname;
719 uint32 p_outputfile;
720 uint32 p_datatype;
721 UNISTR2 docname;
722 UNISTR2 outputfile;
723 UNISTR2 datatype;
725 DOC_INFO_1;
727 typedef struct spool_doc_info
729 uint32 switch_value;
730 DOC_INFO_1 doc_info_1;
732 DOC_INFO;
734 typedef struct spool_doc_info_container
736 uint32 level;
737 DOC_INFO docinfo;
739 DOC_INFO_CONTAINER;
741 typedef struct spool_q_startdocprinter
743 POLICY_HND handle;
744 DOC_INFO_CONTAINER doc_info_container;
746 SPOOL_Q_STARTDOCPRINTER;
748 typedef struct spool_r_startdocprinter
750 uint32 jobid;
751 WERROR status;
753 SPOOL_R_STARTDOCPRINTER;
755 typedef struct spool_q_enddocprinter
757 POLICY_HND handle;
759 SPOOL_Q_ENDDOCPRINTER;
761 typedef struct spool_r_enddocprinter
763 WERROR status;
765 SPOOL_R_ENDDOCPRINTER;
767 typedef struct spool_q_writeprinter
769 POLICY_HND handle;
770 uint32 buffer_size;
771 uint8 *buffer;
772 uint32 buffer_size2;
774 SPOOL_Q_WRITEPRINTER;
776 typedef struct spool_r_writeprinter
778 uint32 buffer_written;
779 WERROR status;
781 SPOOL_R_WRITEPRINTER;
783 typedef struct spool_notify_option
785 uint32 version;
786 uint32 flags;
787 uint32 count;
788 uint32 option_type_ptr;
789 SPOOL_NOTIFY_OPTION_TYPE_CTR ctr;
791 SPOOL_NOTIFY_OPTION;
793 typedef struct spool_notify_info_data
795 uint16 type;
796 uint16 field;
797 uint32 reserved;
798 uint32 id;
799 union {
800 uint32 value[2];
801 struct {
802 uint32 length;
803 uint16 *string;
804 } data;
805 struct {
806 uint32 size;
807 SEC_DESC *desc;
808 } sd;
810 notify_data;
811 uint32 size;
812 uint32 enc_type;
813 } SPOOL_NOTIFY_INFO_DATA;
815 typedef struct spool_notify_info
817 uint32 version;
818 uint32 flags;
819 uint32 count;
820 SPOOL_NOTIFY_INFO_DATA *data;
822 SPOOL_NOTIFY_INFO;
824 /* If the struct name looks obscure, yes it is ! */
825 /* RemoteFindFirstPrinterChangeNotificationEx query struct */
826 typedef struct spoolss_q_rffpcnex
828 POLICY_HND handle;
829 uint32 flags;
830 uint32 options;
831 uint32 localmachine_ptr;
832 UNISTR2 localmachine;
833 uint32 printerlocal;
834 uint32 option_ptr;
835 SPOOL_NOTIFY_OPTION *option;
837 SPOOL_Q_RFFPCNEX;
839 typedef struct spool_r_rffpcnex
841 WERROR status;
843 SPOOL_R_RFFPCNEX;
845 /* Remote Find Next Printer Change Notify Ex */
846 typedef struct spool_q_rfnpcnex
848 POLICY_HND handle;
849 uint32 change;
850 uint32 option_ptr;
851 SPOOL_NOTIFY_OPTION *option;
853 SPOOL_Q_RFNPCNEX;
855 typedef struct spool_r_rfnpcnex
857 uint32 info_ptr;
858 SPOOL_NOTIFY_INFO info;
859 WERROR status;
861 SPOOL_R_RFNPCNEX;
863 /* Find Close Printer Notify */
864 typedef struct spool_q_fcpn
866 POLICY_HND handle;
868 SPOOL_Q_FCPN;
870 typedef struct spool_r_fcpn
872 WERROR status;
874 SPOOL_R_FCPN;
877 typedef struct printer_info_0
879 UNISTR printername;
880 UNISTR servername;
881 uint32 cjobs;
882 uint32 total_jobs;
883 uint32 total_bytes;
885 uint16 year;
886 uint16 month;
887 uint16 dayofweek;
888 uint16 day;
889 uint16 hour;
890 uint16 minute;
891 uint16 second;
892 uint16 milliseconds;
894 uint32 global_counter;
895 uint32 total_pages;
897 uint16 major_version;
898 uint16 build_version;
900 uint32 unknown7;
901 uint32 unknown8;
902 uint32 unknown9;
903 uint32 session_counter;
904 uint32 unknown11;
905 uint32 printer_errors;
906 uint32 unknown13;
907 uint32 unknown14;
908 uint32 unknown15;
909 uint32 unknown16;
910 uint32 change_id;
911 uint32 unknown18;
912 uint32 status;
913 uint32 unknown20;
914 uint32 c_setprinter;
916 uint16 unknown22;
917 uint16 unknown23;
918 uint16 unknown24;
919 uint16 unknown25;
920 uint16 unknown26;
921 uint16 unknown27;
922 uint16 unknown28;
923 uint16 unknown29;
924 } PRINTER_INFO_0;
926 typedef struct printer_info_1
928 uint32 flags;
929 UNISTR description;
930 UNISTR name;
931 UNISTR comment;
933 PRINTER_INFO_1;
935 typedef struct printer_info_2
937 UNISTR servername;
938 UNISTR printername;
939 UNISTR sharename;
940 UNISTR portname;
941 UNISTR drivername;
942 UNISTR comment;
943 UNISTR location;
944 DEVICEMODE *devmode;
945 UNISTR sepfile;
946 UNISTR printprocessor;
947 UNISTR datatype;
948 UNISTR parameters;
949 SEC_DESC *secdesc;
950 uint32 attributes;
951 uint32 priority;
952 uint32 defaultpriority;
953 uint32 starttime;
954 uint32 untiltime;
955 uint32 status;
956 uint32 cjobs;
957 uint32 averageppm;
959 PRINTER_INFO_2;
961 typedef struct printer_info_3
963 SEC_DESC *secdesc;
965 PRINTER_INFO_3;
967 typedef struct printer_info_4
969 UNISTR printername;
970 UNISTR servername;
971 uint32 attributes;
973 PRINTER_INFO_4;
975 typedef struct printer_info_5
977 UNISTR printername;
978 UNISTR portname;
979 uint32 attributes;
980 uint32 device_not_selected_timeout;
981 uint32 transmission_retry_timeout;
983 PRINTER_INFO_5;
985 typedef struct printer_info_6
987 uint32 status;
989 PRINTER_INFO_6;
991 #define SPOOL_DS_PUBLISH 1
992 #define SPOOL_DS_UPDATE 2
993 #define SPOOL_DS_UNPUBLISH 4
994 #define SPOOL_DS_PENDING 0x80000000
996 typedef struct printer_info_7
998 UNISTR guid; /* text form of printer guid */
999 uint32 action;
1001 PRINTER_INFO_7;
1003 typedef struct spool_q_enumprinters
1005 uint32 flags;
1006 uint32 servername_ptr;
1007 UNISTR2 servername;
1008 uint32 level;
1009 RPC_BUFFER *buffer;
1010 uint32 offered;
1012 SPOOL_Q_ENUMPRINTERS;
1014 typedef struct printer_info_ctr_info
1016 PRINTER_INFO_0 *printers_0;
1017 PRINTER_INFO_1 *printers_1;
1018 PRINTER_INFO_2 *printers_2;
1019 PRINTER_INFO_3 *printers_3;
1020 PRINTER_INFO_4 *printers_4;
1021 PRINTER_INFO_5 *printers_5;
1022 PRINTER_INFO_7 *printers_7;
1024 PRINTER_INFO_CTR;
1026 typedef struct spool_r_enumprinters
1028 RPC_BUFFER *buffer;
1029 uint32 needed; /* bytes needed */
1030 uint32 returned; /* number of printers */
1031 WERROR status;
1033 SPOOL_R_ENUMPRINTERS;
1036 typedef struct spool_q_getprinter
1038 POLICY_HND handle;
1039 uint32 level;
1040 RPC_BUFFER *buffer;
1041 uint32 offered;
1043 SPOOL_Q_GETPRINTER;
1045 typedef struct printer_info_info
1047 union
1049 PRINTER_INFO_0 *info0;
1050 PRINTER_INFO_1 *info1;
1051 PRINTER_INFO_2 *info2;
1052 void *info;
1053 } printer;
1054 } PRINTER_INFO;
1056 typedef struct spool_r_getprinter
1058 RPC_BUFFER *buffer;
1059 uint32 needed;
1060 WERROR status;
1061 } SPOOL_R_GETPRINTER;
1063 typedef struct driver_info_1
1065 UNISTR name;
1066 } DRIVER_INFO_1;
1068 typedef struct driver_info_2
1070 uint32 version;
1071 UNISTR name;
1072 UNISTR architecture;
1073 UNISTR driverpath;
1074 UNISTR datafile;
1075 UNISTR configfile;
1076 } DRIVER_INFO_2;
1078 typedef struct driver_info_3
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;
1091 DRIVER_INFO_3;
1093 typedef struct driver_info_6
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;
1115 DRIVER_INFO_6;
1117 typedef struct driver_info_info
1119 DRIVER_INFO_1 *info1;
1120 DRIVER_INFO_2 *info2;
1121 DRIVER_INFO_3 *info3;
1122 DRIVER_INFO_6 *info6;
1124 PRINTER_DRIVER_CTR;
1126 typedef struct spool_q_getprinterdriver2
1128 POLICY_HND handle;
1129 uint32 architecture_ptr;
1130 UNISTR2 architecture;
1131 uint32 level;
1132 RPC_BUFFER *buffer;
1133 uint32 offered;
1134 uint32 clientmajorversion;
1135 uint32 clientminorversion;
1137 SPOOL_Q_GETPRINTERDRIVER2;
1139 typedef struct spool_r_getprinterdriver2
1141 RPC_BUFFER *buffer;
1142 uint32 needed;
1143 uint32 servermajorversion;
1144 uint32 serverminorversion;
1145 WERROR status;
1147 SPOOL_R_GETPRINTERDRIVER2;
1150 typedef struct add_jobinfo_1
1152 UNISTR path;
1153 uint32 job_number;
1155 ADD_JOBINFO_1;
1158 typedef struct spool_q_addjob
1160 POLICY_HND handle;
1161 uint32 level;
1162 RPC_BUFFER *buffer;
1163 uint32 offered;
1165 SPOOL_Q_ADDJOB;
1167 typedef struct spool_r_addjob
1169 RPC_BUFFER *buffer;
1170 uint32 needed;
1171 WERROR status;
1173 SPOOL_R_ADDJOB;
1176 * I'm really wondering how many different time formats
1177 * I will have to cope with
1179 * JFM, 09/13/98 In a mad mood ;-(
1181 typedef struct systemtime
1183 uint16 year;
1184 uint16 month;
1185 uint16 dayofweek;
1186 uint16 day;
1187 uint16 hour;
1188 uint16 minute;
1189 uint16 second;
1190 uint16 milliseconds;
1192 SYSTEMTIME;
1194 typedef struct s_job_info_1
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;
1210 JOB_INFO_1;
1212 typedef struct s_job_info_2
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;
1238 JOB_INFO_2;
1240 typedef struct spool_q_enumjobs
1242 POLICY_HND handle;
1243 uint32 firstjob;
1244 uint32 numofjobs;
1245 uint32 level;
1246 RPC_BUFFER *buffer;
1247 uint32 offered;
1249 SPOOL_Q_ENUMJOBS;
1251 typedef struct job_info_ctr_info
1253 union
1255 JOB_INFO_1 *job_info_1;
1256 JOB_INFO_2 *job_info_2;
1257 void *info;
1258 } job;
1260 } JOB_INFO_CTR;
1262 typedef struct spool_r_enumjobs
1264 RPC_BUFFER *buffer;
1265 uint32 needed;
1266 uint32 returned;
1267 WERROR status;
1269 SPOOL_R_ENUMJOBS;
1271 typedef struct spool_q_schedulejob
1273 POLICY_HND handle;
1274 uint32 jobid;
1276 SPOOL_Q_SCHEDULEJOB;
1278 typedef struct spool_r_schedulejob
1280 WERROR status;
1282 SPOOL_R_SCHEDULEJOB;
1284 typedef struct s_port_info_1
1286 UNISTR port_name;
1288 PORT_INFO_1;
1290 typedef struct s_port_info_2
1292 UNISTR port_name;
1293 UNISTR monitor_name;
1294 UNISTR description;
1295 uint32 port_type;
1296 uint32 reserved;
1298 PORT_INFO_2;
1300 /* Port Type bits */
1301 #define PORT_TYPE_WRITE 0x0001
1302 #define PORT_TYPE_READ 0x0002
1303 #define PORT_TYPE_REDIRECTED 0x0004
1304 #define PORT_TYPE_NET_ATTACHED 0x0008
1306 typedef struct spool_q_enumports
1308 uint32 name_ptr;
1309 UNISTR2 name;
1310 uint32 level;
1311 RPC_BUFFER *buffer;
1312 uint32 offered;
1314 SPOOL_Q_ENUMPORTS;
1316 typedef struct port_info_ctr_info
1318 union
1320 PORT_INFO_1 *info_1;
1321 PORT_INFO_2 *info_2;
1323 port;
1326 PORT_INFO_CTR;
1328 typedef struct spool_r_enumports
1330 RPC_BUFFER *buffer;
1331 uint32 needed; /* bytes needed */
1332 uint32 returned; /* number of printers */
1333 WERROR status;
1335 SPOOL_R_ENUMPORTS;
1337 #define JOB_CONTROL_PAUSE 1
1338 #define JOB_CONTROL_RESUME 2
1339 #define JOB_CONTROL_CANCEL 3
1340 #define JOB_CONTROL_RESTART 4
1341 #define JOB_CONTROL_DELETE 5
1343 typedef struct job_info_info
1345 union
1347 JOB_INFO_1 job_info_1;
1348 JOB_INFO_2 job_info_2;
1350 job;
1353 JOB_INFO;
1355 typedef struct spool_q_setjob
1357 POLICY_HND handle;
1358 uint32 jobid;
1359 uint32 level;
1360 JOB_INFO ctr;
1361 uint32 command;
1364 SPOOL_Q_SETJOB;
1366 typedef struct spool_r_setjob
1368 WERROR status;
1371 SPOOL_R_SETJOB;
1373 typedef struct spool_q_enumprinterdrivers
1375 uint32 name_ptr;
1376 UNISTR2 name;
1377 uint32 environment_ptr;
1378 UNISTR2 environment;
1379 uint32 level;
1380 RPC_BUFFER *buffer;
1381 uint32 offered;
1383 SPOOL_Q_ENUMPRINTERDRIVERS;
1385 typedef struct spool_r_enumprinterdrivers
1387 RPC_BUFFER *buffer;
1388 uint32 needed;
1389 uint32 returned;
1390 WERROR status;
1392 SPOOL_R_ENUMPRINTERDRIVERS;
1394 #define FORM_USER 0
1395 #define FORM_BUILTIN 1
1396 #define FORM_PRINTER 2
1398 typedef struct spool_form_1
1400 uint32 flag;
1401 UNISTR name;
1402 uint32 width;
1403 uint32 length;
1404 uint32 left;
1405 uint32 top;
1406 uint32 right;
1407 uint32 bottom;
1409 FORM_1;
1411 typedef struct spool_q_enumforms
1413 POLICY_HND handle;
1414 uint32 level;
1415 RPC_BUFFER *buffer;
1416 uint32 offered;
1418 SPOOL_Q_ENUMFORMS;
1420 typedef struct spool_r_enumforms
1422 RPC_BUFFER *buffer;
1423 uint32 needed;
1424 uint32 numofforms;
1425 WERROR status;
1427 SPOOL_R_ENUMFORMS;
1429 typedef struct spool_q_getform
1431 POLICY_HND handle;
1432 UNISTR2 formname;
1433 uint32 level;
1434 RPC_BUFFER *buffer;
1435 uint32 offered;
1437 SPOOL_Q_GETFORM;
1439 typedef struct spool_r_getform
1441 RPC_BUFFER *buffer;
1442 uint32 needed;
1443 WERROR status;
1445 SPOOL_R_GETFORM;
1447 typedef struct spool_printer_info_level_1
1449 uint32 flags;
1450 uint32 description_ptr;
1451 uint32 name_ptr;
1452 uint32 comment_ptr;
1453 UNISTR2 description;
1454 UNISTR2 name;
1455 UNISTR2 comment;
1456 } SPOOL_PRINTER_INFO_LEVEL_1;
1458 typedef struct spool_printer_info_level_2
1460 uint32 servername_ptr;
1461 uint32 printername_ptr;
1462 uint32 sharename_ptr;
1463 uint32 portname_ptr;
1464 uint32 drivername_ptr;
1465 uint32 comment_ptr;
1466 uint32 location_ptr;
1467 uint32 devmode_ptr;
1468 uint32 sepfile_ptr;
1469 uint32 printprocessor_ptr;
1470 uint32 datatype_ptr;
1471 uint32 parameters_ptr;
1472 uint32 secdesc_ptr;
1473 uint32 attributes;
1474 uint32 priority;
1475 uint32 default_priority;
1476 uint32 starttime;
1477 uint32 untiltime;
1478 uint32 status;
1479 uint32 cjobs;
1480 uint32 averageppm;
1481 UNISTR2 servername;
1482 UNISTR2 printername;
1483 UNISTR2 sharename;
1484 UNISTR2 portname;
1485 UNISTR2 drivername;
1486 UNISTR2 comment;
1487 UNISTR2 location;
1488 UNISTR2 sepfile;
1489 UNISTR2 printprocessor;
1490 UNISTR2 datatype;
1491 UNISTR2 parameters;
1493 SPOOL_PRINTER_INFO_LEVEL_2;
1495 typedef struct spool_printer_info_level_3
1497 uint32 secdesc_ptr;
1499 SPOOL_PRINTER_INFO_LEVEL_3;
1501 typedef struct spool_printer_info_level_7
1503 uint32 guid_ptr;
1504 uint32 action;
1505 UNISTR2 guid;
1507 SPOOL_PRINTER_INFO_LEVEL_7;
1509 typedef struct spool_printer_info_level
1511 uint32 level;
1512 uint32 info_ptr;
1513 SPOOL_PRINTER_INFO_LEVEL_1 *info_1;
1514 SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
1515 SPOOL_PRINTER_INFO_LEVEL_3 *info_3;
1516 SPOOL_PRINTER_INFO_LEVEL_7 *info_7;
1518 SPOOL_PRINTER_INFO_LEVEL;
1520 typedef struct spool_printer_driver_info_level_3
1522 uint32 cversion;
1523 uint32 name_ptr;
1524 uint32 environment_ptr;
1525 uint32 driverpath_ptr;
1526 uint32 datafile_ptr;
1527 uint32 configfile_ptr;
1528 uint32 helpfile_ptr;
1529 uint32 monitorname_ptr;
1530 uint32 defaultdatatype_ptr;
1531 uint32 dependentfilessize;
1532 uint32 dependentfiles_ptr;
1534 UNISTR2 name;
1535 UNISTR2 environment;
1536 UNISTR2 driverpath;
1537 UNISTR2 datafile;
1538 UNISTR2 configfile;
1539 UNISTR2 helpfile;
1540 UNISTR2 monitorname;
1541 UNISTR2 defaultdatatype;
1542 BUFFER5 dependentfiles;
1545 SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;
1547 /* SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 structure */
1548 typedef struct {
1549 uint32 version;
1550 uint32 name_ptr;
1551 uint32 environment_ptr;
1552 uint32 driverpath_ptr;
1553 uint32 datafile_ptr;
1554 uint32 configfile_ptr;
1555 uint32 helpfile_ptr;
1556 uint32 monitorname_ptr;
1557 uint32 defaultdatatype_ptr;
1558 uint32 dependentfiles_len;
1559 uint32 dependentfiles_ptr;
1560 uint32 previousnames_len;
1561 uint32 previousnames_ptr;
1562 NTTIME driverdate;
1563 uint64 driverversion;
1564 uint32 dummy4;
1565 uint32 mfgname_ptr;
1566 uint32 oemurl_ptr;
1567 uint32 hardwareid_ptr;
1568 uint32 provider_ptr;
1569 UNISTR2 name;
1570 UNISTR2 environment;
1571 UNISTR2 driverpath;
1572 UNISTR2 datafile;
1573 UNISTR2 configfile;
1574 UNISTR2 helpfile;
1575 UNISTR2 monitorname;
1576 UNISTR2 defaultdatatype;
1577 BUFFER5 dependentfiles;
1578 BUFFER5 previousnames;
1579 UNISTR2 mfgname;
1580 UNISTR2 oemurl;
1581 UNISTR2 hardwareid;
1582 UNISTR2 provider;
1583 } SPOOL_PRINTER_DRIVER_INFO_LEVEL_6;
1586 typedef struct spool_printer_driver_info_level
1588 uint32 level;
1589 uint32 ptr;
1590 SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
1591 SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *info_6;
1593 SPOOL_PRINTER_DRIVER_INFO_LEVEL;
1596 typedef struct spool_q_setprinter
1598 POLICY_HND handle;
1599 uint32 level;
1600 SPOOL_PRINTER_INFO_LEVEL info;
1601 SEC_DESC_BUF *secdesc_ctr;
1602 DEVMODE_CTR devmode_ctr;
1604 uint32 command;
1607 SPOOL_Q_SETPRINTER;
1609 typedef struct spool_r_setprinter
1611 WERROR status;
1613 SPOOL_R_SETPRINTER;
1615 /********************************************/
1617 typedef struct {
1618 POLICY_HND handle;
1619 } SPOOL_Q_DELETEPRINTER;
1621 typedef struct {
1622 POLICY_HND handle;
1623 WERROR status;
1624 } SPOOL_R_DELETEPRINTER;
1626 /********************************************/
1628 typedef struct {
1629 POLICY_HND handle;
1630 } SPOOL_Q_ABORTPRINTER;
1632 typedef struct {
1633 WERROR status;
1634 } SPOOL_R_ABORTPRINTER;
1637 /********************************************/
1639 typedef struct {
1640 UNISTR2 *server_name;
1641 uint32 level;
1642 SPOOL_PRINTER_INFO_LEVEL info;
1643 DEVMODE_CTR devmode_ctr;
1644 SEC_DESC_BUF *secdesc_ctr;
1645 uint32 user_switch;
1646 SPOOL_USER_CTR user_ctr;
1647 } SPOOL_Q_ADDPRINTEREX;
1649 typedef struct {
1650 POLICY_HND handle;
1651 WERROR status;
1652 } SPOOL_R_ADDPRINTEREX;
1654 /********************************************/
1656 typedef struct spool_q_addprinterdriver
1658 uint32 server_name_ptr;
1659 UNISTR2 server_name;
1660 uint32 level;
1661 SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1663 SPOOL_Q_ADDPRINTERDRIVER;
1665 typedef struct spool_r_addprinterdriver
1667 WERROR status;
1669 SPOOL_R_ADDPRINTERDRIVER;
1671 typedef struct spool_q_addprinterdriverex
1673 uint32 server_name_ptr;
1674 UNISTR2 server_name;
1675 uint32 level;
1676 SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1677 uint32 copy_flags;
1679 SPOOL_Q_ADDPRINTERDRIVEREX;
1681 typedef struct spool_r_addprinterdriverex
1683 WERROR status;
1685 SPOOL_R_ADDPRINTERDRIVEREX;
1688 typedef struct driver_directory_1
1690 UNISTR name;
1692 DRIVER_DIRECTORY_1;
1694 typedef struct driver_info_ctr_info
1696 DRIVER_DIRECTORY_1 *info1;
1698 DRIVER_DIRECTORY_CTR;
1700 typedef struct spool_q_getprinterdriverdirectory
1702 uint32 name_ptr;
1703 UNISTR2 name;
1704 uint32 environment_ptr;
1705 UNISTR2 environment;
1706 uint32 level;
1707 RPC_BUFFER *buffer;
1708 uint32 offered;
1710 SPOOL_Q_GETPRINTERDRIVERDIR;
1712 typedef struct spool_r_getprinterdriverdirectory
1714 RPC_BUFFER *buffer;
1715 uint32 needed;
1716 WERROR status;
1718 SPOOL_R_GETPRINTERDRIVERDIR;
1720 typedef struct spool_q_addprintprocessor
1722 uint32 server_ptr;
1723 UNISTR2 server;
1724 UNISTR2 environment;
1725 UNISTR2 path;
1726 UNISTR2 name;
1728 SPOOL_Q_ADDPRINTPROCESSOR;
1730 typedef struct spool_r_addprintprocessor
1732 WERROR status;
1734 SPOOL_R_ADDPRINTPROCESSOR;
1737 typedef struct spool_q_enumprintprocessors
1739 uint32 name_ptr;
1740 UNISTR2 name;
1741 uint32 environment_ptr;
1742 UNISTR2 environment;
1743 uint32 level;
1744 RPC_BUFFER *buffer;
1745 uint32 offered;
1747 SPOOL_Q_ENUMPRINTPROCESSORS;
1749 typedef struct printprocessor_1
1751 UNISTR name;
1753 PRINTPROCESSOR_1;
1755 typedef struct spool_r_enumprintprocessors
1757 RPC_BUFFER *buffer;
1758 uint32 needed;
1759 uint32 returned;
1760 WERROR status;
1762 SPOOL_R_ENUMPRINTPROCESSORS;
1764 typedef struct spool_q_enumprintprocdatatypes
1766 uint32 name_ptr;
1767 UNISTR2 name;
1768 uint32 processor_ptr;
1769 UNISTR2 processor;
1770 uint32 level;
1771 RPC_BUFFER *buffer;
1772 uint32 offered;
1774 SPOOL_Q_ENUMPRINTPROCDATATYPES;
1776 typedef struct ppdatatype_1
1778 UNISTR name;
1780 PRINTPROCDATATYPE_1;
1782 typedef struct spool_r_enumprintprocdatatypes
1784 RPC_BUFFER *buffer;
1785 uint32 needed;
1786 uint32 returned;
1787 WERROR status;
1789 SPOOL_R_ENUMPRINTPROCDATATYPES;
1791 typedef struct printmonitor_1
1793 UNISTR name;
1795 PRINTMONITOR_1;
1797 typedef struct printmonitor_2
1799 UNISTR name;
1800 UNISTR environment;
1801 UNISTR dll_name;
1803 PRINTMONITOR_2;
1805 typedef struct spool_q_enumprintmonitors
1807 uint32 name_ptr;
1808 UNISTR2 name;
1809 uint32 level;
1810 RPC_BUFFER *buffer;
1811 uint32 offered;
1813 SPOOL_Q_ENUMPRINTMONITORS;
1815 typedef struct spool_r_enumprintmonitors
1817 RPC_BUFFER *buffer;
1818 uint32 needed;
1819 uint32 returned;
1820 WERROR status;
1822 SPOOL_R_ENUMPRINTMONITORS;
1825 typedef struct spool_q_enumprinterdata
1827 POLICY_HND handle;
1828 uint32 index;
1829 uint32 valuesize;
1830 uint32 datasize;
1832 SPOOL_Q_ENUMPRINTERDATA;
1834 typedef struct spool_r_enumprinterdata
1836 uint32 valuesize;
1837 uint16 *value;
1838 uint32 realvaluesize;
1839 uint32 type;
1840 uint32 datasize;
1841 uint8 *data;
1842 uint32 realdatasize;
1843 WERROR status;
1845 SPOOL_R_ENUMPRINTERDATA;
1847 typedef struct spool_q_setprinterdata
1849 POLICY_HND handle;
1850 UNISTR2 value;
1851 uint32 type;
1852 uint32 max_len;
1853 uint8 *data;
1854 uint32 real_len;
1855 uint32 numeric_data;
1857 SPOOL_Q_SETPRINTERDATA;
1859 typedef struct spool_r_setprinterdata
1861 WERROR status;
1863 SPOOL_R_SETPRINTERDATA;
1865 typedef struct spool_q_resetprinter
1867 POLICY_HND handle;
1868 uint32 datatype_ptr;
1869 UNISTR2 datatype;
1870 DEVMODE_CTR devmode_ctr;
1872 } SPOOL_Q_RESETPRINTER;
1874 typedef struct spool_r_resetprinter
1876 WERROR status;
1878 SPOOL_R_RESETPRINTER;
1882 typedef struct _form
1884 uint32 flags;
1885 uint32 name_ptr;
1886 uint32 size_x;
1887 uint32 size_y;
1888 uint32 left;
1889 uint32 top;
1890 uint32 right;
1891 uint32 bottom;
1892 UNISTR2 name;
1894 FORM;
1896 typedef struct spool_q_addform
1898 POLICY_HND handle;
1899 uint32 level;
1900 uint32 level2; /* This should really be part of the FORM structure */
1901 FORM form;
1903 SPOOL_Q_ADDFORM;
1905 typedef struct spool_r_addform
1907 WERROR status;
1909 SPOOL_R_ADDFORM;
1911 typedef struct spool_q_setform
1913 POLICY_HND handle;
1914 UNISTR2 name;
1915 uint32 level;
1916 uint32 level2;
1917 FORM form;
1919 SPOOL_Q_SETFORM;
1921 typedef struct spool_r_setform
1923 WERROR status;
1925 SPOOL_R_SETFORM;
1927 typedef struct spool_q_deleteform
1929 POLICY_HND handle;
1930 UNISTR2 name;
1932 SPOOL_Q_DELETEFORM;
1934 typedef struct spool_r_deleteform
1936 WERROR status;
1938 SPOOL_R_DELETEFORM;
1940 typedef struct spool_q_getjob
1942 POLICY_HND handle;
1943 uint32 jobid;
1944 uint32 level;
1945 RPC_BUFFER *buffer;
1946 uint32 offered;
1948 SPOOL_Q_GETJOB;
1950 typedef struct pjob_info_info
1952 union
1954 JOB_INFO_1 *job_info_1;
1955 JOB_INFO_2 *job_info_2;
1956 void *info;
1958 job;
1961 PJOB_INFO;
1963 typedef struct spool_r_getjob
1965 RPC_BUFFER *buffer;
1966 uint32 needed;
1967 WERROR status;
1969 SPOOL_R_GETJOB;
1971 typedef struct spool_q_replyopenprinter
1973 UNISTR2 string;
1974 uint32 printer;
1975 uint32 type;
1976 uint32 unknown0;
1977 uint32 unknown1;
1979 SPOOL_Q_REPLYOPENPRINTER;
1981 typedef struct spool_r_replyopenprinter
1983 POLICY_HND handle;
1984 WERROR status;
1986 SPOOL_R_REPLYOPENPRINTER;
1988 typedef struct spool_q_routerreplyprinter
1990 POLICY_HND handle;
1991 uint32 condition;
1992 uint32 unknown1; /* 0x00000001 */
1993 uint32 change_id;
1994 uint8 unknown2[5]; /* 0x0000000001 */
1996 SPOOL_Q_ROUTERREPLYPRINTER;
1998 typedef struct spool_r_routerreplyprinter
2000 WERROR status;
2002 SPOOL_R_ROUTERREPLYPRINTER;
2004 typedef struct spool_q_replycloseprinter
2006 POLICY_HND handle;
2008 SPOOL_Q_REPLYCLOSEPRINTER;
2010 typedef struct spool_r_replycloseprinter
2012 POLICY_HND handle;
2013 WERROR status;
2015 SPOOL_R_REPLYCLOSEPRINTER;
2017 typedef struct spool_q_rrpcn
2019 POLICY_HND handle;
2020 uint32 change_low;
2021 uint32 change_high;
2022 uint32 unknown0;
2023 uint32 unknown1;
2024 uint32 info_ptr;
2025 SPOOL_NOTIFY_INFO info;
2027 SPOOL_Q_REPLY_RRPCN;
2029 typedef struct spool_r_rrpcn
2031 uint32 unknown0;
2032 WERROR status;
2034 SPOOL_R_REPLY_RRPCN;
2036 typedef struct spool_q_getprinterdataex
2038 POLICY_HND handle;
2039 UNISTR2 keyname;
2040 UNISTR2 valuename;
2041 uint32 size;
2043 SPOOL_Q_GETPRINTERDATAEX;
2045 typedef struct spool_r_getprinterdataex
2047 uint32 type;
2048 uint32 size;
2049 uint8 *data;
2050 uint32 needed;
2051 WERROR status;
2053 SPOOL_R_GETPRINTERDATAEX;
2055 typedef struct spool_q_setprinterdataex
2057 POLICY_HND handle;
2058 UNISTR2 key;
2059 UNISTR2 value;
2060 uint32 type;
2061 uint32 max_len;
2062 uint8 *data;
2063 uint32 real_len;
2064 uint32 numeric_data;
2066 SPOOL_Q_SETPRINTERDATAEX;
2068 typedef struct spool_r_setprinterdataex
2070 WERROR status;
2072 SPOOL_R_SETPRINTERDATAEX;
2075 typedef struct spool_q_deleteprinterdataex
2077 POLICY_HND handle;
2078 UNISTR2 keyname;
2079 UNISTR2 valuename;
2081 SPOOL_Q_DELETEPRINTERDATAEX;
2083 typedef struct spool_r_deleteprinterdataex
2085 WERROR status;
2087 SPOOL_R_DELETEPRINTERDATAEX;
2090 typedef struct spool_q_enumprinterkey
2092 POLICY_HND handle;
2093 UNISTR2 key;
2094 uint32 size;
2096 SPOOL_Q_ENUMPRINTERKEY;
2098 typedef struct spool_r_enumprinterkey
2100 BUFFER5 keys;
2101 uint32 needed; /* in bytes */
2102 WERROR status;
2104 SPOOL_R_ENUMPRINTERKEY;
2106 typedef struct spool_q_deleteprinterkey
2108 POLICY_HND handle;
2109 UNISTR2 keyname;
2111 SPOOL_Q_DELETEPRINTERKEY;
2113 typedef struct spool_r_deleteprinterkey
2115 WERROR status;
2117 SPOOL_R_DELETEPRINTERKEY;
2119 typedef struct printer_enum_values
2121 UNISTR valuename;
2122 uint32 value_len;
2123 uint32 type;
2124 uint8 *data;
2125 uint32 data_len;
2128 PRINTER_ENUM_VALUES;
2130 typedef struct printer_enum_values_ctr
2132 uint32 size;
2133 uint32 size_of_array;
2134 PRINTER_ENUM_VALUES *values;
2136 PRINTER_ENUM_VALUES_CTR;
2138 typedef struct spool_q_enumprinterdataex
2140 POLICY_HND handle;
2141 UNISTR2 key;
2142 uint32 size;
2144 SPOOL_Q_ENUMPRINTERDATAEX;
2146 typedef struct spool_r_enumprinterdataex
2148 PRINTER_ENUM_VALUES_CTR ctr;
2149 uint32 needed;
2150 uint32 returned;
2151 WERROR status;
2153 SPOOL_R_ENUMPRINTERDATAEX;
2155 typedef struct printprocessor_directory_1
2157 UNISTR name;
2159 PRINTPROCESSOR_DIRECTORY_1;
2161 typedef struct spool_q_getprintprocessordirectory
2163 UNISTR2 name;
2164 UNISTR2 environment;
2165 uint32 level;
2166 RPC_BUFFER *buffer;
2167 uint32 offered;
2169 SPOOL_Q_GETPRINTPROCESSORDIRECTORY;
2171 typedef struct spool_r_getprintprocessordirectory
2173 RPC_BUFFER *buffer;
2174 uint32 needed;
2175 WERROR status;
2177 SPOOL_R_GETPRINTPROCESSORDIRECTORY;
2179 /**************************************/
2181 #define MAX_PORTNAME 64
2182 #define MAX_NETWORK_NAME 49
2183 #define MAX_SNMP_COMM_NAME 33
2184 #define MAX_QUEUE_NAME 33
2185 #define MAX_IPADDR_STRING 17
2187 typedef struct {
2188 uint16 portname[MAX_PORTNAME];
2189 uint32 version;
2190 uint32 protocol;
2191 uint32 size;
2192 uint32 reserved;
2193 uint16 hostaddress[MAX_NETWORK_NAME];
2194 uint16 snmpcommunity[MAX_SNMP_COMM_NAME];
2195 uint32 dblspool;
2196 uint16 queue[MAX_QUEUE_NAME];
2197 uint16 ipaddress[MAX_IPADDR_STRING];
2198 uint32 port;
2199 uint32 snmpenabled;
2200 uint32 snmpdevindex;
2201 } SPOOL_PORT_DATA_1;
2203 typedef struct {
2204 POLICY_HND handle;
2205 UNISTR2 dataname;
2206 RPC_BUFFER indata;
2207 uint32 indata_len;
2208 uint32 offered;
2209 uint32 unknown;
2210 } SPOOL_Q_XCVDATAPORT;
2212 typedef struct {
2213 RPC_BUFFER outdata;
2214 uint32 needed;
2215 uint32 unknown;
2216 WERROR status;
2217 } SPOOL_R_XCVDATAPORT;
2219 #define PRINTER_DRIVER_VERSION 2
2220 #define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
2222 #endif /* _RPC_SPOOLSS_H */