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