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