spoolss: fill in spoolss_AddPrinterDriver. This is metze's work from 2005 (!).
[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 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 [nodiscriminant,relative_base,public] union {
663                 [case(1)] spoolss_DriverInfo1 info1;
664                 [case(2)] spoolss_DriverInfo2 info2;
665                 [case(3)] spoolss_DriverInfo3 info3;
666                 [case(4)] spoolss_DriverInfo4 info4;
667                 [case(5)] spoolss_DriverInfo5 info5;
668                 [case(6)] spoolss_DriverInfo6 info6;
669                 [default];
670         } spoolss_DriverInfo;
671
672         /******************/
673         /* Function: 0x0a */
674         [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDrivers(
675                 [in,unique] [string,charset(UTF16)] uint16 *server,
676                 [in,unique] [string,charset(UTF16)] uint16 *environment,
677                 [in] uint32 level,
678                 [in,unique] DATA_BLOB *buffer,
679                 [in] uint32 offered,
680                 [out,unique] DATA_BLOB *info,
681                 [out,ref] uint32 *needed,
682                 [out] uint32 count
683         );
684         [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers(
685                 [in] uint32 level,
686                 [in] uint32 count,
687                 [out,switch_is(level)] spoolss_DriverInfo info[count]
688         );
689         [nopull,nopush] WERROR spoolss_EnumPrinterDrivers(
690                 [in,unique] [string,charset(UTF16)] uint16 *server,
691                 [in,unique] [string,charset(UTF16)] uint16 *environment,
692                 [in] uint32 level,
693                 [in,unique] DATA_BLOB *buffer,
694                 [in] uint32 offered,
695                 [out,unique,switch_is(level),size_is(count)] spoolss_DriverInfo *info,
696                 [out,ref] uint32 *needed,
697                 [out] uint32 count
698         );
699
700         /******************/
701         /* Function: 0x0b */
702         [todo] WERROR spoolss_GetPrinterDriver(
703         );
704
705         /******************/
706         /* Function: 0x0c */
707         typedef struct {
708                 nstring directory_name;
709         } spoolss_DriverDirectoryInfo1;
710
711         /* NOTE: it's seems that w2k3 completly ignores the level
712                  in its server code
713          */
714         typedef [nodiscriminant,relative_base,gensize,public] union {
715                 [case(1)] spoolss_DriverDirectoryInfo1 info1;
716                 [default] spoolss_DriverDirectoryInfo1 info1;
717         } spoolss_DriverDirectoryInfo;
718
719         [public] WERROR spoolss_GetPrinterDriverDirectory(
720                 [in,unique] [string,charset(UTF16)] uint16 *server,
721                 [in,unique] [string,charset(UTF16)] uint16 *environment,
722                 [in] uint32 level,
723                 [in,unique] DATA_BLOB *buffer,
724                 [in] uint32 offered,
725                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
726                 [out,ref] uint32 *needed
727         );
728
729         /******************/
730         /* Function: 0x0d */
731         WERROR spoolss_DeletePrinterDriver(
732                 [in,unique] [string,charset(UTF16)] uint16 *server,
733                 [in] [string,charset(UTF16)] uint16 architecture[],
734                 [in] [string,charset(UTF16)] uint16 driver[]
735         );
736
737         /******************/
738         /* Function: 0x0e */
739         WERROR spoolss_AddPrintProcessor(
740                 [in,unique] [string,charset(UTF16)] uint16 *server,
741                 [in] [string,charset(UTF16)] uint16 architecture[],
742                 [in] [string,charset(UTF16)] uint16 path_name[],
743                 [in] [string,charset(UTF16)] uint16 print_processor_name[]
744         );
745
746         /******************/
747         /* Function: 0x0f */
748         typedef struct {
749                 [relative] nstring *print_processor_name;
750         } spoolss_PrintProcessorInfo1;
751
752         typedef [nodiscriminant,relative_base,public] union {
753                 [case(1)] spoolss_PrintProcessorInfo1 info1;
754                 [default];
755         } spoolss_PrintProcessorInfo;
756
757         [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessors(
758                 [in,unique] [string,charset(UTF16)] uint16 *servername,
759                 [in,unique] [string,charset(UTF16)] uint16 *environment,
760                 [in] uint32 level,
761                 [in,unique] DATA_BLOB *buffer,
762                 [in] uint32 offered,
763                 [out,unique] DATA_BLOB *info,
764                 [out,ref] uint32 *needed,
765                 [out] uint32 count
766         );
767         [public,noopnum,noprint] void __spoolss_EnumPrintProcessors(
768                 [in] uint32 level,
769                 [in] uint32 count,
770                 [out,switch_is(level)] spoolss_PrintProcessorInfo info[count]
771         );
772         [nopull,nopush] WERROR spoolss_EnumPrintProcessors(
773                 [in,unique] [string,charset(UTF16)] uint16 *servername,
774                 [in,unique] [string,charset(UTF16)] uint16 *environment,
775                 [in] uint32 level,
776                 [in,unique] DATA_BLOB *buffer,
777                 [in] uint32 offered,
778                 [out,unique,switch_is(level),size_is(count)] spoolss_PrintProcessorInfo *info,
779                 [out,ref] uint32 *needed,
780                 [out] uint32 count
781         );
782
783         /******************/
784         /* Function: 0x10 */
785         [todo] WERROR spoolss_GetPrintProcessorDirectory(
786         );
787
788         /******************/
789         /* Function: 0x11 */
790         typedef struct {
791                 [string,charset(UTF16)] uint16 *document_name;
792                 [string,charset(UTF16)] uint16 *output_file;
793                 [string,charset(UTF16)] uint16 *datatype;
794         } spoolss_DocumentInfo1;
795
796         typedef [switch_type(uint32)] union {
797                 [case(1)] spoolss_DocumentInfo1 *info1;
798                 [case(2)]; /* TODO */
799                 [case(3)]; /* TODO */
800                 [default];
801         } spoolss_DocumentInfo;
802
803         WERROR spoolss_StartDocPrinter(
804                 [in,ref] policy_handle *handle,
805                 [in] uint32 level,
806                 [in,switch_is(level)] spoolss_DocumentInfo info,
807                 [out,ref] uint32 *job_id
808         );
809
810         /******************/
811         /* Function: 0x12 */
812         WERROR spoolss_StartPagePrinter(
813                 [in,ref] policy_handle *handle
814         );
815
816         /******************/
817         /* Function: 0x13 */
818         WERROR spoolss_WritePrinter(
819                 [in,ref] policy_handle *handle,
820                 [in] DATA_BLOB data,
821                 [in,value(r->in.data.length)] uint32 _data_size,
822                 [out,ref] uint32 *num_written
823         );
824
825         /******************/
826         /* Function: 0x14 */
827         WERROR spoolss_EndPagePrinter(
828                 [in,ref] policy_handle *handle
829         );
830
831         /******************/
832         /* Function: 0x15 */
833         WERROR spoolss_AbortPrinter(
834                 [in,ref] policy_handle *handle
835         );
836
837         /******************/
838         /* Function: 0x16 */
839         WERROR spoolss_ReadPrinter(
840                 [in,ref] policy_handle *handle,
841                 [out,ref] [size_is(data_size)] uint8 *data,
842                 [in] uint32 data_size,
843                 [out,ref] uint32 *_data_size
844         );
845
846         /******************/
847         /* Function: 0x17 */
848         WERROR spoolss_EndDocPrinter(
849                 [in,ref] policy_handle *handle
850         );
851
852         /******************/
853         /* Function: 0x18 */
854         WERROR spoolss_AddJob(
855                 [in,ref] policy_handle *handle,
856                 [in] uint32 level,
857                 [in,out,unique] [size_is(offered)] uint8 *buffer,
858                 [in] uint32 offered,
859                 [out,ref] uint32 *needed
860         );
861
862         /******************/
863         /* Function: 0x19 */
864         WERROR spoolss_ScheduleJob(
865                 [in,ref] policy_handle *handle,
866                 [in] uint32 jobid
867         );
868
869         /******************/
870         /* Function: 0x1a */
871         const string SPOOLSS_ARCHITECTURE_NT_X86                = "Windows NT x86";
872
873         typedef [public,gensize] struct {
874                 [value(ndr_size_spoolss_OSVersion(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
875                 uint32 major;
876                 uint32 minor;
877                 uint32 build;
878                 [value(2)] uint32 unknown;
879                 [subcontext(0),subcontext_size(256)] nstring extra_string;
880         } spoolss_OSVersion;
881
882         typedef [public,gensize] struct {
883                 [value(ndr_size_spoolss_OSVersionEx(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
884                 uint32 major;
885                 uint32 minor;
886                 uint32 build;
887                 [value(2)] uint32 unknown1;
888                 [subcontext(0),subcontext_size(256)] nstring extra_string;
889                 uint32 unknown2;/* service pack number? I saw 0 from w2k3 and 1 from winxp sp1*/
890                 uint32 unknown3;/* hmm? w2k3: 131346(0x20112) winxp sp1: 503382272 0x1E010100 */
891         } spoolss_OSVersionEx;
892
893         typedef [v1_enum] enum {
894                 SPOOLSS_PRINTER_DATA_TYPE_NULL = 0,
895                 SPOOLSS_PRINTER_DATA_TYPE_STRING = 1,
896                 SPOOLSS_PRINTER_DATA_TYPE_BINARY = 3,
897                 SPOOLSS_PRINTER_DATA_TYPE_UINT32 = 4,
898                 SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY = 7
899         } spoolss_PrinterDataType;
900
901         typedef [nodiscriminant,public,gensize] union {
902                 [case(SPOOLSS_PRINTER_DATA_TYPE_NULL)];
903                 [case(SPOOLSS_PRINTER_DATA_TYPE_STRING)] nstring string;
904                 [case(SPOOLSS_PRINTER_DATA_TYPE_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary;
905                 [case(SPOOLSS_PRINTER_DATA_TYPE_UINT32)] uint32 value;
906                 [case(SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY)] nstring_array string_array;
907                 [default,flag(NDR_REMAINING)] DATA_BLOB data;
908         } spoolss_PrinterData;
909
910         [noopnum,noprint,public] WERROR _spoolss_GetPrinterData(
911                 [in,ref] policy_handle *handle,
912                 [in]     [string,charset(UTF16)] uint16 value_name[],
913                 [in]     uint32 offered,
914                 [out,ref] spoolss_PrinterDataType *type,
915                 [out]    DATA_BLOB data,
916                 [out,ref] uint32 *needed
917         );
918         [noopnum,noprint,public] void __spoolss_GetPrinterData(
919                 [in] spoolss_PrinterDataType type,
920                 [out,switch_is(type)] spoolss_PrinterData data
921         );
922         [nopull,nopush,public] WERROR spoolss_GetPrinterData(
923                 [in,ref] policy_handle *handle,
924                 [in]     [string,charset(UTF16)] uint16 value_name[],
925                 [in]     uint32 offered,
926                 [out,ref] spoolss_PrinterDataType *type,
927                 [out,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData data,
928                 [out,ref] uint32 *needed
929         );
930
931         /******************/
932         /* Function: 0x1b */
933         [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData(
934                 [in,ref] policy_handle *handle,
935                 [in] [string,charset(UTF16)] uint16 value_name[],
936                 [in] spoolss_PrinterDataType type,
937                 [in] DATA_BLOB data,
938                 [in] uint32 _offered
939         );
940         [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData(
941                 [in] spoolss_PrinterDataType type,
942                 [out,switch_is(type)] spoolss_PrinterData data
943         );
944         [nopush] WERROR spoolss_SetPrinterData(
945                 [in,ref] policy_handle *handle,
946                 [in] [string,charset(UTF16)] uint16 value_name[],
947                 [in] spoolss_PrinterDataType type,
948                 [in,subcontext(4),switch_is(type)] spoolss_PrinterData data,
949                 [in,value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] uint32 _offered
950         );
951
952         /******************/
953         /* Function: 0x1c */
954         [todo] WERROR spoolss_WaitForPrinterChange(
955         );
956
957         /******************/
958         /* Function: 0x1d */
959         [public] WERROR spoolss_ClosePrinter(
960                 [in,out,ref]     policy_handle *handle
961         );
962
963         /******************/
964         /* Function: 0x1e */
965         typedef [v1_enum] enum {
966                 SPOOLSS_FORM_USER       = 0,
967                 SPOOLSS_FORM_BUILTIN    = 1,
968                 SPOOLSS_FORM_PRINTER    = 2
969         } spoolss_FormFlags;
970
971         typedef struct {
972                 uint32 width;
973                 uint32 height;
974         } spoolss_FormSize;
975
976         typedef struct {
977                 uint32 left;
978                 uint32 top;
979                 uint32 right;
980                 uint32 bottom;
981         } spoolss_FormArea;
982
983         typedef struct {
984                 spoolss_FormFlags flags;
985                 [relative] nstring *form_name;
986                 spoolss_FormSize size;
987                 spoolss_FormArea area;
988         } spoolss_FormInfo1;
989
990         typedef [nodiscriminant,relative_base,public,gensize] union {
991                 [case(1)] spoolss_FormInfo1 info1;
992                 [default];
993         } spoolss_FormInfo;
994
995         typedef struct {
996                 spoolss_FormFlags flags;
997                 [string,charset(UTF16)] uint16 *form_name;
998                 spoolss_FormSize size;
999                 spoolss_FormArea area;
1000         } spoolss_AddFormInfo1;
1001
1002         typedef [switch_type(uint32)] union {
1003                 [case(1)] spoolss_AddFormInfo1 *info1;
1004         } spoolss_AddFormInfo;
1005
1006         WERROR spoolss_AddForm(
1007                 [in,ref] policy_handle *handle,
1008                 [in] uint32 level,
1009                 [in,switch_is(level)] spoolss_AddFormInfo info
1010         );
1011
1012         /******************/
1013         /* Function: 0x1f */
1014         WERROR spoolss_DeleteForm(
1015                 [in,ref] policy_handle *handle,
1016                 [in] [string,charset(UTF16)] uint16 form_name[]
1017         );
1018
1019         /******************/
1020         /* Function: 0x20 */
1021         WERROR spoolss_GetForm(
1022                 [in,ref] policy_handle *handle,
1023                 [in] [string,charset(UTF16)] uint16 form_name[],
1024                 [in] uint32 level,
1025                 [in,unique] DATA_BLOB *buffer,
1026                 [in] uint32 offered,
1027                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
1028                 [out,ref] uint32 *needed
1029         );
1030
1031         /******************/
1032         /* Function: 0x21 */
1033         WERROR spoolss_SetForm(
1034                 [in,ref] policy_handle *handle,
1035                 [in] [string,charset(UTF16)] uint16 form_name[],
1036                 [in] uint32 level,
1037                 [in,switch_is(level)] spoolss_AddFormInfo info
1038         );
1039
1040         /******************/
1041         /* Function: 0x22 */
1042         [public,noopnum,noprint] WERROR _spoolss_EnumForms(
1043                 [in,ref] policy_handle *handle,
1044                 [in]     uint32 level,
1045                 [in,unique] DATA_BLOB *buffer,
1046                 [in]     uint32 offered,
1047                 [out,unique] DATA_BLOB *info,
1048                 [out,ref] uint32 *needed,
1049                 [out]    uint32 count
1050         );
1051         [public,noopnum,noprint] void __spoolss_EnumForms(
1052                 [in] uint32 level,
1053                 [in] uint32 count,
1054                 [out,switch_is(level)] spoolss_FormInfo info[count]
1055         );
1056         [nopull,nopush] WERROR spoolss_EnumForms(
1057                 [in,ref] policy_handle *handle,
1058                 [in]     uint32 level,
1059                 [in,unique] DATA_BLOB *buffer,
1060                 [in]     uint32 offered,
1061                 [out,unique,switch_is(level),size_is(count)] spoolss_FormInfo *info,
1062                 [out,ref] uint32 *needed,
1063                 [out] uint32 count
1064         );
1065
1066         typedef struct {
1067                 [relative] nstring *port_name;
1068         } spoolss_PortInfo1;
1069
1070         typedef bitmap {
1071                 SPOOLSS_PORT_TYPE_WRITE         = 0x00000001,
1072                 SPOOLSS_PORT_TYPE_READ          = 0x00000002,
1073                 SPOOLSS_PORT_TYPE_REDIRECTED    = 0x00000004,
1074                 SPOOLSS_PORT_TYPE_NET_ATTACHED  = 0x00000008
1075         } spoolss_PortType;
1076
1077         typedef struct {
1078                 [relative] nstring *port_name;
1079                 [relative] nstring *monitor_name;
1080                 [relative] nstring *description;
1081                 spoolss_PortType port_type;
1082                 uint32 reserved;
1083         } spoolss_PortInfo2;
1084
1085         typedef [nodiscriminant,relative_base,public] union {
1086                 [case(1)] spoolss_PortInfo1 info1;
1087                 [case(2)] spoolss_PortInfo2 info2;
1088                 [case(3)]; /* TODO */
1089                 [default];
1090         } spoolss_PortInfo;
1091
1092         /******************/
1093         /* Function: 0x23 */
1094         [public,noopnum,noprint] WERROR _spoolss_EnumPorts(
1095                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1096                 [in] uint32 level,
1097                 [in,unique] DATA_BLOB *buffer,
1098                 [in] uint32 offered,
1099                 [out,unique] DATA_BLOB *info,
1100                 [out,ref] uint32 *needed,
1101                 [out] uint32 count
1102         );
1103         [public,noopnum,noprint] void __spoolss_EnumPorts(
1104                 [in] uint32 level,
1105                 [in] uint32 count,
1106                 [out,switch_is(level)] spoolss_PortInfo info[count]
1107         );
1108         [nopull,nopush] WERROR spoolss_EnumPorts(
1109                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1110                 [in] uint32 level,
1111                 [in,unique] DATA_BLOB *buffer,
1112                 [in] uint32 offered,
1113                 [out,unique,switch_is(level),size_is(count)] spoolss_PortInfo *info,
1114                 [out,ref] uint32 *needed,
1115                 [out] uint32 count
1116         );
1117
1118         /******************/
1119         /* Function: 0x24 */
1120         typedef struct {
1121                 [relative] nstring *monitor_name;
1122         } spoolss_MonitorInfo1;
1123
1124         typedef struct {
1125                 [relative] nstring *monitor_name;
1126                 [relative] nstring *environment;
1127                 [relative] nstring *dll_name;
1128         } spoolss_MonitorInfo2;
1129
1130         typedef [nodiscriminant,relative_base,public] union {
1131                 [case(1)] spoolss_MonitorInfo1 info1;
1132                 [case(2)] spoolss_MonitorInfo2 info2;
1133                 [default];
1134         } spoolss_MonitorInfo;
1135
1136         [public,noopnum,noprint] WERROR _spoolss_EnumMonitors(
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] DATA_BLOB *info,
1142                 [out,ref] uint32 *needed,
1143                 [out] uint32 count
1144         );
1145         [public,noopnum,noprint] void __spoolss_EnumMonitors(
1146                 [in] uint32 level,
1147                 [in] uint32 count,
1148                 [out,switch_is(level)] spoolss_MonitorInfo info[count]
1149         );
1150         [nopull,nopush] WERROR spoolss_EnumMonitors(
1151                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1152                 [in] uint32 level,
1153                 [in,unique] DATA_BLOB *buffer,
1154                 [in] uint32 offered,
1155                 [out,unique,switch_is(level),size_is(count)] spoolss_MonitorInfo *info,
1156                 [out,ref] uint32 *needed,
1157                 [out] uint32 count
1158         );
1159
1160         /******************/
1161         /* Function: 0x25 */
1162         WERROR spoolss_AddPort(
1163                [in,unique] [string,charset(UTF16)] uint16 *server_name,
1164                [in] uint32 unknown,
1165                [in] [string,charset(UTF16)] uint16 monitor_name[]
1166         );
1167
1168         /******************/
1169         /* Function: 0x26 */
1170         [todo] WERROR spoolss_ConfigurePort(
1171         );
1172
1173         /******************/
1174         /* Function: 0x27 */
1175         [todo] WERROR spoolss_DeletePort(
1176         );
1177
1178         /******************/
1179         /* Function: 0x28 */
1180         [todo] WERROR spoolss_CreatePrinterIC(
1181         );
1182
1183         /******************/
1184         /* Function: 0x29 */
1185         [todo] WERROR spoolss_PlayGDIScriptOnPrinterIC(
1186         );
1187
1188         /******************/
1189         /* Function: 0x2a */
1190         [todo] WERROR spoolss_DeletePrinterIC(
1191         );
1192
1193         /******************/
1194         /* Function: 0x2b */
1195         [todo] WERROR spoolss_AddPrinterConnection(
1196         );
1197
1198         /******************/
1199         /* Function: 0x2c */
1200         [todo] WERROR spoolss_DeletePrinterConnection(
1201         );
1202
1203         /******************/
1204         /* Function: 0x2d */
1205         [todo] WERROR spoolss_PrinterMessageBox(
1206                 /* Marked as obsolete in MSDN.  "Not necessary and has
1207                    no effect". */
1208         );
1209
1210         /******************/
1211         /* Function: 0x2e */
1212         [todo] WERROR spoolss_AddMonitor(
1213         );
1214
1215         /******************/
1216         /* Function: 0x2f */
1217         [todo] WERROR spoolss_DeleteMonitor(
1218         );
1219
1220         /******************/
1221         /* Function: 0x30 */
1222         [todo] WERROR spoolss_DeletePrintProcessor(
1223         );
1224
1225         /******************/
1226         /* Function: 0x31 */
1227         [todo] WERROR spoolss_AddPrintProvidor(
1228         );
1229
1230         /******************/
1231         /* Function: 0x32 */
1232         [todo] WERROR spoolss_DeletePrintProvidor(
1233         );
1234
1235         /******************/
1236         /* Function: 0x33 */
1237         [todo] WERROR spoolss_EnumPrintProcDataTypes(
1238         );
1239
1240         /******************/
1241         /* Function: 0x34 */
1242         [todo] WERROR spoolss_ResetPrinter(
1243         );
1244
1245         /******************/
1246         /* Function: 0x35 */
1247         WERROR spoolss_GetPrinterDriver2(
1248                 [in,ref] policy_handle *handle,
1249                 [in,unique] [string,charset(UTF16)] uint16 *architecture,
1250                 [in]     uint32 level,
1251                 [in,unique] DATA_BLOB *buffer,
1252                 [in]     uint32 offered,
1253                 [in]     uint32 client_major_version,
1254                 [in]     uint32 client_minor_version,
1255                 [out,unique] DATA_BLOB *info,
1256                 [out,ref] uint32 *needed,
1257                 [out,ref] uint32 *server_major_version,
1258                 [out,ref] uint32 *server_minor_version
1259         );
1260
1261         /******************/
1262         /* Function: 0x36 */
1263         [todo] WERROR spoolss_FindFirstPrinterChangeNotification(
1264         );
1265
1266         /******************/
1267         /* Function: 0x37 */
1268         [todo] WERROR spoolss_FindNextPrinterChangeNotification(
1269         );
1270
1271         /******************/
1272         /* Function: 0x38 */
1273         [public] WERROR spoolss_FindClosePrinterNotify(
1274                 [in,ref] policy_handle *handle
1275         );
1276
1277         /******************/
1278         /* Function: 0x39 */
1279         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotificationOld(
1280         );
1281
1282         /******************/
1283         /* Function: 0x3a */
1284         [public] WERROR spoolss_ReplyOpenPrinter(
1285                 [in,string,charset(UTF16)] uint16 server_name[],
1286                 [in] uint32 printer_local,
1287                 [in] winreg_Type type,
1288                 [in,range(0,512)] uint32 bufsize,
1289                 [in,unique,size_is(bufsize)] uint8 *buffer,
1290                 [out,ref] policy_handle *handle
1291         );
1292
1293         /******************/
1294         /* Function: 0x3b */
1295
1296         typedef [bitmap32bit] bitmap {
1297                 PRINTER_CHANGE_ADD_PRINTER                      = 0x00000001,
1298                 PRINTER_CHANGE_SET_PRINTER                      = 0x00000002,
1299                 PRINTER_CHANGE_DELETE_PRINTER                   = 0x00000004,
1300                 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER        = 0x00000008,
1301                 PRINTER_CHANGE_ADD_JOB                          = 0x00000100,
1302                 PRINTER_CHANGE_SET_JOB                          = 0x00000200,
1303                 PRINTER_CHANGE_DELETE_JOB                       = 0x00000400,
1304                 PRINTER_CHANGE_WRITE_JOB                        = 0x00000800,
1305                 PRINTER_CHANGE_ADD_FORM                         = 0x00010000,
1306                 PRINTER_CHANGE_SET_FORM                         = 0x00020000,
1307                 PRINTER_CHANGE_DELETE_FORM                      = 0x00040000,
1308                 PRINTER_CHANGE_ADD_PORT                         = 0x00100000,
1309                 PRINTER_CHANGE_CONFIGURE_PORT                   = 0x00200000,
1310                 PRINTER_CHANGE_DELETE_PORT                      = 0x00400000,
1311                 PRINTER_CHANGE_ADD_PRINT_PROCESSOR              = 0x01000000,
1312                 PRINTER_CHANGE_DELETE_PRINT_PROCESSOR           = 0x04000000,
1313                 PRINTER_CHANGE_ADD_PRINTER_DRIVER               = 0x10000000,
1314                 PRINTER_CHANGE_SET_PRINTER_DRIVER               = 0x20000000,
1315                 PRINTER_CHANGE_DELETE_PRINTER_DRIVER            = 0x40000000,
1316                 PRINTER_CHANGE_TIMEOUT                          = 0x80000000
1317         } spoolss_PrinterChangeFlags;
1318
1319         const int PRINTER_CHANGE_PRINTER                        = (PRINTER_CHANGE_ADD_PRINTER |
1320                                                                    PRINTER_CHANGE_SET_PRINTER |
1321                                                                    PRINTER_CHANGE_DELETE_PRINTER |
1322                                                                    PRINTER_CHANGE_FAILED_CONNECTION_PRINTER); /* 0x000000FF */
1323
1324         const int PRINTER_CHANGE_JOB                            = (PRINTER_CHANGE_ADD_JOB |
1325                                                                    PRINTER_CHANGE_SET_JOB |
1326                                                                    PRINTER_CHANGE_DELETE_JOB |
1327                                                                    PRINTER_CHANGE_WRITE_JOB); /* 0x0000FF00 */
1328
1329         const int PRINTER_CHANGE_FORM                           = (PRINTER_CHANGE_ADD_FORM |
1330                                                                    PRINTER_CHANGE_SET_FORM |
1331                                                                    PRINTER_CHANGE_DELETE_FORM); /* 0x00070000 */
1332
1333         const int PRINTER_CHANGE_PORT                           = (PRINTER_CHANGE_ADD_PORT |
1334                                                                    PRINTER_CHANGE_CONFIGURE_PORT |
1335                                                                    PRINTER_CHANGE_DELETE_PORT); /* 0x00700000 */
1336
1337         const int PRINTER_CHANGE_PRINT_PROCESSOR                = (PRINTER_CHANGE_ADD_PRINT_PROCESSOR |
1338                                                                    PRINTER_CHANGE_DELETE_PRINT_PROCESSOR); /* 0x07000000 */
1339
1340         const int PRINTER_CHANGE_PRINTER_DRIVER                 = (PRINTER_CHANGE_ADD_PRINTER_DRIVER |
1341                                                                    PRINTER_CHANGE_SET_PRINTER_DRIVER |
1342                                                                    PRINTER_CHANGE_DELETE_PRINTER_DRIVER); /* 0x70000000 */
1343
1344         const int PRINTER_CHANGE_ALL                            = (PRINTER_CHANGE_JOB |
1345                                                                    PRINTER_CHANGE_FORM |
1346                                                                    PRINTER_CHANGE_PORT |
1347                                                                    PRINTER_CHANGE_PRINT_PROCESSOR |
1348                                                                    PRINTER_CHANGE_PRINTER_DRIVER); /* 0x7777FFFF */
1349         WERROR spoolss_RouterReplyPrinter(
1350                 [in,ref] policy_handle *handle,
1351                 [in] spoolss_PrinterChangeFlags flags,
1352                 [in,range(0,512)] uint32 bufsize,
1353                 [in,unique,size_is(bufsize)] uint8 *buffer
1354         );
1355
1356         /******************/
1357         /* Function: 0x3c */
1358         [public] WERROR spoolss_ReplyClosePrinter(
1359                 [in,out,ref] policy_handle *handle
1360         );
1361
1362         /******************/
1363         /* Function: 0x3d */
1364         [todo] WERROR spoolss_AddPortEx(
1365         );
1366
1367         /******************/
1368         /* Function: 0x3e */
1369         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotification(
1370         );
1371
1372         /******************/
1373         /* Function: 0x3f */
1374         [todo] WERROR spoolss_SpoolerInit(
1375         );
1376
1377         /******************/
1378         /* Function: 0x40 */
1379         [todo] WERROR spoolss_ResetPrinterEx(
1380         );
1381
1382         typedef [enum16bit] enum {
1383                 SPOOLSS_FIELD_SERVER_NAME               =  0,
1384                 SPOOLSS_FIELD_PRINTER_NAME              =  1,
1385                 SPOOLSS_FIELD_SHARE_NAME        =  2,
1386                 SPOOLSS_FIELD_PORT_NAME                 =  3,
1387                 SPOOLSS_FIELD_DRIVER_NAME               =  4,
1388                 SPOOLSS_FIELD_COMMENT                   =  5,
1389                 SPOOLSS_FIELD_LOCATION                  =  6,
1390                 SPOOLSS_FIELD_DEVMODE                   =  7,
1391                 SPOOLSS_FIELD_SEPFILE                   =  8,
1392                 SPOOLSS_FIELD_PRINT_PROCESSOR   =  9,
1393                 SPOOLSS_FIELD_PARAMETERS                = 10,
1394                 SPOOLSS_FIELD_DATATYPE                  = 11,
1395                 SPOOLSS_FIELD_SECURITY_DESCRIPTOR=12,
1396                 SPOOLSS_FIELD_ATTRIBUTES                = 13,
1397                 SPOOLSS_FIELD_PRIORITY                  = 14,
1398                 SPOOLSS_FIELD_DEFAULT_PRIORITY  = 15,
1399                 SPOOLSS_FIELD_START_TIME                = 16,
1400                 SPOOLSS_FIELD_UNTIL_TIME                = 17,
1401                 SPOOLSS_FIELD_STATUS                    = 18,
1402                 SPOOLSS_FIELD_STATUS_STRING             = 19,
1403                 SPOOLSS_FIELD_CJOBS                             = 20,
1404                 SPOOLSS_FIELD_AVERAGE_PPM               = 21,
1405                 SPOOLSS_FIELD_TOTAL_PAGES               = 22,
1406                 SPOOLSS_FIELD_PAGES_PRINTED     = 23,
1407                 SPOOLSS_FIELD_TOTAL_BYTES               = 24,
1408                 SPOOLSS_FIELD_BYTES_PRINTED             = 25
1409         } spoolss_Field;
1410
1411         typedef [enum16bit] enum {
1412                 SPOOLSS_NOTIFY_PRINTER                  = 0,
1413                 SPOOLSS_NOTIFY_JOB                              = 1
1414         } spoolss_NotifyType;
1415
1416         /******************/
1417         /* Function: 0x41 */
1418         typedef struct {
1419                 spoolss_NotifyType type;
1420                 uint16 u1;
1421                 uint32 u2;
1422                 uint32 u3;
1423                 uint32 count;
1424                 [size_is(count)] spoolss_Field *fields;
1425         } spoolss_NotifyOptionsArray;
1426
1427         typedef struct {
1428                 uint32 version;
1429                 uint32 flags;
1430                 uint32 count;
1431                 [size_is(count)] spoolss_NotifyOptionsArray *options;
1432         } spoolss_NotifyOptionsContainer;
1433
1434         [public] WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
1435                 [in,ref] policy_handle *handle,
1436                 [in] uint32 flags,
1437                 [in] uint32 options,
1438                 [in,unique] [string,charset(UTF16)] uint16 *str,
1439                 [in] uint32 printer_local,
1440                 [in,unique] spoolss_NotifyOptionsContainer *t1
1441         );
1442
1443         /******************/
1444         /* Function: 0x42 */
1445         [todo] WERROR spoolss_RouterRefreshPrinterChangeNotification(
1446         );
1447
1448         typedef struct {
1449                 uint32 size;
1450                 [size_is(size/2),unique,charset(UTF16)] uint16 *string;
1451         } spoolss_NotifyUTF16String;
1452
1453         typedef struct {
1454                 uint32 size;
1455                 [size_is(size),charset(DOS)] uint8 *string;
1456         } spoolss_NotifyDOSString;
1457
1458         typedef struct {
1459                 uint16 data[8];
1460         } spoolss_NotifyBlobData;
1461
1462         typedef struct {
1463                 uint32 len;
1464                 [unique] spoolss_NotifyBlobData *data;
1465         } spoolss_NotifyBlob;
1466
1467         typedef [switch_type(uint32)] union {
1468                 [case(1)] dlong integer;
1469                 [case(2)] spoolss_NotifyUTF16String utf16_string;
1470                 [case(3)] spoolss_NotifyDOSString ascii_string;
1471                 [case(4)] spoolss_NotifyBlob blob;
1472                 [case(5)] spoolss_NotifyDOSString ascii_string;
1473         } spoolss_NotifyData;
1474
1475         typedef struct {
1476                 spoolss_NotifyType type;
1477                 spoolss_Field field;
1478                 uint32 variable_type;
1479                 uint32 job_id;
1480                 [switch_is(variable_type)] spoolss_NotifyData data;
1481         } spoolss_Notify;
1482
1483         typedef struct {
1484                 uint32 version;
1485                 uint32 flags;
1486                 uint32 count;
1487                 [size_is(count)] spoolss_Notify notifies[];
1488         } spoolss_NotifyInfo;
1489
1490         /******************/
1491         /* Function: 0x43 */
1492         [public] WERROR spoolss_RemoteFindNextPrinterChangeNotifyEx(
1493                 [in,ref] policy_handle *handle,
1494                 [in] uint32 change_low,
1495                 [in,unique] spoolss_NotifyOptionsContainer *container,
1496                 [out,ref] spoolss_NotifyInfo **info
1497         );
1498
1499         /******************/
1500         /* Function: 0x44 */
1501         [todo] WERROR spoolss_44(
1502         );
1503
1504         typedef struct {
1505                 uint32 size;
1506                 [string,charset(UTF16)] uint16 *client;
1507                 [string,charset(UTF16)] uint16 *user;
1508                 uint32 build;
1509                 uint32 major;
1510                 uint32 minor;
1511                 uint32 processor;
1512         } spoolss_UserLevel1;
1513
1514         typedef union {
1515                 [case(1)]  spoolss_UserLevel1 *level1;
1516         } spoolss_UserLevel;
1517
1518         typedef bitmap {
1519                 SERVER_ACCESS_ADMINISTER        = 0x00000001,
1520                 SERVER_ACCESS_ENUMERATE         = 0x00000002,
1521                 PRINTER_ACCESS_ADMINISTER       = 0x00000004,
1522                 PRINTER_ACCESS_USE              = 0x00000008,
1523                 JOB_ACCESS_ADMINISTER           = 0x00000010
1524         } spoolss_AccessRights;
1525
1526         /* Access rights for print servers */
1527         const int SERVER_ALL_ACCESS     = SEC_STD_REQUIRED |
1528                                           SERVER_ACCESS_ADMINISTER |
1529                                           SERVER_ACCESS_ENUMERATE;
1530
1531         const int SERVER_READ           = SEC_STD_READ_CONTROL |
1532                                           SERVER_ACCESS_ENUMERATE;
1533
1534         const int SERVER_WRITE          = STANDARD_RIGHTS_WRITE_ACCESS |
1535                                           SERVER_ACCESS_ADMINISTER |
1536                                           SERVER_ACCESS_ENUMERATE;
1537
1538         const int SERVER_EXECUTE        = SEC_STD_READ_CONTROL |
1539                                           SERVER_ACCESS_ENUMERATE;
1540
1541         /* Access rights for printers */
1542         const int PRINTER_ALL_ACCESS    = SEC_STD_REQUIRED |
1543                                           PRINTER_ACCESS_ADMINISTER |
1544                                           PRINTER_ACCESS_USE;
1545
1546         const int PRINTER_READ          = SEC_STD_READ_CONTROL |
1547                                           PRINTER_ACCESS_USE;
1548
1549         const int PRINTER_WRITE         = STANDARD_RIGHTS_WRITE_ACCESS |
1550                                           PRINTER_ACCESS_USE;
1551
1552         const int PRINTER_EXECUTE       = SEC_STD_READ_CONTROL |
1553                                           PRINTER_ACCESS_USE;
1554
1555         /* Access rights for jobs */
1556         const int JOB_ALL_ACCESS        = SEC_STD_REQUIRED |
1557                                           JOB_ACCESS_ADMINISTER;
1558
1559         const int JOB_READ              = SEC_STD_READ_CONTROL |
1560                                           JOB_ACCESS_ADMINISTER;
1561
1562         const int JOB_WRITE             = STANDARD_RIGHTS_WRITE_ACCESS |
1563                                           JOB_ACCESS_ADMINISTER;
1564
1565         const int JOB_EXECUTE           = SEC_STD_READ_CONTROL |
1566                                           JOB_ACCESS_ADMINISTER;
1567
1568         /* ACE masks for various print permissions */
1569         const int PRINTER_ACE_FULL_CONTROL = SEC_GENERIC_ALL |
1570                                                 PRINTER_ALL_ACCESS;
1571
1572         const int PRINTER_ACE_MANAGE_DOCUMENTS = SEC_GENERIC_ALL |
1573                                                 READ_CONTROL_ACCESS;
1574
1575         const int PRINTER_ACE_PRINT     = GENERIC_EXECUTE_ACCESS |
1576                                           READ_CONTROL_ACCESS |
1577                                           PRINTER_ACCESS_USE;
1578
1579         /******************/
1580         /* Function: 0x45 */
1581         [public] WERROR spoolss_OpenPrinterEx(
1582                 [in,unique]           [string,charset(UTF16)] uint16 *printername,
1583                 [in,unique]           [string,charset(UTF16)] uint16 *datatype,
1584                 [in]                  spoolss_DevmodeContainer devmode_ctr,
1585                 [in]                  uint32 access_mask,
1586                 [in]                  uint32 level,
1587                 [in,switch_is(level)] spoolss_UserLevel userlevel,
1588                 [out,ref]             policy_handle *handle
1589         );
1590
1591         /******************/
1592         /* Function: 0x46 */
1593         WERROR spoolss_AddPrinterEx(
1594                 [in,unique] [string,charset(UTF16)] uint16 *server,
1595                 [in] uint32 level,
1596                 [in,unique,switch_is(level)] spoolss_PrinterInfo *info,
1597                 [in] spoolss_DevmodeContainer devmode_ctr,
1598                 [in,unique] security_descriptor *secdesc,
1599                 [in] uint32 ulevel,
1600                 [in,switch_is(ulevel)] spoolss_UserLevel userlevel
1601         );
1602
1603         /******************/
1604         /* Function: 0x47 */
1605         [todo] WERROR spoolss_47(
1606         );
1607
1608         /******************/
1609         /* Function: 0x48 */
1610         WERROR spoolss_EnumPrinterData(
1611                 [in,ref] policy_handle *handle,
1612                 [in]     uint32 enum_index,
1613                 [out,size_is(value_offered/2),charset(UTF16)] uint16 value_name[],
1614                 [in]     uint32 value_offered,
1615                 [out,ref] uint32 *value_needed,
1616                 [out,ref] uint32 *printerdata_type,
1617                 [out,ref] DATA_BLOB *buffer,
1618                 [in]     uint32 data_offered,
1619                 [out,ref] uint32 *data_needed
1620         );
1621
1622         /******************/
1623         /* Function: 0x49 */
1624         WERROR spoolss_DeletePrinterData(
1625                 [in,ref] policy_handle *handle,
1626                 [in] [string,charset(UTF16)] uint16 value_name[]
1627         );
1628
1629         /******************/
1630         /* Function: 0x4a */
1631         [todo] WERROR spoolss_4a(
1632         );
1633
1634         /******************/
1635         /* Function: 0x4b */
1636         [todo] WERROR spoolss_4b(
1637         );
1638
1639         /******************/
1640         /* Function: 0x4c */
1641         [todo] WERROR spoolss_4c(
1642         );
1643
1644         /******************/
1645         /* Function: 0x4d */
1646         WERROR spoolss_SetPrinterDataEx(
1647                 [in,ref] policy_handle *handle,
1648                 [in]     [string,charset(UTF16)] uint16 key_name[],
1649                 [in]     [string,charset(UTF16)] uint16 value_name[],
1650                 [in]     uint32 type,
1651                 [in]     DATA_BLOB buffer,
1652                 [in]     uint32 offered
1653         );
1654
1655         /******************/
1656         /* Function: 0x4e */
1657         WERROR spoolss_GetPrinterDataEx(
1658                 [in,ref] policy_handle *handle,
1659                 [in]     [string,charset(UTF16)] uint16 key_name[],
1660                 [in]     [string,charset(UTF16)] uint16 value_name[],
1661                 [out,ref] uint32 *type,
1662                 [out,ref] [size_is(offered)] uint8 *buffer,
1663                 [in]     uint32 offered,
1664                 [out,ref] uint32 *needed
1665         );
1666
1667         /******************/
1668         /* Function: 0x4f */
1669         [public] WERROR spoolss_EnumPrinterDataEx(
1670                 [in,ref] policy_handle *handle,
1671                 [in]     [string,charset(UTF16)] uint16 key_name[],
1672                 [out,ref] [size_is(offered)] uint8 *buffer,
1673                 [in]     uint32 offered,
1674                 [out,ref] uint32 *needed,
1675                 [out,ref] uint32 *count
1676         );
1677
1678         /******************/
1679         /* Function: 0x50 */
1680         [public] WERROR spoolss_EnumPrinterKey(
1681                 [in, ref] policy_handle *handle,
1682                 [in] [string,charset(UTF16)] uint16 key_name[],
1683                 [out,ref] [size_is(key_buffer_size/2)] uint16 *key_buffer,
1684                 [in] uint32 key_buffer_size,
1685                 [out,ref] uint32 *needed
1686         );
1687
1688         /******************/
1689         /* Function: 0x51 */
1690         WERROR spoolss_DeletePrinterDataEx(
1691                 [in,ref] policy_handle *handle,
1692                 [in] [string,charset(UTF16)] uint16 key_name[],
1693                 [in] [string,charset(UTF16)] uint16 value_name[]
1694         );
1695
1696         /******************/
1697         /* Function: 0x52 */
1698         WERROR spoolss_DeletePrinterKey(
1699                 [in,ref] policy_handle *handle,
1700                 [in] [string,charset(UTF16)] uint16 key_name[]
1701         );
1702
1703         /******************/
1704         /* Function: 0x53 */
1705         [todo] WERROR spoolss_53(
1706         );
1707
1708         /******************/
1709         /* Function: 0x54 */
1710         typedef [public,bitmap32bit] bitmap {
1711                 DPD_DELETE_UNUSED_FILES         = 0x00000001,
1712                 DPD_DELETE_SPECIFIC_VERSION     = 0x00000002,
1713                 DPD_DELETE_ALL_FILES            = 0x00000004
1714         } spoolss_DeleteDriverFlags;
1715
1716         WERROR spoolss_DeletePrinterDriverEx(
1717                 [in,unique] [string,charset(UTF16)] uint16 *server,
1718                 [in] [string,charset(UTF16)] uint16 architecture[],
1719                 [in] [string,charset(UTF16)] uint16 driver[],
1720                 [in] spoolss_DeleteDriverFlags delete_flags,
1721                 [in] uint32 version
1722         );
1723
1724         /******************/
1725         /* Function: 0x55 */
1726         [todo] WERROR spoolss_55(
1727         );
1728
1729         /******************/
1730         /* Function: 0x56 */
1731         [todo] WERROR spoolss_56(
1732         );
1733
1734         /******************/
1735         /* Function: 0x57 */
1736         [todo] WERROR spoolss_57(
1737         );
1738
1739         /******************/
1740         /* Function: 0x58 */
1741         WERROR spoolss_XcvData(
1742                 [in,ref] policy_handle *handle,
1743                 [in] [string,charset(UTF16)] uint16 function_name[],
1744                 [in] DATA_BLOB in_data,
1745                 [in,value(r->in.in_data.length)] uint32 _in_data_length,
1746                 [out,ref] [size_is(out_data_size)] uint8 *out_data,
1747                 [in] uint32 out_data_size,
1748                 [out,ref] uint32 *needed,
1749                 [in,out,ref] uint32 *status_code
1750         );
1751
1752         /******************/
1753         /* Function: 0x59 */
1754         [public,todo] WERROR spoolss_AddPrinterDriverEx(
1755         );
1756
1757         /******************/
1758         /* Function: 0x5a */
1759         [todo] WERROR spoolss_5a(
1760         );
1761
1762         /******************/
1763         /* Function: 0x5b */
1764         [todo] WERROR spoolss_5b(
1765         );
1766
1767         /******************/
1768         /* Function: 0x5c */
1769         [todo] WERROR spoolss_5c(
1770         );
1771
1772         /******************/
1773         /* Function: 0x5d */
1774         [todo] WERROR spoolss_5d(
1775         );
1776
1777         /******************/
1778         /* Function: 0x5e */
1779         [todo] WERROR spoolss_5e(
1780         );
1781
1782         /******************/
1783         /* Function: 0x5f */
1784         [todo] WERROR spoolss_5f(
1785         );
1786 }