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