spoolss: add more spoolss calls to IDL
[metze/samba/wip.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 [public,gensize] 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 [enum16bit] enum {
183                 DMSPEC_NT3              = 0x320,
184                 DMSPEC_WIN95_98_ME      = 0x400,
185                 DMSPEC_NT4_AND_ABOVE    = 0x401
186         } spoolss_DeviceModeSpecVersion;
187
188         typedef [enum16bit] enum {
189                 DMORIENT_PORTRAIT       = 0x0001,
190                 DMORIENT_LANDSCAPE      = 0x0002
191         } spoolss_DeviceModeOrientation;
192
193         typedef [enum16bit] enum {
194                 DMPAPER_LETTER                  = 0x0001, /* Letter, 8 1/2 x 11 inches */
195                 DMPAPER_LETTERSMALL             = 0x0002, /* Letter Small, 8 1/2 x 11 inches */
196                 DMPAPER_TABLOID                 = 0x0003, /* Tabloid, 11 x 17 inches */
197                 DMPAPER_LEDGER                  = 0x0004, /* Ledger, 17 x 11 inches */
198                 DMPAPER_LEGAL                   = 0x0005, /* Legal, 8 1/2 x 14 inches */
199                 DMPAPER_STATEMENT               = 0x0006, /* Statement, 5 1/2 x 8 1/2 inches */
200                 DMPAPER_EXECUTIVE               = 0x0007, /* Executive, 7 1/4 x 10 1/2 inches */
201                 DMPAPER_A3                      = 0x0008, /* A3 sheet, 297 x 420 millimeters */
202                 DMPAPER_A4                      = 0x0009, /* A4 sheet, 210 x 297 millimeters */
203                 DMPAPER_A4SMALL                 = 0x000A, /* A4 small sheet, 210 x 297 millimeters */
204                 DMPAPER_A5                      = 0x000B, /* A5 sheet, 148 x 210 millimeters */
205                 DMPAPER_B4                      = 0x000C, /* B4 sheet, 250 x 354 millimeters */
206                 DMPAPER_B5                      = 0x000D, /* B5 sheet, 182 x 257-millimeter paper */
207                 DMPAPER_FOLIO                   = 0x000E, /* Folio, 8 1/2 x 13-inch paper */
208                 DMPAPER_QUARTO                  = 0x000F, /* Quarto, 215 x 275 millimeter paper */
209                 DMPAPER_10X14                   = 0x0010, /* 10 x 14-inch sheet */
210                 DMPAPER_11X17                   = 0x0011, /* 11 x 17-inch sheet */
211                 DMPAPER_NOTE                    = 0x0012, /* Note, 8 1/2 x 11-inches */
212                 DMPAPER_ENV_9                   = 0x0013, /* #9 Envelope, 3 7/8 x 8 7/8 inches */
213                 DMPAPER_ENV_10                  = 0x0014, /* #10 Envelope, 4 1/8 x 9 1/2 inches */
214                 DMPAPER_ENV_11                  = 0x0015, /* #11 Envelope, 4 1/2 x 10 3/8 inches */
215                 DMPAPER_ENV_12                  = 0x0016, /* #12 Envelope, 4 3/4 x 11 inches */
216                 DMPAPER_ENV_14                  = 0x0017, /* #14 Envelope, 5 x 11 1/2 inches */
217                 DMPAPER_CSHEET                  = 0x0018, /* C Sheet, 17 x 22 inches */
218                 DMPAPER_DSHEET                  = 0x0019, /* D Sheet, 22 x 34 inches */
219                 DMPAPER_ESHEET                  = 0x001A, /* E Sheet, 34 x 44 inches */
220                 DMPAPER_ENV_DL                  = 0x001B, /* DL Envelope, 110 x 220 millimeters */
221                 DMPAPER_ENV_C5                  = 0x001C, /* C5 Envelope, 162 x 229 millimeters */
222                 DMPAPER_ENV_C3                  = 0x001D, /* C3 Envelope, 324 x 458 millimeters */
223                 DMPAPER_ENV_C4                  = 0x001E, /* C4 Envelope, 229 x 324 millimeters */
224                 DMPAPER_ENV_C6                  = 0x001F, /* C6 Envelope, 114 x 162 millimeters */
225                 DMPAPER_ENV_C65                 = 0x0020, /* C65 Envelope, 114 x 229 millimeters */
226                 DMPAPER_ENV_B4                  = 0x0021, /* B4 Envelope, 250 x 353 millimeters */
227                 DMPAPER_ENV_B5                  = 0x0022, /* B5 Envelope, 176 x 250 millimeters */
228                 DMPAPER_ENV_B6                  = 0x0023, /* B6 Envelope, 176 x 125 millimeters */
229                 DMPAPER_ENV_ITALY               = 0x0024, /* Italy Envelope, 110 x 230 millimeters */
230                 DMPAPER_ENV_MONARCH             = 0x0025, /* Monarch Envelope, 3 7/8 x 7 1/2 inches */
231                 DMPAPER_ENV_PERSONAL            = 0x0026, /* 6 3/4 Envelope, 3 5/8 x 6 1/2 inches */
232                 DMPAPER_FANFOLD_US              = 0x0027, /* US Std Fanfold, 14 7/8 x 11 inches */
233                 DMPAPER_FANFOLD_STD_GERMAN      = 0x0028, /* German Std Fanfold, 8 1/2 x 12 inches */
234                 DMPAPER_FANFOLD_LGL_GERMAN      = 0x0029, /* German Legal Fanfold, 8 x 13 inches */
235                 DMPAPER_DBL_JAPANESE_POSTCARD   = 0x0045, /* Double Japanese Postcard, 200 x 148 millimeters */
236                 DMPAPER_A6                      = 0x0046, /* A6 sheet, 105 x 148 millimeters */
237                 DMPAPER_JENV_KAKU2              = 0x0047, /* Japanese Envelope Kaku #2 */
238                 DMPAPER_JENV_KAKU3              = 0x0048, /* Japanese Envelope Kaku #3 */
239                 DMPAPER_JENV_CHOU3              = 0x0049, /* Japanese Envelope Chou #3 */
240                 DMPAPER_JENV_CHOU4              = 0x004A, /* Japanese Envelope Chou #4 */
241                 DMPAPER_LETTER_ROTATED          = 0x004B, /* Letter Rotated, 11 by 8 1/2 inches */
242                 DMPAPER_A3_ROTATED              = 0x004C, /* A3 rotated sheet, 420 x 297 millimeters */
243                 DMPAPER_A4_ROTATED              = 0x004D, /* A4 rotated sheet, 297 x 210 millimeters */
244                 DMPAPER_A5_ROTATED              = 0x004E, /* A5 rotated sheet, 210 x 148 millimeters */
245                 DMPAPER_B4_JIS_ROTATED          = 0x004F, /* B4 (JIS) rotated sheet, 364 x 257 millimeters */
246                 DMPAPER_B5_JIS_ROTATED          = 0x0050, /* B5 (JIS) rotated sheet, 257 x 182 millimeters */
247                 DMPAPER_JAPANESE_POSTCARD_ROTATED = 0x0051, /* Japanese Postcard Rotated, 148 x 100 millimeters */
248                 DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED = 0x0052, /* Double Japanese Postcard Rotated, 148 x 200 millimeters */
249                 DMPAPER_A6_ROTATED              = 0x0053, /* A6 rotated sheet, 148 x 105 millimeters */
250                 DMPAPER_JENV_KAKU2_ROTATED      = 0x0054, /* Japanese Envelope Kaku #2 Rotated */
251                 DMPAPER_JENV_KAKU3_ROTATED      = 0x0055, /* Japanese Envelope Kaku #3 Rotated */
252                 DMPAPER_JENV_CHOU3_ROTATED      = 0x0056, /* Japanese Envelope Chou #3 Rotated */
253                 DMPAPER_JENV_CHOU4_ROTATED      = 0x0057, /* Japanese Envelope Chou #4 Rotated */
254                 DMPAPER_B6_JIS                  = 0x0058, /* B6 (JIS) sheet, 128 x 182 millimeters */
255                 DMPAPER_B6_JIS_ROTATED          = 0x0059, /* B6 (JIS) rotated sheet, 182 x 128 millimeters */
256                 DMPAPER_12X11                   = 0x005A, /* 12 x 11-inch sheet */
257                 DMPAPER_JENV_YOU4               = 0x005B, /* Japanese Envelope You #4 */
258                 DMPAPER_JENV_YOU4_ROTATED       = 0x005C, /* Japanese Envelope You #4 */
259                 DMPAPER_P16K                    = 0x005D, /* PRC 16K, 146 x 215 millimeters */
260                 DMPAPER_P32K                    = 0x005E, /* PRC 32K, 97 x 151 millimeters */
261                 DMPAPER_P32KBIG                 = 0x005F, /* PRC 32K(Big) 97 x 151 millimeters */
262                 DMPAPER_PENV_1                  = 0x0060, /* PRC Envelope #1, 102 by 165 millimeters */
263                 DMPAPER_PENV_2                  = 0x0061, /* PRC Envelope #2, 102 x 176 millimeters */
264                 DMPAPER_PENV_3                  = 0x0062, /* PRC Envelope #3, 125 x 176 millimeters */
265                 DMPAPER_PENV_4                  = 0x0063, /* PRC Envelope #4, 110 x 208 millimeters */
266                 DMPAPER_PENV_5                  = 0x0064, /* PRC Envelope #5, 110 x 220 millimeters */
267                 DMPAPER_PENV_6                  = 0x0065, /* PRC Envelope #6, 120 x 230 millimeters */
268                 DMPAPER_PENV_7                  = 0x0066, /* PRC Envelope #7, 160 x 230 millimeters */
269                 DMPAPER_PENV_8                  = 0x0067, /* PRC Envelope #8, 120 x 309 millimeters */
270                 DMPAPER_PENV_9                  = 0x0068, /* PRC Envelope #9, 229 x 324 millimeters */
271                 DMPAPER_PENV_10                 = 0x0069, /* PRC Envelope #10, 324 x 458 millimeters */
272                 DMPAPER_P16K_ROTATED            = 0x006A, /* PRC 16K Rotated, 215 x 146 millimeters */
273                 DMPAPER_P32K_ROTATED            = 0x006B, /* PRC 32K Rotated, 151 x 97 millimeters */
274                 DMPAPER_P32KBIG_ROTATED         = 0x006C, /* PRC 32K(Big) Rotated, 151 x 97 millimeters */
275                 DMPAPER_PENV_1_ROTATED          = 0x006D, /* PRC Envelope #1 Rotated, 165 x 102 millimeters */
276                 DMPAPER_PENV_2_ROTATED          = 0x006E, /* PRC Envelope #2 Rotated, 176 x 102 millimeters */
277                 DMPAPER_PENV_3_ROTATED          = 0x006F, /* PRC Envelope #3 Rotated, 176 x 125 millimeters */
278                 DMPAPER_PENV_4_ROTATED          = 0x0070, /* PRC Envelope #4 Rotated, 208 x 110 millimeters */
279                 DMPAPER_PENV_5_ROTATED          = 0x0071, /* PRC Envelope #5 Rotated, 220 x 110 millimeters */
280                 DMPAPER_PENV_6_ROTATED          = 0x0072, /* PRC Envelope #6 Rotated, 230 x 120 millimeters */
281                 DMPAPER_PENV_7_ROTATED          = 0x0073, /* PRC Envelope #7 Rotated, 230 x 160 millimeters */
282                 DMPAPER_PENV_8_ROTATED          = 0x0074, /* PRC Envelope #8 Rotated, 309 x 120 millimeters */
283                 DMPAPER_PENV_9_ROTATED          = 0x0075, /* PRC Envelope #9 Rotated, 324 x 229 millimeters */
284                 DMPAPER_PENV_10_ROTATED         = 0x0076 /* PRC Envelope #10 Rotated, 458 x 324 millimeters */
285         } spoolss_DeviceModePaperSize;
286
287         typedef [enum16bit] enum {
288                 DMBIN_UPPER             = 0x0001,
289                 DMBIN_LOWER             = 0x0002,
290                 DMBIN_MIDDLE            = 0x0003,
291                 DMBIN_MANUAL            = 0x0004,
292                 DMBIN_ENVELOPE          = 0x0005,
293                 DMBIN_ENVMANUAL         = 0x0006,
294                 DMBIN_AUTO              = 0x0007,
295                 DMBIN_TRACTOR           = 0x0008,
296                 DMBIN_SMALLFMT          = 0x0009,
297                 DMBIN_LARGEFMT          = 0x000a,
298                 DMBIN_LARGECAPACITY     = 0x000b,
299                 DMBIN_CASSETTE          = 0x000e,
300                 DMBIN_FORMSOURCE        = 0x000f
301         } spoolss_DeviceModeDefaultSource;
302
303         typedef [enum16bit] enum {
304                 DMRES_HIGH              = 0xfffc,
305                 DMRES_MEDIUM            = 0xfffd,
306                 DMRES_LOW               = 0xfffe,
307                 DMRES_DRAFT             = 0xffff
308         } spoolss_DeviceModePrintQuality;
309
310         typedef [enum16bit] enum {
311                 DMRES_MONOCHROME         = 0x0001,
312                 DMRES_COLOR              = 0x0002
313         } spoolss_DeviceModeColor;
314
315         typedef [enum16bit] enum {
316                 DMDUP_SIMPLEX           = 0x0001,
317                 DMDUP_VERTICAL          = 0x0002,
318                 DMDUP_HORIZONTAL        = 0x0003
319         } spoolss_DeviceModeDuplex;
320
321         typedef [enum16bit] enum {
322                 DMTT_BITMAP             = 0x0001,
323                 DMTT_DOWNLOAD           = 0x0002,
324                 DMTT_SUBDEV             = 0x0003,
325                 DMTT_DOWNLOAD_OUTLINE   = 0x0004
326         } spoolss_DeviceModeTTOption;
327
328         typedef [enum16bit] enum {
329                 DMCOLLATE_FALSE         = 0x0000,
330                 DMCOLLATE_TRUE          = 0x0001
331         } spoolss_DeviceModeCollate;
332
333         typedef [v1_enum] enum {
334                 DMNUP_SYSTEM            = 0x00000001,
335                 DMNUP_ONEUP             = 0x00000002
336         } spoolss_DeviceModeNUp;
337
338         typedef [v1_enum] enum {
339                 DMICMMETHOD_NONE        = 0x00000001,
340                 DMICMMETHOD_SYSTEM      = 0x00000002,
341                 DMICMMETHOD_DRIVER      = 0x00000003,
342                 DMICMMETHOD_DEVICE      = 0x00000004
343         } spoolss_DeviceModeICMMethod;
344
345         typedef [v1_enum] enum {
346                 DMICM_SATURATE          = 0x00000001,
347                 DMICM_CONTRAST          = 0x00000002,
348                 DMICM_COLORIMETRIC      = 0x00000003,
349                 DMICM_ABS_COLORIMETRIC  = 0x00000004
350         } spoolss_DeviceModeICMIntent;
351
352         typedef [v1_enum] enum {
353                 DMMEDIA_STANDARD        = 0x00000001,
354                 DMMEDIA_TRANSPARENCY    = 0x00000002,
355                 DMMEDIA_GLOSSY          = 0x00000003
356         } spoolss_DeviceModeMediaType;
357
358         typedef [v1_enum] enum {
359                 DMDITHER_NONE           = 0x00000001,
360                 DMDITHER_COARSE         = 0x00000002,
361                 DMDITHER_FINE           = 0x00000003,
362                 DMDITHER_LINEART        = 0x00000004,
363                 DMDITHER_ERRORDIFFUSION = 0x00000005,
364                 DMDITHER_RESERVED6      = 0x00000006,
365                 DMDITHER_RESERVED7      = 0x00000007,
366                 DMDITHER_RESERVED8      = 0x00000008,
367                 DMDITHER_RESERVED9      = 0x00000009,
368                 DMDITHER_GRAYSCALE      = 0x0000000A
369         } spoolss_DeviceModeDitherType;
370
371         typedef [public,gensize] struct {
372                 [charset(UTF16)] uint16 devicename[32];
373                 spoolss_DeviceModeSpecVersion specversion;
374                 uint16 driverversion;
375                 uint16 size;
376                 [value(r->driverextra_data.length)] uint16 __driverextra_length;
377                 spoolss_DeviceModeFields fields;
378                 spoolss_DeviceModeOrientation orientation;
379                 spoolss_DeviceModePaperSize papersize;
380                 uint16 paperlength;
381                 uint16 paperwidth;
382                 uint16 scale;
383                 uint16 copies;
384                 spoolss_DeviceModeDefaultSource defaultsource;
385                 spoolss_DeviceModePrintQuality printquality;
386                 spoolss_DeviceModeColor color;
387                 spoolss_DeviceModeDuplex duplex;
388                 uint16 yresolution;
389                 spoolss_DeviceModeTTOption ttoption;
390                 spoolss_DeviceModeCollate collate;
391                 [charset(UTF16)] uint16 formname[32];
392                 uint16 logpixels; /* reserved */
393                 uint32 bitsperpel; /* reserved */
394                 uint32 pelswidth; /* reserved */
395                 uint32 pelsheight; /* reserved */
396                 spoolss_DeviceModeNUp displayflags;
397                 uint32 displayfrequency; /* reserved */
398                 spoolss_DeviceModeICMMethod icmmethod;
399                 spoolss_DeviceModeICMIntent icmintent;
400                 spoolss_DeviceModeMediaType mediatype;
401                 spoolss_DeviceModeDitherType dithertype;
402                 uint32 reserved1;
403                 uint32 reserved2;
404                 uint32 panningwidth; /* reserved */
405                 uint32 panningheight; /* reserved */
406                 [subcontext_size(__driverextra_length),subcontext(0),flag(NDR_REMAINING)] DATA_BLOB driverextra_data;
407         } spoolss_DeviceMode;
408
409         typedef [public] bitmap {
410                 PRINTER_ENUM_DEFAULT     = 0x00000001,
411                 PRINTER_ENUM_LOCAL       = 0x00000002,
412                 PRINTER_ENUM_CONNECTIONS = 0x00000004,
413                 PRINTER_ENUM_FAVORITE    = 0x00000004,
414                 PRINTER_ENUM_NAME        = 0x00000008,
415                 PRINTER_ENUM_REMOTE      = 0x00000010,
416                 PRINTER_ENUM_SHARED      = 0x00000020,
417                 PRINTER_ENUM_NETWORK     = 0x00000040,
418                 PRINTER_ENUM_EXPAND      = 0x00004000,
419                 PRINTER_ENUM_CONTAINER   = 0x00008000,
420                 PRINTER_ENUM_ICON1       = 0x00010000,
421                 PRINTER_ENUM_ICON2       = 0x00020000,
422                 PRINTER_ENUM_ICON3       = 0x00040000,
423                 PRINTER_ENUM_ICON4       = 0x00080000,
424                 PRINTER_ENUM_ICON5       = 0x00100000,
425                 PRINTER_ENUM_ICON6       = 0x00200000,
426                 PRINTER_ENUM_ICON7       = 0x00400000,
427                 PRINTER_ENUM_ICON8       = 0x00800000,
428                 PRINTER_ENUM_HIDE        = 0x01000000
429         } spoolss_EnumPrinterFlags;
430
431         const int PRINTER_ENUM_ICONMASK = (PRINTER_ENUM_ICON1 |
432                                            PRINTER_ENUM_ICON2 |
433                                            PRINTER_ENUM_ICON3 |
434                                            PRINTER_ENUM_ICON4 |
435                                            PRINTER_ENUM_ICON5 |
436                                            PRINTER_ENUM_ICON6 |
437                                            PRINTER_ENUM_ICON7 |
438                                            PRINTER_ENUM_ICON8); /* 0x00ff0000 */
439
440         typedef bitmap {
441                 PRINTER_ATTRIBUTE_QUEUED                = 0x00000001,
442                 PRINTER_ATTRIBUTE_DIRECT                = 0x00000002,
443                 PRINTER_ATTRIBUTE_DEFAULT               = 0x00000004,
444                 PRINTER_ATTRIBUTE_SHARED                = 0x00000008,
445                 PRINTER_ATTRIBUTE_NETWORK               = 0x00000010,
446                 PRINTER_ATTRIBUTE_HIDDEN                = 0x00000020,
447                 PRINTER_ATTRIBUTE_LOCAL                 = 0x00000040,
448                 PRINTER_ATTRIBUTE_ENABLE_DEVQ           = 0x00000080,
449                 PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS       = 0x00000100,
450                 PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST     = 0x00000200,
451                 PRINTER_ATTRIBUTE_WORK_OFFLINE          = 0x00000400,
452                 PRINTER_ATTRIBUTE_ENABLE_BIDI           = 0x00000800,
453                 PRINTER_ATTRIBUTE_RAW_ONLY              = 0x00001000,
454                 PRINTER_ATTRIBUTE_PUBLISHED             = 0x00002000,
455                 PRINTER_ATTRIBUTE_FAX                   = 0x00004000,
456                 PRINTER_ATTRIBUTE_TS                    = 0x00008000
457         } spoolss_PrinterAttributes;
458
459         typedef [public,gensize] struct {
460                 spoolss_PrinterAttributes flags;
461                 [relative] nstring *description;
462                 [relative] nstring *name;
463                 [relative] nstring *comment;
464         } spoolss_PrinterInfo1;
465
466         typedef [public,gensize] struct {
467                 [relative] nstring *servername;
468                 [relative] nstring *printername;
469                 [relative] nstring *sharename;
470                 [relative] nstring *portname;
471                 [relative] nstring *drivername;
472                 [relative] nstring *comment;
473                 [relative] nstring *location;
474                 [relative,subcontext(0)] spoolss_DeviceMode *devmode;
475                 [relative] nstring *sepfile;
476                 [relative] nstring *printprocessor;
477                 [relative] nstring *datatype;
478                 [relative] nstring *parameters;
479                 [relative,subcontext(0)] security_descriptor *secdesc;
480                 spoolss_PrinterAttributes attributes;
481                 [range(0,99)] uint32 priority;
482                 uint32 defaultpriority;
483                 uint32 starttime;
484                 uint32 untiltime;
485                 spoolss_PrinterStatus status;
486                 uint32 cjobs;
487                 uint32 averageppm;
488         } spoolss_PrinterInfo2;
489
490         typedef [public,gensize] struct {
491                 [relative,subcontext(0)] security_descriptor *secdesc;
492         } spoolss_PrinterInfo3;
493
494         typedef [public,gensize] struct {
495                 [relative] nstring *printername;
496                 [relative] nstring *servername;
497                 spoolss_PrinterAttributes attributes;
498         } spoolss_PrinterInfo4;
499
500         typedef [public,gensize] struct {
501                 [relative] nstring *printername;
502                 [relative] nstring *portname;
503                 spoolss_PrinterAttributes attributes;
504                 uint32 device_not_selected_timeout;
505                 uint32 transmission_retry_timeout;
506         } spoolss_PrinterInfo5;
507
508         typedef [public,gensize] struct {
509                 spoolss_PrinterStatus status;
510         } spoolss_PrinterInfo6;
511
512         typedef bitmap {
513                 DSPRINT_PUBLISH         = 0x00000001,
514                 DSPRINT_UPDATE          = 0x00000002,
515                 DSPRINT_UNPUBLISH       = 0x00000004,
516                 DSPRINT_REPUBLISH       = 0x00000008,
517                 DSPRINT_PENDING         = 0x80000000
518         } spoolss_DsPrintAction;
519
520         typedef [public,gensize] struct {
521                 [relative] nstring *guid; /* text form of printer guid */
522                 spoolss_DsPrintAction action;
523         } spoolss_PrinterInfo7;
524
525         typedef struct {
526                 [relative,subcontext(0)] spoolss_DeviceMode *devmode;
527         } spoolss_DeviceModeInfo;
528
529         typedef [nodiscriminant,relative_base,public,gensize] union {
530                 [case(0)] spoolss_PrinterInfo0 info0;
531                 [case(1)] spoolss_PrinterInfo1 info1;
532                 [case(2)] spoolss_PrinterInfo2 info2;
533                 [case(3)] spoolss_PrinterInfo3 info3;
534                 [case(4)] spoolss_PrinterInfo4 info4;
535                 [case(5)] spoolss_PrinterInfo5 info5;
536                 [case(6)] spoolss_PrinterInfo6 info6;
537                 [case(7)] spoolss_PrinterInfo7 info7;
538                 [case(8)] spoolss_DeviceModeInfo info8;
539                 [case(9)] spoolss_DeviceModeInfo info9;
540                 [default];
541         } spoolss_PrinterInfo;
542
543         /******************/
544         /* Function: 0x00 */
545         /* we are using this as internal parsing code */
546         [public,noopnum,noprint] WERROR _spoolss_EnumPrinters(
547                 [in] spoolss_EnumPrinterFlags flags,
548                 [in,unique] [string,charset(UTF16)] uint16 *server,
549                 [in] uint32 level,
550                 [in,unique] DATA_BLOB *buffer,
551                 [in] uint32 offered,
552                 [out,unique] DATA_BLOB *info,
553                 [out,ref] uint32 *needed,
554                 [out,ref] uint32 *count
555         );
556         [public,noopnum,noprint] void __spoolss_EnumPrinters(
557                 [in] uint32 level,
558                 [in] uint32 count,
559                 [out,switch_is(level)] spoolss_PrinterInfo info[count]
560         );
561         [nopull,nopush] WERROR spoolss_EnumPrinters(
562                 [in] spoolss_EnumPrinterFlags flags,
563                 [in,unique] [string,charset(UTF16)] uint16 *server,
564                 [in] uint32 level,
565                 [in,unique] DATA_BLOB *buffer,
566                 [in] uint32 offered,
567                 /* what we have here is a subcontext containing an array of no discriminant unions
568                  * and the array has no size in front
569                  */
570                 [out,ref] uint32 *count,
571                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrinterInfo **info,
572                 [out,ref] uint32 *needed
573         );
574
575         /******************/
576         /* Function: 0x01 */
577         typedef struct {
578                 [value(_ndr_size_spoolss_DeviceMode(devmode, ndr->iconv_convenience, ndr->flags))] uint32 _ndr_size;
579                 [subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode;
580         } spoolss_DevmodeContainer;
581
582         [public] WERROR spoolss_OpenPrinter(
583                 [in,unique] [string,charset(UTF16)] uint16 *printername,
584                 [in,unique] [string,charset(UTF16)] uint16 *datatype,
585                 [in] spoolss_DevmodeContainer devmode_ctr,
586                 [in] spoolss_AccessRights access_mask,
587                 [out,ref] policy_handle *handle
588         );
589
590         /******************/
591         /* Function: 0x02 */
592
593         typedef [public,gensize] struct {
594                 uint32 job_id;
595                 [relative] nstring *printer_name;
596                 [relative] nstring *server_name;
597                 [relative] nstring *user_name;
598                 [relative] nstring *document_name;
599                 [relative] nstring *data_type;
600                 [relative] nstring *text_status;
601                 spoolss_JobStatus status;
602                 [range(0,99)] uint32 priority;
603                 uint32 position;
604                 uint32 total_pages;
605                 uint32 pages_printed;
606                 spoolss_Time submitted;
607         } spoolss_JobInfo1;
608
609         typedef [public,gensize] struct {
610                 uint32 job_id;
611                 [relative] nstring *printer_name;
612                 [relative] nstring *server_name;
613                 [relative] nstring *user_name;
614                 [relative] nstring *document_name;
615                 [relative] nstring *notify_name;
616                 [relative] nstring *data_type;
617                 [relative] nstring *print_processor;
618                 [relative] nstring *parameters;
619                 [relative] nstring *driver_name;
620                 [relative] spoolss_DeviceMode *devmode;
621                 [relative] nstring *text_status;
622                 [relative] security_descriptor *secdesc;
623                 spoolss_JobStatus status;
624                 [range(0,99)] uint32 priority;
625                 uint32 position;
626                 uint32 start_time;
627                 uint32 until_time;
628                 uint32 total_pages;
629                 uint32 size;
630                 spoolss_Time submitted;
631                 uint32 time;
632                 uint32 pages_printed;
633         } spoolss_JobInfo2;
634
635         typedef [public,gensize] struct {
636                 uint32 job_id;
637                 uint32 next_job_id;
638                 uint32 reserved;
639         } spoolss_JobInfo3;
640
641         typedef [public,gensize] struct {
642                 uint32 job_id;
643                 [relative] nstring *printer_name;
644                 [relative] nstring *server_name;
645                 [relative] nstring *user_name;
646                 [relative] nstring *document_name;
647                 [relative] nstring *notify_name;
648                 [relative] nstring *data_type;
649                 [relative] nstring *print_processor;
650                 [relative] nstring *parameters;
651                 [relative] nstring *driver_name;
652                 [relative] spoolss_DeviceMode *devmode;
653                 [relative] nstring *text_status;
654                 [relative] security_descriptor *secdesc;
655                 spoolss_JobStatus status;
656                 [range(0,99)] uint32 priority;
657                 uint32 position;
658                 uint32 start_time;
659                 uint32 until_time;
660                 uint32 total_pages;
661                 uint32 size;
662                 spoolss_Time submitted;
663                 uint32 time;
664                 uint32 pages_printed;
665                 uint32 size_high;
666         } spoolss_JobInfo4;
667
668         typedef [nodiscriminant,relative_base,public,gensize] union {
669                 [case(1)] spoolss_JobInfo1 info1;
670                 [case(2)] spoolss_JobInfo2 info2;
671                 [case(3)] spoolss_JobInfo3 info3;
672                 [case(4)] spoolss_JobInfo4 info4;
673                 [default];
674         } spoolss_JobInfo;
675
676         typedef struct {
677                 uint32 job_id;
678                 [string,charset(UTF16)] uint16 *printer_name;
679                 [string,charset(UTF16)] uint16 *server_name;
680                 [string,charset(UTF16)] uint16 *user_name;
681                 [string,charset(UTF16)] uint16 *document_name;
682                 [string,charset(UTF16)] uint16 *data_type;
683                 [string,charset(UTF16)] uint16 *text_status;
684                 spoolss_JobStatus status;
685                 [range(0,99)] uint32 priority;
686                 uint32 position;
687                 uint32 total_pages;
688                 uint32 pages_printed;
689                 spoolss_Time submitted;
690         } spoolss_SetJobInfo1;
691
692         typedef struct {
693                 uint32 job_id;
694                 [string,charset(UTF16)] uint16 *printer_name;
695                 [string,charset(UTF16)] uint16 *server_name;
696                 [string,charset(UTF16)] uint16 *user_name;
697                 [string,charset(UTF16)] uint16 *document_name;
698                 [string,charset(UTF16)] uint16 *notify_name;
699                 [string,charset(UTF16)] uint16 *data_type;
700                 [string,charset(UTF16)] uint16 *print_processor;
701                 [string,charset(UTF16)] uint16 *parameters;
702                 [string,charset(UTF16)] uint16 *driver_name;
703                 uint32 _devmode_ptr; /* pointer to truncated devicemode */
704                 [string,charset(UTF16)] uint16 *text_status;
705                 uint32 _secdesc_ptr;
706                 spoolss_JobStatus status;
707                 [range(0,99)] uint32 priority;
708                 uint32 position;
709                 uint32 start_time;
710                 uint32 until_time;
711                 uint32 total_pages;
712                 uint32 size;
713                 spoolss_Time submitted;
714                 uint32 time;
715                 uint32 pages_printed;
716         } spoolss_SetJobInfo2;
717
718         typedef struct {
719                 uint32 job_id;
720                 [string,charset(UTF16)] uint16 *printer_name;
721                 [string,charset(UTF16)] uint16 *server_name;
722                 [string,charset(UTF16)] uint16 *user_name;
723                 [string,charset(UTF16)] uint16 *document_name;
724                 [string,charset(UTF16)] uint16 *notify_name;
725                 [string,charset(UTF16)] uint16 *data_type;
726                 [string,charset(UTF16)] uint16 *print_processor;
727                 [string,charset(UTF16)] uint16 *parameters;
728                 [string,charset(UTF16)] uint16 *driver_name;
729                 uint32 _devmode_ptr; /* pointer to truncated devicemode */
730                 [string,charset(UTF16)] uint16 *text_status;
731                 uint32 _secdesc_ptr;
732                 spoolss_JobStatus status;
733                 [range(0,99)] uint32 priority;
734                 uint32 position;
735                 uint32 start_time;
736                 uint32 until_time;
737                 uint32 total_pages;
738                 uint32 size;
739                 spoolss_Time submitted;
740                 uint32 time;
741                 uint32 pages_printed;
742                 uint32 size_high;
743         } spoolss_SetJobInfo4;
744
745         typedef [public] union {
746                 [case(1)] spoolss_SetJobInfo1 *info1;
747                 [case(2)] spoolss_SetJobInfo2 *info2;
748                 [case(3)] spoolss_JobInfo3    *info3;
749                 [case(4)] spoolss_SetJobInfo4 *info4;
750                 [default];
751         } spoolss_SetJobInfo;
752
753         typedef struct {
754                 uint32 level;
755                 [switch_is(level)] spoolss_SetJobInfo info;
756         } spoolss_JobInfoContainer;
757
758         typedef [v1_enum] enum {
759                 SPOOLSS_JOB_CONTROL_PAUSE               = 1,
760                 SPOOLSS_JOB_CONTROL_RESUME              = 2,
761                 SPOOLSS_JOB_CONTROL_CANCEL              = 3,
762                 SPOOLSS_JOB_CONTROL_RESTART             = 4,
763                 SPOOLSS_JOB_CONTROL_DELETE              = 5,
764                 SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER     = 6,
765                 SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED   = 7,
766                 SPOOLSS_JOB_CONTROL_RETAIN              = 8,
767                 SPOOLSS_JOB_CONTROL_RELEASE             = 9
768         } spoolss_JobControl;
769
770         WERROR spoolss_SetJob(
771                 [in,ref] policy_handle *handle,
772                 [in] uint32 job_id,
773                 [in,unique] spoolss_JobInfoContainer *ctr,
774                 [in] spoolss_JobControl command
775         );
776
777         /******************/
778         /* Function: 0x03 */
779         WERROR spoolss_GetJob(
780                 [in,ref] policy_handle *handle,
781                 [in]     uint32 job_id,
782                 [in]     uint32 level,
783                 [in,unique] DATA_BLOB *buffer,
784                 [in]     uint32 offered,
785                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info,
786                 [out,ref] uint32 *needed
787         );
788
789         /******************/
790         /* Function: 0x04 */
791         [public,noopnum,noprint] WERROR _spoolss_EnumJobs(
792                 [in,ref] policy_handle *handle,
793                 [in]     uint32 firstjob,
794                 [in]     uint32 numjobs,
795                 [in]     uint32 level,
796                 [in,unique] DATA_BLOB *buffer,
797                 [in]     uint32 offered,
798                 [out,unique] DATA_BLOB *info,
799                 [out,ref] uint32 *needed,
800                 [out,ref] uint32 *count
801         );
802         [public,noopnum,noprint] void __spoolss_EnumJobs(
803                 [in] uint32 level,
804                 [in] uint32 count,
805                 [out,switch_is(level)] spoolss_JobInfo info[count]
806         );
807         [nopull,nopush] WERROR spoolss_EnumJobs(
808                 [in,ref] policy_handle *handle,
809                 [in]     uint32 firstjob,
810                 [in]     uint32 numjobs,
811                 [in]     uint32 level,
812                 [in,unique] DATA_BLOB *buffer,
813                 [in]     uint32 offered,
814                 [out,ref] uint32 *count,
815                 [out,ref,switch_is(level),size_is(,*count)] spoolss_JobInfo **info,
816                 [out,ref] uint32 *needed
817         );
818
819         /******************/
820         /* Function: 0x05 */
821         WERROR spoolss_AddPrinter(
822                 [in,unique] [string,charset(UTF16)] uint16 *server,
823                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
824                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
825                 [in,ref] sec_desc_buf *secdesc_ctr,
826                 [out,ref] policy_handle *handle
827         );
828
829         /******************/
830         /* Function: 0x06 */
831         WERROR spoolss_DeletePrinter(
832                 [in] policy_handle *handle
833         );
834
835         /******************/
836         /* Function: 0x07 */
837         typedef [v1_enum] enum {
838                 SPOOLSS_PRINTER_CONTROL_UNPAUSE    = 0,
839                 SPOOLSS_PRINTER_CONTROL_PAUSE      = 1,
840                 SPOOLSS_PRINTER_CONTROL_RESUME     = 2,
841                 SPOOLSS_PRINTER_CONTROL_PURGE      = 3,
842                 SPOOLSS_PRINTER_CONTROL_SET_STATUS = 4
843         } spoolss_PrinterControl;
844
845         typedef struct {
846                 [string,charset(UTF16)] uint16 *servername;
847                 [string,charset(UTF16)] uint16 *printername;
848                 uint32 cjobs;
849                 uint32 total_jobs;
850                 uint32 total_bytes;
851                 spoolss_Time time;
852                 uint32 global_counter;
853                 uint32 total_pages;
854                 uint32 version;
855                 uint32 free_build;
856                 uint32 spooling;
857                 uint32 max_spooling;
858                 uint32 session_counter;
859                 uint32 num_error_out_of_paper;
860                 uint32 num_error_not_ready;
861                 uint32 job_error;
862                 uint32 number_of_processors;
863                 spoolss_ProcessorType processor_type;
864                 uint32 high_part_total_bytes;
865                 uint32 change_id;
866                 WERROR last_error;
867                 uint32 status;
868                 uint32 enumerate_network_printers;
869                 uint32 c_setprinter;
870                 spoolss_ProcessorArchitecture processor_architecture;
871                 uint16 processor_level;
872                 uint32 ref_ic;
873                 uint32 reserved2;
874                 uint32 reserved3;
875         } spoolss_SetPrinterInfo0;
876
877         typedef struct {
878                 spoolss_PrinterAttributes flags;
879                 [string,charset(UTF16)] uint16 *description;
880                 [string,charset(UTF16)] uint16 *name;
881                 [string,charset(UTF16)] uint16 *comment;
882         } spoolss_SetPrinterInfo1;
883
884         typedef struct {
885                 [string,charset(UTF16)] uint16 *servername;
886                 [string,charset(UTF16)] uint16 *printername;
887                 [string,charset(UTF16)] uint16 *sharename;
888                 [string,charset(UTF16)] uint16 *portname;
889                 [string,charset(UTF16)] uint16 *drivername;
890                 [string,charset(UTF16)] uint16 *comment;
891                 [string,charset(UTF16)] uint16 *location;
892                 [subcontext(0)] spoolss_DeviceMode *devmode;
893                 [string,charset(UTF16)] uint16 *sepfile;
894                 [string,charset(UTF16)] uint16 *printprocessor;
895                 [string,charset(UTF16)] uint16 *datatype;
896                 [string,charset(UTF16)] uint16 *parameters;
897                 [subcontext(0)] security_descriptor *secdesc;
898                 spoolss_PrinterAttributes attributes;
899                 [range(0,99)] uint32 priority;
900                 uint32 defaultpriority;
901                 uint32 starttime;
902                 uint32 untiltime;
903                 spoolss_PrinterStatus status;
904                 uint32 cjobs;
905                 uint32 averageppm;
906         } spoolss_SetPrinterInfo2;
907
908         typedef struct {
909                 uint32 sec_desc_ptr;
910         } spoolss_SetPrinterInfo3;
911
912         typedef struct {
913                 [string,charset(UTF16)] uint16 *printername;
914                 [string,charset(UTF16)] uint16 *servername;
915                 spoolss_PrinterAttributes attributes;
916         } spoolss_SetPrinterInfo4;
917
918         typedef struct {
919                 [string,charset(UTF16)] uint16 *printername;
920                 [string,charset(UTF16)] uint16 *portname;
921                 spoolss_PrinterAttributes attributes;
922                 uint32 device_not_selected_timeout;
923                 uint32 transmission_retry_timeout;
924         } spoolss_SetPrinterInfo5;
925
926         typedef struct {
927                 spoolss_PrinterStatus status;
928         } spoolss_SetPrinterInfo6;
929
930         typedef struct {
931                 [string,charset(UTF16)] uint16 *guid; /* text form of printer guid */
932                 spoolss_DsPrintAction action;
933         } spoolss_SetPrinterInfo7;
934
935         typedef [switch_type(uint32)] union {
936                 [case(0)] spoolss_SetPrinterInfo0 *info0;
937                 [case(1)] spoolss_SetPrinterInfo1 *info1;
938                 [case(2)] spoolss_SetPrinterInfo2 *info2;
939                 [case(3)] spoolss_SetPrinterInfo3 *info3;
940                 [case(4)] spoolss_SetPrinterInfo4 *info4;
941                 [case(5)] spoolss_SetPrinterInfo5 *info5;
942                 [case(6)] spoolss_SetPrinterInfo6 *info6;
943                 [case(7)] spoolss_SetPrinterInfo7 *info7;
944                 [case(8)] spoolss_DeviceModeInfo *info8;
945                 [case(9)] spoolss_DeviceModeInfo *info9;
946                 [default];
947         } spoolss_SetPrinterInfo;
948
949         typedef struct {
950                 uint32 level;
951                 [switch_is(level)] spoolss_SetPrinterInfo info;
952         } spoolss_SetPrinterInfoCtr;
953
954         WERROR spoolss_SetPrinter(
955                 [in,ref] policy_handle *handle,
956                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
957                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
958                 [in,ref] sec_desc_buf *secdesc_ctr,
959                 [in] spoolss_PrinterControl command
960         );
961
962         /******************/
963         /* Function: 0x08 */
964         [public] WERROR spoolss_GetPrinter(
965                 [in,ref] policy_handle *handle,
966                 [in]     uint32 level,
967                 [in,unique] DATA_BLOB *buffer,
968                 [in]     uint32 offered,
969                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info,
970                 [out,ref] uint32 *needed
971         );
972
973         /******************/
974         /* Function: 0x09 */
975
976         typedef [public] struct {
977                 [value((ndr_size_spoolss_StringArray(r, ndr->iconv_convenience, ndr->flags)-4)/2)] uint32 _ndr_size;
978                 /*[subcontext(0),subcontext_size(_ndr_size*2)]*/ nstring_array string;
979         } spoolss_StringArray;
980
981         typedef struct {
982                 [string,charset(UTF16)] uint16 *driver_name;
983         } spoolss_AddDriverInfo1;
984
985         typedef [v1_enum,public] enum {
986                 SPOOLSS_DRIVER_VERSION_9X       = 0,
987                 SPOOLSS_DRIVER_VERSION_NT35     = 1,
988                 SPOOLSS_DRIVER_VERSION_NT4      = 2,
989                 SPOOLSS_DRIVER_VERSION_200X     = 3
990         } spoolss_DriverOSVersion;
991
992         typedef struct {
993                 spoolss_DriverOSVersion version;
994                 [string,charset(UTF16)] uint16 *driver_name;
995                 [string,charset(UTF16)] uint16 *architecture;
996                 [string,charset(UTF16)] uint16 *driver_path;
997                 [string,charset(UTF16)] uint16 *data_file;
998                 [string,charset(UTF16)] uint16 *config_file;
999         } spoolss_AddDriverInfo2;
1000
1001         typedef struct {
1002                 spoolss_DriverOSVersion version;
1003                 [string,charset(UTF16)] uint16 *driver_name;
1004                 [string,charset(UTF16)] uint16 *architecture;
1005                 [string,charset(UTF16)] uint16 *driver_path;
1006                 [string,charset(UTF16)] uint16 *data_file;
1007                 [string,charset(UTF16)] uint16 *config_file;
1008                 [string,charset(UTF16)] uint16 *help_file;
1009                 [string,charset(UTF16)] uint16 *monitor_name;
1010                 [string,charset(UTF16)] uint16 *default_datatype;
1011                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
1012                 spoolss_StringArray *dependent_files;
1013         } spoolss_AddDriverInfo3;
1014
1015         typedef struct {
1016                 spoolss_DriverOSVersion version;
1017                 [string,charset(UTF16)] uint16 *driver_name;
1018                 [string,charset(UTF16)] uint16 *architecture;
1019                 [string,charset(UTF16)] uint16 *driver_path;
1020                 [string,charset(UTF16)] uint16 *data_file;
1021                 [string,charset(UTF16)] uint16 *config_file;
1022                 [string,charset(UTF16)] uint16 *help_file;
1023                 [string,charset(UTF16)] uint16 *monitor_name;
1024                 [string,charset(UTF16)] uint16 *default_datatype;
1025                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
1026                 spoolss_StringArray *dependent_files;
1027                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
1028                 spoolss_StringArray *previous_names;
1029         } spoolss_AddDriverInfo4;
1030
1031         typedef [bitmap32bit] bitmap {
1032                 PRINTER_DRIVER_PACKAGE_AWARE = 0x00000002
1033         } spoolss_DriverAttributes;
1034
1035         typedef struct {
1036                 spoolss_DriverOSVersion version;
1037                 [string,charset(UTF16)] uint16 *driver_name;
1038                 [string,charset(UTF16)] uint16 *architecture;
1039                 [string,charset(UTF16)] uint16 *driver_path;
1040                 [string,charset(UTF16)] uint16 *data_file;
1041                 [string,charset(UTF16)] uint16 *config_file;
1042                 spoolss_DriverAttributes driver_attributes;
1043                 uint32 config_version;
1044                 uint32 driver_version;
1045         } spoolss_AddDriverInfo5;
1046
1047         typedef struct {
1048                 spoolss_DriverOSVersion version;
1049                 [string,charset(UTF16)] uint16 *driver_name;
1050                 [string,charset(UTF16)] uint16 *architecture;
1051                 [string,charset(UTF16)] uint16 *driver_path;
1052                 [string,charset(UTF16)] uint16 *data_file;
1053                 [string,charset(UTF16)] uint16 *config_file;
1054                 [string,charset(UTF16)] uint16 *help_file;
1055                 [string,charset(UTF16)] uint16 *monitor_name;
1056                 [string,charset(UTF16)] uint16 *default_datatype;
1057                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
1058                 spoolss_StringArray *dependent_files;
1059                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
1060                 spoolss_StringArray *previous_names;
1061                 NTTIME driver_date;
1062                 hyper driver_version;
1063                 [string,charset(UTF16)] uint16 *manufacturer_name;
1064                 [string,charset(UTF16)] uint16 *manufacturer_url;
1065                 [string,charset(UTF16)] uint16 *hardware_id;
1066                 [string,charset(UTF16)] uint16 *provider;
1067         } spoolss_AddDriverInfo6;
1068
1069         typedef struct {
1070                 spoolss_DriverOSVersion version;
1071                 [string,charset(UTF16)] uint16 *driver_name;
1072                 [string,charset(UTF16)] uint16 *architecture;
1073                 [string,charset(UTF16)] uint16 *driver_path;
1074                 [string,charset(UTF16)] uint16 *data_file;
1075                 [string,charset(UTF16)] uint16 *config_file;
1076                 [string,charset(UTF16)] uint16 *help_file;
1077                 [string,charset(UTF16)] uint16 *monitor_name;
1078                 [string,charset(UTF16)] uint16 *default_datatype;
1079                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
1080                 spoolss_StringArray *dependent_files;
1081                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
1082                 spoolss_StringArray *previous_names;
1083                 NTTIME driver_date;
1084                 hyper driver_version;
1085                 [string,charset(UTF16)] uint16 *manufacturer_name;
1086                 [string,charset(UTF16)] uint16 *manufacturer_url;
1087                 [string,charset(UTF16)] uint16 *hardware_id;
1088                 [string,charset(UTF16)] uint16 *provider;
1089                 [string,charset(UTF16)] uint16 *print_processor;
1090                 [string,charset(UTF16)] uint16 *vendor_setup;
1091                 [value(((ndr_size_spoolss_StringArray(color_profiles, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles;
1092                 spoolss_StringArray *color_profiles;
1093                 [string,charset(UTF16)] uint16 *inf_path;
1094                 uint32 printer_driver_attributes;
1095                 [value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies;
1096                 spoolss_StringArray *core_driver_dependencies;
1097                 NTTIME min_inbox_driver_ver_date;
1098                 hyper min_inbox_driver_ver_version;
1099         } spoolss_AddDriverInfo8;
1100
1101         typedef [switch_type(uint32)] union {
1102                 [case(1)] spoolss_AddDriverInfo1 *info1;
1103                 [case(2)] spoolss_AddDriverInfo2 *info2;
1104                 [case(3)] spoolss_AddDriverInfo3 *info3;
1105                 [case(4)] spoolss_AddDriverInfo4 *info4;
1106                 [case(6)] spoolss_AddDriverInfo6 *info6;
1107                 [case(8)] spoolss_AddDriverInfo8 *info8;
1108         } spoolss_AddDriverInfo;
1109
1110         typedef struct {
1111                 uint32 level;
1112                 [switch_is(level)] spoolss_AddDriverInfo info;
1113         } spoolss_AddDriverInfoCtr;
1114
1115         WERROR spoolss_AddPrinterDriver(
1116                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1117                 [in,ref] spoolss_AddDriverInfoCtr *info_ctr
1118         );
1119
1120         typedef [public,gensize] struct {
1121                 [relative] nstring *driver_name;
1122         } spoolss_DriverInfo1;
1123
1124         typedef [public,gensize] struct {
1125                 spoolss_DriverOSVersion version;
1126                 [relative] nstring *driver_name;
1127                 [relative] nstring *architecture;
1128                 [relative] nstring *driver_path;
1129                 [relative] nstring *data_file;
1130                 [relative] nstring *config_file;
1131         } spoolss_DriverInfo2;
1132
1133         typedef [public,gensize] struct {
1134                 spoolss_DriverOSVersion version;
1135                 [relative] nstring *driver_name;
1136                 [relative] nstring *architecture;
1137                 [relative] nstring *driver_path;
1138                 [relative] nstring *data_file;
1139                 [relative] nstring *config_file;
1140                 [relative] nstring *help_file;
1141                 [relative] nstring_array *dependent_files;
1142                 [relative] nstring *monitor_name;
1143                 [relative] nstring *default_datatype;
1144         } spoolss_DriverInfo3;
1145
1146         typedef [public,gensize] struct {
1147                 spoolss_DriverOSVersion version;
1148                 [relative] nstring *driver_name;
1149                 [relative] nstring *architecture;
1150                 [relative] nstring *driver_path;
1151                 [relative] nstring *data_file;
1152                 [relative] nstring *config_file;
1153                 [relative] nstring *help_file;
1154                 [relative] nstring_array *dependent_files;
1155                 [relative] nstring *monitor_name;
1156                 [relative] nstring *default_datatype;
1157                 [relative] nstring_array *previous_names;
1158         } spoolss_DriverInfo4;
1159
1160         typedef [public,gensize] struct {
1161                 spoolss_DriverOSVersion version;
1162                 [relative] nstring *driver_name;
1163                 [relative] nstring *architecture;
1164                 [relative] nstring *driver_path;
1165                 [relative] nstring *data_file;
1166                 [relative] nstring *config_file;
1167                 spoolss_DriverAttributes driver_attributes;
1168                 uint32 config_version;
1169                 uint32 driver_version;
1170         } spoolss_DriverInfo5;
1171
1172         typedef [public,gensize] struct {
1173                 spoolss_DriverOSVersion version;
1174                 [relative] nstring *driver_name;
1175                 [relative] nstring *architecture;
1176                 [relative] nstring *driver_path;
1177                 [relative] nstring *data_file;
1178                 [relative] nstring *config_file;
1179                 [relative] nstring *help_file;
1180                 [relative] nstring_array *dependent_files;
1181                 [relative] nstring *monitor_name;
1182                 [relative] nstring *default_datatype;
1183                 [relative] nstring_array *previous_names;
1184                 NTTIME driver_date;
1185                 hyper driver_version;
1186                 [relative] nstring *manufacturer_name;
1187                 [relative] nstring *manufacturer_url;
1188                 [relative] nstring *hardware_id;
1189                 [relative] nstring *provider;
1190         } spoolss_DriverInfo6;
1191
1192         typedef [public,gensize] struct {
1193                 spoolss_DriverOSVersion version;
1194                 [relative] nstring *driver_name;
1195                 [relative] nstring *architecture;
1196                 [relative] nstring *driver_path;
1197                 [relative] nstring *data_file;
1198                 [relative] nstring *config_file;
1199                 [relative] nstring *help_file;
1200                 [relative] nstring *monitor_name;
1201                 [relative] nstring *default_datatype;
1202                 [relative] nstring_array *dependent_files;
1203                 [relative] nstring_array *previous_names;
1204                 NTTIME driver_date;
1205                 hyper driver_version;
1206                 [relative] nstring *manufacturer_name;
1207                 [relative] nstring *manufacturer_url;
1208                 [relative] nstring *hardware_id;
1209                 [relative] nstring *provider;
1210                 [relative] nstring *print_processor;
1211                 [relative] nstring *vendor_setup;
1212                 [relative] nstring_array *color_profiles;
1213                 [relative] nstring *inf_path;
1214                 uint32 printer_driver_attributes;
1215                 [relative] nstring_array *core_driver_dependencies;
1216                 NTTIME min_inbox_driver_ver_date;
1217                 hyper min_inbox_driver_ver_version;
1218         } spoolss_DriverInfo8;
1219
1220         typedef [v1_enum] enum {
1221                 SPOOLSS_DRIVER_FILE_TYPE_RENDERING      = 0x00000000,
1222                 SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION  = 0x00000001,
1223                 SPOOLSS_DRIVER_FILE_TYPE_DATA           = 0x00000002,
1224                 SPOOLSS_DRIVER_FILE_TYPE_HELP           = 0x00000003,
1225                 SPOOLSS_DRIVER_FILE_TYPE_OTHER          = 0x00000004
1226         } spoolss_DriverFileType;
1227
1228         typedef [public] struct {
1229                 [relative] nstring *file_name;
1230                 spoolss_DriverFileType file_type;
1231                 uint32 file_version;
1232         } spoolss_DriverFileInfo;
1233
1234         typedef [public,gensize,nopush,nopull] struct {
1235                 spoolss_DriverOSVersion version;
1236                 [relative] nstring *driver_name;
1237                 [relative] nstring *architecture;
1238                 [relative] [size_is(file_count)] spoolss_DriverFileInfo *file_info;
1239                 uint32 file_count;
1240                 [relative] nstring *monitor_name;
1241                 [relative] nstring *default_datatype;
1242                 [relative] nstring_array *previous_names;
1243                 NTTIME driver_date;
1244                 hyper driver_version;
1245                 [relative] nstring *manufacturer_name;
1246                 [relative] nstring *manufacturer_url;
1247                 [relative] nstring *hardware_id;
1248                 [relative] nstring *provider;
1249         } spoolss_DriverInfo101;
1250
1251         typedef [nodiscriminant,relative_base,public,gensize] union {
1252                 [case(1)] spoolss_DriverInfo1 info1;
1253                 [case(2)] spoolss_DriverInfo2 info2;
1254                 [case(3)] spoolss_DriverInfo3 info3;
1255                 [case(4)] spoolss_DriverInfo4 info4;
1256                 [case(5)] spoolss_DriverInfo5 info5;
1257                 [case(6)] spoolss_DriverInfo6 info6;
1258                 [case(8)] spoolss_DriverInfo8 info8;
1259                 [case(101)] spoolss_DriverInfo101 info101;
1260                 [default];
1261         } spoolss_DriverInfo;
1262
1263         /******************/
1264         /* Function: 0x0a */
1265         [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDrivers(
1266                 [in,unique] [string,charset(UTF16)] uint16 *server,
1267                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1268                 [in] uint32 level,
1269                 [in,unique] DATA_BLOB *buffer,
1270                 [in] uint32 offered,
1271                 [out,unique] DATA_BLOB *info,
1272                 [out,ref] uint32 *needed,
1273                 [out,ref] uint32 *count
1274         );
1275         [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers(
1276                 [in] uint32 level,
1277                 [in] uint32 count,
1278                 [out,switch_is(level)] spoolss_DriverInfo info[count]
1279         );
1280         [nopull,nopush] WERROR spoolss_EnumPrinterDrivers(
1281                 [in,unique] [string,charset(UTF16)] uint16 *server,
1282                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1283                 [in] uint32 level,
1284                 [in,unique] DATA_BLOB *buffer,
1285                 [in] uint32 offered,
1286                 [out,ref] uint32 *count,
1287                 [out,ref,switch_is(level),size_is(,*count)] spoolss_DriverInfo **info,
1288                 [out,ref] uint32 *needed
1289         );
1290
1291         /******************/
1292         /* Function: 0x0b */
1293         WERROR spoolss_GetPrinterDriver(
1294                 [in,ref] policy_handle *handle,
1295                 [in,unique] [string,charset(UTF16)] uint16 *architecture,
1296                 [in]     uint32 level,
1297                 [in,unique] DATA_BLOB *buffer,
1298                 [in]     uint32 offered,
1299                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverInfo *info,
1300                 [out,ref] uint32 *needed
1301         );
1302
1303         /******************/
1304         /* Function: 0x0c */
1305         typedef [public,gensize] struct {
1306                 nstring directory_name;
1307         } spoolss_DriverDirectoryInfo1;
1308
1309         /* NOTE: it's seems that w2k3 completly ignores the level
1310                  in its server code
1311          */
1312         typedef [nodiscriminant,relative_base,gensize,public] union {
1313                 [case(1)] spoolss_DriverDirectoryInfo1 info1;
1314                 [default] spoolss_DriverDirectoryInfo1 info1;
1315         } spoolss_DriverDirectoryInfo;
1316
1317         [public] WERROR spoolss_GetPrinterDriverDirectory(
1318                 [in,unique] [string,charset(UTF16)] uint16 *server,
1319                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1320                 [in] uint32 level,
1321                 [in,unique] DATA_BLOB *buffer,
1322                 [in] uint32 offered,
1323                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
1324                 [out,ref] uint32 *needed
1325         );
1326
1327         /******************/
1328         /* Function: 0x0d */
1329         WERROR spoolss_DeletePrinterDriver(
1330                 [in,unique] [string,charset(UTF16)] uint16 *server,
1331                 [in] [string,charset(UTF16)] uint16 architecture[],
1332                 [in] [string,charset(UTF16)] uint16 driver[]
1333         );
1334
1335         /******************/
1336         /* Function: 0x0e */
1337         WERROR spoolss_AddPrintProcessor(
1338                 [in,unique] [string,charset(UTF16)] uint16 *server,
1339                 [in] [string,charset(UTF16)] uint16 architecture[],
1340                 [in] [string,charset(UTF16)] uint16 path_name[],
1341                 [in] [string,charset(UTF16)] uint16 print_processor_name[]
1342         );
1343
1344         /******************/
1345         /* Function: 0x0f */
1346         typedef [public,gensize] struct {
1347                 [relative] nstring *print_processor_name;
1348         } spoolss_PrintProcessorInfo1;
1349
1350         typedef [nodiscriminant,relative_base,public] union {
1351                 [case(1)] spoolss_PrintProcessorInfo1 info1;
1352                 [default];
1353         } spoolss_PrintProcessorInfo;
1354
1355         [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessors(
1356                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1357                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1358                 [in] uint32 level,
1359                 [in,unique] DATA_BLOB *buffer,
1360                 [in] uint32 offered,
1361                 [out,unique] DATA_BLOB *info,
1362                 [out,ref] uint32 *needed,
1363                 [out,ref] uint32 *count
1364         );
1365         [public,noopnum,noprint] void __spoolss_EnumPrintProcessors(
1366                 [in] uint32 level,
1367                 [in] uint32 count,
1368                 [out,switch_is(level)] spoolss_PrintProcessorInfo info[count]
1369         );
1370         [nopull,nopush] WERROR spoolss_EnumPrintProcessors(
1371                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1372                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1373                 [in] uint32 level,
1374                 [in,unique] DATA_BLOB *buffer,
1375                 [in] uint32 offered,
1376                 [out,ref] uint32 *count,
1377                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrintProcessorInfo **info,
1378                 [out,ref] uint32 *needed
1379         );
1380
1381         /******************/
1382         /* Function: 0x10 */
1383         typedef [public,gensize] struct {
1384                 nstring directory_name;
1385         } spoolss_PrintProcessorDirectoryInfo1;
1386
1387         typedef [nodiscriminant,relative_base,gensize,public] union {
1388                 [case(1)] spoolss_PrintProcessorDirectoryInfo1 info1;
1389                 [default] spoolss_PrintProcessorDirectoryInfo1 info1;
1390         } spoolss_PrintProcessorDirectoryInfo;
1391
1392         WERROR spoolss_GetPrintProcessorDirectory(
1393                 [in,unique] [string,charset(UTF16)] uint16 *server,
1394                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1395                 [in] uint32 level,
1396                 [in,unique] DATA_BLOB *buffer,
1397                 [in] uint32 offered,
1398                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrintProcessorDirectoryInfo *info,
1399                 [out,ref] uint32 *needed
1400         );
1401
1402         /******************/
1403         /* Function: 0x11 */
1404         typedef struct {
1405                 [string,charset(UTF16)] uint16 *document_name;
1406                 [string,charset(UTF16)] uint16 *output_file;
1407                 [string,charset(UTF16)] uint16 *datatype;
1408         } spoolss_DocumentInfo1;
1409
1410         typedef [switch_type(uint32)] union {
1411                 [case(1)] spoolss_DocumentInfo1 *info1;
1412                 [case(2)]; /* TODO */
1413                 [case(3)]; /* TODO */
1414                 [default];
1415         } spoolss_DocumentInfo;
1416
1417         WERROR spoolss_StartDocPrinter(
1418                 [in,ref] policy_handle *handle,
1419                 [in] uint32 level,
1420                 [in,switch_is(level)] spoolss_DocumentInfo info,
1421                 [out,ref] uint32 *job_id
1422         );
1423
1424         /******************/
1425         /* Function: 0x12 */
1426         WERROR spoolss_StartPagePrinter(
1427                 [in,ref] policy_handle *handle
1428         );
1429
1430         /******************/
1431         /* Function: 0x13 */
1432         WERROR spoolss_WritePrinter(
1433                 [in,ref] policy_handle *handle,
1434                 [in] DATA_BLOB data,
1435                 [in,value(r->in.data.length)] uint32 _data_size,
1436                 [out,ref] uint32 *num_written
1437         );
1438
1439         /******************/
1440         /* Function: 0x14 */
1441         WERROR spoolss_EndPagePrinter(
1442                 [in,ref] policy_handle *handle
1443         );
1444
1445         /******************/
1446         /* Function: 0x15 */
1447         WERROR spoolss_AbortPrinter(
1448                 [in,ref] policy_handle *handle
1449         );
1450
1451         /******************/
1452         /* Function: 0x16 */
1453         WERROR spoolss_ReadPrinter(
1454                 [in,ref] policy_handle *handle,
1455                 [out,ref] [size_is(data_size)] uint8 *data,
1456                 [in] uint32 data_size,
1457                 [out,ref] uint32 *_data_size
1458         );
1459
1460         /******************/
1461         /* Function: 0x17 */
1462         WERROR spoolss_EndDocPrinter(
1463                 [in,ref] policy_handle *handle
1464         );
1465
1466         /******************/
1467         /* Function: 0x18 */
1468         WERROR spoolss_AddJob(
1469                 [in,ref] policy_handle *handle,
1470                 [in] uint32 level,
1471                 [in,out,unique] [size_is(offered)] uint8 *buffer,
1472                 [in] uint32 offered,
1473                 [out,ref] uint32 *needed
1474         );
1475
1476         /******************/
1477         /* Function: 0x19 */
1478         WERROR spoolss_ScheduleJob(
1479                 [in,ref] policy_handle *handle,
1480                 [in] uint32 jobid
1481         );
1482
1483         /******************/
1484         /* Function: 0x1a */
1485
1486         const string SPL_ARCH_WIN40             = "WIN40";
1487         const string SPL_ARCH_W32X86            = "W32X86";
1488         const string SPL_ARCH_W32MIPS           = "W32MIPS";
1489         const string SPL_ARCH_W32ALPHA          = "W32ALPHA";
1490         const string SPL_ARCH_W32PPC            = "W32PPC";
1491         const string SPL_ARCH_IA64              = "IA64";
1492         const string SPL_ARCH_X64               = "x64";
1493
1494         const string SPOOLSS_ARCHITECTURE_ALL                   = "all";
1495         const string SPOOLSS_ARCHITECTURE_NT_X86                = "Windows NT x86";
1496         const string SPOOLSS_DEFAULT_SERVER_PATH                = "C:\\WINDOWS\\system32\\spool";
1497
1498         typedef [public,gensize] struct {
1499                 [value(ndr_size_spoolss_OSVersion(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
1500                 uint32 major;
1501                 uint32 minor;
1502                 uint32 build;
1503                 [value(2)] uint32 platform_id;
1504                 [subcontext(0),subcontext_size(256)] nstring extra_string;
1505         } spoolss_OSVersion;
1506
1507         typedef [public,gensize] struct {
1508                 [value(ndr_size_spoolss_OSVersionEx(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
1509                 uint32 major;
1510                 uint32 minor;
1511                 uint32 build;
1512                 [value(2)] uint32 platform_id;
1513                 [subcontext(0),subcontext_size(256)] nstring extra_string;
1514                 uint16 service_pack_major;
1515                 uint16 service_pack_minor;
1516                 uint16 suite_mask;
1517                 uint8 product_type;
1518                 uint8 reserved;
1519         } spoolss_OSVersionEx;
1520
1521         typedef [nodiscriminant,public,gensize] union {
1522                 [case(REG_NONE)];
1523                 [case(REG_SZ)] nstring string;
1524                 [case(REG_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary;
1525                 [case(REG_DWORD)] uint32 value;
1526                 [case(REG_MULTI_SZ)] nstring_array string_array;
1527                 [default,flag(NDR_REMAINING)] DATA_BLOB data;
1528         } spoolss_PrinterData;
1529
1530         [noopnum,noprint,public] WERROR _spoolss_GetPrinterData(
1531                 [in,ref] policy_handle *handle,
1532                 [in]     [string,charset(UTF16)] uint16 value_name[],
1533                 [in]     uint32 offered,
1534                 [out,ref] winreg_Type *type,
1535                 [out,ref] DATA_BLOB *data,
1536                 [out,ref] uint32 *needed
1537         );
1538         [noopnum,noprint,public] void __spoolss_GetPrinterData(
1539                 [in] winreg_Type type,
1540                 [out,ref,switch_is(type)] spoolss_PrinterData *data
1541         );
1542         [nopull,nopush,public] WERROR spoolss_GetPrinterData(
1543                 [in,ref] policy_handle *handle,
1544                 [in]     [string,charset(UTF16)] uint16 value_name[],
1545                 [in]     uint32 offered,
1546                 [out,ref] winreg_Type *type,
1547                 [out,ref,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData *data,
1548                 [out,ref] uint32 *needed
1549         );
1550
1551         /******************/
1552         /* Function: 0x1b */
1553         [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData(
1554                 [in,ref] policy_handle *handle,
1555                 [in] [string,charset(UTF16)] uint16 value_name[],
1556                 [in] winreg_Type type,
1557                 [in] DATA_BLOB data,
1558                 [in] uint32 _offered
1559         );
1560         [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData(
1561                 [in] winreg_Type type,
1562                 [out,ref,switch_is(type)] spoolss_PrinterData *data
1563         );
1564         [nopush] WERROR spoolss_SetPrinterData(
1565                 [in,ref] policy_handle *handle,
1566                 [in] [string,charset(UTF16)] uint16 value_name[],
1567                 [in] winreg_Type type,
1568                 [in,subcontext(4),switch_is(type)] spoolss_PrinterData data,
1569                 [in,value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] uint32 _offered
1570         );
1571
1572         /******************/
1573         /* Function: 0x1c */
1574         [todo] WERROR spoolss_WaitForPrinterChange(
1575         );
1576
1577         /******************/
1578         /* Function: 0x1d */
1579         [public] WERROR spoolss_ClosePrinter(
1580                 [in,out,ref]     policy_handle *handle
1581         );
1582
1583         /******************/
1584         /* Function: 0x1e */
1585         typedef [v1_enum] enum {
1586                 SPOOLSS_FORM_USER       = 0,
1587                 SPOOLSS_FORM_BUILTIN    = 1,
1588                 SPOOLSS_FORM_PRINTER    = 2
1589         } spoolss_FormFlags;
1590
1591         typedef struct {
1592                 uint32 width;
1593                 uint32 height;
1594         } spoolss_FormSize;
1595
1596         typedef struct {
1597                 uint32 left;
1598                 uint32 top;
1599                 uint32 right;
1600                 uint32 bottom;
1601         } spoolss_FormArea;
1602
1603         typedef [public,gensize] struct {
1604                 spoolss_FormFlags flags;
1605                 [relative] nstring *form_name;
1606                 spoolss_FormSize size;
1607                 spoolss_FormArea area;
1608         } spoolss_FormInfo1;
1609
1610         typedef [bitmap32bit] bitmap {
1611                 SPOOLSS_FORM_STRING_TYPE_NONE           = 0x00000001,
1612                 SPOOLSS_FORM_STRING_TYPE_MUI_DLL        = 0x00000002,
1613                 SPOOLSS_FORM_STRING_TYPE_LANG_PAIR      = 0x00000004
1614         } spoolss_FormStringType;
1615
1616         typedef [public,gensize] struct {
1617                 spoolss_FormFlags flags;
1618                 [relative] nstring *form_name;
1619                 spoolss_FormSize size;
1620                 spoolss_FormArea area;
1621                 [relative] astring *keyword;
1622                 spoolss_FormStringType string_type;
1623                 [relative] nstring *mui_dll;
1624                 uint32 ressource_id;
1625                 [relative] nstring *display_name;
1626                 uint32 lang_id;
1627         } spoolss_FormInfo2;
1628
1629         typedef [nodiscriminant,relative_base,public,gensize] union {
1630                 [case(1)] spoolss_FormInfo1 info1;
1631                 [case(2)] spoolss_FormInfo2 info2;
1632                 [default];
1633         } spoolss_FormInfo;
1634
1635         typedef struct {
1636                 spoolss_FormFlags flags;
1637                 [string,charset(UTF16)] uint16 *form_name;
1638                 spoolss_FormSize size;
1639                 spoolss_FormArea area;
1640         } spoolss_AddFormInfo1;
1641
1642         typedef struct {
1643                 spoolss_FormFlags flags;
1644                 [string,charset(UTF16)] uint16 *form_name;
1645                 spoolss_FormSize size;
1646                 spoolss_FormArea area;
1647                 [string,charset(DOS)] uint8 *keyword;
1648                 spoolss_FormStringType string_type;
1649                 [string,charset(UTF16)] uint16 *mui_dll;
1650                 uint32 ressource_id;
1651                 [string,charset(UTF16)] uint16 *display_name;
1652                 uint32 lang_id;
1653         } spoolss_AddFormInfo2;
1654
1655         typedef [switch_type(uint32)] union {
1656                 [case(1)] spoolss_AddFormInfo1 *info1;
1657                 [case(2)] spoolss_AddFormInfo2 *info2;
1658         } spoolss_AddFormInfo;
1659
1660         WERROR spoolss_AddForm(
1661                 [in,ref] policy_handle *handle,
1662                 [in] uint32 level,
1663                 [in,switch_is(level)] spoolss_AddFormInfo info
1664         );
1665
1666         /******************/
1667         /* Function: 0x1f */
1668         WERROR spoolss_DeleteForm(
1669                 [in,ref] policy_handle *handle,
1670                 [in] [string,charset(UTF16)] uint16 form_name[]
1671         );
1672
1673         /******************/
1674         /* Function: 0x20 */
1675         WERROR spoolss_GetForm(
1676                 [in,ref] policy_handle *handle,
1677                 [in] [string,charset(UTF16)] uint16 form_name[],
1678                 [in] uint32 level,
1679                 [in,unique] DATA_BLOB *buffer,
1680                 [in] uint32 offered,
1681                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
1682                 [out,ref] uint32 *needed
1683         );
1684
1685         /******************/
1686         /* Function: 0x21 */
1687         WERROR spoolss_SetForm(
1688                 [in,ref] policy_handle *handle,
1689                 [in] [string,charset(UTF16)] uint16 form_name[],
1690                 [in] uint32 level,
1691                 [in,switch_is(level)] spoolss_AddFormInfo info
1692         );
1693
1694         /******************/
1695         /* Function: 0x22 */
1696         [public,noopnum,noprint] WERROR _spoolss_EnumForms(
1697                 [in,ref] policy_handle *handle,
1698                 [in]     uint32 level,
1699                 [in,unique] DATA_BLOB *buffer,
1700                 [in]     uint32 offered,
1701                 [out,unique] DATA_BLOB *info,
1702                 [out,ref] uint32 *needed,
1703                 [out,ref] uint32 *count
1704         );
1705         [public,noopnum,noprint] void __spoolss_EnumForms(
1706                 [in] uint32 level,
1707                 [in] uint32 count,
1708                 [out,switch_is(level)] spoolss_FormInfo info[count]
1709         );
1710         [nopull,nopush] WERROR spoolss_EnumForms(
1711                 [in,ref] policy_handle *handle,
1712                 [in]     uint32 level,
1713                 [in,unique] DATA_BLOB *buffer,
1714                 [in]     uint32 offered,
1715                 [out,ref] uint32 *count,
1716                 [out,ref,switch_is(level),size_is(,*count)] spoolss_FormInfo **info,
1717                 [out,ref] uint32 *needed
1718         );
1719
1720         /*
1721          * Special strings for the OpenPrinter() call.  See the MSDN DDK
1722          * docs on the XcvDataPort() for more details.
1723          */
1724
1725         const string SPL_LOCAL_PORT             = "Local Port";
1726         const string SPL_TCPIP_PORT             = "Standard TCP/IP Port";
1727         const string SPL_XCV_MONITOR_LOCALMON   = ",XcvMonitor Local Port";
1728         const string SPL_XCV_MONITOR_TCPMON     = ",XcvMonitor Standard TCP/IP Port";
1729
1730         typedef [public,gensize] struct {
1731                 [relative] nstring *port_name;
1732         } spoolss_PortInfo1;
1733
1734         typedef bitmap {
1735                 SPOOLSS_PORT_TYPE_WRITE         = 0x00000001,
1736                 SPOOLSS_PORT_TYPE_READ          = 0x00000002,
1737                 SPOOLSS_PORT_TYPE_REDIRECTED    = 0x00000004,
1738                 SPOOLSS_PORT_TYPE_NET_ATTACHED  = 0x00000008
1739         } spoolss_PortType;
1740
1741         typedef [public,gensize] struct {
1742                 [relative] nstring *port_name;
1743                 [relative] nstring *monitor_name;
1744                 [relative] nstring *description;
1745                 spoolss_PortType port_type;
1746                 uint32 reserved;
1747         } spoolss_PortInfo2;
1748
1749         typedef [v1_enum] enum {
1750                 PORT_STATUS_CLEAR               = 0x00000000,
1751                 PORT_STATUS_OFFLINE             = 0x00000001,
1752                 PORT_STATUS_PAPER_JAM           = 0x00000002,
1753                 PORT_STATUS_PAPER_OUT           = 0x00000003,
1754                 PORT_STATUS_OUTPUT_BIN_FULL     = 0x00000004,
1755                 PORT_STATUS_PAPER_PROBLEM       = 0x00000005,
1756                 PORT_STATUS_NO_TONER            = 0x00000006,
1757                 PORT_STATUS_DOOR_OPEN           = 0x00000007,
1758                 PORT_STATUS_USER_INTERVENTION   = 0x00000008,
1759                 PORT_STATUS_OUT_OF_MEMORY       = 0x00000009,
1760                 PORT_STATUS_TONER_LOW           = 0x0000000A,
1761                 PORT_STATUS_WARMING_UP          = 0x0000000B,
1762                 PORT_STATUS_POWER_SAVE          = 0x0000000C
1763         } spoolss_PortStatus;
1764
1765         typedef [v1_enum] enum {
1766                 PORT_STATUS_TYPE_ERROR          = 0x00000001,
1767                 PORT_STATUS_TYPE_WARNING        = 0x00000002,
1768                 PORT_STATUS_TYPE_INFO           = 0x00000003
1769         } spoolss_PortSeverity;
1770
1771         typedef [public,gensize] struct {
1772                 spoolss_PortStatus status;
1773                 [relative] nstring *status_string;
1774                 spoolss_PortSeverity severity;
1775         } spoolss_PortInfo3;
1776
1777         typedef [public,gensize] struct {
1778                 [relative] nstring *port_name;
1779                 DATA_BLOB monitor_data; /* relative ?? */
1780         } spoolss_PortInfoFF;
1781
1782         typedef [nodiscriminant,relative_base,public] union {
1783                 [case(1)] spoolss_PortInfo1 info1;
1784                 [case(2)] spoolss_PortInfo2 info2;
1785                 [case(3)] spoolss_PortInfo3 info3;
1786                 [case(0xff)] spoolss_PortInfoFF infoFF;
1787                 [default];
1788         } spoolss_PortInfo;
1789
1790         /******************/
1791         /* Function: 0x23 */
1792         [public,noopnum,noprint] WERROR _spoolss_EnumPorts(
1793                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1794                 [in] uint32 level,
1795                 [in,unique] DATA_BLOB *buffer,
1796                 [in] uint32 offered,
1797                 [out,unique] DATA_BLOB *info,
1798                 [out,ref] uint32 *needed,
1799                 [out,ref] uint32 *count
1800         );
1801         [public,noopnum,noprint] void __spoolss_EnumPorts(
1802                 [in] uint32 level,
1803                 [in] uint32 count,
1804                 [out,switch_is(level)] spoolss_PortInfo info[count]
1805         );
1806         [nopull,nopush] WERROR spoolss_EnumPorts(
1807                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1808                 [in] uint32 level,
1809                 [in,unique] DATA_BLOB *buffer,
1810                 [in] uint32 offered,
1811                 [out,ref] uint32 *count,
1812                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PortInfo **info,
1813                 [out,ref] uint32 *needed
1814         );
1815
1816         /******************/
1817         /* Function: 0x24 */
1818         typedef [public,gensize] struct {
1819                 [relative] nstring *monitor_name;
1820         } spoolss_MonitorInfo1;
1821
1822         typedef [public,gensize] struct {
1823                 [relative] nstring *monitor_name;
1824                 [relative] nstring *environment;
1825                 [relative] nstring *dll_name;
1826         } spoolss_MonitorInfo2;
1827
1828         typedef [nodiscriminant,relative_base,public] union {
1829                 [case(1)] spoolss_MonitorInfo1 info1;
1830                 [case(2)] spoolss_MonitorInfo2 info2;
1831                 [default];
1832         } spoolss_MonitorInfo;
1833
1834         [public,noopnum,noprint] WERROR _spoolss_EnumMonitors(
1835                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1836                 [in] uint32 level,
1837                 [in,unique] DATA_BLOB *buffer,
1838                 [in] uint32 offered,
1839                 [out,unique] DATA_BLOB *info,
1840                 [out,ref] uint32 *needed,
1841                 [out,ref] uint32 *count
1842         );
1843         [public,noopnum,noprint] void __spoolss_EnumMonitors(
1844                 [in] uint32 level,
1845                 [in] uint32 count,
1846                 [out,switch_is(level)] spoolss_MonitorInfo info[count]
1847         );
1848         [nopull,nopush] WERROR spoolss_EnumMonitors(
1849                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1850                 [in] uint32 level,
1851                 [in,unique] DATA_BLOB *buffer,
1852                 [in] uint32 offered,
1853                 [out,ref] uint32 *count,
1854                 [out,ref,switch_is(level),size_is(,*count)] spoolss_MonitorInfo **info,
1855                 [out,ref] uint32 *needed
1856         );
1857
1858         /******************/
1859         /* Function: 0x25 */
1860         WERROR spoolss_AddPort(
1861                [in,unique] [string,charset(UTF16)] uint16 *server_name,
1862                [in] uint32 unknown,
1863                [in] [string,charset(UTF16)] uint16 monitor_name[]
1864         );
1865
1866         /******************/
1867         /* Function: 0x26 */
1868         [todo] WERROR spoolss_ConfigurePort(
1869         );
1870
1871         /******************/
1872         /* Function: 0x27 */
1873         [todo] WERROR spoolss_DeletePort(
1874         );
1875
1876         /******************/
1877         /* Function: 0x28 */
1878         WERROR spoolss_CreatePrinterIC(
1879                 [in,ref] policy_handle *handle,
1880                 [out,ref] policy_handle *gdi_handle,
1881                 [in,ref] spoolss_DevmodeContainer *devmode_ctr
1882         );
1883
1884         /******************/
1885         /* Function: 0x29 */
1886         [todo] WERROR spoolss_PlayGDIScriptOnPrinterIC(
1887         );
1888
1889         /******************/
1890         /* Function: 0x2a */
1891         WERROR spoolss_DeletePrinterIC(
1892                 [in,out,ref] policy_handle *gdi_handle
1893         );
1894
1895         /******************/
1896         /* Function: 0x2b */
1897         [todo] WERROR spoolss_AddPrinterConnection(
1898         );
1899
1900         /******************/
1901         /* Function: 0x2c */
1902         [todo] WERROR spoolss_DeletePrinterConnection(
1903         );
1904
1905         /******************/
1906         /* Function: 0x2d */
1907         [todo] WERROR spoolss_PrinterMessageBox(
1908                 /* Marked as obsolete in MSDN.  "Not necessary and has
1909                    no effect". */
1910         );
1911
1912         /******************/
1913         /* Function: 0x2e */
1914         [todo] WERROR spoolss_AddMonitor(
1915         );
1916
1917         /******************/
1918         /* Function: 0x2f */
1919         [todo] WERROR spoolss_DeleteMonitor(
1920         );
1921
1922         /******************/
1923         /* Function: 0x30 */
1924         [todo] WERROR spoolss_DeletePrintProcessor(
1925         );
1926
1927         /******************/
1928         /* Function: 0x31 */
1929         [todo] WERROR spoolss_AddPrintProvidor(
1930         );
1931
1932         /******************/
1933         /* Function: 0x32 */
1934         [todo] WERROR spoolss_DeletePrintProvidor(
1935         );
1936
1937         /******************/
1938         /* Function: 0x33 */
1939
1940         typedef [public,gensize] struct {
1941                 [relative] nstring *name_array;
1942         } spoolss_PrintProcDataTypesInfo1;
1943
1944         typedef [nodiscriminant,relative_base,public] union {
1945                 [case(1)] spoolss_PrintProcDataTypesInfo1 info1;
1946                 [default];
1947         } spoolss_PrintProcDataTypesInfo;
1948
1949         [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcDataTypes(
1950                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1951                 [in,unique] [string,charset(UTF16)] uint16 *print_processor_name,
1952                 [in] uint32 level,
1953                 [in,unique] DATA_BLOB *buffer,
1954                 [in] uint32 offered,
1955                 [out,unique] DATA_BLOB *info,
1956                 [out,ref] uint32 *needed,
1957                 [out,ref] uint32 *count
1958         );
1959         [public,noopnum,noprint] void __spoolss_EnumPrintProcDataTypes(
1960                 [in] uint32 level,
1961                 [in] uint32 count,
1962                 [out,switch_is(level)] spoolss_PrintProcDataTypesInfo info[count]
1963         );
1964         [nopull,nopush] WERROR spoolss_EnumPrintProcDataTypes(
1965                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1966                 [in,unique] [string,charset(UTF16)] uint16 *print_processor_name,
1967                 [in] uint32 level,
1968                 [in,unique] DATA_BLOB *buffer,
1969                 [in] uint32 offered,
1970                 [out,ref] uint32 *count,
1971                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrintProcDataTypesInfo **info,
1972                 [out,ref] uint32 *needed
1973         );
1974
1975         /******************/
1976         /* Function: 0x34 */
1977         WERROR spoolss_ResetPrinter(
1978                 [in,ref] policy_handle *handle,
1979                 [in,unique] [string,charset(UTF16)] uint16 *data_type,
1980                 [in,ref] spoolss_DevmodeContainer *devmode_ctr
1981         );
1982
1983         /******************/
1984         /* Function: 0x35 */
1985         WERROR spoolss_GetPrinterDriver2(
1986                 [in,ref] policy_handle *handle,
1987                 [in,unique] [string,charset(UTF16)] uint16 *architecture,
1988                 [in]     uint32 level,
1989                 [in,unique] DATA_BLOB *buffer,
1990                 [in]     uint32 offered,
1991                 [in]     uint32 client_major_version,
1992                 [in]     uint32 client_minor_version,
1993                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverInfo *info,
1994                 [out,ref] uint32 *needed,
1995                 [out,ref] uint32 *server_major_version,
1996                 [out,ref] uint32 *server_minor_version
1997         );
1998
1999         /******************/
2000         /* Function: 0x36 */
2001         [todo] WERROR spoolss_FindFirstPrinterChangeNotification(
2002         );
2003
2004         /******************/
2005         /* Function: 0x37 */
2006         [todo] WERROR spoolss_FindNextPrinterChangeNotification(
2007         );
2008
2009         /******************/
2010         /* Function: 0x38 */
2011         [public] WERROR spoolss_FindClosePrinterNotify(
2012                 [in,ref] policy_handle *handle
2013         );
2014
2015         /******************/
2016         /* Function: 0x39 */
2017         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotificationOld(
2018         );
2019
2020         /******************/
2021         /* Function: 0x3a */
2022         [public] WERROR spoolss_ReplyOpenPrinter(
2023                 [in,string,charset(UTF16)] uint16 server_name[],
2024                 [in] uint32 printer_local,
2025                 [in] winreg_Type type,
2026                 [in,range(0,512)] uint32 bufsize,
2027                 [in,unique,size_is(bufsize)] uint8 *buffer,
2028                 [out,ref] policy_handle *handle
2029         );
2030
2031         /******************/
2032         /* Function: 0x3b */
2033
2034         typedef [bitmap32bit] bitmap {
2035                 PRINTER_CHANGE_ADD_PRINTER                      = 0x00000001,
2036                 PRINTER_CHANGE_SET_PRINTER                      = 0x00000002,
2037                 PRINTER_CHANGE_DELETE_PRINTER                   = 0x00000004,
2038                 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER        = 0x00000008,
2039                 PRINTER_CHANGE_ADD_JOB                          = 0x00000100,
2040                 PRINTER_CHANGE_SET_JOB                          = 0x00000200,
2041                 PRINTER_CHANGE_DELETE_JOB                       = 0x00000400,
2042                 PRINTER_CHANGE_WRITE_JOB                        = 0x00000800,
2043                 PRINTER_CHANGE_ADD_FORM                         = 0x00010000,
2044                 PRINTER_CHANGE_SET_FORM                         = 0x00020000,
2045                 PRINTER_CHANGE_DELETE_FORM                      = 0x00040000,
2046                 PRINTER_CHANGE_ADD_PORT                         = 0x00100000,
2047                 PRINTER_CHANGE_CONFIGURE_PORT                   = 0x00200000,
2048                 PRINTER_CHANGE_DELETE_PORT                      = 0x00400000,
2049                 PRINTER_CHANGE_ADD_PRINT_PROCESSOR              = 0x01000000,
2050                 PRINTER_CHANGE_DELETE_PRINT_PROCESSOR           = 0x04000000,
2051                 PRINTER_CHANGE_SERVER                           = 0x08000000,
2052                 PRINTER_CHANGE_ADD_PRINTER_DRIVER               = 0x10000000,
2053                 PRINTER_CHANGE_SET_PRINTER_DRIVER               = 0x20000000,
2054                 PRINTER_CHANGE_DELETE_PRINTER_DRIVER            = 0x40000000,
2055                 PRINTER_CHANGE_TIMEOUT                          = 0x80000000
2056         } spoolss_PrinterChangeFlags;
2057
2058         const int PRINTER_CHANGE_PRINTER                        = 0x000000FF;
2059
2060         const int PRINTER_CHANGE_JOB                            = 0x0000FF00;
2061
2062         const int PRINTER_CHANGE_FORM                           = (PRINTER_CHANGE_ADD_FORM |
2063                                                                    PRINTER_CHANGE_SET_FORM |
2064                                                                    PRINTER_CHANGE_DELETE_FORM); /* 0x00070000 */
2065
2066         const int PRINTER_CHANGE_PORT                           = (PRINTER_CHANGE_ADD_PORT |
2067                                                                    PRINTER_CHANGE_CONFIGURE_PORT |
2068                                                                    PRINTER_CHANGE_DELETE_PORT); /* 0x00700000 */
2069
2070         const int PRINTER_CHANGE_PRINT_PROCESSOR                = 0x07000000;
2071
2072         const int PRINTER_CHANGE_PRINTER_DRIVER                 = (PRINTER_CHANGE_ADD_PRINTER_DRIVER |
2073                                                                    PRINTER_CHANGE_SET_PRINTER_DRIVER |
2074                                                                    PRINTER_CHANGE_DELETE_PRINTER_DRIVER); /* 0x70000000 */
2075
2076         const int PRINTER_CHANGE_ALL                            = (PRINTER_CHANGE_PRINTER |
2077                                                                    PRINTER_CHANGE_JOB |
2078                                                                    PRINTER_CHANGE_FORM |
2079                                                                    PRINTER_CHANGE_PORT |
2080                                                                    PRINTER_CHANGE_PRINT_PROCESSOR |
2081                                                                    PRINTER_CHANGE_PRINTER_DRIVER); /* 0x7777FFFF */
2082         WERROR spoolss_RouterReplyPrinter(
2083                 [in,ref] policy_handle *handle,
2084                 [in] spoolss_PrinterChangeFlags flags,
2085                 [in,range(0,512)] uint32 bufsize,
2086                 [in,unique,size_is(bufsize)] uint8 *buffer
2087         );
2088
2089         /******************/
2090         /* Function: 0x3c */
2091         [public] WERROR spoolss_ReplyClosePrinter(
2092                 [in,out,ref] policy_handle *handle
2093         );
2094
2095         /******************/
2096         /* Function: 0x3d */
2097         [todo] WERROR spoolss_AddPortEx(
2098         );
2099
2100         /******************/
2101         /* Function: 0x3e */
2102         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotification(
2103         );
2104
2105         /******************/
2106         /* Function: 0x3f */
2107         [todo] WERROR spoolss_SpoolerInit(
2108         );
2109
2110         /******************/
2111         /* Function: 0x40 */
2112         [todo] WERROR spoolss_ResetPrinterEx(
2113         );
2114
2115         typedef [enum16bit,public] enum {
2116                 JOB_NOTIFY_FIELD_PRINTER_NAME                   = 0x00,
2117                 JOB_NOTIFY_FIELD_MACHINE_NAME                   = 0x01,
2118                 JOB_NOTIFY_FIELD_PORT_NAME                      = 0x02,
2119                 JOB_NOTIFY_FIELD_USER_NAME                      = 0x03,
2120                 JOB_NOTIFY_FIELD_NOTIFY_NAME                    = 0x04,
2121                 JOB_NOTIFY_FIELD_DATATYPE                       = 0x05,
2122                 JOB_NOTIFY_FIELD_PRINT_PROCESSOR                = 0x06,
2123                 JOB_NOTIFY_FIELD_PARAMETERS                     = 0x07,
2124                 JOB_NOTIFY_FIELD_DRIVER_NAME                    = 0x08,
2125                 JOB_NOTIFY_FIELD_DEVMODE                        = 0x09,
2126                 JOB_NOTIFY_FIELD_STATUS                         = 0x0a,
2127                 JOB_NOTIFY_FIELD_STATUS_STRING                  = 0x0b,
2128                 JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR            = 0x0c,
2129                 JOB_NOTIFY_FIELD_DOCUMENT                       = 0x0d,
2130                 JOB_NOTIFY_FIELD_PRIORITY                       = 0x0e,
2131                 JOB_NOTIFY_FIELD_POSITION                       = 0x0f,
2132                 JOB_NOTIFY_FIELD_SUBMITTED                      = 0x10,
2133                 JOB_NOTIFY_FIELD_START_TIME                     = 0x11,
2134                 JOB_NOTIFY_FIELD_UNTIL_TIME                     = 0x12,
2135                 JOB_NOTIFY_FIELD_TIME                           = 0x13,
2136                 JOB_NOTIFY_FIELD_TOTAL_PAGES                    = 0x14,
2137                 JOB_NOTIFY_FIELD_PAGES_PRINTED                  = 0x15,
2138                 JOB_NOTIFY_FIELD_TOTAL_BYTES                    = 0x16,
2139                 JOB_NOTIFY_FIELD_BYTES_PRINTED                  = 0x17
2140         } spoolss_JobNotifyField;
2141
2142         typedef [enum16bit,public] enum {
2143                 PRINTER_NOTIFY_FIELD_SERVER_NAME                = 0x00,
2144                 PRINTER_NOTIFY_FIELD_PRINTER_NAME               = 0x01,
2145                 PRINTER_NOTIFY_FIELD_SHARE_NAME                 = 0x02,
2146                 PRINTER_NOTIFY_FIELD_PORT_NAME                  = 0x03,
2147                 PRINTER_NOTIFY_FIELD_DRIVER_NAME                = 0x04,
2148                 PRINTER_NOTIFY_FIELD_COMMENT                    = 0x05,
2149                 PRINTER_NOTIFY_FIELD_LOCATION                   = 0x06,
2150                 PRINTER_NOTIFY_FIELD_DEVMODE                    = 0x07,
2151                 PRINTER_NOTIFY_FIELD_SEPFILE                    = 0x08,
2152                 PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR            = 0x09,
2153                 PRINTER_NOTIFY_FIELD_PARAMETERS                 = 0x0a,
2154                 PRINTER_NOTIFY_FIELD_DATATYPE                   = 0x0b,
2155                 PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR        = 0x0c,
2156                 PRINTER_NOTIFY_FIELD_ATTRIBUTES                 = 0x0d,
2157                 PRINTER_NOTIFY_FIELD_PRIORITY                   = 0x0e,
2158                 PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY           = 0x0f,
2159                 PRINTER_NOTIFY_FIELD_START_TIME                 = 0x10,
2160                 PRINTER_NOTIFY_FIELD_UNTIL_TIME                 = 0x11,
2161                 PRINTER_NOTIFY_FIELD_STATUS                     = 0x12,
2162                 PRINTER_NOTIFY_FIELD_STATUS_STRING              = 0x13,
2163                 PRINTER_NOTIFY_FIELD_CJOBS                      = 0x14,
2164                 PRINTER_NOTIFY_FIELD_AVERAGE_PPM                = 0x15,
2165                 PRINTER_NOTIFY_FIELD_TOTAL_PAGES                = 0x16,
2166                 PRINTER_NOTIFY_FIELD_PAGES_PRINTED              = 0x17,
2167                 PRINTER_NOTIFY_FIELD_TOTAL_BYTES                = 0x18,
2168                 PRINTER_NOTIFY_FIELD_BYTES_PRINTED              = 0x19,
2169                 PRINTER_NOTIFY_FIELD_OBJECT_GUID                = 0x1a,
2170                 PRINTER_NOTIFY_FIELD_FRIENDLY_NAME              = 0x1b
2171         } spoolss_PrintNotifyField;
2172
2173         typedef [enum16bit] enum {
2174                 PRINTER_NOTIFY_TYPE     = 0x00,
2175                 JOB_NOTIFY_TYPE         = 0x01
2176         } spoolss_NotifyType;
2177
2178         typedef [nodiscriminant,noprint] union {
2179                 [case(PRINTER_NOTIFY_TYPE)] uint16 field;
2180                 [case(JOB_NOTIFY_TYPE)] uint16 field;
2181                 [default] uint16 field;
2182         } spoolss_Field;
2183
2184         /******************/
2185         /* Function: 0x41 */
2186         typedef struct {
2187                 spoolss_NotifyType type;
2188                 uint16 u1;
2189                 uint32 u2;
2190                 uint32 u3;
2191                 uint32 count;
2192                 [size_is(count),switch_is(type)] spoolss_Field *fields;
2193         } spoolss_NotifyOptionType;
2194
2195         typedef [bitmap32bit] bitmap {
2196                 PRINTER_NOTIFY_OPTIONS_REFRESH  = 0x00000001
2197         } spoolssNotifyOptionFlags;
2198
2199         typedef struct {
2200                 [value(2)] uint32 version;
2201                 spoolssNotifyOptionFlags flags;
2202                 uint32 count;
2203                 [size_is(count)] spoolss_NotifyOptionType *types;
2204         } spoolss_NotifyOption;
2205
2206         [public] WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
2207                 [in,ref] policy_handle *handle,
2208                 [in] spoolss_PrinterChangeFlags flags,
2209                 [in] uint32 options,
2210                 [in,unique] [string,charset(UTF16)] uint16 *local_machine,
2211                 [in] uint32 printer_local,
2212                 [in,unique] spoolss_NotifyOption *notify_options
2213         );
2214
2215         /******************/
2216         /* Function: 0x42 */
2217
2218         typedef struct {
2219                 uint32 size;
2220                 [size_is(size/2),unique,charset(UTF16)] uint16 *string;
2221         } spoolss_NotifyString;
2222
2223         typedef [v1_enum] enum {
2224                 NOTIFY_TABLE_DWORD              = 0x0001,
2225                 NOTIFY_TABLE_STRING             = 0x0002,
2226                 NOTIFY_TABLE_DEVMODE            = 0x0003,
2227                 NOTIFY_TABLE_TIME               = 0x0004,
2228                 NOTIFY_TABLE_SECURITYDESCRIPTOR = 0x0005
2229         } spoolss_NotifyTable;
2230
2231         typedef [switch_type(uint32)] union {
2232                 [case(1)] uint32 integer[2];
2233                 [case(2)] spoolss_NotifyString string;
2234                 [case(3)] spoolss_DevmodeContainer devmode;
2235                 [case(4)] spoolss_TimeCtr time;
2236                 [case(5)] sec_desc_buf sd;
2237         } spoolss_NotifyData;
2238
2239         typedef struct {
2240                 spoolss_NotifyType type;
2241                 [switch_is(type)] spoolss_Field field;
2242                 spoolss_NotifyTable variable_type;
2243                 uint32 job_id;
2244                 [switch_is(variable_type)] spoolss_NotifyData data;
2245         } spoolss_Notify;
2246
2247         typedef struct {
2248                 [value(2)] uint32 version;
2249                 uint32 flags;
2250                 uint32 count;
2251                 [size_is(count)] spoolss_Notify notifies[];
2252         } spoolss_NotifyInfo;
2253
2254         typedef [switch_type(uint32)] union {
2255                 [case(0)] spoolss_NotifyInfo *info0;
2256         } spoolss_ReplyPrinterInfo;
2257
2258         typedef [bitmap32bit] bitmap {
2259                 PRINTER_NOTIFY_INFO_DISCARDED           = 0x00000001,
2260                 PRINTER_NOTIFY_INFO_DISCARDNOTED        = 0x00010000,
2261                 PRINTER_NOTIFY_INFO_COLOR_MISMATCH      = 0x00080000
2262         } spoolss_PrinterNotifyFlags;
2263
2264         WERROR spoolss_RouterReplyPrinterEx(
2265                 [in,ref] policy_handle *handle,
2266                 [in] uint32 color,
2267                 [in] spoolss_PrinterChangeFlags flags,
2268                 [out,ref] spoolss_PrinterNotifyFlags *reply_result,
2269                 [in] uint32 reply_type,
2270                 [in,switch_is(reply_type)] spoolss_ReplyPrinterInfo info
2271         );
2272
2273         /******************/
2274         /* Function: 0x43 */
2275         [public] WERROR spoolss_RouterRefreshPrinterChangeNotify(
2276                 [in,ref] policy_handle *handle,
2277                 [in] uint32 change_low,
2278                 [in,unique] spoolss_NotifyOption *options,
2279                 [out,ref] spoolss_NotifyInfo **info
2280         );
2281
2282         /******************/
2283         /* Function: 0x44 */
2284         [todo] WERROR spoolss_44(
2285         );
2286
2287         typedef struct {
2288                 uint32 size;
2289                 [string,charset(UTF16)] uint16 *client;
2290                 [string,charset(UTF16)] uint16 *user;
2291                 uint32 build;
2292                 spoolss_MajorVersion major;
2293                 spoolss_MinorVersion minor;
2294                 spoolss_ProcessorArchitecture processor;
2295         } spoolss_UserLevel1;
2296
2297         typedef struct {
2298                 uint32 not_used;
2299         } spoolss_UserLevel2;
2300
2301         typedef struct {
2302                 uint32 size;
2303                 uint32 flags;
2304                 uint32 size2;
2305                 [string,charset(UTF16)] uint16 *client;
2306                 [string,charset(UTF16)] uint16 *user;
2307                 uint32 build;
2308                 spoolss_MajorVersion major;
2309                 spoolss_MinorVersion minor;
2310                 spoolss_ProcessorArchitecture processor;
2311                 udlong reserved;
2312         } spoolss_UserLevel3;
2313
2314         typedef [switch_type(uint32)] union {
2315                 [case(1)]  spoolss_UserLevel1 *level1;
2316                 [case(2)]  spoolss_UserLevel2 *level2;
2317                 [case(3)]  spoolss_UserLevel3 *level3;
2318         } spoolss_UserLevel;
2319
2320         typedef struct {
2321                 uint32 level;
2322                 [switch_is(level)] spoolss_UserLevel user_info;
2323         } spoolss_UserLevelCtr;
2324
2325         typedef bitmap {
2326                 SERVER_ACCESS_ADMINISTER        = 0x00000001,
2327                 SERVER_ACCESS_ENUMERATE         = 0x00000002,
2328                 PRINTER_ACCESS_ADMINISTER       = 0x00000004,
2329                 PRINTER_ACCESS_USE              = 0x00000008,
2330                 JOB_ACCESS_ADMINISTER           = 0x00000010,
2331                 JOB_ACCESS_READ                 = 0x00000020
2332         } spoolss_AccessRights;
2333
2334         /* Access rights for print servers */
2335         const int SERVER_ALL_ACCESS     = SEC_STD_REQUIRED |
2336                                           SERVER_ACCESS_ADMINISTER |
2337                                           SERVER_ACCESS_ENUMERATE;
2338
2339         const int SERVER_READ           = SEC_STD_READ_CONTROL |
2340                                           SERVER_ACCESS_ENUMERATE;
2341
2342         const int SERVER_WRITE          = STANDARD_RIGHTS_WRITE_ACCESS |
2343                                           SERVER_ACCESS_ADMINISTER |
2344                                           SERVER_ACCESS_ENUMERATE;
2345
2346         const int SERVER_EXECUTE        = SEC_STD_READ_CONTROL |
2347                                           SERVER_ACCESS_ENUMERATE;
2348
2349         /* Access rights for printers */
2350         const int PRINTER_ALL_ACCESS    = SEC_STD_REQUIRED |
2351                                           PRINTER_ACCESS_ADMINISTER |
2352                                           PRINTER_ACCESS_USE;
2353
2354         const int PRINTER_READ          = SEC_STD_READ_CONTROL |
2355                                           PRINTER_ACCESS_USE;
2356
2357         const int PRINTER_WRITE         = STANDARD_RIGHTS_WRITE_ACCESS |
2358                                           PRINTER_ACCESS_USE;
2359
2360         const int PRINTER_EXECUTE       = SEC_STD_READ_CONTROL |
2361                                           PRINTER_ACCESS_USE;
2362
2363         /* Access rights for jobs */
2364         const int JOB_ALL_ACCESS        = SEC_STD_REQUIRED |
2365                                           JOB_ACCESS_ADMINISTER;
2366
2367         const int JOB_READ              = SEC_STD_READ_CONTROL |
2368                                           JOB_ACCESS_ADMINISTER;
2369
2370         const int JOB_WRITE             = STANDARD_RIGHTS_WRITE_ACCESS |
2371                                           JOB_ACCESS_ADMINISTER;
2372
2373         const int JOB_EXECUTE           = SEC_STD_READ_CONTROL |
2374                                           JOB_ACCESS_ADMINISTER;
2375
2376         /* ACE masks for various print permissions */
2377         const int PRINTER_ACE_FULL_CONTROL = SEC_GENERIC_ALL |
2378                                                 PRINTER_ALL_ACCESS;
2379
2380         const int PRINTER_ACE_MANAGE_DOCUMENTS = SEC_GENERIC_ALL |
2381                                                 READ_CONTROL_ACCESS;
2382
2383         const int PRINTER_ACE_PRINT     = GENERIC_EXECUTE_ACCESS |
2384                                           READ_CONTROL_ACCESS |
2385                                           PRINTER_ACCESS_USE;
2386
2387         /******************/
2388         /* Function: 0x45 */
2389         [public] WERROR spoolss_OpenPrinterEx(
2390                 [in,unique]           [string,charset(UTF16)] uint16 *printername,
2391                 [in,unique]           [string,charset(UTF16)] uint16 *datatype,
2392                 [in]                  spoolss_DevmodeContainer devmode_ctr,
2393                 [in]                  spoolss_AccessRights access_mask,
2394                 [in]                  uint32 level,
2395                 [in,switch_is(level)] spoolss_UserLevel userlevel,
2396                 [out,ref]             policy_handle *handle
2397         );
2398
2399         /******************/
2400         /* Function: 0x46 */
2401         WERROR spoolss_AddPrinterEx(
2402                 [in,unique] [string,charset(UTF16)] uint16 *server,
2403                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
2404                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
2405                 [in,ref] sec_desc_buf *secdesc_ctr,
2406                 [in,ref] spoolss_UserLevelCtr *userlevel_ctr,
2407                 [out,ref] policy_handle *handle
2408         );
2409
2410         /******************/
2411         /* Function: 0x47 */
2412         [todo] WERROR spoolss_47(
2413         );
2414
2415         /******************/
2416         /* Function: 0x48 */
2417         WERROR spoolss_EnumPrinterData(
2418                 [in,ref] policy_handle *handle,
2419                 [in]     uint32 enum_index,
2420                 [out,size_is(value_offered/2),charset(UTF16)] uint16 value_name[],
2421                 [in]     uint32 value_offered,
2422                 [out,ref] uint32 *value_needed,
2423                 [out,ref] winreg_Type *type,
2424                 [out,ref,size_is(data_offered),flag(LIBNDR_PRINT_ARRAY_HEX)] uint8 *data,
2425                 [in]     uint32 data_offered,
2426                 [out,ref] uint32 *data_needed
2427         );
2428
2429         /******************/
2430         /* Function: 0x49 */
2431         WERROR spoolss_DeletePrinterData(
2432                 [in,ref] policy_handle *handle,
2433                 [in] [string,charset(UTF16)] uint16 value_name[]
2434         );
2435
2436         /******************/
2437         /* Function: 0x4a */
2438         [todo] WERROR spoolss_4a(
2439         );
2440
2441         /******************/
2442         /* Function: 0x4b */
2443         [todo] WERROR spoolss_4b(
2444         );
2445
2446         /******************/
2447         /* Function: 0x4c */
2448         [todo] WERROR spoolss_4c(
2449         );
2450
2451         /******************/
2452         /* Function: 0x4d */
2453         WERROR spoolss_SetPrinterDataEx(
2454                 [in,ref] policy_handle *handle,
2455                 [in]     [string,charset(UTF16)] uint16 key_name[],
2456                 [in]     [string,charset(UTF16)] uint16 value_name[],
2457                 [in]     winreg_Type type,
2458                 [in,ref] [size_is(offered)] uint8 *buffer,
2459                 [in]     uint32 offered
2460         );
2461
2462         /******************/
2463         /* Function: 0x4e */
2464         WERROR spoolss_GetPrinterDataEx(
2465                 [in,ref] policy_handle *handle,
2466                 [in]     [string,charset(UTF16)] uint16 key_name[],
2467                 [in]     [string,charset(UTF16)] uint16 value_name[],
2468                 [out,ref] winreg_Type *type,
2469                 [out,ref] [size_is(offered)] uint8 *buffer,
2470                 [in]     uint32 offered,
2471                 [out,ref] uint32 *needed
2472         );
2473
2474         /******************/
2475         /* Function: 0x4f */
2476
2477         typedef [relative_base,public,gensize] struct {
2478                 [relative] nstring *value_name;
2479                 [value(2*strlen_m_term(value_name))] uint32 value_name_len;
2480                 winreg_Type type;
2481                 [relative,switch_is(type),subcontext(0),subcontext_size(r->data_length)] spoolss_PrinterData *data;
2482                 [value(ndr_size_spoolss_PrinterData(data, type, ndr->iconv_convenience, ndr->flags))] uint32 data_length;
2483         } spoolss_PrinterEnumValues;
2484
2485         [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDataEx(
2486                 [in,ref] policy_handle *handle,
2487                 [in]     [string,charset(UTF16)] uint16 key_name[],
2488                 [out] DATA_BLOB info,
2489                 [in] uint32 offered,
2490                 [out,ref] uint32 *needed,
2491                 [out,ref] uint32 *count
2492         );
2493         [public,noopnum,noprint] void __spoolss_EnumPrinterDataEx(
2494                 [in] uint32 count,
2495                 [out] spoolss_PrinterEnumValues info[count]
2496         );
2497         [nopull,nopush] WERROR spoolss_EnumPrinterDataEx(
2498                 [in,ref] policy_handle *handle,
2499                 [in]     [string,charset(UTF16)] uint16 key_name[],
2500                 [in] uint32 offered,
2501                 [out,ref] uint32 *count,
2502                 [out,ref,size_is(,*count)] spoolss_PrinterEnumValues **info,
2503                 [out,ref] uint32 *needed
2504         );
2505
2506         /******************/
2507         /* Function: 0x50 */
2508         [public] WERROR spoolss_EnumPrinterKey(
2509                 [in, ref] policy_handle *handle,
2510                 [in] [string,charset(UTF16)] uint16 key_name[],
2511                 [out,ref] [subcontext(0),subcontext_size(offered)] nstring_array **key_buffer,
2512                 [in] uint32 offered,
2513                 [out,ref] uint32 *needed
2514         );
2515
2516         /******************/
2517         /* Function: 0x51 */
2518         WERROR spoolss_DeletePrinterDataEx(
2519                 [in,ref] policy_handle *handle,
2520                 [in] [string,charset(UTF16)] uint16 key_name[],
2521                 [in] [string,charset(UTF16)] uint16 value_name[]
2522         );
2523
2524         /******************/
2525         /* Function: 0x52 */
2526         WERROR spoolss_DeletePrinterKey(
2527                 [in,ref] policy_handle *handle,
2528                 [in] [string,charset(UTF16)] uint16 key_name[]
2529         );
2530
2531         /******************/
2532         /* Function: 0x53 */
2533         [todo] WERROR spoolss_53(
2534         );
2535
2536         /******************/
2537         /* Function: 0x54 */
2538         typedef [public,bitmap32bit] bitmap {
2539                 DPD_DELETE_UNUSED_FILES         = 0x00000001,
2540                 DPD_DELETE_SPECIFIC_VERSION     = 0x00000002,
2541                 DPD_DELETE_ALL_FILES            = 0x00000004
2542         } spoolss_DeleteDriverFlags;
2543
2544         WERROR spoolss_DeletePrinterDriverEx(
2545                 [in,unique] [string,charset(UTF16)] uint16 *server,
2546                 [in] [string,charset(UTF16)] uint16 architecture[],
2547                 [in] [string,charset(UTF16)] uint16 driver[],
2548                 [in] spoolss_DeleteDriverFlags delete_flags,
2549                 [in] uint32 version
2550         );
2551
2552         /******************/
2553         /* Function: 0x55 */
2554         [todo] WERROR spoolss_55(
2555         );
2556
2557         /******************/
2558         /* Function: 0x56 */
2559         [todo] WERROR spoolss_56(
2560         );
2561
2562         /******************/
2563         /* Function: 0x57 */
2564         [todo] WERROR spoolss_57(
2565         );
2566
2567         /******************/
2568         /* Function: 0x58 */
2569
2570         typedef [v1_enum] enum {
2571                 PROTOCOL_RAWTCP_TYPE    = 1,
2572                 PROTOCOL_LPR_TYPE       = 2
2573         } spoolss_PortProtocol;
2574
2575         typedef [public] struct {
2576                 [charset(UTF16)] uint16 portname[64];
2577                 [value(0x00000001)] uint32 version;
2578                 spoolss_PortProtocol protocol;
2579                 [value(sizeof(r))] uint32 size;
2580                 uint32 reserved;
2581                 [charset(UTF16)] uint16 hostaddress[49];
2582                 [charset(UTF16)] uint16 snmpcommunity[33];
2583                 uint32 dblspool;
2584                 [charset(UTF16)] uint16 queue[33];
2585                 [charset(UTF16)] uint16 ip_address[16]; /* s3 had 17 */
2586                 [charset(UTF16)] uint16 hardware_address[13];
2587                 [charset(UTF16)] uint16 device_type[257];
2588                 uint32 port_number;
2589                 boolean32 snmp_enabled;
2590                 uint32 snmp_dev_index;
2591         } spoolss_PortData1;
2592
2593         typedef [public] struct {
2594                 [charset(UTF16)] uint16 portname[64];
2595                 [value(0x00000002)] uint32 version;
2596                 spoolss_PortProtocol protocol;
2597                 [value(sizeof(r))] uint32 size;
2598                 uint32 reserved;
2599                 [charset(UTF16)] uint16 hostaddress[128];
2600                 [charset(UTF16)] uint16 snmpcommunity[33];
2601                 uint32 dblspool;
2602                 [charset(UTF16)] uint16 queue[33];
2603                 [charset(UTF16)] uint16 device_type[257];
2604                 uint32 port_number;
2605                 boolean32 snmp_enabled;
2606                 uint32 snmp_dev_index;
2607                 uint32 port_monitor_mib_index;
2608         } spoolss_PortData2;
2609
2610         typedef [public] struct {
2611                 nstring dll_name;
2612         } spoolss_MonitorUi;
2613
2614         WERROR spoolss_XcvData(
2615                 [in,ref] policy_handle *handle,
2616                 [in] [string,charset(UTF16)] uint16 function_name[],
2617                 [in] DATA_BLOB in_data,
2618                 [in,value(r->in.in_data.length)] uint32 _in_data_length,
2619                 [out,ref] [size_is(out_data_size)] uint8 *out_data,
2620                 [in] uint32 out_data_size,
2621                 [out,ref] uint32 *needed,
2622                 [in,out,ref] uint32 *status_code
2623         );
2624
2625         /******************/
2626         /* Function: 0x59 */
2627
2628         typedef [bitmap32bit] bitmap {
2629                 APD_STRICT_UPGRADE              = 0x00000001,
2630                 APD_STRICT_DOWNGRADE            = 0x00000002,
2631                 APD_COPY_ALL_FILES              = 0x00000004,
2632                 APD_COPY_NEW_FILES              = 0x00000008,
2633                 APD_COPY_FROM_DIRECTORY         = 0x00000010,
2634                 APD_DONT_COPY_FILES_TO_CLUSTER  = 0x00001000,
2635                 APD_COPY_TO_ALL_SPOOLERS        = 0x00002000,
2636                 APD_RETURN_BLOCKING_STATUS_CODE = 0x00010000
2637         } spoolss_AddPrinterDriverExFlags;
2638
2639         [public] WERROR spoolss_AddPrinterDriverEx(
2640                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2641                 [in,ref] spoolss_AddDriverInfoCtr *info_ctr,
2642                 [in] spoolss_AddPrinterDriverExFlags flags
2643         );
2644
2645         /******************/
2646         /* Function: 0x5a */
2647         [todo] WERROR spoolss_5a(
2648         );
2649
2650         /******************/
2651         /* Function: 0x5b */
2652         [todo] WERROR spoolss_5b(
2653         );
2654
2655         /******************/
2656         /* Function: 0x5c */
2657         [todo] WERROR spoolss_5c(
2658         );
2659
2660         /******************/
2661         /* Function: 0x5d */
2662         [todo] WERROR spoolss_5d(
2663         );
2664
2665         /******************/
2666         /* Function: 0x5e */
2667         [todo] WERROR spoolss_5e(
2668         );
2669
2670         /******************/
2671         /* Function: 0x5f */
2672         [todo] WERROR spoolss_5f(
2673         );
2674
2675         /******************/
2676         /* Function: 0x60 */
2677         [todo] WERROR spoolss_60(
2678         );
2679
2680         /******************/
2681         /* Function: 0x61 */
2682         [todo] WERROR spoolss_61(
2683         );
2684
2685         /******************/
2686         /* Function: 0x62 */
2687         [todo] WERROR spoolss_62(
2688         );
2689
2690         /******************/
2691         /* Function: 0x63 */
2692         [todo] WERROR spoolss_63(
2693         );
2694
2695         /******************/
2696         /* Function: 0x64 */
2697         [todo] WERROR spoolss_64(
2698         );
2699
2700         /******************/
2701         /* Function: 0x65 */
2702         [todo] WERROR spoolss_65(
2703         );
2704
2705         /******************/
2706         /* Function: 0x66 */
2707         typedef struct {
2708                 GUID core_driver_guid;
2709                 NTTIME driver_date;
2710                 hyper driver_version;
2711                 [charset(UTF8)] uint8 formname[520];
2712         } spoolss_CorePrinterDriver;
2713
2714         WERROR spoolss_GetCorePrinterDrivers(
2715                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2716                 [in,ref] [string,charset(UTF16)] uint16 *architecture,
2717                 [in] uint32 core_driver_size,
2718                 [in,size_is(core_driver_size)] [charset(UTF16)] uint16 *core_driver_dependencies,
2719                 [in] uint32 core_printer_driver_count,
2720                 [out,size_is(core_printer_driver_count)] spoolss_CorePrinterDriver *core_printer_drivers
2721         );
2722
2723         /******************/
2724         /* Function: 0x67 */
2725         [todo] WERROR spoolss_67(
2726         );
2727
2728         /******************/
2729         /* Function: 0x68 */
2730         WERROR spoolss_GetPrinterDriverPackagePath(
2731                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2732                 [in,ref] [string,charset(UTF16)] uint16 *architecture,
2733                 [in,unique] [string,charset(UTF16)] uint16 *language,
2734                 [in,ref] [string,charset(UTF16)] uint16 *package_id,
2735                 [in,out,unique,size_is(driver_package_cab_size)] [charset(UTF16)] uint16 *driver_package_cab,
2736                 [in] uint32 driver_package_cab_size,
2737                 [out,ref] uint32 *required
2738                 );
2739
2740         /******************/
2741         /* Function: 0x69 */
2742         [todo] WERROR spoolss_69(
2743         );
2744
2745         /******************/
2746         /* Function: 0x6a */
2747         [todo] WERROR spoolss_6a(
2748         );
2749
2750         /******************/
2751         /* Function: 0x6b */
2752         [todo] WERROR spoolss_6b(
2753         );
2754
2755         /******************/
2756         /* Function: 0x6c */
2757         [todo] WERROR spoolss_6c(
2758         );
2759
2760         /******************/
2761         /* Function: 0x6d */
2762         [todo] WERROR spoolss_6d(
2763         );
2764 }