s3-spoolss: move SPL_ARCH_X defines to IDL.
[jra/samba/.git] / librpc / idl / spoolss.idl
1 #include "idl_types.h"
2
3 /*
4   spoolss interface definitions
5 */
6 import "misc.idl", "security.idl", "winreg.idl";
7
8 [ uuid("12345678-1234-abcd-ef00-0123456789ab"),
9   version(1.0),
10   endpoint("ncacn_np:[\\pipe\\spoolss]"),
11   pointer_default(unique),
12   helpstring("Spooler SubSystem"),
13   helper("../librpc/ndr/ndr_spoolss_buf.h")
14 ] interface spoolss
15 {
16         typedef [v1_enum] enum winreg_Type winreg_Type;
17         typedef [gensize] struct {
18                 uint16 year;
19                 uint16 month;
20                 uint16 day_of_week;
21                 uint16 day;
22                 uint16 hour;
23                 uint16 minute;
24                 uint16 second;
25                 uint16 millisecond;
26         } spoolss_Time;
27
28         typedef struct {
29                 [value(ndr_size_spoolss_Time(time, ndr->iconv_convenience, ndr->flags))] uint32 size;
30                 [unique] spoolss_Time *time;
31         } spoolss_TimeCtr;
32
33         typedef enum {
34                 PROCESSOR_ARCHITECTURE_INTEL            = 0x0000,
35                 PROCESSOR_ARCHITECTURE_IA64             = 0x0006,
36                 PROCESSOR_ARCHITECTURE_AMD64            = 0x0009
37         } spoolss_ProcessorArchitecture;
38
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;
46
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;
55
56         typedef [v1_enum] enum {
57                 /* Windows 2008, Windows Vista, Windows 2000, Windows NT4, Windows 95 */
58                 SPOOLSS_MINOR_VERSION_0                 = 0x00000000,
59                 /* Windows XP */
60                 SPOOLSS_MINOR_VERSION_XP                = 0x00000001,
61                 /* Windows 2003, Windows XP x64 */
62                 SPOOLSS_MINOR_VERSION_2003_XP64         = 0x00000002,
63                 /* Windows 98 */
64                 SPOOLSS_MINOR_VERSION_98                = 0x0000000a,
65                 /* Windows Me */
66                 SPOOLSS_MINOR_VERSION_ME                = 0x0000005a
67         } spoolss_MinorVersion;
68
69         const int PRINTER_STATUS_OK             = 0x00000000;
70
71         typedef bitmap {
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;
98
99         /* JOB status codes. */
100
101         const int JOB_STATUS_QUEUED = 0x0000;
102
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
117         } spoolss_JobStatus;
118
119         typedef [public,gensize] struct {
120                 [relative] nstring *printername;
121                 [relative] nstring *servername;
122                 uint32 cjobs;
123                 uint32 total_jobs;
124                 uint32 total_bytes;
125                 spoolss_Time time;
126                 uint32 global_counter;
127                 uint32 total_pages;
128                 uint32 version;
129                 uint32 free_build;
130                 uint32 spooling;
131                 uint32 max_spooling;
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;
139                 uint32 change_id;
140                 WERROR last_error;
141                 spoolss_PrinterStatus status;
142                 uint32 enumerate_network_printers;
143                 uint32 c_setprinter;
144                 spoolss_ProcessorArchitecture processor_architecture;
145                 uint16 processor_level;
146                 uint32 ref_ic;
147                 uint32 reserved2;
148                 uint32 reserved3;
149         } spoolss_PrinterInfo0;
150
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;
181
182         typedef [public,gensize] struct {
183                 [charset(UTF16)] uint16 devicename[32];
184                 uint16 specversion;
185                 uint16 driverversion;
186                 uint16 size;
187                 [value(r->driverextra_data.length)] uint16 __driverextra_length;
188                 spoolss_DeviceModeFields fields;
189                 uint16 orientation;
190                 uint16 papersize;
191                 uint16 paperlength;
192                 uint16 paperwidth;
193                 uint16 scale;
194                 uint16 copies;
195                 uint16 defaultsource;
196                 uint16 printquality;
197                 uint16 color;
198                 uint16 duplex;
199                 uint16 yresolution;
200                 uint16 ttoption;
201                 uint16 collate;
202                 [charset(UTF16)] uint16 formname[32];
203                 uint16 logpixels;
204                 uint32 bitsperpel;
205                 uint32 pelswidth;
206                 uint32 pelsheight;
207                 uint32 displayflags;
208                 uint32 displayfrequency;
209                 uint32 icmmethod;
210                 uint32 icmintent;
211                 uint32 mediatype;
212                 uint32 dithertype;
213                 uint32 reserved1;
214                 uint32 reserved2;
215                 uint32 panningwidth;
216                 uint32 panningheight;
217                 [subcontext_size(__driverextra_length),subcontext(0),flag(NDR_REMAINING)] DATA_BLOB driverextra_data;
218         } spoolss_DeviceMode;
219
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;
241
242         const int PRINTER_ENUM_ICONMASK = (PRINTER_ENUM_ICON1 |
243                                            PRINTER_ENUM_ICON2 |
244                                            PRINTER_ENUM_ICON3 |
245                                            PRINTER_ENUM_ICON4 |
246                                            PRINTER_ENUM_ICON5 |
247                                            PRINTER_ENUM_ICON6 |
248                                            PRINTER_ENUM_ICON7 |
249                                            PRINTER_ENUM_ICON8); /* 0x00ff0000 */
250
251         typedef [public,gensize] struct {
252                 spoolss_EnumPrinterFlags flags;
253                 [relative] nstring *description;
254                 [relative] nstring *name;
255                 [relative] nstring *comment;
256         } spoolss_PrinterInfo1;
257
258         typedef bitmap {
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;
276
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;
294                 uint32 starttime;
295                 uint32 untiltime;
296                 spoolss_PrinterStatus status;
297                 uint32 cjobs;
298                 uint32 averageppm;
299         } spoolss_PrinterInfo2;
300
301         typedef [public,gensize] struct {
302                 [relative,subcontext(0)] security_descriptor *secdesc;
303         } spoolss_PrinterInfo3;
304
305         typedef [public,gensize] struct {
306                 [relative] nstring *printername;
307                 [relative] nstring *servername;
308                 spoolss_PrinterAttributes attributes;
309         } spoolss_PrinterInfo4;
310
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;
318
319         typedef [public,gensize] struct {
320                 spoolss_PrinterStatus status;
321         } spoolss_PrinterInfo6;
322
323         typedef bitmap {
324                 DSPRINT_PUBLISH         = 0x00000001,
325                 DSPRINT_UPDATE          = 0x00000002,
326                 DSPRINT_UNPUBLISH       = 0x00000004,
327                 DSPRINT_REPUBLISH       = 0x00000008,
328                 DSPRINT_PENDING         = 0x80000000
329         } spoolss_DsPrintAction;
330
331         typedef [public,gensize] struct {
332                 [relative] nstring *guid; /* text form of printer guid */
333                 spoolss_DsPrintAction action;
334         } spoolss_PrinterInfo7;
335
336         typedef struct {
337                 [relative,subcontext(0)] spoolss_DeviceMode *devmode;
338         } spoolss_DeviceModeInfo;
339
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;
351                 [default];
352         } spoolss_PrinterInfo;
353
354         /******************/
355         /* Function: 0x00 */
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,
360                 [in] uint32 level,
361                 [in,unique] DATA_BLOB *buffer,
362                 [in] uint32 offered,
363                 [out,unique] DATA_BLOB *info,
364                 [out,ref] uint32 *needed,
365                 [out,ref] uint32 *count
366         );
367         [public,noopnum,noprint] void __spoolss_EnumPrinters(
368                 [in] uint32 level,
369                 [in] uint32 count,
370                 [out,switch_is(level)] spoolss_PrinterInfo info[count]
371         );
372         [nopull,nopush] WERROR spoolss_EnumPrinters(
373                 [in] spoolss_EnumPrinterFlags flags,
374                 [in,unique] [string,charset(UTF16)] uint16 *server,
375                 [in] uint32 level,
376                 [in,unique] DATA_BLOB *buffer,
377                 [in] uint32 offered,
378                 /* what we have here is a subcontext containing an array of no discriminant unions
379                  * and the array has no size in front
380                  */
381                 [out,ref] uint32 *count,
382                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrinterInfo **info,
383                 [out,ref] uint32 *needed
384         );
385
386         /******************/
387         /* Function: 0x01 */
388         typedef struct {
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;
392
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
399         );
400
401         /******************/
402         /* Function: 0x02 */
403
404         typedef [public,gensize] struct {
405                 uint32 job_id;
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;
414                 uint32 position;
415                 uint32 total_pages;
416                 uint32 pages_printed;
417                 spoolss_Time submitted;
418         } spoolss_JobInfo1;
419
420         typedef [public,gensize] struct {
421                 uint32 job_id;
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;
436                 uint32 position;
437                 uint32 start_time;
438                 uint32 until_time;
439                 uint32 total_pages;
440                 uint32 size;
441                 spoolss_Time submitted;
442                 uint32 time;
443                 uint32 pages_printed;
444         } spoolss_JobInfo2;
445
446         typedef [public,gensize] struct {
447                 uint32 job_id;
448                 uint32 next_job_id;
449                 uint32 reserved;
450         } spoolss_JobInfo3;
451
452         typedef [public,gensize] struct {
453                 uint32 job_id;
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;
468                 uint32 position;
469                 uint32 start_time;
470                 uint32 until_time;
471                 uint32 total_pages;
472                 uint32 size;
473                 spoolss_Time submitted;
474                 uint32 time;
475                 uint32 pages_printed;
476                 uint32 size_high;
477         } spoolss_JobInfo4;
478
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;
484                 [default];
485         } spoolss_JobInfo;
486
487         typedef struct {
488                 uint32 job_id;
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;
497                 uint32 position;
498                 uint32 total_pages;
499                 uint32 pages_printed;
500                 spoolss_Time submitted;
501         } spoolss_SetJobInfo1;
502
503         typedef struct {
504                 uint32 job_id;
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;
516                 uint32 _secdesc_ptr;
517                 spoolss_JobStatus status;
518                 [range(0,99)] uint32 priority;
519                 uint32 position;
520                 uint32 start_time;
521                 uint32 until_time;
522                 uint32 total_pages;
523                 uint32 size;
524                 spoolss_Time submitted;
525                 uint32 time;
526                 uint32 pages_printed;
527         } spoolss_SetJobInfo2;
528
529         typedef struct {
530                 uint32 job_id;
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;
542                 uint32 _secdesc_ptr;
543                 spoolss_JobStatus status;
544                 [range(0,99)] uint32 priority;
545                 uint32 position;
546                 uint32 start_time;
547                 uint32 until_time;
548                 uint32 total_pages;
549                 uint32 size;
550                 spoolss_Time submitted;
551                 uint32 time;
552                 uint32 pages_printed;
553                 uint32 size_high;
554         } spoolss_SetJobInfo4;
555
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;
561                 [default];
562         } spoolss_SetJobInfo;
563
564         typedef struct {
565                 uint32 level;
566                 [switch_is(level)] spoolss_SetJobInfo info;
567         } spoolss_JobInfoContainer;
568
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;
580
581         WERROR spoolss_SetJob(
582                 [in,ref] policy_handle *handle,
583                 [in] uint32 job_id,
584                 [in,unique] spoolss_JobInfoContainer *ctr,
585                 [in] spoolss_JobControl command
586         );
587
588         /******************/
589         /* Function: 0x03 */
590         WERROR spoolss_GetJob(
591                 [in,ref] policy_handle *handle,
592                 [in]     uint32 job_id,
593                 [in]     uint32 level,
594                 [in,unique] DATA_BLOB *buffer,
595                 [in]     uint32 offered,
596                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info,
597                 [out,ref] uint32 *needed
598         );
599
600         /******************/
601         /* Function: 0x04 */
602         [public,noopnum,noprint] WERROR _spoolss_EnumJobs(
603                 [in,ref] policy_handle *handle,
604                 [in]     uint32 firstjob,
605                 [in]     uint32 numjobs,
606                 [in]     uint32 level,
607                 [in,unique] DATA_BLOB *buffer,
608                 [in]     uint32 offered,
609                 [out,unique] DATA_BLOB *info,
610                 [out,ref] uint32 *needed,
611                 [out,ref] uint32 *count
612         );
613         [public,noopnum,noprint] void __spoolss_EnumJobs(
614                 [in] uint32 level,
615                 [in] uint32 count,
616                 [out,switch_is(level)] spoolss_JobInfo info[count]
617         );
618         [nopull,nopush] WERROR spoolss_EnumJobs(
619                 [in,ref] policy_handle *handle,
620                 [in]     uint32 firstjob,
621                 [in]     uint32 numjobs,
622                 [in]     uint32 level,
623                 [in,unique] DATA_BLOB *buffer,
624                 [in]     uint32 offered,
625                 [out,ref] uint32 *count,
626                 [out,ref,switch_is(level),size_is(,*count)] spoolss_JobInfo **info,
627                 [out,ref] uint32 *needed
628         );
629
630         /******************/
631         /* Function: 0x05 */
632         [todo] WERROR spoolss_AddPrinter(
633                 /* This function is not implemented in Samba 3 as no
634                    clients have been observed using it. */
635         );
636
637         /******************/
638         /* Function: 0x06 */
639         WERROR spoolss_DeletePrinter(
640                 [in] policy_handle *handle
641         );
642
643         /******************/
644         /* Function: 0x07 */
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;
652
653         typedef struct {
654                 [string,charset(UTF16)] uint16 *servername;
655                 [string,charset(UTF16)] uint16 *printername;
656                 uint32 cjobs;
657                 uint32 total_jobs;
658                 uint32 total_bytes;
659                 spoolss_Time time;
660                 uint32 global_counter;
661                 uint32 total_pages;
662                 uint32 version;
663                 uint32 free_build;
664                 uint32 spooling;
665                 uint32 max_spooling;
666                 uint32 session_counter;
667                 uint32 num_error_out_of_paper;
668                 uint32 num_error_not_ready;
669                 uint32 job_error;
670                 uint32 number_of_processors;
671                 spoolss_ProcessorType processor_type;
672                 uint32 high_part_total_bytes;
673                 uint32 change_id;
674                 WERROR last_error;
675                 uint32 status;
676                 uint32 enumerate_network_printers;
677                 uint32 c_setprinter;
678                 spoolss_ProcessorArchitecture processor_architecture;
679                 uint16 processor_level;
680                 uint32 ref_ic;
681                 uint32 reserved2;
682                 uint32 reserved3;
683         } spoolss_SetPrinterInfo0;
684
685         typedef struct {
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;
691
692         typedef struct {
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;
709                 uint32 starttime;
710                 uint32 untiltime;
711                 spoolss_PrinterStatus status;
712                 uint32 cjobs;
713                 uint32 averageppm;
714         } spoolss_SetPrinterInfo2;
715
716         typedef struct {
717                 uint32 sec_desc_ptr;
718         } spoolss_SetPrinterInfo3;
719
720         typedef struct {
721                 [string,charset(UTF16)] uint16 *printername;
722                 [string,charset(UTF16)] uint16 *servername;
723                 spoolss_PrinterAttributes attributes;
724         } spoolss_SetPrinterInfo4;
725
726         typedef struct {
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;
733
734         typedef struct {
735                 spoolss_PrinterStatus status;
736         } spoolss_SetPrinterInfo6;
737
738         typedef struct {
739                 [string,charset(UTF16)] uint16 *guid; /* text form of printer guid */
740                 spoolss_DsPrintAction action;
741         } spoolss_SetPrinterInfo7;
742
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;
754                 [default];
755         } spoolss_SetPrinterInfo;
756
757         typedef struct {
758                 uint32 level;
759                 [switch_is(level)] spoolss_SetPrinterInfo info;
760         } spoolss_SetPrinterInfoCtr;
761
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
768         );
769
770         /******************/
771         /* Function: 0x08 */
772         [public] WERROR spoolss_GetPrinter(
773                 [in,ref] policy_handle *handle,
774                 [in]     uint32 level,
775                 [in,unique] DATA_BLOB *buffer,
776                 [in]     uint32 offered,
777                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info,
778                 [out,ref] uint32 *needed
779         );
780
781         /******************/
782         /* Function: 0x09 */
783
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;
788
789         typedef struct {
790                 [string,charset(UTF16)] uint16 *driver_name;
791         } spoolss_AddDriverInfo1;
792
793         typedef [v1_enum,public] enum {
794                 SPOOLSS_DRIVER_VERSION_9X       = 0,
795                 SPOOLSS_DRIVER_VERSION_NT35     = 1,
796                 SPOOLSS_DRIVER_VERSION_NT4      = 2,
797                 SPOOLSS_DRIVER_VERSION_200X     = 3
798         } spoolss_DriverOSVersion;
799
800         typedef struct {
801                 spoolss_DriverOSVersion version;
802                 [string,charset(UTF16)] uint16 *driver_name;
803                 [string,charset(UTF16)] uint16 *architecture;
804                 [string,charset(UTF16)] uint16 *driver_path;
805                 [string,charset(UTF16)] uint16 *data_file;
806                 [string,charset(UTF16)] uint16 *config_file;
807         } spoolss_AddDriverInfo2;
808
809         typedef struct {
810                 spoolss_DriverOSVersion version;
811                 [string,charset(UTF16)] uint16 *driver_name;
812                 [string,charset(UTF16)] uint16 *architecture;
813                 [string,charset(UTF16)] uint16 *driver_path;
814                 [string,charset(UTF16)] uint16 *data_file;
815                 [string,charset(UTF16)] uint16 *config_file;
816                 [string,charset(UTF16)] uint16 *help_file;
817                 [string,charset(UTF16)] uint16 *monitor_name;
818                 [string,charset(UTF16)] uint16 *default_datatype;
819                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
820                 spoolss_StringArray *dependent_files;
821         } spoolss_AddDriverInfo3;
822
823         typedef struct {
824                 spoolss_DriverOSVersion version;
825                 [string,charset(UTF16)] uint16 *driver_name;
826                 [string,charset(UTF16)] uint16 *architecture;
827                 [string,charset(UTF16)] uint16 *driver_path;
828                 [string,charset(UTF16)] uint16 *data_file;
829                 [string,charset(UTF16)] uint16 *config_file;
830                 [string,charset(UTF16)] uint16 *help_file;
831                 [string,charset(UTF16)] uint16 *monitor_name;
832                 [string,charset(UTF16)] uint16 *default_datatype;
833                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
834                 spoolss_StringArray *dependent_files;
835                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
836                 spoolss_StringArray *previous_names;
837         } spoolss_AddDriverInfo4;
838
839         typedef [bitmap32bit] bitmap {
840                 PRINTER_DRIVER_PACKAGE_AWARE = 0x00000002
841         } spoolss_DriverAttributes;
842
843         typedef struct {
844                 spoolss_DriverOSVersion version;
845                 [string,charset(UTF16)] uint16 *driver_name;
846                 [string,charset(UTF16)] uint16 *architecture;
847                 [string,charset(UTF16)] uint16 *driver_path;
848                 [string,charset(UTF16)] uint16 *data_file;
849                 [string,charset(UTF16)] uint16 *config_file;
850                 spoolss_DriverAttributes driver_attributes;
851                 uint32 config_version;
852                 uint32 driver_version;
853         } spoolss_AddDriverInfo5;
854
855         typedef struct {
856                 spoolss_DriverOSVersion version;
857                 [string,charset(UTF16)] uint16 *driver_name;
858                 [string,charset(UTF16)] uint16 *architecture;
859                 [string,charset(UTF16)] uint16 *driver_path;
860                 [string,charset(UTF16)] uint16 *data_file;
861                 [string,charset(UTF16)] uint16 *config_file;
862                 [string,charset(UTF16)] uint16 *help_file;
863                 [string,charset(UTF16)] uint16 *monitor_name;
864                 [string,charset(UTF16)] uint16 *default_datatype;
865                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
866                 spoolss_StringArray *dependent_files;
867                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
868                 spoolss_StringArray *previous_names;
869                 NTTIME driver_date;
870                 hyper driver_version;
871                 [string,charset(UTF16)] uint16 *manufacturer_name;
872                 [string,charset(UTF16)] uint16 *manufacturer_url;
873                 [string,charset(UTF16)] uint16 *hardware_id;
874                 [string,charset(UTF16)] uint16 *provider;
875         } spoolss_AddDriverInfo6;
876
877         typedef struct {
878                 spoolss_DriverOSVersion version;
879                 [string,charset(UTF16)] uint16 *driver_name;
880                 [string,charset(UTF16)] uint16 *architecture;
881                 [string,charset(UTF16)] uint16 *driver_path;
882                 [string,charset(UTF16)] uint16 *data_file;
883                 [string,charset(UTF16)] uint16 *config_file;
884                 [string,charset(UTF16)] uint16 *help_file;
885                 [string,charset(UTF16)] uint16 *monitor_name;
886                 [string,charset(UTF16)] uint16 *default_datatype;
887                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
888                 spoolss_StringArray *dependent_files;
889                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
890                 spoolss_StringArray *previous_names;
891                 NTTIME driver_date;
892                 hyper driver_version;
893                 [string,charset(UTF16)] uint16 *manufacturer_name;
894                 [string,charset(UTF16)] uint16 *manufacturer_url;
895                 [string,charset(UTF16)] uint16 *hardware_id;
896                 [string,charset(UTF16)] uint16 *provider;
897                 [string,charset(UTF16)] uint16 *print_processor;
898                 [string,charset(UTF16)] uint16 *vendor_setup;
899                 [value(((ndr_size_spoolss_StringArray(color_profiles, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles;
900                 spoolss_StringArray *color_profiles;
901                 [string,charset(UTF16)] uint16 *inf_path;
902                 uint32 printer_driver_attributes;
903                 [value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies;
904                 spoolss_StringArray *core_driver_dependencies;
905                 NTTIME min_inbox_driver_ver_date;
906                 hyper min_inbox_driver_ver_version;
907         } spoolss_AddDriverInfo8;
908
909         typedef [switch_type(uint32)] union {
910                 [case(1)] spoolss_AddDriverInfo1 *info1;
911                 [case(2)] spoolss_AddDriverInfo2 *info2;
912                 [case(3)] spoolss_AddDriverInfo3 *info3;
913                 [case(4)] spoolss_AddDriverInfo4 *info4;
914                 [case(6)] spoolss_AddDriverInfo6 *info6;
915                 [case(8)] spoolss_AddDriverInfo8 *info8;
916         } spoolss_AddDriverInfo;
917
918         typedef struct {
919                 uint32 level;
920                 [switch_is(level)] spoolss_AddDriverInfo info;
921         } spoolss_AddDriverInfoCtr;
922
923         WERROR spoolss_AddPrinterDriver(
924                 [in,unique] [string,charset(UTF16)] uint16 *servername,
925                 [in,ref] spoolss_AddDriverInfoCtr *info_ctr
926         );
927
928         typedef [public,gensize] struct {
929                 [relative] nstring *driver_name;
930         } spoolss_DriverInfo1;
931
932         typedef [public,gensize] struct {
933                 spoolss_DriverOSVersion version;
934                 [relative] nstring *driver_name;
935                 [relative] nstring *architecture;
936                 [relative] nstring *driver_path;
937                 [relative] nstring *data_file;
938                 [relative] nstring *config_file;
939         } spoolss_DriverInfo2;
940
941         typedef [public,gensize] struct {
942                 spoolss_DriverOSVersion version;
943                 [relative] nstring *driver_name;
944                 [relative] nstring *architecture;
945                 [relative] nstring *driver_path;
946                 [relative] nstring *data_file;
947                 [relative] nstring *config_file;
948                 [relative] nstring *help_file;
949                 [relative] nstring_array *dependent_files;
950                 [relative] nstring *monitor_name;
951                 [relative] nstring *default_datatype;
952         } spoolss_DriverInfo3;
953
954         typedef [public,gensize] struct {
955                 spoolss_DriverOSVersion version;
956                 [relative] nstring *driver_name;
957                 [relative] nstring *architecture;
958                 [relative] nstring *driver_path;
959                 [relative] nstring *data_file;
960                 [relative] nstring *config_file;
961                 [relative] nstring *help_file;
962                 [relative] nstring_array *dependent_files;
963                 [relative] nstring *monitor_name;
964                 [relative] nstring *default_datatype;
965                 [relative] nstring_array *previous_names;
966         } spoolss_DriverInfo4;
967
968         typedef [public,gensize] struct {
969                 spoolss_DriverOSVersion version;
970                 [relative] nstring *driver_name;
971                 [relative] nstring *architecture;
972                 [relative] nstring *driver_path;
973                 [relative] nstring *data_file;
974                 [relative] nstring *config_file;
975                 spoolss_DriverAttributes driver_attributes;
976                 uint32 config_version;
977                 uint32 driver_version;
978         } spoolss_DriverInfo5;
979
980         typedef [public,gensize] struct {
981                 spoolss_DriverOSVersion version;
982                 [relative] nstring *driver_name;
983                 [relative] nstring *architecture;
984                 [relative] nstring *driver_path;
985                 [relative] nstring *data_file;
986                 [relative] nstring *config_file;
987                 [relative] nstring *help_file;
988                 [relative] nstring_array *dependent_files;
989                 [relative] nstring *monitor_name;
990                 [relative] nstring *default_datatype;
991                 [relative] nstring_array *previous_names;
992                 NTTIME driver_date;
993                 hyper driver_version;
994                 [relative] nstring *manufacturer_name;
995                 [relative] nstring *manufacturer_url;
996                 [relative] nstring *hardware_id;
997                 [relative] nstring *provider;
998         } spoolss_DriverInfo6;
999
1000         typedef [public,gensize] struct {
1001                 spoolss_DriverOSVersion version;
1002                 [relative] nstring *driver_name;
1003                 [relative] nstring *architecture;
1004                 [relative] nstring *driver_path;
1005                 [relative] nstring *data_file;
1006                 [relative] nstring *config_file;
1007                 [relative] nstring *help_file;
1008                 [relative] nstring *monitor_name;
1009                 [relative] nstring *default_datatype;
1010                 [relative] nstring_array *dependent_files;
1011                 [relative] nstring_array *previous_names;
1012                 NTTIME driver_date;
1013                 hyper driver_version;
1014                 [relative] nstring *manufacturer_name;
1015                 [relative] nstring *manufacturer_url;
1016                 [relative] nstring *hardware_id;
1017                 [relative] nstring *provider;
1018                 [relative] nstring *print_processor;
1019                 [relative] nstring *vendor_setup;
1020                 [relative] nstring_array *color_profiles;
1021                 [relative] nstring *inf_path;
1022                 uint32 printer_driver_attributes;
1023                 [relative] nstring_array *core_driver_dependencies;
1024                 NTTIME min_inbox_driver_ver_date;
1025                 hyper min_inbox_driver_ver_version;
1026         } spoolss_DriverInfo8;
1027
1028         typedef [v1_enum] enum {
1029                 SPOOLSS_DRIVER_FILE_TYPE_RENDERING      = 0x00000000,
1030                 SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION  = 0x00000001,
1031                 SPOOLSS_DRIVER_FILE_TYPE_DATA           = 0x00000002,
1032                 SPOOLSS_DRIVER_FILE_TYPE_HELP           = 0x00000003,
1033                 SPOOLSS_DRIVER_FILE_TYPE_OTHER          = 0x00000004
1034         } spoolss_DriverFileType;
1035
1036         typedef [public] struct {
1037                 [relative] nstring *file_name;
1038                 spoolss_DriverFileType file_type;
1039                 uint32 file_version;
1040         } spoolss_DriverFileInfo;
1041
1042         typedef [public,gensize,nopush,nopull] struct {
1043                 spoolss_DriverOSVersion version;
1044                 [relative] nstring *driver_name;
1045                 [relative] nstring *architecture;
1046                 [relative] [size_is(file_count)] spoolss_DriverFileInfo *file_info;
1047                 uint32 file_count;
1048                 [relative] nstring *monitor_name;
1049                 [relative] nstring *default_datatype;
1050                 [relative] nstring_array *previous_names;
1051                 NTTIME driver_date;
1052                 hyper driver_version;
1053                 [relative] nstring *manufacturer_name;
1054                 [relative] nstring *manufacturer_url;
1055                 [relative] nstring *hardware_id;
1056                 [relative] nstring *provider;
1057         } spoolss_DriverInfo101;
1058
1059         typedef [nodiscriminant,relative_base,public,gensize] union {
1060                 [case(1)] spoolss_DriverInfo1 info1;
1061                 [case(2)] spoolss_DriverInfo2 info2;
1062                 [case(3)] spoolss_DriverInfo3 info3;
1063                 [case(4)] spoolss_DriverInfo4 info4;
1064                 [case(5)] spoolss_DriverInfo5 info5;
1065                 [case(6)] spoolss_DriverInfo6 info6;
1066                 [case(8)] spoolss_DriverInfo8 info8;
1067                 [case(101)] spoolss_DriverInfo101 info101;
1068                 [default];
1069         } spoolss_DriverInfo;
1070
1071         /******************/
1072         /* Function: 0x0a */
1073         [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDrivers(
1074                 [in,unique] [string,charset(UTF16)] uint16 *server,
1075                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1076                 [in] uint32 level,
1077                 [in,unique] DATA_BLOB *buffer,
1078                 [in] uint32 offered,
1079                 [out,unique] DATA_BLOB *info,
1080                 [out,ref] uint32 *needed,
1081                 [out,ref] uint32 *count
1082         );
1083         [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers(
1084                 [in] uint32 level,
1085                 [in] uint32 count,
1086                 [out,switch_is(level)] spoolss_DriverInfo info[count]
1087         );
1088         [nopull,nopush] WERROR spoolss_EnumPrinterDrivers(
1089                 [in,unique] [string,charset(UTF16)] uint16 *server,
1090                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1091                 [in] uint32 level,
1092                 [in,unique] DATA_BLOB *buffer,
1093                 [in] uint32 offered,
1094                 [out,ref] uint32 *count,
1095                 [out,ref,switch_is(level),size_is(,*count)] spoolss_DriverInfo **info,
1096                 [out,ref] uint32 *needed
1097         );
1098
1099         /******************/
1100         /* Function: 0x0b */
1101         [todo] WERROR spoolss_GetPrinterDriver(
1102         );
1103
1104         /******************/
1105         /* Function: 0x0c */
1106         typedef [public,gensize] struct {
1107                 nstring directory_name;
1108         } spoolss_DriverDirectoryInfo1;
1109
1110         /* NOTE: it's seems that w2k3 completly ignores the level
1111                  in its server code
1112          */
1113         typedef [nodiscriminant,relative_base,gensize,public] union {
1114                 [case(1)] spoolss_DriverDirectoryInfo1 info1;
1115                 [default] spoolss_DriverDirectoryInfo1 info1;
1116         } spoolss_DriverDirectoryInfo;
1117
1118         [public] WERROR spoolss_GetPrinterDriverDirectory(
1119                 [in,unique] [string,charset(UTF16)] uint16 *server,
1120                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1121                 [in] uint32 level,
1122                 [in,unique] DATA_BLOB *buffer,
1123                 [in] uint32 offered,
1124                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
1125                 [out,ref] uint32 *needed
1126         );
1127
1128         /******************/
1129         /* Function: 0x0d */
1130         WERROR spoolss_DeletePrinterDriver(
1131                 [in,unique] [string,charset(UTF16)] uint16 *server,
1132                 [in] [string,charset(UTF16)] uint16 architecture[],
1133                 [in] [string,charset(UTF16)] uint16 driver[]
1134         );
1135
1136         /******************/
1137         /* Function: 0x0e */
1138         WERROR spoolss_AddPrintProcessor(
1139                 [in,unique] [string,charset(UTF16)] uint16 *server,
1140                 [in] [string,charset(UTF16)] uint16 architecture[],
1141                 [in] [string,charset(UTF16)] uint16 path_name[],
1142                 [in] [string,charset(UTF16)] uint16 print_processor_name[]
1143         );
1144
1145         /******************/
1146         /* Function: 0x0f */
1147         typedef [public,gensize] struct {
1148                 [relative] nstring *print_processor_name;
1149         } spoolss_PrintProcessorInfo1;
1150
1151         typedef [nodiscriminant,relative_base,public] union {
1152                 [case(1)] spoolss_PrintProcessorInfo1 info1;
1153                 [default];
1154         } spoolss_PrintProcessorInfo;
1155
1156         [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessors(
1157                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1158                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1159                 [in] uint32 level,
1160                 [in,unique] DATA_BLOB *buffer,
1161                 [in] uint32 offered,
1162                 [out,unique] DATA_BLOB *info,
1163                 [out,ref] uint32 *needed,
1164                 [out,ref] uint32 *count
1165         );
1166         [public,noopnum,noprint] void __spoolss_EnumPrintProcessors(
1167                 [in] uint32 level,
1168                 [in] uint32 count,
1169                 [out,switch_is(level)] spoolss_PrintProcessorInfo info[count]
1170         );
1171         [nopull,nopush] WERROR spoolss_EnumPrintProcessors(
1172                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1173                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1174                 [in] uint32 level,
1175                 [in,unique] DATA_BLOB *buffer,
1176                 [in] uint32 offered,
1177                 [out,ref] uint32 *count,
1178                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrintProcessorInfo **info,
1179                 [out,ref] uint32 *needed
1180         );
1181
1182         /******************/
1183         /* Function: 0x10 */
1184         typedef [public,gensize] struct {
1185                 nstring directory_name;
1186         } spoolss_PrintProcessorDirectoryInfo1;
1187
1188         typedef [nodiscriminant,relative_base,gensize,public] union {
1189                 [case(1)] spoolss_PrintProcessorDirectoryInfo1 info1;
1190                 [default] spoolss_PrintProcessorDirectoryInfo1 info1;
1191         } spoolss_PrintProcessorDirectoryInfo;
1192
1193         WERROR spoolss_GetPrintProcessorDirectory(
1194                 [in,unique] [string,charset(UTF16)] uint16 *server,
1195                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1196                 [in] uint32 level,
1197                 [in,unique] DATA_BLOB *buffer,
1198                 [in] uint32 offered,
1199                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrintProcessorDirectoryInfo *info,
1200                 [out,ref] uint32 *needed
1201         );
1202
1203         /******************/
1204         /* Function: 0x11 */
1205         typedef struct {
1206                 [string,charset(UTF16)] uint16 *document_name;
1207                 [string,charset(UTF16)] uint16 *output_file;
1208                 [string,charset(UTF16)] uint16 *datatype;
1209         } spoolss_DocumentInfo1;
1210
1211         typedef [switch_type(uint32)] union {
1212                 [case(1)] spoolss_DocumentInfo1 *info1;
1213                 [case(2)]; /* TODO */
1214                 [case(3)]; /* TODO */
1215                 [default];
1216         } spoolss_DocumentInfo;
1217
1218         WERROR spoolss_StartDocPrinter(
1219                 [in,ref] policy_handle *handle,
1220                 [in] uint32 level,
1221                 [in,switch_is(level)] spoolss_DocumentInfo info,
1222                 [out,ref] uint32 *job_id
1223         );
1224
1225         /******************/
1226         /* Function: 0x12 */
1227         WERROR spoolss_StartPagePrinter(
1228                 [in,ref] policy_handle *handle
1229         );
1230
1231         /******************/
1232         /* Function: 0x13 */
1233         WERROR spoolss_WritePrinter(
1234                 [in,ref] policy_handle *handle,
1235                 [in] DATA_BLOB data,
1236                 [in,value(r->in.data.length)] uint32 _data_size,
1237                 [out,ref] uint32 *num_written
1238         );
1239
1240         /******************/
1241         /* Function: 0x14 */
1242         WERROR spoolss_EndPagePrinter(
1243                 [in,ref] policy_handle *handle
1244         );
1245
1246         /******************/
1247         /* Function: 0x15 */
1248         WERROR spoolss_AbortPrinter(
1249                 [in,ref] policy_handle *handle
1250         );
1251
1252         /******************/
1253         /* Function: 0x16 */
1254         WERROR spoolss_ReadPrinter(
1255                 [in,ref] policy_handle *handle,
1256                 [out,ref] [size_is(data_size)] uint8 *data,
1257                 [in] uint32 data_size,
1258                 [out,ref] uint32 *_data_size
1259         );
1260
1261         /******************/
1262         /* Function: 0x17 */
1263         WERROR spoolss_EndDocPrinter(
1264                 [in,ref] policy_handle *handle
1265         );
1266
1267         /******************/
1268         /* Function: 0x18 */
1269         WERROR spoolss_AddJob(
1270                 [in,ref] policy_handle *handle,
1271                 [in] uint32 level,
1272                 [in,out,unique] [size_is(offered)] uint8 *buffer,
1273                 [in] uint32 offered,
1274                 [out,ref] uint32 *needed
1275         );
1276
1277         /******************/
1278         /* Function: 0x19 */
1279         WERROR spoolss_ScheduleJob(
1280                 [in,ref] policy_handle *handle,
1281                 [in] uint32 jobid
1282         );
1283
1284         /******************/
1285         /* Function: 0x1a */
1286
1287         const string SPL_ARCH_WIN40             = "WIN40";
1288         const string SPL_ARCH_W32X86            = "W32X86";
1289         const string SPL_ARCH_W32MIPS           = "W32MIPS";
1290         const string SPL_ARCH_W32ALPHA          = "W32ALPHA";
1291         const string SPL_ARCH_W32PPC            = "W32PPC";
1292         const string SPL_ARCH_IA64              = "IA64";
1293         const string SPL_ARCH_X64               = "x64";
1294
1295         const string SPOOLSS_ARCHITECTURE_ALL                   = "all";
1296         const string SPOOLSS_ARCHITECTURE_NT_X86                = "Windows NT x86";
1297         const string SPOOLSS_DEFAULT_SERVER_PATH                = "C:\\WINDOWS\\system32\\spool";
1298
1299         typedef [public,gensize] struct {
1300                 [value(ndr_size_spoolss_OSVersion(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
1301                 uint32 major;
1302                 uint32 minor;
1303                 uint32 build;
1304                 [value(2)] uint32 unknown;
1305                 [subcontext(0),subcontext_size(256)] nstring extra_string;
1306         } spoolss_OSVersion;
1307
1308         typedef [public,gensize] struct {
1309                 [value(ndr_size_spoolss_OSVersionEx(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
1310                 uint32 major;
1311                 uint32 minor;
1312                 uint32 build;
1313                 [value(2)] uint32 unknown1;
1314                 [subcontext(0),subcontext_size(256)] nstring extra_string;
1315                 uint32 unknown2;/* service pack number? I saw 0 from w2k3 and 1 from winxp sp1*/
1316                 uint32 unknown3;/* hmm? w2k3: 131346(0x20112) winxp sp1: 503382272 0x1E010100 */
1317         } spoolss_OSVersionEx;
1318
1319         typedef [nodiscriminant,public,gensize] union {
1320                 [case(REG_NONE)];
1321                 [case(REG_SZ)] nstring string;
1322                 [case(REG_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary;
1323                 [case(REG_DWORD)] uint32 value;
1324                 [case(REG_MULTI_SZ)] nstring_array string_array;
1325                 [default,flag(NDR_REMAINING)] DATA_BLOB data;
1326         } spoolss_PrinterData;
1327
1328         [noopnum,noprint,public] WERROR _spoolss_GetPrinterData(
1329                 [in,ref] policy_handle *handle,
1330                 [in]     [string,charset(UTF16)] uint16 value_name[],
1331                 [in]     uint32 offered,
1332                 [out,ref] winreg_Type *type,
1333                 [out,ref] DATA_BLOB *data,
1334                 [out,ref] uint32 *needed
1335         );
1336         [noopnum,noprint,public] void __spoolss_GetPrinterData(
1337                 [in] winreg_Type type,
1338                 [out,ref,switch_is(type)] spoolss_PrinterData *data
1339         );
1340         [nopull,nopush,public] WERROR spoolss_GetPrinterData(
1341                 [in,ref] policy_handle *handle,
1342                 [in]     [string,charset(UTF16)] uint16 value_name[],
1343                 [in]     uint32 offered,
1344                 [out,ref] winreg_Type *type,
1345                 [out,ref,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData *data,
1346                 [out,ref] uint32 *needed
1347         );
1348
1349         /******************/
1350         /* Function: 0x1b */
1351         [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData(
1352                 [in,ref] policy_handle *handle,
1353                 [in] [string,charset(UTF16)] uint16 value_name[],
1354                 [in] winreg_Type type,
1355                 [in] DATA_BLOB data,
1356                 [in] uint32 _offered
1357         );
1358         [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData(
1359                 [in] winreg_Type type,
1360                 [out,ref,switch_is(type)] spoolss_PrinterData *data
1361         );
1362         [nopush] WERROR spoolss_SetPrinterData(
1363                 [in,ref] policy_handle *handle,
1364                 [in] [string,charset(UTF16)] uint16 value_name[],
1365                 [in] winreg_Type type,
1366                 [in,subcontext(4),switch_is(type)] spoolss_PrinterData data,
1367                 [in,value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] uint32 _offered
1368         );
1369
1370         /******************/
1371         /* Function: 0x1c */
1372         [todo] WERROR spoolss_WaitForPrinterChange(
1373         );
1374
1375         /******************/
1376         /* Function: 0x1d */
1377         [public] WERROR spoolss_ClosePrinter(
1378                 [in,out,ref]     policy_handle *handle
1379         );
1380
1381         /******************/
1382         /* Function: 0x1e */
1383         typedef [v1_enum] enum {
1384                 SPOOLSS_FORM_USER       = 0,
1385                 SPOOLSS_FORM_BUILTIN    = 1,
1386                 SPOOLSS_FORM_PRINTER    = 2
1387         } spoolss_FormFlags;
1388
1389         typedef struct {
1390                 uint32 width;
1391                 uint32 height;
1392         } spoolss_FormSize;
1393
1394         typedef struct {
1395                 uint32 left;
1396                 uint32 top;
1397                 uint32 right;
1398                 uint32 bottom;
1399         } spoolss_FormArea;
1400
1401         typedef [public,gensize] struct {
1402                 spoolss_FormFlags flags;
1403                 [relative] nstring *form_name;
1404                 spoolss_FormSize size;
1405                 spoolss_FormArea area;
1406         } spoolss_FormInfo1;
1407
1408         typedef [bitmap32bit] bitmap {
1409                 SPOOLSS_FORM_STRING_TYPE_NONE           = 0x00000001,
1410                 SPOOLSS_FORM_STRING_TYPE_MUI_DLL        = 0x00000002,
1411                 SPOOLSS_FORM_STRING_TYPE_LANG_PAIR      = 0x00000004
1412         } spoolss_FormStringType;
1413
1414         typedef [public,gensize] struct {
1415                 spoolss_FormFlags flags;
1416                 [relative] nstring *form_name;
1417                 spoolss_FormSize size;
1418                 spoolss_FormArea area;
1419                 [relative] astring *keyword;
1420                 spoolss_FormStringType string_type;
1421                 [relative] nstring *mui_dll;
1422                 uint32 ressource_id;
1423                 [relative] nstring *display_name;
1424                 uint32 lang_id;
1425         } spoolss_FormInfo2;
1426
1427         typedef [nodiscriminant,relative_base,public,gensize] union {
1428                 [case(1)] spoolss_FormInfo1 info1;
1429                 [case(2)] spoolss_FormInfo2 info2;
1430                 [default];
1431         } spoolss_FormInfo;
1432
1433         typedef struct {
1434                 spoolss_FormFlags flags;
1435                 [string,charset(UTF16)] uint16 *form_name;
1436                 spoolss_FormSize size;
1437                 spoolss_FormArea area;
1438         } spoolss_AddFormInfo1;
1439
1440         typedef struct {
1441                 spoolss_FormFlags flags;
1442                 [string,charset(UTF16)] uint16 *form_name;
1443                 spoolss_FormSize size;
1444                 spoolss_FormArea area;
1445                 [string,charset(DOS)] uint8 *keyword;
1446                 spoolss_FormStringType string_type;
1447                 [string,charset(UTF16)] uint16 *mui_dll;
1448                 uint32 ressource_id;
1449                 [string,charset(UTF16)] uint16 *display_name;
1450                 uint32 lang_id;
1451         } spoolss_AddFormInfo2;
1452
1453         typedef [switch_type(uint32)] union {
1454                 [case(1)] spoolss_AddFormInfo1 *info1;
1455                 [case(2)] spoolss_AddFormInfo2 *info2;
1456         } spoolss_AddFormInfo;
1457
1458         WERROR spoolss_AddForm(
1459                 [in,ref] policy_handle *handle,
1460                 [in] uint32 level,
1461                 [in,switch_is(level)] spoolss_AddFormInfo info
1462         );
1463
1464         /******************/
1465         /* Function: 0x1f */
1466         WERROR spoolss_DeleteForm(
1467                 [in,ref] policy_handle *handle,
1468                 [in] [string,charset(UTF16)] uint16 form_name[]
1469         );
1470
1471         /******************/
1472         /* Function: 0x20 */
1473         WERROR spoolss_GetForm(
1474                 [in,ref] policy_handle *handle,
1475                 [in] [string,charset(UTF16)] uint16 form_name[],
1476                 [in] uint32 level,
1477                 [in,unique] DATA_BLOB *buffer,
1478                 [in] uint32 offered,
1479                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
1480                 [out,ref] uint32 *needed
1481         );
1482
1483         /******************/
1484         /* Function: 0x21 */
1485         WERROR spoolss_SetForm(
1486                 [in,ref] policy_handle *handle,
1487                 [in] [string,charset(UTF16)] uint16 form_name[],
1488                 [in] uint32 level,
1489                 [in,switch_is(level)] spoolss_AddFormInfo info
1490         );
1491
1492         /******************/
1493         /* Function: 0x22 */
1494         [public,noopnum,noprint] WERROR _spoolss_EnumForms(
1495                 [in,ref] policy_handle *handle,
1496                 [in]     uint32 level,
1497                 [in,unique] DATA_BLOB *buffer,
1498                 [in]     uint32 offered,
1499                 [out,unique] DATA_BLOB *info,
1500                 [out,ref] uint32 *needed,
1501                 [out,ref] uint32 *count
1502         );
1503         [public,noopnum,noprint] void __spoolss_EnumForms(
1504                 [in] uint32 level,
1505                 [in] uint32 count,
1506                 [out,switch_is(level)] spoolss_FormInfo info[count]
1507         );
1508         [nopull,nopush] WERROR spoolss_EnumForms(
1509                 [in,ref] policy_handle *handle,
1510                 [in]     uint32 level,
1511                 [in,unique] DATA_BLOB *buffer,
1512                 [in]     uint32 offered,
1513                 [out,ref] uint32 *count,
1514                 [out,ref,switch_is(level),size_is(,*count)] spoolss_FormInfo **info,
1515                 [out,ref] uint32 *needed
1516         );
1517
1518         /*
1519          * Special strings for the OpenPrinter() call.  See the MSDN DDK
1520          * docs on the XcvDataPort() for more details.
1521          */
1522
1523         const string SPL_LOCAL_PORT             = "Local Port";
1524         const string SPL_TCPIP_PORT             = "Standard TCP/IP Port";
1525         const string SPL_XCV_MONITOR_LOCALMON   = ",XcvMonitor Local Port";
1526         const string SPL_XCV_MONITOR_TCPMON     = ",XcvMonitor Standard TCP/IP Port";
1527
1528         typedef [public,gensize] struct {
1529                 [relative] nstring *port_name;
1530         } spoolss_PortInfo1;
1531
1532         typedef bitmap {
1533                 SPOOLSS_PORT_TYPE_WRITE         = 0x00000001,
1534                 SPOOLSS_PORT_TYPE_READ          = 0x00000002,
1535                 SPOOLSS_PORT_TYPE_REDIRECTED    = 0x00000004,
1536                 SPOOLSS_PORT_TYPE_NET_ATTACHED  = 0x00000008
1537         } spoolss_PortType;
1538
1539         typedef [public,gensize] struct {
1540                 [relative] nstring *port_name;
1541                 [relative] nstring *monitor_name;
1542                 [relative] nstring *description;
1543                 spoolss_PortType port_type;
1544                 uint32 reserved;
1545         } spoolss_PortInfo2;
1546
1547         typedef [v1_enum] enum {
1548                 PORT_STATUS_CLEAR               = 0x00000000,
1549                 PORT_STATUS_OFFLINE             = 0x00000001,
1550                 PORT_STATUS_PAPER_JAM           = 0x00000002,
1551                 PORT_STATUS_PAPER_OUT           = 0x00000003,
1552                 PORT_STATUS_OUTPUT_BIN_FULL     = 0x00000004,
1553                 PORT_STATUS_PAPER_PROBLEM       = 0x00000005,
1554                 PORT_STATUS_NO_TONER            = 0x00000006,
1555                 PORT_STATUS_DOOR_OPEN           = 0x00000007,
1556                 PORT_STATUS_USER_INTERVENTION   = 0x00000008,
1557                 PORT_STATUS_OUT_OF_MEMORY       = 0x00000009,
1558                 PORT_STATUS_TONER_LOW           = 0x0000000A,
1559                 PORT_STATUS_WARMING_UP          = 0x0000000B,
1560                 PORT_STATUS_POWER_SAVE          = 0x0000000C
1561         } spoolss_PortStatus;
1562
1563         typedef [v1_enum] enum {
1564                 PORT_STATUS_TYPE_ERROR          = 0x00000001,
1565                 PORT_STATUS_TYPE_WARNING        = 0x00000002,
1566                 PORT_STATUS_TYPE_INFO           = 0x00000003
1567         } spoolss_PortSeverity;
1568
1569         typedef [public,gensize] struct {
1570                 spoolss_PortStatus status;
1571                 [relative] nstring *status_string;
1572                 spoolss_PortSeverity severity;
1573         } spoolss_PortInfo3;
1574
1575         typedef [public,gensize] struct {
1576                 [relative] nstring *port_name;
1577                 DATA_BLOB monitor_data; /* relative ?? */
1578         } spoolss_PortInfoFF;
1579
1580         typedef [nodiscriminant,relative_base,public] union {
1581                 [case(1)] spoolss_PortInfo1 info1;
1582                 [case(2)] spoolss_PortInfo2 info2;
1583                 [case(3)] spoolss_PortInfo3 info3;
1584                 [case(0xff)] spoolss_PortInfoFF infoFF;
1585                 [default];
1586         } spoolss_PortInfo;
1587
1588         /******************/
1589         /* Function: 0x23 */
1590         [public,noopnum,noprint] WERROR _spoolss_EnumPorts(
1591                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1592                 [in] uint32 level,
1593                 [in,unique] DATA_BLOB *buffer,
1594                 [in] uint32 offered,
1595                 [out,unique] DATA_BLOB *info,
1596                 [out,ref] uint32 *needed,
1597                 [out,ref] uint32 *count
1598         );
1599         [public,noopnum,noprint] void __spoolss_EnumPorts(
1600                 [in] uint32 level,
1601                 [in] uint32 count,
1602                 [out,switch_is(level)] spoolss_PortInfo info[count]
1603         );
1604         [nopull,nopush] WERROR spoolss_EnumPorts(
1605                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1606                 [in] uint32 level,
1607                 [in,unique] DATA_BLOB *buffer,
1608                 [in] uint32 offered,
1609                 [out,ref] uint32 *count,
1610                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PortInfo **info,
1611                 [out,ref] uint32 *needed
1612         );
1613
1614         /******************/
1615         /* Function: 0x24 */
1616         typedef [public,gensize] struct {
1617                 [relative] nstring *monitor_name;
1618         } spoolss_MonitorInfo1;
1619
1620         typedef [public,gensize] struct {
1621                 [relative] nstring *monitor_name;
1622                 [relative] nstring *environment;
1623                 [relative] nstring *dll_name;
1624         } spoolss_MonitorInfo2;
1625
1626         typedef [nodiscriminant,relative_base,public] union {
1627                 [case(1)] spoolss_MonitorInfo1 info1;
1628                 [case(2)] spoolss_MonitorInfo2 info2;
1629                 [default];
1630         } spoolss_MonitorInfo;
1631
1632         [public,noopnum,noprint] WERROR _spoolss_EnumMonitors(
1633                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1634                 [in] uint32 level,
1635                 [in,unique] DATA_BLOB *buffer,
1636                 [in] uint32 offered,
1637                 [out,unique] DATA_BLOB *info,
1638                 [out,ref] uint32 *needed,
1639                 [out,ref] uint32 *count
1640         );
1641         [public,noopnum,noprint] void __spoolss_EnumMonitors(
1642                 [in] uint32 level,
1643                 [in] uint32 count,
1644                 [out,switch_is(level)] spoolss_MonitorInfo info[count]
1645         );
1646         [nopull,nopush] WERROR spoolss_EnumMonitors(
1647                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1648                 [in] uint32 level,
1649                 [in,unique] DATA_BLOB *buffer,
1650                 [in] uint32 offered,
1651                 [out,ref] uint32 *count,
1652                 [out,ref,switch_is(level),size_is(,*count)] spoolss_MonitorInfo **info,
1653                 [out,ref] uint32 *needed
1654         );
1655
1656         /******************/
1657         /* Function: 0x25 */
1658         WERROR spoolss_AddPort(
1659                [in,unique] [string,charset(UTF16)] uint16 *server_name,
1660                [in] uint32 unknown,
1661                [in] [string,charset(UTF16)] uint16 monitor_name[]
1662         );
1663
1664         /******************/
1665         /* Function: 0x26 */
1666         [todo] WERROR spoolss_ConfigurePort(
1667         );
1668
1669         /******************/
1670         /* Function: 0x27 */
1671         [todo] WERROR spoolss_DeletePort(
1672         );
1673
1674         /******************/
1675         /* Function: 0x28 */
1676         [todo] WERROR spoolss_CreatePrinterIC(
1677         );
1678
1679         /******************/
1680         /* Function: 0x29 */
1681         [todo] WERROR spoolss_PlayGDIScriptOnPrinterIC(
1682         );
1683
1684         /******************/
1685         /* Function: 0x2a */
1686         [todo] WERROR spoolss_DeletePrinterIC(
1687         );
1688
1689         /******************/
1690         /* Function: 0x2b */
1691         [todo] WERROR spoolss_AddPrinterConnection(
1692         );
1693
1694         /******************/
1695         /* Function: 0x2c */
1696         [todo] WERROR spoolss_DeletePrinterConnection(
1697         );
1698
1699         /******************/
1700         /* Function: 0x2d */
1701         [todo] WERROR spoolss_PrinterMessageBox(
1702                 /* Marked as obsolete in MSDN.  "Not necessary and has
1703                    no effect". */
1704         );
1705
1706         /******************/
1707         /* Function: 0x2e */
1708         [todo] WERROR spoolss_AddMonitor(
1709         );
1710
1711         /******************/
1712         /* Function: 0x2f */
1713         [todo] WERROR spoolss_DeleteMonitor(
1714         );
1715
1716         /******************/
1717         /* Function: 0x30 */
1718         [todo] WERROR spoolss_DeletePrintProcessor(
1719         );
1720
1721         /******************/
1722         /* Function: 0x31 */
1723         [todo] WERROR spoolss_AddPrintProvidor(
1724         );
1725
1726         /******************/
1727         /* Function: 0x32 */
1728         [todo] WERROR spoolss_DeletePrintProvidor(
1729         );
1730
1731         /******************/
1732         /* Function: 0x33 */
1733
1734         typedef [public,gensize] struct {
1735                 [relative] nstring *name_array;
1736         } spoolss_PrintProcDataTypesInfo1;
1737
1738         typedef [nodiscriminant,relative_base,public] union {
1739                 [case(1)] spoolss_PrintProcDataTypesInfo1 info1;
1740                 [default];
1741         } spoolss_PrintProcDataTypesInfo;
1742
1743         [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcDataTypes(
1744                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1745                 [in,unique] [string,charset(UTF16)] uint16 *print_processor_name,
1746                 [in] uint32 level,
1747                 [in,unique] DATA_BLOB *buffer,
1748                 [in] uint32 offered,
1749                 [out,unique] DATA_BLOB *info,
1750                 [out,ref] uint32 *needed,
1751                 [out,ref] uint32 *count
1752         );
1753         [public,noopnum,noprint] void __spoolss_EnumPrintProcDataTypes(
1754                 [in] uint32 level,
1755                 [in] uint32 count,
1756                 [out,switch_is(level)] spoolss_PrintProcDataTypesInfo info[count]
1757         );
1758         [nopull,nopush] WERROR spoolss_EnumPrintProcDataTypes(
1759                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1760                 [in,unique] [string,charset(UTF16)] uint16 *print_processor_name,
1761                 [in] uint32 level,
1762                 [in,unique] DATA_BLOB *buffer,
1763                 [in] uint32 offered,
1764                 [out,ref] uint32 *count,
1765                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrintProcDataTypesInfo **info,
1766                 [out,ref] uint32 *needed
1767         );
1768
1769         /******************/
1770         /* Function: 0x34 */
1771         WERROR spoolss_ResetPrinter(
1772                 [in,ref] policy_handle *handle,
1773                 [in,unique] [string,charset(UTF16)] uint16 *data_type,
1774                 [in,ref] spoolss_DevmodeContainer *devmode_ctr
1775         );
1776
1777         /******************/
1778         /* Function: 0x35 */
1779         WERROR spoolss_GetPrinterDriver2(
1780                 [in,ref] policy_handle *handle,
1781                 [in,unique] [string,charset(UTF16)] uint16 *architecture,
1782                 [in]     uint32 level,
1783                 [in,unique] DATA_BLOB *buffer,
1784                 [in]     uint32 offered,
1785                 [in]     uint32 client_major_version,
1786                 [in]     uint32 client_minor_version,
1787                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverInfo *info,
1788                 [out,ref] uint32 *needed,
1789                 [out,ref] uint32 *server_major_version,
1790                 [out,ref] uint32 *server_minor_version
1791         );
1792
1793         /******************/
1794         /* Function: 0x36 */
1795         [todo] WERROR spoolss_FindFirstPrinterChangeNotification(
1796         );
1797
1798         /******************/
1799         /* Function: 0x37 */
1800         [todo] WERROR spoolss_FindNextPrinterChangeNotification(
1801         );
1802
1803         /******************/
1804         /* Function: 0x38 */
1805         [public] WERROR spoolss_FindClosePrinterNotify(
1806                 [in,ref] policy_handle *handle
1807         );
1808
1809         /******************/
1810         /* Function: 0x39 */
1811         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotificationOld(
1812         );
1813
1814         /******************/
1815         /* Function: 0x3a */
1816         [public] WERROR spoolss_ReplyOpenPrinter(
1817                 [in,string,charset(UTF16)] uint16 server_name[],
1818                 [in] uint32 printer_local,
1819                 [in] winreg_Type type,
1820                 [in,range(0,512)] uint32 bufsize,
1821                 [in,unique,size_is(bufsize)] uint8 *buffer,
1822                 [out,ref] policy_handle *handle
1823         );
1824
1825         /******************/
1826         /* Function: 0x3b */
1827
1828         typedef [bitmap32bit] bitmap {
1829                 PRINTER_CHANGE_ADD_PRINTER                      = 0x00000001,
1830                 PRINTER_CHANGE_SET_PRINTER                      = 0x00000002,
1831                 PRINTER_CHANGE_DELETE_PRINTER                   = 0x00000004,
1832                 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER        = 0x00000008,
1833                 PRINTER_CHANGE_ADD_JOB                          = 0x00000100,
1834                 PRINTER_CHANGE_SET_JOB                          = 0x00000200,
1835                 PRINTER_CHANGE_DELETE_JOB                       = 0x00000400,
1836                 PRINTER_CHANGE_WRITE_JOB                        = 0x00000800,
1837                 PRINTER_CHANGE_ADD_FORM                         = 0x00010000,
1838                 PRINTER_CHANGE_SET_FORM                         = 0x00020000,
1839                 PRINTER_CHANGE_DELETE_FORM                      = 0x00040000,
1840                 PRINTER_CHANGE_ADD_PORT                         = 0x00100000,
1841                 PRINTER_CHANGE_CONFIGURE_PORT                   = 0x00200000,
1842                 PRINTER_CHANGE_DELETE_PORT                      = 0x00400000,
1843                 PRINTER_CHANGE_ADD_PRINT_PROCESSOR              = 0x01000000,
1844                 PRINTER_CHANGE_DELETE_PRINT_PROCESSOR           = 0x04000000,
1845                 PRINTER_CHANGE_SERVER                           = 0x08000000,
1846                 PRINTER_CHANGE_ADD_PRINTER_DRIVER               = 0x10000000,
1847                 PRINTER_CHANGE_SET_PRINTER_DRIVER               = 0x20000000,
1848                 PRINTER_CHANGE_DELETE_PRINTER_DRIVER            = 0x40000000,
1849                 PRINTER_CHANGE_TIMEOUT                          = 0x80000000
1850         } spoolss_PrinterChangeFlags;
1851
1852         const int PRINTER_CHANGE_PRINTER                        = 0x000000FF;
1853
1854         const int PRINTER_CHANGE_JOB                            = 0x0000FF00;
1855
1856         const int PRINTER_CHANGE_FORM                           = (PRINTER_CHANGE_ADD_FORM |
1857                                                                    PRINTER_CHANGE_SET_FORM |
1858                                                                    PRINTER_CHANGE_DELETE_FORM); /* 0x00070000 */
1859
1860         const int PRINTER_CHANGE_PORT                           = (PRINTER_CHANGE_ADD_PORT |
1861                                                                    PRINTER_CHANGE_CONFIGURE_PORT |
1862                                                                    PRINTER_CHANGE_DELETE_PORT); /* 0x00700000 */
1863
1864         const int PRINTER_CHANGE_PRINT_PROCESSOR                = 0x07000000;
1865
1866         const int PRINTER_CHANGE_PRINTER_DRIVER                 = (PRINTER_CHANGE_ADD_PRINTER_DRIVER |
1867                                                                    PRINTER_CHANGE_SET_PRINTER_DRIVER |
1868                                                                    PRINTER_CHANGE_DELETE_PRINTER_DRIVER); /* 0x70000000 */
1869
1870         const int PRINTER_CHANGE_ALL                            = (PRINTER_CHANGE_PRINTER |
1871                                                                    PRINTER_CHANGE_JOB |
1872                                                                    PRINTER_CHANGE_FORM |
1873                                                                    PRINTER_CHANGE_PORT |
1874                                                                    PRINTER_CHANGE_PRINT_PROCESSOR |
1875                                                                    PRINTER_CHANGE_PRINTER_DRIVER); /* 0x7777FFFF */
1876         WERROR spoolss_RouterReplyPrinter(
1877                 [in,ref] policy_handle *handle,
1878                 [in] spoolss_PrinterChangeFlags flags,
1879                 [in,range(0,512)] uint32 bufsize,
1880                 [in,unique,size_is(bufsize)] uint8 *buffer
1881         );
1882
1883         /******************/
1884         /* Function: 0x3c */
1885         [public] WERROR spoolss_ReplyClosePrinter(
1886                 [in,out,ref] policy_handle *handle
1887         );
1888
1889         /******************/
1890         /* Function: 0x3d */
1891         [todo] WERROR spoolss_AddPortEx(
1892         );
1893
1894         /******************/
1895         /* Function: 0x3e */
1896         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotification(
1897         );
1898
1899         /******************/
1900         /* Function: 0x3f */
1901         [todo] WERROR spoolss_SpoolerInit(
1902         );
1903
1904         /******************/
1905         /* Function: 0x40 */
1906         [todo] WERROR spoolss_ResetPrinterEx(
1907         );
1908
1909         typedef [enum16bit,public] enum {
1910                 JOB_NOTIFY_FIELD_PRINTER_NAME                   = 0x00,
1911                 JOB_NOTIFY_FIELD_MACHINE_NAME                   = 0x01,
1912                 JOB_NOTIFY_FIELD_PORT_NAME                      = 0x02,
1913                 JOB_NOTIFY_FIELD_USER_NAME                      = 0x03,
1914                 JOB_NOTIFY_FIELD_NOTIFY_NAME                    = 0x04,
1915                 JOB_NOTIFY_FIELD_DATATYPE                       = 0x05,
1916                 JOB_NOTIFY_FIELD_PRINT_PROCESSOR                = 0x06,
1917                 JOB_NOTIFY_FIELD_PARAMETERS                     = 0x07,
1918                 JOB_NOTIFY_FIELD_DRIVER_NAME                    = 0x08,
1919                 JOB_NOTIFY_FIELD_DEVMODE                        = 0x09,
1920                 JOB_NOTIFY_FIELD_STATUS                         = 0x0a,
1921                 JOB_NOTIFY_FIELD_STATUS_STRING                  = 0x0b,
1922                 JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR            = 0x0c,
1923                 JOB_NOTIFY_FIELD_DOCUMENT                       = 0x0d,
1924                 JOB_NOTIFY_FIELD_PRIORITY                       = 0x0e,
1925                 JOB_NOTIFY_FIELD_POSITION                       = 0x0f,
1926                 JOB_NOTIFY_FIELD_SUBMITTED                      = 0x10,
1927                 JOB_NOTIFY_FIELD_START_TIME                     = 0x11,
1928                 JOB_NOTIFY_FIELD_UNTIL_TIME                     = 0x12,
1929                 JOB_NOTIFY_FIELD_TIME                           = 0x13,
1930                 JOB_NOTIFY_FIELD_TOTAL_PAGES                    = 0x14,
1931                 JOB_NOTIFY_FIELD_PAGES_PRINTED                  = 0x15,
1932                 JOB_NOTIFY_FIELD_TOTAL_BYTES                    = 0x16,
1933                 JOB_NOTIFY_FIELD_BYTES_PRINTED                  = 0x17
1934         } spoolss_JobNotifyField;
1935
1936         typedef [enum16bit,public] enum {
1937                 PRINTER_NOTIFY_FIELD_SERVER_NAME                = 0x00,
1938                 PRINTER_NOTIFY_FIELD_PRINTER_NAME               = 0x01,
1939                 PRINTER_NOTIFY_FIELD_SHARE_NAME                 = 0x02,
1940                 PRINTER_NOTIFY_FIELD_PORT_NAME                  = 0x03,
1941                 PRINTER_NOTIFY_FIELD_DRIVER_NAME                = 0x04,
1942                 PRINTER_NOTIFY_FIELD_COMMENT                    = 0x05,
1943                 PRINTER_NOTIFY_FIELD_LOCATION                   = 0x06,
1944                 PRINTER_NOTIFY_FIELD_DEVMODE                    = 0x07,
1945                 PRINTER_NOTIFY_FIELD_SEPFILE                    = 0x08,
1946                 PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR            = 0x09,
1947                 PRINTER_NOTIFY_FIELD_PARAMETERS                 = 0x0a,
1948                 PRINTER_NOTIFY_FIELD_DATATYPE                   = 0x0b,
1949                 PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR        = 0x0c,
1950                 PRINTER_NOTIFY_FIELD_ATTRIBUTES                 = 0x0d,
1951                 PRINTER_NOTIFY_FIELD_PRIORITY                   = 0x0e,
1952                 PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY           = 0x0f,
1953                 PRINTER_NOTIFY_FIELD_START_TIME                 = 0x10,
1954                 PRINTER_NOTIFY_FIELD_UNTIL_TIME                 = 0x11,
1955                 PRINTER_NOTIFY_FIELD_STATUS                     = 0x12,
1956                 PRINTER_NOTIFY_FIELD_STATUS_STRING              = 0x13,
1957                 PRINTER_NOTIFY_FIELD_CJOBS                      = 0x14,
1958                 PRINTER_NOTIFY_FIELD_AVERAGE_PPM                = 0x15,
1959                 PRINTER_NOTIFY_FIELD_TOTAL_PAGES                = 0x16,
1960                 PRINTER_NOTIFY_FIELD_PAGES_PRINTED              = 0x17,
1961                 PRINTER_NOTIFY_FIELD_TOTAL_BYTES                = 0x18,
1962                 PRINTER_NOTIFY_FIELD_BYTES_PRINTED              = 0x19,
1963                 PRINTER_NOTIFY_FIELD_OBJECT_GUID                = 0x1a,
1964                 PRINTER_NOTIFY_FIELD_FRIENDLY_NAME              = 0x1b
1965         } spoolss_PrintNotifyField;
1966
1967         typedef [enum16bit] enum {
1968                 PRINTER_NOTIFY_TYPE     = 0x00,
1969                 JOB_NOTIFY_TYPE         = 0x01
1970         } spoolss_NotifyType;
1971
1972         typedef [nodiscriminant,noprint] union {
1973                 [case(PRINTER_NOTIFY_TYPE)] uint16 field;
1974                 [case(JOB_NOTIFY_TYPE)] uint16 field;
1975                 [default] uint16 field;
1976         } spoolss_Field;
1977
1978         /******************/
1979         /* Function: 0x41 */
1980         typedef struct {
1981                 spoolss_NotifyType type;
1982                 uint16 u1;
1983                 uint32 u2;
1984                 uint32 u3;
1985                 uint32 count;
1986                 [size_is(count),switch_is(type)] spoolss_Field *fields;
1987         } spoolss_NotifyOptionType;
1988
1989         typedef [bitmap32bit] bitmap {
1990                 PRINTER_NOTIFY_OPTIONS_REFRESH  = 0x00000001
1991         } spoolssNotifyOptionFlags;
1992
1993         typedef struct {
1994                 [value(2)] uint32 version;
1995                 spoolssNotifyOptionFlags flags;
1996                 uint32 count;
1997                 [size_is(count)] spoolss_NotifyOptionType *types;
1998         } spoolss_NotifyOption;
1999
2000         [public] WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
2001                 [in,ref] policy_handle *handle,
2002                 [in] spoolss_PrinterChangeFlags flags,
2003                 [in] uint32 options,
2004                 [in,unique] [string,charset(UTF16)] uint16 *local_machine,
2005                 [in] uint32 printer_local,
2006                 [in,unique] spoolss_NotifyOption *notify_options
2007         );
2008
2009         /******************/
2010         /* Function: 0x42 */
2011
2012         typedef struct {
2013                 uint32 size;
2014                 [size_is(size/2),unique,charset(UTF16)] uint16 *string;
2015         } spoolss_NotifyString;
2016
2017         typedef [v1_enum] enum {
2018                 NOTIFY_TABLE_DWORD              = 0x0001,
2019                 NOTIFY_TABLE_STRING             = 0x0002,
2020                 NOTIFY_TABLE_DEVMODE            = 0x0003,
2021                 NOTIFY_TABLE_TIME               = 0x0004,
2022                 NOTIFY_TABLE_SECURITYDESCRIPTOR = 0x0005
2023         } spoolss_NotifyTable;
2024
2025         typedef [switch_type(uint32)] union {
2026                 [case(1)] uint32 integer[2];
2027                 [case(2)] spoolss_NotifyString string;
2028                 [case(3)] spoolss_DevmodeContainer devmode;
2029                 [case(4)] spoolss_TimeCtr time;
2030                 [case(5)] sec_desc_buf sd;
2031         } spoolss_NotifyData;
2032
2033         typedef struct {
2034                 spoolss_NotifyType type;
2035                 [switch_is(type)] spoolss_Field field;
2036                 spoolss_NotifyTable variable_type;
2037                 uint32 job_id;
2038                 [switch_is(variable_type)] spoolss_NotifyData data;
2039         } spoolss_Notify;
2040
2041         typedef struct {
2042                 [value(2)] uint32 version;
2043                 uint32 flags;
2044                 uint32 count;
2045                 [size_is(count)] spoolss_Notify notifies[];
2046         } spoolss_NotifyInfo;
2047
2048         typedef [switch_type(uint32)] union {
2049                 [case(0)] spoolss_NotifyInfo *info0;
2050         } spoolss_ReplyPrinterInfo;
2051
2052         typedef [bitmap32bit] bitmap {
2053                 PRINTER_NOTIFY_INFO_DISCARDED           = 0x00000001,
2054                 PRINTER_NOTIFY_INFO_DISCARDNOTED        = 0x00010000,
2055                 PRINTER_NOTIFY_INFO_COLOR_MISMATCH      = 0x00080000
2056         } spoolss_PrinterNotifyFlags;
2057
2058         WERROR spoolss_RouterReplyPrinterEx(
2059                 [in,ref] policy_handle *handle,
2060                 [in] uint32 color,
2061                 [in] spoolss_PrinterChangeFlags flags,
2062                 [out,ref] spoolss_PrinterNotifyFlags *reply_result,
2063                 [in] uint32 reply_type,
2064                 [in,switch_is(reply_type)] spoolss_ReplyPrinterInfo info
2065         );
2066
2067         /******************/
2068         /* Function: 0x43 */
2069         [public] WERROR spoolss_RouterRefreshPrinterChangeNotify(
2070                 [in,ref] policy_handle *handle,
2071                 [in] uint32 change_low,
2072                 [in,unique] spoolss_NotifyOption *options,
2073                 [out,ref] spoolss_NotifyInfo **info
2074         );
2075
2076         /******************/
2077         /* Function: 0x44 */
2078         [todo] WERROR spoolss_44(
2079         );
2080
2081         typedef struct {
2082                 uint32 size;
2083                 [string,charset(UTF16)] uint16 *client;
2084                 [string,charset(UTF16)] uint16 *user;
2085                 uint32 build;
2086                 spoolss_MajorVersion major;
2087                 spoolss_MinorVersion minor;
2088                 spoolss_ProcessorArchitecture processor;
2089         } spoolss_UserLevel1;
2090
2091         typedef struct {
2092                 uint32 not_used;
2093         } spoolss_UserLevel2;
2094
2095         typedef struct {
2096                 uint32 size;
2097                 uint32 flags;
2098                 uint32 size2;
2099                 [string,charset(UTF16)] uint16 *client;
2100                 [string,charset(UTF16)] uint16 *user;
2101                 uint32 build;
2102                 spoolss_MajorVersion major;
2103                 spoolss_MinorVersion minor;
2104                 spoolss_ProcessorArchitecture processor;
2105                 udlong reserved;
2106         } spoolss_UserLevel3;
2107
2108         typedef [switch_type(uint32)] union {
2109                 [case(1)]  spoolss_UserLevel1 *level1;
2110                 [case(2)]  spoolss_UserLevel2 *level2;
2111                 [case(3)]  spoolss_UserLevel3 *level3;
2112         } spoolss_UserLevel;
2113
2114         typedef struct {
2115                 uint32 level;
2116                 [switch_is(level)] spoolss_UserLevel user_info;
2117         } spoolss_UserLevelCtr;
2118
2119         typedef bitmap {
2120                 SERVER_ACCESS_ADMINISTER        = 0x00000001,
2121                 SERVER_ACCESS_ENUMERATE         = 0x00000002,
2122                 PRINTER_ACCESS_ADMINISTER       = 0x00000004,
2123                 PRINTER_ACCESS_USE              = 0x00000008,
2124                 JOB_ACCESS_ADMINISTER           = 0x00000010,
2125                 JOB_ACCESS_READ                 = 0x00000020
2126         } spoolss_AccessRights;
2127
2128         /* Access rights for print servers */
2129         const int SERVER_ALL_ACCESS     = SEC_STD_REQUIRED |
2130                                           SERVER_ACCESS_ADMINISTER |
2131                                           SERVER_ACCESS_ENUMERATE;
2132
2133         const int SERVER_READ           = SEC_STD_READ_CONTROL |
2134                                           SERVER_ACCESS_ENUMERATE;
2135
2136         const int SERVER_WRITE          = STANDARD_RIGHTS_WRITE_ACCESS |
2137                                           SERVER_ACCESS_ADMINISTER |
2138                                           SERVER_ACCESS_ENUMERATE;
2139
2140         const int SERVER_EXECUTE        = SEC_STD_READ_CONTROL |
2141                                           SERVER_ACCESS_ENUMERATE;
2142
2143         /* Access rights for printers */
2144         const int PRINTER_ALL_ACCESS    = SEC_STD_REQUIRED |
2145                                           PRINTER_ACCESS_ADMINISTER |
2146                                           PRINTER_ACCESS_USE;
2147
2148         const int PRINTER_READ          = SEC_STD_READ_CONTROL |
2149                                           PRINTER_ACCESS_USE;
2150
2151         const int PRINTER_WRITE         = STANDARD_RIGHTS_WRITE_ACCESS |
2152                                           PRINTER_ACCESS_USE;
2153
2154         const int PRINTER_EXECUTE       = SEC_STD_READ_CONTROL |
2155                                           PRINTER_ACCESS_USE;
2156
2157         /* Access rights for jobs */
2158         const int JOB_ALL_ACCESS        = SEC_STD_REQUIRED |
2159                                           JOB_ACCESS_ADMINISTER;
2160
2161         const int JOB_READ              = SEC_STD_READ_CONTROL |
2162                                           JOB_ACCESS_ADMINISTER;
2163
2164         const int JOB_WRITE             = STANDARD_RIGHTS_WRITE_ACCESS |
2165                                           JOB_ACCESS_ADMINISTER;
2166
2167         const int JOB_EXECUTE           = SEC_STD_READ_CONTROL |
2168                                           JOB_ACCESS_ADMINISTER;
2169
2170         /* ACE masks for various print permissions */
2171         const int PRINTER_ACE_FULL_CONTROL = SEC_GENERIC_ALL |
2172                                                 PRINTER_ALL_ACCESS;
2173
2174         const int PRINTER_ACE_MANAGE_DOCUMENTS = SEC_GENERIC_ALL |
2175                                                 READ_CONTROL_ACCESS;
2176
2177         const int PRINTER_ACE_PRINT     = GENERIC_EXECUTE_ACCESS |
2178                                           READ_CONTROL_ACCESS |
2179                                           PRINTER_ACCESS_USE;
2180
2181         /******************/
2182         /* Function: 0x45 */
2183         [public] WERROR spoolss_OpenPrinterEx(
2184                 [in,unique]           [string,charset(UTF16)] uint16 *printername,
2185                 [in,unique]           [string,charset(UTF16)] uint16 *datatype,
2186                 [in]                  spoolss_DevmodeContainer devmode_ctr,
2187                 [in]                  spoolss_AccessRights access_mask,
2188                 [in]                  uint32 level,
2189                 [in,switch_is(level)] spoolss_UserLevel userlevel,
2190                 [out,ref]             policy_handle *handle
2191         );
2192
2193         /******************/
2194         /* Function: 0x46 */
2195         WERROR spoolss_AddPrinterEx(
2196                 [in,unique] [string,charset(UTF16)] uint16 *server,
2197                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
2198                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
2199                 [in,ref] sec_desc_buf *secdesc_ctr,
2200                 [in,ref] spoolss_UserLevelCtr *userlevel_ctr,
2201                 [out,ref] policy_handle *handle
2202         );
2203
2204         /******************/
2205         /* Function: 0x47 */
2206         [todo] WERROR spoolss_47(
2207         );
2208
2209         /******************/
2210         /* Function: 0x48 */
2211         WERROR spoolss_EnumPrinterData(
2212                 [in,ref] policy_handle *handle,
2213                 [in]     uint32 enum_index,
2214                 [out,size_is(value_offered/2),charset(UTF16)] uint16 value_name[],
2215                 [in]     uint32 value_offered,
2216                 [out,ref] uint32 *value_needed,
2217                 [out,ref] winreg_Type *type,
2218                 [out,ref,size_is(data_offered),flag(LIBNDR_PRINT_ARRAY_HEX)] uint8 *data,
2219                 [in]     uint32 data_offered,
2220                 [out,ref] uint32 *data_needed
2221         );
2222
2223         /******************/
2224         /* Function: 0x49 */
2225         WERROR spoolss_DeletePrinterData(
2226                 [in,ref] policy_handle *handle,
2227                 [in] [string,charset(UTF16)] uint16 value_name[]
2228         );
2229
2230         /******************/
2231         /* Function: 0x4a */
2232         [todo] WERROR spoolss_4a(
2233         );
2234
2235         /******************/
2236         /* Function: 0x4b */
2237         [todo] WERROR spoolss_4b(
2238         );
2239
2240         /******************/
2241         /* Function: 0x4c */
2242         [todo] WERROR spoolss_4c(
2243         );
2244
2245         /******************/
2246         /* Function: 0x4d */
2247         WERROR spoolss_SetPrinterDataEx(
2248                 [in,ref] policy_handle *handle,
2249                 [in]     [string,charset(UTF16)] uint16 key_name[],
2250                 [in]     [string,charset(UTF16)] uint16 value_name[],
2251                 [in]     winreg_Type type,
2252                 [in,ref] [size_is(offered)] uint8 *buffer,
2253                 [in]     uint32 offered
2254         );
2255
2256         /******************/
2257         /* Function: 0x4e */
2258         WERROR spoolss_GetPrinterDataEx(
2259                 [in,ref] policy_handle *handle,
2260                 [in]     [string,charset(UTF16)] uint16 key_name[],
2261                 [in]     [string,charset(UTF16)] uint16 value_name[],
2262                 [out,ref] winreg_Type *type,
2263                 [out,ref] [size_is(offered)] uint8 *buffer,
2264                 [in]     uint32 offered,
2265                 [out,ref] uint32 *needed
2266         );
2267
2268         /******************/
2269         /* Function: 0x4f */
2270
2271         typedef [relative_base,public,gensize] struct {
2272                 [relative] nstring *value_name;
2273                 [value(2*strlen_m_term(value_name))] uint32 value_name_len;
2274                 winreg_Type type;
2275                 [relative,switch_is(type),subcontext(0),subcontext_size(r->data_length)] spoolss_PrinterData *data;
2276                 [value(ndr_size_spoolss_PrinterData(data, type, ndr->iconv_convenience, ndr->flags))] uint32 data_length;
2277         } spoolss_PrinterEnumValues;
2278
2279         [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDataEx(
2280                 [in,ref] policy_handle *handle,
2281                 [in]     [string,charset(UTF16)] uint16 key_name[],
2282                 [out] DATA_BLOB info,
2283                 [in] uint32 offered,
2284                 [out,ref] uint32 *needed,
2285                 [out,ref] uint32 *count
2286         );
2287         [public,noopnum,noprint] void __spoolss_EnumPrinterDataEx(
2288                 [in] uint32 count,
2289                 [out] spoolss_PrinterEnumValues info[count]
2290         );
2291         [nopull,nopush] WERROR spoolss_EnumPrinterDataEx(
2292                 [in,ref] policy_handle *handle,
2293                 [in]     [string,charset(UTF16)] uint16 key_name[],
2294                 [in] uint32 offered,
2295                 [out,ref] uint32 *count,
2296                 [out,ref,size_is(,*count)] spoolss_PrinterEnumValues **info,
2297                 [out,ref] uint32 *needed
2298         );
2299
2300         /******************/
2301         /* Function: 0x50 */
2302         [public] WERROR spoolss_EnumPrinterKey(
2303                 [in, ref] policy_handle *handle,
2304                 [in] [string,charset(UTF16)] uint16 key_name[],
2305                 [out,ref] [subcontext(0),subcontext_size(offered)] nstring_array **key_buffer,
2306                 [in] uint32 offered,
2307                 [out,ref] uint32 *needed
2308         );
2309
2310         /******************/
2311         /* Function: 0x51 */
2312         WERROR spoolss_DeletePrinterDataEx(
2313                 [in,ref] policy_handle *handle,
2314                 [in] [string,charset(UTF16)] uint16 key_name[],
2315                 [in] [string,charset(UTF16)] uint16 value_name[]
2316         );
2317
2318         /******************/
2319         /* Function: 0x52 */
2320         WERROR spoolss_DeletePrinterKey(
2321                 [in,ref] policy_handle *handle,
2322                 [in] [string,charset(UTF16)] uint16 key_name[]
2323         );
2324
2325         /******************/
2326         /* Function: 0x53 */
2327         [todo] WERROR spoolss_53(
2328         );
2329
2330         /******************/
2331         /* Function: 0x54 */
2332         typedef [public,bitmap32bit] bitmap {
2333                 DPD_DELETE_UNUSED_FILES         = 0x00000001,
2334                 DPD_DELETE_SPECIFIC_VERSION     = 0x00000002,
2335                 DPD_DELETE_ALL_FILES            = 0x00000004
2336         } spoolss_DeleteDriverFlags;
2337
2338         WERROR spoolss_DeletePrinterDriverEx(
2339                 [in,unique] [string,charset(UTF16)] uint16 *server,
2340                 [in] [string,charset(UTF16)] uint16 architecture[],
2341                 [in] [string,charset(UTF16)] uint16 driver[],
2342                 [in] spoolss_DeleteDriverFlags delete_flags,
2343                 [in] uint32 version
2344         );
2345
2346         /******************/
2347         /* Function: 0x55 */
2348         [todo] WERROR spoolss_55(
2349         );
2350
2351         /******************/
2352         /* Function: 0x56 */
2353         [todo] WERROR spoolss_56(
2354         );
2355
2356         /******************/
2357         /* Function: 0x57 */
2358         [todo] WERROR spoolss_57(
2359         );
2360
2361         /******************/
2362         /* Function: 0x58 */
2363
2364         typedef [v1_enum] enum {
2365                 PROTOCOL_RAWTCP_TYPE    = 1,
2366                 PROTOCOL_LPR_TYPE       = 2
2367         } spoolss_PortProtocol;
2368
2369         typedef [public] struct {
2370                 [charset(UTF16)] uint16 portname[64];
2371                 [value(0x00000001)] uint32 version;
2372                 spoolss_PortProtocol protocol;
2373                 [value(sizeof(r))] uint32 size;
2374                 uint32 reserved;
2375                 [charset(UTF16)] uint16 hostaddress[49];
2376                 [charset(UTF16)] uint16 snmpcommunity[33];
2377                 uint32 dblspool;
2378                 [charset(UTF16)] uint16 queue[33];
2379                 [charset(UTF16)] uint16 ip_address[16]; /* s3 had 17 */
2380                 [charset(UTF16)] uint16 hardware_address[13];
2381                 [charset(UTF16)] uint16 device_type[257];
2382                 uint32 port_number;
2383                 boolean32 snmp_enabled;
2384                 uint32 snmp_dev_index;
2385         } spoolss_PortData1;
2386
2387         typedef [public] struct {
2388                 [charset(UTF16)] uint16 portname[64];
2389                 [value(0x00000002)] uint32 version;
2390                 spoolss_PortProtocol protocol;
2391                 [value(sizeof(r))] uint32 size;
2392                 uint32 reserved;
2393                 [charset(UTF16)] uint16 hostaddress[128];
2394                 [charset(UTF16)] uint16 snmpcommunity[33];
2395                 uint32 dblspool;
2396                 [charset(UTF16)] uint16 queue[33];
2397                 [charset(UTF16)] uint16 device_type[257];
2398                 uint32 port_number;
2399                 boolean32 snmp_enabled;
2400                 uint32 snmp_dev_index;
2401                 uint32 port_monitor_mib_index;
2402         } spoolss_PortData2;
2403
2404         typedef [public] struct {
2405                 nstring dll_name;
2406         } spoolss_MonitorUi;
2407
2408         WERROR spoolss_XcvData(
2409                 [in,ref] policy_handle *handle,
2410                 [in] [string,charset(UTF16)] uint16 function_name[],
2411                 [in] DATA_BLOB in_data,
2412                 [in,value(r->in.in_data.length)] uint32 _in_data_length,
2413                 [out,ref] [size_is(out_data_size)] uint8 *out_data,
2414                 [in] uint32 out_data_size,
2415                 [out,ref] uint32 *needed,
2416                 [in,out,ref] uint32 *status_code
2417         );
2418
2419         /******************/
2420         /* Function: 0x59 */
2421
2422         typedef [bitmap32bit] bitmap {
2423                 APD_STRICT_UPGRADE              = 0x00000001,
2424                 APD_STRICT_DOWNGRADE            = 0x00000002,
2425                 APD_COPY_ALL_FILES              = 0x00000004,
2426                 APD_COPY_NEW_FILES              = 0x00000008,
2427                 APD_COPY_FROM_DIRECTORY         = 0x00000010,
2428                 APD_DONT_COPY_FILES_TO_CLUSTER  = 0x00001000,
2429                 APD_COPY_TO_ALL_SPOOLERS        = 0x00002000,
2430                 APD_RETURN_BLOCKING_STATUS_CODE = 0x00010000
2431         } spoolss_AddPrinterDriverExFlags;
2432
2433         [public] WERROR spoolss_AddPrinterDriverEx(
2434                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2435                 [in,ref] spoolss_AddDriverInfoCtr *info_ctr,
2436                 [in] spoolss_AddPrinterDriverExFlags flags
2437         );
2438
2439         /******************/
2440         /* Function: 0x5a */
2441         [todo] WERROR spoolss_5a(
2442         );
2443
2444         /******************/
2445         /* Function: 0x5b */
2446         [todo] WERROR spoolss_5b(
2447         );
2448
2449         /******************/
2450         /* Function: 0x5c */
2451         [todo] WERROR spoolss_5c(
2452         );
2453
2454         /******************/
2455         /* Function: 0x5d */
2456         [todo] WERROR spoolss_5d(
2457         );
2458
2459         /******************/
2460         /* Function: 0x5e */
2461         [todo] WERROR spoolss_5e(
2462         );
2463
2464         /******************/
2465         /* Function: 0x5f */
2466         [todo] WERROR spoolss_5f(
2467         );
2468 }