17357508ca39e1b9a9cf5e2ccc8a1620ee8f071e
[kai/samba.git] / librpc / idl / spoolss.idl
1 #include "idl_types.h"
2
3 /*
4   spoolss interface definitions
5 */
6 import "misc.idl", "security.idl", "winreg.idl";
7
8
9 cpp_quote("#define spoolss_security_descriptor security_descriptor")
10
11 [ uuid("12345678-1234-abcd-ef00-0123456789ab"),
12   version(1.0),
13   endpoint("ncacn_np:[\\pipe\\spoolss]"),
14   pointer_default(unique),
15   helpstring("Spooler SubSystem"),
16   helper("../librpc/ndr/ndr_spoolss_buf.h")
17 ] interface spoolss
18 {
19         typedef [v1_enum] enum winreg_Type winreg_Type;
20         typedef [gensize,noprint] struct {
21                 uint16 year;
22                 uint16 month;
23                 uint16 day_of_week;
24                 uint16 day;
25                 uint16 hour;
26                 uint16 minute;
27                 uint16 second;
28                 uint16 millisecond;
29         } spoolss_Time;
30
31         typedef struct {
32                 [value(ndr_size_spoolss_Time(time, ndr->flags))] uint32 size;
33                 [unique] spoolss_Time *time;
34         } spoolss_TimeCtr;
35
36         typedef enum {
37                 PROCESSOR_ARCHITECTURE_INTEL            = 0x0000,
38                 PROCESSOR_ARCHITECTURE_ARM              = 0x0005,
39                 PROCESSOR_ARCHITECTURE_IA64             = 0x0006,
40                 PROCESSOR_ARCHITECTURE_AMD64            = 0x0009
41         } spoolss_ProcessorArchitecture;
42
43         typedef [v1_enum] enum {
44                 PROCESSOR_ARM                           = 0x00000000,
45                 PROCESSOR_INTEL_386                     = 0x00000182,
46                 PROCESSOR_INTEL_486                     = 0x000001E6,
47                 PROCESSOR_INTEL_PENTIUM                 = 0x0000024A,
48                 PROCESSOR_INTEL_IA64                    = 0x00000898,
49                 PROCESSOR_AMD_X8664                     = 0x000022A0
50         } spoolss_ProcessorType;
51
52         typedef [v1_enum] enum {
53                 /* Windows 95, Windows 98, Windows Me, Windows NT4 */
54                 SPOOLSS_MAJOR_VERSION_NT4_95_98_ME      = 0x00000004,
55                 /* Windows 2000, Windows 2003, Windows XP */
56                 SPOOLSS_MAJOR_VERSION_2000_2003_XP      = 0x00000005,
57                 /* Windows Vista, Windows 2008 */
58                 SPOOLSS_MAJOR_VERSION_2008_VISTA        = 0x00000006
59         } spoolss_MajorVersion;
60
61         typedef [v1_enum] enum {
62                 /* Windows 2008, Windows Vista, Windows 2000, Windows NT4, Windows 95 */
63                 SPOOLSS_MINOR_VERSION_0                 = 0x00000000,
64                 /* Windows XP */
65                 SPOOLSS_MINOR_VERSION_XP                = 0x00000001,
66                 /* Windows 2003, Windows XP x64 */
67                 SPOOLSS_MINOR_VERSION_2003_XP64         = 0x00000002,
68                 /* Windows 98 */
69                 SPOOLSS_MINOR_VERSION_98                = 0x0000000a,
70                 /* Windows Me */
71                 SPOOLSS_MINOR_VERSION_ME                = 0x0000005a
72         } spoolss_MinorVersion;
73
74         const int PRINTER_STATUS_OK             = 0x00000000;
75
76         typedef [public] bitmap {
77                 PRINTER_STATUS_PAUSED           = 0x00000001,
78                 PRINTER_STATUS_ERROR            = 0x00000002,
79                 PRINTER_STATUS_PENDING_DELETION = 0x00000004,
80                 PRINTER_STATUS_PAPER_JAM        = 0x00000008,
81                 PRINTER_STATUS_PAPER_OUT        = 0x00000010,
82                 PRINTER_STATUS_MANUAL_FEED      = 0x00000020,
83                 PRINTER_STATUS_PAPER_PROBLEM    = 0x00000040,
84                 PRINTER_STATUS_OFFLINE          = 0x00000080,
85                 PRINTER_STATUS_IO_ACTIVE        = 0x00000100,
86                 PRINTER_STATUS_BUSY             = 0x00000200,
87                 PRINTER_STATUS_PRINTING         = 0x00000400,
88                 PRINTER_STATUS_OUTPUT_BIN_FULL  = 0x00000800,
89                 PRINTER_STATUS_NOT_AVAILABLE    = 0x00001000,
90                 PRINTER_STATUS_WAITING          = 0x00002000,
91                 PRINTER_STATUS_PROCESSING       = 0x00004000,
92                 PRINTER_STATUS_INITIALIZING     = 0x00008000,
93                 PRINTER_STATUS_WARMING_UP       = 0x00010000,
94                 PRINTER_STATUS_TONER_LOW        = 0x00020000,
95                 PRINTER_STATUS_NO_TONER         = 0x00040000,
96                 PRINTER_STATUS_PAGE_PUNT        = 0x00080000,
97                 PRINTER_STATUS_USER_INTERVENTION= 0x00100000,
98                 PRINTER_STATUS_OUT_OF_MEMORY    = 0x00200000,
99                 PRINTER_STATUS_DOOR_OPEN        = 0x00400000,
100                 PRINTER_STATUS_SERVER_UNKNOWN   = 0x00800000,
101                 PRINTER_STATUS_POWER_SAVE       = 0x01000000
102         } spoolss_PrinterStatus;
103
104         /* JOB status codes. */
105
106         const int JOB_STATUS_QUEUED = 0x0000;
107
108         typedef [bitmap32bit] bitmap {
109                 JOB_STATUS_PAUSED               = 0x00000001,
110                 JOB_STATUS_ERROR                = 0x00000002,
111                 JOB_STATUS_DELETING             = 0x00000004,
112                 JOB_STATUS_SPOOLING             = 0x00000008,
113                 JOB_STATUS_PRINTING             = 0x00000010,
114                 JOB_STATUS_OFFLINE              = 0x00000020,
115                 JOB_STATUS_PAPEROUT             = 0x00000040,
116                 JOB_STATUS_PRINTED              = 0x00000080,
117                 JOB_STATUS_DELETED              = 0x00000100,
118                 JOB_STATUS_BLOCKED_DEVQ         = 0x00000200,
119                 JOB_STATUS_USER_INTERVENTION    = 0x00000400,
120                 JOB_STATUS_RESTART              = 0x00000800,
121                 JOB_STATUS_COMPLETE             = 0x00001000
122         } spoolss_JobStatus;
123
124         typedef [v1_enum] enum {
125                 SPOOLSS_DEBUGGING_BUILD         = 0x00000000,
126                 SPOOLSS_RELEASE_BUILD           = 0x00000001
127         } spoolss_Build;
128
129         typedef [public,gensize] struct {
130                 [relative] nstring *printername;
131                 [relative] nstring *servername;
132                 uint32 cjobs;
133                 uint32 total_jobs;
134                 uint32 total_bytes;
135                 spoolss_Time time;
136                 uint32 global_counter;
137                 uint32 total_pages;
138                 uint32 version;
139                 spoolss_Build free_build;
140                 uint32 spooling;
141                 uint32 max_spooling;
142                 uint32 session_counter;
143                 uint32 num_error_out_of_paper;
144                 uint32 num_error_not_ready;
145                 spoolss_JobStatus job_error;
146                 uint32 number_of_processors;
147                 spoolss_ProcessorType processor_type;
148                 uint32 high_part_total_bytes;
149                 uint32 change_id;
150                 WERROR last_error;
151                 spoolss_PrinterStatus status;
152                 uint32 enumerate_network_printers;
153                 uint32 c_setprinter;
154                 spoolss_ProcessorArchitecture processor_architecture;
155                 uint16 processor_level;
156                 uint32 ref_ic;
157                 uint32 reserved2;
158                 uint32 reserved3;
159         } spoolss_PrinterInfo0;
160
161         /* Device Mode Extra Data */
162
163         typedef [v1_enum] enum {
164                 SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA        = 0x554e4944, /* 0x44494e55 */
165                 SPOOLSS_DM_SIGNATURE_JTEXP              = 0x4a544d53, /* 0x534d544a */
166                 SPOOLSS_DM_SIGNATURE_PSEXTRA            = 0x50524956 /* 0x56495250 */
167         } spoolss_DM_Signature;
168
169         typedef [v1_enum] enum {
170                 SPOOLSS_DM_LAYOUT_NUP_DISABLED          = 0x00000000,
171                 SPOOLSS_DM_LAYOUT_NUP_2                 = 0x00000001,
172                 SPOOLSS_DM_LAYOUT_NUP_4                 = 0x00000002,
173                 SPOOLSS_DM_LAYOUT_NUP_6                 = 0x00000003,
174                 SPOOLSS_DM_LAYOUT_NUP_9                 = 0x00000004,
175                 SPOOLSS_DM_LAYOUT_NUP_16                = 0x00000005,
176                 SPOOLSS_DM_LAYOUT_BOOKLET               = 0x00000006
177         } spoolss_DM_Layout;
178
179         typedef [v1_enum] enum {
180                 SPOOLSS_DM_NUP_DIRECTION_L2R_T2B        = 0x00000001,
181                 SPOOLSS_DM_NUP_DIRECTION_T2B_L2R        = 0x00000002,
182                 SPOOLSS_DM_NUP_DIRECTION_R2L_T2B        = 0x00000004,
183                 SPOOLSS_DM_NUP_DIRECTION_T2B_R2L        = 0x00000008
184         } spoolss_DM_NupDirection;
185
186         typedef [v1_enum] enum {
187                 SPOOLSS_DM_NUP_BORDER_PRINT             = 0x00000000,
188                 SPOOLSS_DM_NUP_BORDER_NONE              = 0x00000001
189         } spoolss_DM_NupBorderFlags;
190
191         typedef [v1_enum] enum {
192                 SPOOLSS_DM_BOOKLET_LEFT_FLIP            = 0x00000000,
193                 SPOOLSS_DM_BOOKLET_RIGHT_FLIP           = 0x00000001
194         } spoolss_DM_BookletFlags;
195
196         /* Device Mode Extra Data: PostScript */
197
198         /* NT 3.51 */
199
200         typedef [bitmap32bit] bitmap {
201                 SPOOLSS_DM_PS_FLAGS_DRV_ERROR_HANDLER   = 0x00000002,
202                 SPOOLSS_DM_PS_FLAGS_PRINT_MIRROR        = 0x00000004,
203                 SPOOLSS_DM_PS_FLAGS_PRINT_NEGATIVE      = 0x00000010,
204                 SPOOLSS_DM_PS_FLAGS_COMPRESS_BITMAP     = 0x00000040,
205                 SPOOLSS_DM_PS_FLAGS_ROTATE_180          = 0x00000200,
206                 SPOOLSS_DM_PS_FLAGS_GDI_METAFILE_SPOOL  = 0x00002000
207         } spoolss_DMPS_Flags;
208
209         typedef struct {
210                 [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature;
211                 spoolss_DMPS_Flags dwFlags;
212                 uint32 wchEPSFile[12];
213                 [value(24)] uint16 caSize;
214                 uint16 caFlags;
215                 uint16 caIlluminantIndex;
216                 uint16 caRedGamma;
217                 uint16 caGreenGamma;
218                 uint16 caBlueGamma;
219                 uint16 caReferenceBlack;
220                 uint16 caReferenceWhite;
221                 uint16 caContrast;
222                 uint16 caBrightness;
223                 uint16 caColorfulness;
224                 uint16 caRedGreenTint;
225         } spoolss_PSDRVEXTRA351;
226
227         /* NT 4.0 */
228
229         typedef struct {
230                 [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature;
231                 spoolss_DMPS_Flags dwFlags;
232                 uint32 wchEPSFile[12];
233                 [value(24)] uint16 caSize;
234                 uint16 caFlags;
235                 uint16 caIlluminantIndex;
236                 uint16 caRedGamma;
237                 uint16 caGreenGamma;
238                 uint16 caBlueGamma;
239                 uint16 caReferenceBlack;
240                 uint16 caReferenceWhite;
241                 uint16 caContrast;
242                 uint16 caBrightness;
243                 uint16 caColorfulness;
244                 uint16 caRedGreenTint;
245                 uint16 wChecksum;
246                 uint16 wOptions;
247                 uint32 aubOptions[8];
248         } spoolss_PSDRVEXTRA400;
249
250         /* 2000 & XP */
251
252         typedef [v1_enum] enum {
253                 SPOOLSS_DM_PS_OPTIMIZE_SPEED            = 0x00000000,
254                 SPOOLSS_DM_PS_OPTIMIZE_PORTABILITY      = 0x00000001,
255                 SPOOLSS_DM_PS_OPTIMIZE_EPS              = 0x00000002,
256                 SPOOLSS_DM_PS_OPTIMIZE_ARCHIVAL         = 0x00000003
257         } spoolss_DMPS_Dialect;
258
259         typedef [v1_enum] enum {
260                 SPOOLSS_DM_PS_TTDLFMT_DEFAULT           = 0x00000000,
261                 SPOOLSS_DM_PS_TTDLFMT_TYPE_1            = 0x00000001,
262                 SPOOLSS_DM_PS_TTDLFMT_TYPE_3            = 0x00000002,
263                 SPOOLSS_DM_PS_TTDLFMT_TYPE_42           = 0x00000003
264         } spoolss_DMPS_TTDLFmt;
265
266         typedef [v1_enum] enum {
267                 SPOOLSS_DM_PS_PSLEVEL_1 = 0x00000001,
268                 SPOOLSS_DM_PS_PSLEVEL_2 = 0x00000002,
269                 SPOOLSS_DM_PS_PSLEVEL_3 = 0x00000003
270         } spoolss_DMPS_PSLevel;
271
272         typedef enum {
273                 SPOOLSS_DM_PS_FEED_DIRECTION_LONG_EDGE_FIRST            = 0x0000,
274                 SPOOLSS_DM_PS_FEED_DIRECTION_SHORT_EDGE_FIRST           = 0x0001,
275                 SPOOLSS_DM_PS_FEED_DIRECTION_LONG_EDGE_FIRST_UPSIDEDOWN = 0x0002,
276                 SPOOLSS_DM_PS_FEED_DIRECTION_SHORT_EDGE_FIRST_UPSIDEDOWN= 0x0003
277         } spoolss_DMPS_FeedDirection;
278
279         typedef struct {
280                 [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature;
281                 spoolss_DMPS_Flags dwFlags;
282                 uint32 wchEPSFile[12];
283                 [value(24)] uint16 caSize;
284                 uint16 caFlags;
285                 uint16 caIlluminantIndex;
286                 uint16 caRedGamma;
287                 uint16 caGreenGamma;
288                 uint16 caBlueGamma;
289                 uint16 caReferenceBlack;
290                 uint16 caReferenceWhite;
291                 uint16 caContrast;
292                 uint16 caBrightness;
293                 uint16 caColorfulness;
294                 uint16 caRedGreenTint;
295                 uint16 wReserved1;
296                 uint16 wSize;
297                 uint32 fxScrFreq;
298                 uint32 fxScrAngle;
299                 spoolss_DMPS_Dialect iDialect;
300                 spoolss_DMPS_TTDLFmt iTTDLFmt;
301                 boolean32 bReversePrint;
302                 spoolss_DM_Layout iLayout;
303                 spoolss_DMPS_PSLevel iPSLevel;
304                 uint32 dwReserved2;
305                 uint16 wOEMExtra;
306                 [value(0x0010)] uint16 wVer;
307                 uint32 dwX;
308                 uint32 dwY;
309                 uint32 dwWidthOffset;
310                 uint32 dwHeightOffset;
311                 spoolss_DMPS_FeedDirection wFeedDirection;
312                 uint16 wCutSheet;
313                 uint32 dwReserved3[4];
314                 uint32 dwChecksum32;
315                 uint32 dwOptions;
316                 uint32 aOptions[128];
317         } spoolss_PSDRVEXTRA500;
318
319         /* Vista, 2008, 7 */
320
321         typedef struct {
322                 [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature;
323                 spoolss_DMPS_Flags dwFlags;
324                 uint32 wchEPSFile[12];
325                 [value(24)] uint16 caSize;
326                 uint16 caFlags;
327                 uint16 caIlluminantIndex;
328                 uint16 caRedGamma;
329                 uint16 caGreenGamma;
330                 uint16 caBlueGamma;
331                 uint16 caReferenceBlack;
332                 uint16 caReferenceWhite;
333                 uint16 caContrast;
334                 uint16 caBrightness;
335                 uint16 caColorfulness;
336                 uint16 caRedGreenTint;
337                 uint16 wCoreJTExpSize;
338                 [value(ndr_size_spoolss_PSDRVEXTRA(r, ndr->flags) + wCoreJTExpSize)] uint16 wCoreFullSize;
339                 uint32 fxScrFreq;
340                 uint32 fxScrAngle;
341                 spoolss_DMPS_Dialect iDialect;
342                 spoolss_DMPS_TTDLFmt iTTDLFmt;
343                 boolean32 bReversePrint;
344                 spoolss_DM_Layout iLayout;
345                 spoolss_DMPS_PSLevel iPSLevel;
346                 uint32 dwReserved2;
347                 uint16 wOEMExtra;
348                 [value(0x0010)] uint16 wVer;
349                 uint32 dwX;
350                 uint32 dwY;
351                 uint32 dwWidthOffset;
352                 uint32 dwHeightOffset;
353                 spoolss_DMPS_FeedDirection wFeedDirection;
354                 uint16 wCutSheet;
355                 uint32 dwReserved3[4];
356                 uint32 dwChecksum32;
357                 uint32 dwOptions;
358                 uint32 aOptions[128];
359                 spoolss_DM_NupDirection dwNupDirection;
360                 spoolss_DM_NupBorderFlags dwNupBorderFlags;
361                 spoolss_DM_BookletFlags dwBookletFlags;
362                 uint32 dwPadding;
363         } spoolss_PSDRVEXTRA;
364
365         /* Device Mode Extra Data: UniDriver */
366
367         /* NT 3.5, NT 4.0 */
368
369         typedef struct {
370                 uint16 wReserved[56];
371         } spoolss_UNIDRVEXTRA3_4;
372
373         /* 2000, XP */
374
375         typedef [v1_enum] enum {
376                 SPOOLSS_DM_UNI_QUALITY_BEST             = 0x00000000,
377                 SPOOLSS_DM_UNI_QUALITY_MEDIUM           = 0x00000001,
378                 SPOOLSS_DM_UNI_QUALITY_DRAFT            = 0x00000002
379         } spoolss_DMUNI_Quality;
380
381         typedef [bitmap32bit] bitmap {
382                 SPOOLSS_DM_UNI_FLAGS_PRINT_TEXT_AS_GRAPHICS     = 0x00000002,
383                 SPOOLSS_DM_UNI_FLAGS_AVOID_EMFSPOOL             = 0x00000010,
384                 SPOOLSS_DM_UNI_FLAGS_CUSTOM_HALFTONING          = 0x00000080
385         } spoolss_DMUNI_Flags;
386
387         typedef struct {
388                 [value(SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA)] spoolss_DM_Signature dwSignature;
389                 [value(0x0022)] uint16 wVer;
390                 uint16 sPadding;
391                 uint16 wSize;
392                 uint16 wOEMExtra;
393                 uint32 dwChecksum32;
394                 spoolss_DMUNI_Flags dwFlags;
395                 boolean32 bReversePrint;
396                 spoolss_DM_Layout iLayout;
397                 spoolss_DMUNI_Quality iQuality;
398                 uint16 wReserved[6];
399                 uint32 dwOptions;
400                 uint32 aOptions[128];
401         } spoolss_UNIDRVEXTRA500;
402
403         /* Vista, 2008, 7 */
404
405         typedef [public,gensize] struct {
406                 [value(SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA)] spoolss_DM_Signature dwSignature;
407                 [value(0x0022)] uint16 wVer;
408                 uint16 wCoreJTExpSize;
409                 [value(ndr_size_spoolss_UNIDRVEXTRA(r, ndr->flags) + wCoreJTExpSize)] uint16 wCoreFullSize;
410                 uint16 wOEMExtra;
411                 uint32 dwChecksum32;
412                 spoolss_DMUNI_Flags dwFlags;
413                 boolean32 bReversePrint;
414                 spoolss_DM_Layout iLayout;
415                 spoolss_DMUNI_Quality iQuality;
416                 uint16 wReserved[6];
417                 uint32 dwOptions;
418                 uint32 aOptions[128];
419                 spoolss_DM_NupDirection dwNupDirection;
420                 spoolss_DM_NupBorderFlags dwNupBorderFlags;
421                 spoolss_DM_BookletFlags dwBookletFlags;
422         } spoolss_UNIDRVEXTRA;
423
424         /* Device Mode Extra Data: JTEXP */
425
426         typedef struct {
427                 uint32 dwSize;
428                 [value(SPOOLSS_DM_SIGNATURE_JTEXP)] spoolss_DM_Signature dwSignature;
429                 [value(0)] uint32 dwVersion;
430                 [value(16)] uint32 wJTHdrSize;
431                 uint32 wCoreMFOSize;
432                 [string,charset(UTF16)] uint16 *ModelName;
433                 nstring_array FeatureOptionPairs;
434         } spoolss_JTEXP;
435
436         /* Device Mode Extra Data: OEM_DMEXTRA */
437
438         typedef struct {
439                 uint32 dwSize;
440                 spoolss_DM_Signature dwSignature;
441                 uint32 dwVersion;
442                 [flag(NDR_REMAINING)] DATA_BLOB Data;
443         } spoolss_OEM_DMEXTRA;
444
445         typedef [nodiscriminant] union {
446                 [case(0x0350)] spoolss_PSDRVEXTRA351    psdrvextra351;
447                 [case(0x0400)] spoolss_PSDRVEXTRA400    psdrvextra400;
448                 [case(0x0501)] spoolss_PSDRVEXTRA500    psdrvextra500;
449                 [case(0x0600)] spoolss_PSDRVEXTRA       psdrvextra;
450                 [default] [flag(NDR_REMAINING)] DATA_BLOB psblob;
451         } spoolss_DeviceModeExtraDataPostScript;
452
453         typedef [nodiscriminant] union {
454                 [case(0x0301)] spoolss_UNIDRVEXTRA3_4   unidrvextra3_4;
455                 [case(0x0500)] spoolss_UNIDRVEXTRA500   unidrvextra500;
456                 [case(0x0600)] spoolss_UNIDRVEXTRA      unidrvextra;
457                 [default] [flag(NDR_REMAINING)] DATA_BLOB uniblob;
458         } spoolss_DeviceModeExtraDataUniDriver;
459
460         typedef [bitmap32bit] bitmap {
461                 DEVMODE_ORIENTATION             = 0x00000001,
462                 DEVMODE_PAPERSIZE               = 0x00000002,
463                 DEVMODE_PAPERLENGTH             = 0x00000004,
464                 DEVMODE_PAPERWIDTH              = 0x00000008,
465                 DEVMODE_SCALE                   = 0x00000010,
466                 DEVMODE_POSITION                = 0x00000020,
467                 DEVMODE_NUP                     = 0x00000040,
468                 DEVMODE_COPIES                  = 0x00000100,
469                 DEVMODE_DEFAULTSOURCE           = 0x00000200,
470                 DEVMODE_PRINTQUALITY            = 0x00000400,
471                 DEVMODE_COLOR                   = 0x00000800,
472                 DEVMODE_DUPLEX                  = 0x00001000,
473                 DEVMODE_YRESOLUTION             = 0x00002000,
474                 DEVMODE_TTOPTION                = 0x00004000,
475                 DEVMODE_COLLATE                 = 0x00008000,
476                 DEVMODE_FORMNAME                = 0x00010000,
477                 DEVMODE_LOGPIXELS               = 0x00020000,
478                 DEVMODE_BITSPERPEL              = 0x00040000,
479                 DEVMODE_PELSWIDTH               = 0x00080000,
480                 DEVMODE_PELSHEIGHT              = 0x00100000,
481                 DEVMODE_DISPLAYFLAGS            = 0x00200000,
482                 DEVMODE_DISPLAYFREQUENCY        = 0x00400000,
483                 DEVMODE_ICMMETHOD               = 0x00800000,
484                 DEVMODE_ICMINTENT               = 0x01000000,
485                 DEVMODE_MEDIATYPE               = 0x02000000,
486                 DEVMODE_DITHERTYPE              = 0x04000000,
487                 DEVMODE_PANNINGWIDTH            = 0x08000000,
488                 DEVMODE_PANNINGHEIGHT           = 0x10000000
489         } spoolss_DeviceModeFields;
490
491         typedef [enum16bit] enum {
492                 DMSPEC_NT3              = 0x320,
493                 DMSPEC_WIN95_98_ME      = 0x400,
494                 DMSPEC_NT4_AND_ABOVE    = 0x401
495         } spoolss_DeviceModeSpecVersion;
496
497         typedef [enum16bit] enum {
498                 DMORIENT_PORTRAIT       = 0x0001,
499                 DMORIENT_LANDSCAPE      = 0x0002
500         } spoolss_DeviceModeOrientation;
501
502         typedef [enum16bit] enum {
503                 DMPAPER_LETTER                  = 0x0001, /* Letter, 8 1/2 x 11 inches */
504                 DMPAPER_LETTERSMALL             = 0x0002, /* Letter Small, 8 1/2 x 11 inches */
505                 DMPAPER_TABLOID                 = 0x0003, /* Tabloid, 11 x 17 inches */
506                 DMPAPER_LEDGER                  = 0x0004, /* Ledger, 17 x 11 inches */
507                 DMPAPER_LEGAL                   = 0x0005, /* Legal, 8 1/2 x 14 inches */
508                 DMPAPER_STATEMENT               = 0x0006, /* Statement, 5 1/2 x 8 1/2 inches */
509                 DMPAPER_EXECUTIVE               = 0x0007, /* Executive, 7 1/4 x 10 1/2 inches */
510                 DMPAPER_A3                      = 0x0008, /* A3 sheet, 297 x 420 millimeters */
511                 DMPAPER_A4                      = 0x0009, /* A4 sheet, 210 x 297 millimeters */
512                 DMPAPER_A4SMALL                 = 0x000A, /* A4 small sheet, 210 x 297 millimeters */
513                 DMPAPER_A5                      = 0x000B, /* A5 sheet, 148 x 210 millimeters */
514                 DMPAPER_B4                      = 0x000C, /* B4 sheet, 250 x 354 millimeters */
515                 DMPAPER_B5                      = 0x000D, /* B5 sheet, 182 x 257-millimeter paper */
516                 DMPAPER_FOLIO                   = 0x000E, /* Folio, 8 1/2 x 13-inch paper */
517                 DMPAPER_QUARTO                  = 0x000F, /* Quarto, 215 x 275 millimeter paper */
518                 DMPAPER_10X14                   = 0x0010, /* 10 x 14-inch sheet */
519                 DMPAPER_11X17                   = 0x0011, /* 11 x 17-inch sheet */
520                 DMPAPER_NOTE                    = 0x0012, /* Note, 8 1/2 x 11-inches */
521                 DMPAPER_ENV_9                   = 0x0013, /* #9 Envelope, 3 7/8 x 8 7/8 inches */
522                 DMPAPER_ENV_10                  = 0x0014, /* #10 Envelope, 4 1/8 x 9 1/2 inches */
523                 DMPAPER_ENV_11                  = 0x0015, /* #11 Envelope, 4 1/2 x 10 3/8 inches */
524                 DMPAPER_ENV_12                  = 0x0016, /* #12 Envelope, 4 3/4 x 11 inches */
525                 DMPAPER_ENV_14                  = 0x0017, /* #14 Envelope, 5 x 11 1/2 inches */
526                 DMPAPER_CSHEET                  = 0x0018, /* C Sheet, 17 x 22 inches */
527                 DMPAPER_DSHEET                  = 0x0019, /* D Sheet, 22 x 34 inches */
528                 DMPAPER_ESHEET                  = 0x001A, /* E Sheet, 34 x 44 inches */
529                 DMPAPER_ENV_DL                  = 0x001B, /* DL Envelope, 110 x 220 millimeters */
530                 DMPAPER_ENV_C5                  = 0x001C, /* C5 Envelope, 162 x 229 millimeters */
531                 DMPAPER_ENV_C3                  = 0x001D, /* C3 Envelope, 324 x 458 millimeters */
532                 DMPAPER_ENV_C4                  = 0x001E, /* C4 Envelope, 229 x 324 millimeters */
533                 DMPAPER_ENV_C6                  = 0x001F, /* C6 Envelope, 114 x 162 millimeters */
534                 DMPAPER_ENV_C65                 = 0x0020, /* C65 Envelope, 114 x 229 millimeters */
535                 DMPAPER_ENV_B4                  = 0x0021, /* B4 Envelope, 250 x 353 millimeters */
536                 DMPAPER_ENV_B5                  = 0x0022, /* B5 Envelope, 176 x 250 millimeters */
537                 DMPAPER_ENV_B6                  = 0x0023, /* B6 Envelope, 176 x 125 millimeters */
538                 DMPAPER_ENV_ITALY               = 0x0024, /* Italy Envelope, 110 x 230 millimeters */
539                 DMPAPER_ENV_MONARCH             = 0x0025, /* Monarch Envelope, 3 7/8 x 7 1/2 inches */
540                 DMPAPER_ENV_PERSONAL            = 0x0026, /* 6 3/4 Envelope, 3 5/8 x 6 1/2 inches */
541                 DMPAPER_FANFOLD_US              = 0x0027, /* US Std Fanfold, 14 7/8 x 11 inches */
542                 DMPAPER_FANFOLD_STD_GERMAN      = 0x0028, /* German Std Fanfold, 8 1/2 x 12 inches */
543                 DMPAPER_FANFOLD_LGL_GERMAN      = 0x0029, /* German Legal Fanfold, 8 x 13 inches */
544                 DMPAPER_DBL_JAPANESE_POSTCARD   = 0x0045, /* Double Japanese Postcard, 200 x 148 millimeters */
545                 DMPAPER_A6                      = 0x0046, /* A6 sheet, 105 x 148 millimeters */
546                 DMPAPER_JENV_KAKU2              = 0x0047, /* Japanese Envelope Kaku #2 */
547                 DMPAPER_JENV_KAKU3              = 0x0048, /* Japanese Envelope Kaku #3 */
548                 DMPAPER_JENV_CHOU3              = 0x0049, /* Japanese Envelope Chou #3 */
549                 DMPAPER_JENV_CHOU4              = 0x004A, /* Japanese Envelope Chou #4 */
550                 DMPAPER_LETTER_ROTATED          = 0x004B, /* Letter Rotated, 11 by 8 1/2 inches */
551                 DMPAPER_A3_ROTATED              = 0x004C, /* A3 rotated sheet, 420 x 297 millimeters */
552                 DMPAPER_A4_ROTATED              = 0x004D, /* A4 rotated sheet, 297 x 210 millimeters */
553                 DMPAPER_A5_ROTATED              = 0x004E, /* A5 rotated sheet, 210 x 148 millimeters */
554                 DMPAPER_B4_JIS_ROTATED          = 0x004F, /* B4 (JIS) rotated sheet, 364 x 257 millimeters */
555                 DMPAPER_B5_JIS_ROTATED          = 0x0050, /* B5 (JIS) rotated sheet, 257 x 182 millimeters */
556                 DMPAPER_JAPANESE_POSTCARD_ROTATED = 0x0051, /* Japanese Postcard Rotated, 148 x 100 millimeters */
557                 DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED = 0x0052, /* Double Japanese Postcard Rotated, 148 x 200 millimeters */
558                 DMPAPER_A6_ROTATED              = 0x0053, /* A6 rotated sheet, 148 x 105 millimeters */
559                 DMPAPER_JENV_KAKU2_ROTATED      = 0x0054, /* Japanese Envelope Kaku #2 Rotated */
560                 DMPAPER_JENV_KAKU3_ROTATED      = 0x0055, /* Japanese Envelope Kaku #3 Rotated */
561                 DMPAPER_JENV_CHOU3_ROTATED      = 0x0056, /* Japanese Envelope Chou #3 Rotated */
562                 DMPAPER_JENV_CHOU4_ROTATED      = 0x0057, /* Japanese Envelope Chou #4 Rotated */
563                 DMPAPER_B6_JIS                  = 0x0058, /* B6 (JIS) sheet, 128 x 182 millimeters */
564                 DMPAPER_B6_JIS_ROTATED          = 0x0059, /* B6 (JIS) rotated sheet, 182 x 128 millimeters */
565                 DMPAPER_12X11                   = 0x005A, /* 12 x 11-inch sheet */
566                 DMPAPER_JENV_YOU4               = 0x005B, /* Japanese Envelope You #4 */
567                 DMPAPER_JENV_YOU4_ROTATED       = 0x005C, /* Japanese Envelope You #4 */
568                 DMPAPER_P16K                    = 0x005D, /* PRC 16K, 146 x 215 millimeters */
569                 DMPAPER_P32K                    = 0x005E, /* PRC 32K, 97 x 151 millimeters */
570                 DMPAPER_P32KBIG                 = 0x005F, /* PRC 32K(Big) 97 x 151 millimeters */
571                 DMPAPER_PENV_1                  = 0x0060, /* PRC Envelope #1, 102 by 165 millimeters */
572                 DMPAPER_PENV_2                  = 0x0061, /* PRC Envelope #2, 102 x 176 millimeters */
573                 DMPAPER_PENV_3                  = 0x0062, /* PRC Envelope #3, 125 x 176 millimeters */
574                 DMPAPER_PENV_4                  = 0x0063, /* PRC Envelope #4, 110 x 208 millimeters */
575                 DMPAPER_PENV_5                  = 0x0064, /* PRC Envelope #5, 110 x 220 millimeters */
576                 DMPAPER_PENV_6                  = 0x0065, /* PRC Envelope #6, 120 x 230 millimeters */
577                 DMPAPER_PENV_7                  = 0x0066, /* PRC Envelope #7, 160 x 230 millimeters */
578                 DMPAPER_PENV_8                  = 0x0067, /* PRC Envelope #8, 120 x 309 millimeters */
579                 DMPAPER_PENV_9                  = 0x0068, /* PRC Envelope #9, 229 x 324 millimeters */
580                 DMPAPER_PENV_10                 = 0x0069, /* PRC Envelope #10, 324 x 458 millimeters */
581                 DMPAPER_P16K_ROTATED            = 0x006A, /* PRC 16K Rotated, 215 x 146 millimeters */
582                 DMPAPER_P32K_ROTATED            = 0x006B, /* PRC 32K Rotated, 151 x 97 millimeters */
583                 DMPAPER_P32KBIG_ROTATED         = 0x006C, /* PRC 32K(Big) Rotated, 151 x 97 millimeters */
584                 DMPAPER_PENV_1_ROTATED          = 0x006D, /* PRC Envelope #1 Rotated, 165 x 102 millimeters */
585                 DMPAPER_PENV_2_ROTATED          = 0x006E, /* PRC Envelope #2 Rotated, 176 x 102 millimeters */
586                 DMPAPER_PENV_3_ROTATED          = 0x006F, /* PRC Envelope #3 Rotated, 176 x 125 millimeters */
587                 DMPAPER_PENV_4_ROTATED          = 0x0070, /* PRC Envelope #4 Rotated, 208 x 110 millimeters */
588                 DMPAPER_PENV_5_ROTATED          = 0x0071, /* PRC Envelope #5 Rotated, 220 x 110 millimeters */
589                 DMPAPER_PENV_6_ROTATED          = 0x0072, /* PRC Envelope #6 Rotated, 230 x 120 millimeters */
590                 DMPAPER_PENV_7_ROTATED          = 0x0073, /* PRC Envelope #7 Rotated, 230 x 160 millimeters */
591                 DMPAPER_PENV_8_ROTATED          = 0x0074, /* PRC Envelope #8 Rotated, 309 x 120 millimeters */
592                 DMPAPER_PENV_9_ROTATED          = 0x0075, /* PRC Envelope #9 Rotated, 324 x 229 millimeters */
593                 DMPAPER_PENV_10_ROTATED         = 0x0076 /* PRC Envelope #10 Rotated, 458 x 324 millimeters */
594         } spoolss_DeviceModePaperSize;
595
596         typedef [enum16bit] enum {
597                 DMBIN_UPPER             = 0x0001,
598                 DMBIN_LOWER             = 0x0002,
599                 DMBIN_MIDDLE            = 0x0003,
600                 DMBIN_MANUAL            = 0x0004,
601                 DMBIN_ENVELOPE          = 0x0005,
602                 DMBIN_ENVMANUAL         = 0x0006,
603                 DMBIN_AUTO              = 0x0007,
604                 DMBIN_TRACTOR           = 0x0008,
605                 DMBIN_SMALLFMT          = 0x0009,
606                 DMBIN_LARGEFMT          = 0x000a,
607                 DMBIN_LARGECAPACITY     = 0x000b,
608                 DMBIN_CASSETTE          = 0x000e,
609                 DMBIN_FORMSOURCE        = 0x000f
610         } spoolss_DeviceModeDefaultSource;
611
612         typedef [enum16bit] enum {
613                 DMRES_HIGH              = 0xfffc,
614                 DMRES_MEDIUM            = 0xfffd,
615                 DMRES_LOW               = 0xfffe,
616                 DMRES_DRAFT             = 0xffff
617         } spoolss_DeviceModePrintQuality;
618
619         typedef [enum16bit] enum {
620                 DMRES_MONOCHROME         = 0x0001,
621                 DMRES_COLOR              = 0x0002
622         } spoolss_DeviceModeColor;
623
624         typedef [enum16bit] enum {
625                 DMDUP_SIMPLEX           = 0x0001,
626                 DMDUP_VERTICAL          = 0x0002,
627                 DMDUP_HORIZONTAL        = 0x0003
628         } spoolss_DeviceModeDuplex;
629
630         typedef [enum16bit] enum {
631                 DMTT_BITMAP             = 0x0001,
632                 DMTT_DOWNLOAD           = 0x0002,
633                 DMTT_SUBDEV             = 0x0003,
634                 DMTT_DOWNLOAD_OUTLINE   = 0x0004
635         } spoolss_DeviceModeTTOption;
636
637         typedef [enum16bit] enum {
638                 DMCOLLATE_FALSE         = 0x0000,
639                 DMCOLLATE_TRUE          = 0x0001
640         } spoolss_DeviceModeCollate;
641
642         typedef [v1_enum] enum {
643                 DMNUP_SYSTEM            = 0x00000001,
644                 DMNUP_ONEUP             = 0x00000002
645         } spoolss_DeviceModeNUp;
646
647         typedef [v1_enum] enum {
648                 DMICMMETHOD_NONE        = 0x00000001,
649                 DMICMMETHOD_SYSTEM      = 0x00000002,
650                 DMICMMETHOD_DRIVER      = 0x00000003,
651                 DMICMMETHOD_DEVICE      = 0x00000004
652         } spoolss_DeviceModeICMMethod;
653
654         typedef [v1_enum] enum {
655                 DMICM_SATURATE          = 0x00000001,
656                 DMICM_CONTRAST          = 0x00000002,
657                 DMICM_COLORIMETRIC      = 0x00000003,
658                 DMICM_ABS_COLORIMETRIC  = 0x00000004
659         } spoolss_DeviceModeICMIntent;
660
661         typedef [v1_enum] enum {
662                 DMMEDIA_STANDARD        = 0x00000001,
663                 DMMEDIA_TRANSPARENCY    = 0x00000002,
664                 DMMEDIA_GLOSSY          = 0x00000003
665         } spoolss_DeviceModeMediaType;
666
667         typedef [v1_enum] enum {
668                 DMDITHER_NONE           = 0x00000001,
669                 DMDITHER_COARSE         = 0x00000002,
670                 DMDITHER_FINE           = 0x00000003,
671                 DMDITHER_LINEART        = 0x00000004,
672                 DMDITHER_ERRORDIFFUSION = 0x00000005,
673                 DMDITHER_RESERVED6      = 0x00000006,
674                 DMDITHER_RESERVED7      = 0x00000007,
675                 DMDITHER_RESERVED8      = 0x00000008,
676                 DMDITHER_RESERVED9      = 0x00000009,
677                 DMDITHER_GRAYSCALE      = 0x0000000A
678         } spoolss_DeviceModeDitherType;
679
680         const int MAXDEVICENAME = 32;
681
682         typedef [public,gensize] struct {
683                 [charset(UTF16),to_null] uint16 devicename[MAXDEVICENAME];
684                 spoolss_DeviceModeSpecVersion specversion;
685                 uint16 driverversion;
686                 uint16 size;
687                 [value(r->driverextra_data.length)] uint16 __driverextra_length;
688                 spoolss_DeviceModeFields fields;
689                 spoolss_DeviceModeOrientation orientation;
690                 spoolss_DeviceModePaperSize papersize;
691                 uint16 paperlength;
692                 uint16 paperwidth;
693                 uint16 scale;
694                 uint16 copies;
695                 spoolss_DeviceModeDefaultSource defaultsource;
696                 spoolss_DeviceModePrintQuality printquality;
697                 spoolss_DeviceModeColor color;
698                 spoolss_DeviceModeDuplex duplex;
699                 uint16 yresolution;
700                 spoolss_DeviceModeTTOption ttoption;
701                 spoolss_DeviceModeCollate collate;
702                 [charset(UTF16),to_null] uint16 formname[MAXDEVICENAME];
703                 uint16 logpixels; /* reserved */
704                 uint32 bitsperpel; /* reserved */
705                 uint32 pelswidth; /* reserved */
706                 uint32 pelsheight; /* reserved */
707                 spoolss_DeviceModeNUp displayflags;
708                 uint32 displayfrequency; /* reserved */
709                 spoolss_DeviceModeICMMethod icmmethod;
710                 spoolss_DeviceModeICMIntent icmintent;
711                 spoolss_DeviceModeMediaType mediatype;
712                 spoolss_DeviceModeDitherType dithertype;
713                 uint32 reserved1;
714                 uint32 reserved2;
715                 uint32 panningwidth; /* reserved */
716                 uint32 panningheight; /* reserved */
717                 [subcontext_size(__driverextra_length),subcontext(0),flag(NDR_REMAINING)] DATA_BLOB driverextra_data;
718         } spoolss_DeviceMode;
719
720         typedef [public] bitmap {
721                 PRINTER_ENUM_DEFAULT     = 0x00000001,
722                 PRINTER_ENUM_LOCAL       = 0x00000002,
723                 PRINTER_ENUM_CONNECTIONS = 0x00000004,
724                 PRINTER_ENUM_FAVORITE    = 0x00000004,
725                 PRINTER_ENUM_NAME        = 0x00000008,
726                 PRINTER_ENUM_REMOTE      = 0x00000010,
727                 PRINTER_ENUM_SHARED      = 0x00000020,
728                 PRINTER_ENUM_NETWORK     = 0x00000040,
729                 PRINTER_ENUM_EXPAND      = 0x00004000,
730                 PRINTER_ENUM_CONTAINER   = 0x00008000,
731                 PRINTER_ENUM_ICON1       = 0x00010000,
732                 PRINTER_ENUM_ICON2       = 0x00020000,
733                 PRINTER_ENUM_ICON3       = 0x00040000,
734                 PRINTER_ENUM_ICON4       = 0x00080000,
735                 PRINTER_ENUM_ICON5       = 0x00100000,
736                 PRINTER_ENUM_ICON6       = 0x00200000,
737                 PRINTER_ENUM_ICON7       = 0x00400000,
738                 PRINTER_ENUM_ICON8       = 0x00800000,
739                 PRINTER_ENUM_HIDE        = 0x01000000
740         } spoolss_EnumPrinterFlags;
741
742         const int PRINTER_ENUM_ICONMASK = (PRINTER_ENUM_ICON1 |
743                                            PRINTER_ENUM_ICON2 |
744                                            PRINTER_ENUM_ICON3 |
745                                            PRINTER_ENUM_ICON4 |
746                                            PRINTER_ENUM_ICON5 |
747                                            PRINTER_ENUM_ICON6 |
748                                            PRINTER_ENUM_ICON7 |
749                                            PRINTER_ENUM_ICON8); /* 0x00ff0000 */
750
751         typedef [public] bitmap {
752                 PRINTER_ATTRIBUTE_QUEUED                = 0x00000001,
753                 PRINTER_ATTRIBUTE_DIRECT                = 0x00000002,
754                 PRINTER_ATTRIBUTE_DEFAULT               = 0x00000004,
755                 PRINTER_ATTRIBUTE_SHARED                = 0x00000008,
756                 PRINTER_ATTRIBUTE_NETWORK               = 0x00000010,
757                 PRINTER_ATTRIBUTE_HIDDEN                = 0x00000020,
758                 PRINTER_ATTRIBUTE_LOCAL                 = 0x00000040,
759                 PRINTER_ATTRIBUTE_ENABLE_DEVQ           = 0x00000080,
760                 PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS       = 0x00000100,
761                 PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST     = 0x00000200,
762                 PRINTER_ATTRIBUTE_WORK_OFFLINE          = 0x00000400,
763                 PRINTER_ATTRIBUTE_ENABLE_BIDI           = 0x00000800,
764                 PRINTER_ATTRIBUTE_RAW_ONLY              = 0x00001000,
765                 PRINTER_ATTRIBUTE_PUBLISHED             = 0x00002000,
766                 PRINTER_ATTRIBUTE_FAX                   = 0x00004000,
767                 PRINTER_ATTRIBUTE_TS                    = 0x00008000
768         } spoolss_PrinterAttributes;
769
770         typedef [public,gensize] struct {
771                 spoolss_EnumPrinterFlags flags;
772                 [relative] nstring *description;
773                 [relative] nstring *name;
774                 [relative] nstring *comment;
775         } spoolss_PrinterInfo1;
776
777         typedef [public,gensize,nopush] struct {
778                 [relative] nstring *servername;
779                 [relative] nstring *printername;
780                 [relative] nstring *sharename;
781                 [relative] nstring *portname;
782                 [relative] nstring *drivername;
783                 [relative] nstring *comment;
784                 [relative] nstring *location;
785                 [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_DeviceMode *devmode;
786                 [relative] nstring *sepfile;
787                 [relative] nstring *printprocessor;
788                 [relative] nstring *datatype;
789                 [relative] nstring *parameters;
790                 [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_security_descriptor *secdesc;
791                 spoolss_PrinterAttributes attributes;
792                 [range(0,99)] uint32 priority;
793                 uint32 defaultpriority;
794                 uint32 starttime;
795                 uint32 untiltime;
796                 spoolss_PrinterStatus status;
797                 uint32 cjobs;
798                 uint32 averageppm;
799         } spoolss_PrinterInfo2;
800
801         typedef [public,gensize] struct {
802                 [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_security_descriptor *secdesc;
803         } spoolss_PrinterInfo3;
804
805         typedef [public,gensize] struct {
806                 [relative] nstring *printername;
807                 [relative] nstring *servername;
808                 spoolss_PrinterAttributes attributes;
809         } spoolss_PrinterInfo4;
810
811         typedef [public,gensize] struct {
812                 [relative] nstring *printername;
813                 [relative] nstring *portname;
814                 spoolss_PrinterAttributes attributes;
815                 uint32 device_not_selected_timeout;
816                 uint32 transmission_retry_timeout;
817         } spoolss_PrinterInfo5;
818
819         typedef [public,gensize] struct {
820                 spoolss_PrinterStatus status;
821         } spoolss_PrinterInfo6;
822
823         typedef bitmap {
824                 DSPRINT_PUBLISH         = 0x00000001,
825                 DSPRINT_UPDATE          = 0x00000002,
826                 DSPRINT_UNPUBLISH       = 0x00000004,
827                 DSPRINT_REPUBLISH       = 0x00000008,
828                 DSPRINT_PENDING         = 0x80000000
829         } spoolss_DsPrintAction;
830
831         typedef [public,gensize] struct {
832                 [relative] nstring *guid; /* text form of printer guid */
833                 spoolss_DsPrintAction action;
834         } spoolss_PrinterInfo7;
835
836         typedef struct {
837                 [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_DeviceMode *devmode;
838         } spoolss_DeviceModeInfo;
839
840         typedef [nodiscriminant,relative_base,public,gensize,flag(NDR_RELATIVE_REVERSE)] union {
841                 [case(0)] spoolss_PrinterInfo0 info0;
842                 [case(1)] spoolss_PrinterInfo1 info1;
843                 [case(2)] spoolss_PrinterInfo2 info2;
844                 [case(3)] spoolss_PrinterInfo3 info3;
845                 [case(4)] spoolss_PrinterInfo4 info4;
846                 [case(5)] spoolss_PrinterInfo5 info5;
847                 [case(6)] spoolss_PrinterInfo6 info6;
848                 [case(7)] spoolss_PrinterInfo7 info7;
849                 [case(8)] spoolss_DeviceModeInfo info8;
850                 [case(9)] spoolss_DeviceModeInfo info9;
851                 [default];
852         } spoolss_PrinterInfo;
853
854         /******************/
855         /* Function: 0x00 */
856         /* we are using this as internal parsing code */
857         [public,noopnum,noprint] WERROR _spoolss_EnumPrinters(
858                 [in] spoolss_EnumPrinterFlags flags,
859                 [in,unique] [string,charset(UTF16)] uint16 *server,
860                 [in] uint32 level,
861                 [in,unique] DATA_BLOB *buffer,
862                 [in] uint32 offered,
863                 [out,unique] DATA_BLOB *info,
864                 [out,ref] uint32 *needed,
865                 [out,ref] uint32 *count
866         );
867         [public,noopnum,noprint] void __spoolss_EnumPrinters(
868                 [in] uint32 level,
869                 [in] uint32 count,
870                 [out,switch_is(level)] spoolss_PrinterInfo info[count]
871         );
872         [nopull,nopush] WERROR spoolss_EnumPrinters(
873                 [in] spoolss_EnumPrinterFlags flags,
874                 [in,unique] [string,charset(UTF16)] uint16 *server,
875                 [in] uint32 level,
876                 [in,unique] DATA_BLOB *buffer,
877                 [in] uint32 offered,
878                 /* what we have here is a subcontext containing an array of no discriminant unions
879                  * and the array has no size in front
880                  */
881                 [out,ref] uint32 *count,
882                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrinterInfo **info,
883                 [out,ref] uint32 *needed
884         );
885
886         /******************/
887         /* Function: 0x01 */
888         typedef struct {
889                 [value(_ndr_size_spoolss_DeviceMode(devmode, ndr->flags))] uint32 _ndr_size;
890                 [subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode;
891         } spoolss_DevmodeContainer;
892
893         [public] WERROR spoolss_OpenPrinter(
894                 [in,unique] [string,charset(UTF16)] uint16 *printername,
895                 [in,unique] [string,charset(UTF16)] uint16 *datatype,
896                 [in] spoolss_DevmodeContainer devmode_ctr,
897                 [in] spoolss_AccessRights access_mask,
898                 [out,ref] policy_handle *handle
899         );
900
901         /******************/
902         /* Function: 0x02 */
903
904         typedef [public,gensize] struct {
905                 uint32 job_id;
906                 [relative] nstring *printer_name;
907                 [relative] nstring *server_name;
908                 [relative] nstring *user_name;
909                 [relative] nstring *document_name;
910                 [relative] nstring *data_type;
911                 [relative] nstring *text_status;
912                 spoolss_JobStatus status;
913                 [range(0,99)] uint32 priority;
914                 uint32 position;
915                 uint32 total_pages;
916                 uint32 pages_printed;
917                 spoolss_Time submitted;
918         } spoolss_JobInfo1;
919
920         typedef [public,gensize] struct {
921                 uint32 job_id;
922                 [relative] nstring *printer_name;
923                 [relative] nstring *server_name;
924                 [relative] nstring *user_name;
925                 [relative] nstring *document_name;
926                 [relative] nstring *notify_name;
927                 [relative] nstring *data_type;
928                 [relative] nstring *print_processor;
929                 [relative] nstring *parameters;
930                 [relative] nstring *driver_name;
931                 [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_DeviceMode *devmode;
932                 [relative] nstring *text_status;
933                 [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_security_descriptor *secdesc;
934                 spoolss_JobStatus status;
935                 [range(0,99)] uint32 priority;
936                 uint32 position;
937                 uint32 start_time;
938                 uint32 until_time;
939                 uint32 total_pages;
940                 uint32 size;
941                 spoolss_Time submitted;
942                 uint32 time;
943                 uint32 pages_printed;
944         } spoolss_JobInfo2;
945
946         typedef [public,gensize] struct {
947                 uint32 job_id;
948                 uint32 next_job_id;
949                 uint32 reserved;
950         } spoolss_JobInfo3;
951
952         typedef [public,gensize] struct {
953                 uint32 job_id;
954                 [relative] nstring *printer_name;
955                 [relative] nstring *server_name;
956                 [relative] nstring *user_name;
957                 [relative] nstring *document_name;
958                 [relative] nstring *notify_name;
959                 [relative] nstring *data_type;
960                 [relative] nstring *print_processor;
961                 [relative] nstring *parameters;
962                 [relative] nstring *driver_name;
963                 [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_DeviceMode *devmode;
964                 [relative] nstring *text_status;
965                 [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_security_descriptor *secdesc;
966                 spoolss_JobStatus status;
967                 [range(0,99)] uint32 priority;
968                 uint32 position;
969                 uint32 start_time;
970                 uint32 until_time;
971                 uint32 total_pages;
972                 uint32 size;
973                 spoolss_Time submitted;
974                 uint32 time;
975                 uint32 pages_printed;
976                 uint32 size_high;
977         } spoolss_JobInfo4;
978
979         typedef [nodiscriminant,relative_base,public,gensize,flag(NDR_RELATIVE_REVERSE)] union {
980                 [case(1)] spoolss_JobInfo1 info1;
981                 [case(2)] spoolss_JobInfo2 info2;
982                 [case(3)] spoolss_JobInfo3 info3;
983                 [case(4)] spoolss_JobInfo4 info4;
984                 [default];
985         } spoolss_JobInfo;
986
987         typedef struct {
988                 uint32 job_id;
989                 [string,charset(UTF16)] uint16 *printer_name;
990                 [string,charset(UTF16)] uint16 *server_name;
991                 [string,charset(UTF16)] uint16 *user_name;
992                 [string,charset(UTF16)] uint16 *document_name;
993                 [string,charset(UTF16)] uint16 *data_type;
994                 [string,charset(UTF16)] uint16 *text_status;
995                 spoolss_JobStatus status;
996                 [range(0,99)] uint32 priority;
997                 uint32 position;
998                 uint32 total_pages;
999                 uint32 pages_printed;
1000                 spoolss_Time submitted;
1001         } spoolss_SetJobInfo1;
1002
1003         typedef struct {
1004                 uint32 job_id;
1005                 [string,charset(UTF16)] uint16 *printer_name;
1006                 [string,charset(UTF16)] uint16 *server_name;
1007                 [string,charset(UTF16)] uint16 *user_name;
1008                 [string,charset(UTF16)] uint16 *document_name;
1009                 [string,charset(UTF16)] uint16 *notify_name;
1010                 [string,charset(UTF16)] uint16 *data_type;
1011                 [string,charset(UTF16)] uint16 *print_processor;
1012                 [string,charset(UTF16)] uint16 *parameters;
1013                 [string,charset(UTF16)] uint16 *driver_name;
1014                 uint32 _devmode_ptr; /* pointer to truncated devicemode */
1015                 [string,charset(UTF16)] uint16 *text_status;
1016                 uint32 _secdesc_ptr;
1017                 spoolss_JobStatus status;
1018                 [range(0,99)] uint32 priority;
1019                 uint32 position;
1020                 uint32 start_time;
1021                 uint32 until_time;
1022                 uint32 total_pages;
1023                 uint32 size;
1024                 spoolss_Time submitted;
1025                 uint32 time;
1026                 uint32 pages_printed;
1027         } spoolss_SetJobInfo2;
1028
1029         typedef struct {
1030                 uint32 job_id;
1031                 [string,charset(UTF16)] uint16 *printer_name;
1032                 [string,charset(UTF16)] uint16 *server_name;
1033                 [string,charset(UTF16)] uint16 *user_name;
1034                 [string,charset(UTF16)] uint16 *document_name;
1035                 [string,charset(UTF16)] uint16 *notify_name;
1036                 [string,charset(UTF16)] uint16 *data_type;
1037                 [string,charset(UTF16)] uint16 *print_processor;
1038                 [string,charset(UTF16)] uint16 *parameters;
1039                 [string,charset(UTF16)] uint16 *driver_name;
1040                 uint32 _devmode_ptr; /* pointer to truncated devicemode */
1041                 [string,charset(UTF16)] uint16 *text_status;
1042                 uint32 _secdesc_ptr;
1043                 spoolss_JobStatus status;
1044                 [range(0,99)] uint32 priority;
1045                 uint32 position;
1046                 uint32 start_time;
1047                 uint32 until_time;
1048                 uint32 total_pages;
1049                 uint32 size;
1050                 spoolss_Time submitted;
1051                 uint32 time;
1052                 uint32 pages_printed;
1053                 uint32 size_high;
1054         } spoolss_SetJobInfo4;
1055
1056         typedef [public] union {
1057                 [case(1)] spoolss_SetJobInfo1 *info1;
1058                 [case(2)] spoolss_SetJobInfo2 *info2;
1059                 [case(3)] spoolss_JobInfo3    *info3;
1060                 [case(4)] spoolss_SetJobInfo4 *info4;
1061                 [default];
1062         } spoolss_SetJobInfo;
1063
1064         typedef struct {
1065                 uint32 level;
1066                 [switch_is(level)] spoolss_SetJobInfo info;
1067         } spoolss_JobInfoContainer;
1068
1069         typedef [v1_enum] enum {
1070                 SPOOLSS_JOB_CONTROL_PAUSE               = 1,
1071                 SPOOLSS_JOB_CONTROL_RESUME              = 2,
1072                 SPOOLSS_JOB_CONTROL_CANCEL              = 3,
1073                 SPOOLSS_JOB_CONTROL_RESTART             = 4,
1074                 SPOOLSS_JOB_CONTROL_DELETE              = 5,
1075                 SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER     = 6,
1076                 SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED   = 7,
1077                 SPOOLSS_JOB_CONTROL_RETAIN              = 8,
1078                 SPOOLSS_JOB_CONTROL_RELEASE             = 9
1079         } spoolss_JobControl;
1080
1081         WERROR spoolss_SetJob(
1082                 [in,ref] policy_handle *handle,
1083                 [in] uint32 job_id,
1084                 [in,unique] spoolss_JobInfoContainer *ctr,
1085                 [in] spoolss_JobControl command
1086         );
1087
1088         /******************/
1089         /* Function: 0x03 */
1090         WERROR spoolss_GetJob(
1091                 [in,ref] policy_handle *handle,
1092                 [in]     uint32 job_id,
1093                 [in]     uint32 level,
1094                 [in,unique] DATA_BLOB *buffer,
1095                 [in]     uint32 offered,
1096                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info,
1097                 [out,ref] uint32 *needed
1098         );
1099
1100         /******************/
1101         /* Function: 0x04 */
1102         [public,noopnum,noprint] WERROR _spoolss_EnumJobs(
1103                 [in,ref] policy_handle *handle,
1104                 [in]     uint32 firstjob,
1105                 [in]     uint32 numjobs,
1106                 [in]     uint32 level,
1107                 [in,unique] DATA_BLOB *buffer,
1108                 [in]     uint32 offered,
1109                 [out,unique] DATA_BLOB *info,
1110                 [out,ref] uint32 *needed,
1111                 [out,ref] uint32 *count
1112         );
1113         [public,noopnum,noprint] void __spoolss_EnumJobs(
1114                 [in] uint32 level,
1115                 [in] uint32 count,
1116                 [out,switch_is(level)] spoolss_JobInfo info[count]
1117         );
1118         [nopull,nopush] WERROR spoolss_EnumJobs(
1119                 [in,ref] policy_handle *handle,
1120                 [in]     uint32 firstjob,
1121                 [in]     uint32 numjobs,
1122                 [in]     uint32 level,
1123                 [in,unique] DATA_BLOB *buffer,
1124                 [in]     uint32 offered,
1125                 [out,ref] uint32 *count,
1126                 [out,ref,switch_is(level),size_is(,*count)] spoolss_JobInfo **info,
1127                 [out,ref] uint32 *needed
1128         );
1129
1130         /******************/
1131         /* Function: 0x05 */
1132         WERROR spoolss_AddPrinter(
1133                 [in,unique] [string,charset(UTF16)] uint16 *server,
1134                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
1135                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
1136                 [in,ref] sec_desc_buf *secdesc_ctr,
1137                 [out,ref] policy_handle *handle
1138         );
1139
1140         /******************/
1141         /* Function: 0x06 */
1142         WERROR spoolss_DeletePrinter(
1143                 [in] policy_handle *handle
1144         );
1145
1146         /******************/
1147         /* Function: 0x07 */
1148         typedef [v1_enum] enum {
1149                 SPOOLSS_PRINTER_CONTROL_UNPAUSE    = 0,
1150                 SPOOLSS_PRINTER_CONTROL_PAUSE      = 1,
1151                 SPOOLSS_PRINTER_CONTROL_RESUME     = 2,
1152                 SPOOLSS_PRINTER_CONTROL_PURGE      = 3,
1153                 SPOOLSS_PRINTER_CONTROL_SET_STATUS = 4
1154         } spoolss_PrinterControl;
1155
1156         typedef struct {
1157                 [string,charset(UTF16)] uint16 *servername;
1158                 [string,charset(UTF16)] uint16 *printername;
1159                 uint32 cjobs;
1160                 uint32 total_jobs;
1161                 uint32 total_bytes;
1162                 spoolss_Time time;
1163                 uint32 global_counter;
1164                 uint32 total_pages;
1165                 uint32 version;
1166                 spoolss_Build free_build;
1167                 uint32 spooling;
1168                 uint32 max_spooling;
1169                 uint32 session_counter;
1170                 uint32 num_error_out_of_paper;
1171                 uint32 num_error_not_ready;
1172                 spoolss_JobStatus job_error;
1173                 uint32 number_of_processors;
1174                 spoolss_ProcessorType processor_type;
1175                 uint32 high_part_total_bytes;
1176                 uint32 change_id;
1177                 WERROR last_error;
1178                 spoolss_PrinterStatus status;
1179                 uint32 enumerate_network_printers;
1180                 uint32 c_setprinter;
1181                 spoolss_ProcessorArchitecture processor_architecture;
1182                 uint16 processor_level;
1183                 uint32 ref_ic;
1184                 uint32 reserved2;
1185                 uint32 reserved3;
1186         } spoolss_SetPrinterInfo0;
1187
1188         typedef struct {
1189                 spoolss_PrinterAttributes flags;
1190                 [string,charset(UTF16)] uint16 *description;
1191                 [string,charset(UTF16)] uint16 *name;
1192                 [string,charset(UTF16)] uint16 *comment;
1193         } spoolss_SetPrinterInfo1;
1194
1195         typedef struct {
1196                 [string,charset(UTF16)] uint16 *servername;
1197                 [string,charset(UTF16)] uint16 *printername;
1198                 [string,charset(UTF16)] uint16 *sharename;
1199                 [string,charset(UTF16)] uint16 *portname;
1200                 [string,charset(UTF16)] uint16 *drivername;
1201                 [string,charset(UTF16)] uint16 *comment;
1202                 [string,charset(UTF16)] uint16 *location;
1203                 uint32 devmode_ptr;
1204                 [string,charset(UTF16)] uint16 *sepfile;
1205                 [string,charset(UTF16)] uint16 *printprocessor;
1206                 [string,charset(UTF16)] uint16 *datatype;
1207                 [string,charset(UTF16)] uint16 *parameters;
1208                 uint32 secdesc_ptr;
1209                 spoolss_PrinterAttributes attributes;
1210                 [range(0,99)] uint32 priority;
1211                 uint32 defaultpriority;
1212                 uint32 starttime;
1213                 uint32 untiltime;
1214                 spoolss_PrinterStatus status;
1215                 uint32 cjobs;
1216                 uint32 averageppm;
1217         } spoolss_SetPrinterInfo2;
1218
1219         typedef struct {
1220                 uint32 sec_desc_ptr;
1221         } spoolss_SetPrinterInfo3;
1222
1223         typedef struct {
1224                 [string,charset(UTF16)] uint16 *printername;
1225                 [string,charset(UTF16)] uint16 *servername;
1226                 spoolss_PrinterAttributes attributes;
1227         } spoolss_SetPrinterInfo4;
1228
1229         typedef struct {
1230                 [string,charset(UTF16)] uint16 *printername;
1231                 [string,charset(UTF16)] uint16 *portname;
1232                 spoolss_PrinterAttributes attributes;
1233                 uint32 device_not_selected_timeout;
1234                 uint32 transmission_retry_timeout;
1235         } spoolss_SetPrinterInfo5;
1236
1237         typedef struct {
1238                 spoolss_PrinterStatus status;
1239         } spoolss_SetPrinterInfo6;
1240
1241         typedef struct {
1242                 [string,charset(UTF16)] uint16 *guid; /* text form of printer guid */
1243                 spoolss_DsPrintAction action;
1244         } spoolss_SetPrinterInfo7;
1245
1246         typedef struct {
1247                 uint32 devmode_ptr;
1248         } spoolss_SetPrinterInfo8;
1249
1250         typedef struct {
1251                 uint32 devmode_ptr;
1252         } spoolss_SetPrinterInfo9;
1253
1254         typedef [switch_type(uint32)] union {
1255                 [case(0)] spoolss_SetPrinterInfo0 *info0;
1256                 [case(1)] spoolss_SetPrinterInfo1 *info1;
1257                 [case(2)] spoolss_SetPrinterInfo2 *info2;
1258                 [case(3)] spoolss_SetPrinterInfo3 *info3;
1259                 [case(4)] spoolss_SetPrinterInfo4 *info4;
1260                 [case(5)] spoolss_SetPrinterInfo5 *info5;
1261                 [case(6)] spoolss_SetPrinterInfo6 *info6;
1262                 [case(7)] spoolss_SetPrinterInfo7 *info7;
1263                 [case(8)] spoolss_SetPrinterInfo8 *info8;
1264                 [case(9)] spoolss_SetPrinterInfo9 *info9;
1265                 [default];
1266         } spoolss_SetPrinterInfo;
1267
1268         typedef struct {
1269                 uint32 level;
1270                 [switch_is(level)] spoolss_SetPrinterInfo info;
1271         } spoolss_SetPrinterInfoCtr;
1272
1273         WERROR spoolss_SetPrinter(
1274                 [in,ref] policy_handle *handle,
1275                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
1276                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
1277                 [in,ref] sec_desc_buf *secdesc_ctr,
1278                 [in] spoolss_PrinterControl command
1279         );
1280
1281         /******************/
1282         /* Function: 0x08 */
1283         [public] WERROR spoolss_GetPrinter(
1284                 [in,ref] policy_handle *handle,
1285                 [in]     uint32 level,
1286                 [in,unique] DATA_BLOB *buffer,
1287                 [in]     uint32 offered,
1288                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info,
1289                 [out,ref] uint32 *needed
1290         );
1291
1292         /******************/
1293         /* Function: 0x09 */
1294
1295         typedef [public] struct {
1296                 [value((ndr_size_spoolss_StringArray(r, ndr->flags)-4)/2)] uint32 _ndr_size;
1297                 /*[subcontext(0),subcontext_size(_ndr_size*2)]*/ nstring_array string;
1298         } spoolss_StringArray;
1299
1300         typedef struct {
1301                 [string,charset(UTF16)] uint16 *driver_name;
1302         } spoolss_AddDriverInfo1;
1303
1304         typedef [v1_enum,public] enum {
1305                 SPOOLSS_DRIVER_VERSION_9X       = 0,
1306                 SPOOLSS_DRIVER_VERSION_NT35     = 1,
1307                 SPOOLSS_DRIVER_VERSION_NT4      = 2,
1308                 SPOOLSS_DRIVER_VERSION_200X     = 3
1309         } spoolss_DriverOSVersion;
1310
1311         typedef struct {
1312                 spoolss_DriverOSVersion version;
1313                 [string,charset(UTF16)] uint16 *driver_name;
1314                 [string,charset(UTF16)] uint16 *architecture;
1315                 [string,charset(UTF16)] uint16 *driver_path;
1316                 [string,charset(UTF16)] uint16 *data_file;
1317                 [string,charset(UTF16)] uint16 *config_file;
1318         } spoolss_AddDriverInfo2;
1319
1320         typedef struct {
1321                 spoolss_DriverOSVersion version;
1322                 [string,charset(UTF16)] uint16 *driver_name;
1323                 [string,charset(UTF16)] uint16 *architecture;
1324                 [string,charset(UTF16)] uint16 *driver_path;
1325                 [string,charset(UTF16)] uint16 *data_file;
1326                 [string,charset(UTF16)] uint16 *config_file;
1327                 [string,charset(UTF16)] uint16 *help_file;
1328                 [string,charset(UTF16)] uint16 *monitor_name;
1329                 [string,charset(UTF16)] uint16 *default_datatype;
1330                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
1331                 spoolss_StringArray *dependent_files;
1332         } spoolss_AddDriverInfo3;
1333
1334         typedef struct {
1335                 spoolss_DriverOSVersion version;
1336                 [string,charset(UTF16)] uint16 *driver_name;
1337                 [string,charset(UTF16)] uint16 *architecture;
1338                 [string,charset(UTF16)] uint16 *driver_path;
1339                 [string,charset(UTF16)] uint16 *data_file;
1340                 [string,charset(UTF16)] uint16 *config_file;
1341                 [string,charset(UTF16)] uint16 *help_file;
1342                 [string,charset(UTF16)] uint16 *monitor_name;
1343                 [string,charset(UTF16)] uint16 *default_datatype;
1344                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
1345                 spoolss_StringArray *dependent_files;
1346                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
1347                 spoolss_StringArray *previous_names;
1348         } spoolss_AddDriverInfo4;
1349
1350         typedef [bitmap32bit] bitmap {
1351                 PRINTER_DRIVER_PACKAGE_AWARE = 0x00000002
1352         } spoolss_DriverAttributes;
1353
1354         typedef struct {
1355                 spoolss_DriverOSVersion version;
1356                 [string,charset(UTF16)] uint16 *driver_name;
1357                 [string,charset(UTF16)] uint16 *architecture;
1358                 [string,charset(UTF16)] uint16 *driver_path;
1359                 [string,charset(UTF16)] uint16 *data_file;
1360                 [string,charset(UTF16)] uint16 *config_file;
1361                 spoolss_DriverAttributes driver_attributes;
1362                 uint32 config_version;
1363                 uint32 driver_version;
1364         } spoolss_AddDriverInfo5;
1365
1366         typedef struct {
1367                 spoolss_DriverOSVersion version;
1368                 [string,charset(UTF16)] uint16 *driver_name;
1369                 [string,charset(UTF16)] uint16 *architecture;
1370                 [string,charset(UTF16)] uint16 *driver_path;
1371                 [string,charset(UTF16)] uint16 *data_file;
1372                 [string,charset(UTF16)] uint16 *config_file;
1373                 [string,charset(UTF16)] uint16 *help_file;
1374                 [string,charset(UTF16)] uint16 *monitor_name;
1375                 [string,charset(UTF16)] uint16 *default_datatype;
1376                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
1377                 spoolss_StringArray *dependent_files;
1378                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
1379                 spoolss_StringArray *previous_names;
1380                 NTTIME driver_date;
1381                 hyper driver_version;
1382                 [string,charset(UTF16)] uint16 *manufacturer_name;
1383                 [string,charset(UTF16)] uint16 *manufacturer_url;
1384                 [string,charset(UTF16)] uint16 *hardware_id;
1385                 [string,charset(UTF16)] uint16 *provider;
1386         } spoolss_AddDriverInfo6;
1387
1388         typedef struct {
1389                 spoolss_DriverOSVersion version;
1390                 [string,charset(UTF16)] uint16 *driver_name;
1391                 [string,charset(UTF16)] uint16 *architecture;
1392                 [string,charset(UTF16)] uint16 *driver_path;
1393                 [string,charset(UTF16)] uint16 *data_file;
1394                 [string,charset(UTF16)] uint16 *config_file;
1395                 [string,charset(UTF16)] uint16 *help_file;
1396                 [string,charset(UTF16)] uint16 *monitor_name;
1397                 [string,charset(UTF16)] uint16 *default_datatype;
1398                 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
1399                 spoolss_StringArray *dependent_files;
1400                 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
1401                 spoolss_StringArray *previous_names;
1402                 NTTIME driver_date;
1403                 hyper driver_version;
1404                 [string,charset(UTF16)] uint16 *manufacturer_name;
1405                 [string,charset(UTF16)] uint16 *manufacturer_url;
1406                 [string,charset(UTF16)] uint16 *hardware_id;
1407                 [string,charset(UTF16)] uint16 *provider;
1408                 [string,charset(UTF16)] uint16 *print_processor;
1409                 [string,charset(UTF16)] uint16 *vendor_setup;
1410                 [value(((ndr_size_spoolss_StringArray(color_profiles, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles;
1411                 spoolss_StringArray *color_profiles;
1412                 [string,charset(UTF16)] uint16 *inf_path;
1413                 uint32 printer_driver_attributes;
1414                 [value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies;
1415                 spoolss_StringArray *core_driver_dependencies;
1416                 NTTIME min_inbox_driver_ver_date;
1417                 hyper min_inbox_driver_ver_version;
1418         } spoolss_AddDriverInfo8;
1419
1420         typedef [switch_type(uint32)] union {
1421                 [case(1)] spoolss_AddDriverInfo1 *info1;
1422                 [case(2)] spoolss_AddDriverInfo2 *info2;
1423                 [case(3)] spoolss_AddDriverInfo3 *info3;
1424                 [case(4)] spoolss_AddDriverInfo4 *info4;
1425                 [case(6)] spoolss_AddDriverInfo6 *info6;
1426                 [case(8)] spoolss_AddDriverInfo8 *info8;
1427         } spoolss_AddDriverInfo;
1428
1429         typedef struct {
1430                 uint32 level;
1431                 [switch_is(level)] spoolss_AddDriverInfo info;
1432         } spoolss_AddDriverInfoCtr;
1433
1434         WERROR spoolss_AddPrinterDriver(
1435                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1436                 [in,ref] spoolss_AddDriverInfoCtr *info_ctr
1437         );
1438
1439         typedef [public,gensize] struct {
1440                 [relative] nstring *driver_name;
1441         } spoolss_DriverInfo1;
1442
1443         typedef [public,gensize] struct {
1444                 spoolss_DriverOSVersion version;
1445                 [relative] nstring *driver_name;
1446                 [relative] nstring *architecture;
1447                 [relative] nstring *driver_path;
1448                 [relative] nstring *data_file;
1449                 [relative] nstring *config_file;
1450         } spoolss_DriverInfo2;
1451
1452         typedef [public,gensize] struct {
1453                 spoolss_DriverOSVersion version;
1454                 [relative] nstring *driver_name;
1455                 [relative] nstring *architecture;
1456                 [relative] nstring *driver_path;
1457                 [relative] nstring *data_file;
1458                 [relative] nstring *config_file;
1459                 [relative] nstring *help_file;
1460                 [relative] nstring_array *dependent_files;
1461                 [relative] nstring *monitor_name;
1462                 [relative] nstring *default_datatype;
1463         } spoolss_DriverInfo3;
1464
1465         typedef [public,gensize] struct {
1466                 spoolss_DriverOSVersion version;
1467                 [relative] nstring *driver_name;
1468                 [relative] nstring *architecture;
1469                 [relative] nstring *driver_path;
1470                 [relative] nstring *data_file;
1471                 [relative] nstring *config_file;
1472                 [relative] nstring *help_file;
1473                 [relative] nstring_array *dependent_files;
1474                 [relative] nstring *monitor_name;
1475                 [relative] nstring *default_datatype;
1476                 [relative] nstring_array *previous_names;
1477         } spoolss_DriverInfo4;
1478
1479         typedef [public,gensize] struct {
1480                 spoolss_DriverOSVersion version;
1481                 [relative] nstring *driver_name;
1482                 [relative] nstring *architecture;
1483                 [relative] nstring *driver_path;
1484                 [relative] nstring *data_file;
1485                 [relative] nstring *config_file;
1486                 spoolss_DriverAttributes driver_attributes;
1487                 uint32 config_version;
1488                 uint32 driver_version;
1489         } spoolss_DriverInfo5;
1490
1491         typedef [public,gensize] struct {
1492                 spoolss_DriverOSVersion version;
1493                 [relative] nstring *driver_name;
1494                 [relative] nstring *architecture;
1495                 [relative] nstring *driver_path;
1496                 [relative] nstring *data_file;
1497                 [relative] nstring *config_file;
1498                 [relative] nstring *help_file;
1499                 [relative] nstring_array *dependent_files;
1500                 [relative] nstring *monitor_name;
1501                 [relative] nstring *default_datatype;
1502                 [relative] nstring_array *previous_names;
1503                 NTTIME driver_date;
1504                 hyper driver_version;
1505                 [relative] nstring *manufacturer_name;
1506                 [relative] nstring *manufacturer_url;
1507                 [relative] nstring *hardware_id;
1508                 [relative] nstring *provider;
1509         } spoolss_DriverInfo6;
1510
1511         typedef [public,gensize] struct {
1512                 uint32 size;
1513                 spoolss_DriverOSVersion version;
1514                 [relative] nstring *driver_name;
1515                 [relative] nstring *inf_name;
1516                 [relative] nstring *install_source_root;
1517         } spoolss_DriverInfo7;
1518
1519         typedef [public,gensize] struct {
1520                 spoolss_DriverOSVersion version;
1521                 [relative] nstring *driver_name;
1522                 [relative] nstring *architecture;
1523                 [relative] nstring *driver_path;
1524                 [relative] nstring *data_file;
1525                 [relative] nstring *config_file;
1526                 [relative] nstring *help_file;
1527                 [relative] nstring_array *dependent_files;
1528                 [relative] nstring *monitor_name;
1529                 [relative] nstring *default_datatype;
1530                 [relative] nstring_array *previous_names;
1531                 NTTIME driver_date;
1532                 hyper driver_version;
1533                 [relative] nstring *manufacturer_name;
1534                 [relative] nstring *manufacturer_url;
1535                 [relative] nstring *hardware_id;
1536                 [relative] nstring *provider;
1537                 [relative] nstring *print_processor;
1538                 [relative] nstring *vendor_setup;
1539                 [relative] nstring_array *color_profiles;
1540                 [relative] nstring *inf_path;
1541                 uint32 printer_driver_attributes;
1542                 [relative] nstring_array *core_driver_dependencies;
1543                 NTTIME min_inbox_driver_ver_date;
1544                 hyper min_inbox_driver_ver_version;
1545         } spoolss_DriverInfo8;
1546
1547         typedef [v1_enum] enum {
1548                 SPOOLSS_DRIVER_FILE_TYPE_RENDERING      = 0x00000000,
1549                 SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION  = 0x00000001,
1550                 SPOOLSS_DRIVER_FILE_TYPE_DATA           = 0x00000002,
1551                 SPOOLSS_DRIVER_FILE_TYPE_HELP           = 0x00000003,
1552                 SPOOLSS_DRIVER_FILE_TYPE_OTHER          = 0x00000004
1553         } spoolss_DriverFileType;
1554
1555         typedef [public] struct {
1556                 [relative] nstring *file_name;
1557                 spoolss_DriverFileType file_type;
1558                 uint32 file_version;
1559         } spoolss_DriverFileInfo;
1560
1561         typedef [public,gensize,nopush,nopull] struct {
1562                 spoolss_DriverOSVersion version;
1563                 [relative] nstring *driver_name;
1564                 [relative] nstring *architecture;
1565                 [relative,size_is(file_count),flag(NDR_ALIGN4)] spoolss_DriverFileInfo *file_info;
1566                 uint32 file_count;
1567                 [relative] nstring *monitor_name;
1568                 [relative] nstring *default_datatype;
1569                 [relative] nstring_array *previous_names;
1570                 NTTIME driver_date;
1571                 hyper driver_version;
1572                 [relative] nstring *manufacturer_name;
1573                 [relative] nstring *manufacturer_url;
1574                 [relative] nstring *hardware_id;
1575                 [relative] nstring *provider;
1576         } spoolss_DriverInfo101;
1577
1578         typedef [nodiscriminant,relative_base,public,gensize,flag(NDR_RELATIVE_REVERSE)] union {
1579                 [case(1)] spoolss_DriverInfo1 info1;
1580                 [case(2)] spoolss_DriverInfo2 info2;
1581                 [case(3)] spoolss_DriverInfo3 info3;
1582                 [case(4)] spoolss_DriverInfo4 info4;
1583                 [case(5)] spoolss_DriverInfo5 info5;
1584                 [case(6)] spoolss_DriverInfo6 info6;
1585                 [case(7)] spoolss_DriverInfo7 info7;
1586                 [case(8)] spoolss_DriverInfo8 info8;
1587                 [case(101)] spoolss_DriverInfo101 info101;
1588                 [default];
1589         } spoolss_DriverInfo;
1590
1591         /******************/
1592         /* Function: 0x0a */
1593         [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDrivers(
1594                 [in,unique] [string,charset(UTF16)] uint16 *server,
1595                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1596                 [in] uint32 level,
1597                 [in,unique] DATA_BLOB *buffer,
1598                 [in] uint32 offered,
1599                 [out,unique] DATA_BLOB *info,
1600                 [out,ref] uint32 *needed,
1601                 [out,ref] uint32 *count
1602         );
1603         [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers(
1604                 [in] uint32 level,
1605                 [in] uint32 count,
1606                 [out,switch_is(level)] spoolss_DriverInfo info[count]
1607         );
1608         [nopull,nopush] WERROR spoolss_EnumPrinterDrivers(
1609                 [in,unique] [string,charset(UTF16)] uint16 *server,
1610                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1611                 [in] uint32 level,
1612                 [in,unique] DATA_BLOB *buffer,
1613                 [in] uint32 offered,
1614                 [out,ref] uint32 *count,
1615                 [out,ref,switch_is(level),size_is(,*count)] spoolss_DriverInfo **info,
1616                 [out,ref] uint32 *needed
1617         );
1618
1619         /******************/
1620         /* Function: 0x0b */
1621         WERROR spoolss_GetPrinterDriver(
1622                 [in,ref] policy_handle *handle,
1623                 [in,unique] [string,charset(UTF16)] uint16 *architecture,
1624                 [in]     uint32 level,
1625                 [in,unique] DATA_BLOB *buffer,
1626                 [in]     uint32 offered,
1627                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverInfo *info,
1628                 [out,ref] uint32 *needed
1629         );
1630
1631         /******************/
1632         /* Function: 0x0c */
1633         typedef [public,gensize] struct {
1634                 nstring directory_name;
1635         } spoolss_DriverDirectoryInfo1;
1636
1637         /* NOTE: it's seems that w2k3 completly ignores the level
1638                  in its server code
1639          */
1640         typedef [nodiscriminant,relative_base,public,gensize,flag(NDR_RELATIVE_REVERSE)] union {
1641                 [case(1)] spoolss_DriverDirectoryInfo1 info1;
1642                 [default] spoolss_DriverDirectoryInfo1 info1;
1643         } spoolss_DriverDirectoryInfo;
1644
1645         [public] WERROR spoolss_GetPrinterDriverDirectory(
1646                 [in,unique] [string,charset(UTF16)] uint16 *server,
1647                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1648                 [in] uint32 level,
1649                 [in,unique] DATA_BLOB *buffer,
1650                 [in] uint32 offered,
1651                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
1652                 [out,ref] uint32 *needed
1653         );
1654
1655         /******************/
1656         /* Function: 0x0d */
1657         WERROR spoolss_DeletePrinterDriver(
1658                 [in,unique] [string,charset(UTF16)] uint16 *server,
1659                 [in] [string,charset(UTF16)] uint16 architecture[],
1660                 [in] [string,charset(UTF16)] uint16 driver[]
1661         );
1662
1663         /******************/
1664         /* Function: 0x0e */
1665         WERROR spoolss_AddPrintProcessor(
1666                 [in,unique] [string,charset(UTF16)] uint16 *server,
1667                 [in] [string,charset(UTF16)] uint16 architecture[],
1668                 [in] [string,charset(UTF16)] uint16 path_name[],
1669                 [in] [string,charset(UTF16)] uint16 print_processor_name[]
1670         );
1671
1672         /******************/
1673         /* Function: 0x0f */
1674         typedef [public,gensize] struct {
1675                 [relative] nstring *print_processor_name;
1676         } spoolss_PrintProcessorInfo1;
1677
1678         typedef [nodiscriminant,relative_base,public,flag(NDR_RELATIVE_REVERSE)] union {
1679                 [case(1)] spoolss_PrintProcessorInfo1 info1;
1680                 [default];
1681         } spoolss_PrintProcessorInfo;
1682
1683         [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessors(
1684                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1685                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1686                 [in] uint32 level,
1687                 [in,unique] DATA_BLOB *buffer,
1688                 [in] uint32 offered,
1689                 [out,unique] DATA_BLOB *info,
1690                 [out,ref] uint32 *needed,
1691                 [out,ref] uint32 *count
1692         );
1693         [public,noopnum,noprint] void __spoolss_EnumPrintProcessors(
1694                 [in] uint32 level,
1695                 [in] uint32 count,
1696                 [out,switch_is(level)] spoolss_PrintProcessorInfo info[count]
1697         );
1698         [nopull,nopush] WERROR spoolss_EnumPrintProcessors(
1699                 [in,unique] [string,charset(UTF16)] uint16 *servername,
1700                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1701                 [in] uint32 level,
1702                 [in,unique] DATA_BLOB *buffer,
1703                 [in] uint32 offered,
1704                 [out,ref] uint32 *count,
1705                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrintProcessorInfo **info,
1706                 [out,ref] uint32 *needed
1707         );
1708
1709         /******************/
1710         /* Function: 0x10 */
1711         typedef [public,gensize] struct {
1712                 nstring directory_name;
1713         } spoolss_PrintProcessorDirectoryInfo1;
1714
1715         typedef [nodiscriminant,relative_base,public,gensize,flag(NDR_RELATIVE_REVERSE)] union {
1716                 [case(1)] spoolss_PrintProcessorDirectoryInfo1 info1;
1717                 [default] spoolss_PrintProcessorDirectoryInfo1 info1;
1718         } spoolss_PrintProcessorDirectoryInfo;
1719
1720         WERROR spoolss_GetPrintProcessorDirectory(
1721                 [in,unique] [string,charset(UTF16)] uint16 *server,
1722                 [in,unique] [string,charset(UTF16)] uint16 *environment,
1723                 [in] uint32 level,
1724                 [in,unique] DATA_BLOB *buffer,
1725                 [in] uint32 offered,
1726                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrintProcessorDirectoryInfo *info,
1727                 [out,ref] uint32 *needed
1728         );
1729
1730         /******************/
1731         /* Function: 0x11 */
1732         typedef struct {
1733                 [string,charset(UTF16)] uint16 *document_name;
1734                 [string,charset(UTF16)] uint16 *output_file;
1735                 [string,charset(UTF16)] uint16 *datatype;
1736         } spoolss_DocumentInfo1;
1737
1738         typedef [switch_type(uint32)] union {
1739                 [case(1)] spoolss_DocumentInfo1 *info1;
1740                 [case(2)]; /* TODO */
1741                 [case(3)]; /* TODO */
1742                 [default];
1743         } spoolss_DocumentInfo;
1744
1745         WERROR spoolss_StartDocPrinter(
1746                 [in,ref] policy_handle *handle,
1747                 [in] uint32 level,
1748                 [in,switch_is(level)] spoolss_DocumentInfo info,
1749                 [out,ref] uint32 *job_id
1750         );
1751
1752         /******************/
1753         /* Function: 0x12 */
1754         WERROR spoolss_StartPagePrinter(
1755                 [in,ref] policy_handle *handle
1756         );
1757
1758         /******************/
1759         /* Function: 0x13 */
1760         WERROR spoolss_WritePrinter(
1761                 [in,ref] policy_handle *handle,
1762                 [in] DATA_BLOB data,
1763                 [in,value(r->in.data.length)] uint32 _data_size,
1764                 [out,ref] uint32 *num_written
1765         );
1766
1767         /******************/
1768         /* Function: 0x14 */
1769         WERROR spoolss_EndPagePrinter(
1770                 [in,ref] policy_handle *handle
1771         );
1772
1773         /******************/
1774         /* Function: 0x15 */
1775         WERROR spoolss_AbortPrinter(
1776                 [in,ref] policy_handle *handle
1777         );
1778
1779         /******************/
1780         /* Function: 0x16 */
1781         WERROR spoolss_ReadPrinter(
1782                 [in,ref] policy_handle *handle,
1783                 [out,ref] [size_is(data_size)] uint8 *data,
1784                 [in] uint32 data_size,
1785                 [out,ref] uint32 *_data_size
1786         );
1787
1788         /******************/
1789         /* Function: 0x17 */
1790         WERROR spoolss_EndDocPrinter(
1791                 [in,ref] policy_handle *handle
1792         );
1793
1794         /******************/
1795         /* Function: 0x18 */
1796         WERROR spoolss_AddJob(
1797                 [in,ref] policy_handle *handle,
1798                 [in] uint32 level,
1799                 [in,out,unique] [size_is(offered)] uint8 *buffer,
1800                 [in] uint32 offered,
1801                 [out,ref] uint32 *needed
1802         );
1803
1804         /******************/
1805         /* Function: 0x19 */
1806         WERROR spoolss_ScheduleJob(
1807                 [in,ref] policy_handle *handle,
1808                 [in] uint32 jobid
1809         );
1810
1811         /******************/
1812         /* Function: 0x1a */
1813
1814         const string SPL_ARCH_WIN40             = "WIN40";
1815         const string SPL_ARCH_W32X86            = "W32X86";
1816         const string SPL_ARCH_W32MIPS           = "W32MIPS";
1817         const string SPL_ARCH_W32ALPHA          = "W32ALPHA";
1818         const string SPL_ARCH_W32PPC            = "W32PPC";
1819         const string SPL_ARCH_IA64              = "IA64";
1820         const string SPL_ARCH_X64               = "x64";
1821         const string SPL_ARCH_ARM               = "ARM";
1822
1823         const string SPOOLSS_ARCHITECTURE_ALL                   = "All";
1824         const string SPOOLSS_ARCHITECTURE_ALL_CLUSTER           = "AllCluster";
1825         const string SPOOLSS_ARCHITECTURE_NT_X86                = "Windows NT x86";
1826         const string SPOOLSS_ARCHITECTURE_IA_64                 = "Windows IA64";
1827         const string SPOOLSS_ARCHITECTURE_x64                   = "Windows x64";
1828         const string SPOOLSS_ARCHITECTURE_4_0                   = "Windows 4.0";
1829         const string SPOOLSS_ARCHITECTURE_ARM                   = "Windows ARM";
1830         const string SPOOLSS_DEFAULT_SERVER_PATH                = "C:\\WINDOWS\\system32\\spool";
1831
1832         typedef [public,gensize] struct {
1833                 [value(ndr_size_spoolss_OSVersion(r,ndr->flags))] uint32 _ndr_size;
1834                 uint32 major;
1835                 uint32 minor;
1836                 uint32 build;
1837                 [value(2)] uint32 platform_id;
1838                 [subcontext(0),subcontext_size(256)] nstring extra_string;
1839         } spoolss_OSVersion;
1840
1841         typedef [public,gensize] struct {
1842                 [value(ndr_size_spoolss_OSVersionEx(r,ndr->flags))] uint32 _ndr_size;
1843                 uint32 major;
1844                 uint32 minor;
1845                 uint32 build;
1846                 [value(2)] uint32 platform_id;
1847                 [subcontext(0),subcontext_size(256)] nstring extra_string;
1848                 uint16 service_pack_major;
1849                 uint16 service_pack_minor;
1850                 uint16 suite_mask;
1851                 uint8 product_type;
1852                 uint8 reserved;
1853         } spoolss_OSVersionEx;
1854
1855         typedef [nodiscriminant,public] union {
1856                 [case(REG_NONE)];
1857                 [case(REG_SZ)] nstring string;
1858                 [case(REG_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary;
1859                 [case(REG_DWORD)] uint32 value;
1860                 [case(REG_MULTI_SZ)] nstring_array string_array;
1861                 [default,flag(NDR_REMAINING)] DATA_BLOB data;
1862         } spoolss_PrinterData;
1863
1864         /* predefined registry key names for printer data */
1865
1866         const string SPOOL_PRINTERDATA_KEY              = "PrinterDriverData";
1867         const string SPOOL_DSSPOOLER_KEY                = "DsSpooler";
1868         const string SPOOL_DSDRIVER_KEY                 = "DsDriver";
1869         const string SPOOL_DSUSER_KEY                   = "DsUser";
1870         const string SPOOL_PNPDATA_KEY                  = "PnPData";
1871         const string SPOOL_OID_KEY                      = "OID";
1872
1873         /* predefined value names for printer data */
1874
1875         const string SPOOL_REG_ASSETNUMBER              = "assetNumber";
1876         const string SPOOL_REG_BYTESPERMINUTE           = "bytesPerMinute";
1877         const string SPOOL_REG_DEFAULTPRIORITY          = "defaultPriority";
1878         const string SPOOL_REG_DESCRIPTION              = "description";
1879         const string SPOOL_REG_DRIVERNAME               = "driverName";
1880         const string SPOOL_REG_DRIVERVERSION            = "driverVersion";
1881         const string SPOOL_REG_FLAGS                    = "flags";
1882         const string SPOOL_REG_LOCATION                 = "location";
1883         const string SPOOL_REG_OPERATINGSYSTEM          = "operatingSystem";
1884         const string SPOOL_REG_OPERATINGSYSTEMHOTFIX    = "operatingSystemHotfix";
1885         const string SPOOL_REG_OPERATINGSYSTEMSERVICEPACK = "operatingSystemServicePack";
1886         const string SPOOL_REG_OPERATINGSYSTEMVERSION   = "operatingSystemVersion";
1887         const string SPOOL_REG_PORTNAME                 = "portName";
1888         const string SPOOL_REG_PRINTATTRIBUTES          = "printAttributes";
1889         const string SPOOL_REG_PRINTBINNAMES            = "printBinNames";
1890         const string SPOOL_REG_PRINTCOLLATE             = "printCollate";
1891         const string SPOOL_REG_PRINTCOLOR               = "printColor";
1892         const string SPOOL_REG_PRINTDUPLEXSUPPORTED     = "printDuplexSupported";
1893         const string SPOOL_REG_PRINTENDTIME             = "printEndTime";
1894         const string SPOOL_REG_PRINTERNAME              = "printerName";
1895         const string SPOOL_REG_PRINTFORMNAME            = "printFormName";
1896         const string SPOOL_REG_PRINTKEEPPRINTEDJOBS     = "printKeepPrintedJobs";
1897         const string SPOOL_REG_PRINTLANGUAGE            = "printLanguage";
1898         const string SPOOL_REG_PRINTMACADDRESS          = "printMACAddress";
1899         const string SPOOL_REG_PRINTMAXCOPIES           = "printMaxCopies";
1900         const string SPOOL_REG_PRINTMAXRESOLUTIONSUPPORTED = "printMaxResolutionSupported";
1901         const string SPOOL_REG_PRINTMAXXEXTENT          = "printMaxXExtent";
1902         const string SPOOL_REG_PRINTMAXYEXTENT          = "printMaxYExtent";
1903         const string SPOOL_REG_PRINTMEDIAREADY          = "printMediaReady";
1904         const string SPOOL_REG_PRINTMEDIASUPPORTED      = "printMediaSupported";
1905         const string SPOOL_REG_PRINTMEMORY              = "printMemory";
1906         const string SPOOL_REG_PRINTMINXEXTENT          = "printMinXExtent";
1907         const string SPOOL_REG_PRINTMINYEXTENT          = "printMinYExtent";
1908         const string SPOOL_REG_PRINTNETWORKADDRESS      = "printNetworkAddress";
1909         const string SPOOL_REG_PRINTNOTIFY              = "printNotify";
1910         const string SPOOL_REG_PRINTNUMBERUP            = "printNumberUp";
1911         const string SPOOL_REG_PRINTORIENTATIONSSUPPORTED = "printOrientationsSupported";
1912         const string SPOOL_REG_PRINTOWNER               = "printOwner";
1913         const string SPOOL_REG_PRINTPAGESPERMINUTE      = "printPagesPerMinute";
1914         const string SPOOL_REG_PRINTRATE                = "printRate";
1915         const string SPOOL_REG_PRINTRATEUNIT            = "printRateUnit";
1916         const string SPOOL_REG_PRINTSEPARATORFILE       = "printSeparatorFile";
1917         const string SPOOL_REG_PRINTSHARENAME           = "printShareName";
1918         const string SPOOL_REG_PRINTSPOOLING            = "printSpooling";
1919         const string SPOOL_REGVAL_PRINTWHILESPOOLING    = "PrintWhileSpooling";
1920         const string SPOOL_REGVAL_PRINTAFTERSPOOLED     = "PrintAfterSpooled";
1921         const string SPOOL_REGVAL_PRINTDIRECT           = "PrintDirect";
1922         const string SPOOL_REG_PRINTSTAPLINGSUPPORTED   = "printStaplingSupported";
1923         const string SPOOL_REG_PRINTSTARTTIME           = "printStartTime";
1924         const string SPOOL_REG_PRINTSTATUS              = "printStatus";
1925         const string SPOOL_REG_PRIORITY                 = "priority";
1926         const string SPOOL_REG_SERVERNAME               = "serverName";
1927         const string SPOOL_REG_SHORTSERVERNAME          = "shortServerName";
1928         const string SPOOL_REG_UNCNAME                  = "uNCName";
1929         const string SPOOL_REG_URL                      = "url";
1930         const string SPOOL_REG_VERSIONNUMBER            = "versionNumber";
1931
1932         [public] WERROR spoolss_GetPrinterData(
1933                 [in,ref] policy_handle *handle,
1934                 [in]     [string,charset(UTF16)] uint16 value_name[],
1935                 [out,ref] winreg_Type *type,
1936                 [out,ref,size_is(offered)] uint8 *data,
1937                 [in]     uint32 offered,
1938                 [out,ref] uint32 *needed
1939         );
1940
1941         /******************/
1942         /* Function: 0x1b */
1943         WERROR spoolss_SetPrinterData(
1944                 [in,ref] policy_handle *handle,
1945                 [in] [string,charset(UTF16)] uint16 value_name[],
1946                 [in] winreg_Type type,
1947                 [in,ref] [size_is(offered)] uint8 *data,
1948                 [in] uint32 offered
1949         );
1950
1951         /******************/
1952         /* Function: 0x1c */
1953         [todo] WERROR spoolss_WaitForPrinterChange(
1954         );
1955
1956         /******************/
1957         /* Function: 0x1d */
1958         [public] WERROR spoolss_ClosePrinter(
1959                 [in,out,ref]     policy_handle *handle
1960         );
1961
1962         /******************/
1963         /* Function: 0x1e */
1964         typedef [v1_enum] enum {
1965                 SPOOLSS_FORM_USER       = 0,
1966                 SPOOLSS_FORM_BUILTIN    = 1,
1967                 SPOOLSS_FORM_PRINTER    = 2
1968         } spoolss_FormFlags;
1969
1970         typedef struct {
1971                 uint32 width;
1972                 uint32 height;
1973         } spoolss_FormSize;
1974
1975         typedef struct {
1976                 uint32 left;
1977                 uint32 top;
1978                 uint32 right;
1979                 uint32 bottom;
1980         } spoolss_FormArea;
1981
1982         typedef [public,gensize] struct {
1983                 spoolss_FormFlags flags;
1984                 [relative] nstring *form_name;
1985                 spoolss_FormSize size;
1986                 spoolss_FormArea area;
1987         } spoolss_FormInfo1;
1988
1989         typedef [bitmap32bit] bitmap {
1990                 SPOOLSS_FORM_STRING_TYPE_NONE           = 0x00000001,
1991                 SPOOLSS_FORM_STRING_TYPE_MUI_DLL        = 0x00000002,
1992                 SPOOLSS_FORM_STRING_TYPE_LANG_PAIR      = 0x00000004
1993         } spoolss_FormStringType;
1994
1995         typedef [public,gensize] struct {
1996                 spoolss_FormFlags flags;
1997                 [relative] nstring *form_name;
1998                 spoolss_FormSize size;
1999                 spoolss_FormArea area;
2000                 [relative] astring *keyword;
2001                 spoolss_FormStringType string_type;
2002                 [relative] nstring *mui_dll;
2003                 uint32 ressource_id;
2004                 [relative] nstring *display_name;
2005                 uint16 lang_id;
2006                 uint16 unused;
2007         } spoolss_FormInfo2;
2008
2009         typedef [nodiscriminant,relative_base,public,gensize,flag(NDR_RELATIVE_REVERSE)] union {
2010                 [case(1)] spoolss_FormInfo1 info1;
2011                 [case(2)] spoolss_FormInfo2 info2;
2012                 [default];
2013         } spoolss_FormInfo;
2014
2015         typedef struct {
2016                 spoolss_FormFlags flags;
2017                 [string,charset(UTF16)] uint16 *form_name;
2018                 spoolss_FormSize size;
2019                 spoolss_FormArea area;
2020         } spoolss_AddFormInfo1;
2021
2022         typedef struct {
2023                 spoolss_FormFlags flags;
2024                 [string,charset(UTF16)] uint16 *form_name;
2025                 spoolss_FormSize size;
2026                 spoolss_FormArea area;
2027                 [string,charset(DOS)] uint8 *keyword;
2028                 spoolss_FormStringType string_type;
2029                 [string,charset(UTF16)] uint16 *mui_dll;
2030                 uint32 ressource_id;
2031                 [string,charset(UTF16)] uint16 *display_name;
2032                 uint32 lang_id;
2033         } spoolss_AddFormInfo2;
2034
2035         typedef [switch_type(uint32)] union {
2036                 [case(1)] spoolss_AddFormInfo1 *info1;
2037                 [case(2)] spoolss_AddFormInfo2 *info2;
2038         } spoolss_AddFormInfo;
2039
2040         WERROR spoolss_AddForm(
2041                 [in,ref] policy_handle *handle,
2042                 [in] uint32 level,
2043                 [in,switch_is(level)] spoolss_AddFormInfo info
2044         );
2045
2046         /******************/
2047         /* Function: 0x1f */
2048         WERROR spoolss_DeleteForm(
2049                 [in,ref] policy_handle *handle,
2050                 [in] [string,charset(UTF16)] uint16 form_name[]
2051         );
2052
2053         /******************/
2054         /* Function: 0x20 */
2055         WERROR spoolss_GetForm(
2056                 [in,ref] policy_handle *handle,
2057                 [in] [string,charset(UTF16)] uint16 form_name[],
2058                 [in] uint32 level,
2059                 [in,unique] DATA_BLOB *buffer,
2060                 [in] uint32 offered,
2061                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
2062                 [out,ref] uint32 *needed
2063         );
2064
2065         /******************/
2066         /* Function: 0x21 */
2067         WERROR spoolss_SetForm(
2068                 [in,ref] policy_handle *handle,
2069                 [in] [string,charset(UTF16)] uint16 form_name[],
2070                 [in] uint32 level,
2071                 [in,switch_is(level)] spoolss_AddFormInfo info
2072         );
2073
2074         /******************/
2075         /* Function: 0x22 */
2076         [public,noopnum,noprint] WERROR _spoolss_EnumForms(
2077                 [in,ref] policy_handle *handle,
2078                 [in]     uint32 level,
2079                 [in,unique] DATA_BLOB *buffer,
2080                 [in]     uint32 offered,
2081                 [out,unique] DATA_BLOB *info,
2082                 [out,ref] uint32 *needed,
2083                 [out,ref] uint32 *count
2084         );
2085         [public,noopnum,noprint] void __spoolss_EnumForms(
2086                 [in] uint32 level,
2087                 [in] uint32 count,
2088                 [out,switch_is(level)] spoolss_FormInfo info[count]
2089         );
2090         [nopull,nopush] WERROR spoolss_EnumForms(
2091                 [in,ref] policy_handle *handle,
2092                 [in]     uint32 level,
2093                 [in,unique] DATA_BLOB *buffer,
2094                 [in]     uint32 offered,
2095                 [out,ref] uint32 *count,
2096                 [out,ref,switch_is(level),size_is(,*count)] spoolss_FormInfo **info,
2097                 [out,ref] uint32 *needed
2098         );
2099
2100         /*
2101          * Special strings for the OpenPrinter() call.  See the MSDN DDK
2102          * docs on the XcvDataPort() for more details.
2103          */
2104
2105         const string SPL_LOCAL_PORT             = "Local Port";
2106         const string SPL_TCPIP_PORT             = "Standard TCP/IP Port";
2107         const string SPL_XCV_MONITOR_LOCALMON   = ",XcvMonitor Local Port";
2108         const string SPL_XCV_MONITOR_TCPMON     = ",XcvMonitor Standard TCP/IP Port";
2109
2110         typedef [public,gensize] struct {
2111                 [relative] nstring *port_name;
2112         } spoolss_PortInfo1;
2113
2114         typedef bitmap {
2115                 SPOOLSS_PORT_TYPE_WRITE         = 0x00000001,
2116                 SPOOLSS_PORT_TYPE_READ          = 0x00000002,
2117                 SPOOLSS_PORT_TYPE_REDIRECTED    = 0x00000004,
2118                 SPOOLSS_PORT_TYPE_NET_ATTACHED  = 0x00000008
2119         } spoolss_PortType;
2120
2121         typedef [public,gensize] struct {
2122                 [relative] nstring *port_name;
2123                 [relative] nstring *monitor_name;
2124                 [relative] nstring *description;
2125                 spoolss_PortType port_type;
2126                 uint32 reserved;
2127         } spoolss_PortInfo2;
2128
2129         typedef [v1_enum] enum {
2130                 PORT_STATUS_CLEAR               = 0x00000000,
2131                 PORT_STATUS_OFFLINE             = 0x00000001,
2132                 PORT_STATUS_PAPER_JAM           = 0x00000002,
2133                 PORT_STATUS_PAPER_OUT           = 0x00000003,
2134                 PORT_STATUS_OUTPUT_BIN_FULL     = 0x00000004,
2135                 PORT_STATUS_PAPER_PROBLEM       = 0x00000005,
2136                 PORT_STATUS_NO_TONER            = 0x00000006,
2137                 PORT_STATUS_DOOR_OPEN           = 0x00000007,
2138                 PORT_STATUS_USER_INTERVENTION   = 0x00000008,
2139                 PORT_STATUS_OUT_OF_MEMORY       = 0x00000009,
2140                 PORT_STATUS_TONER_LOW           = 0x0000000A,
2141                 PORT_STATUS_WARMING_UP          = 0x0000000B,
2142                 PORT_STATUS_POWER_SAVE          = 0x0000000C
2143         } spoolss_PortStatus;
2144
2145         typedef [v1_enum] enum {
2146                 PORT_STATUS_TYPE_ERROR          = 0x00000001,
2147                 PORT_STATUS_TYPE_WARNING        = 0x00000002,
2148                 PORT_STATUS_TYPE_INFO           = 0x00000003
2149         } spoolss_PortSeverity;
2150
2151         typedef [public,gensize] struct {
2152                 spoolss_PortStatus status;
2153                 [relative] nstring *status_string;
2154                 spoolss_PortSeverity severity;
2155         } spoolss_PortInfo3;
2156
2157         typedef [public,gensize] struct {
2158                 [relative] nstring *port_name;
2159                 DATA_BLOB monitor_data; /* relative ?? */
2160         } spoolss_PortInfoFF;
2161
2162         typedef [nodiscriminant,relative_base,public,flag(NDR_RELATIVE_REVERSE)] union {
2163                 [case(1)] spoolss_PortInfo1 info1;
2164                 [case(2)] spoolss_PortInfo2 info2;
2165                 [case(3)] spoolss_PortInfo3 info3;
2166                 [case(0xff)] spoolss_PortInfoFF infoFF;
2167                 [default];
2168         } spoolss_PortInfo;
2169
2170         /******************/
2171         /* Function: 0x23 */
2172         [public,noopnum,noprint] WERROR _spoolss_EnumPorts(
2173                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2174                 [in] uint32 level,
2175                 [in,unique] DATA_BLOB *buffer,
2176                 [in] uint32 offered,
2177                 [out,unique] DATA_BLOB *info,
2178                 [out,ref] uint32 *needed,
2179                 [out,ref] uint32 *count
2180         );
2181         [public,noopnum,noprint] void __spoolss_EnumPorts(
2182                 [in] uint32 level,
2183                 [in] uint32 count,
2184                 [out,switch_is(level)] spoolss_PortInfo info[count]
2185         );
2186         [nopull,nopush] WERROR spoolss_EnumPorts(
2187                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2188                 [in] uint32 level,
2189                 [in,unique] DATA_BLOB *buffer,
2190                 [in] uint32 offered,
2191                 [out,ref] uint32 *count,
2192                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PortInfo **info,
2193                 [out,ref] uint32 *needed
2194         );
2195
2196         /******************/
2197         /* Function: 0x24 */
2198         typedef [public,gensize] struct {
2199                 [relative] nstring *monitor_name;
2200         } spoolss_MonitorInfo1;
2201
2202         typedef [public,gensize] struct {
2203                 [relative] nstring *monitor_name;
2204                 [relative] nstring *environment;
2205                 [relative] nstring *dll_name;
2206         } spoolss_MonitorInfo2;
2207
2208         typedef [nodiscriminant,relative_base,public,flag(NDR_RELATIVE_REVERSE)] union {
2209                 [case(1)] spoolss_MonitorInfo1 info1;
2210                 [case(2)] spoolss_MonitorInfo2 info2;
2211                 [default];
2212         } spoolss_MonitorInfo;
2213
2214         [public,noopnum,noprint] WERROR _spoolss_EnumMonitors(
2215                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2216                 [in] uint32 level,
2217                 [in,unique] DATA_BLOB *buffer,
2218                 [in] uint32 offered,
2219                 [out,unique] DATA_BLOB *info,
2220                 [out,ref] uint32 *needed,
2221                 [out,ref] uint32 *count
2222         );
2223         [public,noopnum,noprint] void __spoolss_EnumMonitors(
2224                 [in] uint32 level,
2225                 [in] uint32 count,
2226                 [out,switch_is(level)] spoolss_MonitorInfo info[count]
2227         );
2228         [nopull,nopush] WERROR spoolss_EnumMonitors(
2229                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2230                 [in] uint32 level,
2231                 [in,unique] DATA_BLOB *buffer,
2232                 [in] uint32 offered,
2233                 [out,ref] uint32 *count,
2234                 [out,ref,switch_is(level),size_is(,*count)] spoolss_MonitorInfo **info,
2235                 [out,ref] uint32 *needed
2236         );
2237
2238         /******************/
2239         /* Function: 0x25 */
2240
2241         typedef [public,gensize] struct {
2242                 [string,charset(UTF16)] uint16 *port_name;
2243         } spoolss_SetPortInfo1;
2244
2245         typedef [public,gensize] struct {
2246                 [string,charset(UTF16)] uint16 *port_name;
2247                 [string,charset(UTF16)] uint16 *monitor_name;
2248                 [string,charset(UTF16)] uint16 *description;
2249                 spoolss_PortType port_type;
2250                 uint32 reserved;
2251         } spoolss_SetPortInfo2;
2252
2253         typedef [public,gensize] struct {
2254                 spoolss_PortStatus status;
2255                 [string,charset(UTF16)] uint16 *status_string;
2256                 spoolss_PortSeverity severity;
2257         } spoolss_SetPortInfo3;
2258
2259         typedef [public,gensize] struct {
2260                 [string,charset(UTF16)] uint16 *port_name;
2261                 DATA_BLOB monitor_data; /* relative ?? */
2262         } spoolss_SetPortInfoFF;
2263
2264         typedef [switch_type(uint32)] union {
2265                 [case(1)] spoolss_SetPortInfo1 *info1;
2266                 [case(2)] spoolss_SetPortInfo2 *info2;
2267                 [case(3)] spoolss_SetPortInfo3 *info3;
2268                 [case(0xff)] spoolss_SetPortInfoFF *infoFF;
2269         } spoolss_SetPortInfo;
2270
2271         typedef struct {
2272                 uint32 level;
2273                 [switch_is(level)] spoolss_SetPrinterInfo info;
2274         } spoolss_SetPortInfoContainer;
2275
2276         WERROR spoolss_AddPort(
2277                [in,unique] [string,charset(UTF16)] uint16 *server_name,
2278                [in] uint32 unknown,
2279                [in] [string,charset(UTF16)] uint16 monitor_name[]
2280         );
2281
2282         /******************/
2283         /* Function: 0x26 */
2284         [todo] WERROR spoolss_ConfigurePort(
2285         );
2286
2287         /******************/
2288         /* Function: 0x27 */
2289         WERROR spoolss_DeletePort(
2290                [in,unique] [string,charset(UTF16)] uint16 *server_name,
2291                [in] uint32 ptr,
2292                [in,ref] [string,charset(UTF16)] uint16 *port_name
2293         );
2294
2295         /******************/
2296         /* Function: 0x28 */
2297         WERROR spoolss_CreatePrinterIC(
2298                 [in,ref] policy_handle *handle,
2299                 [out,ref] policy_handle *gdi_handle,
2300                 [in,ref] spoolss_DevmodeContainer *devmode_ctr
2301         );
2302
2303         /******************/
2304         /* Function: 0x29 */
2305         [todo] WERROR spoolss_PlayGDIScriptOnPrinterIC(
2306         );
2307
2308         /******************/
2309         /* Function: 0x2a */
2310         WERROR spoolss_DeletePrinterIC(
2311                 [in,out,ref] policy_handle *gdi_handle
2312         );
2313
2314         /******************/
2315         /* Function: 0x2b */
2316         [todo] WERROR spoolss_AddPrinterConnection(
2317         );
2318
2319         /******************/
2320         /* Function: 0x2c */
2321         [todo] WERROR spoolss_DeletePrinterConnection(
2322         );
2323
2324         /******************/
2325         /* Function: 0x2d */
2326         [todo] WERROR spoolss_PrinterMessageBox(
2327                 /* Marked as obsolete in MSDN.  "Not necessary and has
2328                    no effect". */
2329         );
2330
2331         /******************/
2332         /* Function: 0x2e */
2333         [todo] WERROR spoolss_AddMonitor(
2334         );
2335
2336         /******************/
2337         /* Function: 0x2f */
2338         [todo] WERROR spoolss_DeleteMonitor(
2339         );
2340
2341         /******************/
2342         /* Function: 0x30 */
2343         [todo] WERROR spoolss_DeletePrintProcessor(
2344         );
2345
2346         /******************/
2347         /* Function: 0x31 */
2348         [todo] WERROR spoolss_AddPrintProvidor(
2349         );
2350
2351         /******************/
2352         /* Function: 0x32 */
2353         [todo] WERROR spoolss_DeletePrintProvidor(
2354         );
2355
2356         /******************/
2357         /* Function: 0x33 */
2358
2359         typedef [public,gensize] struct {
2360                 [relative] nstring *name_array;
2361         } spoolss_PrintProcDataTypesInfo1;
2362
2363         typedef [nodiscriminant,relative_base,public,flag(NDR_RELATIVE_REVERSE)] union {
2364                 [case(1)] spoolss_PrintProcDataTypesInfo1 info1;
2365                 [default];
2366         } spoolss_PrintProcDataTypesInfo;
2367
2368         [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcDataTypes(
2369                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2370                 [in,unique] [string,charset(UTF16)] uint16 *print_processor_name,
2371                 [in] uint32 level,
2372                 [in,unique] DATA_BLOB *buffer,
2373                 [in] uint32 offered,
2374                 [out,unique] DATA_BLOB *info,
2375                 [out,ref] uint32 *needed,
2376                 [out,ref] uint32 *count
2377         );
2378         [public,noopnum,noprint] void __spoolss_EnumPrintProcDataTypes(
2379                 [in] uint32 level,
2380                 [in] uint32 count,
2381                 [out,switch_is(level)] spoolss_PrintProcDataTypesInfo info[count]
2382         );
2383         [nopull,nopush] WERROR spoolss_EnumPrintProcDataTypes(
2384                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2385                 [in,unique] [string,charset(UTF16)] uint16 *print_processor_name,
2386                 [in] uint32 level,
2387                 [in,unique] DATA_BLOB *buffer,
2388                 [in] uint32 offered,
2389                 [out,ref] uint32 *count,
2390                 [out,ref,switch_is(level),size_is(,*count)] spoolss_PrintProcDataTypesInfo **info,
2391                 [out,ref] uint32 *needed
2392         );
2393
2394         /******************/
2395         /* Function: 0x34 */
2396         WERROR spoolss_ResetPrinter(
2397                 [in,ref] policy_handle *handle,
2398                 [in,unique] [string,charset(UTF16)] uint16 *data_type,
2399                 [in,ref] spoolss_DevmodeContainer *devmode_ctr
2400         );
2401
2402         /******************/
2403         /* Function: 0x35 */
2404         [public] WERROR spoolss_GetPrinterDriver2(
2405                 [in,ref] policy_handle *handle,
2406                 [in,unique] [string,charset(UTF16)] uint16 *architecture,
2407                 [in]     uint32 level,
2408                 [in,unique] DATA_BLOB *buffer,
2409                 [in]     uint32 offered,
2410                 [in]     uint32 client_major_version,
2411                 [in]     uint32 client_minor_version,
2412                 [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverInfo *info,
2413                 [out,ref] uint32 *needed,
2414                 [out,ref] uint32 *server_major_version,
2415                 [out,ref] uint32 *server_minor_version
2416         );
2417
2418         /******************/
2419         /* Function: 0x36 */
2420         [todo] WERROR spoolss_FindFirstPrinterChangeNotification(
2421         );
2422
2423         /******************/
2424         /* Function: 0x37 */
2425         [todo] WERROR spoolss_FindNextPrinterChangeNotification(
2426         );
2427
2428         /******************/
2429         /* Function: 0x38 */
2430         [public] WERROR spoolss_FindClosePrinterNotify(
2431                 [in,ref] policy_handle *handle
2432         );
2433
2434         /******************/
2435         /* Function: 0x39 */
2436         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotificationOld(
2437         );
2438
2439         /******************/
2440         /* Function: 0x3a */
2441         [public] WERROR spoolss_ReplyOpenPrinter(
2442                 [in,string,charset(UTF16)] uint16 server_name[],
2443                 [in] uint32 printer_local,
2444                 [in] winreg_Type type,
2445                 [in,range(0,512)] uint32 bufsize,
2446                 [in,unique,size_is(bufsize)] uint8 *buffer,
2447                 [out,ref] policy_handle *handle
2448         );
2449
2450         /******************/
2451         /* Function: 0x3b */
2452
2453         typedef [bitmap32bit] bitmap {
2454                 PRINTER_CHANGE_ADD_PRINTER                      = 0x00000001,
2455                 PRINTER_CHANGE_SET_PRINTER                      = 0x00000002,
2456                 PRINTER_CHANGE_DELETE_PRINTER                   = 0x00000004,
2457                 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER        = 0x00000008,
2458                 PRINTER_CHANGE_ADD_JOB                          = 0x00000100,
2459                 PRINTER_CHANGE_SET_JOB                          = 0x00000200,
2460                 PRINTER_CHANGE_DELETE_JOB                       = 0x00000400,
2461                 PRINTER_CHANGE_WRITE_JOB                        = 0x00000800,
2462                 PRINTER_CHANGE_ADD_FORM                         = 0x00010000,
2463                 PRINTER_CHANGE_SET_FORM                         = 0x00020000,
2464                 PRINTER_CHANGE_DELETE_FORM                      = 0x00040000,
2465                 PRINTER_CHANGE_ADD_PORT                         = 0x00100000,
2466                 PRINTER_CHANGE_CONFIGURE_PORT                   = 0x00200000,
2467                 PRINTER_CHANGE_DELETE_PORT                      = 0x00400000,
2468                 PRINTER_CHANGE_ADD_PRINT_PROCESSOR              = 0x01000000,
2469                 PRINTER_CHANGE_DELETE_PRINT_PROCESSOR           = 0x04000000,
2470                 PRINTER_CHANGE_SERVER                           = 0x08000000,
2471                 PRINTER_CHANGE_ADD_PRINTER_DRIVER               = 0x10000000,
2472                 PRINTER_CHANGE_SET_PRINTER_DRIVER               = 0x20000000,
2473                 PRINTER_CHANGE_DELETE_PRINTER_DRIVER            = 0x40000000,
2474                 PRINTER_CHANGE_TIMEOUT                          = 0x80000000
2475         } spoolss_PrinterChangeFlags;
2476
2477         const int PRINTER_CHANGE_PRINTER                        = 0x000000FF;
2478
2479         const int PRINTER_CHANGE_JOB                            = 0x0000FF00;
2480
2481         const int PRINTER_CHANGE_FORM                           = (PRINTER_CHANGE_ADD_FORM |
2482                                                                    PRINTER_CHANGE_SET_FORM |
2483                                                                    PRINTER_CHANGE_DELETE_FORM); /* 0x00070000 */
2484
2485         const int PRINTER_CHANGE_PORT                           = (PRINTER_CHANGE_ADD_PORT |
2486                                                                    PRINTER_CHANGE_CONFIGURE_PORT |
2487                                                                    PRINTER_CHANGE_DELETE_PORT); /* 0x00700000 */
2488
2489         const int PRINTER_CHANGE_PRINT_PROCESSOR                = 0x07000000;
2490
2491         const int PRINTER_CHANGE_PRINTER_DRIVER                 = (PRINTER_CHANGE_ADD_PRINTER_DRIVER |
2492                                                                    PRINTER_CHANGE_SET_PRINTER_DRIVER |
2493                                                                    PRINTER_CHANGE_DELETE_PRINTER_DRIVER); /* 0x70000000 */
2494
2495         const int PRINTER_CHANGE_ALL                            = (PRINTER_CHANGE_PRINTER |
2496                                                                    PRINTER_CHANGE_JOB |
2497                                                                    PRINTER_CHANGE_FORM |
2498                                                                    PRINTER_CHANGE_PORT |
2499                                                                    PRINTER_CHANGE_PRINT_PROCESSOR |
2500                                                                    PRINTER_CHANGE_PRINTER_DRIVER); /* 0x7777FFFF */
2501         WERROR spoolss_RouterReplyPrinter(
2502                 [in,ref] policy_handle *handle,
2503                 [in] spoolss_PrinterChangeFlags flags,
2504                 [in,range(0,512)] uint32 bufsize,
2505                 [in,unique,size_is(bufsize)] uint8 *buffer
2506         );
2507
2508         /******************/
2509         /* Function: 0x3c */
2510         [public] WERROR spoolss_ReplyClosePrinter(
2511                 [in,out,ref] policy_handle *handle
2512         );
2513
2514         /******************/
2515         /* Function: 0x3d */
2516
2517         typedef struct {
2518                 uint32 monitor_data_size;
2519                 [size_is(monitor_data_size),unique] uint8 *monitor_data;
2520         } spoolss_PortVarContainer;
2521
2522         WERROR spoolss_AddPortEx(
2523                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2524                 [in,ref] spoolss_SetPortInfoContainer *port_ctr,
2525                 [in,ref] spoolss_PortVarContainer *port_var_ctr,
2526                 [in,unique] [string,charset(UTF16)] uint16 *monitor_name
2527         );
2528
2529         /******************/
2530         /* Function: 0x3e */
2531         [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotification(
2532         );
2533
2534         /******************/
2535         /* Function: 0x3f */
2536         [todo] WERROR spoolss_SpoolerInit(
2537         );
2538
2539         /******************/
2540         /* Function: 0x40 */
2541         [todo] WERROR spoolss_ResetPrinterEx(
2542         );
2543
2544         typedef [enum16bit,public] enum {
2545                 JOB_NOTIFY_FIELD_PRINTER_NAME                   = 0x00,
2546                 JOB_NOTIFY_FIELD_MACHINE_NAME                   = 0x01,
2547                 JOB_NOTIFY_FIELD_PORT_NAME                      = 0x02,
2548                 JOB_NOTIFY_FIELD_USER_NAME                      = 0x03,
2549                 JOB_NOTIFY_FIELD_NOTIFY_NAME                    = 0x04,
2550                 JOB_NOTIFY_FIELD_DATATYPE                       = 0x05,
2551                 JOB_NOTIFY_FIELD_PRINT_PROCESSOR                = 0x06,
2552                 JOB_NOTIFY_FIELD_PARAMETERS                     = 0x07,
2553                 JOB_NOTIFY_FIELD_DRIVER_NAME                    = 0x08,
2554                 JOB_NOTIFY_FIELD_DEVMODE                        = 0x09,
2555                 JOB_NOTIFY_FIELD_STATUS                         = 0x0a,
2556                 JOB_NOTIFY_FIELD_STATUS_STRING                  = 0x0b,
2557                 JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR            = 0x0c,
2558                 JOB_NOTIFY_FIELD_DOCUMENT                       = 0x0d,
2559                 JOB_NOTIFY_FIELD_PRIORITY                       = 0x0e,
2560                 JOB_NOTIFY_FIELD_POSITION                       = 0x0f,
2561                 JOB_NOTIFY_FIELD_SUBMITTED                      = 0x10,
2562                 JOB_NOTIFY_FIELD_START_TIME                     = 0x11,
2563                 JOB_NOTIFY_FIELD_UNTIL_TIME                     = 0x12,
2564                 JOB_NOTIFY_FIELD_TIME                           = 0x13,
2565                 JOB_NOTIFY_FIELD_TOTAL_PAGES                    = 0x14,
2566                 JOB_NOTIFY_FIELD_PAGES_PRINTED                  = 0x15,
2567                 JOB_NOTIFY_FIELD_TOTAL_BYTES                    = 0x16,
2568                 JOB_NOTIFY_FIELD_BYTES_PRINTED                  = 0x17
2569         } spoolss_JobNotifyField;
2570
2571         typedef [enum16bit,public] enum {
2572                 PRINTER_NOTIFY_FIELD_SERVER_NAME                = 0x00,
2573                 PRINTER_NOTIFY_FIELD_PRINTER_NAME               = 0x01,
2574                 PRINTER_NOTIFY_FIELD_SHARE_NAME                 = 0x02,
2575                 PRINTER_NOTIFY_FIELD_PORT_NAME                  = 0x03,
2576                 PRINTER_NOTIFY_FIELD_DRIVER_NAME                = 0x04,
2577                 PRINTER_NOTIFY_FIELD_COMMENT                    = 0x05,
2578                 PRINTER_NOTIFY_FIELD_LOCATION                   = 0x06,
2579                 PRINTER_NOTIFY_FIELD_DEVMODE                    = 0x07,
2580                 PRINTER_NOTIFY_FIELD_SEPFILE                    = 0x08,
2581                 PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR            = 0x09,
2582                 PRINTER_NOTIFY_FIELD_PARAMETERS                 = 0x0a,
2583                 PRINTER_NOTIFY_FIELD_DATATYPE                   = 0x0b,
2584                 PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR        = 0x0c,
2585                 PRINTER_NOTIFY_FIELD_ATTRIBUTES                 = 0x0d,
2586                 PRINTER_NOTIFY_FIELD_PRIORITY                   = 0x0e,
2587                 PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY           = 0x0f,
2588                 PRINTER_NOTIFY_FIELD_START_TIME                 = 0x10,
2589                 PRINTER_NOTIFY_FIELD_UNTIL_TIME                 = 0x11,
2590                 PRINTER_NOTIFY_FIELD_STATUS                     = 0x12,
2591                 PRINTER_NOTIFY_FIELD_STATUS_STRING              = 0x13,
2592                 PRINTER_NOTIFY_FIELD_CJOBS                      = 0x14,
2593                 PRINTER_NOTIFY_FIELD_AVERAGE_PPM                = 0x15,
2594                 PRINTER_NOTIFY_FIELD_TOTAL_PAGES                = 0x16,
2595                 PRINTER_NOTIFY_FIELD_PAGES_PRINTED              = 0x17,
2596                 PRINTER_NOTIFY_FIELD_TOTAL_BYTES                = 0x18,
2597                 PRINTER_NOTIFY_FIELD_BYTES_PRINTED              = 0x19,
2598                 PRINTER_NOTIFY_FIELD_OBJECT_GUID                = 0x1a,
2599                 PRINTER_NOTIFY_FIELD_FRIENDLY_NAME              = 0x1b
2600         } spoolss_PrintNotifyField;
2601
2602         typedef [enum16bit] enum {
2603                 PRINTER_NOTIFY_TYPE     = 0x00,
2604                 JOB_NOTIFY_TYPE         = 0x01
2605         } spoolss_NotifyType;
2606
2607         typedef [nodiscriminant,noprint] union {
2608                 [case(PRINTER_NOTIFY_TYPE)] uint16 field;
2609                 [case(JOB_NOTIFY_TYPE)] uint16 field;
2610                 [default] uint16 field;
2611         } spoolss_Field;
2612
2613         /******************/
2614         /* Function: 0x41 */
2615         typedef struct {
2616                 spoolss_NotifyType type;
2617                 uint16 u1;
2618                 uint32 u2;
2619                 uint32 u3;
2620                 uint32 count;
2621                 [size_is(count),switch_is(type)] spoolss_Field *fields;
2622         } spoolss_NotifyOptionType;
2623
2624         typedef [bitmap32bit] bitmap {
2625                 PRINTER_NOTIFY_OPTIONS_REFRESH  = 0x00000001
2626         } spoolssNotifyOptionFlags;
2627
2628         typedef struct {
2629                 [value(2)] uint32 version;
2630                 spoolssNotifyOptionFlags flags;
2631                 uint32 count;
2632                 [size_is(count)] spoolss_NotifyOptionType *types;
2633         } spoolss_NotifyOption;
2634
2635         [public] WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
2636                 [in,ref] policy_handle *handle,
2637                 [in] spoolss_PrinterChangeFlags flags,
2638                 [in] uint32 options,
2639                 [in,unique] [string,charset(UTF16)] uint16 *local_machine,
2640                 [in] uint32 printer_local,
2641                 [in,unique] spoolss_NotifyOption *notify_options
2642         );
2643
2644         /******************/
2645         /* Function: 0x42 */
2646
2647         typedef struct {
2648                 uint32 size;
2649                 [size_is(size/2),unique,charset(UTF16)] uint16 *string;
2650         } spoolss_NotifyString;
2651
2652         typedef [v1_enum] enum {
2653                 NOTIFY_TABLE_DWORD              = 0x0001,
2654                 NOTIFY_TABLE_STRING             = 0x0002,
2655                 NOTIFY_TABLE_DEVMODE            = 0x0003,
2656                 NOTIFY_TABLE_TIME               = 0x0004,
2657                 NOTIFY_TABLE_SECURITYDESCRIPTOR = 0x0005
2658         } spoolss_NotifyTable;
2659
2660         typedef [switch_type(uint32)] union {
2661                 [case(1)] uint32 integer[2];
2662                 [case(2)] spoolss_NotifyString string;
2663                 [case(3)] spoolss_DevmodeContainer devmode;
2664                 [case(4)] spoolss_TimeCtr time;
2665                 [case(5)] sec_desc_buf sd;
2666         } spoolss_NotifyData;
2667
2668         typedef struct {
2669                 spoolss_NotifyType type;
2670                 [switch_is(type)] spoolss_Field field;
2671                 spoolss_NotifyTable variable_type;
2672                 uint32 job_id;
2673                 [switch_is(variable_type)] spoolss_NotifyData data;
2674         } spoolss_Notify;
2675
2676         typedef struct {
2677                 [value(2)] uint32 version;
2678                 uint32 flags;
2679                 uint32 count;
2680                 [size_is(count)] spoolss_Notify notifies[];
2681         } spoolss_NotifyInfo;
2682
2683         typedef [switch_type(uint32)] union {
2684                 [case(0)] spoolss_NotifyInfo *info0;
2685         } spoolss_ReplyPrinterInfo;
2686
2687         typedef [bitmap32bit] bitmap {
2688                 PRINTER_NOTIFY_INFO_DISCARDED           = 0x00000001,
2689                 PRINTER_NOTIFY_INFO_DISCARDNOTED        = 0x00010000,
2690                 PRINTER_NOTIFY_INFO_COLOR_MISMATCH      = 0x00080000
2691         } spoolss_PrinterNotifyFlags;
2692
2693         WERROR spoolss_RouterReplyPrinterEx(
2694                 [in,ref] policy_handle *handle,
2695                 [in] uint32 color,
2696                 [in] spoolss_PrinterChangeFlags flags,
2697                 [out,ref] spoolss_PrinterNotifyFlags *reply_result,
2698                 [in] uint32 reply_type,
2699                 [in,switch_is(reply_type)] spoolss_ReplyPrinterInfo info
2700         );
2701
2702         /******************/
2703         /* Function: 0x43 */
2704         [public] WERROR spoolss_RouterRefreshPrinterChangeNotify(
2705                 [in,ref] policy_handle *handle,
2706                 [in] uint32 change_low,
2707                 [in,unique] spoolss_NotifyOption *options,
2708                 [out,ref] spoolss_NotifyInfo **info
2709         );
2710
2711         /******************/
2712         /* Function: 0x44 */
2713         [todo] WERROR spoolss_44(
2714         );
2715
2716         typedef struct {
2717                 uint32 size;
2718                 [string,charset(UTF16)] uint16 *client;
2719                 [string,charset(UTF16)] uint16 *user;
2720                 uint32 build;
2721                 spoolss_MajorVersion major;
2722                 spoolss_MinorVersion minor;
2723                 spoolss_ProcessorArchitecture processor;
2724         } spoolss_UserLevel1;
2725
2726         typedef struct {
2727                 uint32 not_used;
2728         } spoolss_UserLevel2;
2729
2730         typedef struct {
2731                 uint32 size;
2732                 uint32 flags;
2733                 uint32 size2;
2734                 [string,charset(UTF16)] uint16 *client;
2735                 [string,charset(UTF16)] uint16 *user;
2736                 uint32 build;
2737                 spoolss_MajorVersion major;
2738                 spoolss_MinorVersion minor;
2739                 spoolss_ProcessorArchitecture processor;
2740                 udlong reserved;
2741         } spoolss_UserLevel3;
2742
2743         typedef [switch_type(uint32)] union {
2744                 [case(1)]  spoolss_UserLevel1 *level1;
2745                 [case(2)]  spoolss_UserLevel2 *level2;
2746                 [case(3)]  spoolss_UserLevel3 *level3;
2747         } spoolss_UserLevel;
2748
2749         typedef struct {
2750                 uint32 level;
2751                 [switch_is(level)] spoolss_UserLevel user_info;
2752         } spoolss_UserLevelCtr;
2753
2754         typedef bitmap {
2755                 SERVER_ACCESS_ADMINISTER        = 0x00000001,
2756                 SERVER_ACCESS_ENUMERATE         = 0x00000002,
2757                 PRINTER_ACCESS_ADMINISTER       = 0x00000004,
2758                 PRINTER_ACCESS_USE              = 0x00000008,
2759                 JOB_ACCESS_ADMINISTER           = 0x00000010,
2760                 JOB_ACCESS_READ                 = 0x00000020
2761         } spoolss_AccessRights;
2762
2763         /* Access rights for print servers */
2764         const int SERVER_ALL_ACCESS     = SEC_STD_REQUIRED |
2765                                           SERVER_ACCESS_ADMINISTER |
2766                                           SERVER_ACCESS_ENUMERATE;
2767
2768         const int SERVER_READ           = SEC_STD_READ_CONTROL |
2769                                           SERVER_ACCESS_ENUMERATE;
2770
2771         const int SERVER_WRITE          = STANDARD_RIGHTS_WRITE_ACCESS |
2772                                           SERVER_ACCESS_ADMINISTER |
2773                                           SERVER_ACCESS_ENUMERATE;
2774
2775         const int SERVER_EXECUTE        = SEC_STD_READ_CONTROL |
2776                                           SERVER_ACCESS_ENUMERATE;
2777
2778         /* Access rights for printers */
2779         const int PRINTER_ALL_ACCESS    = SEC_STD_REQUIRED |
2780                                           PRINTER_ACCESS_ADMINISTER |
2781                                           PRINTER_ACCESS_USE;
2782
2783         const int PRINTER_READ          = SEC_STD_READ_CONTROL |
2784                                           PRINTER_ACCESS_USE;
2785
2786         const int PRINTER_WRITE         = STANDARD_RIGHTS_WRITE_ACCESS |
2787                                           PRINTER_ACCESS_USE;
2788
2789         const int PRINTER_EXECUTE       = SEC_STD_READ_CONTROL |
2790                                           PRINTER_ACCESS_USE;
2791
2792         /* Access rights for jobs */
2793         const int JOB_ALL_ACCESS        = SEC_STD_REQUIRED |
2794                                           JOB_ACCESS_ADMINISTER;
2795
2796         const int JOB_READ              = SEC_STD_READ_CONTROL |
2797                                           JOB_ACCESS_ADMINISTER;
2798
2799         const int JOB_WRITE             = STANDARD_RIGHTS_WRITE_ACCESS |
2800                                           JOB_ACCESS_ADMINISTER;
2801
2802         const int JOB_EXECUTE           = SEC_STD_READ_CONTROL |
2803                                           JOB_ACCESS_ADMINISTER;
2804
2805         /* ACE masks for various print permissions */
2806         const int PRINTER_ACE_FULL_CONTROL = SEC_GENERIC_ALL |
2807                                                 PRINTER_ALL_ACCESS;
2808
2809         const int PRINTER_ACE_MANAGE_DOCUMENTS = SEC_GENERIC_ALL |
2810                                                 READ_CONTROL_ACCESS;
2811
2812         const int PRINTER_ACE_PRINT     = GENERIC_EXECUTE_ACCESS |
2813                                           READ_CONTROL_ACCESS |
2814                                           PRINTER_ACCESS_USE;
2815
2816         /******************/
2817         /* Function: 0x45 */
2818         [public] WERROR spoolss_OpenPrinterEx(
2819                 [in,unique]           [string,charset(UTF16)] uint16 *printername,
2820                 [in,unique]           [string,charset(UTF16)] uint16 *datatype,
2821                 [in]                  spoolss_DevmodeContainer devmode_ctr,
2822                 [in]                  spoolss_AccessRights access_mask,
2823                 [in]                  uint32 level,
2824                 [in,switch_is(level)] spoolss_UserLevel userlevel,
2825                 [out,ref]             policy_handle *handle
2826         );
2827
2828         /******************/
2829         /* Function: 0x46 */
2830         WERROR spoolss_AddPrinterEx(
2831                 [in,unique] [string,charset(UTF16)] uint16 *server,
2832                 [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
2833                 [in,ref] spoolss_DevmodeContainer *devmode_ctr,
2834                 [in,ref] sec_desc_buf *secdesc_ctr,
2835                 [in,ref] spoolss_UserLevelCtr *userlevel_ctr,
2836                 [out,ref] policy_handle *handle
2837         );
2838
2839         /******************/
2840         /* Function: 0x47 */
2841         WERROR spoolss_SetPort(
2842                 [in,unique] [string,charset(UTF16)] uint16 *servername,
2843                 [in,unique] [string,charset(UTF16)] uint16 *port_name,
2844                 [in,ref] spoolss_SetPortInfoContainer *port_ctr
2845         );
2846
2847         /******************/
2848         /* Function: 0x48 */
2849         WERROR spoolss_EnumPrinterData(
2850                 [in,ref] policy_handle *handle,
2851                 [in]     uint32 enum_index,
2852                 [out,size_is(value_offered/2),charset(UTF16)] uint16 value_name[],
2853                 [in]     uint32 value_offered,
2854                 [out,ref] uint32 *value_needed,
2855                 [out,ref] winreg_Type *type,
2856                 [out,ref,size_is(data_offered),flag(LIBNDR_PRINT_ARRAY_HEX)] uint8 *data,
2857                 [in]     uint32 data_offered,
2858                 [out,ref] uint32 *data_needed
2859         );
2860
2861         /******************/
2862         /* Function: 0x49 */
2863         WERROR spoolss_DeletePrinterData(
2864                 [in,ref] policy_handle *handle,
2865                 [in] [string,charset(UTF16)] uint16 value_name[]
2866         );
2867
2868         /******************/
2869         /* Function: 0x4a */
2870         [todo] WERROR spoolss_4a(
2871         );
2872
2873         /******************/
2874         /* Function: 0x4b */
2875         [todo] WERROR spoolss_4b(
2876         );
2877
2878         /******************/
2879         /* Function: 0x4c */
2880         [todo] WERROR spoolss_4c(
2881         );
2882
2883         /******************/
2884         /* Function: 0x4d */
2885         WERROR spoolss_SetPrinterDataEx(
2886                 [in,ref] policy_handle *handle,
2887                 [in] [string,charset(UTF16)] uint16 key_name[],
2888                 [in] [string,charset(UTF16)] uint16 value_name[],
2889                 [in] winreg_Type type,
2890                 [in,ref] [size_is(offered)] uint8 *data,
2891                 [in] uint32 offered
2892         );
2893
2894         /******************/
2895         /* Function: 0x4e */
2896         WERROR spoolss_GetPrinterDataEx(
2897                 [in,ref] policy_handle *handle,
2898                 [in]     [string,charset(UTF16)] uint16 key_name[],
2899                 [in]     [string,charset(UTF16)] uint16 value_name[],
2900                 [out,ref] winreg_Type *type,
2901                 [out,ref,size_is(offered)] uint8 *data,
2902                 [in]     uint32 offered,
2903                 [out,ref] uint32 *needed
2904         );
2905
2906         /******************/
2907         /* Function: 0x4f */
2908
2909         typedef [relative_base,public,gensize] struct {
2910                 [relative] nstring *value_name;
2911                 [value(2*strlen_m_term(value_name))] uint32 value_name_len;
2912                 winreg_Type type;
2913                 [relative,subcontext(0),subcontext_size(data_length),flag(NDR_REMAINING|ndr_spoolss_PrinterEnumValues_align(r->type))] DATA_BLOB *data;
2914                 [value(data ? data->length : 0)] uint32 data_length;
2915         } spoolss_PrinterEnumValues;
2916
2917         [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDataEx(
2918                 [in,ref] policy_handle *handle,
2919                 [in]     [string,charset(UTF16)] uint16 key_name[],
2920                 [out] DATA_BLOB info,
2921                 [in] uint32 offered,
2922                 [out,ref] uint32 *needed,
2923                 [out,ref] uint32 *count
2924         );
2925         [public,noopnum,noprint] void __spoolss_EnumPrinterDataEx(
2926                 [in] uint32 count,
2927                 [out] spoolss_PrinterEnumValues info[count]
2928         );
2929         [nopull,nopush] WERROR spoolss_EnumPrinterDataEx(
2930                 [in,ref] policy_handle *handle,
2931                 [in]     [string,charset(UTF16)] uint16 key_name[],
2932                 [in] uint32 offered,
2933                 [out,ref] uint32 *count,
2934                 [out,ref,size_is(,*count)] spoolss_PrinterEnumValues **info,
2935                 [out,ref] uint32 *needed
2936         );
2937
2938         typedef [nodiscriminant] union {
2939                 [case(0)];
2940                 [case(1)];
2941                 [default] nstring_array string_array;
2942         } spoolss_KeyNames;
2943
2944         /******************/
2945         /* Function: 0x50 */
2946         [public] WERROR spoolss_EnumPrinterKey(
2947                 [in, ref] policy_handle *handle,
2948                 [in] [string,charset(UTF16)] uint16 key_name[],
2949                 [out,ref] uint32 *_ndr_size,
2950                 [out,ref,subcontext(0),subcontext_size(*_ndr_size*2),switch_is(*_ndr_size)] spoolss_KeyNames *key_buffer,
2951                 [in] uint32 offered,
2952                 [out,ref] uint32 *needed
2953         );
2954
2955         /******************/
2956         /* Function: 0x51 */
2957         WERROR spoolss_DeletePrinterDataEx(
2958                 [in,ref] policy_handle *handle,
2959                 [in] [string,charset(UTF16)] uint16 key_name[],
2960                 [in] [string,charset(UTF16)] uint16 value_name[]
2961         );
2962
2963         /******************/
2964         /* Function: 0x52 */
2965         WERROR spoolss_DeletePrinterKey(
2966                 [in,ref] policy_handle *handle,
2967                 [in] [string,charset(UTF16)] uint16 key_name[]
2968         );
2969
2970         /******************/
2971         /* Function: 0x53 */
2972         [todo] WERROR spoolss_53(
2973         );
2974
2975         /******************/
2976         /* Function: 0x54 */
2977         typedef [public,bitmap32bit] bitmap {
2978                 DPD_DELETE_UNUSED_FILES         = 0x00000001,
2979                 DPD_DELETE_SPECIFIC_VERSION     = 0x00000002,
2980                 DPD_DELETE_ALL_FILES            = 0x00000004
2981         } spoolss_DeleteDriverFlags;
2982
2983         WERROR spoolss_DeletePrinterDriverEx(
2984                 [in,unique] [string,charset(UTF16)] uint16 *server,
2985                 [in] [string,charset(UTF16)] uint16 architecture[],
2986                 [in] [string,charset(UTF16)] uint16 driver[],
2987                 [in] spoolss_DeleteDriverFlags delete_flags,
2988                 [in] uint32 version
2989         );
2990
2991         /******************/
2992         /* Function: 0x55 */
2993         WERROR spoolss_AddPerMachineConnection(
2994                 [in,unique] [string,charset(UTF16)] uint16 *server,
2995                 [in,ref] [string,charset(UTF16)] uint16 *printername,
2996                 [in,ref] [string,charset(UTF16)] uint16 *printserver,
2997                 [in,ref] [string,charset(UTF16)] uint16 *provider
2998         );
2999
3000         /******************/
3001         /* Function: 0x56 */
3002         WERROR spoolss_DeletePerMachineConnection(
3003                 [in,unique] [string,charset(UTF16)] uint16 *server,
3004                 [in,ref] [string,charset(UTF16)] uint16 *printername
3005         );
3006
3007         /******************/
3008         /* Function: 0x57 */
3009         [todo] WERROR spoolss_EnumPerMachineConnections(
3010         );
3011
3012         /******************/
3013         /* Function: 0x58 */
3014
3015         typedef [v1_enum] enum {
3016                 PROTOCOL_RAWTCP_TYPE    = 1,
3017                 PROTOCOL_LPR_TYPE       = 2
3018         } spoolss_PortProtocol;
3019
3020         typedef [public,gensize] struct {
3021                 [charset(UTF16)] uint16 portname[64];
3022                 [value(0x00000001)] uint32 version;
3023                 spoolss_PortProtocol protocol;
3024                 [value(ndr_size_spoolss_PortData1(r, ndr->flags))] uint32 size;
3025                 uint32 reserved;
3026                 [charset(UTF16)] uint16 hostaddress[49];
3027                 [charset(UTF16)] uint16 snmpcommunity[33];
3028                 uint32 dblspool;
3029                 [charset(UTF16)] uint16 queue[33];
3030                 [charset(UTF16)] uint16 ip_address[16]; /* s3 had 17 */
3031                 [charset(UTF16)] uint16 hardware_address[13];
3032                 [charset(UTF16)] uint16 device_type[257];
3033                 uint32 port_number;
3034                 boolean32 snmp_enabled;
3035                 uint32 snmp_dev_index;
3036         } spoolss_PortData1;
3037
3038         typedef [public,gensize] struct {
3039                 [charset(UTF16)] uint16 portname[64];
3040                 [value(0x00000002)] uint32 version;
3041                 spoolss_PortProtocol protocol;
3042                 [value(ndr_size_spoolss_PortData2(r, ndr->flags))] uint32 size;
3043                 uint32 reserved;
3044                 [charset(UTF16)] uint16 hostaddress[128];
3045                 [charset(UTF16)] uint16 snmpcommunity[33];
3046                 uint32 dblspool;
3047                 [charset(UTF16)] uint16 queue[33];
3048                 [charset(UTF16)] uint16 device_type[257];
3049                 uint32 port_number;
3050                 boolean32 snmp_enabled;
3051                 uint32 snmp_dev_index;
3052                 uint32 port_monitor_mib_index;
3053         } spoolss_PortData2;
3054
3055         typedef [public] struct {
3056                 nstring dll_name;
3057         } spoolss_MonitorUi;
3058
3059         WERROR spoolss_XcvData(
3060                 [in,ref] policy_handle *handle,
3061                 [in] [string,charset(UTF16)] uint16 function_name[],
3062                 [in] DATA_BLOB in_data,
3063                 [in,value(r->in.in_data.length)] uint32 _in_data_length,
3064                 [out,ref] [size_is(out_data_size)] uint8 *out_data,
3065                 [in] uint32 out_data_size,
3066                 [out,ref] uint32 *needed,
3067                 [in,out,ref] uint32 *status_code
3068         );
3069
3070         /******************/
3071         /* Function: 0x59 */
3072
3073         typedef [bitmap32bit] bitmap {
3074                 APD_STRICT_UPGRADE              = 0x00000001,
3075                 APD_STRICT_DOWNGRADE            = 0x00000002,
3076                 APD_COPY_ALL_FILES              = 0x00000004,
3077                 APD_COPY_NEW_FILES              = 0x00000008,
3078                 APD_COPY_FROM_DIRECTORY         = 0x00000010,
3079                 APD_DONT_COPY_FILES_TO_CLUSTER  = 0x00001000,
3080                 APD_COPY_TO_ALL_SPOOLERS        = 0x00002000,
3081                 APD_RETURN_BLOCKING_STATUS_CODE = 0x00010000
3082         } spoolss_AddPrinterDriverExFlags;
3083
3084         [public] WERROR spoolss_AddPrinterDriverEx(
3085                 [in,unique] [string,charset(UTF16)] uint16 *servername,
3086                 [in,ref] spoolss_AddDriverInfoCtr *info_ctr,
3087                 [in] spoolss_AddPrinterDriverExFlags flags
3088         );
3089
3090         /******************/
3091         /* Function: 0x5a */
3092         [todo] WERROR spoolss_5a(
3093         );
3094
3095         /******************/
3096         /* Function: 0x5b */
3097         [todo] WERROR spoolss_5b(
3098         );
3099
3100         /******************/
3101         /* Function: 0x5c */
3102         [todo] WERROR spoolss_5c(
3103         );
3104
3105         /******************/
3106         /* Function: 0x5d */
3107         [todo] WERROR spoolss_5d(
3108         );
3109
3110         /******************/
3111         /* Function: 0x5e */
3112         [todo] WERROR spoolss_5e(
3113         );
3114
3115         /******************/
3116         /* Function: 0x5f */
3117         [todo] WERROR spoolss_5f(
3118         );
3119
3120         /******************/
3121         /* Function: 0x60 */
3122         [todo] WERROR spoolss_60(
3123         );
3124
3125         /******************/
3126         /* Function: 0x61 */
3127         [todo] WERROR spoolss_61(
3128         );
3129
3130         /******************/
3131         /* Function: 0x62 */
3132         [todo] WERROR spoolss_62(
3133         );
3134
3135         /******************/
3136         /* Function: 0x63 */
3137         [todo] WERROR spoolss_63(
3138         );
3139
3140         /******************/
3141         /* Function: 0x64 */
3142         [todo] WERROR spoolss_64(
3143         );
3144
3145         /******************/
3146         /* Function: 0x65 */
3147         [todo] WERROR spoolss_65(
3148         );
3149
3150         /******************/
3151         /* Function: 0x66 */
3152         typedef struct {
3153                 GUID core_driver_guid;
3154                 NTTIME driver_date;
3155                 hyper driver_version;
3156                 [charset(UTF8)] uint8 formname[520];
3157         } spoolss_CorePrinterDriver;
3158
3159         WERROR spoolss_GetCorePrinterDrivers(
3160                 [in,unique] [string,charset(UTF16)] uint16 *servername,
3161                 [in,ref] [string,charset(UTF16)] uint16 *architecture,
3162                 [in] uint32 core_driver_size,
3163                 [in,size_is(core_driver_size)] [charset(UTF16)] uint16 *core_driver_dependencies,
3164                 [in] uint32 core_printer_driver_count,
3165                 [out,size_is(core_printer_driver_count)] spoolss_CorePrinterDriver *core_printer_drivers
3166         );
3167
3168         /******************/
3169         /* Function: 0x67 */
3170         [todo] WERROR spoolss_67(
3171         );
3172
3173         /******************/
3174         /* Function: 0x68 */
3175         WERROR spoolss_GetPrinterDriverPackagePath(
3176                 [in,unique] [string,charset(UTF16)] uint16 *servername,
3177                 [in,ref] [string,charset(UTF16)] uint16 *architecture,
3178                 [in,unique] [string,charset(UTF16)] uint16 *language,
3179                 [in,ref] [string,charset(UTF16)] uint16 *package_id,
3180                 [in,out,unique,size_is(driver_package_cab_size)] [charset(UTF16)] uint16 *driver_package_cab,
3181                 [in] uint32 driver_package_cab_size,
3182                 [out,ref] uint32 *required
3183                 );
3184
3185         /******************/
3186         /* Function: 0x69 */
3187         [todo] WERROR spoolss_69(
3188         );
3189
3190         /******************/
3191         /* Function: 0x6a */
3192         [todo] WERROR spoolss_6a(
3193         );
3194
3195         /******************/
3196         /* Function: 0x6b */
3197         [todo] WERROR spoolss_6b(
3198         );
3199
3200         /******************/
3201         /* Function: 0x6c */
3202         [todo] WERROR spoolss_6c(
3203         );
3204
3205         /******************/
3206         /* Function: 0x6d */
3207         [todo] WERROR spoolss_6d(
3208         );
3209 }