2 Unix SMB/CIFS implementation.
3 SMB parameters and setup
4 Copyright (C) Andrew Tridgell 1992-2000,
5 Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
6 Copyright (C) Jean Francois Micouleau 1998-2000.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef _RPC_SPOOLSS_H /* _RPC_SPOOLSS_H */
24 #define _RPC_SPOOLSS_H
29 /* spoolss pipe: this are the calls which are not implemented ...
30 #define SPOOLSS_OPENPRINTER 0x01
31 #define SPOOLSS_GETPRINTERDRIVER 0x0b
32 #define SPOOLSS_READPRINTER 0x16
33 #define SPOOLSS_WAITFORPRINTERCHANGE 0x1c
34 #define SPOOLSS_ADDPORT 0x25
35 #define SPOOLSS_CONFIGUREPORT 0x26
36 #define SPOOLSS_DELETEPORT 0x27
37 #define SPOOLSS_CREATEPRINTERIC 0x28
38 #define SPOOLSS_PLAYGDISCRIPTONPRINTERIC 0x29
39 #define SPOOLSS_DELETEPRINTERIC 0x2a
40 #define SPOOLSS_ADDPRINTERCONNECTION 0x2b
41 #define SPOOLSS_DELETEPRINTERCONNECTION 0x2c
42 #define SPOOLSS_PRINTERMESSAGEBOX 0x2d
43 #define SPOOLSS_ADDMONITOR 0x2e
44 #define SPOOLSS_DELETEMONITOR 0x2f
45 #define SPOOLSS_DELETEPRINTPROCESSOR 0x30
46 #define SPOOLSS_ADDPRINTPROVIDOR 0x31
47 #define SPOOLSS_DELETEPRINTPROVIDOR 0x32
48 #define SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION 0x36
49 #define SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION 0x37
50 #define SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD 0x39
51 #define SPOOLSS_ADDPORTEX 0x3d
52 #define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION0x3e
53 #define SPOOLSS_SPOOLERINIT 0x3f
54 #define SPOOLSS_RESETPRINTEREX 0x40
55 #define SPOOLSS_DELETEPRINTERDATAEX 0x51
56 #define SPOOLSS_DELETEPRINTERDRIVEREX 0x54
57 #define SPOOLSS_ADDPRINTERDRIVEREX 0x59
60 /* those are implemented */
61 #define SPOOLSS_ENUMPRINTERS 0x00
62 #define SPOOLSS_SETJOB 0x02
63 #define SPOOLSS_GETJOB 0x03
64 #define SPOOLSS_ENUMJOBS 0x04
65 #define SPOOLSS_ADDPRINTER 0x05
66 #define SPOOLSS_DELETEPRINTER 0x06
67 #define SPOOLSS_SETPRINTER 0x07
68 #define SPOOLSS_GETPRINTER 0x08
69 #define SPOOLSS_ADDPRINTERDRIVER 0x09
70 #define SPOOLSS_ENUMPRINTERDRIVERS 0x0a
71 #define SPOOLSS_GETPRINTERDRIVERDIRECTORY 0x0c
72 #define SPOOLSS_DELETEPRINTERDRIVER 0x0d
73 #define SPOOLSS_ADDPRINTPROCESSOR 0x0e
74 #define SPOOLSS_ENUMPRINTPROCESSORS 0x0f
75 #define SPOOLSS_GETPRINTPROCESSORDIRECTORY 0x10
76 #define SPOOLSS_STARTDOCPRINTER 0x11
77 #define SPOOLSS_STARTPAGEPRINTER 0x12
78 #define SPOOLSS_WRITEPRINTER 0x13
79 #define SPOOLSS_ENDPAGEPRINTER 0x14
80 #define SPOOLSS_ABORTPRINTER 0x15
81 #define SPOOLSS_ENDDOCPRINTER 0x17
82 #define SPOOLSS_ADDJOB 0x18
83 #define SPOOLSS_SCHEDULEJOB 0x19
84 #define SPOOLSS_GETPRINTERDATA 0x1a
85 #define SPOOLSS_SETPRINTERDATA 0x1b
86 #define SPOOLSS_CLOSEPRINTER 0x1d
87 #define SPOOLSS_ADDFORM 0x1e
88 #define SPOOLSS_DELETEFORM 0x1f
89 #define SPOOLSS_GETFORM 0x20
90 #define SPOOLSS_SETFORM 0x21
91 #define SPOOLSS_ENUMFORMS 0x22
92 #define SPOOLSS_ENUMPORTS 0x23
93 #define SPOOLSS_ENUMMONITORS 0x24
94 #define SPOOLSS_ENUMPRINTPROCDATATYPES 0x33
95 #define SPOOLSS_RESETPRINTER 0x34
96 #define SPOOLSS_GETPRINTERDRIVER2 0x35
97 #define SPOOLSS_FCPN 0x38 /* FindClosePrinterNotify */
98 #define SPOOLSS_REPLYOPENPRINTER 0x3a
99 #define SPOOLSS_ROUTERREPLYPRINTER 0x3b
100 #define SPOOLSS_REPLYCLOSEPRINTER 0x3c
101 #define SPOOLSS_RFFPCNEX 0x41 /* RemoteFindFirstPrinterChangeNotifyEx */
102 #define SPOOLSS_RRPCN 0x42 /* RouteRefreshPrinterChangeNotification */
103 #define SPOOLSS_RFNPCNEX 0x43 /* RemoteFindNextPrinterChangeNotifyEx */
104 #define SPOOLSS_OPENPRINTEREX 0x45
105 #define SPOOLSS_ADDPRINTEREX 0x46
106 #define SPOOLSS_ENUMPRINTERDATA 0x48
107 #define SPOOLSS_DELETEPRINTERDATA 0x49
108 #define SPOOLSS_SETPRINTERDATAEX 0x4d
109 #define SPOOLSS_GETPRINTERDATAEX 0x4e
110 #define SPOOLSS_ENUMPRINTERDATAEX 0x4f
111 #define SPOOLSS_ENUMPRINTERKEY 0x50
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_PAUSED 0x00000001
121 #define PRINTER_STATUS_ERROR 0x00000002
122 #define PRINTER_STATUS_PENDING_DELETION 0x00000004
123 #define PRINTER_STATUS_PAPER_JAM 0x00000008
125 #define PRINTER_STATUS_PAPER_OUT 0x00000010
126 #define PRINTER_STATUS_MANUAL_FEED 0x00000020
127 #define PRINTER_STATUS_PAPER_PROBLEM 0x00000040
128 #define PRINTER_STATUS_OFFLINE 0x00000080
130 #define PRINTER_STATUS_IO_ACTIVE 0x00000100
131 #define PRINTER_STATUS_BUSY 0x00000200
132 #define PRINTER_STATUS_PRINTING 0x00000400
133 #define PRINTER_STATUS_OUTPUT_BIN_FULL 0x00000800
135 #define PRINTER_STATUS_NOT_AVAILABLE 0x00001000
136 #define PRINTER_STATUS_WAITING 0x00002000
137 #define PRINTER_STATUS_PROCESSING 0x00004000
138 #define PRINTER_STATUS_INITIALIZING 0x00008000
140 #define PRINTER_STATUS_WARMING_UP 0x00010000
141 #define PRINTER_STATUS_TONER_LOW 0x00020000
142 #define PRINTER_STATUS_NO_TONER 0x00040000
143 #define PRINTER_STATUS_PAGE_PUNT 0x00080000
145 #define PRINTER_STATUS_USER_INTERVENTION 0x00100000
146 #define PRINTER_STATUS_OUT_OF_MEMORY 0x00200000
147 #define PRINTER_STATUS_DOOR_OPEN 0x00400000
148 #define PRINTER_STATUS_SERVER_UNKNOWN 0x00800000
150 #define PRINTER_STATUS_POWER_SAVE 0x01000000
152 #define SERVER_ACCESS_ADMINISTER 0x00000001
153 #define SERVER_ACCESS_ENUMERATE 0x00000002
154 #define PRINTER_ACCESS_ADMINISTER 0x00000004
155 #define PRINTER_ACCESS_USE 0x00000008
156 #define JOB_ACCESS_ADMINISTER 0x00000010
158 /* JOB status codes. */
160 #define JOB_STATUS_PAUSED 0x001
161 #define JOB_STATUS_ERROR 0x002
162 #define JOB_STATUS_DELETING 0x004
163 #define JOB_STATUS_SPOOLING 0x008
164 #define JOB_STATUS_PRINTING 0x010
165 #define JOB_STATUS_OFFLINE 0x020
166 #define JOB_STATUS_PAPEROUT 0x040
167 #define JOB_STATUS_PRINTED 0x080
168 #define JOB_STATUS_DELETED 0x100
169 #define JOB_STATUS_BLOCKED 0x200
170 #define JOB_STATUS_USER_INTERVENTION 0x400
172 /* ACE masks for the various print permissions */
174 #define PRINTER_ACE_FULL_CONTROL GENERIC_ALL_ACCESS
175 #define PRINTER_ACE_MANAGE_DOCUMENTS READ_CONTROL_ACCESS
176 #define PRINTER_ACE_PRINT \
177 (GENERIC_READ_ACCESS | GENERIC_WRITE_ACCESS | GENERIC_EXECUTE_ACCESS)
179 /* Access rights for print servers */
180 #define SERVER_ALL_ACCESS STANDARD_RIGHTS_REQUIRED_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
181 #define SERVER_READ STANDARD_RIGHTS_READ_ACCESS|SERVER_ACCESS_ENUMERATE
182 #define SERVER_WRITE STANDARD_RIGHTS_WRITE_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
183 #define SERVER_EXECUTE STANDARD_RIGHTS_EXECUTE_ACCESS|SERVER_ACCESS_ENUMERATE
185 /* Access rights for printers */
186 #define PRINTER_ALL_ACCESS STANDARD_RIGHTS_REQUIRED_ACCESS|PRINTER_ACCESS_ADMINISTER|PRINTER_ACCESS_USE
187 #define PRINTER_READ STANDARD_RIGHTS_READ_ACCESS|PRINTER_ACCESS_USE
188 #define PRINTER_WRITE STANDARD_RIGHTS_WRITE_ACCESS|PRINTER_ACCESS_USE
189 #define PRINTER_EXECUTE STANDARD_RIGHTS_EXECUTE_ACCESS|PRINTER_ACCESS_USE
191 /* Access rights for jobs */
192 #define JOB_ALL_ACCESS STANDARD_RIGHTS_REQUIRED_ACCESS|JOB_ACCESS_ADMINISTER
193 #define JOB_READ STANDARD_RIGHTS_READ_ACCESS|JOB_ACCESS_ADMINISTER
194 #define JOB_WRITE STANDARD_RIGHTS_WRITE_ACCESS|JOB_ACCESS_ADMINISTER
195 #define JOB_EXECUTE STANDARD_RIGHTS_EXECUTE_ACCESS|JOB_ACCESS_ADMINISTER
201 #define PRINTER_NOTIFY_TYPE 0x00
202 #define JOB_NOTIFY_TYPE 0x01
204 #define MAX_PRINTER_NOTIFY 26
205 #define MAX_JOB_NOTIFY 24
207 #define MAX_NOTIFY_TYPE_FOR_NOW 26
209 #define PRINTER_NOTIFY_SERVER_NAME 0x00
210 #define PRINTER_NOTIFY_PRINTER_NAME 0x01
211 #define PRINTER_NOTIFY_SHARE_NAME 0x02
212 #define PRINTER_NOTIFY_PORT_NAME 0x03
213 #define PRINTER_NOTIFY_DRIVER_NAME 0x04
214 #define PRINTER_NOTIFY_COMMENT 0x05
215 #define PRINTER_NOTIFY_LOCATION 0x06
216 #define PRINTER_NOTIFY_DEVMODE 0x07
217 #define PRINTER_NOTIFY_SEPFILE 0x08
218 #define PRINTER_NOTIFY_PRINT_PROCESSOR 0x09
219 #define PRINTER_NOTIFY_PARAMETERS 0x0A
220 #define PRINTER_NOTIFY_DATATYPE 0x0B
221 #define PRINTER_NOTIFY_SECURITY_DESCRIPTOR 0x0C
222 #define PRINTER_NOTIFY_ATTRIBUTES 0x0D
223 #define PRINTER_NOTIFY_PRIORITY 0x0E
224 #define PRINTER_NOTIFY_DEFAULT_PRIORITY 0x0F
225 #define PRINTER_NOTIFY_START_TIME 0x10
226 #define PRINTER_NOTIFY_UNTIL_TIME 0x11
227 #define PRINTER_NOTIFY_STATUS 0x12
228 #define PRINTER_NOTIFY_STATUS_STRING 0x13
229 #define PRINTER_NOTIFY_CJOBS 0x14
230 #define PRINTER_NOTIFY_AVERAGE_PPM 0x15
231 #define PRINTER_NOTIFY_TOTAL_PAGES 0x16
232 #define PRINTER_NOTIFY_PAGES_PRINTED 0x17
233 #define PRINTER_NOTIFY_TOTAL_BYTES 0x18
234 #define PRINTER_NOTIFY_BYTES_PRINTED 0x19
236 #define JOB_NOTIFY_PRINTER_NAME 0x00
237 #define JOB_NOTIFY_MACHINE_NAME 0x01
238 #define JOB_NOTIFY_PORT_NAME 0x02
239 #define JOB_NOTIFY_USER_NAME 0x03
240 #define JOB_NOTIFY_NOTIFY_NAME 0x04
241 #define JOB_NOTIFY_DATATYPE 0x05
242 #define JOB_NOTIFY_PRINT_PROCESSOR 0x06
243 #define JOB_NOTIFY_PARAMETERS 0x07
244 #define JOB_NOTIFY_DRIVER_NAME 0x08
245 #define JOB_NOTIFY_DEVMODE 0x09
246 #define JOB_NOTIFY_STATUS 0x0A
247 #define JOB_NOTIFY_STATUS_STRING 0x0B
248 #define JOB_NOTIFY_SECURITY_DESCRIPTOR 0x0C
249 #define JOB_NOTIFY_DOCUMENT 0x0D
250 #define JOB_NOTIFY_PRIORITY 0x0E
251 #define JOB_NOTIFY_POSITION 0x0F
252 #define JOB_NOTIFY_SUBMITTED 0x10
253 #define JOB_NOTIFY_START_TIME 0x11
254 #define JOB_NOTIFY_UNTIL_TIME 0x12
255 #define JOB_NOTIFY_TIME 0x13
256 #define JOB_NOTIFY_TOTAL_PAGES 0x14
257 #define JOB_NOTIFY_PAGES_PRINTED 0x15
258 #define JOB_NOTIFY_TOTAL_BYTES 0x16
259 #define JOB_NOTIFY_BYTES_PRINTED 0x17
261 #define PRINTER_NOTIFY_OPTIONS_REFRESH 0x01
263 #define PRINTER_CHANGE_ADD_PRINTER 0x00000001
264 #define PRINTER_CHANGE_SET_PRINTER 0x00000002
265 #define PRINTER_CHANGE_DELETE_PRINTER 0x00000004
266 #define PRINTER_CHANGE_FAILED_CONNECTION_PRINTER 0x00000008
267 #define PRINTER_CHANGE_PRINTER (PRINTER_CHANGE_ADD_PRINTER | \
268 PRINTER_CHANGE_SET_PRINTER | \
269 PRINTER_CHANGE_DELETE_PRINTER | \
270 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER )
272 #define PRINTER_CHANGE_ADD_JOB 0x00000100
273 #define PRINTER_CHANGE_SET_JOB 0x00000200
274 #define PRINTER_CHANGE_DELETE_JOB 0x00000400
275 #define PRINTER_CHANGE_WRITE_JOB 0x00000800
276 #define PRINTER_CHANGE_JOB (PRINTER_CHANGE_ADD_JOB | \
277 PRINTER_CHANGE_SET_JOB | \
278 PRINTER_CHANGE_DELETE_JOB | \
279 PRINTER_CHANGE_WRITE_JOB )
281 #define PRINTER_CHANGE_ADD_FORM 0x00010000
282 #define PRINTER_CHANGE_SET_FORM 0x00020000
283 #define PRINTER_CHANGE_DELETE_FORM 0x00040000
284 #define PRINTER_CHANGE_FORM (PRINTER_CHANGE_ADD_FORM | \
285 PRINTER_CHANGE_SET_FORM | \
286 PRINTER_CHANGE_DELETE_FORM )
288 #define PRINTER_CHANGE_ADD_PORT 0x00100000
289 #define PRINTER_CHANGE_CONFIGURE_PORT 0x00200000
290 #define PRINTER_CHANGE_DELETE_PORT 0x00400000
291 #define PRINTER_CHANGE_PORT (PRINTER_CHANGE_ADD_PORT | \
292 PRINTER_CHANGE_CONFIGURE_PORT | \
293 PRINTER_CHANGE_DELETE_PORT )
295 #define PRINTER_CHANGE_ADD_PRINT_PROCESSOR 0x01000000
296 #define PRINTER_CHANGE_DELETE_PRINT_PROCESSOR 0x04000000
297 #define PRINTER_CHANGE_PRINT_PROCESSOR (PRINTER_CHANGE_ADD_PRINT_PROCESSOR | \
298 PRINTER_CHANGE_DELETE_PRINT_PROCESSOR )
300 #define PRINTER_CHANGE_ADD_PRINTER_DRIVER 0x10000000
301 #define PRINTER_CHANGE_SET_PRINTER_DRIVER 0x20000000
302 #define PRINTER_CHANGE_DELETE_PRINTER_DRIVER 0x40000000
303 #define PRINTER_CHANGE_PRINTER_DRIVER (PRINTER_CHANGE_ADD_PRINTER_DRIVER | \
304 PRINTER_CHANGE_SET_PRINTER_DRIVER | \
305 PRINTER_CHANGE_DELETE_PRINTER_DRIVER )
307 #define PRINTER_CHANGE_TIMEOUT 0x80000000
308 #define PRINTER_CHANGE_ALL (PRINTER_CHANGE_JOB | \
309 PRINTER_CHANGE_FORM | \
310 PRINTER_CHANGE_PORT | \
311 PRINTER_CHANGE_PRINT_PROCESSOR | \
312 PRINTER_CHANGE_PRINTER_DRIVER )
314 #define PRINTER_NOTIFY_INFO_DISCARDED 0x1
317 * Set of macros for flagging what changed in the PRINTER_INFO_2 struct
318 * when sending messages to other smbd's
320 #define PRINTER_MESSAGE_NULL 0x00000000
321 #define PRINTER_MESSAGE_DRIVER 0x00000001
322 #define PRINTER_MESSAGE_COMMENT 0x00000002
323 #define PRINTER_MESSAGE_PRINTERNAME 0x00000004
324 #define PRINTER_MESSAGE_LOCATION 0x00000008
325 #define PRINTER_MESSAGE_DEVMODE 0x00000010 /* not curently supported */
326 #define PRINTER_MESSAGE_SEPFILE 0x00000020
327 #define PRINTER_MESSAGE_PRINTPROC 0x00000040
328 #define PRINTER_MESSAGE_PARAMS 0x00000080
329 #define PRINTER_MESSAGE_DATATYPE 0x00000100
330 #define PRINTER_MESSAGE_SECDESC 0x00000200
331 #define PRINTER_MESSAGE_CJOBS 0x00000400
332 #define PRINTER_MESSAGE_PORT 0x00000800
333 #define PRINTER_MESSAGE_SHARENAME 0x00001000
334 #define PRINTER_MESSAGE_ATTRIBUTES 0x00002000
336 typedef struct printer_message_info {
337 uint32 low; /* PRINTER_CHANGE_XXX */
338 uint32 high; /* PRINTER_CHANGE_XXX */
339 fstring printer_name;
340 uint32 flags; /* PRINTER_MESSAGE_XXX */
342 PRINTER_MESSAGE_INFO;
345 * The printer attributes.
346 * I #defined all of them (grabbed form MSDN)
348 * ( SHARED | NETWORK | RAW_ONLY )
349 * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
352 #define PRINTER_ATTRIBUTE_QUEUED 0x00000001
353 #define PRINTER_ATTRIBUTE_DIRECT 0x00000002
354 #define PRINTER_ATTRIBUTE_DEFAULT 0x00000004
355 #define PRINTER_ATTRIBUTE_SHARED 0x00000008
357 #define PRINTER_ATTRIBUTE_NETWORK 0x00000010
358 #define PRINTER_ATTRIBUTE_HIDDEN 0x00000020
359 #define PRINTER_ATTRIBUTE_LOCAL 0x00000040
360 #define PRINTER_ATTRIBUTE_ENABLE_DEVQ 0x00000080
362 #define PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS 0x00000100
363 #define PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST 0x00000200
364 #define PRINTER_ATTRIBUTE_WORK_OFFLINE 0x00000400
365 #define PRINTER_ATTRIBUTE_ENABLE_BIDI 0x00000800
367 #define PRINTER_ATTRIBUTE_RAW_ONLY 0x00001000
369 #define NO_PRIORITY 0
370 #define MAX_PRIORITY 99
371 #define MIN_PRIORITY 1
372 #define DEF_PRIORITY 1
374 /* the flags of the query */
375 #define PRINTER_ENUM_DEFAULT 0x00000001
376 #define PRINTER_ENUM_LOCAL 0x00000002
377 #define PRINTER_ENUM_CONNECTIONS 0x00000004
378 #define PRINTER_ENUM_FAVORITE 0x00000004
379 #define PRINTER_ENUM_NAME 0x00000008
380 #define PRINTER_ENUM_REMOTE 0x00000010
381 #define PRINTER_ENUM_SHARED 0x00000020
382 #define PRINTER_ENUM_NETWORK 0x00000040
384 /* the flags of each printers */
385 #define PRINTER_ENUM_UNKNOWN_8 0x00000008
386 #define PRINTER_ENUM_EXPAND 0x00004000
387 #define PRINTER_ENUM_CONTAINER 0x00008000
388 #define PRINTER_ENUM_ICONMASK 0x00ff0000
389 #define PRINTER_ENUM_ICON1 0x00010000
390 #define PRINTER_ENUM_ICON2 0x00020000
391 #define PRINTER_ENUM_ICON3 0x00040000
392 #define PRINTER_ENUM_ICON4 0x00080000
393 #define PRINTER_ENUM_ICON5 0x00100000
394 #define PRINTER_ENUM_ICON6 0x00200000
395 #define PRINTER_ENUM_ICON7 0x00400000
396 #define PRINTER_ENUM_ICON8 0x00800000
398 /* this struct is undocumented */
399 /* thanks to the ddk ... */
400 typedef struct spool_user_1
402 uint32 size; /* length of user_name & client_name + 2? */
403 uint32 client_name_ptr;
404 uint32 user_name_ptr;
414 typedef struct spool_user_ctr_info
423 * various bits in the DEVICEMODE.fields member
426 #define DEVMODE_ORIENTATION 0x00000001
427 #define DEVMODE_PAPERSIZE 0x00000002
428 #define DEVMODE_PAPERLENGTH 0x00000004
429 #define DEVMODE_PAPERWIDTH 0x00000008
430 #define DEVMODE_SCALE 0x00000010
431 #define DEVMODE_POSITION 0x00000020
432 #define DEVMODE_NUP 0x00000040
433 #define DEVMODE_COPIES 0x00000100
434 #define DEVMODE_DEFAULTSOURCE 0x00000200
435 #define DEVMODE_PRINTQUALITY 0x00000400
436 #define DEVMODE_COLOR 0x00000800
437 #define DEVMODE_DUPLEX 0x00001000
438 #define DEVMODE_YRESOLUTION 0x00002000
439 #define DEVMODE_TTOPTION 0x00004000
440 #define DEVMODE_COLLATE 0x00008000
441 #define DEVMODE_FORMNAME 0x00010000
442 #define DEVMODE_LOGPIXELS 0x00020000
443 #define DEVMODE_BITSPERPEL 0x00040000
444 #define DEVMODE_PELSWIDTH 0x00080000
445 #define DEVMODE_PELSHEIGHT 0x00100000
446 #define DEVMODE_DISPLAYFLAGS 0x00200000
447 #define DEVMODE_DISPLAYFREQUENCY 0x00400000
448 #define DEVMODE_ICMMETHOD 0x00800000
449 #define DEVMODE_ICMINTENT 0x01000000
450 #define DEVMODE_MEDIATYPE 0x02000000
451 #define DEVMODE_DITHERTYPE 0x04000000
452 #define DEVMODE_PANNINGWIDTH 0x08000000
453 #define DEVMODE_PANNINGHEIGHT 0x10000000
457 * Devicemode structure
460 typedef struct devicemode
464 uint16 driverversion;
474 uint16 defaultsource;
487 uint32 displayfrequency;
495 uint32 panningheight;
500 typedef struct _devmode_cont
508 typedef struct _printer_default
512 DEVMODE_CTR devmode_cont;
513 uint32 access_required;
517 /* SPOOL_Q_OPEN_PRINTER_EX request to open a printer */
518 typedef struct spool_q_open_printer_ex
520 uint32 printername_ptr;
522 PRINTER_DEFAULT printer_default;
524 SPOOL_USER_CTR user_ctr;
526 SPOOL_Q_OPEN_PRINTER_EX;
528 /* SPOOL_R_OPEN_PRINTER_EX reply to an open printer */
529 typedef struct spool_r_open_printer_ex
531 POLICY_HND handle; /* handle used along all transactions (20*uint8) */
534 SPOOL_R_OPEN_PRINTER_EX;
536 typedef struct spool_notify_option_type
545 uint16 fields[MAX_NOTIFY_TYPE_FOR_NOW];
547 SPOOL_NOTIFY_OPTION_TYPE;
549 typedef struct spool_notify_option_type_ctr
552 SPOOL_NOTIFY_OPTION_TYPE *type;
554 SPOOL_NOTIFY_OPTION_TYPE_CTR;
558 typedef struct s_header_type
570 typedef struct new_buffer
576 uint32 string_at_end;
580 typedef struct spool_q_getprinterdata
586 SPOOL_Q_GETPRINTERDATA;
588 typedef struct spool_r_getprinterdata
596 SPOOL_R_GETPRINTERDATA;
598 typedef struct spool_q_deleteprinterdata
603 SPOOL_Q_DELETEPRINTERDATA;
605 typedef struct spool_r_deleteprinterdata
609 SPOOL_R_DELETEPRINTERDATA;
611 typedef struct spool_q_closeprinter
615 SPOOL_Q_CLOSEPRINTER;
617 typedef struct spool_r_closeprinter
622 SPOOL_R_CLOSEPRINTER;
624 typedef struct spool_q_startpageprinter
628 SPOOL_Q_STARTPAGEPRINTER;
630 typedef struct spool_r_startpageprinter
634 SPOOL_R_STARTPAGEPRINTER;
636 typedef struct spool_q_endpageprinter
640 SPOOL_Q_ENDPAGEPRINTER;
642 typedef struct spool_r_endpageprinter
646 SPOOL_R_ENDPAGEPRINTER;
649 typedef struct spool_q_deleteprinterdriver
656 SPOOL_Q_DELETEPRINTERDRIVER;
658 typedef struct spool_r_deleteprinterdriver
662 SPOOL_R_DELETEPRINTERDRIVER;
665 typedef struct spool_doc_info_1
676 typedef struct spool_doc_info
679 DOC_INFO_1 doc_info_1;
683 typedef struct spool_doc_info_container
690 typedef struct spool_q_startdocprinter
693 DOC_INFO_CONTAINER doc_info_container;
695 SPOOL_Q_STARTDOCPRINTER;
697 typedef struct spool_r_startdocprinter
702 SPOOL_R_STARTDOCPRINTER;
704 typedef struct spool_q_enddocprinter
708 SPOOL_Q_ENDDOCPRINTER;
710 typedef struct spool_r_enddocprinter
714 SPOOL_R_ENDDOCPRINTER;
716 typedef struct spool_q_writeprinter
723 SPOOL_Q_WRITEPRINTER;
725 typedef struct spool_r_writeprinter
727 uint32 buffer_written;
730 SPOOL_R_WRITEPRINTER;
732 typedef struct spool_notify_option
737 uint32 option_type_ptr;
738 SPOOL_NOTIFY_OPTION_TYPE_CTR ctr;
742 typedef struct spool_notify_info_data
761 } SPOOL_NOTIFY_INFO_DATA;
763 typedef struct spool_notify_info
768 SPOOL_NOTIFY_INFO_DATA *data;
772 /* If the struct name looks obscure, yes it is ! */
773 /* RemoteFindFirstPrinterChangeNotificationEx query struct */
774 typedef struct spoolss_q_rffpcnex
779 uint32 localmachine_ptr;
780 UNISTR2 localmachine;
783 SPOOL_NOTIFY_OPTION *option;
787 typedef struct spool_r_rffpcnex
793 /* Remote Find Next Printer Change Notify Ex */
794 typedef struct spool_q_rfnpcnex
799 SPOOL_NOTIFY_OPTION *option;
803 typedef struct spool_r_rfnpcnex
806 SPOOL_NOTIFY_INFO info;
811 /* Find Close Printer Notify */
812 typedef struct spool_q_fcpn
818 typedef struct spool_r_fcpn
825 typedef struct printer_info_0
842 uint32 global_counter;
845 uint16 major_version;
846 uint16 build_version;
851 uint32 session_counter;
853 uint32 printer_errors;
874 typedef struct printer_info_1
883 typedef struct printer_info_2
894 UNISTR printprocessor;
900 uint32 defaultpriority;
909 typedef struct printer_info_3
916 typedef struct printer_info_4
924 typedef struct printer_info_5
929 uint32 device_not_selected_timeout;
930 uint32 transmission_retry_timeout;
934 typedef struct spool_q_enumprinters
937 uint32 servername_ptr;
943 SPOOL_Q_ENUMPRINTERS;
945 typedef struct printer_info_ctr_info
947 PRINTER_INFO_0 *printers_0;
948 PRINTER_INFO_1 *printers_1;
949 PRINTER_INFO_2 *printers_2;
950 PRINTER_INFO_3 *printers_3;
951 PRINTER_INFO_4 *printers_4;
952 PRINTER_INFO_5 *printers_5;
956 typedef struct spool_r_enumprinters
959 uint32 needed; /* bytes needed */
960 uint32 returned; /* number of printers */
963 SPOOL_R_ENUMPRINTERS;
966 typedef struct spool_q_getprinter
975 typedef struct printer_info_info
979 PRINTER_INFO_0 *info0;
980 PRINTER_INFO_1 *info1;
981 PRINTER_INFO_2 *info2;
986 typedef struct spool_r_getprinter
991 } SPOOL_R_GETPRINTER;
993 typedef struct driver_info_1
998 typedef struct driver_info_2
1002 UNISTR architecture;
1008 typedef struct driver_info_3
1012 UNISTR architecture;
1017 uint16 *dependentfiles;
1019 UNISTR defaultdatatype;
1023 typedef struct driver_info_6
1027 UNISTR architecture;
1032 uint16 *dependentfiles;
1034 UNISTR defaultdatatype;
1035 uint16* previousdrivernames;
1038 uint32 driver_version_low;
1039 uint32 driver_version_high;
1047 typedef struct driver_info_info
1049 DRIVER_INFO_1 *info1;
1050 DRIVER_INFO_2 *info2;
1051 DRIVER_INFO_3 *info3;
1052 DRIVER_INFO_6 *info6;
1056 typedef struct spool_q_getprinterdriver2
1059 uint32 architecture_ptr;
1060 UNISTR2 architecture;
1064 uint32 clientmajorversion;
1065 uint32 clientminorversion;
1067 SPOOL_Q_GETPRINTERDRIVER2;
1069 typedef struct spool_r_getprinterdriver2
1073 uint32 servermajorversion;
1074 uint32 serverminorversion;
1077 SPOOL_R_GETPRINTERDRIVER2;
1080 typedef struct add_jobinfo_1
1088 typedef struct spool_q_addjob
1097 typedef struct spool_r_addjob
1106 * I'm really wondering how many different time formats
1107 * I will have to cope with
1109 * JFM, 09/13/98 In a mad mood ;-(
1111 typedef struct systemtime
1120 uint16 milliseconds;
1124 typedef struct s_job_info_1
1137 uint32 pagesprinted;
1138 SYSTEMTIME submitted;
1142 typedef struct s_job_info_2
1151 UNISTR printprocessor;
1154 DEVICEMODE *devmode;
1156 /* SEC_DESC sec_desc;*/
1164 SYSTEMTIME submitted;
1166 uint32 pagesprinted;
1170 typedef struct spool_q_enumjobs
1181 typedef struct job_info_ctr_info
1185 JOB_INFO_1 **job_info_1;
1186 JOB_INFO_2 **job_info_2;
1192 typedef struct spool_r_enumjobs
1201 typedef struct spool_q_schedulejob
1206 SPOOL_Q_SCHEDULEJOB;
1208 typedef struct spool_r_schedulejob
1212 SPOOL_R_SCHEDULEJOB;
1214 typedef struct s_port_info_1
1220 typedef struct s_port_info_2
1223 UNISTR monitor_name;
1230 typedef struct spool_q_enumports
1240 typedef struct port_info_ctr_info
1244 PORT_INFO_1 *info_1;
1245 PORT_INFO_2 *info_2;
1252 typedef struct spool_r_enumports
1255 uint32 needed; /* bytes needed */
1256 uint32 returned; /* number of printers */
1261 #define JOB_CONTROL_PAUSE 1
1262 #define JOB_CONTROL_RESUME 2
1263 #define JOB_CONTROL_CANCEL 3
1264 #define JOB_CONTROL_RESTART 4
1265 #define JOB_CONTROL_DELETE 5
1267 typedef struct job_info_info
1271 JOB_INFO_1 job_info_1;
1272 JOB_INFO_2 job_info_2;
1279 typedef struct spool_q_setjob
1290 typedef struct spool_r_setjob
1297 typedef struct spool_q_enumprinterdrivers
1301 uint32 environment_ptr;
1302 UNISTR2 environment;
1307 SPOOL_Q_ENUMPRINTERDRIVERS;
1309 typedef struct spool_r_enumprinterdrivers
1316 SPOOL_R_ENUMPRINTERDRIVERS;
1319 #define FORM_BUILTIN 1
1320 #define FORM_PRINTER 2
1322 typedef struct spool_form_1
1335 typedef struct spool_q_enumforms
1344 typedef struct spool_r_enumforms
1353 typedef struct spool_q_getform
1363 typedef struct spool_r_getform
1371 typedef struct spool_printer_info_level_1
1374 uint32 description_ptr;
1377 UNISTR2 description;
1380 } SPOOL_PRINTER_INFO_LEVEL_1;
1382 typedef struct spool_printer_info_level_2
1384 uint32 servername_ptr;
1385 uint32 printername_ptr;
1386 uint32 sharename_ptr;
1387 uint32 portname_ptr;
1388 uint32 drivername_ptr;
1390 uint32 location_ptr;
1393 uint32 printprocessor_ptr;
1394 uint32 datatype_ptr;
1395 uint32 parameters_ptr;
1399 uint32 default_priority;
1406 UNISTR2 printername;
1413 UNISTR2 printprocessor;
1417 SPOOL_PRINTER_INFO_LEVEL_2;
1419 typedef struct spool_printer_info_level_3
1423 SPOOL_PRINTER_INFO_LEVEL_3;
1425 typedef struct spool_printer_info_level
1429 SPOOL_PRINTER_INFO_LEVEL_1 *info_1;
1430 SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
1431 SPOOL_PRINTER_INFO_LEVEL_3 *info_3;
1433 SPOOL_PRINTER_INFO_LEVEL;
1435 typedef struct spool_printer_driver_info_level_3
1439 uint32 environment_ptr;
1440 uint32 driverpath_ptr;
1441 uint32 datafile_ptr;
1442 uint32 configfile_ptr;
1443 uint32 helpfile_ptr;
1444 uint32 monitorname_ptr;
1445 uint32 defaultdatatype_ptr;
1446 uint32 dependentfilessize;
1447 uint32 dependentfiles_ptr;
1450 UNISTR2 environment;
1455 UNISTR2 monitorname;
1456 UNISTR2 defaultdatatype;
1457 BUFFER5 dependentfiles;
1460 SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;
1462 /* SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 structure */
1466 uint32 environment_ptr;
1467 uint32 driverpath_ptr;
1468 uint32 datafile_ptr;
1469 uint32 configfile_ptr;
1470 uint32 helpfile_ptr;
1471 uint32 monitorname_ptr;
1472 uint32 defaultdatatype_ptr;
1473 uint32 dependentfiles_len;
1474 uint32 dependentfiles_ptr;
1475 uint32 previousnames_len;
1476 uint32 previousnames_ptr;
1478 UINT64_S driverversion;
1482 uint32 hardwareid_ptr;
1483 uint32 provider_ptr;
1485 UNISTR2 environment;
1490 UNISTR2 monitorname;
1491 UNISTR2 defaultdatatype;
1492 BUFFER5 dependentfiles;
1493 BUFFER5 previousnames;
1498 } SPOOL_PRINTER_DRIVER_INFO_LEVEL_6;
1501 typedef struct spool_printer_driver_info_level
1505 SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
1506 SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *info_6;
1508 SPOOL_PRINTER_DRIVER_INFO_LEVEL;
1511 /* this struct is undocumented */
1512 /* thanks to the ddk ... */
1513 typedef struct spool_user_level_1
1516 uint32 client_name_ptr;
1517 uint32 user_name_ptr;
1522 UNISTR2 client_name;
1527 typedef struct spool_user_level
1529 SPOOL_USER_LEVEL_1 *user_level_1;
1533 typedef struct spool_q_setprinter
1537 SPOOL_PRINTER_INFO_LEVEL info;
1538 SEC_DESC_BUF *secdesc_ctr;
1539 DEVMODE_CTR devmode_ctr;
1546 typedef struct spool_r_setprinter
1552 typedef struct spool_q_addprinter
1554 UNISTR2 server_name;
1556 SPOOL_PRINTER_INFO_LEVEL info;
1557 DEVMODE_CTR devmode_ctr;
1558 SEC_DESC_BUF *secdesc_ctr;
1560 SPOOL_USER_LEVEL user;
1564 typedef struct spool_r_addprinter
1570 typedef struct spool_q_deleteprinter
1574 SPOOL_Q_DELETEPRINTER;
1576 typedef struct spool_r_deleteprinter
1581 SPOOL_R_DELETEPRINTER;
1583 typedef struct spool_q_abortprinter
1587 SPOOL_Q_ABORTPRINTER;
1589 typedef struct spool_r_abortprinter
1593 SPOOL_R_ABORTPRINTER;
1596 typedef struct spool_q_addprinterex
1598 uint32 server_name_ptr;
1599 UNISTR2 server_name;
1601 SPOOL_PRINTER_INFO_LEVEL info;
1602 DEVMODE_CTR devmode_ctr;
1603 SEC_DESC_BUF *secdesc_ctr;
1605 SPOOL_USER_CTR user_ctr;
1607 SPOOL_Q_ADDPRINTEREX;
1609 typedef struct spool_r_addprinterex
1614 SPOOL_R_ADDPRINTEREX;
1617 typedef struct spool_q_addprinterdriver
1619 uint32 server_name_ptr;
1620 UNISTR2 server_name;
1622 SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1624 SPOOL_Q_ADDPRINTERDRIVER;
1626 typedef struct spool_r_addprinterdriver
1630 SPOOL_R_ADDPRINTERDRIVER;
1633 typedef struct driver_directory_1
1639 typedef struct driver_info_ctr_info
1641 DRIVER_DIRECTORY_1 *info1;
1643 DRIVER_DIRECTORY_CTR;
1645 typedef struct spool_q_getprinterdriverdirectory
1649 uint32 environment_ptr;
1650 UNISTR2 environment;
1655 SPOOL_Q_GETPRINTERDRIVERDIR;
1657 typedef struct spool_r_getprinterdriverdirectory
1663 SPOOL_R_GETPRINTERDRIVERDIR;
1665 typedef struct spool_q_addprintprocessor
1669 UNISTR2 environment;
1673 SPOOL_Q_ADDPRINTPROCESSOR;
1675 typedef struct spool_r_addprintprocessor
1679 SPOOL_R_ADDPRINTPROCESSOR;
1682 typedef struct spool_q_enumprintprocessors
1686 uint32 environment_ptr;
1687 UNISTR2 environment;
1692 SPOOL_Q_ENUMPRINTPROCESSORS;
1694 typedef struct printprocessor_1
1700 typedef struct spool_r_enumprintprocessors
1707 SPOOL_R_ENUMPRINTPROCESSORS;
1709 typedef struct spool_q_enumprintprocdatatypes
1713 uint32 processor_ptr;
1719 SPOOL_Q_ENUMPRINTPROCDATATYPES;
1721 typedef struct ppdatatype_1
1725 PRINTPROCDATATYPE_1;
1727 typedef struct spool_r_enumprintprocdatatypes
1734 SPOOL_R_ENUMPRINTPROCDATATYPES;
1736 typedef struct printmonitor_1
1742 typedef struct printmonitor_2
1750 typedef struct spool_q_enumprintmonitors
1758 SPOOL_Q_ENUMPRINTMONITORS;
1760 typedef struct spool_r_enumprintmonitors
1767 SPOOL_R_ENUMPRINTMONITORS;
1770 typedef struct spool_q_enumprinterdata
1777 SPOOL_Q_ENUMPRINTERDATA;
1779 typedef struct spool_r_enumprinterdata
1783 uint32 realvaluesize;
1787 uint32 realdatasize;
1790 SPOOL_R_ENUMPRINTERDATA;
1792 typedef struct spool_q_setprinterdata
1800 uint32 numeric_data;
1802 SPOOL_Q_SETPRINTERDATA;
1804 typedef struct spool_r_setprinterdata
1808 SPOOL_R_SETPRINTERDATA;
1810 typedef struct spool_q_resetprinter
1814 DEVMODE_CTR devmode_ctr;
1816 } SPOOL_Q_RESETPRINTER;
1818 typedef struct spool_r_resetprinter
1822 SPOOL_R_RESETPRINTER;
1826 typedef struct _form
1840 typedef struct spool_q_addform
1844 uint32 level2; /* This should really be part of the FORM structure */
1849 typedef struct spool_r_addform
1855 typedef struct spool_q_setform
1865 typedef struct spool_r_setform
1871 typedef struct spool_q_deleteform
1878 typedef struct spool_r_deleteform
1884 typedef struct spool_q_getjob
1894 typedef struct pjob_info_info
1898 JOB_INFO_1 *job_info_1;
1899 JOB_INFO_2 *job_info_2;
1907 typedef struct spool_r_getjob
1915 typedef struct spool_q_replyopenprinter
1923 SPOOL_Q_REPLYOPENPRINTER;
1925 typedef struct spool_r_replyopenprinter
1930 SPOOL_R_REPLYOPENPRINTER;
1932 typedef struct spool_q_routerreplyprinter
1936 uint32 unknown1; /* 0x00000001 */
1938 uint8 unknown2[5]; /* 0x0000000001 */
1940 SPOOL_Q_ROUTERREPLYPRINTER;
1942 typedef struct spool_r_routerreplyprinter
1946 SPOOL_R_ROUTERREPLYPRINTER;
1948 typedef struct spool_q_replycloseprinter
1952 SPOOL_Q_REPLYCLOSEPRINTER;
1954 typedef struct spool_r_replycloseprinter
1959 SPOOL_R_REPLYCLOSEPRINTER;
1961 typedef struct spool_q_rrpcn
1969 SPOOL_NOTIFY_INFO info;
1971 SPOOL_Q_REPLY_RRPCN;
1973 typedef struct spool_r_rrpcn
1978 SPOOL_R_REPLY_RRPCN;
1980 typedef struct spool_q_getprinterdataex
1987 SPOOL_Q_GETPRINTERDATAEX;
1989 typedef struct spool_r_getprinterdataex
1997 SPOOL_R_GETPRINTERDATAEX;
1999 typedef struct spool_q_setprinterdataex
2008 uint32 numeric_data;
2010 SPOOL_Q_SETPRINTERDATAEX;
2012 typedef struct spool_r_setprinterdataex
2016 SPOOL_R_SETPRINTERDATAEX;
2019 typedef struct spool_q_enumprinterkey
2025 SPOOL_Q_ENUMPRINTERKEY;
2027 typedef struct spool_r_enumprinterkey
2030 uint32 needed; /* in bytes */
2033 SPOOL_R_ENUMPRINTERKEY;
2035 typedef struct printer_enum_values
2044 PRINTER_ENUM_VALUES;
2046 typedef struct printer_enum_values_ctr
2049 uint32 size_of_array;
2050 PRINTER_ENUM_VALUES *values;
2052 PRINTER_ENUM_VALUES_CTR;
2054 typedef struct spool_q_enumprinterdataex
2060 SPOOL_Q_ENUMPRINTERDATAEX;
2062 typedef struct spool_r_enumprinterdataex
2064 PRINTER_ENUM_VALUES_CTR ctr;
2069 SPOOL_R_ENUMPRINTERDATAEX;
2071 typedef struct printprocessor_directory_1
2075 PRINTPROCESSOR_DIRECTORY_1;
2077 typedef struct spool_q_getprintprocessordirectory
2080 UNISTR2 environment;
2085 SPOOL_Q_GETPRINTPROCESSORDIRECTORY;
2087 typedef struct spool_r_getprintprocessordirectory
2093 SPOOL_R_GETPRINTPROCESSORDIRECTORY;
2095 #define PRINTER_DRIVER_VERSION 2
2096 #define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
2098 #endif /* _RPC_SPOOLSS_H */