4 spoolss interface definitions
6 import "misc.idl", "security.idl", "winreg.idl";
8 [ uuid("12345678-1234-abcd-ef00-0123456789ab"),
10 endpoint("ncacn_np:[\\pipe\\spoolss]"),
11 pointer_default(unique),
12 helpstring("Spooler SubSystem"),
13 helper("../librpc/ndr/ndr_spoolss_buf.h")
16 typedef [v1_enum] enum winreg_Type winreg_Type;
17 typedef [gensize] struct {
29 [value(ndr_size_spoolss_Time(time, ndr->iconv_convenience, ndr->flags))] uint32 size;
30 [unique] spoolss_Time *time;
34 PROCESSOR_ARCHITECTURE_INTEL = 0x0000,
35 PROCESSOR_ARCHITECTURE_IA64 = 0x0006,
36 PROCESSOR_ARCHITECTURE_AMD64 = 0x0009
37 } spoolss_ProcessorArchitecture;
39 typedef [v1_enum] enum {
40 PROCESSOR_INTEL_386 = 0x00000182,
41 PROCESSOR_INTEL_486 = 0x000001E6,
42 PROCESSOR_INTEL_PENTIUM = 0x0000024A,
43 PROCESSOR_INTEL_IA64 = 0x00000898,
44 PROCESSOR_AMD_X8664 = 0x000022A0
45 } spoolss_ProcessorType;
47 typedef [v1_enum] enum {
48 /* Windows 95, Windows 98, Windows Me, Windows NT4 */
49 SPOOLSS_MAJOR_VERSION_NT4_95_98_ME = 0x00000004,
50 /* Windows 2000, Windows 2003, Windows XP */
51 SPOOLSS_MAJOR_VERSION_2000_2003_XP = 0x00000005,
52 /* Windows Vista, Windows 2008 */
53 SPOOLSS_MAJOR_VERSION_2008_VISTA = 0x00000006
54 } spoolss_MajorVersion;
56 typedef [v1_enum] enum {
57 /* Windows 2008, Windows Vista, Windows 2000, Windows NT4, Windows 95 */
58 SPOOLSS_MINOR_VERSION_0 = 0x00000000,
60 SPOOLSS_MINOR_VERSION_XP = 0x00000001,
61 /* Windows 2003, Windows XP x64 */
62 SPOOLSS_MINOR_VERSION_2003_XP64 = 0x00000002,
64 SPOOLSS_MINOR_VERSION_98 = 0x0000000a,
66 SPOOLSS_MINOR_VERSION_ME = 0x0000005a
67 } spoolss_MinorVersion;
69 const int PRINTER_STATUS_OK = 0x00000000;
72 PRINTER_STATUS_PAUSED = 0x00000001,
73 PRINTER_STATUS_ERROR = 0x00000002,
74 PRINTER_STATUS_PENDING_DELETION = 0x00000004,
75 PRINTER_STATUS_PAPER_JAM = 0x00000008,
76 PRINTER_STATUS_PAPER_OUT = 0x00000010,
77 PRINTER_STATUS_MANUAL_FEED = 0x00000020,
78 PRINTER_STATUS_PAPER_PROBLEM = 0x00000040,
79 PRINTER_STATUS_OFFLINE = 0x00000080,
80 PRINTER_STATUS_IO_ACTIVE = 0x00000100,
81 PRINTER_STATUS_BUSY = 0x00000200,
82 PRINTER_STATUS_PRINTING = 0x00000400,
83 PRINTER_STATUS_OUTPUT_BIN_FULL = 0x00000800,
84 PRINTER_STATUS_NOT_AVAILABLE = 0x00001000,
85 PRINTER_STATUS_WAITING = 0x00002000,
86 PRINTER_STATUS_PROCESSING = 0x00004000,
87 PRINTER_STATUS_INITIALIZING = 0x00008000,
88 PRINTER_STATUS_WARMING_UP = 0x00010000,
89 PRINTER_STATUS_TONER_LOW = 0x00020000,
90 PRINTER_STATUS_NO_TONER = 0x00040000,
91 PRINTER_STATUS_PAGE_PUNT = 0x00080000,
92 PRINTER_STATUS_USER_INTERVENTION= 0x00100000,
93 PRINTER_STATUS_OUT_OF_MEMORY = 0x00200000,
94 PRINTER_STATUS_DOOR_OPEN = 0x00400000,
95 PRINTER_STATUS_SERVER_UNKNOWN = 0x00800000,
96 PRINTER_STATUS_POWER_SAVE = 0x01000000
97 } spoolss_PrinterStatus;
99 /* JOB status codes. */
101 const int JOB_STATUS_QUEUED = 0x0000;
103 typedef [bitmap32bit] bitmap {
104 JOB_STATUS_PAUSED = 0x00000001,
105 JOB_STATUS_ERROR = 0x00000002,
106 JOB_STATUS_DELETING = 0x00000004,
107 JOB_STATUS_SPOOLING = 0x00000008,
108 JOB_STATUS_PRINTING = 0x00000010,
109 JOB_STATUS_OFFLINE = 0x00000020,
110 JOB_STATUS_PAPEROUT = 0x00000040,
111 JOB_STATUS_PRINTED = 0x00000080,
112 JOB_STATUS_DELETED = 0x00000100,
113 JOB_STATUS_BLOCKED_DEVQ = 0x00000200,
114 JOB_STATUS_USER_INTERVENTION = 0x00000400,
115 JOB_STATUS_RESTART = 0x00000800,
116 JOB_STATUS_COMPLETE = 0x00001000
119 typedef [public,gensize] struct {
120 [relative] nstring *printername;
121 [relative] nstring *servername;
126 uint32 global_counter;
132 uint32 session_counter;
133 uint32 num_error_out_of_paper;
134 uint32 num_error_not_ready;
135 spoolss_JobStatus job_error;
136 uint32 number_of_processors;
137 spoolss_ProcessorType processor_type;
138 uint32 high_part_total_bytes;
141 spoolss_PrinterStatus status;
142 uint32 enumerate_network_printers;
144 spoolss_ProcessorArchitecture processor_architecture;
145 uint16 processor_level;
149 } spoolss_PrinterInfo0;
151 typedef [bitmap32bit] bitmap {
152 DEVMODE_ORIENTATION = 0x00000001,
153 DEVMODE_PAPERSIZE = 0x00000002,
154 DEVMODE_PAPERLENGTH = 0x00000004,
155 DEVMODE_PAPERWIDTH = 0x00000008,
156 DEVMODE_SCALE = 0x00000010,
157 DEVMODE_POSITION = 0x00000020,
158 DEVMODE_NUP = 0x00000040,
159 DEVMODE_COPIES = 0x00000100,
160 DEVMODE_DEFAULTSOURCE = 0x00000200,
161 DEVMODE_PRINTQUALITY = 0x00000400,
162 DEVMODE_COLOR = 0x00000800,
163 DEVMODE_DUPLEX = 0x00001000,
164 DEVMODE_YRESOLUTION = 0x00002000,
165 DEVMODE_TTOPTION = 0x00004000,
166 DEVMODE_COLLATE = 0x00008000,
167 DEVMODE_FORMNAME = 0x00010000,
168 DEVMODE_LOGPIXELS = 0x00020000,
169 DEVMODE_BITSPERPEL = 0x00040000,
170 DEVMODE_PELSWIDTH = 0x00080000,
171 DEVMODE_PELSHEIGHT = 0x00100000,
172 DEVMODE_DISPLAYFLAGS = 0x00200000,
173 DEVMODE_DISPLAYFREQUENCY = 0x00400000,
174 DEVMODE_ICMMETHOD = 0x00800000,
175 DEVMODE_ICMINTENT = 0x01000000,
176 DEVMODE_MEDIATYPE = 0x02000000,
177 DEVMODE_DITHERTYPE = 0x04000000,
178 DEVMODE_PANNINGWIDTH = 0x08000000,
179 DEVMODE_PANNINGHEIGHT = 0x10000000
180 } spoolss_DeviceModeFields;
182 typedef [public,gensize] struct {
183 [charset(UTF16)] uint16 devicename[32];
185 uint16 driverversion;
187 [value(r->driverextra_data.length)] uint16 __driverextra_length;
188 spoolss_DeviceModeFields fields;
195 uint16 defaultsource;
202 [charset(UTF16)] uint16 formname[32];
208 uint32 displayfrequency;
216 uint32 panningheight;
217 [subcontext_size(__driverextra_length),subcontext(0),flag(NDR_REMAINING)] DATA_BLOB driverextra_data;
218 } spoolss_DeviceMode;
220 typedef [public] bitmap {
221 PRINTER_ENUM_DEFAULT = 0x00000001,
222 PRINTER_ENUM_LOCAL = 0x00000002,
223 PRINTER_ENUM_CONNECTIONS = 0x00000004,
224 PRINTER_ENUM_FAVORITE = 0x00000004,
225 PRINTER_ENUM_NAME = 0x00000008,
226 PRINTER_ENUM_REMOTE = 0x00000010,
227 PRINTER_ENUM_SHARED = 0x00000020,
228 PRINTER_ENUM_NETWORK = 0x00000040,
229 PRINTER_ENUM_EXPAND = 0x00004000,
230 PRINTER_ENUM_CONTAINER = 0x00008000,
231 PRINTER_ENUM_ICON1 = 0x00010000,
232 PRINTER_ENUM_ICON2 = 0x00020000,
233 PRINTER_ENUM_ICON3 = 0x00040000,
234 PRINTER_ENUM_ICON4 = 0x00080000,
235 PRINTER_ENUM_ICON5 = 0x00100000,
236 PRINTER_ENUM_ICON6 = 0x00200000,
237 PRINTER_ENUM_ICON7 = 0x00400000,
238 PRINTER_ENUM_ICON8 = 0x00800000,
239 PRINTER_ENUM_HIDE = 0x01000000
240 } spoolss_EnumPrinterFlags;
242 const int PRINTER_ENUM_ICONMASK = (PRINTER_ENUM_ICON1 |
249 PRINTER_ENUM_ICON8); /* 0x00ff0000 */
251 typedef [public,gensize] struct {
252 spoolss_EnumPrinterFlags flags;
253 [relative] nstring *description;
254 [relative] nstring *name;
255 [relative] nstring *comment;
256 } spoolss_PrinterInfo1;
259 PRINTER_ATTRIBUTE_QUEUED = 0x00000001,
260 PRINTER_ATTRIBUTE_DIRECT = 0x00000002,
261 PRINTER_ATTRIBUTE_DEFAULT = 0x00000004,
262 PRINTER_ATTRIBUTE_SHARED = 0x00000008,
263 PRINTER_ATTRIBUTE_NETWORK = 0x00000010,
264 PRINTER_ATTRIBUTE_HIDDEN = 0x00000020,
265 PRINTER_ATTRIBUTE_LOCAL = 0x00000040,
266 PRINTER_ATTRIBUTE_ENABLE_DEVQ = 0x00000080,
267 PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS = 0x00000100,
268 PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST = 0x00000200,
269 PRINTER_ATTRIBUTE_WORK_OFFLINE = 0x00000400,
270 PRINTER_ATTRIBUTE_ENABLE_BIDI = 0x00000800,
271 PRINTER_ATTRIBUTE_RAW_ONLY = 0x00001000,
272 PRINTER_ATTRIBUTE_PUBLISHED = 0x00002000,
273 PRINTER_ATTRIBUTE_FAX = 0x00004000,
274 PRINTER_ATTRIBUTE_TS = 0x00008000
275 } spoolss_PrinterAttributes;
277 typedef [public,gensize] struct {
278 [relative] nstring *servername;
279 [relative] nstring *printername;
280 [relative] nstring *sharename;
281 [relative] nstring *portname;
282 [relative] nstring *drivername;
283 [relative] nstring *comment;
284 [relative] nstring *location;
285 [relative,subcontext(0)] spoolss_DeviceMode *devmode;
286 [relative] nstring *sepfile;
287 [relative] nstring *printprocessor;
288 [relative] nstring *datatype;
289 [relative] nstring *parameters;
290 [relative,subcontext(0)] security_descriptor *secdesc;
291 spoolss_PrinterAttributes attributes;
292 [range(0,99)] uint32 priority;
293 uint32 defaultpriority;
296 spoolss_PrinterStatus status;
299 } spoolss_PrinterInfo2;
301 typedef [public,gensize] struct {
302 [relative,subcontext(0)] security_descriptor *secdesc;
303 } spoolss_PrinterInfo3;
305 typedef [public,gensize] struct {
306 [relative] nstring *printername;
307 [relative] nstring *servername;
308 spoolss_PrinterAttributes attributes;
309 } spoolss_PrinterInfo4;
311 typedef [public,gensize] struct {
312 [relative] nstring *printername;
313 [relative] nstring *portname;
314 spoolss_PrinterAttributes attributes;
315 uint32 device_not_selected_timeout;
316 uint32 transmission_retry_timeout;
317 } spoolss_PrinterInfo5;
319 typedef [public,gensize] struct {
320 spoolss_PrinterStatus status;
321 } spoolss_PrinterInfo6;
324 DSPRINT_PUBLISH = 0x00000001,
325 DSPRINT_UPDATE = 0x00000002,
326 DSPRINT_UNPUBLISH = 0x00000004,
327 DSPRINT_REPUBLISH = 0x00000008,
328 DSPRINT_PENDING = 0x80000000
329 } spoolss_DsPrintAction;
331 typedef [public,gensize] struct {
332 [relative] nstring *guid; /* text form of printer guid */
333 spoolss_DsPrintAction action;
334 } spoolss_PrinterInfo7;
337 [relative,subcontext(0)] spoolss_DeviceMode *devmode;
338 } spoolss_DeviceModeInfo;
340 typedef [nodiscriminant,relative_base,public,gensize] union {
341 [case(0)] spoolss_PrinterInfo0 info0;
342 [case(1)] spoolss_PrinterInfo1 info1;
343 [case(2)] spoolss_PrinterInfo2 info2;
344 [case(3)] spoolss_PrinterInfo3 info3;
345 [case(4)] spoolss_PrinterInfo4 info4;
346 [case(5)] spoolss_PrinterInfo5 info5;
347 [case(6)] spoolss_PrinterInfo6 info6;
348 [case(7)] spoolss_PrinterInfo7 info7;
349 [case(8)] spoolss_DeviceModeInfo info8;
350 [case(9)] spoolss_DeviceModeInfo info9;
352 } spoolss_PrinterInfo;
356 /* we are using this as internal parsing code */
357 [public,noopnum,noprint] WERROR _spoolss_EnumPrinters(
358 [in] spoolss_EnumPrinterFlags flags,
359 [in,unique] [string,charset(UTF16)] uint16 *server,
361 [in,unique] DATA_BLOB *buffer,
363 [out,unique] DATA_BLOB *info,
364 [out,ref] uint32 *needed,
365 [out,ref] uint32 *count
367 [public,noopnum,noprint] void __spoolss_EnumPrinters(
370 [out,switch_is(level)] spoolss_PrinterInfo info[count]
372 [nopull,nopush] WERROR spoolss_EnumPrinters(
373 [in] spoolss_EnumPrinterFlags flags,
374 [in,unique] [string,charset(UTF16)] uint16 *server,
376 [in,unique] DATA_BLOB *buffer,
378 /* what we have here is a subcontext containing an array of no discriminant unions
379 * and the array has no size in front
381 [out,ref] uint32 *count,
382 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrinterInfo **info,
383 [out,ref] uint32 *needed
389 [value(_ndr_size_spoolss_DeviceMode(devmode, ndr->iconv_convenience, ndr->flags))] uint32 _ndr_size;
390 [subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode;
391 } spoolss_DevmodeContainer;
393 [public] WERROR spoolss_OpenPrinter(
394 [in,unique] [string,charset(UTF16)] uint16 *printername,
395 [in,unique] [string,charset(UTF16)] uint16 *datatype,
396 [in] spoolss_DevmodeContainer devmode_ctr,
397 [in] spoolss_AccessRights access_mask,
398 [out,ref] policy_handle *handle
404 typedef [public,gensize] struct {
406 [relative] nstring *printer_name;
407 [relative] nstring *server_name;
408 [relative] nstring *user_name;
409 [relative] nstring *document_name;
410 [relative] nstring *data_type;
411 [relative] nstring *text_status;
412 spoolss_JobStatus status;
413 [range(0,99)] uint32 priority;
416 uint32 pages_printed;
417 spoolss_Time submitted;
420 typedef [public,gensize] struct {
422 [relative] nstring *printer_name;
423 [relative] nstring *server_name;
424 [relative] nstring *user_name;
425 [relative] nstring *document_name;
426 [relative] nstring *notify_name;
427 [relative] nstring *data_type;
428 [relative] nstring *print_processor;
429 [relative] nstring *parameters;
430 [relative] nstring *driver_name;
431 [relative] spoolss_DeviceMode *devmode;
432 [relative] nstring *text_status;
433 [relative] security_descriptor *secdesc;
434 spoolss_JobStatus status;
435 [range(0,99)] uint32 priority;
441 spoolss_Time submitted;
443 uint32 pages_printed;
446 typedef [public,gensize] struct {
452 typedef [public,gensize] struct {
454 [relative] nstring *printer_name;
455 [relative] nstring *server_name;
456 [relative] nstring *user_name;
457 [relative] nstring *document_name;
458 [relative] nstring *notify_name;
459 [relative] nstring *data_type;
460 [relative] nstring *print_processor;
461 [relative] nstring *parameters;
462 [relative] nstring *driver_name;
463 [relative] spoolss_DeviceMode *devmode;
464 [relative] nstring *text_status;
465 [relative] security_descriptor *secdesc;
466 spoolss_JobStatus status;
467 [range(0,99)] uint32 priority;
473 spoolss_Time submitted;
475 uint32 pages_printed;
479 typedef [nodiscriminant,relative_base,public,gensize] union {
480 [case(1)] spoolss_JobInfo1 info1;
481 [case(2)] spoolss_JobInfo2 info2;
482 [case(3)] spoolss_JobInfo3 info3;
483 [case(4)] spoolss_JobInfo4 info4;
489 [string,charset(UTF16)] uint16 *printer_name;
490 [string,charset(UTF16)] uint16 *server_name;
491 [string,charset(UTF16)] uint16 *user_name;
492 [string,charset(UTF16)] uint16 *document_name;
493 [string,charset(UTF16)] uint16 *data_type;
494 [string,charset(UTF16)] uint16 *text_status;
495 spoolss_JobStatus status;
496 [range(0,99)] uint32 priority;
499 uint32 pages_printed;
500 spoolss_Time submitted;
501 } spoolss_SetJobInfo1;
505 [string,charset(UTF16)] uint16 *printer_name;
506 [string,charset(UTF16)] uint16 *server_name;
507 [string,charset(UTF16)] uint16 *user_name;
508 [string,charset(UTF16)] uint16 *document_name;
509 [string,charset(UTF16)] uint16 *notify_name;
510 [string,charset(UTF16)] uint16 *data_type;
511 [string,charset(UTF16)] uint16 *print_processor;
512 [string,charset(UTF16)] uint16 *parameters;
513 [string,charset(UTF16)] uint16 *driver_name;
514 uint32 _devmode_ptr; /* pointer to truncated devicemode */
515 [string,charset(UTF16)] uint16 *text_status;
517 spoolss_JobStatus status;
518 [range(0,99)] uint32 priority;
524 spoolss_Time submitted;
526 uint32 pages_printed;
527 } spoolss_SetJobInfo2;
531 [string,charset(UTF16)] uint16 *printer_name;
532 [string,charset(UTF16)] uint16 *server_name;
533 [string,charset(UTF16)] uint16 *user_name;
534 [string,charset(UTF16)] uint16 *document_name;
535 [string,charset(UTF16)] uint16 *notify_name;
536 [string,charset(UTF16)] uint16 *data_type;
537 [string,charset(UTF16)] uint16 *print_processor;
538 [string,charset(UTF16)] uint16 *parameters;
539 [string,charset(UTF16)] uint16 *driver_name;
540 uint32 _devmode_ptr; /* pointer to truncated devicemode */
541 [string,charset(UTF16)] uint16 *text_status;
543 spoolss_JobStatus status;
544 [range(0,99)] uint32 priority;
550 spoolss_Time submitted;
552 uint32 pages_printed;
554 } spoolss_SetJobInfo4;
556 typedef [public] union {
557 [case(1)] spoolss_SetJobInfo1 *info1;
558 [case(2)] spoolss_SetJobInfo2 *info2;
559 [case(3)] spoolss_JobInfo3 *info3;
560 [case(4)] spoolss_SetJobInfo4 *info4;
562 } spoolss_SetJobInfo;
566 [switch_is(level)] spoolss_SetJobInfo info;
567 } spoolss_JobInfoContainer;
569 typedef [v1_enum] enum {
570 SPOOLSS_JOB_CONTROL_PAUSE = 1,
571 SPOOLSS_JOB_CONTROL_RESUME = 2,
572 SPOOLSS_JOB_CONTROL_CANCEL = 3,
573 SPOOLSS_JOB_CONTROL_RESTART = 4,
574 SPOOLSS_JOB_CONTROL_DELETE = 5,
575 SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER = 6,
576 SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED = 7,
577 SPOOLSS_JOB_CONTROL_RETAIN = 8,
578 SPOOLSS_JOB_CONTROL_RELEASE = 9
579 } spoolss_JobControl;
581 WERROR spoolss_SetJob(
582 [in,ref] policy_handle *handle,
584 [in,unique] spoolss_JobInfoContainer *ctr,
585 [in] spoolss_JobControl command
590 WERROR spoolss_GetJob(
591 [in,ref] policy_handle *handle,
594 [in,unique] DATA_BLOB *buffer,
596 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info,
597 [out,ref] uint32 *needed
602 [public,noopnum,noprint] WERROR _spoolss_EnumJobs(
603 [in,ref] policy_handle *handle,
604 [in] uint32 firstjob,
607 [in,unique] DATA_BLOB *buffer,
609 [out,unique] DATA_BLOB *info,
610 [out,ref] uint32 *needed,
611 [out,ref] uint32 *count
613 [public,noopnum,noprint] void __spoolss_EnumJobs(
616 [out,switch_is(level)] spoolss_JobInfo info[count]
618 [nopull,nopush] WERROR spoolss_EnumJobs(
619 [in,ref] policy_handle *handle,
620 [in] uint32 firstjob,
623 [in,unique] DATA_BLOB *buffer,
625 [out,ref] uint32 *count,
626 [out,ref,switch_is(level),size_is(,*count)] spoolss_JobInfo **info,
627 [out,ref] uint32 *needed
632 [todo] WERROR spoolss_AddPrinter(
633 /* This function is not implemented in Samba 3 as no
634 clients have been observed using it. */
639 WERROR spoolss_DeletePrinter(
640 [in] policy_handle *handle
645 typedef [v1_enum] enum {
646 SPOOLSS_PRINTER_CONTROL_UNPAUSE = 0,
647 SPOOLSS_PRINTER_CONTROL_PAUSE = 1,
648 SPOOLSS_PRINTER_CONTROL_RESUME = 2,
649 SPOOLSS_PRINTER_CONTROL_PURGE = 3,
650 SPOOLSS_PRINTER_CONTROL_SET_STATUS = 4
651 } spoolss_PrinterControl;
654 [string,charset(UTF16)] uint16 *servername;
655 [string,charset(UTF16)] uint16 *printername;
660 uint32 global_counter;
666 uint32 session_counter;
667 uint32 num_error_out_of_paper;
668 uint32 num_error_not_ready;
670 uint32 number_of_processors;
671 spoolss_ProcessorType processor_type;
672 uint32 high_part_total_bytes;
676 uint32 enumerate_network_printers;
678 spoolss_ProcessorArchitecture processor_architecture;
679 uint16 processor_level;
683 } spoolss_SetPrinterInfo0;
686 spoolss_EnumPrinterFlags flags;
687 [string,charset(UTF16)] uint16 *description;
688 [string,charset(UTF16)] uint16 *name;
689 [string,charset(UTF16)] uint16 *comment;
690 } spoolss_SetPrinterInfo1;
693 [string,charset(UTF16)] uint16 *servername;
694 [string,charset(UTF16)] uint16 *printername;
695 [string,charset(UTF16)] uint16 *sharename;
696 [string,charset(UTF16)] uint16 *portname;
697 [string,charset(UTF16)] uint16 *drivername;
698 [string,charset(UTF16)] uint16 *comment;
699 [string,charset(UTF16)] uint16 *location;
700 [subcontext(0)] spoolss_DeviceMode *devmode;
701 [string,charset(UTF16)] uint16 *sepfile;
702 [string,charset(UTF16)] uint16 *printprocessor;
703 [string,charset(UTF16)] uint16 *datatype;
704 [string,charset(UTF16)] uint16 *parameters;
705 [subcontext(0)] security_descriptor *secdesc;
706 spoolss_PrinterAttributes attributes;
707 [range(0,99)] uint32 priority;
708 uint32 defaultpriority;
711 spoolss_PrinterStatus status;
714 } spoolss_SetPrinterInfo2;
718 } spoolss_SetPrinterInfo3;
721 [string,charset(UTF16)] uint16 *printername;
722 [string,charset(UTF16)] uint16 *servername;
723 spoolss_PrinterAttributes attributes;
724 } spoolss_SetPrinterInfo4;
727 [string,charset(UTF16)] uint16 *printername;
728 [string,charset(UTF16)] uint16 *portname;
729 spoolss_PrinterAttributes attributes;
730 uint32 device_not_selected_timeout;
731 uint32 transmission_retry_timeout;
732 } spoolss_SetPrinterInfo5;
735 spoolss_PrinterStatus status;
736 } spoolss_SetPrinterInfo6;
739 [string,charset(UTF16)] uint16 *guid; /* text form of printer guid */
740 spoolss_DsPrintAction action;
741 } spoolss_SetPrinterInfo7;
743 typedef [switch_type(uint32)] union {
744 [case(0)] spoolss_SetPrinterInfo0 *info0;
745 [case(1)] spoolss_SetPrinterInfo1 *info1;
746 [case(2)] spoolss_SetPrinterInfo2 *info2;
747 [case(3)] spoolss_SetPrinterInfo3 *info3;
748 [case(4)] spoolss_SetPrinterInfo4 *info4;
749 [case(5)] spoolss_SetPrinterInfo5 *info5;
750 [case(6)] spoolss_SetPrinterInfo6 *info6;
751 [case(7)] spoolss_SetPrinterInfo7 *info7;
752 [case(8)] spoolss_DeviceModeInfo *info8;
753 [case(9)] spoolss_DeviceModeInfo *info9;
755 } spoolss_SetPrinterInfo;
759 [switch_is(level)] spoolss_SetPrinterInfo info;
760 } spoolss_SetPrinterInfoCtr;
762 WERROR spoolss_SetPrinter(
763 [in,ref] policy_handle *handle,
764 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
765 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
766 [in,ref] sec_desc_buf *secdesc_ctr,
767 [in] spoolss_PrinterControl command
772 [public] WERROR spoolss_GetPrinter(
773 [in,ref] policy_handle *handle,
775 [in,unique] DATA_BLOB *buffer,
777 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info,
778 [out,ref] uint32 *needed
784 typedef [public] struct {
785 [value((ndr_size_spoolss_StringArray(r, ndr->iconv_convenience, ndr->flags)-4)/2)] uint32 _ndr_size;
786 /*[subcontext(0),subcontext_size(_ndr_size*2)]*/ nstring_array string;
787 } spoolss_StringArray;
789 typedef [public] struct {
790 [value((ndr_size_spoolss_StringArray2(r, ndr->iconv_convenience, ndr->flags)-4)/2)] uint32 _ndr_size;
791 [subcontext(0),subcontext_size(_ndr_size*2)] nstring_array string;
792 } spoolss_StringArray2;
795 [string,charset(UTF16)] uint16 *driver_name;
796 } spoolss_AddDriverInfo1;
798 typedef [v1_enum,public] enum {
799 SPOOLSS_DRIVER_VERSION_9X = 0,
800 SPOOLSS_DRIVER_VERSION_NT35 = 1,
801 SPOOLSS_DRIVER_VERSION_NT4 = 2,
802 SPOOLSS_DRIVER_VERSION_200X = 3
803 } spoolss_DriverOSVersion;
806 spoolss_DriverOSVersion version;
807 [string,charset(UTF16)] uint16 *driver_name;
808 [string,charset(UTF16)] uint16 *architecture;
809 [string,charset(UTF16)] uint16 *driver_path;
810 [string,charset(UTF16)] uint16 *data_file;
811 [string,charset(UTF16)] uint16 *config_file;
812 } spoolss_AddDriverInfo2;
815 spoolss_DriverOSVersion version;
816 [string,charset(UTF16)] uint16 *driver_name;
817 [string,charset(UTF16)] uint16 *architecture;
818 [string,charset(UTF16)] uint16 *driver_path;
819 [string,charset(UTF16)] uint16 *data_file;
820 [string,charset(UTF16)] uint16 *config_file;
821 [string,charset(UTF16)] uint16 *help_file;
822 [string,charset(UTF16)] uint16 *monitor_name;
823 [string,charset(UTF16)] uint16 *default_datatype;
824 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
825 spoolss_StringArray *dependent_files;
826 } spoolss_AddDriverInfo3;
829 spoolss_DriverOSVersion version;
830 [string,charset(UTF16)] uint16 *driver_name;
831 [string,charset(UTF16)] uint16 *architecture;
832 [string,charset(UTF16)] uint16 *driver_path;
833 [string,charset(UTF16)] uint16 *data_file;
834 [string,charset(UTF16)] uint16 *config_file;
835 [string,charset(UTF16)] uint16 *help_file;
836 [string,charset(UTF16)] uint16 *monitor_name;
837 [string,charset(UTF16)] uint16 *default_datatype;
838 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
839 spoolss_StringArray *dependent_files;
840 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
841 spoolss_StringArray *previous_names;
842 } spoolss_AddDriverInfo4;
844 typedef [bitmap32bit] bitmap {
845 PRINTER_DRIVER_PACKAGE_AWARE = 0x00000002
846 } spoolss_DriverAttributes;
849 spoolss_DriverOSVersion version;
850 [string,charset(UTF16)] uint16 *driver_name;
851 [string,charset(UTF16)] uint16 *architecture;
852 [string,charset(UTF16)] uint16 *driver_path;
853 [string,charset(UTF16)] uint16 *data_file;
854 [string,charset(UTF16)] uint16 *config_file;
855 spoolss_DriverAttributes driver_attributes;
856 uint32 config_version;
857 uint32 driver_version;
858 } spoolss_AddDriverInfo5;
861 spoolss_DriverOSVersion version;
862 [string,charset(UTF16)] uint16 *driver_name;
863 [string,charset(UTF16)] uint16 *architecture;
864 [string,charset(UTF16)] uint16 *driver_path;
865 [string,charset(UTF16)] uint16 *data_file;
866 [string,charset(UTF16)] uint16 *config_file;
867 [string,charset(UTF16)] uint16 *help_file;
868 [string,charset(UTF16)] uint16 *monitor_name;
869 [string,charset(UTF16)] uint16 *default_datatype;
870 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
871 spoolss_StringArray *dependent_files;
872 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
873 spoolss_StringArray *previous_names;
875 hyper driver_version;
876 [string,charset(UTF16)] uint16 *manufacturer_name;
877 [string,charset(UTF16)] uint16 *manufacturer_url;
878 [string,charset(UTF16)] uint16 *hardware_id;
879 [string,charset(UTF16)] uint16 *provider;
880 } spoolss_AddDriverInfo6;
883 spoolss_DriverOSVersion version;
884 [string,charset(UTF16)] uint16 *driver_name;
885 [string,charset(UTF16)] uint16 *architecture;
886 [string,charset(UTF16)] uint16 *driver_path;
887 [string,charset(UTF16)] uint16 *data_file;
888 [string,charset(UTF16)] uint16 *config_file;
889 [string,charset(UTF16)] uint16 *help_file;
890 [string,charset(UTF16)] uint16 *monitor_name;
891 [string,charset(UTF16)] uint16 *default_datatype;
892 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
893 spoolss_StringArray *dependent_files;
894 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
895 spoolss_StringArray *previous_names;
897 hyper driver_version;
898 [string,charset(UTF16)] uint16 *manufacturer_name;
899 [string,charset(UTF16)] uint16 *manufacturer_url;
900 [string,charset(UTF16)] uint16 *hardware_id;
901 [string,charset(UTF16)] uint16 *provider;
902 [string,charset(UTF16)] uint16 *print_processor;
903 [string,charset(UTF16)] uint16 *vendor_setup;
904 [value(((ndr_size_spoolss_StringArray(color_profiles, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles;
905 spoolss_StringArray *color_profiles;
906 [string,charset(UTF16)] uint16 *inf_path;
907 uint32 printer_driver_attributes;
908 [value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies;
909 spoolss_StringArray *core_driver_dependencies;
910 NTTIME min_inbox_driver_ver_date;
911 hyper min_inbox_driver_ver_version;
912 } spoolss_AddDriverInfo8;
914 typedef [switch_type(uint32)] union {
915 [case(1)] spoolss_AddDriverInfo1 *info1;
916 [case(2)] spoolss_AddDriverInfo2 *info2;
917 [case(3)] spoolss_AddDriverInfo3 *info3;
918 [case(4)] spoolss_AddDriverInfo4 *info4;
919 [case(6)] spoolss_AddDriverInfo6 *info6;
920 [case(8)] spoolss_AddDriverInfo8 *info8;
921 } spoolss_AddDriverInfo;
925 [switch_is(level)] spoolss_AddDriverInfo info;
926 } spoolss_AddDriverInfoCtr;
928 WERROR spoolss_AddPrinterDriver(
929 [in,unique] [string,charset(UTF16)] uint16 *servername,
930 [in,ref] spoolss_AddDriverInfoCtr *info_ctr
933 typedef [public,gensize] struct {
934 [relative] nstring *driver_name;
935 } spoolss_DriverInfo1;
937 typedef [public,gensize] struct {
938 spoolss_DriverOSVersion version;
939 [relative] nstring *driver_name;
940 [relative] nstring *architecture;
941 [relative] nstring *driver_path;
942 [relative] nstring *data_file;
943 [relative] nstring *config_file;
944 } spoolss_DriverInfo2;
946 typedef [public,gensize] struct {
947 spoolss_DriverOSVersion version;
948 [relative] nstring *driver_name;
949 [relative] nstring *architecture;
950 [relative] nstring *driver_path;
951 [relative] nstring *data_file;
952 [relative] nstring *config_file;
953 [relative] nstring *help_file;
954 [relative] nstring_array *dependent_files;
955 [relative] nstring *monitor_name;
956 [relative] nstring *default_datatype;
957 } spoolss_DriverInfo3;
959 typedef [public,gensize] struct {
960 spoolss_DriverOSVersion version;
961 [relative] nstring *driver_name;
962 [relative] nstring *architecture;
963 [relative] nstring *driver_path;
964 [relative] nstring *data_file;
965 [relative] nstring *config_file;
966 [relative] nstring *help_file;
967 [relative] nstring_array *dependent_files;
968 [relative] nstring *monitor_name;
969 [relative] nstring *default_datatype;
970 [relative] nstring_array *previous_names;
971 } spoolss_DriverInfo4;
973 typedef [public,gensize] struct {
974 spoolss_DriverOSVersion version;
975 [relative] nstring *driver_name;
976 [relative] nstring *architecture;
977 [relative] nstring *driver_path;
978 [relative] nstring *data_file;
979 [relative] nstring *config_file;
980 spoolss_DriverAttributes driver_attributes;
981 uint32 config_version;
982 uint32 driver_version;
983 } spoolss_DriverInfo5;
985 typedef [public,gensize] struct {
986 spoolss_DriverOSVersion version;
987 [relative] nstring *driver_name;
988 [relative] nstring *architecture;
989 [relative] nstring *driver_path;
990 [relative] nstring *data_file;
991 [relative] nstring *config_file;
992 [relative] nstring *help_file;
993 [relative] nstring_array *dependent_files;
994 [relative] nstring *monitor_name;
995 [relative] nstring *default_datatype;
996 [relative] nstring_array *previous_names;
998 hyper driver_version;
999 [relative] nstring *manufacturer_name;
1000 [relative] nstring *manufacturer_url;
1001 [relative] nstring *hardware_id;
1002 [relative] nstring *provider;
1003 } spoolss_DriverInfo6;
1005 typedef [public,gensize] struct {
1006 spoolss_DriverOSVersion version;
1007 [relative] nstring *driver_name;
1008 [relative] nstring *architecture;
1009 [relative] nstring *driver_path;
1010 [relative] nstring *data_file;
1011 [relative] nstring *config_file;
1012 [relative] nstring *help_file;
1013 [relative] nstring *monitor_name;
1014 [relative] nstring *default_datatype;
1015 [relative] nstring_array *dependent_files;
1016 [relative] nstring_array *previous_names;
1018 hyper driver_version;
1019 [relative] nstring *manufacturer_name;
1020 [relative] nstring *manufacturer_url;
1021 [relative] nstring *hardware_id;
1022 [relative] nstring *provider;
1023 [relative] nstring *print_processor;
1024 [relative] nstring *vendor_setup;
1025 [relative] nstring_array *color_profiles;
1026 [relative] nstring *inf_path;
1027 uint32 printer_driver_attributes;
1028 [relative] nstring_array *core_driver_dependencies;
1029 NTTIME min_inbox_driver_ver_date;
1030 hyper min_inbox_driver_ver_version;
1031 } spoolss_DriverInfo8;
1033 typedef [v1_enum] enum {
1034 SPOOLSS_DRIVER_FILE_TYPE_RENDERING = 0x00000000,
1035 SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION = 0x00000001,
1036 SPOOLSS_DRIVER_FILE_TYPE_DATA = 0x00000002,
1037 SPOOLSS_DRIVER_FILE_TYPE_HELP = 0x00000003,
1038 SPOOLSS_DRIVER_FILE_TYPE_OTHER = 0x00000004
1039 } spoolss_DriverFileType;
1041 typedef [public] struct {
1042 [relative] nstring *file_name;
1043 spoolss_DriverFileType file_type;
1044 uint32 file_version;
1045 } spoolss_DriverFileInfo;
1047 typedef [public,gensize,nopush,nopull] struct {
1048 spoolss_DriverOSVersion version;
1049 [relative] nstring *driver_name;
1050 [relative] nstring *architecture;
1051 [relative] [size_is(file_count)] spoolss_DriverFileInfo *file_info;
1053 [relative] nstring *monitor_name;
1054 [relative] nstring *default_datatype;
1055 [relative] nstring_array *previous_names;
1057 hyper driver_version;
1058 [relative] nstring *manufacturer_name;
1059 [relative] nstring *manufacturer_url;
1060 [relative] nstring *hardware_id;
1061 [relative] nstring *provider;
1062 } spoolss_DriverInfo101;
1064 typedef [nodiscriminant,relative_base,public,gensize] union {
1065 [case(1)] spoolss_DriverInfo1 info1;
1066 [case(2)] spoolss_DriverInfo2 info2;
1067 [case(3)] spoolss_DriverInfo3 info3;
1068 [case(4)] spoolss_DriverInfo4 info4;
1069 [case(5)] spoolss_DriverInfo5 info5;
1070 [case(6)] spoolss_DriverInfo6 info6;
1071 [case(8)] spoolss_DriverInfo8 info8;
1072 [case(101)] spoolss_DriverInfo101 info101;
1074 } spoolss_DriverInfo;
1076 /******************/
1077 /* Function: 0x0a */
1078 [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDrivers(
1079 [in,unique] [string,charset(UTF16)] uint16 *server,
1080 [in,unique] [string,charset(UTF16)] uint16 *environment,
1082 [in,unique] DATA_BLOB *buffer,
1083 [in] uint32 offered,
1084 [out,unique] DATA_BLOB *info,
1085 [out,ref] uint32 *needed,
1086 [out,ref] uint32 *count
1088 [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers(
1091 [out,switch_is(level)] spoolss_DriverInfo info[count]
1093 [nopull,nopush] WERROR spoolss_EnumPrinterDrivers(
1094 [in,unique] [string,charset(UTF16)] uint16 *server,
1095 [in,unique] [string,charset(UTF16)] uint16 *environment,
1097 [in,unique] DATA_BLOB *buffer,
1098 [in] uint32 offered,
1099 [out,ref] uint32 *count,
1100 [out,ref,switch_is(level),size_is(,*count)] spoolss_DriverInfo **info,
1101 [out,ref] uint32 *needed
1104 /******************/
1105 /* Function: 0x0b */
1106 [todo] WERROR spoolss_GetPrinterDriver(
1109 /******************/
1110 /* Function: 0x0c */
1111 typedef [public,gensize] struct {
1112 nstring directory_name;
1113 } spoolss_DriverDirectoryInfo1;
1115 /* NOTE: it's seems that w2k3 completly ignores the level
1118 typedef [nodiscriminant,relative_base,gensize,public] union {
1119 [case(1)] spoolss_DriverDirectoryInfo1 info1;
1120 [default] spoolss_DriverDirectoryInfo1 info1;
1121 } spoolss_DriverDirectoryInfo;
1123 [public] WERROR spoolss_GetPrinterDriverDirectory(
1124 [in,unique] [string,charset(UTF16)] uint16 *server,
1125 [in,unique] [string,charset(UTF16)] uint16 *environment,
1127 [in,unique] DATA_BLOB *buffer,
1128 [in] uint32 offered,
1129 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
1130 [out,ref] uint32 *needed
1133 /******************/
1134 /* Function: 0x0d */
1135 WERROR spoolss_DeletePrinterDriver(
1136 [in,unique] [string,charset(UTF16)] uint16 *server,
1137 [in] [string,charset(UTF16)] uint16 architecture[],
1138 [in] [string,charset(UTF16)] uint16 driver[]
1141 /******************/
1142 /* Function: 0x0e */
1143 WERROR spoolss_AddPrintProcessor(
1144 [in,unique] [string,charset(UTF16)] uint16 *server,
1145 [in] [string,charset(UTF16)] uint16 architecture[],
1146 [in] [string,charset(UTF16)] uint16 path_name[],
1147 [in] [string,charset(UTF16)] uint16 print_processor_name[]
1150 /******************/
1151 /* Function: 0x0f */
1152 typedef [public,gensize] struct {
1153 [relative] nstring *print_processor_name;
1154 } spoolss_PrintProcessorInfo1;
1156 typedef [nodiscriminant,relative_base,public] union {
1157 [case(1)] spoolss_PrintProcessorInfo1 info1;
1159 } spoolss_PrintProcessorInfo;
1161 [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessors(
1162 [in,unique] [string,charset(UTF16)] uint16 *servername,
1163 [in,unique] [string,charset(UTF16)] uint16 *environment,
1165 [in,unique] DATA_BLOB *buffer,
1166 [in] uint32 offered,
1167 [out,unique] DATA_BLOB *info,
1168 [out,ref] uint32 *needed,
1169 [out,ref] uint32 *count
1171 [public,noopnum,noprint] void __spoolss_EnumPrintProcessors(
1174 [out,switch_is(level)] spoolss_PrintProcessorInfo info[count]
1176 [nopull,nopush] WERROR spoolss_EnumPrintProcessors(
1177 [in,unique] [string,charset(UTF16)] uint16 *servername,
1178 [in,unique] [string,charset(UTF16)] uint16 *environment,
1180 [in,unique] DATA_BLOB *buffer,
1181 [in] uint32 offered,
1182 [out,ref] uint32 *count,
1183 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrintProcessorInfo **info,
1184 [out,ref] uint32 *needed
1187 /******************/
1188 /* Function: 0x10 */
1189 typedef [public,gensize] struct {
1190 nstring directory_name;
1191 } spoolss_PrintProcessorDirectoryInfo1;
1193 typedef [nodiscriminant,relative_base,gensize,public] union {
1194 [case(1)] spoolss_PrintProcessorDirectoryInfo1 info1;
1195 [default] spoolss_PrintProcessorDirectoryInfo1 info1;
1196 } spoolss_PrintProcessorDirectoryInfo;
1198 WERROR spoolss_GetPrintProcessorDirectory(
1199 [in,unique] [string,charset(UTF16)] uint16 *server,
1200 [in,unique] [string,charset(UTF16)] uint16 *environment,
1202 [in,unique] DATA_BLOB *buffer,
1203 [in] uint32 offered,
1204 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrintProcessorDirectoryInfo *info,
1205 [out,ref] uint32 *needed
1208 /******************/
1209 /* Function: 0x11 */
1211 [string,charset(UTF16)] uint16 *document_name;
1212 [string,charset(UTF16)] uint16 *output_file;
1213 [string,charset(UTF16)] uint16 *datatype;
1214 } spoolss_DocumentInfo1;
1216 typedef [switch_type(uint32)] union {
1217 [case(1)] spoolss_DocumentInfo1 *info1;
1218 [case(2)]; /* TODO */
1219 [case(3)]; /* TODO */
1221 } spoolss_DocumentInfo;
1223 WERROR spoolss_StartDocPrinter(
1224 [in,ref] policy_handle *handle,
1226 [in,switch_is(level)] spoolss_DocumentInfo info,
1227 [out,ref] uint32 *job_id
1230 /******************/
1231 /* Function: 0x12 */
1232 WERROR spoolss_StartPagePrinter(
1233 [in,ref] policy_handle *handle
1236 /******************/
1237 /* Function: 0x13 */
1238 WERROR spoolss_WritePrinter(
1239 [in,ref] policy_handle *handle,
1240 [in] DATA_BLOB data,
1241 [in,value(r->in.data.length)] uint32 _data_size,
1242 [out,ref] uint32 *num_written
1245 /******************/
1246 /* Function: 0x14 */
1247 WERROR spoolss_EndPagePrinter(
1248 [in,ref] policy_handle *handle
1251 /******************/
1252 /* Function: 0x15 */
1253 WERROR spoolss_AbortPrinter(
1254 [in,ref] policy_handle *handle
1257 /******************/
1258 /* Function: 0x16 */
1259 WERROR spoolss_ReadPrinter(
1260 [in,ref] policy_handle *handle,
1261 [out,ref] [size_is(data_size)] uint8 *data,
1262 [in] uint32 data_size,
1263 [out,ref] uint32 *_data_size
1266 /******************/
1267 /* Function: 0x17 */
1268 WERROR spoolss_EndDocPrinter(
1269 [in,ref] policy_handle *handle
1272 /******************/
1273 /* Function: 0x18 */
1274 WERROR spoolss_AddJob(
1275 [in,ref] policy_handle *handle,
1277 [in,out,unique] [size_is(offered)] uint8 *buffer,
1278 [in] uint32 offered,
1279 [out,ref] uint32 *needed
1282 /******************/
1283 /* Function: 0x19 */
1284 WERROR spoolss_ScheduleJob(
1285 [in,ref] policy_handle *handle,
1289 /******************/
1290 /* Function: 0x1a */
1292 const string SPL_ARCH_WIN40 = "WIN40";
1293 const string SPL_ARCH_W32X86 = "W32X86";
1294 const string SPL_ARCH_W32MIPS = "W32MIPS";
1295 const string SPL_ARCH_W32ALPHA = "W32ALPHA";
1296 const string SPL_ARCH_W32PPC = "W32PPC";
1297 const string SPL_ARCH_IA64 = "IA64";
1298 const string SPL_ARCH_X64 = "x64";
1300 const string SPOOLSS_ARCHITECTURE_ALL = "all";
1301 const string SPOOLSS_ARCHITECTURE_NT_X86 = "Windows NT x86";
1302 const string SPOOLSS_DEFAULT_SERVER_PATH = "C:\\WINDOWS\\system32\\spool";
1304 typedef [public,gensize] struct {
1305 [value(ndr_size_spoolss_OSVersion(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
1309 [value(2)] uint32 unknown;
1310 [subcontext(0),subcontext_size(256)] nstring extra_string;
1311 } spoolss_OSVersion;
1313 typedef [public,gensize] struct {
1314 [value(ndr_size_spoolss_OSVersionEx(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
1318 [value(2)] uint32 unknown1;
1319 [subcontext(0),subcontext_size(256)] nstring extra_string;
1320 uint32 unknown2;/* service pack number? I saw 0 from w2k3 and 1 from winxp sp1*/
1321 uint32 unknown3;/* hmm? w2k3: 131346(0x20112) winxp sp1: 503382272 0x1E010100 */
1322 } spoolss_OSVersionEx;
1324 typedef [nodiscriminant,public,gensize] union {
1326 [case(REG_SZ)] nstring string;
1327 [case(REG_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary;
1328 [case(REG_DWORD)] uint32 value;
1329 [case(REG_MULTI_SZ)] nstring_array string_array;
1330 [default,flag(NDR_REMAINING)] DATA_BLOB data;
1331 } spoolss_PrinterData;
1333 [noopnum,noprint,public] WERROR _spoolss_GetPrinterData(
1334 [in,ref] policy_handle *handle,
1335 [in] [string,charset(UTF16)] uint16 value_name[],
1336 [in] uint32 offered,
1337 [out,ref] winreg_Type *type,
1338 [out,ref] DATA_BLOB *data,
1339 [out,ref] uint32 *needed
1341 [noopnum,noprint,public] void __spoolss_GetPrinterData(
1342 [in] winreg_Type type,
1343 [out,ref,switch_is(type)] spoolss_PrinterData *data
1345 [nopull,nopush,public] WERROR spoolss_GetPrinterData(
1346 [in,ref] policy_handle *handle,
1347 [in] [string,charset(UTF16)] uint16 value_name[],
1348 [in] uint32 offered,
1349 [out,ref] winreg_Type *type,
1350 [out,ref,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData *data,
1351 [out,ref] uint32 *needed
1354 /******************/
1355 /* Function: 0x1b */
1356 [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData(
1357 [in,ref] policy_handle *handle,
1358 [in] [string,charset(UTF16)] uint16 value_name[],
1359 [in] winreg_Type type,
1360 [in] DATA_BLOB data,
1361 [in] uint32 _offered
1363 [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData(
1364 [in] winreg_Type type,
1365 [out,ref,switch_is(type)] spoolss_PrinterData *data
1367 [nopush] WERROR spoolss_SetPrinterData(
1368 [in,ref] policy_handle *handle,
1369 [in] [string,charset(UTF16)] uint16 value_name[],
1370 [in] winreg_Type type,
1371 [in,subcontext(4),switch_is(type)] spoolss_PrinterData data,
1372 [in,value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] uint32 _offered
1375 /******************/
1376 /* Function: 0x1c */
1377 [todo] WERROR spoolss_WaitForPrinterChange(
1380 /******************/
1381 /* Function: 0x1d */
1382 [public] WERROR spoolss_ClosePrinter(
1383 [in,out,ref] policy_handle *handle
1386 /******************/
1387 /* Function: 0x1e */
1388 typedef [v1_enum] enum {
1389 SPOOLSS_FORM_USER = 0,
1390 SPOOLSS_FORM_BUILTIN = 1,
1391 SPOOLSS_FORM_PRINTER = 2
1392 } spoolss_FormFlags;
1406 typedef [public,gensize] struct {
1407 spoolss_FormFlags flags;
1408 [relative] nstring *form_name;
1409 spoolss_FormSize size;
1410 spoolss_FormArea area;
1411 } spoolss_FormInfo1;
1413 typedef [bitmap32bit] bitmap {
1414 SPOOLSS_FORM_STRING_TYPE_NONE = 0x00000001,
1415 SPOOLSS_FORM_STRING_TYPE_MUI_DLL = 0x00000002,
1416 SPOOLSS_FORM_STRING_TYPE_LANG_PAIR = 0x00000004
1417 } spoolss_FormStringType;
1419 typedef [public,gensize] struct {
1420 spoolss_FormFlags flags;
1421 [relative] nstring *form_name;
1422 spoolss_FormSize size;
1423 spoolss_FormArea area;
1424 [relative] astring *keyword;
1425 spoolss_FormStringType string_type;
1426 [relative] nstring *mui_dll;
1427 uint32 ressource_id;
1428 [relative] nstring *display_name;
1430 } spoolss_FormInfo2;
1432 typedef [nodiscriminant,relative_base,public,gensize] union {
1433 [case(1)] spoolss_FormInfo1 info1;
1434 [case(2)] spoolss_FormInfo2 info2;
1439 spoolss_FormFlags flags;
1440 [string,charset(UTF16)] uint16 *form_name;
1441 spoolss_FormSize size;
1442 spoolss_FormArea area;
1443 } spoolss_AddFormInfo1;
1446 spoolss_FormFlags flags;
1447 [string,charset(UTF16)] uint16 *form_name;
1448 spoolss_FormSize size;
1449 spoolss_FormArea area;
1450 [string,charset(DOS)] uint8 *keyword;
1451 spoolss_FormStringType string_type;
1452 [string,charset(UTF16)] uint16 *mui_dll;
1453 uint32 ressource_id;
1454 [string,charset(UTF16)] uint16 *display_name;
1456 } spoolss_AddFormInfo2;
1458 typedef [switch_type(uint32)] union {
1459 [case(1)] spoolss_AddFormInfo1 *info1;
1460 [case(2)] spoolss_AddFormInfo2 *info2;
1461 } spoolss_AddFormInfo;
1463 WERROR spoolss_AddForm(
1464 [in,ref] policy_handle *handle,
1466 [in,switch_is(level)] spoolss_AddFormInfo info
1469 /******************/
1470 /* Function: 0x1f */
1471 WERROR spoolss_DeleteForm(
1472 [in,ref] policy_handle *handle,
1473 [in] [string,charset(UTF16)] uint16 form_name[]
1476 /******************/
1477 /* Function: 0x20 */
1478 WERROR spoolss_GetForm(
1479 [in,ref] policy_handle *handle,
1480 [in] [string,charset(UTF16)] uint16 form_name[],
1482 [in,unique] DATA_BLOB *buffer,
1483 [in] uint32 offered,
1484 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
1485 [out,ref] uint32 *needed
1488 /******************/
1489 /* Function: 0x21 */
1490 WERROR spoolss_SetForm(
1491 [in,ref] policy_handle *handle,
1492 [in] [string,charset(UTF16)] uint16 form_name[],
1494 [in,switch_is(level)] spoolss_AddFormInfo info
1497 /******************/
1498 /* Function: 0x22 */
1499 [public,noopnum,noprint] WERROR _spoolss_EnumForms(
1500 [in,ref] policy_handle *handle,
1502 [in,unique] DATA_BLOB *buffer,
1503 [in] uint32 offered,
1504 [out,unique] DATA_BLOB *info,
1505 [out,ref] uint32 *needed,
1506 [out,ref] uint32 *count
1508 [public,noopnum,noprint] void __spoolss_EnumForms(
1511 [out,switch_is(level)] spoolss_FormInfo info[count]
1513 [nopull,nopush] WERROR spoolss_EnumForms(
1514 [in,ref] policy_handle *handle,
1516 [in,unique] DATA_BLOB *buffer,
1517 [in] uint32 offered,
1518 [out,ref] uint32 *count,
1519 [out,ref,switch_is(level),size_is(,*count)] spoolss_FormInfo **info,
1520 [out,ref] uint32 *needed
1524 * Special strings for the OpenPrinter() call. See the MSDN DDK
1525 * docs on the XcvDataPort() for more details.
1528 const string SPL_LOCAL_PORT = "Local Port";
1529 const string SPL_TCPIP_PORT = "Standard TCP/IP Port";
1530 const string SPL_XCV_MONITOR_LOCALMON = ",XcvMonitor Local Port";
1531 const string SPL_XCV_MONITOR_TCPMON = ",XcvMonitor Standard TCP/IP Port";
1533 typedef [public,gensize] struct {
1534 [relative] nstring *port_name;
1535 } spoolss_PortInfo1;
1538 SPOOLSS_PORT_TYPE_WRITE = 0x00000001,
1539 SPOOLSS_PORT_TYPE_READ = 0x00000002,
1540 SPOOLSS_PORT_TYPE_REDIRECTED = 0x00000004,
1541 SPOOLSS_PORT_TYPE_NET_ATTACHED = 0x00000008
1544 typedef [public,gensize] struct {
1545 [relative] nstring *port_name;
1546 [relative] nstring *monitor_name;
1547 [relative] nstring *description;
1548 spoolss_PortType port_type;
1550 } spoolss_PortInfo2;
1552 typedef [v1_enum] enum {
1553 PORT_STATUS_CLEAR = 0x00000000,
1554 PORT_STATUS_OFFLINE = 0x00000001,
1555 PORT_STATUS_PAPER_JAM = 0x00000002,
1556 PORT_STATUS_PAPER_OUT = 0x00000003,
1557 PORT_STATUS_OUTPUT_BIN_FULL = 0x00000004,
1558 PORT_STATUS_PAPER_PROBLEM = 0x00000005,
1559 PORT_STATUS_NO_TONER = 0x00000006,
1560 PORT_STATUS_DOOR_OPEN = 0x00000007,
1561 PORT_STATUS_USER_INTERVENTION = 0x00000008,
1562 PORT_STATUS_OUT_OF_MEMORY = 0x00000009,
1563 PORT_STATUS_TONER_LOW = 0x0000000A,
1564 PORT_STATUS_WARMING_UP = 0x0000000B,
1565 PORT_STATUS_POWER_SAVE = 0x0000000C
1566 } spoolss_PortStatus;
1568 typedef [v1_enum] enum {
1569 PORT_STATUS_TYPE_ERROR = 0x00000001,
1570 PORT_STATUS_TYPE_WARNING = 0x00000002,
1571 PORT_STATUS_TYPE_INFO = 0x00000003
1572 } spoolss_PortSeverity;
1574 typedef [public,gensize] struct {
1575 spoolss_PortStatus status;
1576 [relative] nstring *status_string;
1577 spoolss_PortSeverity severity;
1578 } spoolss_PortInfo3;
1580 typedef [public,gensize] struct {
1581 [relative] nstring *port_name;
1582 DATA_BLOB monitor_data; /* relative ?? */
1583 } spoolss_PortInfoFF;
1585 typedef [nodiscriminant,relative_base,public] union {
1586 [case(1)] spoolss_PortInfo1 info1;
1587 [case(2)] spoolss_PortInfo2 info2;
1588 [case(3)] spoolss_PortInfo3 info3;
1589 [case(0xff)] spoolss_PortInfoFF infoFF;
1593 /******************/
1594 /* Function: 0x23 */
1595 [public,noopnum,noprint] WERROR _spoolss_EnumPorts(
1596 [in,unique] [string,charset(UTF16)] uint16 *servername,
1598 [in,unique] DATA_BLOB *buffer,
1599 [in] uint32 offered,
1600 [out,unique] DATA_BLOB *info,
1601 [out,ref] uint32 *needed,
1602 [out,ref] uint32 *count
1604 [public,noopnum,noprint] void __spoolss_EnumPorts(
1607 [out,switch_is(level)] spoolss_PortInfo info[count]
1609 [nopull,nopush] WERROR spoolss_EnumPorts(
1610 [in,unique] [string,charset(UTF16)] uint16 *servername,
1612 [in,unique] DATA_BLOB *buffer,
1613 [in] uint32 offered,
1614 [out,ref] uint32 *count,
1615 [out,ref,switch_is(level),size_is(,*count)] spoolss_PortInfo **info,
1616 [out,ref] uint32 *needed
1619 /******************/
1620 /* Function: 0x24 */
1621 typedef [public,gensize] struct {
1622 [relative] nstring *monitor_name;
1623 } spoolss_MonitorInfo1;
1625 typedef [public,gensize] struct {
1626 [relative] nstring *monitor_name;
1627 [relative] nstring *environment;
1628 [relative] nstring *dll_name;
1629 } spoolss_MonitorInfo2;
1631 typedef [nodiscriminant,relative_base,public] union {
1632 [case(1)] spoolss_MonitorInfo1 info1;
1633 [case(2)] spoolss_MonitorInfo2 info2;
1635 } spoolss_MonitorInfo;
1637 [public,noopnum,noprint] WERROR _spoolss_EnumMonitors(
1638 [in,unique] [string,charset(UTF16)] uint16 *servername,
1640 [in,unique] DATA_BLOB *buffer,
1641 [in] uint32 offered,
1642 [out,unique] DATA_BLOB *info,
1643 [out,ref] uint32 *needed,
1644 [out,ref] uint32 *count
1646 [public,noopnum,noprint] void __spoolss_EnumMonitors(
1649 [out,switch_is(level)] spoolss_MonitorInfo info[count]
1651 [nopull,nopush] WERROR spoolss_EnumMonitors(
1652 [in,unique] [string,charset(UTF16)] uint16 *servername,
1654 [in,unique] DATA_BLOB *buffer,
1655 [in] uint32 offered,
1656 [out,ref] uint32 *count,
1657 [out,ref,switch_is(level),size_is(,*count)] spoolss_MonitorInfo **info,
1658 [out,ref] uint32 *needed
1661 /******************/
1662 /* Function: 0x25 */
1663 WERROR spoolss_AddPort(
1664 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1665 [in] uint32 unknown,
1666 [in] [string,charset(UTF16)] uint16 monitor_name[]
1669 /******************/
1670 /* Function: 0x26 */
1671 [todo] WERROR spoolss_ConfigurePort(
1674 /******************/
1675 /* Function: 0x27 */
1676 [todo] WERROR spoolss_DeletePort(
1679 /******************/
1680 /* Function: 0x28 */
1681 [todo] WERROR spoolss_CreatePrinterIC(
1684 /******************/
1685 /* Function: 0x29 */
1686 [todo] WERROR spoolss_PlayGDIScriptOnPrinterIC(
1689 /******************/
1690 /* Function: 0x2a */
1691 [todo] WERROR spoolss_DeletePrinterIC(
1694 /******************/
1695 /* Function: 0x2b */
1696 [todo] WERROR spoolss_AddPrinterConnection(
1699 /******************/
1700 /* Function: 0x2c */
1701 [todo] WERROR spoolss_DeletePrinterConnection(
1704 /******************/
1705 /* Function: 0x2d */
1706 [todo] WERROR spoolss_PrinterMessageBox(
1707 /* Marked as obsolete in MSDN. "Not necessary and has
1711 /******************/
1712 /* Function: 0x2e */
1713 [todo] WERROR spoolss_AddMonitor(
1716 /******************/
1717 /* Function: 0x2f */
1718 [todo] WERROR spoolss_DeleteMonitor(
1721 /******************/
1722 /* Function: 0x30 */
1723 [todo] WERROR spoolss_DeletePrintProcessor(
1726 /******************/
1727 /* Function: 0x31 */
1728 [todo] WERROR spoolss_AddPrintProvidor(
1731 /******************/
1732 /* Function: 0x32 */
1733 [todo] WERROR spoolss_DeletePrintProvidor(
1736 /******************/
1737 /* Function: 0x33 */
1739 typedef [public,gensize] struct {
1740 [relative] nstring *name_array;
1741 } spoolss_PrintProcDataTypesInfo1;
1743 typedef [nodiscriminant,relative_base,public] union {
1744 [case(1)] spoolss_PrintProcDataTypesInfo1 info1;
1746 } spoolss_PrintProcDataTypesInfo;
1748 [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcDataTypes(
1749 [in,unique] [string,charset(UTF16)] uint16 *servername,
1750 [in,unique] [string,charset(UTF16)] uint16 *print_processor_name,
1752 [in,unique] DATA_BLOB *buffer,
1753 [in] uint32 offered,
1754 [out,unique] DATA_BLOB *info,
1755 [out,ref] uint32 *needed,
1756 [out,ref] uint32 *count
1758 [public,noopnum,noprint] void __spoolss_EnumPrintProcDataTypes(
1761 [out,switch_is(level)] spoolss_PrintProcDataTypesInfo info[count]
1763 [nopull,nopush] WERROR spoolss_EnumPrintProcDataTypes(
1764 [in,unique] [string,charset(UTF16)] uint16 *servername,
1765 [in,unique] [string,charset(UTF16)] uint16 *print_processor_name,
1767 [in,unique] DATA_BLOB *buffer,
1768 [in] uint32 offered,
1769 [out,ref] uint32 *count,
1770 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrintProcDataTypesInfo **info,
1771 [out,ref] uint32 *needed
1774 /******************/
1775 /* Function: 0x34 */
1776 WERROR spoolss_ResetPrinter(
1777 [in,ref] policy_handle *handle,
1778 [in,unique] [string,charset(UTF16)] uint16 *data_type,
1779 [in,ref] spoolss_DevmodeContainer *devmode_ctr
1782 /******************/
1783 /* Function: 0x35 */
1784 WERROR spoolss_GetPrinterDriver2(
1785 [in,ref] policy_handle *handle,
1786 [in,unique] [string,charset(UTF16)] uint16 *architecture,
1788 [in,unique] DATA_BLOB *buffer,
1789 [in] uint32 offered,
1790 [in] uint32 client_major_version,
1791 [in] uint32 client_minor_version,
1792 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverInfo *info,
1793 [out,ref] uint32 *needed,
1794 [out,ref] uint32 *server_major_version,
1795 [out,ref] uint32 *server_minor_version
1798 /******************/
1799 /* Function: 0x36 */
1800 [todo] WERROR spoolss_FindFirstPrinterChangeNotification(
1803 /******************/
1804 /* Function: 0x37 */
1805 [todo] WERROR spoolss_FindNextPrinterChangeNotification(
1808 /******************/
1809 /* Function: 0x38 */
1810 [public] WERROR spoolss_FindClosePrinterNotify(
1811 [in,ref] policy_handle *handle
1814 /******************/
1815 /* Function: 0x39 */
1816 [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotificationOld(
1819 /******************/
1820 /* Function: 0x3a */
1821 [public] WERROR spoolss_ReplyOpenPrinter(
1822 [in,string,charset(UTF16)] uint16 server_name[],
1823 [in] uint32 printer_local,
1824 [in] winreg_Type type,
1825 [in,range(0,512)] uint32 bufsize,
1826 [in,unique,size_is(bufsize)] uint8 *buffer,
1827 [out,ref] policy_handle *handle
1830 /******************/
1831 /* Function: 0x3b */
1833 typedef [bitmap32bit] bitmap {
1834 PRINTER_CHANGE_ADD_PRINTER = 0x00000001,
1835 PRINTER_CHANGE_SET_PRINTER = 0x00000002,
1836 PRINTER_CHANGE_DELETE_PRINTER = 0x00000004,
1837 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER = 0x00000008,
1838 PRINTER_CHANGE_ADD_JOB = 0x00000100,
1839 PRINTER_CHANGE_SET_JOB = 0x00000200,
1840 PRINTER_CHANGE_DELETE_JOB = 0x00000400,
1841 PRINTER_CHANGE_WRITE_JOB = 0x00000800,
1842 PRINTER_CHANGE_ADD_FORM = 0x00010000,
1843 PRINTER_CHANGE_SET_FORM = 0x00020000,
1844 PRINTER_CHANGE_DELETE_FORM = 0x00040000,
1845 PRINTER_CHANGE_ADD_PORT = 0x00100000,
1846 PRINTER_CHANGE_CONFIGURE_PORT = 0x00200000,
1847 PRINTER_CHANGE_DELETE_PORT = 0x00400000,
1848 PRINTER_CHANGE_ADD_PRINT_PROCESSOR = 0x01000000,
1849 PRINTER_CHANGE_DELETE_PRINT_PROCESSOR = 0x04000000,
1850 PRINTER_CHANGE_SERVER = 0x08000000,
1851 PRINTER_CHANGE_ADD_PRINTER_DRIVER = 0x10000000,
1852 PRINTER_CHANGE_SET_PRINTER_DRIVER = 0x20000000,
1853 PRINTER_CHANGE_DELETE_PRINTER_DRIVER = 0x40000000,
1854 PRINTER_CHANGE_TIMEOUT = 0x80000000
1855 } spoolss_PrinterChangeFlags;
1857 const int PRINTER_CHANGE_PRINTER = 0x000000FF;
1859 const int PRINTER_CHANGE_JOB = 0x0000FF00;
1861 const int PRINTER_CHANGE_FORM = (PRINTER_CHANGE_ADD_FORM |
1862 PRINTER_CHANGE_SET_FORM |
1863 PRINTER_CHANGE_DELETE_FORM); /* 0x00070000 */
1865 const int PRINTER_CHANGE_PORT = (PRINTER_CHANGE_ADD_PORT |
1866 PRINTER_CHANGE_CONFIGURE_PORT |
1867 PRINTER_CHANGE_DELETE_PORT); /* 0x00700000 */
1869 const int PRINTER_CHANGE_PRINT_PROCESSOR = 0x07000000;
1871 const int PRINTER_CHANGE_PRINTER_DRIVER = (PRINTER_CHANGE_ADD_PRINTER_DRIVER |
1872 PRINTER_CHANGE_SET_PRINTER_DRIVER |
1873 PRINTER_CHANGE_DELETE_PRINTER_DRIVER); /* 0x70000000 */
1875 const int PRINTER_CHANGE_ALL = (PRINTER_CHANGE_PRINTER |
1876 PRINTER_CHANGE_JOB |
1877 PRINTER_CHANGE_FORM |
1878 PRINTER_CHANGE_PORT |
1879 PRINTER_CHANGE_PRINT_PROCESSOR |
1880 PRINTER_CHANGE_PRINTER_DRIVER); /* 0x7777FFFF */
1881 WERROR spoolss_RouterReplyPrinter(
1882 [in,ref] policy_handle *handle,
1883 [in] spoolss_PrinterChangeFlags flags,
1884 [in,range(0,512)] uint32 bufsize,
1885 [in,unique,size_is(bufsize)] uint8 *buffer
1888 /******************/
1889 /* Function: 0x3c */
1890 [public] WERROR spoolss_ReplyClosePrinter(
1891 [in,out,ref] policy_handle *handle
1894 /******************/
1895 /* Function: 0x3d */
1896 [todo] WERROR spoolss_AddPortEx(
1899 /******************/
1900 /* Function: 0x3e */
1901 [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotification(
1904 /******************/
1905 /* Function: 0x3f */
1906 [todo] WERROR spoolss_SpoolerInit(
1909 /******************/
1910 /* Function: 0x40 */
1911 [todo] WERROR spoolss_ResetPrinterEx(
1914 typedef [enum16bit,public] enum {
1915 JOB_NOTIFY_FIELD_PRINTER_NAME = 0x00,
1916 JOB_NOTIFY_FIELD_MACHINE_NAME = 0x01,
1917 JOB_NOTIFY_FIELD_PORT_NAME = 0x02,
1918 JOB_NOTIFY_FIELD_USER_NAME = 0x03,
1919 JOB_NOTIFY_FIELD_NOTIFY_NAME = 0x04,
1920 JOB_NOTIFY_FIELD_DATATYPE = 0x05,
1921 JOB_NOTIFY_FIELD_PRINT_PROCESSOR = 0x06,
1922 JOB_NOTIFY_FIELD_PARAMETERS = 0x07,
1923 JOB_NOTIFY_FIELD_DRIVER_NAME = 0x08,
1924 JOB_NOTIFY_FIELD_DEVMODE = 0x09,
1925 JOB_NOTIFY_FIELD_STATUS = 0x0a,
1926 JOB_NOTIFY_FIELD_STATUS_STRING = 0x0b,
1927 JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR = 0x0c,
1928 JOB_NOTIFY_FIELD_DOCUMENT = 0x0d,
1929 JOB_NOTIFY_FIELD_PRIORITY = 0x0e,
1930 JOB_NOTIFY_FIELD_POSITION = 0x0f,
1931 JOB_NOTIFY_FIELD_SUBMITTED = 0x10,
1932 JOB_NOTIFY_FIELD_START_TIME = 0x11,
1933 JOB_NOTIFY_FIELD_UNTIL_TIME = 0x12,
1934 JOB_NOTIFY_FIELD_TIME = 0x13,
1935 JOB_NOTIFY_FIELD_TOTAL_PAGES = 0x14,
1936 JOB_NOTIFY_FIELD_PAGES_PRINTED = 0x15,
1937 JOB_NOTIFY_FIELD_TOTAL_BYTES = 0x16,
1938 JOB_NOTIFY_FIELD_BYTES_PRINTED = 0x17
1939 } spoolss_JobNotifyField;
1941 typedef [enum16bit,public] enum {
1942 PRINTER_NOTIFY_FIELD_SERVER_NAME = 0x00,
1943 PRINTER_NOTIFY_FIELD_PRINTER_NAME = 0x01,
1944 PRINTER_NOTIFY_FIELD_SHARE_NAME = 0x02,
1945 PRINTER_NOTIFY_FIELD_PORT_NAME = 0x03,
1946 PRINTER_NOTIFY_FIELD_DRIVER_NAME = 0x04,
1947 PRINTER_NOTIFY_FIELD_COMMENT = 0x05,
1948 PRINTER_NOTIFY_FIELD_LOCATION = 0x06,
1949 PRINTER_NOTIFY_FIELD_DEVMODE = 0x07,
1950 PRINTER_NOTIFY_FIELD_SEPFILE = 0x08,
1951 PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR = 0x09,
1952 PRINTER_NOTIFY_FIELD_PARAMETERS = 0x0a,
1953 PRINTER_NOTIFY_FIELD_DATATYPE = 0x0b,
1954 PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR = 0x0c,
1955 PRINTER_NOTIFY_FIELD_ATTRIBUTES = 0x0d,
1956 PRINTER_NOTIFY_FIELD_PRIORITY = 0x0e,
1957 PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY = 0x0f,
1958 PRINTER_NOTIFY_FIELD_START_TIME = 0x10,
1959 PRINTER_NOTIFY_FIELD_UNTIL_TIME = 0x11,
1960 PRINTER_NOTIFY_FIELD_STATUS = 0x12,
1961 PRINTER_NOTIFY_FIELD_STATUS_STRING = 0x13,
1962 PRINTER_NOTIFY_FIELD_CJOBS = 0x14,
1963 PRINTER_NOTIFY_FIELD_AVERAGE_PPM = 0x15,
1964 PRINTER_NOTIFY_FIELD_TOTAL_PAGES = 0x16,
1965 PRINTER_NOTIFY_FIELD_PAGES_PRINTED = 0x17,
1966 PRINTER_NOTIFY_FIELD_TOTAL_BYTES = 0x18,
1967 PRINTER_NOTIFY_FIELD_BYTES_PRINTED = 0x19,
1968 PRINTER_NOTIFY_FIELD_OBJECT_GUID = 0x1a,
1969 PRINTER_NOTIFY_FIELD_FRIENDLY_NAME = 0x1b
1970 } spoolss_PrintNotifyField;
1972 typedef [enum16bit] enum {
1973 PRINTER_NOTIFY_TYPE = 0x00,
1974 JOB_NOTIFY_TYPE = 0x01
1975 } spoolss_NotifyType;
1977 typedef [nodiscriminant,noprint] union {
1978 [case(PRINTER_NOTIFY_TYPE)] uint16 field;
1979 [case(JOB_NOTIFY_TYPE)] uint16 field;
1980 [default] uint16 field;
1983 /******************/
1984 /* Function: 0x41 */
1986 spoolss_NotifyType type;
1991 [size_is(count),switch_is(type)] spoolss_Field *fields;
1992 } spoolss_NotifyOptionType;
1994 typedef [bitmap32bit] bitmap {
1995 PRINTER_NOTIFY_OPTIONS_REFRESH = 0x00000001
1996 } spoolssNotifyOptionFlags;
1999 [value(2)] uint32 version;
2000 spoolssNotifyOptionFlags flags;
2002 [size_is(count)] spoolss_NotifyOptionType *types;
2003 } spoolss_NotifyOption;
2005 [public] WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
2006 [in,ref] policy_handle *handle,
2007 [in] spoolss_PrinterChangeFlags flags,
2008 [in] uint32 options,
2009 [in,unique] [string,charset(UTF16)] uint16 *local_machine,
2010 [in] uint32 printer_local,
2011 [in,unique] spoolss_NotifyOption *notify_options
2014 /******************/
2015 /* Function: 0x42 */
2019 [size_is(size/2),unique,charset(UTF16)] uint16 *string;
2020 } spoolss_NotifyString;
2022 typedef [v1_enum] enum {
2023 NOTIFY_TABLE_DWORD = 0x0001,
2024 NOTIFY_TABLE_STRING = 0x0002,
2025 NOTIFY_TABLE_DEVMODE = 0x0003,
2026 NOTIFY_TABLE_TIME = 0x0004,
2027 NOTIFY_TABLE_SECURITYDESCRIPTOR = 0x0005
2028 } spoolss_NotifyTable;
2030 typedef [switch_type(uint32)] union {
2031 [case(1)] uint32 integer[2];
2032 [case(2)] spoolss_NotifyString string;
2033 [case(3)] spoolss_DevmodeContainer devmode;
2034 [case(4)] spoolss_TimeCtr time;
2035 [case(5)] sec_desc_buf sd;
2036 } spoolss_NotifyData;
2039 spoolss_NotifyType type;
2040 [switch_is(type)] spoolss_Field field;
2041 spoolss_NotifyTable variable_type;
2043 [switch_is(variable_type)] spoolss_NotifyData data;
2047 [value(2)] uint32 version;
2050 [size_is(count)] spoolss_Notify notifies[];
2051 } spoolss_NotifyInfo;
2053 typedef [switch_type(uint32)] union {
2054 [case(0)] spoolss_NotifyInfo *info0;
2055 } spoolss_ReplyPrinterInfo;
2057 typedef [bitmap32bit] bitmap {
2058 PRINTER_NOTIFY_INFO_DISCARDED = 0x00000001,
2059 PRINTER_NOTIFY_INFO_DISCARDNOTED = 0x00010000,
2060 PRINTER_NOTIFY_INFO_COLOR_MISMATCH = 0x00080000
2061 } spoolss_PrinterNotifyFlags;
2063 WERROR spoolss_RouterReplyPrinterEx(
2064 [in,ref] policy_handle *handle,
2066 [in] spoolss_PrinterChangeFlags flags,
2067 [out,ref] spoolss_PrinterNotifyFlags *reply_result,
2068 [in] uint32 reply_type,
2069 [in,switch_is(reply_type)] spoolss_ReplyPrinterInfo info
2072 /******************/
2073 /* Function: 0x43 */
2074 [public] WERROR spoolss_RouterRefreshPrinterChangeNotify(
2075 [in,ref] policy_handle *handle,
2076 [in] uint32 change_low,
2077 [in,unique] spoolss_NotifyOption *options,
2078 [out,ref] spoolss_NotifyInfo **info
2081 /******************/
2082 /* Function: 0x44 */
2083 [todo] WERROR spoolss_44(
2088 [string,charset(UTF16)] uint16 *client;
2089 [string,charset(UTF16)] uint16 *user;
2091 spoolss_MajorVersion major;
2092 spoolss_MinorVersion minor;
2093 spoolss_ProcessorArchitecture processor;
2094 } spoolss_UserLevel1;
2098 } spoolss_UserLevel2;
2104 [string,charset(UTF16)] uint16 *client;
2105 [string,charset(UTF16)] uint16 *user;
2107 spoolss_MajorVersion major;
2108 spoolss_MinorVersion minor;
2109 spoolss_ProcessorArchitecture processor;
2111 } spoolss_UserLevel3;
2113 typedef [switch_type(uint32)] union {
2114 [case(1)] spoolss_UserLevel1 *level1;
2115 [case(2)] spoolss_UserLevel2 *level2;
2116 [case(3)] spoolss_UserLevel3 *level3;
2117 } spoolss_UserLevel;
2121 [switch_is(level)] spoolss_UserLevel user_info;
2122 } spoolss_UserLevelCtr;
2125 SERVER_ACCESS_ADMINISTER = 0x00000001,
2126 SERVER_ACCESS_ENUMERATE = 0x00000002,
2127 PRINTER_ACCESS_ADMINISTER = 0x00000004,
2128 PRINTER_ACCESS_USE = 0x00000008,
2129 JOB_ACCESS_ADMINISTER = 0x00000010,
2130 JOB_ACCESS_READ = 0x00000020
2131 } spoolss_AccessRights;
2133 /* Access rights for print servers */
2134 const int SERVER_ALL_ACCESS = SEC_STD_REQUIRED |
2135 SERVER_ACCESS_ADMINISTER |
2136 SERVER_ACCESS_ENUMERATE;
2138 const int SERVER_READ = SEC_STD_READ_CONTROL |
2139 SERVER_ACCESS_ENUMERATE;
2141 const int SERVER_WRITE = STANDARD_RIGHTS_WRITE_ACCESS |
2142 SERVER_ACCESS_ADMINISTER |
2143 SERVER_ACCESS_ENUMERATE;
2145 const int SERVER_EXECUTE = SEC_STD_READ_CONTROL |
2146 SERVER_ACCESS_ENUMERATE;
2148 /* Access rights for printers */
2149 const int PRINTER_ALL_ACCESS = SEC_STD_REQUIRED |
2150 PRINTER_ACCESS_ADMINISTER |
2153 const int PRINTER_READ = SEC_STD_READ_CONTROL |
2156 const int PRINTER_WRITE = STANDARD_RIGHTS_WRITE_ACCESS |
2159 const int PRINTER_EXECUTE = SEC_STD_READ_CONTROL |
2162 /* Access rights for jobs */
2163 const int JOB_ALL_ACCESS = SEC_STD_REQUIRED |
2164 JOB_ACCESS_ADMINISTER;
2166 const int JOB_READ = SEC_STD_READ_CONTROL |
2167 JOB_ACCESS_ADMINISTER;
2169 const int JOB_WRITE = STANDARD_RIGHTS_WRITE_ACCESS |
2170 JOB_ACCESS_ADMINISTER;
2172 const int JOB_EXECUTE = SEC_STD_READ_CONTROL |
2173 JOB_ACCESS_ADMINISTER;
2175 /* ACE masks for various print permissions */
2176 const int PRINTER_ACE_FULL_CONTROL = SEC_GENERIC_ALL |
2179 const int PRINTER_ACE_MANAGE_DOCUMENTS = SEC_GENERIC_ALL |
2180 READ_CONTROL_ACCESS;
2182 const int PRINTER_ACE_PRINT = GENERIC_EXECUTE_ACCESS |
2183 READ_CONTROL_ACCESS |
2186 /******************/
2187 /* Function: 0x45 */
2188 [public] WERROR spoolss_OpenPrinterEx(
2189 [in,unique] [string,charset(UTF16)] uint16 *printername,
2190 [in,unique] [string,charset(UTF16)] uint16 *datatype,
2191 [in] spoolss_DevmodeContainer devmode_ctr,
2192 [in] spoolss_AccessRights access_mask,
2194 [in,switch_is(level)] spoolss_UserLevel userlevel,
2195 [out,ref] policy_handle *handle
2198 /******************/
2199 /* Function: 0x46 */
2200 WERROR spoolss_AddPrinterEx(
2201 [in,unique] [string,charset(UTF16)] uint16 *server,
2202 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
2203 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
2204 [in,ref] sec_desc_buf *secdesc_ctr,
2205 [in,ref] spoolss_UserLevelCtr *userlevel_ctr,
2206 [out,ref] policy_handle *handle
2209 /******************/
2210 /* Function: 0x47 */
2211 [todo] WERROR spoolss_47(
2214 /******************/
2215 /* Function: 0x48 */
2216 WERROR spoolss_EnumPrinterData(
2217 [in,ref] policy_handle *handle,
2218 [in] uint32 enum_index,
2219 [out,size_is(value_offered/2),charset(UTF16)] uint16 value_name[],
2220 [in] uint32 value_offered,
2221 [out,ref] uint32 *value_needed,
2222 [out,ref] winreg_Type *type,
2223 [out,ref,size_is(data_offered),flag(LIBNDR_PRINT_ARRAY_HEX)] uint8 *data,
2224 [in] uint32 data_offered,
2225 [out,ref] uint32 *data_needed
2228 /******************/
2229 /* Function: 0x49 */
2230 WERROR spoolss_DeletePrinterData(
2231 [in,ref] policy_handle *handle,
2232 [in] [string,charset(UTF16)] uint16 value_name[]
2235 /******************/
2236 /* Function: 0x4a */
2237 [todo] WERROR spoolss_4a(
2240 /******************/
2241 /* Function: 0x4b */
2242 [todo] WERROR spoolss_4b(
2245 /******************/
2246 /* Function: 0x4c */
2247 [todo] WERROR spoolss_4c(
2250 /******************/
2251 /* Function: 0x4d */
2252 WERROR spoolss_SetPrinterDataEx(
2253 [in,ref] policy_handle *handle,
2254 [in] [string,charset(UTF16)] uint16 key_name[],
2255 [in] [string,charset(UTF16)] uint16 value_name[],
2256 [in] winreg_Type type,
2257 [in,ref] [size_is(offered)] uint8 *buffer,
2261 /******************/
2262 /* Function: 0x4e */
2263 WERROR spoolss_GetPrinterDataEx(
2264 [in,ref] policy_handle *handle,
2265 [in] [string,charset(UTF16)] uint16 key_name[],
2266 [in] [string,charset(UTF16)] uint16 value_name[],
2267 [out,ref] winreg_Type *type,
2268 [out,ref] [size_is(offered)] uint8 *buffer,
2269 [in] uint32 offered,
2270 [out,ref] uint32 *needed
2273 /******************/
2274 /* Function: 0x4f */
2276 typedef [relative_base,public,gensize] struct {
2277 [relative] nstring *value_name;
2278 [value(2*strlen_m_term(value_name))] uint32 value_name_len;
2280 [relative,switch_is(type),subcontext(0),subcontext_size(r->data_length)] spoolss_PrinterData *data;
2281 [value(ndr_size_spoolss_PrinterData(data, type, ndr->iconv_convenience, ndr->flags))] uint32 data_length;
2282 } spoolss_PrinterEnumValues;
2284 [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDataEx(
2285 [in,ref] policy_handle *handle,
2286 [in] [string,charset(UTF16)] uint16 key_name[],
2287 [out] DATA_BLOB info,
2288 [in] uint32 offered,
2289 [out,ref] uint32 *needed,
2290 [out,ref] uint32 *count
2292 [public,noopnum,noprint] void __spoolss_EnumPrinterDataEx(
2294 [out] spoolss_PrinterEnumValues info[count]
2296 [nopull,nopush] WERROR spoolss_EnumPrinterDataEx(
2297 [in,ref] policy_handle *handle,
2298 [in] [string,charset(UTF16)] uint16 key_name[],
2299 [in] uint32 offered,
2300 [out,ref] uint32 *count,
2301 [out,ref,size_is(,*count)] spoolss_PrinterEnumValues **info,
2302 [out,ref] uint32 *needed
2305 /******************/
2306 /* Function: 0x50 */
2307 [public] WERROR spoolss_EnumPrinterKey(
2308 [in, ref] policy_handle *handle,
2309 [in] [string,charset(UTF16)] uint16 key_name[],
2310 [out,ref] spoolss_StringArray2 *key_buffer,
2311 [in] uint32 offered,
2312 [out,ref] uint32 *needed
2315 /******************/
2316 /* Function: 0x51 */
2317 WERROR spoolss_DeletePrinterDataEx(
2318 [in,ref] policy_handle *handle,
2319 [in] [string,charset(UTF16)] uint16 key_name[],
2320 [in] [string,charset(UTF16)] uint16 value_name[]
2323 /******************/
2324 /* Function: 0x52 */
2325 WERROR spoolss_DeletePrinterKey(
2326 [in,ref] policy_handle *handle,
2327 [in] [string,charset(UTF16)] uint16 key_name[]
2330 /******************/
2331 /* Function: 0x53 */
2332 [todo] WERROR spoolss_53(
2335 /******************/
2336 /* Function: 0x54 */
2337 typedef [public,bitmap32bit] bitmap {
2338 DPD_DELETE_UNUSED_FILES = 0x00000001,
2339 DPD_DELETE_SPECIFIC_VERSION = 0x00000002,
2340 DPD_DELETE_ALL_FILES = 0x00000004
2341 } spoolss_DeleteDriverFlags;
2343 WERROR spoolss_DeletePrinterDriverEx(
2344 [in,unique] [string,charset(UTF16)] uint16 *server,
2345 [in] [string,charset(UTF16)] uint16 architecture[],
2346 [in] [string,charset(UTF16)] uint16 driver[],
2347 [in] spoolss_DeleteDriverFlags delete_flags,
2351 /******************/
2352 /* Function: 0x55 */
2353 [todo] WERROR spoolss_55(
2356 /******************/
2357 /* Function: 0x56 */
2358 [todo] WERROR spoolss_56(
2361 /******************/
2362 /* Function: 0x57 */
2363 [todo] WERROR spoolss_57(
2366 /******************/
2367 /* Function: 0x58 */
2369 typedef [v1_enum] enum {
2370 PROTOCOL_RAWTCP_TYPE = 1,
2371 PROTOCOL_LPR_TYPE = 2
2372 } spoolss_PortProtocol;
2374 typedef [public] struct {
2375 [charset(UTF16)] uint16 portname[64];
2376 [value(0x00000001)] uint32 version;
2377 spoolss_PortProtocol protocol;
2378 [value(sizeof(r))] uint32 size;
2380 [charset(UTF16)] uint16 hostaddress[49];
2381 [charset(UTF16)] uint16 snmpcommunity[33];
2383 [charset(UTF16)] uint16 queue[33];
2384 [charset(UTF16)] uint16 ip_address[16]; /* s3 had 17 */
2385 [charset(UTF16)] uint16 hardware_address[13];
2386 [charset(UTF16)] uint16 device_type[257];
2388 boolean32 snmp_enabled;
2389 uint32 snmp_dev_index;
2390 } spoolss_PortData1;
2392 typedef [public] struct {
2393 [charset(UTF16)] uint16 portname[64];
2394 [value(0x00000002)] uint32 version;
2395 spoolss_PortProtocol protocol;
2396 [value(sizeof(r))] uint32 size;
2398 [charset(UTF16)] uint16 hostaddress[128];
2399 [charset(UTF16)] uint16 snmpcommunity[33];
2401 [charset(UTF16)] uint16 queue[33];
2402 [charset(UTF16)] uint16 device_type[257];
2404 boolean32 snmp_enabled;
2405 uint32 snmp_dev_index;
2406 uint32 port_monitor_mib_index;
2407 } spoolss_PortData2;
2409 typedef [public] struct {
2411 } spoolss_MonitorUi;
2413 WERROR spoolss_XcvData(
2414 [in,ref] policy_handle *handle,
2415 [in] [string,charset(UTF16)] uint16 function_name[],
2416 [in] DATA_BLOB in_data,
2417 [in,value(r->in.in_data.length)] uint32 _in_data_length,
2418 [out,ref] [size_is(out_data_size)] uint8 *out_data,
2419 [in] uint32 out_data_size,
2420 [out,ref] uint32 *needed,
2421 [in,out,ref] uint32 *status_code
2424 /******************/
2425 /* Function: 0x59 */
2427 typedef [bitmap32bit] bitmap {
2428 APD_STRICT_UPGRADE = 0x00000001,
2429 APD_STRICT_DOWNGRADE = 0x00000002,
2430 APD_COPY_ALL_FILES = 0x00000004,
2431 APD_COPY_NEW_FILES = 0x00000008,
2432 APD_COPY_FROM_DIRECTORY = 0x00000010,
2433 APD_DONT_COPY_FILES_TO_CLUSTER = 0x00001000,
2434 APD_COPY_TO_ALL_SPOOLERS = 0x00002000,
2435 APD_RETURN_BLOCKING_STATUS_CODE = 0x00010000
2436 } spoolss_AddPrinterDriverExFlags;
2438 [public] WERROR spoolss_AddPrinterDriverEx(
2439 [in,unique] [string,charset(UTF16)] uint16 *servername,
2440 [in,ref] spoolss_AddDriverInfoCtr *info_ctr,
2441 [in] spoolss_AddPrinterDriverExFlags flags
2444 /******************/
2445 /* Function: 0x5a */
2446 [todo] WERROR spoolss_5a(
2449 /******************/
2450 /* Function: 0x5b */
2451 [todo] WERROR spoolss_5b(
2454 /******************/
2455 /* Function: 0x5c */
2456 [todo] WERROR spoolss_5c(
2459 /******************/
2460 /* Function: 0x5d */
2461 [todo] WERROR spoolss_5d(
2464 /******************/
2465 /* Function: 0x5e */
2466 [todo] WERROR spoolss_5e(
2469 /******************/
2470 /* Function: 0x5f */
2471 [todo] WERROR spoolss_5f(