spoolss: fill in some unknowns in spoolss_PrinterInfo0 and spoolss_SetPrinterInfo0.
[metze/samba/wip.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         typedef struct {
70                 [relative] nstring *printername;
71                 [relative] nstring *servername;
72                 uint32 cjobs;
73                 uint32 total_jobs;
74                 uint32 total_bytes;
75                 spoolss_Time time;
76                 uint32 global_counter;
77                 uint32 total_pages;
78                 uint32 version;
79                 uint32 free_build;
80                 uint32 spooling;
81                 uint32 max_spooling;
82                 uint32 session_counter;
83                 uint32 num_error_out_of_paper;
84                 uint32 num_error_not_ready;
85                 uint32 job_error;
86                 uint32 number_of_processors;
87                 spoolss_ProcessorType processor_type;
88                 uint32 high_part_total_bytes;
89                 uint32 change_id;
90                 WERROR last_error;
91                 uint32 status;
92                 uint32 enumerate_network_printers;
93                 uint32 c_setprinter;
94                 spoolss_ProcessorArchitecture processor_architecture;
95                 uint16 processor_level;
96                 uint32 ref_ic;
97                 uint32 reserved2;
98                 uint32 reserved3;
99         } spoolss_PrinterInfo0;
100
101         typedef [bitmap32bit] bitmap {
102                 DEVMODE_ORIENTATION             = 0x00000001,
103                 DEVMODE_PAPERSIZE               = 0x00000002,
104                 DEVMODE_PAPERLENGTH             = 0x00000004,
105                 DEVMODE_PAPERWIDTH              = 0x00000008,
106                 DEVMODE_SCALE                   = 0x00000010,
107                 DEVMODE_POSITION                = 0x00000020,
108                 DEVMODE_NUP                     = 0x00000040,
109                 DEVMODE_COPIES                  = 0x00000100,
110                 DEVMODE_DEFAULTSOURCE           = 0x00000200,
111                 DEVMODE_PRINTQUALITY            = 0x00000400,
112                 DEVMODE_COLOR                   = 0x00000800,
113                 DEVMODE_DUPLEX                  = 0x00001000,
114                 DEVMODE_YRESOLUTION             = 0x00002000,
115                 DEVMODE_TTOPTION                = 0x00004000,
116                 DEVMODE_COLLATE                 = 0x00008000,
117                 DEVMODE_FORMNAME                = 0x00010000,
118                 DEVMODE_LOGPIXELS               = 0x00020000,
119                 DEVMODE_BITSPERPEL              = 0x00040000,
120                 DEVMODE_PELSWIDTH               = 0x00080000,
121                 DEVMODE_PELSHEIGHT              = 0x00100000,
122                 DEVMODE_DISPLAYFLAGS            = 0x00200000,
123                 DEVMODE_DISPLAYFREQUENCY        = 0x00400000,
124                 DEVMODE_ICMMETHOD               = 0x00800000,
125                 DEVMODE_ICMINTENT               = 0x01000000,
126                 DEVMODE_MEDIATYPE               = 0x02000000,
127                 DEVMODE_DITHERTYPE              = 0x04000000,
128                 DEVMODE_PANNINGWIDTH            = 0x08000000,
129                 DEVMODE_PANNINGHEIGHT           = 0x10000000
130         } spoolss_DeviceModeFields;
131
132         typedef [public,gensize] struct {
133                 [charset(UTF16)] uint16 devicename[32];
134                 uint16 specversion;
135                 uint16 driverversion;
136                 uint16 size;
137                 [value(r->driverextra_data.length)] uint16 __driverextra_length;
138                 spoolss_DeviceModeFields fields;
139                 uint16 orientation;
140                 uint16 papersize;
141                 uint16 paperlength;
142                 uint16 paperwidth;
143                 uint16 scale;
144                 uint16 copies;
145                 uint16 defaultsource;
146                 uint16 printquality;
147                 uint16 color;
148                 uint16 duplex;
149                 uint16 yresolution;
150                 uint16 ttoption;
151                 uint16 collate;
152                 [charset(UTF16)] uint16 formname[32];
153                 uint16 logpixels;
154                 uint32 bitsperpel;
155                 uint32 pelswidth;
156                 uint32 pelsheight;
157                 uint32 displayflags;
158                 uint32 displayfrequency;
159                 uint32 icmmethod;
160                 uint32 icmintent;
161                 uint32 mediatype;
162                 uint32 dithertype;
163                 uint32 reserved1;
164                 uint32 reserved2;
165                 uint32 panningwidth;
166                 uint32 panningheight;
167                 [subcontext_size(__driverextra_length),subcontext(0),flag(NDR_REMAINING)] DATA_BLOB driverextra_data;
168         } spoolss_DeviceMode;
169
170         typedef [public] bitmap {
171                 PRINTER_ENUM_DEFAULT     = 0x00000001,
172                 PRINTER_ENUM_LOCAL       = 0x00000002,
173                 PRINTER_ENUM_CONNECTIONS = 0x00000004,
174                 PRINTER_ENUM_FAVORITE    = 0x00000004,
175                 PRINTER_ENUM_NAME        = 0x00000008,
176                 PRINTER_ENUM_REMOTE      = 0x00000010,
177                 PRINTER_ENUM_SHARED      = 0x00000020,
178                 PRINTER_ENUM_NETWORK     = 0x00000040,
179                 PRINTER_ENUM_EXPAND      = 0x00004000,
180                 PRINTER_ENUM_CONTAINER   = 0x00008000,
181                 PRINTER_ENUM_ICON1       = 0x00010000,
182                 PRINTER_ENUM_ICON2       = 0x00020000,
183                 PRINTER_ENUM_ICON3       = 0x00040000,
184                 PRINTER_ENUM_ICON4       = 0x00080000,
185                 PRINTER_ENUM_ICON5       = 0x00100000,
186                 PRINTER_ENUM_ICON6       = 0x00200000,
187                 PRINTER_ENUM_ICON7       = 0x00400000,
188                 PRINTER_ENUM_ICON8       = 0x00800000,
189                 PRINTER_ENUM_HIDE        = 0x01000000
190         } spoolss_EnumPrinterFlags;
191
192         const int PRINTER_ENUM_ICONMASK = (PRINTER_ENUM_ICON1 |
193                                            PRINTER_ENUM_ICON2 |
194                                            PRINTER_ENUM_ICON3 |
195                                            PRINTER_ENUM_ICON4 |
196                                            PRINTER_ENUM_ICON5 |
197                                            PRINTER_ENUM_ICON6 |
198                                            PRINTER_ENUM_ICON7 |
199                                            PRINTER_ENUM_ICON8); /* 0x00ff0000 */
200
201         typedef struct {
202                 spoolss_EnumPrinterFlags flags;
203                 [relative] nstring *name;
204                 [relative] nstring *description;
205                 [relative] nstring *comment;
206         } spoolss_PrinterInfo1;
207
208         typedef bitmap {
209                 PRINTER_ATTRIBUTE_QUEUED                = 0x00000001,
210                 PRINTER_ATTRIBUTE_DIRECT                = 0x00000002,
211                 PRINTER_ATTRIBUTE_DEFAULT               = 0x00000004,
212                 PRINTER_ATTRIBUTE_SHARED                = 0x00000008,
213                 PRINTER_ATTRIBUTE_NETWORK               = 0x00000010,
214                 PRINTER_ATTRIBUTE_HIDDEN                = 0x00000020,
215                 PRINTER_ATTRIBUTE_LOCAL                 = 0x00000040,
216                 PRINTER_ATTRIBUTE_ENABLE_DEVQ           = 0x00000080,
217                 PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS       = 0x00000100,
218                 PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST     = 0x00000200,
219                 PRINTER_ATTRIBUTE_WORK_OFFLINE          = 0x00000400,
220                 PRINTER_ATTRIBUTE_ENABLE_BIDI           = 0x00000800,
221                 PRINTER_ATTRIBUTE_RAW_ONLY              = 0x00001000,
222                 PRINTER_ATTRIBUTE_PUBLISHED             = 0x00002000,
223                 PRINTER_ATTRIBUTE_FAX                   = 0x00004000,
224                 PRINTER_ATTRIBUTE_TS                    = 0x00008000
225         } spoolss_PrinterAttributes;
226
227         typedef bitmap {
228                 PRINTER_STATUS_PAUSED           = 0x00000001,
229                 PRINTER_STATUS_ERROR            = 0x00000002,
230                 PRINTER_STATUS_PENDING_DELETION = 0x00000004,
231                 PRINTER_STATUS_PAPER_JAM        = 0x00000008,
232                 PRINTER_STATUS_PAPER_OUT        = 0x00000010,
233                 PRINTER_STATUS_MANUAL_FEED      = 0x00000020,
234                 PRINTER_STATUS_PAPER_PROBLEM    = 0x00000040,
235                 PRINTER_STATUS_OFFLINE          = 0x00000080,
236                 PRINTER_STATUS_IO_ACTIVE        = 0x00000100,
237                 PRINTER_STATUS_BUSY             = 0x00000200,
238                 PRINTER_STATUS_PRINTING         = 0x00000400,
239                 PRINTER_STATUS_OUTPUT_BIN_FULL  = 0x00000800,
240                 PRINTER_STATUS_NOT_AVAILABLE    = 0x00001000,
241                 PRINTER_STATUS_WAITING          = 0x00002000,
242                 PRINTER_STATUS_PROCESSING       = 0x00004000,
243                 PRINTER_STATUS_INITIALIZING     = 0x00008000,
244                 PRINTER_STATUS_WARMING_UP       = 0x00010000,
245                 PRINTER_STATUS_TONER_LOW        = 0x00020000,
246                 PRINTER_STATUS_NO_TONER         = 0x00040000,
247                 PRINTER_STATUS_PAGE_PUNT        = 0x00080000,
248                 PRINTER_STATUS_USER_INTERVENTION= 0x00100000,
249                 PRINTER_STATUS_OUT_OF_MEMORY    = 0x00200000,
250                 PRINTER_STATUS_DOOR_OPEN        = 0x00400000,
251                 PRINTER_STATUS_SERVER_UNKNOWN   = 0x00800000,
252                 PRINTER_STATUS_POWER_SAVE       = 0x01000000
253         } spoolss_PrinterStatus;
254
255         typedef struct {
256                 [relative] nstring *servername;
257                 [relative] nstring *printername;
258                 [relative] nstring *sharename;
259                 [relative] nstring *portname;
260                 [relative] nstring *drivername;
261                 [relative] nstring *comment;
262                 [relative] nstring *location;
263                 [relative,subcontext(0)] spoolss_DeviceMode *devmode;
264                 [relative] nstring *sepfile;
265                 [relative] nstring *printprocessor;
266                 [relative] nstring *datatype;
267                 [relative] nstring *parameters;
268                 [relative,subcontext(0)] security_descriptor *secdesc;
269                 spoolss_PrinterAttributes attributes;
270                 uint32 priority;
271                 uint32 defaultpriority;
272                 uint32 starttime;
273                 uint32 untiltime;
274                 spoolss_PrinterStatus status;
275                 uint32 cjobs;
276                 uint32 averageppm;
277         } spoolss_PrinterInfo2;
278
279         typedef struct {
280                 [relative,subcontext(0)] security_descriptor *secdesc;
281         } spoolss_PrinterInfo3;
282
283         typedef struct {
284                 [relative] nstring *printername;
285                 [relative] nstring *servername;
286                 spoolss_PrinterAttributes attributes;
287         } spoolss_PrinterInfo4;
288
289         typedef struct {
290                 [relative] nstring *printername;
291                 [relative] nstring *portname;
292                 spoolss_PrinterAttributes attributes;
293                 uint32 device_not_selected_timeout;
294                 uint32 transmission_retry_timeout;
295         } spoolss_PrinterInfo5;
296
297         typedef struct {
298                 spoolss_PrinterStatus status;
299         } spoolss_PrinterInfo6;
300
301         typedef bitmap {
302                 DSPRINT_PUBLISH         = 0x00000001,
303                 DSPRINT_UPDATE          = 0x00000002,
304                 DSPRINT_UNPUBLISH       = 0x00000004,
305                 DSPRINT_REPUBLISH       = 0x00000008,
306                 DSPRINT_PENDING         = 0x80000000
307         } spoolss_DsPrintAction;
308
309         typedef struct {
310                 [relative] nstring *guid; /* text form of printer guid */
311                 spoolss_DsPrintAction action;
312         } spoolss_PrinterInfo7;
313
314         typedef struct {
315                 [relative,subcontext(0)] spoolss_DeviceMode *devmode;
316         } spoolss_DeviceModeInfo;
317
318         typedef [nodiscriminant,relative_base,public] union {
319                 [case(0)] spoolss_PrinterInfo0 info0;
320                 [case(1)] spoolss_PrinterInfo1 info1;
321                 [case(2)] spoolss_PrinterInfo2 info2;
322                 [case(3)] spoolss_PrinterInfo3 info3;
323                 [case(4)] spoolss_PrinterInfo4 info4;
324                 [case(5)] spoolss_PrinterInfo5 info5;
325                 [case(6)] spoolss_PrinterInfo6 info6;
326                 [case(7)] spoolss_PrinterInfo7 info7;
327                 [case(8)] spoolss_DeviceModeInfo info8;
328                 [case(9)] spoolss_DeviceModeInfo info9;
329                 [default];
330         } spoolss_PrinterInfo;
331
332         /******************/
333         /* Function: 0x00 */
334         /* we are using this as internal parsing code */
335         [public,noopnum,noprint] WERROR _spoolss_EnumPrinters(
336                 [in] spoolss_EnumPrinterFlags flags,
337                 [in,unique] [string,charset(UTF16)] uint16 *server,
338                 [in] uint32 level,
339                 [in,unique] DATA_BLOB *buffer,
340                 [in] uint32 offered,
341                 [out,unique] DATA_BLOB *info,
342                 [out,ref] uint32 *needed,
343                 [out] uint32 count
344         );
345         [public,noopnum,noprint] void __spoolss_EnumPrinters(
346                 [in] uint32 level,
347                 [in] uint32 count,
348                 [out,switch_is(level)] spoolss_PrinterInfo info[count]
349         );
350         [nopull,nopush] WERROR spoolss_EnumPrinters(
351                 [in] spoolss_EnumPrinterFlags flags,
352                 [in,unique] [string,charset(UTF16)] uint16 *server,
353                 [in] uint32 level,
354                 [in,unique] DATA_BLOB *buffer,
355                 [in] uint32 offered,
356                 /* what we have here is a subcontext containing an array of no discriminant unions
357                  * and the array has no size in front
358                  */
359                 [out,unique,switch_is(level),size_is(count)] spoolss_PrinterInfo *info,
360                 [out,ref] uint32 *needed,
361                 [out] uint32 count
362         );
363
364         /******************/
365         /* Function: 0x01 */
366         typedef struct {
367                 [value(_ndr_size_spoolss_DeviceMode(devmode, ndr->iconv_convenience, ndr->flags))] uint32 _ndr_size;
368                 [subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode;
369         } spoolss_DevmodeContainer;
370
371         [public] WERROR spoolss_OpenPrinter(
372                 [in,unique] [string,charset(UTF16)] uint16 *printername,
373                 [in,unique] [string,charset(UTF16)] uint16 *datatype,
374                 [in] spoolss_DevmodeContainer devmode_ctr,
375                 [in] uint32 access_mask,
376                 [out,ref] policy_handle *handle
377         );
378
379         /******************/
380         /* Function: 0x02 */
381         typedef struct {
382                 uint32 job_id;
383                 [relative] nstring *printer_name;
384                 [relative] nstring *server_name;
385                 [relative] nstring *user_name;
386                 [relative] nstring *document_name;
387                 [relative] nstring *data_type;
388                 [relative] nstring *text_status;
389                 uint32 status;
390                 uint32 priority;
391                 uint32 position;
392                 uint32 total_pages;
393                 uint32 pages_printed;
394                 spoolss_Time time;
395         } spoolss_JobInfo1;
396
397         typedef [nodiscriminant,relative_base,public] union {
398                 [case(1)] spoolss_JobInfo1 info1;
399                 [case(2)]; /* TODO */
400                 [case(3)]; /* TODO */
401                 [default];
402         } spoolss_JobInfo;
403
404         typedef struct {
405                 uint32 level;
406                 [switch_is(level)] spoolss_JobInfo info;
407         } spoolss_JobInfoContainer;
408
409         typedef [v1_enum] enum {
410                 SPOOLSS_JOB_CONTROL_PAUSE               = 1,
411                 SPOOLSS_JOB_CONTROL_RESUME              = 2,
412                 SPOOLSS_JOB_CONTROL_CANCEL              = 3,
413                 SPOOLSS_JOB_CONTROL_RESTART             = 4,
414                 SPOOLSS_JOB_CONTROL_DELETE              = 5,
415                 SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER     = 6,
416                 SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED   = 7
417         } spoolss_JobControl;
418
419         WERROR spoolss_SetJob(
420                 [in,ref] policy_handle *handle,
421                 [in] uint32 job_id,
422                 [in,unique] spoolss_JobInfoContainer *ctr,
423                 [in] spoolss_JobControl command
424         );
425
426         /******************/
427         /* Function: 0x03 */
428         WERROR spoolss_GetJob(
429                 [in,ref] policy_handle *handle,
430                 [in]     uint32 job_id,
431                 [in]     uint32 level,
432                 [in,unique] DATA_BLOB *buffer,
433                 [in]     uint32 offered,
434                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info,
435                 [out,ref] uint32 *needed
436         );
437
438         /******************/
439         /* Function: 0x04 */
440         [public,noopnum,noprint] WERROR _spoolss_EnumJobs(
441                 [in,ref] policy_handle *handle,
442                 [in]     uint32 firstjob,
443                 [in]     uint32 numjobs,
444                 [in]     uint32 level,
445                 [in,unique] DATA_BLOB *buffer,
446                 [in]     uint32 offered,
447                 [out,unique] DATA_BLOB *info,
448                 [out,ref] uint32 *needed,
449                 [out]    uint32 count
450         );
451         [public,noopnum,noprint] void __spoolss_EnumJobs(
452                 [in] uint32 level,
453                 [in] uint32 count,
454                 [out,switch_is(level)] spoolss_JobInfo info[count]
455         );
456         [nopull,nopush] WERROR spoolss_EnumJobs(
457                 [in,ref] policy_handle *handle,
458                 [in]     uint32 firstjob,
459                 [in]     uint32 numjobs,
460                 [in]     uint32 level,
461                 [in,unique] DATA_BLOB *buffer,
462                 [in]     uint32 offered,
463                 [out,unique,switch_is(level),size_is(count)] spoolss_JobInfo *info,
464                 [out,ref] uint32 *needed,
465                 [out]    uint32 count
466         );
467
468         /******************/
469         /* Function: 0x05 */
470         [todo] WERROR spoolss_AddPrinter(
471                 /* This function is not implemented in Samba 3 as no
472                    clients have been observed using it. */
473         );
474
475         /******************/
476         /* Function: 0x06 */
477         WERROR spoolss_DeletePrinter(
478                 [in] policy_handle *handle
479         );
480
481         /******************/
482         /* Function: 0x07 */
483         typedef [v1_enum] enum {
484                 SPOOLSS_PRINTER_CONTROL_UNPAUSE    = 0,
485                 SPOOLSS_PRINTER_CONTROL_PAUSE      = 1,
486                 SPOOLSS_PRINTER_CONTROL_RESUME     = 2,
487                 SPOOLSS_PRINTER_CONTROL_PURGE      = 3,
488                 SPOOLSS_PRINTER_CONTROL_SET_STATUS = 4
489         } spoolss_PrinterControl;
490
491         typedef struct {
492                 [string,charset(UTF16)] uint16 *servername;
493                 [string,charset(UTF16)] uint16 *printername;
494                 uint32 cjobs;
495                 uint32 total_jobs;
496                 uint32 total_bytes;
497                 spoolss_Time time;
498                 uint32 global_counter;
499                 uint32 total_pages;
500                 uint32 version;
501                 uint32 free_build;
502                 uint32 spooling;
503                 uint32 max_spooling;
504                 uint32 session_counter;
505                 uint32 num_error_out_of_paper;
506                 uint32 num_error_not_ready;
507                 uint32 job_error;
508                 uint32 number_of_processors;
509                 spoolss_ProcessorType processor_type;
510                 uint32 high_part_total_bytes;
511                 uint32 change_id;
512                 WERROR last_error;
513                 uint32 status;
514                 uint32 enumerate_network_printers;
515                 uint32 c_setprinter;
516                 spoolss_ProcessorArchitecture processor_architecture;
517                 uint16 processor_level;
518                 uint32 ref_ic;
519                 uint32 reserved2;
520                 uint32 reserved3;
521         } spoolss_SetPrinterInfo0;
522
523         typedef struct {
524                 spoolss_EnumPrinterFlags flags;
525                 [string,charset(UTF16)] uint16 *name;
526                 [string,charset(UTF16)] uint16 *description;
527                 [string,charset(UTF16)] uint16 *comment;
528         } spoolss_SetPrinterInfo1;
529
530         typedef struct {
531                 [string,charset(UTF16)] uint16 *servername;
532                 [string,charset(UTF16)] uint16 *printername;
533                 [string,charset(UTF16)] uint16 *sharename;
534                 [string,charset(UTF16)] uint16 *portname;
535                 [string,charset(UTF16)] uint16 *drivername;
536                 [string,charset(UTF16)] uint16 *comment;
537                 [string,charset(UTF16)] uint16 *location;
538                 [subcontext(0)] spoolss_DeviceMode *devmode;
539                 [string,charset(UTF16)] uint16 *sepfile;
540                 [string,charset(UTF16)] uint16 *printprocessor;
541                 [string,charset(UTF16)] uint16 *datatype;
542                 [string,charset(UTF16)] uint16 *parameters;
543                 [subcontext(0)] security_descriptor *secdesc;
544                 spoolss_PrinterAttributes attributes;
545                 uint32 priority;
546                 uint32 defaultpriority;
547                 uint32 starttime;
548                 uint32 untiltime;
549                 spoolss_PrinterStatus status;
550                 uint32 cjobs;
551                 uint32 averageppm;
552         } spoolss_SetPrinterInfo2;
553
554         typedef struct {
555                 security_descriptor *secdesc;
556         } spoolss_SetPrinterInfo3;
557
558         typedef struct {
559                 [string,charset(UTF16)] uint16 *printername;
560                 [string,charset(UTF16)] uint16 *servername;
561                 spoolss_PrinterAttributes attributes;
562         } spoolss_SetPrinterInfo4;
563
564         typedef struct {
565                 [string,charset(UTF16)] uint16 *printername;
566                 [string,charset(UTF16)] uint16 *portname;
567                 spoolss_PrinterAttributes attributes;
568                 uint32 device_not_selected_timeout;
569                 uint32 transmission_retry_timeout;
570         } spoolss_SetPrinterInfo5;
571
572         typedef struct {
573                 spoolss_PrinterStatus status;
574         } spoolss_SetPrinterInfo6;
575
576         typedef struct {
577                 [string,charset(UTF16)] uint16 *guid; /* text form of printer guid */
578                 spoolss_DsPrintAction action;
579         } spoolss_SetPrinterInfo7;
580
581         typedef [switch_type(uint32)] union {
582                 [case(0)] spoolss_SetPrinterInfo0 *info0;
583                 [case(1)] spoolss_SetPrinterInfo1 *info1;
584                 [case(2)] spoolss_SetPrinterInfo2 *info2;
585                 [case(3)] spoolss_SetPrinterInfo3 *info3;
586                 [case(4)] spoolss_SetPrinterInfo4 *info4;
587                 [case(5)] spoolss_SetPrinterInfo5 *info5;
588                 [case(6)] spoolss_SetPrinterInfo6 *info6;
589                 [case(7)] spoolss_SetPrinterInfo7 *info7;
590                 [case(8)] spoolss_DeviceModeInfo *info8;
591                 [case(9)] spoolss_DeviceModeInfo *info9;
592                 [default];
593         } spoolss_SetPrinterInfo;
594
595         typedef struct {
596                 uint32 level;
597                 [switch_is(level)] spoolss_SetPrinterInfo info;
598         } spoolss_SetPrinterInfoCtr;
599
600         WERROR spoolss_SetPrinter(
601                 [in,ref] policy_handle *handle,
602                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
603                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
604                 [in,ref] sec_desc_buf *secdesc_ctr,
605                 [in] spoolss_PrinterControl command
606         );
607
608         /******************/
609         /* Function: 0x08 */
610         [public] WERROR spoolss_GetPrinter(
611                 [in,ref] policy_handle *handle,
612                 [in]     uint32 level,
613                 [in,unique] DATA_BLOB *buffer,
614                 [in]     uint32 offered,
615                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info,
616                 [out,ref] uint32 *needed
617         );
618
619         /******************/
620         /* Function: 0x09 */
621
622         typedef [public,gensize] struct {
623                 [value((ndr_size_spoolss_StringArray(r, ndr->iconv_convenience, ndr->flags)-4)/2)] uint32 _ndr_size;
624                 /*[subcontext(0),subcontext_size(_ndr_size*2)]*/ nstring_array string;
625         } spoolss_StringArray;
626
627         typedef struct {
628                 [string,charset(UTF16)] uint16 *driver_name;
629         } spoolss_AddDriverInfo1;
630
631         typedef [v1_enum] enum {
632                 SPOOLSS_DRIVER_VERSION_9X       = 0,
633                 SPOOLSS_DRIVER_VERSION_NT35     = 1,
634                 SPOOLSS_DRIVER_VERSION_NT4      = 2,
635                 SPOOLSS_DRIVER_VERSION_200X     = 3
636         } spoolss_DriverOSVersion;
637
638         typedef struct {
639                 spoolss_DriverOSVersion version;
640                 [string,charset(UTF16)] uint16 *driver_name;
641                 [string,charset(UTF16)] uint16 *architecture;
642                 [string,charset(UTF16)] uint16 *driver_path;
643                 [string,charset(UTF16)] uint16 *data_file;
644                 [string,charset(UTF16)] uint16 *config_file;
645         } spoolss_AddDriverInfo2;
646
647         typedef struct {
648                 spoolss_DriverOSVersion version;
649                 [string,charset(UTF16)] uint16 *driver_name;
650                 [string,charset(UTF16)] uint16 *architecture;
651                 [string,charset(UTF16)] uint16 *driver_path;
652                 [string,charset(UTF16)] uint16 *data_file;
653                 [string,charset(UTF16)] uint16 *config_file;
654                 [string,charset(UTF16)] uint16 *help_file;
655                 [string,charset(UTF16)] uint16 *monitor_name;
656                 [string,charset(UTF16)] uint16 *default_datatype;
657                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
658                 spoolss_StringArray *dependent_files;
659         } spoolss_AddDriverInfo3;
660
661         typedef struct {
662                 spoolss_DriverOSVersion version;
663                 [string,charset(UTF16)] uint16 *driver_name;
664                 [string,charset(UTF16)] uint16 *architecture;
665                 [string,charset(UTF16)] uint16 *driver_path;
666                 [string,charset(UTF16)] uint16 *data_file;
667                 [string,charset(UTF16)] uint16 *config_file;
668                 [string,charset(UTF16)] uint16 *help_file;
669                 [string,charset(UTF16)] uint16 *monitor_name;
670                 [string,charset(UTF16)] uint16 *default_datatype;
671                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
672                 spoolss_StringArray *dependent_files;
673                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
674                 spoolss_StringArray *previous_names;
675         } spoolss_AddDriverInfo4;
676
677         typedef struct {
678                 spoolss_DriverOSVersion version;
679                 [string,charset(UTF16)] uint16 *driver_name;
680                 [string,charset(UTF16)] uint16 *architecture;
681                 [string,charset(UTF16)] uint16 *driver_path;
682                 [string,charset(UTF16)] uint16 *data_file;
683                 [string,charset(UTF16)] uint16 *config_file;
684                 uint32 driver_attributes;
685                 uint32 config_version;
686                 uint32 driver_version;
687         } spoolss_AddDriverInfo5;
688
689         typedef struct {
690                 spoolss_DriverOSVersion version;
691                 [string,charset(UTF16)] uint16 *driver_name;
692                 [string,charset(UTF16)] uint16 *architecture;
693                 [string,charset(UTF16)] uint16 *driver_path;
694                 [string,charset(UTF16)] uint16 *data_file;
695                 [string,charset(UTF16)] uint16 *config_file;
696                 [string,charset(UTF16)] uint16 *help_file;
697                 [string,charset(UTF16)] uint16 *monitor_name;
698                 [string,charset(UTF16)] uint16 *default_datatype;
699                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
700                 spoolss_StringArray *dependent_files;
701                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
702                 spoolss_StringArray *previous_names;
703                 NTTIME driver_data;
704                 hyper driver_version;
705                 [string,charset(UTF16)] uint16 *manufacturer_name;
706                 [string,charset(UTF16)] uint16 *manufacturer_url;
707                 [string,charset(UTF16)] uint16 *hardware_id;
708                 [string,charset(UTF16)] uint16 *provider;
709         } spoolss_AddDriverInfo6;
710
711         typedef [switch_type(uint32)] union {
712                 [case(1)] spoolss_AddDriverInfo1 *info1;
713                 [case(2)] spoolss_AddDriverInfo2 *info2;
714                 [case(3)] spoolss_AddDriverInfo3 *info3;
715                 [case(4)] spoolss_AddDriverInfo4 *info4;
716                 [case(6)] spoolss_AddDriverInfo6 *info6;
717         } spoolss_AddDriverInfo;
718
719         WERROR spoolss_AddPrinterDriver(
720                 [in] [string,charset(UTF16)] uint16 *servername,
721                 [in] uint32 level,
722                 [in,switch_is(level)] spoolss_AddDriverInfo info
723         );
724
725         typedef struct {
726                 [relative] nstring *driver_name;
727         } spoolss_DriverInfo1;
728
729         typedef struct {
730                 spoolss_DriverOSVersion version;
731                 [relative] nstring *driver_name;
732                 [relative] nstring *architecture;
733                 [relative] nstring *driver_path;
734                 [relative] nstring *data_file;
735                 [relative] nstring *config_file;
736         } spoolss_DriverInfo2;
737
738         typedef struct {
739                 spoolss_DriverOSVersion version;
740                 [relative] nstring *driver_name;
741                 [relative] nstring *architecture;
742                 [relative] nstring *driver_path;
743                 [relative] nstring *data_file;
744                 [relative] nstring *config_file;
745                 [relative] nstring *help_file;
746                 [relative] nstring_array *dependent_files;
747                 [relative] nstring *monitor_name;
748                 [relative] nstring *default_datatype;
749         } spoolss_DriverInfo3;
750
751         typedef struct {
752                 spoolss_DriverOSVersion version;
753                 [relative] nstring *driver_name;
754                 [relative] nstring *architecture;
755                 [relative] nstring *driver_path;
756                 [relative] nstring *data_file;
757                 [relative] nstring *config_file;
758                 [relative] nstring *help_file;
759                 [relative] nstring_array *dependent_files;
760                 [relative] nstring *monitor_name;
761                 [relative] nstring *default_datatype;
762                 [relative] nstring_array *previous_names;
763         } spoolss_DriverInfo4;
764
765         typedef struct {
766                 spoolss_DriverOSVersion version;
767                 [relative] nstring *driver_name;
768                 [relative] nstring *architecture;
769                 [relative] nstring *driver_path;
770                 [relative] nstring *data_file;
771                 [relative] nstring *config_file;
772                 uint32 driver_attributes;
773                 uint32 config_version;
774                 uint32 driver_version;
775         } spoolss_DriverInfo5;
776
777         typedef struct {
778                 spoolss_DriverOSVersion version;
779                 [relative] nstring *driver_name;
780                 [relative] nstring *architecture;
781                 [relative] nstring *driver_path;
782                 [relative] nstring *data_file;
783                 [relative] nstring *config_file;
784                 [relative] nstring *help_file;
785                 [relative] nstring_array *dependent_files;
786                 [relative] nstring *monitor_name;
787                 [relative] nstring *default_datatype;
788                 [relative] nstring_array *previous_names;
789                 NTTIME driver_data;
790                 hyper driver_version;
791                 [relative] nstring *manufacturer_name;
792                 [relative] nstring *manufacturer_url;
793                 [relative] nstring *hardware_id;
794                 [relative] nstring *provider;
795         } spoolss_DriverInfo6;
796
797         typedef struct {
798                 spoolss_DriverOSVersion version;
799                 [relative] nstring *driver_name;
800                 [relative] nstring *architecture;
801                 [relative] nstring *driver_path;
802                 [relative] nstring *data_file;
803                 [relative] nstring *config_file;
804                 [relative] nstring *help_file;
805                 [relative] nstring *monitor_name;
806                 [relative] nstring *default_datatype;
807                 [relative] nstring_array *dependent_files;
808                 [relative] nstring_array *previous_names;
809                 NTTIME driver_data;
810                 hyper driver_version;
811                 [relative] nstring *manufacturer_name;
812                 [relative] nstring *manufacturer_url;
813                 [relative] nstring *hardware_id;
814                 [relative] nstring *provider;
815                 [relative] nstring *print_processor;
816                 [relative] nstring *vendor_setup;
817                 [relative] nstring_array *color_profiles;
818                 [relative] nstring *inf_path;
819                 uint32 printer_driver_attributes;
820                 [relative] nstring_array *core_driver_dependencies;
821                 NTTIME min_inbox_driver_ver_date;
822                 hyper min_inbox_driver_ver_version;
823         } spoolss_DriverInfo8;
824
825         typedef [nodiscriminant,relative_base,public] union {
826                 [case(1)] spoolss_DriverInfo1 info1;
827                 [case(2)] spoolss_DriverInfo2 info2;
828                 [case(3)] spoolss_DriverInfo3 info3;
829                 [case(4)] spoolss_DriverInfo4 info4;
830                 [case(5)] spoolss_DriverInfo5 info5;
831                 [case(6)] spoolss_DriverInfo6 info6;
832                 [default];
833         } spoolss_DriverInfo;
834
835         /******************/
836         /* Function: 0x0a */
837         [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDrivers(
838                 [in,unique] [string,charset(UTF16)] uint16 *server,
839                 [in,unique] [string,charset(UTF16)] uint16 *environment,
840                 [in] uint32 level,
841                 [in,unique] DATA_BLOB *buffer,
842                 [in] uint32 offered,
843                 [out,unique] DATA_BLOB *info,
844                 [out,ref] uint32 *needed,
845                 [out] uint32 count
846         );
847         [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers(
848                 [in] uint32 level,
849                 [in] uint32 count,
850                 [out,switch_is(level)] spoolss_DriverInfo info[count]
851         );
852         [nopull,nopush] WERROR spoolss_EnumPrinterDrivers(
853                 [in,unique] [string,charset(UTF16)] uint16 *server,
854                 [in,unique] [string,charset(UTF16)] uint16 *environment,
855                 [in] uint32 level,
856                 [in,unique] DATA_BLOB *buffer,
857                 [in] uint32 offered,
858                 [out,unique,switch_is(level),size_is(count)] spoolss_DriverInfo *info,
859                 [out,ref] uint32 *needed,
860                 [out] uint32 count
861         );
862
863         /******************/
864         /* Function: 0x0b */
865         [todo] WERROR spoolss_GetPrinterDriver(
866         );
867
868         /******************/
869         /* Function: 0x0c */
870         typedef struct {
871                 nstring directory_name;
872         } spoolss_DriverDirectoryInfo1;
873
874         /* NOTE: it's seems that w2k3 completly ignores the level
875                  in its server code
876          */
877         typedef [nodiscriminant,relative_base,gensize,public] union {
878                 [case(1)] spoolss_DriverDirectoryInfo1 info1;
879                 [default] spoolss_DriverDirectoryInfo1 info1;
880         } spoolss_DriverDirectoryInfo;
881
882         [public] WERROR spoolss_GetPrinterDriverDirectory(
883                 [in,unique] [string,charset(UTF16)] uint16 *server,
884                 [in,unique] [string,charset(UTF16)] uint16 *environment,
885                 [in] uint32 level,
886                 [in,unique] DATA_BLOB *buffer,
887                 [in] uint32 offered,
888                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
889                 [out,ref] uint32 *needed
890         );
891
892         /******************/
893         /* Function: 0x0d */
894         WERROR spoolss_DeletePrinterDriver(
895                 [in,unique] [string,charset(UTF16)] uint16 *server,
896                 [in] [string,charset(UTF16)] uint16 architecture[],
897                 [in] [string,charset(UTF16)] uint16 driver[]
898         );
899
900         /******************/
901         /* Function: 0x0e */
902         WERROR spoolss_AddPrintProcessor(
903                 [in,unique] [string,charset(UTF16)] uint16 *server,
904                 [in] [string,charset(UTF16)] uint16 architecture[],
905                 [in] [string,charset(UTF16)] uint16 path_name[],
906                 [in] [string,charset(UTF16)] uint16 print_processor_name[]
907         );
908
909         /******************/
910         /* Function: 0x0f */
911         typedef struct {
912                 [relative] nstring *print_processor_name;
913         } spoolss_PrintProcessorInfo1;
914
915         typedef [nodiscriminant,relative_base,public] union {
916                 [case(1)] spoolss_PrintProcessorInfo1 info1;
917                 [default];
918         } spoolss_PrintProcessorInfo;
919
920         [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessors(
921                 [in,unique] [string,charset(UTF16)] uint16 *servername,
922                 [in,unique] [string,charset(UTF16)] uint16 *environment,
923                 [in] uint32 level,
924                 [in,unique] DATA_BLOB *buffer,
925                 [in] uint32 offered,
926                 [out,unique] DATA_BLOB *info,
927                 [out,ref] uint32 *needed,
928                 [out] uint32 count
929         );
930         [public,noopnum,noprint] void __spoolss_EnumPrintProcessors(
931                 [in] uint32 level,
932                 [in] uint32 count,
933                 [out,switch_is(level)] spoolss_PrintProcessorInfo info[count]
934         );
935         [nopull,nopush] WERROR spoolss_EnumPrintProcessors(
936                 [in,unique] [string,charset(UTF16)] uint16 *servername,
937                 [in,unique] [string,charset(UTF16)] uint16 *environment,
938                 [in] uint32 level,
939                 [in,unique] DATA_BLOB *buffer,
940                 [in] uint32 offered,
941                 [out,unique,switch_is(level),size_is(count)] spoolss_PrintProcessorInfo *info,
942                 [out,ref] uint32 *needed,
943                 [out] uint32 count
944         );
945
946         /******************/
947         /* Function: 0x10 */
948         [todo] WERROR spoolss_GetPrintProcessorDirectory(
949         );
950
951         /******************/
952         /* Function: 0x11 */
953         typedef struct {
954                 [string,charset(UTF16)] uint16 *document_name;
955                 [string,charset(UTF16)] uint16 *output_file;
956                 [string,charset(UTF16)] uint16 *datatype;
957         } spoolss_DocumentInfo1;
958
959         typedef [switch_type(uint32)] union {
960                 [case(1)] spoolss_DocumentInfo1 *info1;
961                 [case(2)]; /* TODO */
962                 [case(3)]; /* TODO */
963                 [default];
964         } spoolss_DocumentInfo;
965
966         WERROR spoolss_StartDocPrinter(
967                 [in,ref] policy_handle *handle,
968                 [in] uint32 level,
969                 [in,switch_is(level)] spoolss_DocumentInfo info,
970                 [out,ref] uint32 *job_id
971         );
972
973         /******************/
974         /* Function: 0x12 */
975         WERROR spoolss_StartPagePrinter(
976                 [in,ref] policy_handle *handle
977         );
978
979         /******************/
980         /* Function: 0x13 */
981         WERROR spoolss_WritePrinter(
982                 [in,ref] policy_handle *handle,
983                 [in] DATA_BLOB data,
984                 [in,value(r->in.data.length)] uint32 _data_size,
985                 [out,ref] uint32 *num_written
986         );
987
988         /******************/
989         /* Function: 0x14 */
990         WERROR spoolss_EndPagePrinter(
991                 [in,ref] policy_handle *handle
992         );
993
994         /******************/
995         /* Function: 0x15 */
996         WERROR spoolss_AbortPrinter(
997                 [in,ref] policy_handle *handle
998         );
999
1000         /******************/
1001         /* Function: 0x16 */
1002         WERROR spoolss_ReadPrinter(
1003                 [in,ref] policy_handle *handle,
1004                 [out,ref] [size_is(data_size)] uint8 *data,
1005                 [in] uint32 data_size,
1006                 [out,ref] uint32 *_data_size
1007         );
1008
1009         /******************/
1010         /* Function: 0x17 */
1011         WERROR spoolss_EndDocPrinter(
1012                 [in,ref] policy_handle *handle
1013         );
1014
1015         /******************/
1016         /* Function: 0x18 */
1017         WERROR spoolss_AddJob(
1018                 [in,ref] policy_handle *handle,
1019                 [in] uint32 level,
1020                 [in,out,unique] [size_is(offered)] uint8 *buffer,
1021                 [in] uint32 offered,
1022                 [out,ref] uint32 *needed
1023         );
1024
1025         /******************/
1026         /* Function: 0x19 */
1027         WERROR spoolss_ScheduleJob(
1028                 [in,ref] policy_handle *handle,
1029                 [in] uint32 jobid
1030         );
1031
1032         /******************/
1033         /* Function: 0x1a */
1034         const string SPOOLSS_ARCHITECTURE_NT_X86                = "Windows NT x86";
1035
1036         typedef [public,gensize] struct {
1037                 [value(ndr_size_spoolss_OSVersion(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
1038                 uint32 major;
1039                 uint32 minor;
1040                 uint32 build;
1041                 [value(2)] uint32 unknown;
1042                 [subcontext(0),subcontext_size(256)] nstring extra_string;
1043         } spoolss_OSVersion;
1044
1045         typedef [public,gensize] struct {
1046                 [value(ndr_size_spoolss_OSVersionEx(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
1047                 uint32 major;
1048                 uint32 minor;
1049                 uint32 build;
1050                 [value(2)] uint32 unknown1;
1051                 [subcontext(0),subcontext_size(256)] nstring extra_string;
1052                 uint32 unknown2;/* service pack number? I saw 0 from w2k3 and 1 from winxp sp1*/
1053                 uint32 unknown3;/* hmm? w2k3: 131346(0x20112) winxp sp1: 503382272 0x1E010100 */
1054         } spoolss_OSVersionEx;
1055
1056         typedef [v1_enum] enum {
1057                 SPOOLSS_PRINTER_DATA_TYPE_NULL = 0,
1058                 SPOOLSS_PRINTER_DATA_TYPE_STRING = 1,
1059                 SPOOLSS_PRINTER_DATA_TYPE_BINARY = 3,
1060                 SPOOLSS_PRINTER_DATA_TYPE_UINT32 = 4,
1061                 SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY = 7
1062         } spoolss_PrinterDataType;
1063
1064         typedef [nodiscriminant,public,gensize] union {
1065                 [case(SPOOLSS_PRINTER_DATA_TYPE_NULL)];
1066                 [case(SPOOLSS_PRINTER_DATA_TYPE_STRING)] nstring string;
1067                 [case(SPOOLSS_PRINTER_DATA_TYPE_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary;
1068                 [case(SPOOLSS_PRINTER_DATA_TYPE_UINT32)] uint32 value;
1069                 [case(SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY)] nstring_array string_array;
1070                 [default,flag(NDR_REMAINING)] DATA_BLOB data;
1071         } spoolss_PrinterData;
1072
1073         [noopnum,noprint,public] WERROR _spoolss_GetPrinterData(
1074                 [in,ref] policy_handle *handle,
1075                 [in]     [string,charset(UTF16)] uint16 value_name[],
1076                 [in]     uint32 offered,
1077                 [out,ref] spoolss_PrinterDataType *type,
1078                 [out]    DATA_BLOB data,
1079                 [out,ref] uint32 *needed
1080         );
1081         [noopnum,noprint,public] void __spoolss_GetPrinterData(
1082                 [in] spoolss_PrinterDataType type,
1083                 [out,switch_is(type)] spoolss_PrinterData data
1084         );
1085         [nopull,nopush,public] WERROR spoolss_GetPrinterData(
1086                 [in,ref] policy_handle *handle,
1087                 [in]     [string,charset(UTF16)] uint16 value_name[],
1088                 [in]     uint32 offered,
1089                 [out,ref] spoolss_PrinterDataType *type,
1090                 [out,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData data,
1091                 [out,ref] uint32 *needed
1092         );
1093
1094         /******************/
1095         /* Function: 0x1b */
1096         [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData(
1097                 [in,ref] policy_handle *handle,
1098                 [in] [string,charset(UTF16)] uint16 value_name[],
1099                 [in] spoolss_PrinterDataType type,
1100                 [in] DATA_BLOB data,
1101                 [in] uint32 _offered
1102         );
1103         [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData(
1104                 [in] spoolss_PrinterDataType type,
1105                 [out,switch_is(type)] spoolss_PrinterData data
1106         );
1107         [nopush] WERROR spoolss_SetPrinterData(
1108                 [in,ref] policy_handle *handle,
1109                 [in] [string,charset(UTF16)] uint16 value_name[],
1110                 [in] spoolss_PrinterDataType type,
1111                 [in,subcontext(4),switch_is(type)] spoolss_PrinterData data,
1112                 [in,value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] uint32 _offered
1113         );
1114
1115         /******************/
1116         /* Function: 0x1c */
1117         [todo] WERROR spoolss_WaitForPrinterChange(
1118         );
1119
1120         /******************/
1121         /* Function: 0x1d */
1122         [public] WERROR spoolss_ClosePrinter(
1123                 [in,out,ref]     policy_handle *handle
1124         );
1125
1126         /******************/
1127         /* Function: 0x1e */
1128         typedef [v1_enum] enum {
1129                 SPOOLSS_FORM_USER       = 0,
1130                 SPOOLSS_FORM_BUILTIN    = 1,
1131                 SPOOLSS_FORM_PRINTER    = 2
1132         } spoolss_FormFlags;
1133
1134         typedef struct {
1135                 uint32 width;
1136                 uint32 height;
1137         } spoolss_FormSize;
1138
1139         typedef struct {
1140                 uint32 left;
1141                 uint32 top;
1142                 uint32 right;
1143                 uint32 bottom;
1144         } spoolss_FormArea;
1145
1146         typedef struct {
1147                 spoolss_FormFlags flags;
1148                 [relative] nstring *form_name;
1149                 spoolss_FormSize size;
1150                 spoolss_FormArea area;
1151         } spoolss_FormInfo1;
1152
1153         typedef [nodiscriminant,relative_base,public,gensize] union {
1154                 [case(1)] spoolss_FormInfo1 info1;
1155                 [default];
1156         } spoolss_FormInfo;
1157
1158         typedef struct {
1159                 spoolss_FormFlags flags;
1160                 [string,charset(UTF16)] uint16 *form_name;
1161                 spoolss_FormSize size;
1162                 spoolss_FormArea area;
1163         } spoolss_AddFormInfo1;
1164
1165         typedef [switch_type(uint32)] union {
1166                 [case(1)] spoolss_AddFormInfo1 *info1;
1167         } spoolss_AddFormInfo;
1168
1169         WERROR spoolss_AddForm(
1170                 [in,ref] policy_handle *handle,
1171                 [in] uint32 level,
1172                 [in,switch_is(level)] spoolss_AddFormInfo info
1173         );
1174
1175         /******************/
1176         /* Function: 0x1f */
1177         WERROR spoolss_DeleteForm(
1178                 [in,ref] policy_handle *handle,
1179                 [in] [string,charset(UTF16)] uint16 form_name[]
1180         );
1181
1182         /******************/
1183         /* Function: 0x20 */
1184         WERROR spoolss_GetForm(
1185                 [in,ref] policy_handle *handle,
1186                 [in] [string,charset(UTF16)] uint16 form_name[],
1187                 [in] uint32 level,
1188                 [in,unique] DATA_BLOB *buffer,
1189                 [in] uint32 offered,
1190                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
1191                 [out,ref] uint32 *needed
1192         );
1193
1194         /******************/
1195         /* Function: 0x21 */
1196         WERROR spoolss_SetForm(
1197                 [in,ref] policy_handle *handle,
1198                 [in] [string,charset(UTF16)] uint16 form_name[],
1199                 [in] uint32 level,
1200                 [in,switch_is(level)] spoolss_AddFormInfo info
1201         );
1202
1203         /******************/
1204         /* Function: 0x22 */
1205         [public,noopnum,noprint] WERROR _spoolss_EnumForms(
1206                 [in,ref] policy_handle *handle,
1207                 [in]     uint32 level,
1208                 [in,unique] DATA_BLOB *buffer,
1209                 [in]     uint32 offered,
1210                 [out,unique] DATA_BLOB *info,
1211                 [out,ref] uint32 *needed,
1212                 [out]    uint32 count
1213         );
1214         [public,noopnum,noprint] void __spoolss_EnumForms(
1215                 [in] uint32 level,
1216                 [in] uint32 count,
1217                 [out,switch_is(level)] spoolss_FormInfo info[count]
1218         );
1219         [nopull,nopush] WERROR spoolss_EnumForms(
1220                 [in,ref] policy_handle *handle,
1221                 [in]     uint32 level,
1222                 [in,unique] DATA_BLOB *buffer,
1223                 [in]     uint32 offered,
1224                 [out,unique,switch_is(level),size_is(count)] spoolss_FormInfo *info,
1225                 [out,ref] uint32 *needed,
1226                 [out] uint32 count
1227         );
1228
1229         typedef struct {
1230                 [relative] nstring *port_name;
1231         } spoolss_PortInfo1;
1232
1233         typedef bitmap {
1234                 SPOOLSS_PORT_TYPE_WRITE         = 0x00000001,
1235                 SPOOLSS_PORT_TYPE_READ          = 0x00000002,
1236                 SPOOLSS_PORT_TYPE_REDIRECTED    = 0x00000004,
1237                 SPOOLSS_PORT_TYPE_NET_ATTACHED  = 0x00000008
1238         } spoolss_PortType;
1239
1240         typedef struct {
1241                 [relative] nstring *port_name;
1242                 [relative] nstring *monitor_name;
1243                 [relative] nstring *description;
1244                 spoolss_PortType port_type;
1245                 uint32 reserved;
1246         } spoolss_PortInfo2;
1247
1248         typedef [nodiscriminant,relative_base,public] union {
1249                 [case(1)] spoolss_PortInfo1 info1;
1250                 [case(2)] spoolss_PortInfo2 info2;
1251                 [case(3)]; /* TODO */
1252                 [default];
1253         } spoolss_PortInfo;
1254
1255         /******************/
1256         /* Function: 0x23 */
1257         [public,noopnum,noprint] WERROR _spoolss_EnumPorts(
1258                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1259                 [in] uint32 level,
1260                 [in,unique] DATA_BLOB *buffer,
1261                 [in] uint32 offered,
1262                 [out,unique] DATA_BLOB *info,
1263                 [out,ref] uint32 *needed,
1264                 [out] uint32 count
1265         );
1266         [public,noopnum,noprint] void __spoolss_EnumPorts(
1267                 [in] uint32 level,
1268                 [in] uint32 count,
1269                 [out,switch_is(level)] spoolss_PortInfo info[count]
1270         );
1271         [nopull,nopush] WERROR spoolss_EnumPorts(
1272                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1273                 [in] uint32 level,
1274                 [in,unique] DATA_BLOB *buffer,
1275                 [in] uint32 offered,
1276                 [out,unique,switch_is(level),size_is(count)] spoolss_PortInfo *info,
1277                 [out,ref] uint32 *needed,
1278                 [out] uint32 count
1279         );
1280
1281         /******************/
1282         /* Function: 0x24 */
1283         typedef struct {
1284                 [relative] nstring *monitor_name;
1285         } spoolss_MonitorInfo1;
1286
1287         typedef struct {
1288                 [relative] nstring *monitor_name;
1289                 [relative] nstring *environment;
1290                 [relative] nstring *dll_name;
1291         } spoolss_MonitorInfo2;
1292
1293         typedef [nodiscriminant,relative_base,public] union {
1294                 [case(1)] spoolss_MonitorInfo1 info1;
1295                 [case(2)] spoolss_MonitorInfo2 info2;
1296                 [default];
1297         } spoolss_MonitorInfo;
1298
1299         [public,noopnum,noprint] WERROR _spoolss_EnumMonitors(
1300                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1301                 [in] uint32 level,
1302                 [in,unique] DATA_BLOB *buffer,
1303                 [in] uint32 offered,
1304                 [out,unique] DATA_BLOB *info,
1305                 [out,ref] uint32 *needed,
1306                 [out] uint32 count
1307         );
1308         [public,noopnum,noprint] void __spoolss_EnumMonitors(
1309                 [in] uint32 level,
1310                 [in] uint32 count,
1311                 [out,switch_is(level)] spoolss_MonitorInfo info[count]
1312         );
1313         [nopull,nopush] WERROR spoolss_EnumMonitors(
1314                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1315                 [in] uint32 level,
1316                 [in,unique] DATA_BLOB *buffer,
1317                 [in] uint32 offered,
1318                 [out,unique,switch_is(level),size_is(count)] spoolss_MonitorInfo *info,
1319                 [out,ref] uint32 *needed,
1320                 [out] uint32 count
1321         );
1322
1323         /******************/
1324         /* Function: 0x25 */
1325         WERROR spoolss_AddPort(
1326                [in,unique] [string,charset(UTF16)] uint16 *server_name,
1327                [in] uint32 unknown,
1328                [in] [string,charset(UTF16)] uint16 monitor_name[]
1329         );
1330
1331         /******************/
1332         /* Function: 0x26 */
1333         [todo] WERROR spoolss_ConfigurePort(
1334         );
1335
1336         /******************/
1337         /* Function: 0x27 */
1338         [todo] WERROR spoolss_DeletePort(
1339         );
1340
1341         /******************/
1342         /* Function: 0x28 */
1343         [todo] WERROR spoolss_CreatePrinterIC(
1344         );
1345
1346         /******************/
1347         /* Function: 0x29 */
1348         [todo] WERROR spoolss_PlayGDIScriptOnPrinterIC(
1349         );
1350
1351         /******************/
1352         /* Function: 0x2a */
1353         [todo] WERROR spoolss_DeletePrinterIC(
1354         );
1355
1356         /******************/
1357         /* Function: 0x2b */
1358         [todo] WERROR spoolss_AddPrinterConnection(
1359         );
1360
1361         /******************/
1362         /* Function: 0x2c */
1363         [todo] WERROR spoolss_DeletePrinterConnection(
1364         );
1365
1366         /******************/
1367         /* Function: 0x2d */
1368         [todo] WERROR spoolss_PrinterMessageBox(
1369                 /* Marked as obsolete in MSDN.  "Not necessary and has
1370                    no effect". */
1371         );
1372
1373         /******************/
1374         /* Function: 0x2e */
1375         [todo] WERROR spoolss_AddMonitor(
1376         );
1377
1378         /******************/
1379         /* Function: 0x2f */
1380         [todo] WERROR spoolss_DeleteMonitor(
1381         );
1382
1383         /******************/
1384         /* Function: 0x30 */
1385         [todo] WERROR spoolss_DeletePrintProcessor(
1386         );
1387
1388         /******************/
1389         /* Function: 0x31 */
1390         [todo] WERROR spoolss_AddPrintProvidor(
1391         );
1392
1393         /******************/
1394         /* Function: 0x32 */
1395         [todo] WERROR spoolss_DeletePrintProvidor(
1396         );
1397
1398         /******************/
1399         /* Function: 0x33 */
1400         [todo] WERROR spoolss_EnumPrintProcDataTypes(
1401         );
1402
1403         /******************/
1404         /* Function: 0x34 */
1405         [todo] WERROR spoolss_ResetPrinter(
1406         );
1407
1408         /******************/
1409         /* Function: 0x35 */
1410         WERROR spoolss_GetPrinterDriver2(
1411                 [in,ref] policy_handle *handle,
1412                 [in,unique] [string,charset(UTF16)] uint16 *architecture,
1413                 [in]     uint32 level,
1414                 [in,unique] DATA_BLOB *buffer,
1415                 [in]     uint32 offered,
1416                 [in]     uint32 client_major_version,
1417                 [in]     uint32 client_minor_version,
1418                 [out,unique] DATA_BLOB *info,
1419                 [out,ref] uint32 *needed,
1420                 [out,ref] uint32 *server_major_version,
1421                 [out,ref] uint32 *server_minor_version
1422         );
1423
1424         /******************/
1425         /* Function: 0x36 */
1426         [todo] WERROR spoolss_FindFirstPrinterChangeNotification(
1427         );
1428
1429         /******************/
1430         /* Function: 0x37 */
1431         [todo] WERROR spoolss_FindNextPrinterChangeNotification(
1432         );
1433
1434         /******************/
1435         /* Function: 0x38 */
1436         [public] WERROR spoolss_FindClosePrinterNotify(
1437                 [in,ref] policy_handle *handle
1438         );
1439
1440         /******************/
1441         /* Function: 0x39 */
1442         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotificationOld(
1443         );
1444
1445         /******************/
1446         /* Function: 0x3a */
1447         [public] WERROR spoolss_ReplyOpenPrinter(
1448                 [in,string,charset(UTF16)] uint16 server_name[],
1449                 [in] uint32 printer_local,
1450                 [in] winreg_Type type,
1451                 [in,range(0,512)] uint32 bufsize,
1452                 [in,unique,size_is(bufsize)] uint8 *buffer,
1453                 [out,ref] policy_handle *handle
1454         );
1455
1456         /******************/
1457         /* Function: 0x3b */
1458
1459         typedef [bitmap32bit] bitmap {
1460                 PRINTER_CHANGE_ADD_PRINTER                      = 0x00000001,
1461                 PRINTER_CHANGE_SET_PRINTER                      = 0x00000002,
1462                 PRINTER_CHANGE_DELETE_PRINTER                   = 0x00000004,
1463                 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER        = 0x00000008,
1464                 PRINTER_CHANGE_ADD_JOB                          = 0x00000100,
1465                 PRINTER_CHANGE_SET_JOB                          = 0x00000200,
1466                 PRINTER_CHANGE_DELETE_JOB                       = 0x00000400,
1467                 PRINTER_CHANGE_WRITE_JOB                        = 0x00000800,
1468                 PRINTER_CHANGE_ADD_FORM                         = 0x00010000,
1469                 PRINTER_CHANGE_SET_FORM                         = 0x00020000,
1470                 PRINTER_CHANGE_DELETE_FORM                      = 0x00040000,
1471                 PRINTER_CHANGE_ADD_PORT                         = 0x00100000,
1472                 PRINTER_CHANGE_CONFIGURE_PORT                   = 0x00200000,
1473                 PRINTER_CHANGE_DELETE_PORT                      = 0x00400000,
1474                 PRINTER_CHANGE_ADD_PRINT_PROCESSOR              = 0x01000000,
1475                 PRINTER_CHANGE_DELETE_PRINT_PROCESSOR           = 0x04000000,
1476                 PRINTER_CHANGE_ADD_PRINTER_DRIVER               = 0x10000000,
1477                 PRINTER_CHANGE_SET_PRINTER_DRIVER               = 0x20000000,
1478                 PRINTER_CHANGE_DELETE_PRINTER_DRIVER            = 0x40000000,
1479                 PRINTER_CHANGE_TIMEOUT                          = 0x80000000
1480         } spoolss_PrinterChangeFlags;
1481
1482         const int PRINTER_CHANGE_PRINTER                        = (PRINTER_CHANGE_ADD_PRINTER |
1483                                                                    PRINTER_CHANGE_SET_PRINTER |
1484                                                                    PRINTER_CHANGE_DELETE_PRINTER |
1485                                                                    PRINTER_CHANGE_FAILED_CONNECTION_PRINTER); /* 0x000000FF */
1486
1487         const int PRINTER_CHANGE_JOB                            = (PRINTER_CHANGE_ADD_JOB |
1488                                                                    PRINTER_CHANGE_SET_JOB |
1489                                                                    PRINTER_CHANGE_DELETE_JOB |
1490                                                                    PRINTER_CHANGE_WRITE_JOB); /* 0x0000FF00 */
1491
1492         const int PRINTER_CHANGE_FORM                           = (PRINTER_CHANGE_ADD_FORM |
1493                                                                    PRINTER_CHANGE_SET_FORM |
1494                                                                    PRINTER_CHANGE_DELETE_FORM); /* 0x00070000 */
1495
1496         const int PRINTER_CHANGE_PORT                           = (PRINTER_CHANGE_ADD_PORT |
1497                                                                    PRINTER_CHANGE_CONFIGURE_PORT |
1498                                                                    PRINTER_CHANGE_DELETE_PORT); /* 0x00700000 */
1499
1500         const int PRINTER_CHANGE_PRINT_PROCESSOR                = (PRINTER_CHANGE_ADD_PRINT_PROCESSOR |
1501                                                                    PRINTER_CHANGE_DELETE_PRINT_PROCESSOR); /* 0x07000000 */
1502
1503         const int PRINTER_CHANGE_PRINTER_DRIVER                 = (PRINTER_CHANGE_ADD_PRINTER_DRIVER |
1504                                                                    PRINTER_CHANGE_SET_PRINTER_DRIVER |
1505                                                                    PRINTER_CHANGE_DELETE_PRINTER_DRIVER); /* 0x70000000 */
1506
1507         const int PRINTER_CHANGE_ALL                            = (PRINTER_CHANGE_JOB |
1508                                                                    PRINTER_CHANGE_FORM |
1509                                                                    PRINTER_CHANGE_PORT |
1510                                                                    PRINTER_CHANGE_PRINT_PROCESSOR |
1511                                                                    PRINTER_CHANGE_PRINTER_DRIVER); /* 0x7777FFFF */
1512         WERROR spoolss_RouterReplyPrinter(
1513                 [in,ref] policy_handle *handle,
1514                 [in] spoolss_PrinterChangeFlags flags,
1515                 [in,range(0,512)] uint32 bufsize,
1516                 [in,unique,size_is(bufsize)] uint8 *buffer
1517         );
1518
1519         /******************/
1520         /* Function: 0x3c */
1521         [public] WERROR spoolss_ReplyClosePrinter(
1522                 [in,out,ref] policy_handle *handle
1523         );
1524
1525         /******************/
1526         /* Function: 0x3d */
1527         [todo] WERROR spoolss_AddPortEx(
1528         );
1529
1530         /******************/
1531         /* Function: 0x3e */
1532         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotification(
1533         );
1534
1535         /******************/
1536         /* Function: 0x3f */
1537         [todo] WERROR spoolss_SpoolerInit(
1538         );
1539
1540         /******************/
1541         /* Function: 0x40 */
1542         [todo] WERROR spoolss_ResetPrinterEx(
1543         );
1544
1545         typedef [enum16bit] enum {
1546                 SPOOLSS_FIELD_SERVER_NAME               =  0,
1547                 SPOOLSS_FIELD_PRINTER_NAME              =  1,
1548                 SPOOLSS_FIELD_SHARE_NAME        =  2,
1549                 SPOOLSS_FIELD_PORT_NAME                 =  3,
1550                 SPOOLSS_FIELD_DRIVER_NAME               =  4,
1551                 SPOOLSS_FIELD_COMMENT                   =  5,
1552                 SPOOLSS_FIELD_LOCATION                  =  6,
1553                 SPOOLSS_FIELD_DEVMODE                   =  7,
1554                 SPOOLSS_FIELD_SEPFILE                   =  8,
1555                 SPOOLSS_FIELD_PRINT_PROCESSOR   =  9,
1556                 SPOOLSS_FIELD_PARAMETERS                = 10,
1557                 SPOOLSS_FIELD_DATATYPE                  = 11,
1558                 SPOOLSS_FIELD_SECURITY_DESCRIPTOR=12,
1559                 SPOOLSS_FIELD_ATTRIBUTES                = 13,
1560                 SPOOLSS_FIELD_PRIORITY                  = 14,
1561                 SPOOLSS_FIELD_DEFAULT_PRIORITY  = 15,
1562                 SPOOLSS_FIELD_START_TIME                = 16,
1563                 SPOOLSS_FIELD_UNTIL_TIME                = 17,
1564                 SPOOLSS_FIELD_STATUS                    = 18,
1565                 SPOOLSS_FIELD_STATUS_STRING             = 19,
1566                 SPOOLSS_FIELD_CJOBS                             = 20,
1567                 SPOOLSS_FIELD_AVERAGE_PPM               = 21,
1568                 SPOOLSS_FIELD_TOTAL_PAGES               = 22,
1569                 SPOOLSS_FIELD_PAGES_PRINTED     = 23,
1570                 SPOOLSS_FIELD_TOTAL_BYTES               = 24,
1571                 SPOOLSS_FIELD_BYTES_PRINTED             = 25
1572         } spoolss_Field;
1573
1574         typedef [enum16bit] enum {
1575                 SPOOLSS_NOTIFY_PRINTER                  = 0,
1576                 SPOOLSS_NOTIFY_JOB                              = 1
1577         } spoolss_NotifyType;
1578
1579         /******************/
1580         /* Function: 0x41 */
1581         typedef struct {
1582                 spoolss_NotifyType type;
1583                 uint16 u1;
1584                 uint32 u2;
1585                 uint32 u3;
1586                 uint32 count;
1587                 [size_is(count)] spoolss_Field *fields;
1588         } spoolss_NotifyOptionsArray;
1589
1590         typedef struct {
1591                 [value(2)] uint32 version;
1592                 uint32 flags;
1593                 uint32 count;
1594                 [size_is(count)] spoolss_NotifyOptionsArray *options;
1595         } spoolss_NotifyOptionsContainer;
1596
1597         [public] WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
1598                 [in,ref] policy_handle *handle,
1599                 [in] uint32 flags,
1600                 [in] uint32 options,
1601                 [in,unique] [string,charset(UTF16)] uint16 *str,
1602                 [in] uint32 printer_local,
1603                 [in,unique] spoolss_NotifyOptionsContainer *t1
1604         );
1605
1606         /******************/
1607         /* Function: 0x42 */
1608
1609         typedef struct {
1610                 uint32 size;
1611                 [size_is(size/2),unique,charset(UTF16)] uint16 *string;
1612         } spoolss_NotifyString;
1613
1614         typedef [v1_enum] enum {
1615                 NOTIFY_TABLE_DWORD              = 0x0001,
1616                 NOTIFY_TABLE_STRING             = 0x0002,
1617                 NOTIFY_TABLE_DEVMODE            = 0x0003,
1618                 NOTIFY_TABLE_TIME               = 0x0004,
1619                 NOTIFY_TABLE_SECURITYDESCRIPTOR = 0x0005
1620         } spoolss_NotifyTable;
1621
1622         typedef [switch_type(uint32)] union {
1623                 [case(1)] uint32 integer[2];
1624                 [case(2)] spoolss_NotifyString string;
1625                 [case(3)] spoolss_DeviceMode *devmode;
1626                 [case(4)] spoolss_TimeCtr time;
1627                 [case(5)] sec_desc_buf sd;
1628         } spoolss_NotifyData;
1629
1630         typedef struct {
1631                 spoolss_NotifyType type;
1632                 spoolss_Field field;
1633                 spoolss_NotifyTable variable_type;
1634                 uint32 job_id;
1635                 [switch_is(variable_type)] spoolss_NotifyData data;
1636         } spoolss_Notify;
1637
1638         typedef struct {
1639                 [value(2)] uint32 version;
1640                 uint32 flags;
1641                 uint32 count;
1642                 [size_is(count)] spoolss_Notify notifies[];
1643         } spoolss_NotifyInfo;
1644
1645         typedef [switch_type(uint32)] union {
1646                 [case(0)] spoolss_NotifyInfo *info0;
1647         } spoolss_ReplyPrinterInfo;
1648
1649         typedef [bitmap32bit] bitmap {
1650                 PRINTER_NOTIFY_INFO_DISCARDED           = 0x00000001,
1651                 PRINTER_NOTIFY_INFO_DISCARDNOTED        = 0x00010000,
1652                 PRINTER_NOTIFY_INFO_COLOR_MISMATCH      = 0x00080000
1653         } spoolss_PrinterNotifyFlags;
1654
1655         WERROR spoolss_RouterReplyPrinterEx(
1656                 [in,ref] policy_handle *handle,
1657                 [in] uint32 color,
1658                 [in] spoolss_PrinterChangeFlags flags,
1659                 [out,ref] spoolss_PrinterNotifyFlags *reply_result,
1660                 [in] uint32 reply_type,
1661                 [in,switch_is(reply_type)] spoolss_ReplyPrinterInfo info
1662         );
1663
1664         /******************/
1665         /* Function: 0x43 */
1666         [public] WERROR spoolss_RouterRefreshPrinterChangeNotify(
1667                 [in,ref] policy_handle *handle,
1668                 [in] uint32 change_low,
1669                 [in,unique] spoolss_NotifyOptionsContainer *container,
1670                 [out,ref] spoolss_NotifyInfo **info
1671         );
1672
1673         /******************/
1674         /* Function: 0x44 */
1675         [todo] WERROR spoolss_44(
1676         );
1677
1678         typedef struct {
1679                 uint32 size;
1680                 [string,charset(UTF16)] uint16 *client;
1681                 [string,charset(UTF16)] uint16 *user;
1682                 uint32 build;
1683                 spoolss_MajorVersion major;
1684                 spoolss_MinorVersion minor;
1685                 spoolss_ProcessorArchitecture processor;
1686         } spoolss_UserLevel1;
1687
1688         typedef struct {
1689                 uint32 not_used;
1690         } spoolss_UserLevel2;
1691
1692         typedef struct {
1693                 uint32 size;
1694                 uint32 flags;
1695                 uint32 size2;
1696                 [string,charset(UTF16)] uint16 *client;
1697                 [string,charset(UTF16)] uint16 *user;
1698                 uint32 build;
1699                 spoolss_MajorVersion major;
1700                 spoolss_MinorVersion minor;
1701                 spoolss_ProcessorArchitecture processor;
1702                 udlong reserved;
1703         } spoolss_UserLevel3;
1704
1705         typedef [switch_type(uint32)] union {
1706                 [case(1)]  spoolss_UserLevel1 *level1;
1707                 [case(2)]  spoolss_UserLevel2 *level2;
1708                 [case(3)]  spoolss_UserLevel3 *level3;
1709         } spoolss_UserLevel;
1710
1711         typedef struct {
1712                 uint32 level;
1713                 [switch_is(level)] spoolss_UserLevel user_info;
1714         } spoolss_UserLevelCtr;
1715
1716         typedef bitmap {
1717                 SERVER_ACCESS_ADMINISTER        = 0x00000001,
1718                 SERVER_ACCESS_ENUMERATE         = 0x00000002,
1719                 PRINTER_ACCESS_ADMINISTER       = 0x00000004,
1720                 PRINTER_ACCESS_USE              = 0x00000008,
1721                 JOB_ACCESS_ADMINISTER           = 0x00000010
1722         } spoolss_AccessRights;
1723
1724         /* Access rights for print servers */
1725         const int SERVER_ALL_ACCESS     = SEC_STD_REQUIRED |
1726                                           SERVER_ACCESS_ADMINISTER |
1727                                           SERVER_ACCESS_ENUMERATE;
1728
1729         const int SERVER_READ           = SEC_STD_READ_CONTROL |
1730                                           SERVER_ACCESS_ENUMERATE;
1731
1732         const int SERVER_WRITE          = STANDARD_RIGHTS_WRITE_ACCESS |
1733                                           SERVER_ACCESS_ADMINISTER |
1734                                           SERVER_ACCESS_ENUMERATE;
1735
1736         const int SERVER_EXECUTE        = SEC_STD_READ_CONTROL |
1737                                           SERVER_ACCESS_ENUMERATE;
1738
1739         /* Access rights for printers */
1740         const int PRINTER_ALL_ACCESS    = SEC_STD_REQUIRED |
1741                                           PRINTER_ACCESS_ADMINISTER |
1742                                           PRINTER_ACCESS_USE;
1743
1744         const int PRINTER_READ          = SEC_STD_READ_CONTROL |
1745                                           PRINTER_ACCESS_USE;
1746
1747         const int PRINTER_WRITE         = STANDARD_RIGHTS_WRITE_ACCESS |
1748                                           PRINTER_ACCESS_USE;
1749
1750         const int PRINTER_EXECUTE       = SEC_STD_READ_CONTROL |
1751                                           PRINTER_ACCESS_USE;
1752
1753         /* Access rights for jobs */
1754         const int JOB_ALL_ACCESS        = SEC_STD_REQUIRED |
1755                                           JOB_ACCESS_ADMINISTER;
1756
1757         const int JOB_READ              = SEC_STD_READ_CONTROL |
1758                                           JOB_ACCESS_ADMINISTER;
1759
1760         const int JOB_WRITE             = STANDARD_RIGHTS_WRITE_ACCESS |
1761                                           JOB_ACCESS_ADMINISTER;
1762
1763         const int JOB_EXECUTE           = SEC_STD_READ_CONTROL |
1764                                           JOB_ACCESS_ADMINISTER;
1765
1766         /* ACE masks for various print permissions */
1767         const int PRINTER_ACE_FULL_CONTROL = SEC_GENERIC_ALL |
1768                                                 PRINTER_ALL_ACCESS;
1769
1770         const int PRINTER_ACE_MANAGE_DOCUMENTS = SEC_GENERIC_ALL |
1771                                                 READ_CONTROL_ACCESS;
1772
1773         const int PRINTER_ACE_PRINT     = GENERIC_EXECUTE_ACCESS |
1774                                           READ_CONTROL_ACCESS |
1775                                           PRINTER_ACCESS_USE;
1776
1777         /******************/
1778         /* Function: 0x45 */
1779         [public] WERROR spoolss_OpenPrinterEx(
1780                 [in,unique]           [string,charset(UTF16)] uint16 *printername,
1781                 [in,unique]           [string,charset(UTF16)] uint16 *datatype,
1782                 [in]                  spoolss_DevmodeContainer devmode_ctr,
1783                 [in]                  uint32 access_mask,
1784                 [in]                  uint32 level,
1785                 [in,switch_is(level)] spoolss_UserLevel userlevel,
1786                 [out,ref]             policy_handle *handle
1787         );
1788
1789         /******************/
1790         /* Function: 0x46 */
1791         WERROR spoolss_AddPrinterEx(
1792                 [in,unique] [string,charset(UTF16)] uint16 *server,
1793                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
1794                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
1795                 [in,ref] sec_desc_buf *secdesc_ctr,
1796                 [in,ref] spoolss_UserLevelCtr *userlevel_ctr,
1797                 [out,ref] policy_handle *handle
1798         );
1799
1800         /******************/
1801         /* Function: 0x47 */
1802         [todo] WERROR spoolss_47(
1803         );
1804
1805         /******************/
1806         /* Function: 0x48 */
1807         WERROR spoolss_EnumPrinterData(
1808                 [in,ref] policy_handle *handle,
1809                 [in]     uint32 enum_index,
1810                 [out,size_is(value_offered/2),charset(UTF16)] uint16 value_name[],
1811                 [in]     uint32 value_offered,
1812                 [out,ref] uint32 *value_needed,
1813                 [out,ref] uint32 *printerdata_type,
1814                 [out,ref] DATA_BLOB *buffer,
1815                 [in]     uint32 data_offered,
1816                 [out,ref] uint32 *data_needed
1817         );
1818
1819         /******************/
1820         /* Function: 0x49 */
1821         WERROR spoolss_DeletePrinterData(
1822                 [in,ref] policy_handle *handle,
1823                 [in] [string,charset(UTF16)] uint16 value_name[]
1824         );
1825
1826         /******************/
1827         /* Function: 0x4a */
1828         [todo] WERROR spoolss_4a(
1829         );
1830
1831         /******************/
1832         /* Function: 0x4b */
1833         [todo] WERROR spoolss_4b(
1834         );
1835
1836         /******************/
1837         /* Function: 0x4c */
1838         [todo] WERROR spoolss_4c(
1839         );
1840
1841         /******************/
1842         /* Function: 0x4d */
1843         WERROR spoolss_SetPrinterDataEx(
1844                 [in,ref] policy_handle *handle,
1845                 [in]     [string,charset(UTF16)] uint16 key_name[],
1846                 [in]     [string,charset(UTF16)] uint16 value_name[],
1847                 [in]     uint32 type,
1848                 [in,ref] [size_is(offered)] uint8 *buffer,
1849                 [in]     uint32 offered
1850         );
1851
1852         /******************/
1853         /* Function: 0x4e */
1854         WERROR spoolss_GetPrinterDataEx(
1855                 [in,ref] policy_handle *handle,
1856                 [in]     [string,charset(UTF16)] uint16 key_name[],
1857                 [in]     [string,charset(UTF16)] uint16 value_name[],
1858                 [out,ref] uint32 *type,
1859                 [out,ref] [size_is(offered)] uint8 *buffer,
1860                 [in]     uint32 offered,
1861                 [out,ref] uint32 *needed
1862         );
1863
1864         /******************/
1865         /* Function: 0x4f */
1866         [public] WERROR spoolss_EnumPrinterDataEx(
1867                 [in,ref] policy_handle *handle,
1868                 [in]     [string,charset(UTF16)] uint16 key_name[],
1869                 [out,ref] [size_is(offered)] uint8 *buffer,
1870                 [in]     uint32 offered,
1871                 [out,ref] uint32 *needed,
1872                 [out,ref] uint32 *count
1873         );
1874
1875         /******************/
1876         /* Function: 0x50 */
1877         [public] WERROR spoolss_EnumPrinterKey(
1878                 [in, ref] policy_handle *handle,
1879                 [in] [string,charset(UTF16)] uint16 key_name[],
1880                 [out,ref] [size_is(key_buffer_size/2)] uint16 *key_buffer,
1881                 [in] uint32 key_buffer_size,
1882                 [out,ref] uint32 *needed
1883         );
1884
1885         /******************/
1886         /* Function: 0x51 */
1887         WERROR spoolss_DeletePrinterDataEx(
1888                 [in,ref] policy_handle *handle,
1889                 [in] [string,charset(UTF16)] uint16 key_name[],
1890                 [in] [string,charset(UTF16)] uint16 value_name[]
1891         );
1892
1893         /******************/
1894         /* Function: 0x52 */
1895         WERROR spoolss_DeletePrinterKey(
1896                 [in,ref] policy_handle *handle,
1897                 [in] [string,charset(UTF16)] uint16 key_name[]
1898         );
1899
1900         /******************/
1901         /* Function: 0x53 */
1902         [todo] WERROR spoolss_53(
1903         );
1904
1905         /******************/
1906         /* Function: 0x54 */
1907         typedef [public,bitmap32bit] bitmap {
1908                 DPD_DELETE_UNUSED_FILES         = 0x00000001,
1909                 DPD_DELETE_SPECIFIC_VERSION     = 0x00000002,
1910                 DPD_DELETE_ALL_FILES            = 0x00000004
1911         } spoolss_DeleteDriverFlags;
1912
1913         WERROR spoolss_DeletePrinterDriverEx(
1914                 [in,unique] [string,charset(UTF16)] uint16 *server,
1915                 [in] [string,charset(UTF16)] uint16 architecture[],
1916                 [in] [string,charset(UTF16)] uint16 driver[],
1917                 [in] spoolss_DeleteDriverFlags delete_flags,
1918                 [in] uint32 version
1919         );
1920
1921         /******************/
1922         /* Function: 0x55 */
1923         [todo] WERROR spoolss_55(
1924         );
1925
1926         /******************/
1927         /* Function: 0x56 */
1928         [todo] WERROR spoolss_56(
1929         );
1930
1931         /******************/
1932         /* Function: 0x57 */
1933         [todo] WERROR spoolss_57(
1934         );
1935
1936         /******************/
1937         /* Function: 0x58 */
1938         WERROR spoolss_XcvData(
1939                 [in,ref] policy_handle *handle,
1940                 [in] [string,charset(UTF16)] uint16 function_name[],
1941                 [in] DATA_BLOB in_data,
1942                 [in,value(r->in.in_data.length)] uint32 _in_data_length,
1943                 [out,ref] [size_is(out_data_size)] uint8 *out_data,
1944                 [in] uint32 out_data_size,
1945                 [out,ref] uint32 *needed,
1946                 [in,out,ref] uint32 *status_code
1947         );
1948
1949         /******************/
1950         /* Function: 0x59 */
1951
1952         typedef [bitmap32bit] bitmap {
1953                 APD_STRICT_UPGRADE              = 0x00000001,
1954                 APD_STRICT_DOWNGRADE            = 0x00000002,
1955                 APD_COPY_ALL_FILES              = 0x00000004,
1956                 APD_COPY_NEW_FILES              = 0x00000008,
1957                 APD_COPY_FROM_DIRECTORY         = 0x00000010,
1958                 APD_DONT_COPY_FILES_TO_CLUSTER  = 0x00001000,
1959                 APD_COPY_TO_ALL_SPOOLERS        = 0x00002000,
1960                 APD_RETURN_BLOCKING_STATUS_CODE = 0x00010000
1961         } spoolss_AddPrinterDriverExFlags;
1962
1963         [public] WERROR spoolss_AddPrinterDriverEx(
1964                 [in] [string,charset(UTF16)] uint16 *servername,
1965                 [in] uint32 level,
1966                 [in,switch_is(level)] spoolss_AddDriverInfo info,
1967                 [in] spoolss_AddPrinterDriverExFlags flags
1968         );
1969
1970         /******************/
1971         /* Function: 0x5a */
1972         [todo] WERROR spoolss_5a(
1973         );
1974
1975         /******************/
1976         /* Function: 0x5b */
1977         [todo] WERROR spoolss_5b(
1978         );
1979
1980         /******************/
1981         /* Function: 0x5c */
1982         [todo] WERROR spoolss_5c(
1983         );
1984
1985         /******************/
1986         /* Function: 0x5d */
1987         [todo] WERROR spoolss_5d(
1988         );
1989
1990         /******************/
1991         /* Function: 0x5e */
1992         [todo] WERROR spoolss_5e(
1993         );
1994
1995         /******************/
1996         /* Function: 0x5f */
1997         [todo] WERROR spoolss_5f(
1998         );
1999 }