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