spoolss: add 2 new SPOOLSS_JOB_CONTROL values.
[kai/samba-autobuild/.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,ref] 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,ref] uint32 *count,
360                 [out,unique,switch_is(level),size_is(*count)] spoolss_PrinterInfo *info,
361                 [out,ref] uint32 *needed
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] spoolss_AccessRights access_mask,
376                 [out,ref] policy_handle *handle
377         );
378
379         /******************/
380         /* Function: 0x02 */
381
382         /* JOB status codes. */
383
384         const int JOB_STATUS_QUEUED = 0x0000;
385
386         typedef [bitmap32bit] bitmap {
387                 JOB_STATUS_PAUSED               = 0x00000001,
388                 JOB_STATUS_ERROR                = 0x00000002,
389                 JOB_STATUS_DELETING             = 0x00000004,
390                 JOB_STATUS_SPOOLING             = 0x00000008,
391                 JOB_STATUS_PRINTING             = 0x00000010,
392                 JOB_STATUS_OFFLINE              = 0x00000020,
393                 JOB_STATUS_PAPEROUT             = 0x00000040,
394                 JOB_STATUS_PRINTED              = 0x00000080,
395                 JOB_STATUS_DELETED              = 0x00000100,
396                 JOB_STATUS_BLOCKED_DEVQ         = 0x00000200,
397                 JOB_STATUS_USER_INTERVENTION    = 0x00000400,
398                 JOB_STATUS_RESTART              = 0x00000800,
399                 JOB_STATUS_COMPLETE             = 0x00001000
400         } spoolss_JobStatus;
401
402         typedef struct {
403                 uint32 job_id;
404                 [relative] nstring *printer_name;
405                 [relative] nstring *server_name;
406                 [relative] nstring *user_name;
407                 [relative] nstring *document_name;
408                 [relative] nstring *data_type;
409                 [relative] nstring *text_status;
410                 spoolss_JobStatus status;
411                 uint32 priority;
412                 uint32 position;
413                 uint32 total_pages;
414                 uint32 pages_printed;
415                 spoolss_Time submitted;
416         } spoolss_JobInfo1;
417
418         typedef struct {
419                 uint32 job_id;
420                 [relative] nstring *printer_name;
421                 [relative] nstring *server_name;
422                 [relative] nstring *user_name;
423                 [relative] nstring *document_name;
424                 [relative] nstring *notify_name;
425                 [relative] nstring *data_type;
426                 [relative] nstring *print_processor;
427                 [relative] nstring *parameters;
428                 [relative] nstring *driver_name;
429                 [relative] spoolss_DeviceMode *devmode;
430                 [relative] nstring *text_status;
431                 [relative] security_descriptor *secdesc;
432                 spoolss_JobStatus status;
433                 uint32 priority;
434                 uint32 position;
435                 uint32 start_time;
436                 uint32 until_time;
437                 uint32 total_pages;
438                 uint32 size;
439                 spoolss_Time submitted;
440                 uint32 time;
441                 uint32 pages_printed;
442         } spoolss_JobInfo2;
443
444         typedef struct {
445                 uint32 job_id;
446                 uint32 next_job_id;
447                 uint32 reserved;
448         } spoolss_JobInfo3;
449
450         typedef struct {
451                 uint32 job_id;
452                 [relative] nstring *printer_name;
453                 [relative] nstring *server_name;
454                 [relative] nstring *user_name;
455                 [relative] nstring *document_name;
456                 [relative] nstring *notify_name;
457                 [relative] nstring *data_type;
458                 [relative] nstring *print_processor;
459                 [relative] nstring *parameters;
460                 [relative] nstring *driver_name;
461                 [relative] spoolss_DeviceMode *devmode;
462                 [relative] nstring *text_status;
463                 [relative] security_descriptor *secdesc;
464                 spoolss_JobStatus status;
465                 uint32 priority;
466                 uint32 position;
467                 uint32 start_time;
468                 uint32 until_time;
469                 uint32 total_pages;
470                 uint32 size;
471                 spoolss_Time submitted;
472                 uint32 time;
473                 uint32 pages_printed;
474                 uint32 size_high;
475         } spoolss_JobInfo4;
476
477         typedef [nodiscriminant,relative_base,public] union {
478                 [case(1)] spoolss_JobInfo1 info1;
479                 [case(2)] spoolss_JobInfo2 info2;
480                 [case(3)] spoolss_JobInfo3 info3;
481                 [case(4)] spoolss_JobInfo4 info4;
482                 [default];
483         } spoolss_JobInfo;
484
485         typedef struct {
486                 uint32 level;
487                 [switch_is(level)] spoolss_JobInfo info;
488         } spoolss_JobInfoContainer;
489
490         typedef [v1_enum] enum {
491                 SPOOLSS_JOB_CONTROL_PAUSE               = 1,
492                 SPOOLSS_JOB_CONTROL_RESUME              = 2,
493                 SPOOLSS_JOB_CONTROL_CANCEL              = 3,
494                 SPOOLSS_JOB_CONTROL_RESTART             = 4,
495                 SPOOLSS_JOB_CONTROL_DELETE              = 5,
496                 SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER     = 6,
497                 SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED   = 7,
498                 SPOOLSS_JOB_CONTROL_RETAIN              = 8,
499                 SPOOLSS_JOB_CONTROL_RELEASE             = 9
500         } spoolss_JobControl;
501
502         WERROR spoolss_SetJob(
503                 [in,ref] policy_handle *handle,
504                 [in] uint32 job_id,
505                 [in,unique] spoolss_JobInfoContainer *ctr,
506                 [in] spoolss_JobControl command
507         );
508
509         /******************/
510         /* Function: 0x03 */
511         WERROR spoolss_GetJob(
512                 [in,ref] policy_handle *handle,
513                 [in]     uint32 job_id,
514                 [in]     uint32 level,
515                 [in,unique] DATA_BLOB *buffer,
516                 [in]     uint32 offered,
517                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info,
518                 [out,ref] uint32 *needed
519         );
520
521         /******************/
522         /* Function: 0x04 */
523         [public,noopnum,noprint] WERROR _spoolss_EnumJobs(
524                 [in,ref] policy_handle *handle,
525                 [in]     uint32 firstjob,
526                 [in]     uint32 numjobs,
527                 [in]     uint32 level,
528                 [in,unique] DATA_BLOB *buffer,
529                 [in]     uint32 offered,
530                 [out,unique] DATA_BLOB *info,
531                 [out,ref] uint32 *needed,
532                 [out,ref] uint32 *count
533         );
534         [public,noopnum,noprint] void __spoolss_EnumJobs(
535                 [in] uint32 level,
536                 [in] uint32 count,
537                 [out,switch_is(level)] spoolss_JobInfo info[count]
538         );
539         [nopull,nopush] WERROR spoolss_EnumJobs(
540                 [in,ref] policy_handle *handle,
541                 [in]     uint32 firstjob,
542                 [in]     uint32 numjobs,
543                 [in]     uint32 level,
544                 [in,unique] DATA_BLOB *buffer,
545                 [in]     uint32 offered,
546                 [out,ref] uint32 *count,
547                 [out,unique,switch_is(level),size_is(*count)] spoolss_JobInfo *info,
548                 [out,ref] uint32 *needed
549         );
550
551         /******************/
552         /* Function: 0x05 */
553         [todo] WERROR spoolss_AddPrinter(
554                 /* This function is not implemented in Samba 3 as no
555                    clients have been observed using it. */
556         );
557
558         /******************/
559         /* Function: 0x06 */
560         WERROR spoolss_DeletePrinter(
561                 [in] policy_handle *handle
562         );
563
564         /******************/
565         /* Function: 0x07 */
566         typedef [v1_enum] enum {
567                 SPOOLSS_PRINTER_CONTROL_UNPAUSE    = 0,
568                 SPOOLSS_PRINTER_CONTROL_PAUSE      = 1,
569                 SPOOLSS_PRINTER_CONTROL_RESUME     = 2,
570                 SPOOLSS_PRINTER_CONTROL_PURGE      = 3,
571                 SPOOLSS_PRINTER_CONTROL_SET_STATUS = 4
572         } spoolss_PrinterControl;
573
574         typedef struct {
575                 [string,charset(UTF16)] uint16 *servername;
576                 [string,charset(UTF16)] uint16 *printername;
577                 uint32 cjobs;
578                 uint32 total_jobs;
579                 uint32 total_bytes;
580                 spoolss_Time time;
581                 uint32 global_counter;
582                 uint32 total_pages;
583                 uint32 version;
584                 uint32 free_build;
585                 uint32 spooling;
586                 uint32 max_spooling;
587                 uint32 session_counter;
588                 uint32 num_error_out_of_paper;
589                 uint32 num_error_not_ready;
590                 uint32 job_error;
591                 uint32 number_of_processors;
592                 spoolss_ProcessorType processor_type;
593                 uint32 high_part_total_bytes;
594                 uint32 change_id;
595                 WERROR last_error;
596                 uint32 status;
597                 uint32 enumerate_network_printers;
598                 uint32 c_setprinter;
599                 spoolss_ProcessorArchitecture processor_architecture;
600                 uint16 processor_level;
601                 uint32 ref_ic;
602                 uint32 reserved2;
603                 uint32 reserved3;
604         } spoolss_SetPrinterInfo0;
605
606         typedef struct {
607                 spoolss_EnumPrinterFlags flags;
608                 [string,charset(UTF16)] uint16 *name;
609                 [string,charset(UTF16)] uint16 *description;
610                 [string,charset(UTF16)] uint16 *comment;
611         } spoolss_SetPrinterInfo1;
612
613         typedef struct {
614                 [string,charset(UTF16)] uint16 *servername;
615                 [string,charset(UTF16)] uint16 *printername;
616                 [string,charset(UTF16)] uint16 *sharename;
617                 [string,charset(UTF16)] uint16 *portname;
618                 [string,charset(UTF16)] uint16 *drivername;
619                 [string,charset(UTF16)] uint16 *comment;
620                 [string,charset(UTF16)] uint16 *location;
621                 [subcontext(0)] spoolss_DeviceMode *devmode;
622                 [string,charset(UTF16)] uint16 *sepfile;
623                 [string,charset(UTF16)] uint16 *printprocessor;
624                 [string,charset(UTF16)] uint16 *datatype;
625                 [string,charset(UTF16)] uint16 *parameters;
626                 [subcontext(0)] security_descriptor *secdesc;
627                 spoolss_PrinterAttributes attributes;
628                 uint32 priority;
629                 uint32 defaultpriority;
630                 uint32 starttime;
631                 uint32 untiltime;
632                 spoolss_PrinterStatus status;
633                 uint32 cjobs;
634                 uint32 averageppm;
635         } spoolss_SetPrinterInfo2;
636
637         typedef struct {
638                 uint32 sec_desc_ptr;
639         } spoolss_SetPrinterInfo3;
640
641         typedef struct {
642                 [string,charset(UTF16)] uint16 *printername;
643                 [string,charset(UTF16)] uint16 *servername;
644                 spoolss_PrinterAttributes attributes;
645         } spoolss_SetPrinterInfo4;
646
647         typedef struct {
648                 [string,charset(UTF16)] uint16 *printername;
649                 [string,charset(UTF16)] uint16 *portname;
650                 spoolss_PrinterAttributes attributes;
651                 uint32 device_not_selected_timeout;
652                 uint32 transmission_retry_timeout;
653         } spoolss_SetPrinterInfo5;
654
655         typedef struct {
656                 spoolss_PrinterStatus status;
657         } spoolss_SetPrinterInfo6;
658
659         typedef struct {
660                 [string,charset(UTF16)] uint16 *guid; /* text form of printer guid */
661                 spoolss_DsPrintAction action;
662         } spoolss_SetPrinterInfo7;
663
664         typedef [switch_type(uint32)] union {
665                 [case(0)] spoolss_SetPrinterInfo0 *info0;
666                 [case(1)] spoolss_SetPrinterInfo1 *info1;
667                 [case(2)] spoolss_SetPrinterInfo2 *info2;
668                 [case(3)] spoolss_SetPrinterInfo3 *info3;
669                 [case(4)] spoolss_SetPrinterInfo4 *info4;
670                 [case(5)] spoolss_SetPrinterInfo5 *info5;
671                 [case(6)] spoolss_SetPrinterInfo6 *info6;
672                 [case(7)] spoolss_SetPrinterInfo7 *info7;
673                 [case(8)] spoolss_DeviceModeInfo *info8;
674                 [case(9)] spoolss_DeviceModeInfo *info9;
675                 [default];
676         } spoolss_SetPrinterInfo;
677
678         typedef struct {
679                 uint32 level;
680                 [switch_is(level)] spoolss_SetPrinterInfo info;
681         } spoolss_SetPrinterInfoCtr;
682
683         WERROR spoolss_SetPrinter(
684                 [in,ref] policy_handle *handle,
685                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
686                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
687                 [in,ref] sec_desc_buf *secdesc_ctr,
688                 [in] spoolss_PrinterControl command
689         );
690
691         /******************/
692         /* Function: 0x08 */
693         [public] WERROR spoolss_GetPrinter(
694                 [in,ref] policy_handle *handle,
695                 [in]     uint32 level,
696                 [in,unique] DATA_BLOB *buffer,
697                 [in]     uint32 offered,
698                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info,
699                 [out,ref] uint32 *needed
700         );
701
702         /******************/
703         /* Function: 0x09 */
704
705         typedef [public] struct {
706                 [value((ndr_size_spoolss_StringArray(r, ndr->iconv_convenience, ndr->flags)-4)/2)] uint32 _ndr_size;
707                 /*[subcontext(0),subcontext_size(_ndr_size*2)]*/ nstring_array string;
708         } spoolss_StringArray;
709
710         typedef struct {
711                 [string,charset(UTF16)] uint16 *driver_name;
712         } spoolss_AddDriverInfo1;
713
714         typedef [v1_enum,public] enum {
715                 SPOOLSS_DRIVER_VERSION_9X       = 0,
716                 SPOOLSS_DRIVER_VERSION_NT35     = 1,
717                 SPOOLSS_DRIVER_VERSION_NT4      = 2,
718                 SPOOLSS_DRIVER_VERSION_200X     = 3
719         } spoolss_DriverOSVersion;
720
721         typedef struct {
722                 spoolss_DriverOSVersion version;
723                 [string,charset(UTF16)] uint16 *driver_name;
724                 [string,charset(UTF16)] uint16 *architecture;
725                 [string,charset(UTF16)] uint16 *driver_path;
726                 [string,charset(UTF16)] uint16 *data_file;
727                 [string,charset(UTF16)] uint16 *config_file;
728         } spoolss_AddDriverInfo2;
729
730         typedef struct {
731                 spoolss_DriverOSVersion version;
732                 [string,charset(UTF16)] uint16 *driver_name;
733                 [string,charset(UTF16)] uint16 *architecture;
734                 [string,charset(UTF16)] uint16 *driver_path;
735                 [string,charset(UTF16)] uint16 *data_file;
736                 [string,charset(UTF16)] uint16 *config_file;
737                 [string,charset(UTF16)] uint16 *help_file;
738                 [string,charset(UTF16)] uint16 *monitor_name;
739                 [string,charset(UTF16)] uint16 *default_datatype;
740                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
741                 spoolss_StringArray *dependent_files;
742         } spoolss_AddDriverInfo3;
743
744         typedef struct {
745                 spoolss_DriverOSVersion version;
746                 [string,charset(UTF16)] uint16 *driver_name;
747                 [string,charset(UTF16)] uint16 *architecture;
748                 [string,charset(UTF16)] uint16 *driver_path;
749                 [string,charset(UTF16)] uint16 *data_file;
750                 [string,charset(UTF16)] uint16 *config_file;
751                 [string,charset(UTF16)] uint16 *help_file;
752                 [string,charset(UTF16)] uint16 *monitor_name;
753                 [string,charset(UTF16)] uint16 *default_datatype;
754                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
755                 spoolss_StringArray *dependent_files;
756                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
757                 spoolss_StringArray *previous_names;
758         } spoolss_AddDriverInfo4;
759
760         typedef struct {
761                 spoolss_DriverOSVersion version;
762                 [string,charset(UTF16)] uint16 *driver_name;
763                 [string,charset(UTF16)] uint16 *architecture;
764                 [string,charset(UTF16)] uint16 *driver_path;
765                 [string,charset(UTF16)] uint16 *data_file;
766                 [string,charset(UTF16)] uint16 *config_file;
767                 uint32 driver_attributes;
768                 uint32 config_version;
769                 uint32 driver_version;
770         } spoolss_AddDriverInfo5;
771
772         typedef struct {
773                 spoolss_DriverOSVersion version;
774                 [string,charset(UTF16)] uint16 *driver_name;
775                 [string,charset(UTF16)] uint16 *architecture;
776                 [string,charset(UTF16)] uint16 *driver_path;
777                 [string,charset(UTF16)] uint16 *data_file;
778                 [string,charset(UTF16)] uint16 *config_file;
779                 [string,charset(UTF16)] uint16 *help_file;
780                 [string,charset(UTF16)] uint16 *monitor_name;
781                 [string,charset(UTF16)] uint16 *default_datatype;
782                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
783                 spoolss_StringArray *dependent_files;
784                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
785                 spoolss_StringArray *previous_names;
786                 NTTIME driver_date;
787                 hyper driver_version;
788                 [string,charset(UTF16)] uint16 *manufacturer_name;
789                 [string,charset(UTF16)] uint16 *manufacturer_url;
790                 [string,charset(UTF16)] uint16 *hardware_id;
791                 [string,charset(UTF16)] uint16 *provider;
792         } spoolss_AddDriverInfo6;
793
794         typedef struct {
795                 spoolss_DriverOSVersion version;
796                 [string,charset(UTF16)] uint16 *driver_name;
797                 [string,charset(UTF16)] uint16 *architecture;
798                 [string,charset(UTF16)] uint16 *driver_path;
799                 [string,charset(UTF16)] uint16 *data_file;
800                 [string,charset(UTF16)] uint16 *config_file;
801                 [string,charset(UTF16)] uint16 *help_file;
802                 [string,charset(UTF16)] uint16 *monitor_name;
803                 [string,charset(UTF16)] uint16 *default_datatype;
804                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
805                 spoolss_StringArray *dependent_files;
806                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
807                 spoolss_StringArray *previous_names;
808                 NTTIME driver_date;
809                 hyper driver_version;
810                 [string,charset(UTF16)] uint16 *manufacturer_name;
811                 [string,charset(UTF16)] uint16 *manufacturer_url;
812                 [string,charset(UTF16)] uint16 *hardware_id;
813                 [string,charset(UTF16)] uint16 *provider;
814                 [string,charset(UTF16)] uint16 *print_processor;
815                 [string,charset(UTF16)] uint16 *vendor_setup;
816                 [value(((ndr_size_spoolss_StringArray(color_profiles, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles;
817                 spoolss_StringArray *color_profiles;
818                 [string,charset(UTF16)] uint16 *inf_path;
819                 uint32 printer_driver_attributes;
820                 [value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies;
821                 spoolss_StringArray *core_driver_dependencies;
822                 NTTIME min_inbox_driver_ver_date;
823                 hyper min_inbox_driver_ver_version;
824         } spoolss_AddDriverInfo8;
825
826         typedef [switch_type(uint32)] union {
827                 [case(1)] spoolss_AddDriverInfo1 *info1;
828                 [case(2)] spoolss_AddDriverInfo2 *info2;
829                 [case(3)] spoolss_AddDriverInfo3 *info3;
830                 [case(4)] spoolss_AddDriverInfo4 *info4;
831                 [case(6)] spoolss_AddDriverInfo6 *info6;
832                 [case(8)] spoolss_AddDriverInfo8 *info8;
833         } spoolss_AddDriverInfo;
834
835         typedef struct {
836                 uint32 level;
837                 [switch_is(level)] spoolss_AddDriverInfo info;
838         } spoolss_AddDriverInfoCtr;
839
840         WERROR spoolss_AddPrinterDriver(
841                 [in,unique] [string,charset(UTF16)] uint16 *servername,
842                 [in,ref] spoolss_AddDriverInfoCtr *info_ctr
843         );
844
845         typedef [public,gensize] struct {
846                 [relative] nstring *driver_name;
847         } spoolss_DriverInfo1;
848
849         typedef [public,gensize] struct {
850                 spoolss_DriverOSVersion version;
851                 [relative] nstring *driver_name;
852                 [relative] nstring *architecture;
853                 [relative] nstring *driver_path;
854                 [relative] nstring *data_file;
855                 [relative] nstring *config_file;
856         } spoolss_DriverInfo2;
857
858         typedef [public,gensize] struct {
859                 spoolss_DriverOSVersion version;
860                 [relative] nstring *driver_name;
861                 [relative] nstring *architecture;
862                 [relative] nstring *driver_path;
863                 [relative] nstring *data_file;
864                 [relative] nstring *config_file;
865                 [relative] nstring *help_file;
866                 [relative] nstring_array *dependent_files;
867                 [relative] nstring *monitor_name;
868                 [relative] nstring *default_datatype;
869         } spoolss_DriverInfo3;
870
871         typedef [public,gensize] struct {
872                 spoolss_DriverOSVersion version;
873                 [relative] nstring *driver_name;
874                 [relative] nstring *architecture;
875                 [relative] nstring *driver_path;
876                 [relative] nstring *data_file;
877                 [relative] nstring *config_file;
878                 [relative] nstring *help_file;
879                 [relative] nstring_array *dependent_files;
880                 [relative] nstring *monitor_name;
881                 [relative] nstring *default_datatype;
882                 [relative] nstring_array *previous_names;
883         } spoolss_DriverInfo4;
884
885         typedef [public,gensize] struct {
886                 spoolss_DriverOSVersion version;
887                 [relative] nstring *driver_name;
888                 [relative] nstring *architecture;
889                 [relative] nstring *driver_path;
890                 [relative] nstring *data_file;
891                 [relative] nstring *config_file;
892                 uint32 driver_attributes;
893                 uint32 config_version;
894                 uint32 driver_version;
895         } spoolss_DriverInfo5;
896
897         typedef [public,gensize] struct {
898                 spoolss_DriverOSVersion version;
899                 [relative] nstring *driver_name;
900                 [relative] nstring *architecture;
901                 [relative] nstring *driver_path;
902                 [relative] nstring *data_file;
903                 [relative] nstring *config_file;
904                 [relative] nstring *help_file;
905                 [relative] nstring_array *dependent_files;
906                 [relative] nstring *monitor_name;
907                 [relative] nstring *default_datatype;
908                 [relative] nstring_array *previous_names;
909                 NTTIME driver_date;
910                 hyper driver_version;
911                 [relative] nstring *manufacturer_name;
912                 [relative] nstring *manufacturer_url;
913                 [relative] nstring *hardware_id;
914                 [relative] nstring *provider;
915         } spoolss_DriverInfo6;
916
917         typedef [public,gensize] struct {
918                 spoolss_DriverOSVersion version;
919                 [relative] nstring *driver_name;
920                 [relative] nstring *architecture;
921                 [relative] nstring *driver_path;
922                 [relative] nstring *data_file;
923                 [relative] nstring *config_file;
924                 [relative] nstring *help_file;
925                 [relative] nstring *monitor_name;
926                 [relative] nstring *default_datatype;
927                 [relative] nstring_array *dependent_files;
928                 [relative] nstring_array *previous_names;
929                 NTTIME driver_date;
930                 hyper driver_version;
931                 [relative] nstring *manufacturer_name;
932                 [relative] nstring *manufacturer_url;
933                 [relative] nstring *hardware_id;
934                 [relative] nstring *provider;
935                 [relative] nstring *print_processor;
936                 [relative] nstring *vendor_setup;
937                 [relative] nstring_array *color_profiles;
938                 [relative] nstring *inf_path;
939                 uint32 printer_driver_attributes;
940                 [relative] nstring_array *core_driver_dependencies;
941                 NTTIME min_inbox_driver_ver_date;
942                 hyper min_inbox_driver_ver_version;
943         } spoolss_DriverInfo8;
944
945         typedef [v1_enum] enum {
946                 SPOOLSS_DRIVER_FILE_TYPE_RENDERING      = 0x00000000,
947                 SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION  = 0x00000001,
948                 SPOOLSS_DRIVER_FILE_TYPE_DATA           = 0x00000002,
949                 SPOOLSS_DRIVER_FILE_TYPE_HELP           = 0x00000003,
950                 SPOOLSS_DRIVER_FILE_TYPE_OTHER          = 0x00000004
951         } spoolss_DriverFileType;
952
953         typedef [public] struct {
954                 [relative] nstring *file_name;
955                 spoolss_DriverFileType file_type;
956                 uint32 file_version;
957         } spoolss_DriverFileInfo;
958
959         typedef [public,gensize,nopush,nopull] struct {
960                 spoolss_DriverOSVersion version;
961                 [relative] nstring *driver_name;
962                 [relative] nstring *architecture;
963                 [relative] [size_is(file_count)] spoolss_DriverFileInfo *file_info;
964                 uint32 file_count;
965                 [relative] nstring *monitor_name;
966                 [relative] nstring *default_datatype;
967                 [relative] nstring_array *previous_names;
968                 NTTIME driver_date;
969                 hyper driver_version;
970                 [relative] nstring *manufacturer_name;
971                 [relative] nstring *manufacturer_url;
972                 [relative] nstring *hardware_id;
973                 [relative] nstring *provider;
974         } spoolss_DriverInfo101;
975
976         typedef [nodiscriminant,relative_base,public] union {
977                 [case(1)] spoolss_DriverInfo1 info1;
978                 [case(2)] spoolss_DriverInfo2 info2;
979                 [case(3)] spoolss_DriverInfo3 info3;
980                 [case(4)] spoolss_DriverInfo4 info4;
981                 [case(5)] spoolss_DriverInfo5 info5;
982                 [case(6)] spoolss_DriverInfo6 info6;
983                 [case(8)] spoolss_DriverInfo8 info8;
984                 [case(101)] spoolss_DriverInfo101 info101;
985                 [default];
986         } spoolss_DriverInfo;
987
988         /******************/
989         /* Function: 0x0a */
990         [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDrivers(
991                 [in,unique] [string,charset(UTF16)] uint16 *server,
992                 [in,unique] [string,charset(UTF16)] uint16 *environment,
993                 [in] uint32 level,
994                 [in,unique] DATA_BLOB *buffer,
995                 [in] uint32 offered,
996                 [out,unique] DATA_BLOB *info,
997                 [out,ref] uint32 *needed,
998                 [out,ref] uint32 *count
999         );
1000         [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers(
1001                 [in] uint32 level,
1002                 [in] uint32 count,
1003                 [out,switch_is(level)] spoolss_DriverInfo info[count]
1004         );
1005         [nopull,nopush] WERROR spoolss_EnumPrinterDrivers(
1006                 [in,unique] [string,charset(UTF16)] uint16 *server,
1007                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1008                 [in] uint32 level,
1009                 [in,unique] DATA_BLOB *buffer,
1010                 [in] uint32 offered,
1011                 [out,ref] uint32 *count,
1012                 [out,unique,switch_is(level),size_is(*count)] spoolss_DriverInfo *info,
1013                 [out,ref] uint32 *needed
1014         );
1015
1016         /******************/
1017         /* Function: 0x0b */
1018         [todo] WERROR spoolss_GetPrinterDriver(
1019         );
1020
1021         /******************/
1022         /* Function: 0x0c */
1023         typedef [public,gensize] struct {
1024                 nstring directory_name;
1025         } spoolss_DriverDirectoryInfo1;
1026
1027         /* NOTE: it's seems that w2k3 completly ignores the level
1028                  in its server code
1029          */
1030         typedef [nodiscriminant,relative_base,gensize,public] union {
1031                 [case(1)] spoolss_DriverDirectoryInfo1 info1;
1032                 [default] spoolss_DriverDirectoryInfo1 info1;
1033         } spoolss_DriverDirectoryInfo;
1034
1035         [public] WERROR spoolss_GetPrinterDriverDirectory(
1036                 [in,unique] [string,charset(UTF16)] uint16 *server,
1037                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1038                 [in] uint32 level,
1039                 [in,unique] DATA_BLOB *buffer,
1040                 [in] uint32 offered,
1041                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
1042                 [out,ref] uint32 *needed
1043         );
1044
1045         /******************/
1046         /* Function: 0x0d */
1047         WERROR spoolss_DeletePrinterDriver(
1048                 [in,unique] [string,charset(UTF16)] uint16 *server,
1049                 [in] [string,charset(UTF16)] uint16 architecture[],
1050                 [in] [string,charset(UTF16)] uint16 driver[]
1051         );
1052
1053         /******************/
1054         /* Function: 0x0e */
1055         WERROR spoolss_AddPrintProcessor(
1056                 [in,unique] [string,charset(UTF16)] uint16 *server,
1057                 [in] [string,charset(UTF16)] uint16 architecture[],
1058                 [in] [string,charset(UTF16)] uint16 path_name[],
1059                 [in] [string,charset(UTF16)] uint16 print_processor_name[]
1060         );
1061
1062         /******************/
1063         /* Function: 0x0f */
1064         typedef struct {
1065                 [relative] nstring *print_processor_name;
1066         } spoolss_PrintProcessorInfo1;
1067
1068         typedef [nodiscriminant,relative_base,public] union {
1069                 [case(1)] spoolss_PrintProcessorInfo1 info1;
1070                 [default];
1071         } spoolss_PrintProcessorInfo;
1072
1073         [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessors(
1074                 [in,unique] [string,charset(UTF16)] uint16 *servername,
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_EnumPrintProcessors(
1084                 [in] uint32 level,
1085                 [in] uint32 count,
1086                 [out,switch_is(level)] spoolss_PrintProcessorInfo info[count]
1087         );
1088         [nopull,nopush] WERROR spoolss_EnumPrintProcessors(
1089                 [in,unique] [string,charset(UTF16)] uint16 *servername,
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,unique,switch_is(level),size_is(*count)] spoolss_PrintProcessorInfo *info,
1096                 [out,ref] uint32 *needed
1097         );
1098
1099         /******************/
1100         /* Function: 0x10 */
1101         typedef [public,gensize] struct {
1102                 nstring directory_name;
1103         } spoolss_PrintProcessorDirectoryInfo1;
1104
1105         typedef [nodiscriminant,relative_base,gensize,public] union {
1106                 [case(1)] spoolss_PrintProcessorDirectoryInfo1 info1;
1107                 [default] spoolss_PrintProcessorDirectoryInfo1 info1;
1108         } spoolss_PrintProcessorDirectoryInfo;
1109
1110         WERROR spoolss_GetPrintProcessorDirectory(
1111                 [in,unique] [string,charset(UTF16)] uint16 *server,
1112                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1113                 [in] uint32 level,
1114                 [in,unique] DATA_BLOB *buffer,
1115                 [in] uint32 offered,
1116                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrintProcessorDirectoryInfo *info,
1117                 [out,ref] uint32 *needed
1118         );
1119
1120         /******************/
1121         /* Function: 0x11 */
1122         typedef struct {
1123                 [string,charset(UTF16)] uint16 *document_name;
1124                 [string,charset(UTF16)] uint16 *output_file;
1125                 [string,charset(UTF16)] uint16 *datatype;
1126         } spoolss_DocumentInfo1;
1127
1128         typedef [switch_type(uint32)] union {
1129                 [case(1)] spoolss_DocumentInfo1 *info1;
1130                 [case(2)]; /* TODO */
1131                 [case(3)]; /* TODO */
1132                 [default];
1133         } spoolss_DocumentInfo;
1134
1135         WERROR spoolss_StartDocPrinter(
1136                 [in,ref] policy_handle *handle,
1137                 [in] uint32 level,
1138                 [in,switch_is(level)] spoolss_DocumentInfo info,
1139                 [out,ref] uint32 *job_id
1140         );
1141
1142         /******************/
1143         /* Function: 0x12 */
1144         WERROR spoolss_StartPagePrinter(
1145                 [in,ref] policy_handle *handle
1146         );
1147
1148         /******************/
1149         /* Function: 0x13 */
1150         WERROR spoolss_WritePrinter(
1151                 [in,ref] policy_handle *handle,
1152                 [in] DATA_BLOB data,
1153                 [in,value(r->in.data.length)] uint32 _data_size,
1154                 [out,ref] uint32 *num_written
1155         );
1156
1157         /******************/
1158         /* Function: 0x14 */
1159         WERROR spoolss_EndPagePrinter(
1160                 [in,ref] policy_handle *handle
1161         );
1162
1163         /******************/
1164         /* Function: 0x15 */
1165         WERROR spoolss_AbortPrinter(
1166                 [in,ref] policy_handle *handle
1167         );
1168
1169         /******************/
1170         /* Function: 0x16 */
1171         WERROR spoolss_ReadPrinter(
1172                 [in,ref] policy_handle *handle,
1173                 [out,ref] [size_is(data_size)] uint8 *data,
1174                 [in] uint32 data_size,
1175                 [out,ref] uint32 *_data_size
1176         );
1177
1178         /******************/
1179         /* Function: 0x17 */
1180         WERROR spoolss_EndDocPrinter(
1181                 [in,ref] policy_handle *handle
1182         );
1183
1184         /******************/
1185         /* Function: 0x18 */
1186         WERROR spoolss_AddJob(
1187                 [in,ref] policy_handle *handle,
1188                 [in] uint32 level,
1189                 [in,out,unique] [size_is(offered)] uint8 *buffer,
1190                 [in] uint32 offered,
1191                 [out,ref] uint32 *needed
1192         );
1193
1194         /******************/
1195         /* Function: 0x19 */
1196         WERROR spoolss_ScheduleJob(
1197                 [in,ref] policy_handle *handle,
1198                 [in] uint32 jobid
1199         );
1200
1201         /******************/
1202         /* Function: 0x1a */
1203         const string SPOOLSS_ARCHITECTURE_NT_X86                = "Windows NT x86";
1204         const string SPOOLSS_DEFAULT_SERVER_PATH                = "C:\\WINDOWS\\system32\\spool";
1205
1206         typedef [public,gensize] struct {
1207                 [value(ndr_size_spoolss_OSVersion(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
1208                 uint32 major;
1209                 uint32 minor;
1210                 uint32 build;
1211                 [value(2)] uint32 unknown;
1212                 [subcontext(0),subcontext_size(256)] nstring extra_string;
1213         } spoolss_OSVersion;
1214
1215         typedef [public,gensize] struct {
1216                 [value(ndr_size_spoolss_OSVersionEx(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
1217                 uint32 major;
1218                 uint32 minor;
1219                 uint32 build;
1220                 [value(2)] uint32 unknown1;
1221                 [subcontext(0),subcontext_size(256)] nstring extra_string;
1222                 uint32 unknown2;/* service pack number? I saw 0 from w2k3 and 1 from winxp sp1*/
1223                 uint32 unknown3;/* hmm? w2k3: 131346(0x20112) winxp sp1: 503382272 0x1E010100 */
1224         } spoolss_OSVersionEx;
1225
1226         typedef [v1_enum] enum {
1227                 SPOOLSS_PRINTER_DATA_TYPE_NULL = 0,
1228                 SPOOLSS_PRINTER_DATA_TYPE_STRING = 1,
1229                 SPOOLSS_PRINTER_DATA_TYPE_BINARY = 3,
1230                 SPOOLSS_PRINTER_DATA_TYPE_UINT32 = 4,
1231                 SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY = 7
1232         } spoolss_PrinterDataType;
1233
1234         typedef [nodiscriminant,public,gensize] union {
1235                 [case(SPOOLSS_PRINTER_DATA_TYPE_NULL)];
1236                 [case(SPOOLSS_PRINTER_DATA_TYPE_STRING)] nstring string;
1237                 [case(SPOOLSS_PRINTER_DATA_TYPE_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary;
1238                 [case(SPOOLSS_PRINTER_DATA_TYPE_UINT32)] uint32 value;
1239                 [case(SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY)] nstring_array string_array;
1240                 [default,flag(NDR_REMAINING)] DATA_BLOB data;
1241         } spoolss_PrinterData;
1242
1243         [noopnum,noprint,public] WERROR _spoolss_GetPrinterData(
1244                 [in,ref] policy_handle *handle,
1245                 [in]     [string,charset(UTF16)] uint16 value_name[],
1246                 [in]     uint32 offered,
1247                 [out,ref] spoolss_PrinterDataType *type,
1248                 [out]    DATA_BLOB data,
1249                 [out,ref] uint32 *needed
1250         );
1251         [noopnum,noprint,public] void __spoolss_GetPrinterData(
1252                 [in] spoolss_PrinterDataType type,
1253                 [out,switch_is(type)] spoolss_PrinterData data
1254         );
1255         [nopull,nopush,public] WERROR spoolss_GetPrinterData(
1256                 [in,ref] policy_handle *handle,
1257                 [in]     [string,charset(UTF16)] uint16 value_name[],
1258                 [in]     uint32 offered,
1259                 [out,ref] spoolss_PrinterDataType *type,
1260                 [out,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData data,
1261                 [out,ref] uint32 *needed
1262         );
1263
1264         /******************/
1265         /* Function: 0x1b */
1266         [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData(
1267                 [in,ref] policy_handle *handle,
1268                 [in] [string,charset(UTF16)] uint16 value_name[],
1269                 [in] spoolss_PrinterDataType type,
1270                 [in] DATA_BLOB data,
1271                 [in] uint32 _offered
1272         );
1273         [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData(
1274                 [in] spoolss_PrinterDataType type,
1275                 [out,switch_is(type)] spoolss_PrinterData data
1276         );
1277         [nopush] WERROR spoolss_SetPrinterData(
1278                 [in,ref] policy_handle *handle,
1279                 [in] [string,charset(UTF16)] uint16 value_name[],
1280                 [in] spoolss_PrinterDataType type,
1281                 [in,subcontext(4),switch_is(type)] spoolss_PrinterData data,
1282                 [in,value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] uint32 _offered
1283         );
1284
1285         /******************/
1286         /* Function: 0x1c */
1287         [todo] WERROR spoolss_WaitForPrinterChange(
1288         );
1289
1290         /******************/
1291         /* Function: 0x1d */
1292         [public] WERROR spoolss_ClosePrinter(
1293                 [in,out,ref]     policy_handle *handle
1294         );
1295
1296         /******************/
1297         /* Function: 0x1e */
1298         typedef [v1_enum] enum {
1299                 SPOOLSS_FORM_USER       = 0,
1300                 SPOOLSS_FORM_BUILTIN    = 1,
1301                 SPOOLSS_FORM_PRINTER    = 2
1302         } spoolss_FormFlags;
1303
1304         typedef struct {
1305                 uint32 width;
1306                 uint32 height;
1307         } spoolss_FormSize;
1308
1309         typedef struct {
1310                 uint32 left;
1311                 uint32 top;
1312                 uint32 right;
1313                 uint32 bottom;
1314         } spoolss_FormArea;
1315
1316         typedef struct {
1317                 spoolss_FormFlags flags;
1318                 [relative] nstring *form_name;
1319                 spoolss_FormSize size;
1320                 spoolss_FormArea area;
1321         } spoolss_FormInfo1;
1322
1323         typedef [bitmap32bit] bitmap {
1324                 SPOOLSS_FORM_STRING_TYPE_NONE           = 0x00000001,
1325                 SPOOLSS_FORM_STRING_TYPE_MUI_DLL        = 0x00000002,
1326                 SPOOLSS_FORM_STRING_TYPE_LANG_PAIR      = 0x00000004
1327         } spoolss_FormStringType;
1328
1329         typedef struct {
1330                 spoolss_FormFlags flags;
1331                 [relative] nstring *form_name;
1332                 spoolss_FormSize size;
1333                 spoolss_FormArea area;
1334                 [relative] astring *keyword;
1335                 spoolss_FormStringType string_type;
1336                 [relative] nstring *mui_dll;
1337                 uint32 ressource_id;
1338                 [relative] nstring *display_name;
1339                 uint32 lang_id;
1340         } spoolss_FormInfo2;
1341
1342         typedef [nodiscriminant,relative_base,public,gensize] union {
1343                 [case(1)] spoolss_FormInfo1 info1;
1344                 [case(2)] spoolss_FormInfo2 info2;
1345                 [default];
1346         } spoolss_FormInfo;
1347
1348         typedef struct {
1349                 spoolss_FormFlags flags;
1350                 [string,charset(UTF16)] uint16 *form_name;
1351                 spoolss_FormSize size;
1352                 spoolss_FormArea area;
1353         } spoolss_AddFormInfo1;
1354
1355         typedef struct {
1356                 spoolss_FormFlags flags;
1357                 [string,charset(UTF16)] uint16 *form_name;
1358                 spoolss_FormSize size;
1359                 spoolss_FormArea area;
1360                 [string,charset(DOS)] uint8 *keyword;
1361                 spoolss_FormStringType string_type;
1362                 [string,charset(UTF16)] uint16 *mui_dll;
1363                 uint32 ressource_id;
1364                 [string,charset(UTF16)] uint16 *display_name;
1365                 uint32 lang_id;
1366         } spoolss_AddFormInfo2;
1367
1368         typedef [switch_type(uint32)] union {
1369                 [case(1)] spoolss_AddFormInfo1 *info1;
1370                 [case(2)] spoolss_AddFormInfo2 *info2;
1371         } spoolss_AddFormInfo;
1372
1373         WERROR spoolss_AddForm(
1374                 [in,ref] policy_handle *handle,
1375                 [in] uint32 level,
1376                 [in,switch_is(level)] spoolss_AddFormInfo info
1377         );
1378
1379         /******************/
1380         /* Function: 0x1f */
1381         WERROR spoolss_DeleteForm(
1382                 [in,ref] policy_handle *handle,
1383                 [in] [string,charset(UTF16)] uint16 form_name[]
1384         );
1385
1386         /******************/
1387         /* Function: 0x20 */
1388         WERROR spoolss_GetForm(
1389                 [in,ref] policy_handle *handle,
1390                 [in] [string,charset(UTF16)] uint16 form_name[],
1391                 [in] uint32 level,
1392                 [in,unique] DATA_BLOB *buffer,
1393                 [in] uint32 offered,
1394                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
1395                 [out,ref] uint32 *needed
1396         );
1397
1398         /******************/
1399         /* Function: 0x21 */
1400         WERROR spoolss_SetForm(
1401                 [in,ref] policy_handle *handle,
1402                 [in] [string,charset(UTF16)] uint16 form_name[],
1403                 [in] uint32 level,
1404                 [in,switch_is(level)] spoolss_AddFormInfo info
1405         );
1406
1407         /******************/
1408         /* Function: 0x22 */
1409         [public,noopnum,noprint] WERROR _spoolss_EnumForms(
1410                 [in,ref] policy_handle *handle,
1411                 [in]     uint32 level,
1412                 [in,unique] DATA_BLOB *buffer,
1413                 [in]     uint32 offered,
1414                 [out,unique] DATA_BLOB *info,
1415                 [out,ref] uint32 *needed,
1416                 [out,ref] uint32 *count
1417         );
1418         [public,noopnum,noprint] void __spoolss_EnumForms(
1419                 [in] uint32 level,
1420                 [in] uint32 count,
1421                 [out,switch_is(level)] spoolss_FormInfo info[count]
1422         );
1423         [nopull,nopush] WERROR spoolss_EnumForms(
1424                 [in,ref] policy_handle *handle,
1425                 [in]     uint32 level,
1426                 [in,unique] DATA_BLOB *buffer,
1427                 [in]     uint32 offered,
1428                 [out,ref] uint32 *count,
1429                 [out,unique,switch_is(level),size_is(*count)] spoolss_FormInfo *info,
1430                 [out,ref] uint32 *needed
1431         );
1432
1433         typedef struct {
1434                 [relative] nstring *port_name;
1435         } spoolss_PortInfo1;
1436
1437         typedef bitmap {
1438                 SPOOLSS_PORT_TYPE_WRITE         = 0x00000001,
1439                 SPOOLSS_PORT_TYPE_READ          = 0x00000002,
1440                 SPOOLSS_PORT_TYPE_REDIRECTED    = 0x00000004,
1441                 SPOOLSS_PORT_TYPE_NET_ATTACHED  = 0x00000008
1442         } spoolss_PortType;
1443
1444         typedef struct {
1445                 [relative] nstring *port_name;
1446                 [relative] nstring *monitor_name;
1447                 [relative] nstring *description;
1448                 spoolss_PortType port_type;
1449                 uint32 reserved;
1450         } spoolss_PortInfo2;
1451
1452         typedef [nodiscriminant,relative_base,public] union {
1453                 [case(1)] spoolss_PortInfo1 info1;
1454                 [case(2)] spoolss_PortInfo2 info2;
1455                 [case(3)]; /* TODO */
1456                 [default];
1457         } spoolss_PortInfo;
1458
1459         /******************/
1460         /* Function: 0x23 */
1461         [public,noopnum,noprint] WERROR _spoolss_EnumPorts(
1462                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1463                 [in] uint32 level,
1464                 [in,unique] DATA_BLOB *buffer,
1465                 [in] uint32 offered,
1466                 [out,unique] DATA_BLOB *info,
1467                 [out,ref] uint32 *needed,
1468                 [out,ref] uint32 *count
1469         );
1470         [public,noopnum,noprint] void __spoolss_EnumPorts(
1471                 [in] uint32 level,
1472                 [in] uint32 count,
1473                 [out,switch_is(level)] spoolss_PortInfo info[count]
1474         );
1475         [nopull,nopush] WERROR spoolss_EnumPorts(
1476                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1477                 [in] uint32 level,
1478                 [in,unique] DATA_BLOB *buffer,
1479                 [in] uint32 offered,
1480                 [out,ref] uint32 *count,
1481                 [out,unique,switch_is(level),size_is(*count)] spoolss_PortInfo *info,
1482                 [out,ref] uint32 *needed
1483         );
1484
1485         /******************/
1486         /* Function: 0x24 */
1487         typedef struct {
1488                 [relative] nstring *monitor_name;
1489         } spoolss_MonitorInfo1;
1490
1491         typedef struct {
1492                 [relative] nstring *monitor_name;
1493                 [relative] nstring *environment;
1494                 [relative] nstring *dll_name;
1495         } spoolss_MonitorInfo2;
1496
1497         typedef [nodiscriminant,relative_base,public] union {
1498                 [case(1)] spoolss_MonitorInfo1 info1;
1499                 [case(2)] spoolss_MonitorInfo2 info2;
1500                 [default];
1501         } spoolss_MonitorInfo;
1502
1503         [public,noopnum,noprint] WERROR _spoolss_EnumMonitors(
1504                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1505                 [in] uint32 level,
1506                 [in,unique] DATA_BLOB *buffer,
1507                 [in] uint32 offered,
1508                 [out,unique] DATA_BLOB *info,
1509                 [out,ref] uint32 *needed,
1510                 [out,ref] uint32 *count
1511         );
1512         [public,noopnum,noprint] void __spoolss_EnumMonitors(
1513                 [in] uint32 level,
1514                 [in] uint32 count,
1515                 [out,switch_is(level)] spoolss_MonitorInfo info[count]
1516         );
1517         [nopull,nopush] WERROR spoolss_EnumMonitors(
1518                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1519                 [in] uint32 level,
1520                 [in,unique] DATA_BLOB *buffer,
1521                 [in] uint32 offered,
1522                 [out,ref] uint32 *count,
1523                 [out,unique,switch_is(level),size_is(*count)] spoolss_MonitorInfo *info,
1524                 [out,ref] uint32 *needed
1525         );
1526
1527         /******************/
1528         /* Function: 0x25 */
1529         WERROR spoolss_AddPort(
1530                [in,unique] [string,charset(UTF16)] uint16 *server_name,
1531                [in] uint32 unknown,
1532                [in] [string,charset(UTF16)] uint16 monitor_name[]
1533         );
1534
1535         /******************/
1536         /* Function: 0x26 */
1537         [todo] WERROR spoolss_ConfigurePort(
1538         );
1539
1540         /******************/
1541         /* Function: 0x27 */
1542         [todo] WERROR spoolss_DeletePort(
1543         );
1544
1545         /******************/
1546         /* Function: 0x28 */
1547         [todo] WERROR spoolss_CreatePrinterIC(
1548         );
1549
1550         /******************/
1551         /* Function: 0x29 */
1552         [todo] WERROR spoolss_PlayGDIScriptOnPrinterIC(
1553         );
1554
1555         /******************/
1556         /* Function: 0x2a */
1557         [todo] WERROR spoolss_DeletePrinterIC(
1558         );
1559
1560         /******************/
1561         /* Function: 0x2b */
1562         [todo] WERROR spoolss_AddPrinterConnection(
1563         );
1564
1565         /******************/
1566         /* Function: 0x2c */
1567         [todo] WERROR spoolss_DeletePrinterConnection(
1568         );
1569
1570         /******************/
1571         /* Function: 0x2d */
1572         [todo] WERROR spoolss_PrinterMessageBox(
1573                 /* Marked as obsolete in MSDN.  "Not necessary and has
1574                    no effect". */
1575         );
1576
1577         /******************/
1578         /* Function: 0x2e */
1579         [todo] WERROR spoolss_AddMonitor(
1580         );
1581
1582         /******************/
1583         /* Function: 0x2f */
1584         [todo] WERROR spoolss_DeleteMonitor(
1585         );
1586
1587         /******************/
1588         /* Function: 0x30 */
1589         [todo] WERROR spoolss_DeletePrintProcessor(
1590         );
1591
1592         /******************/
1593         /* Function: 0x31 */
1594         [todo] WERROR spoolss_AddPrintProvidor(
1595         );
1596
1597         /******************/
1598         /* Function: 0x32 */
1599         [todo] WERROR spoolss_DeletePrintProvidor(
1600         );
1601
1602         /******************/
1603         /* Function: 0x33 */
1604         [todo] WERROR spoolss_EnumPrintProcDataTypes(
1605         );
1606
1607         /******************/
1608         /* Function: 0x34 */
1609         WERROR spoolss_ResetPrinter(
1610                 [in,ref] policy_handle *handle,
1611                 [in,unique] [string,charset(UTF16)] uint16 *data_type,
1612                 [in,ref] spoolss_DevmodeContainer *devmode_ctr
1613         );
1614
1615         /******************/
1616         /* Function: 0x35 */
1617         WERROR spoolss_GetPrinterDriver2(
1618                 [in,ref] policy_handle *handle,
1619                 [in,unique] [string,charset(UTF16)] uint16 *architecture,
1620                 [in]     uint32 level,
1621                 [in,unique] DATA_BLOB *buffer,
1622                 [in]     uint32 offered,
1623                 [in]     uint32 client_major_version,
1624                 [in]     uint32 client_minor_version,
1625                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverInfo *info,
1626                 [out,ref] uint32 *needed,
1627                 [out,ref] uint32 *server_major_version,
1628                 [out,ref] uint32 *server_minor_version
1629         );
1630
1631         /******************/
1632         /* Function: 0x36 */
1633         [todo] WERROR spoolss_FindFirstPrinterChangeNotification(
1634         );
1635
1636         /******************/
1637         /* Function: 0x37 */
1638         [todo] WERROR spoolss_FindNextPrinterChangeNotification(
1639         );
1640
1641         /******************/
1642         /* Function: 0x38 */
1643         [public] WERROR spoolss_FindClosePrinterNotify(
1644                 [in,ref] policy_handle *handle
1645         );
1646
1647         /******************/
1648         /* Function: 0x39 */
1649         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotificationOld(
1650         );
1651
1652         /******************/
1653         /* Function: 0x3a */
1654         [public] WERROR spoolss_ReplyOpenPrinter(
1655                 [in,string,charset(UTF16)] uint16 server_name[],
1656                 [in] uint32 printer_local,
1657                 [in] winreg_Type type,
1658                 [in,range(0,512)] uint32 bufsize,
1659                 [in,unique,size_is(bufsize)] uint8 *buffer,
1660                 [out,ref] policy_handle *handle
1661         );
1662
1663         /******************/
1664         /* Function: 0x3b */
1665
1666         typedef [bitmap32bit] bitmap {
1667                 PRINTER_CHANGE_ADD_PRINTER                      = 0x00000001,
1668                 PRINTER_CHANGE_SET_PRINTER                      = 0x00000002,
1669                 PRINTER_CHANGE_DELETE_PRINTER                   = 0x00000004,
1670                 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER        = 0x00000008,
1671                 PRINTER_CHANGE_ADD_JOB                          = 0x00000100,
1672                 PRINTER_CHANGE_SET_JOB                          = 0x00000200,
1673                 PRINTER_CHANGE_DELETE_JOB                       = 0x00000400,
1674                 PRINTER_CHANGE_WRITE_JOB                        = 0x00000800,
1675                 PRINTER_CHANGE_ADD_FORM                         = 0x00010000,
1676                 PRINTER_CHANGE_SET_FORM                         = 0x00020000,
1677                 PRINTER_CHANGE_DELETE_FORM                      = 0x00040000,
1678                 PRINTER_CHANGE_ADD_PORT                         = 0x00100000,
1679                 PRINTER_CHANGE_CONFIGURE_PORT                   = 0x00200000,
1680                 PRINTER_CHANGE_DELETE_PORT                      = 0x00400000,
1681                 PRINTER_CHANGE_ADD_PRINT_PROCESSOR              = 0x01000000,
1682                 PRINTER_CHANGE_DELETE_PRINT_PROCESSOR           = 0x04000000,
1683                 PRINTER_CHANGE_SERVER                           = 0x08000000,
1684                 PRINTER_CHANGE_ADD_PRINTER_DRIVER               = 0x10000000,
1685                 PRINTER_CHANGE_SET_PRINTER_DRIVER               = 0x20000000,
1686                 PRINTER_CHANGE_DELETE_PRINTER_DRIVER            = 0x40000000,
1687                 PRINTER_CHANGE_TIMEOUT                          = 0x80000000
1688         } spoolss_PrinterChangeFlags;
1689
1690         const int PRINTER_CHANGE_PRINTER                        = 0x000000FF;
1691
1692         const int PRINTER_CHANGE_JOB                            = 0x0000FF00;
1693
1694         const int PRINTER_CHANGE_FORM                           = (PRINTER_CHANGE_ADD_FORM |
1695                                                                    PRINTER_CHANGE_SET_FORM |
1696                                                                    PRINTER_CHANGE_DELETE_FORM); /* 0x00070000 */
1697
1698         const int PRINTER_CHANGE_PORT                           = (PRINTER_CHANGE_ADD_PORT |
1699                                                                    PRINTER_CHANGE_CONFIGURE_PORT |
1700                                                                    PRINTER_CHANGE_DELETE_PORT); /* 0x00700000 */
1701
1702         const int PRINTER_CHANGE_PRINT_PROCESSOR                = 0x07000000;
1703
1704         const int PRINTER_CHANGE_PRINTER_DRIVER                 = (PRINTER_CHANGE_ADD_PRINTER_DRIVER |
1705                                                                    PRINTER_CHANGE_SET_PRINTER_DRIVER |
1706                                                                    PRINTER_CHANGE_DELETE_PRINTER_DRIVER); /* 0x70000000 */
1707
1708         const int PRINTER_CHANGE_ALL                            = (PRINTER_CHANGE_PRINTER |
1709                                                                    PRINTER_CHANGE_JOB |
1710                                                                    PRINTER_CHANGE_FORM |
1711                                                                    PRINTER_CHANGE_PORT |
1712                                                                    PRINTER_CHANGE_PRINT_PROCESSOR |
1713                                                                    PRINTER_CHANGE_PRINTER_DRIVER); /* 0x7777FFFF */
1714         WERROR spoolss_RouterReplyPrinter(
1715                 [in,ref] policy_handle *handle,
1716                 [in] spoolss_PrinterChangeFlags flags,
1717                 [in,range(0,512)] uint32 bufsize,
1718                 [in,unique,size_is(bufsize)] uint8 *buffer
1719         );
1720
1721         /******************/
1722         /* Function: 0x3c */
1723         [public] WERROR spoolss_ReplyClosePrinter(
1724                 [in,out,ref] policy_handle *handle
1725         );
1726
1727         /******************/
1728         /* Function: 0x3d */
1729         [todo] WERROR spoolss_AddPortEx(
1730         );
1731
1732         /******************/
1733         /* Function: 0x3e */
1734         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotification(
1735         );
1736
1737         /******************/
1738         /* Function: 0x3f */
1739         [todo] WERROR spoolss_SpoolerInit(
1740         );
1741
1742         /******************/
1743         /* Function: 0x40 */
1744         [todo] WERROR spoolss_ResetPrinterEx(
1745         );
1746
1747         typedef [enum16bit] enum {
1748                 SPOOLSS_FIELD_SERVER_NAME               =  0,
1749                 SPOOLSS_FIELD_PRINTER_NAME              =  1,
1750                 SPOOLSS_FIELD_SHARE_NAME        =  2,
1751                 SPOOLSS_FIELD_PORT_NAME                 =  3,
1752                 SPOOLSS_FIELD_DRIVER_NAME               =  4,
1753                 SPOOLSS_FIELD_COMMENT                   =  5,
1754                 SPOOLSS_FIELD_LOCATION                  =  6,
1755                 SPOOLSS_FIELD_DEVMODE                   =  7,
1756                 SPOOLSS_FIELD_SEPFILE                   =  8,
1757                 SPOOLSS_FIELD_PRINT_PROCESSOR   =  9,
1758                 SPOOLSS_FIELD_PARAMETERS                = 10,
1759                 SPOOLSS_FIELD_DATATYPE                  = 11,
1760                 SPOOLSS_FIELD_SECURITY_DESCRIPTOR=12,
1761                 SPOOLSS_FIELD_ATTRIBUTES                = 13,
1762                 SPOOLSS_FIELD_PRIORITY                  = 14,
1763                 SPOOLSS_FIELD_DEFAULT_PRIORITY  = 15,
1764                 SPOOLSS_FIELD_START_TIME                = 16,
1765                 SPOOLSS_FIELD_UNTIL_TIME                = 17,
1766                 SPOOLSS_FIELD_STATUS                    = 18,
1767                 SPOOLSS_FIELD_STATUS_STRING             = 19,
1768                 SPOOLSS_FIELD_CJOBS                             = 20,
1769                 SPOOLSS_FIELD_AVERAGE_PPM               = 21,
1770                 SPOOLSS_FIELD_TOTAL_PAGES               = 22,
1771                 SPOOLSS_FIELD_PAGES_PRINTED     = 23,
1772                 SPOOLSS_FIELD_TOTAL_BYTES               = 24,
1773                 SPOOLSS_FIELD_BYTES_PRINTED             = 25
1774         } spoolss_Field;
1775
1776         typedef [enum16bit] enum {
1777                 SPOOLSS_NOTIFY_PRINTER                  = 0,
1778                 SPOOLSS_NOTIFY_JOB                              = 1
1779         } spoolss_NotifyType;
1780
1781         /******************/
1782         /* Function: 0x41 */
1783         typedef struct {
1784                 spoolss_NotifyType type;
1785                 uint16 u1;
1786                 uint32 u2;
1787                 uint32 u3;
1788                 uint32 count;
1789                 [size_is(count)] spoolss_Field *fields;
1790         } spoolss_NotifyOptionType;
1791
1792         typedef [bitmap32bit] bitmap {
1793                 PRINTER_NOTIFY_OPTIONS_REFRESH  = 0x00000001
1794         } spoolssNotifyOptionFlags;
1795
1796         typedef struct {
1797                 [value(2)] uint32 version;
1798                 spoolssNotifyOptionFlags flags;
1799                 uint32 count;
1800                 [size_is(count)] spoolss_NotifyOptionType *types;
1801         } spoolss_NotifyOption;
1802
1803         [public] WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
1804                 [in,ref] policy_handle *handle,
1805                 [in] spoolss_PrinterChangeFlags flags,
1806                 [in] uint32 options,
1807                 [in,unique] [string,charset(UTF16)] uint16 *local_machine,
1808                 [in] uint32 printer_local,
1809                 [in,unique] spoolss_NotifyOption *notify_options
1810         );
1811
1812         /******************/
1813         /* Function: 0x42 */
1814
1815         typedef struct {
1816                 uint32 size;
1817                 [size_is(size/2),unique,charset(UTF16)] uint16 *string;
1818         } spoolss_NotifyString;
1819
1820         typedef [v1_enum] enum {
1821                 NOTIFY_TABLE_DWORD              = 0x0001,
1822                 NOTIFY_TABLE_STRING             = 0x0002,
1823                 NOTIFY_TABLE_DEVMODE            = 0x0003,
1824                 NOTIFY_TABLE_TIME               = 0x0004,
1825                 NOTIFY_TABLE_SECURITYDESCRIPTOR = 0x0005
1826         } spoolss_NotifyTable;
1827
1828         typedef [switch_type(uint32)] union {
1829                 [case(1)] uint32 integer[2];
1830                 [case(2)] spoolss_NotifyString string;
1831                 [case(3)] spoolss_DevmodeContainer devmode;
1832                 [case(4)] spoolss_TimeCtr time;
1833                 [case(5)] sec_desc_buf sd;
1834         } spoolss_NotifyData;
1835
1836         typedef struct {
1837                 spoolss_NotifyType type;
1838                 spoolss_Field field;
1839                 spoolss_NotifyTable variable_type;
1840                 uint32 job_id;
1841                 [switch_is(variable_type)] spoolss_NotifyData data;
1842         } spoolss_Notify;
1843
1844         typedef struct {
1845                 [value(2)] uint32 version;
1846                 uint32 flags;
1847                 uint32 count;
1848                 [size_is(count)] spoolss_Notify notifies[];
1849         } spoolss_NotifyInfo;
1850
1851         typedef [switch_type(uint32)] union {
1852                 [case(0)] spoolss_NotifyInfo *info0;
1853         } spoolss_ReplyPrinterInfo;
1854
1855         typedef [bitmap32bit] bitmap {
1856                 PRINTER_NOTIFY_INFO_DISCARDED           = 0x00000001,
1857                 PRINTER_NOTIFY_INFO_DISCARDNOTED        = 0x00010000,
1858                 PRINTER_NOTIFY_INFO_COLOR_MISMATCH      = 0x00080000
1859         } spoolss_PrinterNotifyFlags;
1860
1861         WERROR spoolss_RouterReplyPrinterEx(
1862                 [in,ref] policy_handle *handle,
1863                 [in] uint32 color,
1864                 [in] spoolss_PrinterChangeFlags flags,
1865                 [out,ref] spoolss_PrinterNotifyFlags *reply_result,
1866                 [in] uint32 reply_type,
1867                 [in,switch_is(reply_type)] spoolss_ReplyPrinterInfo info
1868         );
1869
1870         /******************/
1871         /* Function: 0x43 */
1872         [public] WERROR spoolss_RouterRefreshPrinterChangeNotify(
1873                 [in,ref] policy_handle *handle,
1874                 [in] uint32 change_low,
1875                 [in,unique] spoolss_NotifyOption *options,
1876                 [out,ref] spoolss_NotifyInfo **info
1877         );
1878
1879         /******************/
1880         /* Function: 0x44 */
1881         [todo] WERROR spoolss_44(
1882         );
1883
1884         typedef struct {
1885                 uint32 size;
1886                 [string,charset(UTF16)] uint16 *client;
1887                 [string,charset(UTF16)] uint16 *user;
1888                 uint32 build;
1889                 spoolss_MajorVersion major;
1890                 spoolss_MinorVersion minor;
1891                 spoolss_ProcessorArchitecture processor;
1892         } spoolss_UserLevel1;
1893
1894         typedef struct {
1895                 uint32 not_used;
1896         } spoolss_UserLevel2;
1897
1898         typedef struct {
1899                 uint32 size;
1900                 uint32 flags;
1901                 uint32 size2;
1902                 [string,charset(UTF16)] uint16 *client;
1903                 [string,charset(UTF16)] uint16 *user;
1904                 uint32 build;
1905                 spoolss_MajorVersion major;
1906                 spoolss_MinorVersion minor;
1907                 spoolss_ProcessorArchitecture processor;
1908                 udlong reserved;
1909         } spoolss_UserLevel3;
1910
1911         typedef [switch_type(uint32)] union {
1912                 [case(1)]  spoolss_UserLevel1 *level1;
1913                 [case(2)]  spoolss_UserLevel2 *level2;
1914                 [case(3)]  spoolss_UserLevel3 *level3;
1915         } spoolss_UserLevel;
1916
1917         typedef struct {
1918                 uint32 level;
1919                 [switch_is(level)] spoolss_UserLevel user_info;
1920         } spoolss_UserLevelCtr;
1921
1922         typedef bitmap {
1923                 SERVER_ACCESS_ADMINISTER        = 0x00000001,
1924                 SERVER_ACCESS_ENUMERATE         = 0x00000002,
1925                 PRINTER_ACCESS_ADMINISTER       = 0x00000004,
1926                 PRINTER_ACCESS_USE              = 0x00000008,
1927                 JOB_ACCESS_ADMINISTER           = 0x00000010,
1928                 JOB_ACCESS_READ                 = 0x00000020
1929         } spoolss_AccessRights;
1930
1931         /* Access rights for print servers */
1932         const int SERVER_ALL_ACCESS     = SEC_STD_REQUIRED |
1933                                           SERVER_ACCESS_ADMINISTER |
1934                                           SERVER_ACCESS_ENUMERATE;
1935
1936         const int SERVER_READ           = SEC_STD_READ_CONTROL |
1937                                           SERVER_ACCESS_ENUMERATE;
1938
1939         const int SERVER_WRITE          = STANDARD_RIGHTS_WRITE_ACCESS |
1940                                           SERVER_ACCESS_ADMINISTER |
1941                                           SERVER_ACCESS_ENUMERATE;
1942
1943         const int SERVER_EXECUTE        = SEC_STD_READ_CONTROL |
1944                                           SERVER_ACCESS_ENUMERATE;
1945
1946         /* Access rights for printers */
1947         const int PRINTER_ALL_ACCESS    = SEC_STD_REQUIRED |
1948                                           PRINTER_ACCESS_ADMINISTER |
1949                                           PRINTER_ACCESS_USE;
1950
1951         const int PRINTER_READ          = SEC_STD_READ_CONTROL |
1952                                           PRINTER_ACCESS_USE;
1953
1954         const int PRINTER_WRITE         = STANDARD_RIGHTS_WRITE_ACCESS |
1955                                           PRINTER_ACCESS_USE;
1956
1957         const int PRINTER_EXECUTE       = SEC_STD_READ_CONTROL |
1958                                           PRINTER_ACCESS_USE;
1959
1960         /* Access rights for jobs */
1961         const int JOB_ALL_ACCESS        = SEC_STD_REQUIRED |
1962                                           JOB_ACCESS_ADMINISTER;
1963
1964         const int JOB_READ              = SEC_STD_READ_CONTROL |
1965                                           JOB_ACCESS_ADMINISTER;
1966
1967         const int JOB_WRITE             = STANDARD_RIGHTS_WRITE_ACCESS |
1968                                           JOB_ACCESS_ADMINISTER;
1969
1970         const int JOB_EXECUTE           = SEC_STD_READ_CONTROL |
1971                                           JOB_ACCESS_ADMINISTER;
1972
1973         /* ACE masks for various print permissions */
1974         const int PRINTER_ACE_FULL_CONTROL = SEC_GENERIC_ALL |
1975                                                 PRINTER_ALL_ACCESS;
1976
1977         const int PRINTER_ACE_MANAGE_DOCUMENTS = SEC_GENERIC_ALL |
1978                                                 READ_CONTROL_ACCESS;
1979
1980         const int PRINTER_ACE_PRINT     = GENERIC_EXECUTE_ACCESS |
1981                                           READ_CONTROL_ACCESS |
1982                                           PRINTER_ACCESS_USE;
1983
1984         /******************/
1985         /* Function: 0x45 */
1986         [public] WERROR spoolss_OpenPrinterEx(
1987                 [in,unique]           [string,charset(UTF16)] uint16 *printername,
1988                 [in,unique]           [string,charset(UTF16)] uint16 *datatype,
1989                 [in]                  spoolss_DevmodeContainer devmode_ctr,
1990                 [in]                  spoolss_AccessRights access_mask,
1991                 [in]                  uint32 level,
1992                 [in,switch_is(level)] spoolss_UserLevel userlevel,
1993                 [out,ref]             policy_handle *handle
1994         );
1995
1996         /******************/
1997         /* Function: 0x46 */
1998         WERROR spoolss_AddPrinterEx(
1999                 [in,unique] [string,charset(UTF16)] uint16 *server,
2000                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
2001                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
2002                 [in,ref] sec_desc_buf *secdesc_ctr,
2003                 [in,ref] spoolss_UserLevelCtr *userlevel_ctr,
2004                 [out,ref] policy_handle *handle
2005         );
2006
2007         /******************/
2008         /* Function: 0x47 */
2009         [todo] WERROR spoolss_47(
2010         );
2011
2012         /******************/
2013         /* Function: 0x48 */
2014         WERROR spoolss_EnumPrinterData(
2015                 [in,ref] policy_handle *handle,
2016                 [in]     uint32 enum_index,
2017                 [out,size_is(value_offered/2),charset(UTF16)] uint16 value_name[],
2018                 [in]     uint32 value_offered,
2019                 [out,ref] uint32 *value_needed,
2020                 [out,ref] uint32 *printerdata_type,
2021                 [out,ref] DATA_BLOB *buffer,
2022                 [in]     uint32 data_offered,
2023                 [out,ref] uint32 *data_needed
2024         );
2025
2026         /******************/
2027         /* Function: 0x49 */
2028         WERROR spoolss_DeletePrinterData(
2029                 [in,ref] policy_handle *handle,
2030                 [in] [string,charset(UTF16)] uint16 value_name[]
2031         );
2032
2033         /******************/
2034         /* Function: 0x4a */
2035         [todo] WERROR spoolss_4a(
2036         );
2037
2038         /******************/
2039         /* Function: 0x4b */
2040         [todo] WERROR spoolss_4b(
2041         );
2042
2043         /******************/
2044         /* Function: 0x4c */
2045         [todo] WERROR spoolss_4c(
2046         );
2047
2048         /******************/
2049         /* Function: 0x4d */
2050         WERROR spoolss_SetPrinterDataEx(
2051                 [in,ref] policy_handle *handle,
2052                 [in]     [string,charset(UTF16)] uint16 key_name[],
2053                 [in]     [string,charset(UTF16)] uint16 value_name[],
2054                 [in]     uint32 type,
2055                 [in,ref] [size_is(offered)] uint8 *buffer,
2056                 [in]     uint32 offered
2057         );
2058
2059         /******************/
2060         /* Function: 0x4e */
2061         WERROR spoolss_GetPrinterDataEx(
2062                 [in,ref] policy_handle *handle,
2063                 [in]     [string,charset(UTF16)] uint16 key_name[],
2064                 [in]     [string,charset(UTF16)] uint16 value_name[],
2065                 [out,ref] uint32 *type,
2066                 [out,ref] [size_is(offered)] uint8 *buffer,
2067                 [in]     uint32 offered,
2068                 [out,ref] uint32 *needed
2069         );
2070
2071         /******************/
2072         /* Function: 0x4f */
2073         [public] WERROR spoolss_EnumPrinterDataEx(
2074                 [in,ref] policy_handle *handle,
2075                 [in]     [string,charset(UTF16)] uint16 key_name[],
2076                 [out,ref] [size_is(offered)] uint8 *buffer,
2077                 [in]     uint32 offered,
2078                 [out,ref] uint32 *needed,
2079                 [out,ref] uint32 *count
2080         );
2081
2082         /******************/
2083         /* Function: 0x50 */
2084         [public] WERROR spoolss_EnumPrinterKey(
2085                 [in, ref] policy_handle *handle,
2086                 [in] [string,charset(UTF16)] uint16 key_name[],
2087                 [out,ref] [size_is(key_buffer_size/2)] uint16 *key_buffer,
2088                 [in] uint32 key_buffer_size,
2089                 [out,ref] uint32 *needed
2090         );
2091
2092         /******************/
2093         /* Function: 0x51 */
2094         WERROR spoolss_DeletePrinterDataEx(
2095                 [in,ref] policy_handle *handle,
2096                 [in] [string,charset(UTF16)] uint16 key_name[],
2097                 [in] [string,charset(UTF16)] uint16 value_name[]
2098         );
2099
2100         /******************/
2101         /* Function: 0x52 */
2102         WERROR spoolss_DeletePrinterKey(
2103                 [in,ref] policy_handle *handle,
2104                 [in] [string,charset(UTF16)] uint16 key_name[]
2105         );
2106
2107         /******************/
2108         /* Function: 0x53 */
2109         [todo] WERROR spoolss_53(
2110         );
2111
2112         /******************/
2113         /* Function: 0x54 */
2114         typedef [public,bitmap32bit] bitmap {
2115                 DPD_DELETE_UNUSED_FILES         = 0x00000001,
2116                 DPD_DELETE_SPECIFIC_VERSION     = 0x00000002,
2117                 DPD_DELETE_ALL_FILES            = 0x00000004
2118         } spoolss_DeleteDriverFlags;
2119
2120         WERROR spoolss_DeletePrinterDriverEx(
2121                 [in,unique] [string,charset(UTF16)] uint16 *server,
2122                 [in] [string,charset(UTF16)] uint16 architecture[],
2123                 [in] [string,charset(UTF16)] uint16 driver[],
2124                 [in] spoolss_DeleteDriverFlags delete_flags,
2125                 [in] uint32 version
2126         );
2127
2128         /******************/
2129         /* Function: 0x55 */
2130         [todo] WERROR spoolss_55(
2131         );
2132
2133         /******************/
2134         /* Function: 0x56 */
2135         [todo] WERROR spoolss_56(
2136         );
2137
2138         /******************/
2139         /* Function: 0x57 */
2140         [todo] WERROR spoolss_57(
2141         );
2142
2143         /******************/
2144         /* Function: 0x58 */
2145
2146         typedef [v1_enum] enum {
2147                 PROTOCOL_RAWTCP_TYPE    = 1,
2148                 PROTOCOL_LPR_TYPE       = 2
2149         } spoolss_PortProtocol;
2150
2151         typedef [public] struct {
2152                 [charset(UTF16)] uint16 portname[64];
2153                 [value(0x00000001)] uint32 version;
2154                 spoolss_PortProtocol protocol;
2155                 [value(sizeof(r))] uint32 size;
2156                 uint32 reserved;
2157                 [charset(UTF16)] uint16 hostaddress[49];
2158                 [charset(UTF16)] uint16 snmpcommunity[33];
2159                 uint32 dblspool;
2160                 [charset(UTF16)] uint16 queue[33];
2161                 [charset(UTF16)] uint16 ip_address[16]; /* s3 had 17 */
2162                 [charset(UTF16)] uint16 hardware_address[13];
2163                 [charset(UTF16)] uint16 device_type[257];
2164                 uint32 port_number;
2165                 boolean32 snmp_enabled;
2166                 uint32 snmp_dev_index;
2167         } spoolss_PortData1;
2168
2169         typedef [public] struct {
2170                 [charset(UTF16)] uint16 portname[64];
2171                 [value(0x00000002)] uint32 version;
2172                 spoolss_PortProtocol protocol;
2173                 [value(sizeof(r))] uint32 size;
2174                 uint32 reserved;
2175                 [charset(UTF16)] uint16 hostaddress[128];
2176                 [charset(UTF16)] uint16 snmpcommunity[33];
2177                 uint32 dblspool;
2178                 [charset(UTF16)] uint16 queue[33];
2179                 [charset(UTF16)] uint16 device_type[257];
2180                 uint32 port_number;
2181                 boolean32 snmp_enabled;
2182                 uint32 snmp_dev_index;
2183                 uint32 port_monitor_mib_index;
2184         } spoolss_PortData2;
2185
2186         typedef [public] struct {
2187                 nstring dll_name;
2188         } spoolss_MonitorUi;
2189
2190         WERROR spoolss_XcvData(
2191                 [in,ref] policy_handle *handle,
2192                 [in] [string,charset(UTF16)] uint16 function_name[],
2193                 [in] DATA_BLOB in_data,
2194                 [in,value(r->in.in_data.length)] uint32 _in_data_length,
2195                 [out,ref] [size_is(out_data_size)] uint8 *out_data,
2196                 [in] uint32 out_data_size,
2197                 [out,ref] uint32 *needed,
2198                 [in,out,ref] uint32 *status_code
2199         );
2200
2201         /******************/
2202         /* Function: 0x59 */
2203
2204         typedef [bitmap32bit] bitmap {
2205                 APD_STRICT_UPGRADE              = 0x00000001,
2206                 APD_STRICT_DOWNGRADE            = 0x00000002,
2207                 APD_COPY_ALL_FILES              = 0x00000004,
2208                 APD_COPY_NEW_FILES              = 0x00000008,
2209                 APD_COPY_FROM_DIRECTORY         = 0x00000010,
2210                 APD_DONT_COPY_FILES_TO_CLUSTER  = 0x00001000,
2211                 APD_COPY_TO_ALL_SPOOLERS        = 0x00002000,
2212                 APD_RETURN_BLOCKING_STATUS_CODE = 0x00010000
2213         } spoolss_AddPrinterDriverExFlags;
2214
2215         [public] WERROR spoolss_AddPrinterDriverEx(
2216                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2217                 [in,ref] spoolss_AddDriverInfoCtr *info_ctr,
2218                 [in] spoolss_AddPrinterDriverExFlags flags
2219         );
2220
2221         /******************/
2222         /* Function: 0x5a */
2223         [todo] WERROR spoolss_5a(
2224         );
2225
2226         /******************/
2227         /* Function: 0x5b */
2228         [todo] WERROR spoolss_5b(
2229         );
2230
2231         /******************/
2232         /* Function: 0x5c */
2233         [todo] WERROR spoolss_5c(
2234         );
2235
2236         /******************/
2237         /* Function: 0x5d */
2238         [todo] WERROR spoolss_5d(
2239         );
2240
2241         /******************/
2242         /* Function: 0x5e */
2243         [todo] WERROR spoolss_5e(
2244         );
2245
2246         /******************/
2247         /* Function: 0x5f */
2248         [todo] WERROR spoolss_5f(
2249         );
2250 }